diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-05-06 15:13:53 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2013-05-08 12:48:05 +0000 |
commit | 5c057433ccd32f37ddc828d3f82c5b1ad7d3e3db (patch) | |
tree | 8edcb9970d79eda2e8c7da1c1f9d557a9999ea7c /libswscale/output.c | |
parent | 8d9537228f034037e710146291a933f0f4f554be (diff) | |
download | ffmpeg-5c057433ccd32f37ddc828d3f82c5b1ad7d3e3db.tar.gz |
libswscale: GBRAP input & output and GBRAP16 input support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libswscale/output.c')
-rw-r--r-- | libswscale/output.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libswscale/output.c b/libswscale/output.c index da760d2599..9669b4572b 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -1495,7 +1495,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 & PIX_FMT_ALPHA) && alpSrc; uint16_t **dest16 = (uint16_t**)dest; int SH = 22 + 7 - desc->comp[0].depth_minus1; @@ -1547,10 +1547,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)) { @@ -1558,6 +1562,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]); } } } @@ -1722,6 +1728,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, case AV_PIX_FMT_GBRP14LE: case AV_PIX_FMT_GBRP16BE: case AV_PIX_FMT_GBRP16LE: + case AV_PIX_FMT_GBRAP: *yuv2anyX = yuv2gbrp_full_X_c; break; } |