Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PR] avcodec/mjpegdec: remove extern_huff option (PR #21474)
@ 2026-01-15 14:30 Ramiro Polla via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: Ramiro Polla via ffmpeg-devel @ 2026-01-15 14:30 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Ramiro Polla

PR #21474 opened by Ramiro Polla (ramiro)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21474
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21474.patch

This functionality was changed from a flag to an option in 1f0c7020a1.
The flag had been added in the early days of FFmpeg in e84c31dc88, and
was used by mplayer since "avid mjpeg support (external huffman table)"
to pass external huffman tables for AVRn and Pegasus MJPEG from AVI
files.

I have not been able to find files where this feature would be needed,
or any other user besides mplayer (mpv removed this functionality over
10 years ago).


>From 4a55dc7f59379be420cb2294ff08c40bab48244b Mon Sep 17 00:00:00 2001
From: Ramiro Polla <ramiro.polla@gmail.com>
Date: Mon, 12 Jan 2026 23:00:05 +0100
Subject: [PATCH] avcodec/mjpegdec: remove extern_huff option

This functionality was changed from a flag to an option in 1f0c7020a1.
The flag had been added in the early days of FFmpeg in e84c31dc88, and
was used by mplayer since "avid mjpeg support (external huffman table)"
to pass external huffman tables for AVRn and Pegasus MJPEG from AVI
files.

I have not been able to find files where this feature would be needed,
or any other user besides mplayer (mpv removed this functionality over
10 years ago).
---
 libavcodec/mjpegdec.c | 27 ---------------------------
 libavcodec/mjpegdec.h |  3 ---
 2 files changed, 30 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 3af4b05551..8ece4ad57c 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -36,7 +36,6 @@
 #include "libavutil/imgutils.h"
 #include "libavutil/avassert.h"
 #include "libavutil/mem.h"
-#include "libavutil/opt.h"
 #include "avcodec.h"
 #include "blockdsp.h"
 #include "codec_internal.h"
@@ -145,16 +144,6 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
     if ((ret = init_default_huffman_tables(s)) < 0)
         return ret;
 
-    if (s->extern_huff) {
-        av_log(avctx, AV_LOG_INFO, "using external huffman table\n");
-        bytestream2_init(&s->gB, avctx->extradata, avctx->extradata_size);
-        if (ff_mjpeg_decode_dht(s)) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "error using external huffman table, switching back to internal\n");
-            if ((ret = init_default_huffman_tables(s)) < 0)
-                return ret;
-        }
-    }
     if (avctx->field_order == AV_FIELD_BB) { /* quicktime icefloe 019 */
         s->interlace_polarity = 1;           /* bottom field first */
         av_log(avctx, AV_LOG_DEBUG, "bottom field first\n");
@@ -2940,21 +2929,6 @@ static av_cold void decode_flush(AVCodecContext *avctx)
 }
 
 #if CONFIG_MJPEG_DECODER
-#define OFFSET(x) offsetof(MJpegDecodeContext, x)
-#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
-static const AVOption options[] = {
-    { "extern_huff", "Use external huffman table.",
-      OFFSET(extern_huff), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
-    { NULL },
-};
-
-static const AVClass mjpegdec_class = {
-    .class_name = "MJPEG decoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
 const FFCodec ff_mjpeg_decoder = {
     .p.name         = "mjpeg",
     CODEC_LONG_NAME("MJPEG (Motion JPEG)"),
@@ -2967,7 +2941,6 @@ const FFCodec ff_mjpeg_decoder = {
     .flush          = decode_flush,
     .p.capabilities = AV_CODEC_CAP_DR1,
     .p.max_lowres   = 3,
-    .p.priv_class   = &mjpegdec_class,
     .p.profiles     = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles),
     .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP |
                       FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM |
diff --git a/libavcodec/mjpegdec.h b/libavcodec/mjpegdec.h
index c2f83ac949..6c934dc564 100644
--- a/libavcodec/mjpegdec.h
+++ b/libavcodec/mjpegdec.h
@@ -29,7 +29,6 @@
 #ifndef AVCODEC_MJPEGDEC_H
 #define AVCODEC_MJPEGDEC_H
 
-#include "libavutil/log.h"
 #include "libavutil/mem_internal.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/stereo3d.h"
@@ -54,7 +53,6 @@ typedef struct ICCEntry {
 struct JLSState;
 
 typedef struct MJpegDecodeContext {
-    AVClass *class;
     AVCodecContext *avctx;
     GetBitContext gb;
     GetByteContext gB;
@@ -139,7 +137,6 @@ typedef struct MJpegDecodeContext {
     uint16_t (*ljpeg_buffer)[4];
     unsigned int ljpeg_buffer_size;
 
-    int extern_huff;
     AVExifMetadata exif_metadata;
 
     AVStereo3D *stereo3d; ///!< stereoscopic information (cached, since it is read before frame allocation)
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-01-15 14:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-15 14:30 [FFmpeg-devel] [PR] avcodec/mjpegdec: remove extern_huff option (PR #21474) Ramiro Polla via ffmpeg-devel

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git