diff options
author | Kieran Kunhya <kierank@ob-encoder.com> | 2011-09-23 03:21:05 +0400 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2011-09-23 04:13:30 +0400 |
commit | 4d4d0e817607bce2a3a0806540f19d5d2b3b9376 (patch) | |
tree | 818201efcbb473f9b7e48072d9bcfdb1301ce964 /libswscale | |
parent | 5cc2530fc24bc2acddeb03687a9efa5ca8fb02f0 (diff) |
Fix unnecessary shift with 9/10bit vertical scaling
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/swscale.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 733f57b049..5d90250acf 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -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); } |