diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-08-08 00:00:46 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-08-08 00:32:09 +0200 |
commit | ce2217b25eccda9f5c14022bd69792e71b417b73 (patch) | |
tree | 7ea358b77eb60739b9ec153bcc74b0408e8ab575 /libavcodec/ffv1dec.c | |
parent | 74314f1f5f9ef69700eb18b85a8260e2754a31ef (diff) | |
download | ffmpeg-ce2217b25eccda9f5c14022bd69792e71b417b73.tar.gz |
avcodec/ffv1: add AV_PIX_FMT_GBRP16 support
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/ffv1dec.c')
-rw-r--r-- | libavcodec/ffv1dec.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index e8b726cc7e..d8f35c34b9 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -103,6 +103,9 @@ static inline int get_vlc_symbol(GetBitContext *gb, VlcState *const state, #undef TYPE #undef RENAME +#define TYPE int32_t +#define RENAME(name) name ## 32 +#include "ffv1dec_template.c" static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index, @@ -318,6 +321,11 @@ static int decode_slice(AVCodecContext *c, void *arg) } else if (f->colorspace == 0) { 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], + p->data[1] + ps * x + y * p->linesize[1], + p->data[2] + ps * x + y * p->linesize[2] }; + decode_rgb_frame32(fs, planes, width, height, p->linesize); } else { uint8_t *planes[3] = { p->data[0] + ps * x + y * p->linesize[0], p->data[1] + ps * x + y * p->linesize[1], @@ -648,6 +656,10 @@ static int read_header(FFV1Context *f) f->avctx->pix_fmt = AV_PIX_FMT_GBRP12; else if (f->avctx->bits_per_raw_sample == 14 && !f->transparency) f->avctx->pix_fmt = AV_PIX_FMT_GBRP14; + else if (f->avctx->bits_per_raw_sample == 16 && !f->transparency) { + f->avctx->pix_fmt = AV_PIX_FMT_GBRP16; + f->use32bit = 1; + } } else { av_log(f->avctx, AV_LOG_ERROR, "colorspace not supported\n"); return AVERROR(ENOSYS); |