[FFmpeg-devel] [PATCH 2/3] cljrenc: Fix rounding in undithered case

Michael Niedermayer michaelni at gmx.at
Fri Dec 9 06:09:51 CET 2011


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavcodec/cljr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c
index 2c3cf1e..ea95901 100644
--- a/libavcodec/cljr.c
+++ b/libavcodec/cljr.c
@@ -149,7 +149,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf,
         uint8_t *cr   = &p->data[2][y * p->linesize[2]];
         for (x = 0; x < avctx->width; x += 4) {
             switch(a->dither_type){
-                case 0: dither = 0;                                break;
+                case 0: dither = 0x492A0000;                       break;
                 case 1: dither = dither*1664525+1013904223;        break;
             }
             put_bits(&pb, 5, (luma[3] +  (dither>>29)   ) >> 3);
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list