summaryrefslogtreecommitdiff
path: root/libavcodec/ffv1dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-11-17 23:21:37 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-11-18 18:04:28 +0100
commitd7a3bb2088679623db70eaa432e7e3563cbd561d (patch)
tree312a80d86c1e631e290ab40915b1d947238dea0d /libavcodec/ffv1dec.c
parent50e0e96f3f8ed57443707289a621446cef0fe367 (diff)
downloadffmpeg-d7a3bb2088679623db70eaa432e7e3563cbd561d.tar.gz
avcodec/ffv1dec: Support gray 10/12/16 explicitly avoid shifts
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/ffv1dec.c')
-rw-r--r--libavcodec/ffv1dec.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 0719e2822d..b5fb825102 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -575,8 +575,19 @@ static int read_header(FFV1Context *f)
if (!f->transparency && !f->chroma_planes) {
if (f->avctx->bits_per_raw_sample <= 8)
f->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
- else
+ else if (f->avctx->bits_per_raw_sample == 10) {
+ f->packed_at_lsb = 1;
+ f->avctx->pix_fmt = AV_PIX_FMT_GRAY10;
+ } else if (f->avctx->bits_per_raw_sample == 12) {
+ f->packed_at_lsb = 1;
+ f->avctx->pix_fmt = AV_PIX_FMT_GRAY12;
+ } else if (f->avctx->bits_per_raw_sample == 16) {
+ f->packed_at_lsb = 1;
+ f->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
+ } else if (f->avctx->bits_per_raw_sample < 16) {
f->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
+ } else
+ return AVERROR(ENOSYS);
} else if (f->transparency && !f->chroma_planes) {
if (f->avctx->bits_per_raw_sample <= 8)
f->avctx->pix_fmt = AV_PIX_FMT_YA8;