aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-21 20:23:45 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-12 17:10:35 +0100
commitf07e2ff6979380ec7c18de55216bdd92db4856a9 (patch)
tree92ed48a2fe78dd7e2f11a66a9875e14952b47802 /libswscale
parentb62b3e1a25aaf4fe8ad0a46a0ee0f9e361e0187d (diff)
downloadffmpeg-f07e2ff6979380ec7c18de55216bdd92db4856a9.tar.gz
swscale/input: fix rgba64 alpha non native
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit f30798584fd9709e83644f831107fdc9e26b1311) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/input.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/libswscale/input.c b/libswscale/input.c
index 1928223951..7b3b7060e6 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -412,14 +412,24 @@ static void gbr24pToUV_half_c(uint8_t *_dstU, uint8_t *_dstV,
}
}
-static void rgba64ToA_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1,
- const uint8_t *unused2, int width, uint32_t *unused)
+static void rgba64leToA_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1,
+ const uint8_t *unused2, int width, uint32_t *unused)
{
int16_t *dst = (int16_t *)_dst;
const uint16_t *src = (const uint16_t *)_src;
int i;
for (i = 0; i < width; i++)
- dst[i] = src[4 * i + 3];
+ dst[i] = AV_RL16(src + 4 * i + 3);
+}
+
+static void rgba64beToA_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1,
+ const uint8_t *unused2, int width, uint32_t *unused)
+{
+ int16_t *dst = (int16_t *)_dst;
+ const uint16_t *src = (const uint16_t *)_src;
+ int i;
+ for (i = 0; i < width; i++)
+ dst[i] = AV_RB16(src + 4 * i + 3);
}
static void abgrToA_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused)
@@ -1359,9 +1369,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
}
switch (srcFormat) {
case AV_PIX_FMT_BGRA64LE:
+ case AV_PIX_FMT_RGBA64LE: c->alpToYV12 = rgba64leToA_c; break;
case AV_PIX_FMT_BGRA64BE:
- case AV_PIX_FMT_RGBA64LE:
- case AV_PIX_FMT_RGBA64BE: c->alpToYV12 = rgba64ToA_c; break;
+ case AV_PIX_FMT_RGBA64BE: c->alpToYV12 = rgba64beToA_c; break;
case AV_PIX_FMT_BGRA:
case AV_PIX_FMT_RGBA:
c->alpToYV12 = rgbaToA_c;