diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-10-25 02:11:50 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-10-29 13:37:41 +0200 |
commit | 20ee12c677c6f58afbae643f039ba06e7d6f070a (patch) | |
tree | f3b573aceed4f7e94218dd16643dbe0bad5192b3 /libavcodec | |
parent | 307326b36dccf4b3aec90864d4e71ec0b8872f48 (diff) | |
download | ffmpeg-20ee12c677c6f58afbae643f039ba06e7d6f070a.tar.gz |
avcodec/mpegvideo: Don't overallocate buffer
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>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpegvideo.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index dbb72f8e94..cea6b5e899 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -381,7 +381,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]; |