History

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.

Andreas Rheinhardt committed 1 year ago

Commit 6cdcf151 parent fc158f31 file · +4 −3Browse files

Unified · Split

libavcodec/mjpegenc.c+4−3
@@ -301,7 +301,7 @@ av_cold int ff_mjpeg_encode_init(MpegEncContext *s) · 300 unmodified lines
301301 (s->avctx->active_thread_type & FF_THREAD_SLICE) &&
302302 s->avctx->thread_count > 1;
303303
304− if (s->codec_id == AV_CODEC_ID_AMV || use_slices)
304+ if (use_slices)
305305 m->huffman = HUFFMAN_TABLE_DEFAULT;
306306
307307 if (s->mpv_flags & FF_MPV_FLAG_QP_RD) {
@@ -624,11 +624,12 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt, · 316 unmodified lines
624624 #define OFFSET(x) offsetof(MJPEGEncContext, mjpeg.x)
625625 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
626626 static const AVOption options[] = {
627−FF_MPV_COMMON_OPTS
627+#define AMV_OPTIONS_OFFSET 4
628628 { "huffman", "Huffman table strategy", OFFSET(huffman), AV_OPT_TYPE_INT, { .i64 = HUFFMAN_TABLE_OPTIMAL }, 0, NB_HUFFMAN_TABLE_OPTION - 1, VE, .unit = "huffman" },
629629 { "default", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = HUFFMAN_TABLE_DEFAULT }, INT_MIN, INT_MAX, VE, .unit = "huffman" },
630630 { "optimal", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = HUFFMAN_TABLE_OPTIMAL }, INT_MIN, INT_MAX, VE, .unit = "huffman" },
631631 { "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 },
632+FF_MPV_COMMON_OPTS
632633 { NULL},
633634 };
634635
@@ -688,7 +689,7 @@ FFCodec ff_mjpeg_encoder = { · 53 unmodified lines
688689 static const AVClass amv_class = {
689690 .class_name = "amv encoder",
690691 .item_name = av_default_item_name,
691− .option = options,
692+ .option = options + AMV_OPTIONS_OFFSET,
692693 .version = LIBAVUTIL_VERSION_INT,
693694 };
694695

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t