[FFmpeg-devel] [PATCH v2 52/69] avcodec/mpegvideo: Move input_picture_number to MPVMainEncContext
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Tue Feb 1 15:06:49 EET 2022
Only used by the main encoder thread.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
libavcodec/mpegvideo.h | 1 -
libavcodec/mpegvideo_enc.c | 4 ++--
libavcodec/mpegvideoenc.h | 1 +
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index ce2d36ab15..99361f0733 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -104,7 +104,6 @@ typedef struct MPVContext {
/* sequence parameters */
int context_initialized;
- int input_picture_number; ///< used to set pic->display_picture_number, should not be used for/by anything else
int coded_picture_number; ///< used to set pic->coded_picture_number, should not be used for/by anything else
int picture_number; //FIXME remove, unclear definition
int mb_width, mb_height; ///< number of MBs horizontally & vertically
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 06c6e5cca1..ecc25ba8a2 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -291,7 +291,7 @@ static void mpv_encode_defaults(MPVMainEncContext *m)
s->me.mv_penalty = default_mv_penalty;
s->fcode_tab = default_fcode_tab;
- s->input_picture_number = 0;
+ m->input_picture_number = 0;
m->picture_in_gop_number = 0;
}
@@ -1080,7 +1080,7 @@ static int load_input_picture(MPVMainEncContext *m, const AVFrame *pic_arg)
if (pic_arg) {
pts = pic_arg->pts;
- display_picture_number = s->input_picture_number++;
+ display_picture_number = m->input_picture_number++;
if (pts != AV_NOPTS_VALUE) {
if (m->user_specified_pts != AV_NOPTS_VALUE) {
diff --git a/libavcodec/mpegvideoenc.h b/libavcodec/mpegvideoenc.h
index 8f6d069369..42731a5edc 100644
--- a/libavcodec/mpegvideoenc.h
+++ b/libavcodec/mpegvideoenc.h
@@ -48,6 +48,7 @@ typedef struct MPVMainEncContext {
int gop_size;
int picture_in_gop_number; ///< 0-> first pic in gop, ...
+ int input_picture_number; ///< used to set pic->display_picture_number, should not be used for/by anything else
/** last non-zero pts from AVFrame which was passed into avcodec_send_frame() */
int64_t user_specified_pts;
--
2.32.0
More information about the ffmpeg-devel
mailing list