Commit d7a3bb20 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/ffv1dec: Support gray 10/12/16 explicitly avoid shifts

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 50e0e96f
...@@ -575,8 +575,19 @@ static int read_header(FFV1Context *f) ...@@ -575,8 +575,19 @@ static int read_header(FFV1Context *f)
if (!f->transparency && !f->chroma_planes) { if (!f->transparency && !f->chroma_planes) {
if (f->avctx->bits_per_raw_sample <= 8) if (f->avctx->bits_per_raw_sample <= 8)
f->avctx->pix_fmt = AV_PIX_FMT_GRAY8; 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; f->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
} else
return AVERROR(ENOSYS);
} else if (f->transparency && !f->chroma_planes) { } else if (f->transparency && !f->chroma_planes) {
if (f->avctx->bits_per_raw_sample <= 8) if (f->avctx->bits_per_raw_sample <= 8)
f->avctx->pix_fmt = AV_PIX_FMT_YA8; f->avctx->pix_fmt = AV_PIX_FMT_YA8;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment