aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-28 21:29:03 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-28 21:30:26 +0100
commita1ca45317df0993e98b4e3aec9ebdae64449478b (patch)
tree05be54be1e025f00231f36b9e5238012aaf2c9dc
parentd46bc4133c104188dd6719365605e42bd1b5e2ff (diff)
downloadffmpeg-a1ca45317df0993e98b4e3aec9ebdae64449478b.tar.gz
cljrenc: fix scaling
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/cljr.c12
-rw-r--r--tests/ref/vsynth1/cljr6
-rw-r--r--tests/ref/vsynth2/cljr6
3 files changed, 12 insertions, 12 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);
}
}
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