[FFmpeg-cvslog] lavc/dpx: Support decoding 10 bit colourspace with transparency information.
Carl Eugen Hoyos
git at videolan.org
Tue Jun 14 17:03:45 CEST 2016
ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Tue Jun 14 17:02:34 2016 +0200| [d5ded429f25cf245f37556ec3076cade9d1fb67f] | committer: Carl Eugen Hoyos
lavc/dpx: Support decoding 10 bit colourspace with transparency information.
Fixes one sample from ticket #5639.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d5ded429f25cf245f37556ec3076cade9d1fb67f
---
libavcodec/dpx.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index af7276a..b439e10 100644
--- a/libavcodec/dpx.c
+++ b/libavcodec/dpx.c
@@ -256,11 +256,13 @@ static int decode_frame(AVCodecContext *avctx,
avctx->pix_fmt = AV_PIX_FMT_RGBA;
break;
case 50100:
- case 51100:
case 50101:
- case 51101:
avctx->pix_fmt = AV_PIX_FMT_GBRP10;
break;
+ case 51100:
+ case 51101:
+ avctx->pix_fmt = AV_PIX_FMT_GBRAP10;
+ break;
case 50120:
case 51120:
case 50121:
@@ -313,9 +315,10 @@ static int decode_frame(AVCodecContext *avctx,
switch (bits_per_color) {
case 10:
for (x = 0; x < avctx->height; x++) {
- uint16_t *dst[3] = {(uint16_t*)ptr[0],
+ uint16_t *dst[4] = {(uint16_t*)ptr[0],
(uint16_t*)ptr[1],
- (uint16_t*)ptr[2]};
+ (uint16_t*)ptr[2],
+ (uint16_t*)ptr[3]};
for (y = 0; y < avctx->width; y++) {
*dst[2]++ = read10in32(&buf, &rgbBuffer,
&n_datum, endian);
@@ -323,13 +326,13 @@ static int decode_frame(AVCodecContext *avctx,
&n_datum, endian);
*dst[1]++ = read10in32(&buf, &rgbBuffer,
&n_datum, endian);
- // For 10 bit, ignore alpha
if (elements == 4)
+ *dst[3]++ =
read10in32(&buf, &rgbBuffer,
&n_datum, endian);
}
n_datum = 0;
- for (i = 0; i < 3; i++)
+ for (i = 0; i < elements; i++)
ptr[i] += p->linesize[i];
}
break;
More information about the ffmpeg-cvslog
mailing list