aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-10-07 21:37:42 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-06-12 11:32:25 +0200
commit8225d2da7390ac22cd9e93bb7b8711379ae36558 (patch)
tree4bcf473bcebed0851a19ea1af796ab51742099f7 /libavcodec
parent89ca63cc9cc2d64a949adba5da36ef3dff580fd2 (diff)
downloadffmpeg-8225d2da7390ac22cd9e93bb7b8711379ae36558.tar.gz
avcodec/mpegvideo_enc: Pass AVFrame*, not Picture* to alloc_picture()
It now only deals with the AVFrame and no longer with the accessories. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpegvideo_enc.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 0b3eef646c..f54ec93cf2 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1091,30 +1091,30 @@ static int get_intra_count(MpegEncContext *s, const uint8_t *src,
return acc;
}
-static int alloc_picture(MpegEncContext *s, Picture *pic)
+static int alloc_picture(MpegEncContext *s, AVFrame *f)
{
AVCodecContext *avctx = s->avctx;
int ret;
- pic->f->width = avctx->width + 2 * EDGE_WIDTH;
- pic->f->height = avctx->height + 2 * EDGE_WIDTH;
+ f->width = avctx->width + 2 * EDGE_WIDTH;
+ f->height = avctx->height + 2 * EDGE_WIDTH;
- ret = ff_encode_alloc_frame(avctx, pic->f);
+ ret = ff_encode_alloc_frame(avctx, f);
if (ret < 0)
return ret;
- ret = ff_mpv_pic_check_linesize(avctx, pic->f, &s->linesize, &s->uvlinesize);
+ ret = ff_mpv_pic_check_linesize(avctx, f, &s->linesize, &s->uvlinesize);
if (ret < 0)
return ret;
- for (int i = 0; pic->f->data[i]; i++) {
+ for (int i = 0; f->data[i]; i++) {
int offset = (EDGE_WIDTH >> (i ? s->chroma_y_shift : 0)) *
- pic->f->linesize[i] +
+ f->linesize[i] +
(EDGE_WIDTH >> (i ? s->chroma_x_shift : 0));
- pic->f->data[i] += offset;
+ f->data[i] += offset;
}
- pic->f->width = avctx->width;
- pic->f->height = avctx->height;
+ f->width = avctx->width;
+ f->height = avctx->height;
return 0;
}
@@ -1186,7 +1186,7 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
return ret;
pic->shared = 1;
} else {
- ret = alloc_picture(s, pic);
+ ret = alloc_picture(s, pic->f);
if (ret < 0)
goto fail;
ret = av_frame_copy_props(pic->f, pic_arg);
@@ -1607,7 +1607,7 @@ no_output_pic:
// input is a shared pix, so we can't modify it -> allocate a new
// one & ensure that the shared one is reuseable
av_frame_move_ref(s->new_pic, s->reordered_input_picture[0]->f);
- ret = alloc_picture(s, s->reordered_input_picture[0]);
+ ret = alloc_picture(s, s->reordered_input_picture[0]->f);
if (ret < 0)
goto fail;