summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_enc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-01-28 00:21:32 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-02-13 19:36:50 +0100
commit20033c7da4d631385dcb2afc4ed907c3500d8372 (patch)
treec3635da54fe18da8bbc2a72aea24c8e9e8456c5c /libavcodec/mpegvideo_enc.c
parente2cf60f0401c6731026a82f7b5b18b1b0389ee5d (diff)
avcodec/msmpegenc: Add MSMPEG4EncContext and move ac_stats to it
Also avoid the allocation by making it part of the context. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 8686a0e426..39fa9caf4a 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -813,12 +813,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
ff_pixblockdsp_init(&s->pdsp, avctx);
ff_qpeldsp_init(&s->qdsp);
- if (s->msmpeg4_version) {
- int ac_stats_size = 2 * 2 * (MAX_LEVEL + 1) * (MAX_RUN + 1) * 2 * sizeof(int);
- if (!(s->ac_stats = av_mallocz(ac_stats_size)))
- return AVERROR(ENOMEM);
- }
-
if (!(avctx->stats_out = av_mallocz(256)) ||
!FF_ALLOCZ_TYPED_ARRAY(s->q_intra_matrix, 32) ||
!FF_ALLOCZ_TYPED_ARRAY(s->q_chroma_intra_matrix, 32) ||
@@ -944,7 +938,6 @@ av_cold int ff_mpv_encode_end(AVCodecContext *avctx)
ff_mpv_picture_free(avctx, &s->new_picture);
av_freep(&avctx->stats_out);
- av_freep(&s->ac_stats);
if(s->q_chroma_intra_matrix != s->q_intra_matrix ) av_freep(&s->q_chroma_intra_matrix);
if(s->q_chroma_intra_matrix16 != s->q_intra_matrix16) av_freep(&s->q_chroma_intra_matrix16);