mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-25 04:19:05 +00:00
interplayvideo: Handle changed video dimensions on the fly
Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
c5d907b6b0
commit
17aa02b9a1
@ -1019,9 +1019,6 @@ static av_cold int ipvideo_decode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
dsputil_init(&s->dsp, avctx);
|
dsputil_init(&s->dsp, avctx);
|
||||||
|
|
||||||
/* decoding map contains 4 bits of information per 8x8 block */
|
|
||||||
s->decoding_map_size = avctx->width * avctx->height / (8 * 8 * 2);
|
|
||||||
|
|
||||||
s->current_frame.data[0] = s->last_frame.data[0] =
|
s->current_frame.data[0] = s->last_frame.data[0] =
|
||||||
s->second_last_frame.data[0] = NULL;
|
s->second_last_frame.data[0] = NULL;
|
||||||
|
|
||||||
@ -1036,6 +1033,9 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
|
|||||||
int buf_size = avpkt->size;
|
int buf_size = avpkt->size;
|
||||||
IpvideoContext *s = avctx->priv_data;
|
IpvideoContext *s = avctx->priv_data;
|
||||||
|
|
||||||
|
/* decoding map contains 4 bits of information per 8x8 block */
|
||||||
|
s->decoding_map_size = avctx->width * avctx->height / (8 * 8 * 2);
|
||||||
|
|
||||||
/* compressed buffer needs to be large enough to at least hold an entire
|
/* compressed buffer needs to be large enough to at least hold an entire
|
||||||
* decoding map */
|
* decoding map */
|
||||||
if (buf_size < s->decoding_map_size)
|
if (buf_size < s->decoding_map_size)
|
||||||
@ -1096,6 +1096,6 @@ AVCodec ff_interplay_video_decoder = {
|
|||||||
.init = ipvideo_decode_init,
|
.init = ipvideo_decode_init,
|
||||||
.close = ipvideo_decode_end,
|
.close = ipvideo_decode_end,
|
||||||
.decode = ipvideo_decode_frame,
|
.decode = ipvideo_decode_frame,
|
||||||
.capabilities = CODEC_CAP_DR1,
|
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_PARAM_CHANGE,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("Interplay MVE video"),
|
.long_name = NULL_IF_CONFIG_SMALL("Interplay MVE video"),
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user