X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fmimic.c;h=02d8b30e31a977cc607a8065dc8bfd7d1c6cac76;hb=faa5a2181df53b5226f998a20b735798addcd365;hp=0cc30ab0ede449ec8cea66cc86d939721b9c16e5;hpb=b893f3f54333eebd4909d447852e98615af785a9;p=ffmpeg diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index 0cc30ab0ede..02d8b30e31a 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -260,9 +260,9 @@ static int vlc_decode_block(MimicContext *ctx, int num_coeffs, int qscale) /* FFmpeg's IDCT behaves somewhat different from the original code, so * a factor of 4 was added to the input */ - coeff = vlcdec_lookup[num_bits][value]; + coeff = ((int8_t*)vlcdec_lookup[num_bits])[value]; if (pos < 3) - coeff <<= 4; + coeff *= 16; else /* TODO Use >> 10 instead of / 1001 */ coeff = (coeff * qscale) / 1001; @@ -390,9 +390,11 @@ static int mimic_decode_frame(AVCodecContext *avctx, void *data, return AVERROR_INVALIDDATA; } + res = ff_set_dimensions(avctx, width, height); + if (res < 0) + return res; + ctx->avctx = avctx; - avctx->width = width; - avctx->height = height; avctx->pix_fmt = AV_PIX_FMT_YUV420P; for (i = 0; i < 3; i++) { ctx->num_vblocks[i] = AV_CEIL_RSHIFT(height, 3 + !!i);