diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-28 21:29:03 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-28 21:30:26 +0100 |
commit | a1ca45317df0993e98b4e3aec9ebdae64449478b (patch) | |
tree | 05be54be1e025f00231f36b9e5238012aaf2c9dc /libavcodec | |
parent | d46bc4133c104188dd6719365605e42bd1b5e2ff (diff) | |
download | ffmpeg-a1ca45317df0993e98b4e3aec9ebdae64449478b.tar.gz |
cljrenc: fix scaling
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/cljr.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c index 2b0142b979..daa13e534a 100644 --- a/libavcodec/cljr.c +++ b/libavcodec/cljr.c @@ -161,13 +161,13 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, case 1: dither = dither * 1664525 + 1013904223; break; case 2: dither = ordered_dither[ y&1 ][ (x>>2)&1 ];break; } - put_bits(&pb, 5, (luma[3] + (dither>>29) ) >> 3); - put_bits(&pb, 5, (luma[2] + ((dither>>26)&7)) >> 3); - put_bits(&pb, 5, (luma[1] + ((dither>>23)&7)) >> 3); - put_bits(&pb, 5, (luma[0] + ((dither>>20)&7)) >> 3); + put_bits(&pb, 5, (249*(luma[3] + (dither>>29) )) >> 11); + put_bits(&pb, 5, (249*(luma[2] + ((dither>>26)&7))) >> 11); + put_bits(&pb, 5, (249*(luma[1] + ((dither>>23)&7))) >> 11); + put_bits(&pb, 5, (249*(luma[0] + ((dither>>20)&7))) >> 11); luma += 4; - put_bits(&pb, 6, (*(cb++) + ((dither>>18)&3)) >> 2); - put_bits(&pb, 6, (*(cr++) + ((dither>>16)&3)) >> 2); + put_bits(&pb, 6, (253*(*(cb++) + ((dither>>18)&3))) >> 10); + put_bits(&pb, 6, (253*(*(cr++) + ((dither>>16)&3))) >> 10); } } |