summaryrefslogtreecommitdiff
path: root/libavcodec/ffv1dec.c
diff options
context:
space:
mode:
authorJérôme Martinez <jerome@mediaarea.net>2018-02-01 13:11:53 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-02-06 23:07:10 +0100
commit698d5eb5bf83d1afbff3e74bb25a6d486b6bf7e8 (patch)
treea7d623a9ca6762b0627dcaed0a5487adfd98760d /libavcodec/ffv1dec.c
parent204c7caf0d77bdfd73196ffee00695222d0ff2cb (diff)
avcodec/ffv1: Support for RGBA64 and GBRAP16
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/ffv1dec.c')
-rw-r--r--libavcodec/ffv1dec.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 5eadb6b158..923b79f3ab 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -336,14 +336,16 @@ static int decode_slice(AVCodecContext *c, void *arg)
decode_plane(fs, p->data[0] + ps*x + y*p->linesize[0] , width, height, p->linesize[0], 0, 2);
decode_plane(fs, p->data[0] + ps*x + y*p->linesize[0] + 1, width, height, p->linesize[0], 1, 2);
} else if (f->use32bit) {
- uint8_t *planes[3] = { p->data[0] + ps * x + y * p->linesize[0],
+ uint8_t *planes[4] = { p->data[0] + ps * x + y * p->linesize[0],
p->data[1] + ps * x + y * p->linesize[1],
- p->data[2] + ps * x + y * p->linesize[2] };
+ p->data[2] + ps * x + y * p->linesize[2],
+ p->data[3] + ps * x + y * p->linesize[3] };
decode_rgb_frame32(fs, planes, width, height, p->linesize);
} else {
- uint8_t *planes[3] = { p->data[0] + ps * x + y * p->linesize[0],
+ uint8_t *planes[4] = { p->data[0] + ps * x + y * p->linesize[0],
p->data[1] + ps * x + y * p->linesize[1],
- p->data[2] + ps * x + y * p->linesize[2] };
+ p->data[2] + ps * x + y * p->linesize[2],
+ p->data[3] + ps * x + y * p->linesize[3] };
decode_rgb_frame(fs, planes, width, height, p->linesize);
}
if (fs->ac != AC_GOLOMB_RICE && f->version > 2) {
@@ -694,6 +696,10 @@ static int read_header(FFV1Context *f)
f->avctx->pix_fmt = AV_PIX_FMT_GBRP16;
f->use32bit = 1;
}
+ else if (f->avctx->bits_per_raw_sample == 16 && f->transparency) {
+ f->avctx->pix_fmt = AV_PIX_FMT_GBRAP16;
+ f->use32bit = 1;
+ }
} else {
av_log(f->avctx, AV_LOG_ERROR, "colorspace not supported\n");
return AVERROR(ENOSYS);