Browse Source

avcodec/mjpegenc: Remove nonsensical AMV options

Both these options are unsupported and silently ignored for AMV;
so it is better to not offer them at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Andreas Rheinhardt 1 week ago
parent
commit
6cdcf15e0a
1 changed files with 4 additions and 3 deletions
  1. 4 3
      libavcodec/mjpegenc.c

+ 4 - 3
libavcodec/mjpegenc.c

@@ -301,7 +301,7 @@ av_cold int ff_mjpeg_encode_init(MpegEncContext *s)
                  (s->avctx->active_thread_type & FF_THREAD_SLICE) &&
                  s->avctx->thread_count > 1;
 
-    if (s->codec_id == AV_CODEC_ID_AMV || use_slices)
+    if (use_slices)
         m->huffman = HUFFMAN_TABLE_DEFAULT;
 
     if (s->mpv_flags & FF_MPV_FLAG_QP_RD) {
@@ -624,11 +624,12 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
 #define OFFSET(x) offsetof(MJPEGEncContext, mjpeg.x)
 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 static const AVOption options[] = {
-FF_MPV_COMMON_OPTS
+#define AMV_OPTIONS_OFFSET 4
 { "huffman", "Huffman table strategy", OFFSET(huffman), AV_OPT_TYPE_INT, { .i64 = HUFFMAN_TABLE_OPTIMAL }, 0, NB_HUFFMAN_TABLE_OPTION - 1, VE, .unit = "huffman" },
     { "default", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = HUFFMAN_TABLE_DEFAULT }, INT_MIN, INT_MAX, VE, .unit = "huffman" },
     { "optimal", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = HUFFMAN_TABLE_OPTIMAL }, INT_MIN, INT_MAX, VE, .unit = "huffman" },
 { "force_duplicated_matrix", "Always write luma and chroma matrix for mjpeg, useful for rtp streaming.", OFFSET(force_duplicated_matrix), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, VE },
+FF_MPV_COMMON_OPTS
 { NULL},
 };
 
@@ -688,7 +689,7 @@ FFCodec ff_mjpeg_encoder = {
 static const AVClass amv_class = {
     .class_name = "amv encoder",
     .item_name  = av_default_item_name,
-    .option     = options,
+    .option     = options + AMV_OPTIONS_OFFSET,
     .version    = LIBAVUTIL_VERSION_INT,
 };