[FFmpeg-devel] [PATCH v2 50/69] avcodec/mpegvideo: Move dummy dst for depr. opts to MPVMainEncContext

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Tue Feb 1 15:06:47 EET 2022


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/mjpegenc.c     | 2 +-
 libavcodec/mpegvideo.h    | 4 ----
 libavcodec/mpegvideoenc.h | 8 ++++++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index a8ea63a76d..360653c5a1 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -631,7 +631,7 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
 static const AVOption options[] = {
 FF_MPV_COMMON_OPTS
 #if FF_API_MJPEG_PRED
-{ "pred", "Deprecated, does nothing", FF_MPV_OFFSET(dummy), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, 3, VE, "pred" },
+{ "pred", "Deprecated, does nothing", FF_MPV_MAIN_OFFSET(dummy), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, 3, VE, "pred" },
     { "left",   NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "pred" },
     { "plane",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, "pred" },
     { "median", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 3 }, INT_MIN, INT_MAX, VE, "pred" },
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 4601c4be64..9002c0549e 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -481,10 +481,6 @@ typedef struct MPVContext {
     int noise_reduction;
 
     int intra_penalty;
-
-#if FF_API_MPEGVIDEO_OPTS || FF_API_MJPEG_PRED
-    int dummy;               ///< used as target for deprecated options
-#endif
 } MPVContext;
 
 /**
diff --git a/libavcodec/mpegvideoenc.h b/libavcodec/mpegvideoenc.h
index 0abd315846..51610c051b 100644
--- a/libavcodec/mpegvideoenc.h
+++ b/libavcodec/mpegvideoenc.h
@@ -109,6 +109,10 @@ typedef struct MPVMainEncContext {
     uint16_t q_inter_matrix16[32][2][64];
     uint16_t q_intra_matrix16[32][2][64];
     uint16_t q_chroma_intra_matrix16[32][2][64];
+
+#if FF_API_MPEGVIDEO_OPTS || FF_API_MJPEG_PRED
+    int dummy;               ///< used as target for deprecated options
+#endif
 } MPVMainEncContext;
 
 #define UNI_AC_ENC_INDEX(run,level) ((run)*128 + (level))
@@ -197,9 +201,9 @@ FF_MPV_OPT_CMP_FUNC, \
 #define FF_MPV_DEPRECATED_MPEG_QUANT_OPT \
     { "mpeg_quant", "Deprecated, does nothing", FF_MPV_OFFSET(mpeg_quant), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 0, FF_MPV_OPT_FLAGS | AV_OPT_FLAG_DEPRECATED },
 #define FF_MPV_DEPRECATED_A53_CC_OPT \
-    { "a53cc",      "Deprecated, does nothing", FF_MPV_OFFSET(dummy),      AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FF_MPV_OPT_FLAGS | AV_OPT_FLAG_DEPRECATED },
+    { "a53cc",      "Deprecated, does nothing", FF_MPV_MAIN_OFFSET(dummy),      AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FF_MPV_OPT_FLAGS | AV_OPT_FLAG_DEPRECATED },
 #define FF_MPV_DEPRECATED_MATRIX_OPT \
-   { "force_duplicated_matrix", "Deprecated, does nothing", FF_MPV_OFFSET(dummy), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, FF_MPV_OPT_FLAGS | AV_OPT_FLAG_DEPRECATED },
+   { "force_duplicated_matrix", "Deprecated, does nothing", FF_MPV_MAIN_OFFSET(dummy), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, FF_MPV_OPT_FLAGS | AV_OPT_FLAG_DEPRECATED },
 #define FF_MPV_DEPRECATED_BFRAME_OPTS \
    { "b_strategy",    "Deprecated, does nothing", FF_MPV_MAIN_OFFSET(b_frame_strategy), AV_OPT_TYPE_INT, { .i64 =  0 }, 0, 2, FF_MPV_OPT_FLAGS | AV_OPT_FLAG_DEPRECATED }, \
    { "b_sensitivity", "Deprecated, does nothing", FF_MPV_MAIN_OFFSET(b_sensitivity),    AV_OPT_TYPE_INT, { .i64 = 40 }, 1, INT_MAX, FF_MPV_OPT_FLAGS | AV_OPT_FLAG_DEPRECATED }, \
-- 
2.32.0



More information about the ffmpeg-devel mailing list