diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-06-23 13:54:17 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-23 13:56:52 +0200 |
commit | b222e0773c78918a59e7748b56eed0bdd8afa043 (patch) | |
tree | bdeddf2e8604da5131c52f2d70ae70e320cf5c5e /libavcodec | |
parent | 35bb74900b951dccdc7481e98a00246f59ec2420 (diff) | |
parent | e121ac634ba324a318f4a97f978dcfb48da6b735 (diff) | |
download | ffmpeg-b222e0773c78918a59e7748b56eed0bdd8afa043.tar.gz |
Merge commit 'e121ac634ba324a318f4a97f978dcfb48da6b735'
* commit 'e121ac634ba324a318f4a97f978dcfb48da6b735':
indeo45: use is_indeo4 context flag instead of checking codec ID
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/indeo4.c | 2 | ||||
-rw-r--r-- | libavcodec/indeo5.c | 2 | ||||
-rw-r--r-- | libavcodec/ivi_common.c | 10 | ||||
-rw-r--r-- | libavcodec/ivi_common.h | 2 |
4 files changed, 10 insertions, 6 deletions
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c index ada44af17f..7adfcbc9ca 100644 --- a/libavcodec/indeo4.c +++ b/libavcodec/indeo4.c @@ -663,6 +663,8 @@ static av_cold int decode_init(AVCodecContext *avctx) ctx->switch_buffers = switch_buffers; ctx->is_nonnull_frame = is_nonnull_frame; + ctx->is_indeo4 = 1; + ctx->p_frame = av_frame_alloc(); if (!ctx->p_frame) return AVERROR(ENOMEM); diff --git a/libavcodec/indeo5.c b/libavcodec/indeo5.c index 75f79ad9d3..470676879b 100644 --- a/libavcodec/indeo5.c +++ b/libavcodec/indeo5.c @@ -672,6 +672,8 @@ static av_cold int decode_init(AVCodecContext *avctx) ctx->switch_buffers = switch_buffers; ctx->is_nonnull_frame = is_nonnull_frame; + ctx->is_indeo4 = 0; + avctx->pix_fmt = AV_PIX_FMT_YUV410P; return 0; diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c index 53f71c7a37..754bfd5bad 100644 --- a/libavcodec/ivi_common.c +++ b/libavcodec/ivi_common.c @@ -997,8 +997,7 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, if (ctx->gop_invalid) return AVERROR_INVALIDDATA; - if (avctx->codec_id == AV_CODEC_ID_INDEO4 && - ctx->frame_type == IVI4_FRAMETYPE_NULL_LAST) { + if (ctx->is_indeo4 && ctx->frame_type == IVI4_FRAMETYPE_NULL_LAST) { if (ctx->got_p_frame) { av_frame_move_ref(data, ctx->p_frame); *got_frame = 1; @@ -1061,7 +1060,7 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return result; if (ctx->is_scalable) { - if (avctx->codec_id == AV_CODEC_ID_INDEO4) + if (ctx->is_indeo4) ff_ivi_recompose_haar(&ctx->planes[0], frame->data[0], frame->linesize[0]); else ff_ivi_recompose53 (&ctx->planes[0], frame->data[0], frame->linesize[0]); @@ -1079,8 +1078,7 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, * to be the only way to handle the B-frames mode. * That's exactly the same Intel decoders do. */ - if (avctx->codec_id == AV_CODEC_ID_INDEO4 && - ctx->frame_type == IVI4_FRAMETYPE_INTRA) { + if (ctx->is_indeo4 && ctx->frame_type == IVI4_FRAMETYPE_INTRA) { int left; // skip version string @@ -1115,7 +1113,7 @@ av_cold int ff_ivi_decode_close(AVCodecContext *avctx) ff_free_vlc(&ctx->mb_vlc.cust_tab); #if IVI4_STREAM_ANALYSER - if (avctx->codec_id == AV_CODEC_ID_INDEO4) { + if (ctx->is_indeo4) { if (ctx->is_scalable) av_log(avctx, AV_LOG_ERROR, "This video uses scalability mode!\n"); if (ctx->uses_tiling) diff --git a/libavcodec/ivi_common.h b/libavcodec/ivi_common.h index b0bdfe5337..a17641f9a7 100644 --- a/libavcodec/ivi_common.h +++ b/libavcodec/ivi_common.h @@ -263,6 +263,8 @@ typedef struct IVI45DecContext { int gop_invalid; int buf_invalid[3]; + int is_indeo4; + AVFrame *p_frame; int got_p_frame; } IVI45DecContext; |