aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ffv1dec.c
diff options
context:
space:
mode:
authorJérôme Martinez <jerome@mediaarea.net>2018-03-07 11:19:03 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-03-10 17:55:50 +0100
commitb6fc09cdb4c4e5e4974ca35159f459174b9a9be5 (patch)
treed1dd81ddd7e60d530246eb1dae468a6ff12ab5ef /libavcodec/ffv1dec.c
parentea6973a5733ce1a6b6359357fd5c1722c2774dce (diff)
downloadffmpeg-b6fc09cdb4c4e5e4974ca35159f459174b9a9be5.tar.gz
avcodec/ffv1: support of more pix_fmt
Without direct support of such pix_fmt, content is padded to 16-bit and it is not possible to know that the source file was with a smaller bit depth so framemd5 is different Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/ffv1dec.c')
-rw-r--r--libavcodec/ffv1dec.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 3d2ee2569f..b4a183c5b7 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -591,7 +591,10 @@ 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 if (f->avctx->bits_per_raw_sample == 10) {
+ else if (f->avctx->bits_per_raw_sample == 9) {
+ f->packed_at_lsb = 1;
+ f->avctx->pix_fmt = AV_PIX_FMT_GRAY9;
+ } 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) {
@@ -642,6 +645,7 @@ static int read_header(FFV1Context *f)
f->packed_at_lsb = 1;
switch(16 * f->chroma_h_shift + f->chroma_v_shift) {
case 0x00: f->avctx->pix_fmt = AV_PIX_FMT_YUV444P10; break;
+ case 0x01: f->avctx->pix_fmt = AV_PIX_FMT_YUV440P10; break;
case 0x10: f->avctx->pix_fmt = AV_PIX_FMT_YUV422P10; break;
case 0x11: f->avctx->pix_fmt = AV_PIX_FMT_YUV420P10; break;
}
@@ -656,9 +660,17 @@ static int read_header(FFV1Context *f)
f->packed_at_lsb = 1;
switch(16 * f->chroma_h_shift + f->chroma_v_shift) {
case 0x00: f->avctx->pix_fmt = AV_PIX_FMT_YUV444P12; break;
+ case 0x01: f->avctx->pix_fmt = AV_PIX_FMT_YUV440P12; break;
case 0x10: f->avctx->pix_fmt = AV_PIX_FMT_YUV422P12; break;
case 0x11: f->avctx->pix_fmt = AV_PIX_FMT_YUV420P12; break;
}
+ } else if (f->avctx->bits_per_raw_sample == 14 && !f->transparency) {
+ f->packed_at_lsb = 1;
+ switch(16 * f->chroma_h_shift + f->chroma_v_shift) {
+ case 0x00: f->avctx->pix_fmt = AV_PIX_FMT_YUV444P14; break;
+ case 0x10: f->avctx->pix_fmt = AV_PIX_FMT_YUV422P14; break;
+ case 0x11: f->avctx->pix_fmt = AV_PIX_FMT_YUV420P14; break;
+ }
} else if (f->avctx->bits_per_raw_sample == 16 && !f->transparency){
f->packed_at_lsb = 1;
switch(16 * f->chroma_h_shift + f->chroma_v_shift) {