X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=libavcodec%2Futvideodec.c;h=3891df3570158f23e99c3b4eecf3468b3f4185dc;hb=ed5680f37ed30a01933c0158b21e3bb3c8acfe4a;hp=086129d094755c787fa9262f7645a6b81f70151a;hpb=e46fab0f3cfb58398de9d2b8bd866f82606a90eb;p=ffmpeg diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index 086129d0947..3891df35701 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -27,6 +27,7 @@ #include #include +#define CACHED_BITSTREAM_READER !ARCH_X86_32 #define UNCHECKED_BITSTREAM_READER 1 #include "libavutil/intreadwrite.h" @@ -949,14 +950,17 @@ static av_cold int decode_init(AVCodecContext *avctx) break; case MKTAG('U', 'Q', 'Y', '2'): c->planes = 3; + c->pro = 1; avctx->pix_fmt = AV_PIX_FMT_YUV422P10; break; case MKTAG('U', 'Q', 'R', 'G'): c->planes = 3; + c->pro = 1; avctx->pix_fmt = AV_PIX_FMT_GBRP10; break; case MKTAG('U', 'Q', 'R', 'A'): c->planes = 4; + c->pro = 1; avctx->pix_fmt = AV_PIX_FMT_GBRAP10; break; case MKTAG('U', 'L', 'H', '0'): @@ -1031,7 +1035,7 @@ static av_cold int decode_init(AVCodecContext *avctx) if (c->compression != 2) avpriv_request_sample(avctx, "Unknown compression type"); c->slices = avctx->extradata[9] + 1; - } else if (avctx->extradata_size >= 16) { + } else if (!c->pro && avctx->extradata_size >= 16) { av_log(avctx, AV_LOG_DEBUG, "Encoder version %d.%d.%d.%d\n", avctx->extradata[3], avctx->extradata[2], avctx->extradata[1], avctx->extradata[0]); @@ -1046,14 +1050,13 @@ static av_cold int decode_init(AVCodecContext *avctx) c->slices = (c->flags >> 24) + 1; c->compression = c->flags & 1; c->interlaced = c->flags & 0x800; - } else if (avctx->extradata_size == 8) { + } else if (c->pro && avctx->extradata_size == 8) { av_log(avctx, AV_LOG_DEBUG, "Encoder version %d.%d.%d.%d\n", avctx->extradata[3], avctx->extradata[2], avctx->extradata[1], avctx->extradata[0]); av_log(avctx, AV_LOG_DEBUG, "Original format %"PRIX32"\n", AV_RB32(avctx->extradata + 4)); c->interlaced = 0; - c->pro = 1; c->frame_info_size = 4; } else { av_log(avctx, AV_LOG_ERROR,