summaryrefslogtreecommitdiff
path: root/libswscale/output.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2014-12-17 14:54:43 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-01-14 17:17:24 +0100
commit928061670e873e816daa14827853b7e11221ff5f (patch)
tree51cd09582027961f2d281aa2c262a4db01c0e8cb /libswscale/output.c
parent9a4aaae3b29392b6d74997e06be249d7d54a7394 (diff)
libswscale: GBRAP input & output and GBRAP16 input support
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libswscale/output.c')
-rw-r--r--libswscale/output.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libswscale/output.c b/libswscale/output.c
index 125d998836..1670f4a2b9 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -1277,7 +1277,7 @@ yuv2gbrp_full_X_c(SwsContext *c, const int16_t *lumFilter,
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->dstFormat);
int i;
- int hasAlpha = 0;
+ int hasAlpha = (desc->flags & AV_PIX_FMT_FLAG_ALPHA) && alpSrc;
uint16_t **dest16 = (uint16_t**)dest;
int SH = 22 + 7 - desc->comp[0].depth_minus1;
@@ -1329,10 +1329,14 @@ yuv2gbrp_full_X_c(SwsContext *c, const int16_t *lumFilter,
dest16[0][i] = G >> SH;
dest16[1][i] = B >> SH;
dest16[2][i] = R >> SH;
+ if (hasAlpha)
+ dest16[3][i] = A;
} else {
dest[0][i] = G >> 22;
dest[1][i] = B >> 22;
dest[2][i] = R >> 22;
+ if (hasAlpha)
+ dest[3][i] = A;
}
}
if (SH != 22 && (!isBE(c->dstFormat)) != (!HAVE_BIGENDIAN)) {
@@ -1340,6 +1344,8 @@ yuv2gbrp_full_X_c(SwsContext *c, const int16_t *lumFilter,
dest16[0][i] = av_bswap16(dest16[0][i]);
dest16[1][i] = av_bswap16(dest16[1][i]);
dest16[2][i] = av_bswap16(dest16[2][i]);
+ if (hasAlpha)
+ dest16[3][i] = av_bswap16(dest16[3][i]);
}
}
}
@@ -1445,6 +1451,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
case AV_PIX_FMT_GBRP10LE:
case AV_PIX_FMT_GBRP16BE:
case AV_PIX_FMT_GBRP16LE:
+ case AV_PIX_FMT_GBRAP:
*yuv2anyX = yuv2gbrp_full_X_c;
break;
}