Fix unnecessary shift with 9/10bit vertical scaling

Signed-off-by: Diego Biurrun <diego@biurrun.de>
This commit is contained in:
Kieran Kunhya 2011-09-22 18:21:05 -05:00 committed by Diego Biurrun
parent 5cc2530fc2
commit 4d4d0e8176
4 changed files with 19 additions and 19 deletions

View File

@ -267,7 +267,7 @@ yuv2yuvX10_c_template(const int16_t *lumFilter, const int16_t **lumSrc,
int i;
uint16_t *yDest = dest[0], *uDest = dest[1], *vDest = dest[2],
*aDest = CONFIG_SWSCALE_ALPHA ? dest[3] : NULL;
int shift = 11 + 16 - output_bits - 1;
int shift = 11 + 16 - output_bits;
#define output_pixel(pos, val) \
if (big_endian) { \
@ -276,24 +276,24 @@ yuv2yuvX10_c_template(const int16_t *lumFilter, const int16_t **lumSrc,
AV_WL16(pos, av_clip_uintp2(val >> shift, output_bits)); \
}
for (i = 0; i < dstW; i++) {
int val = 1 << (26-output_bits - 1);
int val = 1 << (26-output_bits);
int j;
for (j = 0; j < lumFilterSize; j++)
val += (lumSrc[j][i] * lumFilter[j]) >> 1;
val += lumSrc[j][i] * lumFilter[j];
output_pixel(&yDest[i], val);
}
if (uDest) {
for (i = 0; i < chrDstW; i++) {
int u = 1 << (26-output_bits - 1);
int v = 1 << (26-output_bits - 1);
int u = 1 << (26-output_bits);
int v = 1 << (26-output_bits);
int j;
for (j = 0; j < chrFilterSize; j++) {
u += (chrUSrc[j][i] * chrFilter[j]) >> 1;
v += (chrVSrc[j][i] * chrFilter[j]) >> 1;
u += chrUSrc[j][i] * chrFilter[j];
v += chrVSrc[j][i] * chrFilter[j];
}
output_pixel(&uDest[i], u);
@ -303,11 +303,11 @@ yuv2yuvX10_c_template(const int16_t *lumFilter, const int16_t **lumSrc,
if (CONFIG_SWSCALE_ALPHA && aDest) {
for (i = 0; i < dstW; i++) {
int val = 1 << (26-output_bits - 1);
int val = 1 << (26-output_bits);
int j;
for (j = 0; j < lumFilterSize; j++)
val += (alpSrc[j][i] * lumFilter[j]) >> 1;
val += alpSrc[j][i] * lumFilter[j];
output_pixel(&aDest[i], val);
}

View File

@ -31,15 +31,15 @@ uyvy422 314bd486277111a95d9369b944fa0400
yuv410p 7df8f6d69b56a8dcb6c7ee908e5018b5
yuv411p 1143e7c5cc28fe0922b051b17733bc4c
yuv420p fdad2d8df8985e3d17e73c71f713cb14
yuv420p10be d7695b9117d5b52819c569459e42669b
yuv420p10le 0ac6d448db2df5f3d1346aa81f2b5f50
yuv420p10be c143e77e97d2f7d62c3b518857ba9f9b
yuv420p10le 72d90eccf5c34691ff057dafb7447aa2
yuv420p16be 9688e33e03b8c8275ab2fb1df0f06bee
yuv420p16le cba8b390ad5e7b8678e419b8ce79c008
yuv420p9be 8fa6e007b1a40f34eaa3e2beb73ea8af
yuv420p9le a7b131a7dd06906a5aef2e36d117b972
yuv420p9be bb87fddca65d1742412c8d2b1caf96c6
yuv420p9le 828eec50014a41258a5423c1fe56ac97
yuv422p 918e37701ee7377d16a8a6c119c56a40
yuv422p10be 35206fcd7e00ee582a8c366b37d57d1d
yuv422p10le 396f930e2da02f149ab9dd5b781cbe8d
yuv422p10be cea7ca6b0e66d6f29539885896c88603
yuv422p10le a10c4a5837547716f13cd61918b145f9
yuv422p16be 285993ee0c0f4f8e511ee46f93c5f38c
yuv422p16le 61bfcee8e54465f760164f5a75d40b5e
yuv440p 461503fdb9b90451020aa3b25ddf041c

View File

@ -1,4 +1,4 @@
cb29b6ae4e1562d95f9311991fef98df *./tests/data/vsynth1/dnxhd-720p-10bit.dnxhd
b5e24a055af02edec8674333260214fd *./tests/data/vsynth1/dnxhd-720p-10bit.dnxhd
2293760 ./tests/data/vsynth1/dnxhd-720p-10bit.dnxhd
2f45bb1af7da5dd3dca870ac87237b7d *./tests/data/dnxhd_720p_10bit.vsynth1.out.yuv
4466ff3d73d01bbe75ea25001d379b63 *./tests/data/dnxhd_720p_10bit.vsynth1.out.yuv
stddev: 6.27 PSNR: 32.18 MAXDIFF: 64 bytes: 760320/ 7603200

View File

@ -1,4 +1,4 @@
8648511257afb816b5b911706ca391db *./tests/data/vsynth2/dnxhd-720p-10bit.dnxhd
4b57da2c0c1280469ff3579f7151c227 *./tests/data/vsynth2/dnxhd-720p-10bit.dnxhd
2293760 ./tests/data/vsynth2/dnxhd-720p-10bit.dnxhd
391b6f5aa7c7b488b479cb43d420b860 *./tests/data/dnxhd_720p_10bit.vsynth2.out.yuv
31a6aa8b8702e85fa3b48e73f035c4e4 *./tests/data/dnxhd_720p_10bit.vsynth2.out.yuv
stddev: 1.35 PSNR: 45.46 MAXDIFF: 23 bytes: 760320/ 7603200