cljrenc: fix scaling

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-12-28 21:29:03 +01:00
parent d46bc4133c
commit a1ca45317d
3 changed files with 12 additions and 12 deletions

View File

@ -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);
}
}

View File

@ -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

View File

@ -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