summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-01-26 01:50:56 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-01-29 19:30:25 +0100
commitdcdb34be9121adf0cf499d75b84a3ba242a872d4 (patch)
tree3ab400a648d42594f0bb4fd78f9cc7746798050c /libavcodec/mpegvideo.c
parent85ac29ad1cbb1ab2e1294a7e8a30db20df7c0b86 (diff)
downloadffmpeg-dcdb34be9121adf0cf499d75b84a3ba242a872d4.tar.gz
avcodec/mpegvideo: Move MPEG-4 Simple Studio Profile fields to mpeg4video
This is possible now that dealing with the Simple Studio Profile has been moved to mpeg4videodec.c. It also allows to avoid allocations, because one can simply put the required buffers on the context (if one made these buffers part of MpegEncContext, the memory would be wasted for every codec other than MPEG-4). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index a231ee52b7..3b889e0791 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -378,11 +378,6 @@ static int init_duplicate_context(MpegEncContext *s)
}
if (s->out_format == FMT_H263) {
- if (!(s->block32 = av_mallocz(sizeof(*s->block32))) ||
- !(s->dpcm_macroblock = av_mallocz(sizeof(*s->dpcm_macroblock))))
- return AVERROR(ENOMEM);
- s->dpcm_direction = 0;
-
/* ac values */
if (!FF_ALLOCZ_TYPED_ARRAY(s->ac_val_base, yc_size))
return AVERROR(ENOMEM);
@@ -434,8 +429,6 @@ static void free_duplicate_context(MpegEncContext *s)
av_freep(&s->me.map);
av_freep(&s->me.score_map);
av_freep(&s->blocks);
- av_freep(&s->block32);
- av_freep(&s->dpcm_macroblock);
av_freep(&s->ac_val_base);
s->block = NULL;
}
@@ -462,9 +455,6 @@ static void backup_duplicate_context(MpegEncContext *bak, MpegEncContext *src)
COPY(me.score_map);
COPY(blocks);
COPY(block);
- COPY(block32);
- COPY(dpcm_macroblock);
- COPY(dpcm_direction);
COPY(start_mb_y);
COPY(end_mb_y);
COPY(me.map_generation);
@@ -678,10 +668,7 @@ static void clear_context(MpegEncContext *s)
s->dct_error_sum = NULL;
s->block = NULL;
s->blocks = NULL;
- s->block32 = NULL;
memset(s->pblocks, 0, sizeof(s->pblocks));
- s->dpcm_direction = 0;
- s->dpcm_macroblock = NULL;
s->ac_val_base = NULL;
s->ac_val[0] =
s->ac_val[1] =