diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-10-03 17:22:44 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-10-06 20:47:53 +0200 |
commit | 4c422de1dbce3bc4a1920c726ecba9d612cb1190 (patch) | |
tree | 839402b39197c8d8513f07dc6d711e16ab3de755 /libavcodec/mpegvideo.c | |
parent | 27fcc8dd9f9fea7a520e9c4be043f3a05bf324cd (diff) |
avcodec/mpegvideo: Move allocating new_picture to the encoder
It is only used by encoders; this unfortunately necessitated
to add separate allocations to the SVQ1 encoder which uses
motion estimation without being a full member of mpegvideo.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index fc73abab9c..9ed158ac57 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -632,7 +632,6 @@ static void clear_context(MpegEncContext *s) memset(&s->next_picture, 0, sizeof(s->next_picture)); memset(&s->last_picture, 0, sizeof(s->last_picture)); memset(&s->current_picture, 0, sizeof(s->current_picture)); - memset(&s->new_picture, 0, sizeof(s->new_picture)); memset(s->thread_context, 0, sizeof(s->thread_context)); @@ -720,8 +719,7 @@ av_cold int ff_mpv_common_init(MpegEncContext *s) if (!(s->next_picture.f = av_frame_alloc()) || !(s->last_picture.f = av_frame_alloc()) || - !(s->current_picture.f = av_frame_alloc()) || - !(s->new_picture = av_frame_alloc())) + !(s->current_picture.f = av_frame_alloc())) goto fail_nomem; if ((ret = ff_mpv_init_context_frame(s))) @@ -801,7 +799,6 @@ void ff_mpv_common_end(MpegEncContext *s) ff_mpv_picture_free(s->avctx, &s->last_picture); ff_mpv_picture_free(s->avctx, &s->current_picture); ff_mpv_picture_free(s->avctx, &s->next_picture); - av_frame_free(&s->new_picture); s->context_initialized = 0; s->context_reinit = 0; |