summaryrefslogtreecommitdiff
path: root/libswscale/output.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-15 18:59:59 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-18 01:20:30 +0200
commit5918b7ac4116a8d579269f0186f8dc78ed34d6df (patch)
treec599cf9c6ccd9b562782e6e853e0c5945c9920f9 /libswscale/output.c
parent6c593f1b671b7725b8c36f92f7c0a23ccf8e7628 (diff)
downloadffmpeg-5918b7ac4116a8d579269f0186f8dc78ed34d6df.tar.gz
sws/output: init A1/A2 so that rgba64 ends with 0xffff in the absence of alpha input
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/output.c')
-rw-r--r--libswscale/output.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libswscale/output.c b/libswscale/output.c
index 9c7284befe..c9af23b67e 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -682,9 +682,10 @@ yuv2rgba64_X_c_template(SwsContext *c, const int16_t *lumFilter,
int y, enum AVPixelFormat target, int hasAlpha)
{
int i;
+ int A1 = 0xffff<<14, A2 = 0xffff<<14;
for (i = 0; i < ((dstW + 1) >> 1); i++) {
- int j, A1 = 0, A2 = 0;
+ int j;
int Y1 = -0x40000000;
int Y2 = -0x40000000;
int U = -128 << 23; // 19
@@ -762,7 +763,7 @@ yuv2rgba64_2_c_template(SwsContext *c, const int32_t *buf[2],
int yalpha1 = 4096 - yalpha;
int uvalpha1 = 4096 - uvalpha;
int i;
- int A1 = 0, A2 = 0; // Init to avoid compiler warnings
+ int A1 = 0xffff<<14, A2 = 0xffff<<14;
for (i = 0; i < ((dstW + 1) >> 1); i++) {
int Y1 = (buf0[i * 2] * yalpha1 + buf1[i * 2] * yalpha) >> 14;
@@ -810,6 +811,7 @@ yuv2rgba64_1_c_template(SwsContext *c, const int32_t *buf0,
{
const int32_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
int i;
+ int A1 = 0xffff<<14, A2= 0xffff<<14;
if (uvalpha < 2048) {
for (i = 0; i < ((dstW + 1) >> 1); i++) {
@@ -818,7 +820,6 @@ yuv2rgba64_1_c_template(SwsContext *c, const int32_t *buf0,
int U = (ubuf0[i] + (-128 << 11)) >> 2;
int V = (vbuf0[i] + (-128 << 11)) >> 2;
int R, G, B;
- int A1, A2;
Y1 -= c->yuv2rgb_y_offset;
Y2 -= c->yuv2rgb_y_offset;
@@ -851,13 +852,13 @@ yuv2rgba64_1_c_template(SwsContext *c, const int32_t *buf0,
}
} else {
const int32_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
+ int A1 = 0xffff<<14, A2 = 0xffff<<14;
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;
int V = (vbuf0[i] + vbuf1[i] + (-128 << 12)) >> 3;
int R, G, B;
- int A1, A2;
Y1 -= c->yuv2rgb_y_offset;
Y2 -= c->yuv2rgb_y_offset;