diff options
author | Ronald S. Bultje | 2011-06-29 21:04:45 -0700 |
---|---|---|
committer | Michael Niedermayer | 2011-07-01 03:07:18 +0200 |
commit | ebb0d6035394eaeddc346173e7c0a314fe568fd9 (patch) | |
tree | 47bd4a646bef6407ddd02da6c35ddad1940c7635 /libswscale | |
parent | 45f6ffe5e948f3ed2f136404f8386b03b150b702 (diff) |
swscale: fix yuv range correction when using 16-bit scaling.
(cherry picked from commit e0b8fff6c7a293e35079ba1931bd19372686b3f6)
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/swscale.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 987afff2d2..644f84858c 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1982,8 +1982,8 @@ static void chrRangeToJpeg16_c(int16_t *_dstU, int16_t *_dstV, int width) int32_t *dstU = (int32_t *) _dstU; int32_t *dstV = (int32_t *) _dstV; for (i = 0; i < width; i++) { - dstU[i] = (FFMIN(dstU[i],30775)*4663 - 9289992)>>12; //-264 - dstV[i] = (FFMIN(dstV[i],30775)*4663 - 9289992)>>12; //-264 + dstU[i] = (FFMIN(dstU[i],30775<<4)*4663 - (9289992<<4))>>12; //-264 + dstV[i] = (FFMIN(dstV[i],30775<<4)*4663 - (9289992<<4))>>12; //-264 } } static void chrRangeFromJpeg16_c(int16_t *_dstU, int16_t *_dstV, int width) @@ -1992,8 +1992,8 @@ static void chrRangeFromJpeg16_c(int16_t *_dstU, int16_t *_dstV, int width) int32_t *dstU = (int32_t *) _dstU; int32_t *dstV = (int32_t *) _dstV; for (i = 0; i < width; i++) { - dstU[i] = (dstU[i]*1799 + 4081085)>>11; //1469 - dstV[i] = (dstV[i]*1799 + 4081085)>>11; //1469 + dstU[i] = (dstU[i]*1799 + (4081085<<4))>>11; //1469 + dstV[i] = (dstV[i]*1799 + (4081085<<4))>>11; //1469 } } static void lumRangeToJpeg16_c(int16_t *_dst, int width) @@ -2001,14 +2001,14 @@ static void lumRangeToJpeg16_c(int16_t *_dst, int width) int i; int32_t *dst = (int32_t *) _dst; for (i = 0; i < width; i++) - dst[i] = (FFMIN(dst[i],30189)*19077 - 39057361)>>14; + dst[i] = (FFMIN(dst[i],30189<<4)*19077 - (39057361<<4))>>14; } static void lumRangeFromJpeg16_c(int16_t *_dst, int width) { int i; int32_t *dst = (int32_t *) _dst; for (i = 0; i < width; i++) - dst[i] = (dst[i]*14071 + 33561947)>>14; + dst[i] = (dst[i]*14071 + (33561947<<4))>>14; } static void hyscale_fast_c(SwsContext *c, int16_t *dst, int dstWidth, |