diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-28 21:29:03 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-03 17:20:31 +0100 |
commit | b9e09c9eab3f1fdbc93043908a23092c8a691491 (patch) | |
tree | 0f19a893c919746805c1d2d6a8030544cad384fc | |
parent | dfdf616773c3f9a1b610978f120f811cf0bd581a (diff) | |
download | ffmpeg-b9e09c9eab3f1fdbc93043908a23092c8a691491.tar.gz |
cljrenc: fix scaling
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a1ca45317df0993e98b4e3aec9ebdae64449478b)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/cljr.c | 12 | ||||
-rw-r--r-- | tests/ref/vsynth1/cljr | 6 | ||||
-rw-r--r-- | tests/ref/vsynth2/cljr | 6 |
3 files changed, 12 insertions, 12 deletions
diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c index 7ae3e7eeeb..0d87f3d7e5 100644 --- a/libavcodec/cljr.c +++ b/libavcodec/cljr.c @@ -156,13 +156,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); } } diff --git a/tests/ref/vsynth1/cljr b/tests/ref/vsynth1/cljr index 9a7a980b41..181f32f829 100644 --- a/tests/ref/vsynth1/cljr +++ b/tests/ref/vsynth1/cljr @@ -1,4 +1,4 @@ -ff4eebcd5bd7b6470f97867cdecb0bec *./tests/data/vsynth1/cljr.avi +041982e4fa83428c621a127647d47b3f *./tests/data/vsynth1/cljr.avi 5075660 ./tests/data/vsynth1/cljr.avi -0d473eb49653a05685178dd261de861c *./tests/data/cljr.vsynth1.out.yuv -stddev: 30.70 PSNR: 18.39 MAXDIFF: 255 bytes: 7603200/ 7603200 +f5173ae479fc104903b203260cadf507 *./tests/data/cljr.vsynth1.out.yuv +stddev: 30.71 PSNR: 18.38 MAXDIFF: 225 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth2/cljr b/tests/ref/vsynth2/cljr index cf3c8e1abf..4a69a4c46e 100644 --- a/tests/ref/vsynth2/cljr +++ b/tests/ref/vsynth2/cljr @@ -1,4 +1,4 @@ -8ca3f24da468f32561100d3a1a71348d *./tests/data/vsynth2/cljr.avi +fdc1926e0a599de94513f0a3472b598f *./tests/data/vsynth2/cljr.avi 5075660 ./tests/data/vsynth2/cljr.avi -a0126ba9f2b2192b6b63b485e0118114 *./tests/data/cljr.vsynth2.out.yuv -stddev: 10.26 PSNR: 27.90 MAXDIFF: 62 bytes: 7603200/ 7603200 +3db163e55149786e7cf5499b3387bdb1 *./tests/data/cljr.vsynth2.out.yuv +stddev: 10.80 PSNR: 27.46 MAXDIFF: 65 bytes: 7603200/ 7603200 |