diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-01-13 05:56:59 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-14 19:25:15 +0100 |
commit | 52889b543dddf7e7b9a34cdfebfbccbccaf73160 (patch) | |
tree | d6e16988c56ca99b4929714178666f55bacd5d1e /libavcodec | |
parent | 0d5c810bd59abed01f8e70ee956897599eaaea25 (diff) | |
download | ffmpeg-52889b543dddf7e7b9a34cdfebfbccbccaf73160.tar.gz |
mpeg12dec: BW10 support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpeg12.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 831ea92bb5..c4c611b8ac 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -2075,8 +2075,6 @@ static int vcr2_init_sequence(AVCodecContext *avctx) if (MPV_common_init(s) < 0) return -1; - exchange_uv(s); // common init reset pblocks, so we swap them here - s->swap_uv = 1; // in case of xvmc we need to swap uv for each MB s1->mpeg_enc_ctx_allocated = 1; for (i = 0; i < 64; i++) { @@ -2096,8 +2094,15 @@ static int vcr2_init_sequence(AVCodecContext *avctx) s->first_field = 0; s->frame_pred_frame_dct = 1; s->chroma_format = 1; - s->codec_id = s->avctx->codec_id = CODEC_ID_MPEG2VIDEO; - avctx->sub_id = 2; /* indicates MPEG-2 */ + if (s->codec_tag == AV_RL32("BW10")) { + s->codec_id = s->avctx->codec_id = CODEC_ID_MPEG1VIDEO; + avctx->sub_id = 1; /* indicates MPEG-1 */ + } else { + exchange_uv(s); // common init reset pblocks, so we swap them here + s->swap_uv = 1; // in case of xvmc we need to swap uv for each MB + s->codec_id = s->avctx->codec_id = CODEC_ID_MPEG2VIDEO; + avctx->sub_id = 2; /* indicates MPEG-2 */ + } s1->save_width = s->width; s1->save_height = s->height; s1->save_progressive_seq = s->progressive_sequence; @@ -2269,7 +2274,9 @@ static int mpeg_decode_frame(AVCodecContext *avctx, } s2->codec_tag = avpriv_toupper4(avctx->codec_tag); - if (s->mpeg_enc_ctx_allocated == 0 && s2->codec_tag == AV_RL32("VCR2")) + if (s->mpeg_enc_ctx_allocated == 0 && ( s2->codec_tag == AV_RL32("VCR2") + || s2->codec_tag == AV_RL32("BW10") + )) vcr2_init_sequence(avctx); s->slice_count = 0; |