diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2012-04-05 17:30:19 -0700 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2012-04-13 14:21:58 -0700 |
commit | 9206ac80a5c3256738b887cf3cfe39f385ebc672 (patch) | |
tree | b01bf45999876db77b1fe0b69ddfa407388ff086 | |
parent | f5be7958e313f3f62505ea7f90007800e8e1dcb5 (diff) | |
download | ffmpeg-9206ac80a5c3256738b887cf3cfe39f385ebc672.tar.gz |
swscale: handle last pixel if lines have an odd width.
Fixes bug 270.
-rw-r--r-- | libswscale/output.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libswscale/output.c b/libswscale/output.c index f1acf9ec92..5bc25fc35a 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -466,7 +466,7 @@ yuv2422_X_c_template(SwsContext *c, const int16_t *lumFilter, { int i; - for (i = 0; i < (dstW >> 1); i++) { + for (i = 0; i < ((dstW + 1) >> 1); i++) { int j; int Y1 = 1 << 18; int Y2 = 1 << 18; @@ -509,7 +509,7 @@ yuv2422_2_c_template(SwsContext *c, const int16_t *buf[2], int uvalpha1 = 4095 - uvalpha; int i; - for (i = 0; i < (dstW >> 1); i++) { + for (i = 0; i < ((dstW + 1) >> 1); i++) { int Y1 = (buf0[i * 2] * yalpha1 + buf1[i * 2] * yalpha) >> 19; int Y2 = (buf0[i * 2 + 1] * yalpha1 + buf1[i * 2 + 1] * yalpha) >> 19; int U = (ubuf0[i] * uvalpha1 + ubuf1[i] * uvalpha) >> 19; @@ -534,7 +534,7 @@ yuv2422_1_c_template(SwsContext *c, const int16_t *buf0, int i; if (uvalpha < 2048) { - for (i = 0; i < (dstW >> 1); i++) { + for (i = 0; i < ((dstW + 1) >> 1); i++) { int Y1 = buf0[i * 2] >> 7; int Y2 = buf0[i * 2 + 1] >> 7; int U = ubuf0[i] >> 7; @@ -549,7 +549,7 @@ yuv2422_1_c_template(SwsContext *c, const int16_t *buf0, } } else { const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1]; - for (i = 0; i < (dstW >> 1); i++) { + for (i = 0; i < ((dstW + 1) >> 1); i++) { int Y1 = buf0[i * 2] >> 7; int Y2 = buf0[i * 2 + 1] >> 7; int U = (ubuf0[i] + ubuf1[i]) >> 8; @@ -589,7 +589,7 @@ yuv2rgb48_X_c_template(SwsContext *c, const int16_t *lumFilter, { int i; - for (i = 0; i < (dstW >> 1); i++) { + for (i = 0; i < ((dstW + 1) >> 1); i++) { int j; int Y1 = -0x40000000; int Y2 = -0x40000000; @@ -652,7 +652,7 @@ yuv2rgb48_2_c_template(SwsContext *c, const int32_t *buf[2], int uvalpha1 = 4095 - uvalpha; int i; - for (i = 0; i < (dstW >> 1); i++) { + for (i = 0; i < ((dstW + 1) >> 1); i++) { int Y1 = (buf0[i * 2] * yalpha1 + buf1[i * 2] * yalpha) >> 14; int Y2 = (buf0[i * 2 + 1] * yalpha1 + buf1[i * 2 + 1] * yalpha) >> 14; int U = (ubuf0[i] * uvalpha1 + ubuf1[i] * uvalpha + (-128 << 23)) >> 14; @@ -690,7 +690,7 @@ yuv2rgb48_1_c_template(SwsContext *c, const int32_t *buf0, int i; if (uvalpha < 2048) { - for (i = 0; i < (dstW >> 1); i++) { + for (i = 0; i < ((dstW + 1) >> 1); i++) { int Y1 = (buf0[i * 2] ) >> 2; int Y2 = (buf0[i * 2 + 1]) >> 2; int U = (ubuf0[i] + (-128 << 11)) >> 2; @@ -718,7 +718,7 @@ yuv2rgb48_1_c_template(SwsContext *c, const int32_t *buf0, } } else { const int32_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1]; - for (i = 0; i < (dstW >> 1); i++) { + for (i = 0; i < ((dstW + 1) >> 1); i++) { int Y1 = (buf0[i * 2] ) >> 2; int Y2 = (buf0[i * 2 + 1]) >> 2; int U = (ubuf0[i] + ubuf1[i] + (-128 << 12)) >> 3; @@ -932,7 +932,7 @@ yuv2rgb_X_c_template(SwsContext *c, const int16_t *lumFilter, { int i; - for (i = 0; i < (dstW >> 1); i++) { + for (i = 0; i < ((dstW + 1) >> 1); i++) { int j, A1, A2; int Y1 = 1 << 18; int Y2 = 1 << 18; @@ -999,7 +999,7 @@ yuv2rgb_2_c_template(SwsContext *c, const int16_t *buf[2], int uvalpha1 = 4095 - uvalpha; int i; - for (i = 0; i < (dstW >> 1); i++) { + for (i = 0; i < ((dstW + 1) >> 1); i++) { int Y1 = (buf0[i * 2] * yalpha1 + buf1[i * 2] * yalpha) >> 19; int Y2 = (buf0[i * 2 + 1] * yalpha1 + buf1[i * 2 + 1] * yalpha) >> 19; int U = (ubuf0[i] * uvalpha1 + ubuf1[i] * uvalpha) >> 19; @@ -1037,7 +1037,7 @@ yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0, int i; if (uvalpha < 2048) { - for (i = 0; i < (dstW >> 1); i++) { + for (i = 0; i < ((dstW + 1) >> 1); i++) { int Y1 = buf0[i * 2] >> 7; int Y2 = buf0[i * 2 + 1] >> 7; int U = ubuf0[i] >> 7; @@ -1064,7 +1064,7 @@ yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0, } } else { const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1]; - for (i = 0; i < (dstW >> 1); i++) { + for (i = 0; i < ((dstW + 1) >> 1); i++) { int Y1 = buf0[i * 2] >> 7; int Y2 = buf0[i * 2 + 1] >> 7; int U = (ubuf0[i] + ubuf1[i]) >> 8; |