[FFmpeg-cvslog] get_dc: fix rounding

Michael Niedermayer git at videolan.org
Mon Nov 26 21:42:30 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Nov 26 21:26:24 2012 +0100| [109268c826aeb5fd52792c4ead8d56981868b518] | committer: Michael Niedermayer

get_dc: fix rounding

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=109268c826aeb5fd52792c4ead8d56981868b518
---

 libavcodec/snowenc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index cbdf978..23d8d81 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -626,7 +626,7 @@ static int get_dc(SnowContext *s, int mb_x, int mb_y, int plane_index){
     }
     *b= backup;
 
-    return av_clip(((ab<<LOG2_OBMC_MAX) + aa/2)/aa, 0, 255); //FIXME we should not need clipping
+    return av_clip( ROUNDED_DIV(ab<<LOG2_OBMC_MAX, aa), 0, 255); //FIXME we should not need clipping
 }
 
 static inline int get_block_bits(SnowContext *s, int x, int y, int w){



More information about the ffmpeg-cvslog mailing list