1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/mpegvideo: Check h263_aic, not h263_plus for allocating dc_val

This means that these buffers won't be allocated any more
for H.263+ with AIC disabled.
Also remove setting h263_plus for the RV20 encoder,
as it has only been done to force allocating dc_val.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-05-21 01:57:52 +02:00
parent ed73675832
commit 8987c29390
2 changed files with 5 additions and 2 deletions

View File

@ -335,9 +335,11 @@ av_cold int ff_mpv_init_context_frame(MpegEncContext *s)
s->coded_block = s->coded_block_base + s->b8_stride + 1; s->coded_block = s->coded_block_base + s->b8_stride + 1;
} }
if (s->h263_pred || s->h263_plus || !s->encoding) { if (s->h263_pred || s->h263_aic || !s->encoding) {
/* dc values */ /* dc values */
// MN: we need these for error resilience of intra-frames // MN: we need these for error resilience of intra-frames
// Allocating them unconditionally for decoders also means
// that we don't need to reinitialize when e.g. h263_aic changes.
if (!FF_ALLOCZ_TYPED_ARRAY(s->dc_val_base, yc_size)) if (!FF_ALLOCZ_TYPED_ARRAY(s->dc_val_base, yc_size))
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
s->dc_val[0] = s->dc_val_base + s->b8_stride + 1; s->dc_val[0] = s->dc_val_base + s->b8_stride + 1;

View File

@ -944,8 +944,9 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
avctx->delay = 0; avctx->delay = 0;
s->c.low_delay = 1; s->c.low_delay = 1;
s->c.modified_quant = 1; s->c.modified_quant = 1;
// Set here to force allocation of dc_val;
// will be set later on a per-frame basis.
s->c.h263_aic = 1; s->c.h263_aic = 1;
s->c.h263_plus = 1;
s->c.loop_filter = 1; s->c.loop_filter = 1;
s->c.unrestricted_mv = 0; s->c.unrestricted_mv = 0;
break; break;