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
301 (s->avctx->active_thread_type & FF_THREAD_SLICE) &&301 (s->avctx->active_thread_type & FF_THREAD_SLICE) &&
302 s->avctx->thread_count > 1;302 s->avctx->thread_count > 1;
303 303
304 if (s->codec_id == AV_CODEC_ID_AMV || use_slices)304 if (use_slices)
305 m->huffman = HUFFMAN_TABLE_DEFAULT;305 m->huffman = HUFFMAN_TABLE_DEFAULT;
306 306
307 if (s->mpv_flags & FF_MPV_FLAG_QP_RD) {307 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
624#define OFFSET(x) offsetof(MJPEGEncContext, mjpeg.x)624#define OFFSET(x) offsetof(MJPEGEncContext, mjpeg.x)
625#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM625#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
626static const AVOption options[] = {626static const AVOption options[] = {
627FF_MPV_COMMON_OPTS627#define AMV_OPTIONS_OFFSET 4
628{ "huffman", "Huffman table strategy", OFFSET(huffman), AV_OPT_TYPE_INT, { .i64 = HUFFMAN_TABLE_OPTIMAL }, 0, NB_HUFFMAN_TABLE_OPTION - 1, VE, .unit = "huffman" },628{ "huffman", "Huffman table strategy", OFFSET(huffman), AV_OPT_TYPE_INT, { .i64 = HUFFMAN_TABLE_OPTIMAL }, 0, NB_HUFFMAN_TABLE_OPTION - 1, VE, .unit = "huffman" },
629 { "default", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = HUFFMAN_TABLE_DEFAULT }, INT_MIN, INT_MAX, VE, .unit = "huffman" },629 { "default", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = HUFFMAN_TABLE_DEFAULT }, INT_MIN, INT_MAX, VE, .unit = "huffman" },
630 { "optimal", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = HUFFMAN_TABLE_OPTIMAL }, INT_MIN, INT_MAX, VE, .unit = "huffman" },630 { "optimal", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = HUFFMAN_TABLE_OPTIMAL }, INT_MIN, INT_MAX, VE, .unit = "huffman" },
631{ "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 },631{ "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 },
632FF_MPV_COMMON_OPTS
632{ NULL},633{ NULL},
633};634};
634 635
@@ -688,7 +689,7 @@ FFCodec ff_mjpeg_encoder = { · 53 unmodified lines
688static const AVClass amv_class = {689static const AVClass amv_class = {
689 .class_name = "amv encoder",690 .class_name = "amv encoder",
690 .item_name = av_default_item_name,691 .item_name = av_default_item_name,
691 .option = options,692 .option = options + AMV_OPTIONS_OFFSET,
692 .version = LIBAVUTIL_VERSION_INT,693 .version = LIBAVUTIL_VERSION_INT,
693};694};
694 695

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