[FFmpeg-cvslog] avcodec/mjpegenc: Remove nonsensical AMV options
Andreas Rheinhardt
git at videolan.org
Fri Mar 7 16:22:17 EET 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Mon Mar 3 01:36:39 2025 +0100| [6cdcf15e0a558f82562d290c04aa1de0f3fd7809] | committer: Andreas Rheinhardt
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 at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6cdcf15e0a558f82562d290c04aa1de0f3fd7809
---
libavcodec/mjpegenc.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index c2e8b93a34..22d2b4816f 100644
--- a/libavcodec/mjpegenc.c
+++ b/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,
};
More information about the ffmpeg-cvslog
mailing list