Message ID | AS8P250MB07446223CCC8816F450B12AF8F309@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM |
---|---|
State | Accepted |
Commit | 20ee12c677c6f58afbae643f039ba06e7d6f070a |
Headers | show |
Series | [FFmpeg-devel,1/2] avcodec/mpegvideo: Don't initialize H264Chroma ctx unnecessarily | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
Andreas Rheinhardt: > Only encoders need two sets of int16_t [12][64] > (one to save the current best state and one for the current > working state); decoders need only one. This saves 1.5KiB > per slice context for a decoder. > > Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> > --- > libavcodec/mpegvideo.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c > index 697438fa6f..0cd7c86ff6 100644 > --- a/libavcodec/mpegvideo.c > +++ b/libavcodec/mpegvideo.c > @@ -382,7 +382,7 @@ static int init_duplicate_context(MpegEncContext *s) > return AVERROR(ENOMEM); > } > } > - if (!FF_ALLOCZ_TYPED_ARRAY(s->blocks, 2)) > + if (!FF_ALLOCZ_TYPED_ARRAY(s->blocks, 1 + s->encoding)) > return AVERROR(ENOMEM); > s->block = s->blocks[0]; > Will apply the rest of this patchset tomorrow unless there are objections. - Andreas
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 697438fa6f..0cd7c86ff6 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -382,7 +382,7 @@ static int init_duplicate_context(MpegEncContext *s) return AVERROR(ENOMEM); } } - if (!FF_ALLOCZ_TYPED_ARRAY(s->blocks, 2)) + if (!FF_ALLOCZ_TYPED_ARRAY(s->blocks, 1 + s->encoding)) return AVERROR(ENOMEM); s->block = s->blocks[0];
Only encoders need two sets of int16_t [12][64] (one to save the current best state and one for the current working state); decoders need only one. This saves 1.5KiB per slice context for a decoder. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/mpegvideo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)