X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Findeo5.c;h=b1c50c2adbad05e2215efbd0c76711bb61310653;hb=c48883163d6c7ff0806687bf3ee33ca9f8e7dede;hp=4c6bfd66d1c565040aa9e7748bf9eb71940fdd4d;hpb=8bc7fe4daf5c26555d77e2261c96ee14a800fad4;p=ffmpeg diff --git a/libavcodec/indeo5.c b/libavcodec/indeo5.c index 4c6bfd66d1c..b1c50c2adba 100644 --- a/libavcodec/indeo5.c +++ b/libavcodec/indeo5.c @@ -27,7 +27,7 @@ * Known FOURCCs: 'IV50' */ -#define ALT_BITSTREAM_READER_LE +#define BITSTREAM_READER_LE #include "avcodec.h" #include "get_bits.h" #include "dsputil.h" @@ -90,7 +90,7 @@ typedef struct { */ static int decode_gop_header(IVI5DecContext *ctx, AVCodecContext *avctx) { - int result, i, p, tile_size, pic_size_indx, mb_size, blk_size; + int result, i, p, tile_size, pic_size_indx, mb_size, blk_size, is_scalable; int quant_mat, blk_size_changed = 0; IVIBandDesc *band, *band1, *band2; IVIPicConfig pic_conf; @@ -112,8 +112,8 @@ static int decode_gop_header(IVI5DecContext *ctx, AVCodecContext *avctx) /* num_levels * 3 + 1 */ pic_conf.luma_bands = get_bits(&ctx->gb, 2) * 3 + 1; pic_conf.chroma_bands = get_bits1(&ctx->gb) * 3 + 1; - ctx->is_scalable = pic_conf.luma_bands != 1 || pic_conf.chroma_bands != 1; - if (ctx->is_scalable && (pic_conf.luma_bands != 4 || pic_conf.chroma_bands != 1)) { + is_scalable = pic_conf.luma_bands != 1 || pic_conf.chroma_bands != 1; + if (is_scalable && (pic_conf.luma_bands != 4 || pic_conf.chroma_bands != 1)) { av_log(avctx, AV_LOG_ERROR, "Scalability: unsupported subdivision! Luma bands: %d, chroma bands: %d\n", pic_conf.luma_bands, pic_conf.chroma_bands); return -1; @@ -151,6 +151,7 @@ static int decode_gop_header(IVI5DecContext *ctx, AVCodecContext *avctx) return -1; } ctx->pic_conf = pic_conf; + ctx->is_scalable = is_scalable; blk_size_changed = 1; /* force reallocation of the internal structures */ } @@ -481,7 +482,7 @@ static int decode_mb_info(IVI5DecContext *ctx, IVIBandDesc *band, } mb->mv_x = mb->mv_y = 0; /* no motion vector coded */ - if (band->inherit_mv){ + if (band->inherit_mv && ref_mb){ /* motion vector inheritance */ if (mv_scale) { mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale); @@ -492,7 +493,7 @@ static int decode_mb_info(IVI5DecContext *ctx, IVIBandDesc *band, } } } else { - if (band->inherit_mv) { + if (band->inherit_mv && ref_mb) { mb->type = ref_mb->type; /* copy mb_type from corresponding reference mb */ } else if (ctx->frame_type == FRAMETYPE_INTRA) { mb->type = 0; /* mb_type is always INTRA for intra-frames */ @@ -518,7 +519,7 @@ static int decode_mb_info(IVI5DecContext *ctx, IVIBandDesc *band, if (!mb->type) { mb->mv_x = mb->mv_y = 0; /* there is no motion vector in intra-macroblocks */ } else { - if (band->inherit_mv){ + if (band->inherit_mv && ref_mb){ /* motion vector inheritance */ if (mv_scale) { mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale); @@ -759,7 +760,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, switch_buffers(ctx); - //START_TIMER; + //{ START_TIMER; if (ctx->frame_type != FRAMETYPE_NULL) { for (p = 0; p < 3; p++) { @@ -774,7 +775,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, } } - //STOP_TIMER("decode_planes"); + //STOP_TIMER("decode_planes"); } if (ctx->frame.data[0]) avctx->release_buffer(avctx, &ctx->frame);