[FFmpeg-cvslog] avfilter/vf_deshake: fix loss of precission with odd resolutions
Michael Niedermayer
git at videolan.org
Mon Jun 23 18:52:53 CEST 2014
ffmpeg | branch: release/1.2 | Michael Niedermayer <michaelni at gmx.at> | Wed Apr 16 02:06:37 2014 +0200| [8d60d8bef228321a86cc62a9a2e0de975dbe78d7] | committer: Michael Niedermayer
avfilter/vf_deshake: fix loss of precission with odd resolutions
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 73734282e0e4df92269984ee1671424e39249481)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8d60d8bef228321a86cc62a9a2e0de975dbe78d7
---
libavfilter/vf_deshake.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavfilter/vf_deshake.c b/libavfilter/vf_deshake.c
index 26f92f4..f9e42ac 100644
--- a/libavfilter/vf_deshake.c
+++ b/libavfilter/vf_deshake.c
@@ -346,8 +346,8 @@ static void find_motion(DeshakeContext *deshake, uint8_t *src1, uint8_t *src2,
//av_log(NULL, AV_LOG_ERROR, "\n");
}
- p_x = (center_x - width / 2);
- p_y = (center_y - height / 2);
+ p_x = (center_x - width / 2.0);
+ p_y = (center_y - height / 2.0);
t->vector.x += (cos(t->angle)-1)*p_x - sin(t->angle)*p_y;
t->vector.y += sin(t->angle)*p_x + (cos(t->angle)-1)*p_y;
More information about the ffmpeg-cvslog
mailing list