mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-03-13 09:00:40 +08:00
avcodec/mjpegdec: deprecate extern_huff option
This commit is contained in:
@@ -147,6 +147,7 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
|
|||||||
if ((ret = init_default_huffman_tables(s)) < 0)
|
if ((ret = init_default_huffman_tables(s)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
#if FF_API_MJPEG_EXTERN_HUFF
|
||||||
if (s->extern_huff && avctx->extradata) {
|
if (s->extern_huff && avctx->extradata) {
|
||||||
av_log(avctx, AV_LOG_INFO, "using external huffman table\n");
|
av_log(avctx, AV_LOG_INFO, "using external huffman table\n");
|
||||||
bytestream2_init(&s->gB, avctx->extradata, avctx->extradata_size);
|
bytestream2_init(&s->gB, avctx->extradata, avctx->extradata_size);
|
||||||
@@ -157,6 +158,7 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (avctx->field_order == AV_FIELD_BB) { /* quicktime icefloe 019 */
|
if (avctx->field_order == AV_FIELD_BB) { /* quicktime icefloe 019 */
|
||||||
s->interlace_polarity = 1; /* bottom field first */
|
s->interlace_polarity = 1; /* bottom field first */
|
||||||
av_log(avctx, AV_LOG_DEBUG, "bottom field first\n");
|
av_log(avctx, AV_LOG_DEBUG, "bottom field first\n");
|
||||||
@@ -2953,18 +2955,22 @@ static av_cold void decode_flush(AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_MJPEG_DECODER
|
#if CONFIG_MJPEG_DECODER
|
||||||
|
#if FF_API_MJPEG_EXTERN_HUFF
|
||||||
#define OFFSET(x) offsetof(MJpegDecodeContext, x)
|
#define OFFSET(x) offsetof(MJpegDecodeContext, x)
|
||||||
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
|
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
|
||||||
static const AVOption options[] = {
|
static const AVOption options[] = {
|
||||||
{ "extern_huff", "Use external huffman table.",
|
{ "extern_huff", "Use external huffman table.",
|
||||||
OFFSET(extern_huff), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
|
OFFSET(extern_huff), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD | AV_OPT_FLAG_DEPRECATED },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
static const AVClass mjpegdec_class = {
|
static const AVClass mjpegdec_class = {
|
||||||
.class_name = "MJPEG decoder",
|
.class_name = "MJPEG decoder",
|
||||||
.item_name = av_default_item_name,
|
.item_name = av_default_item_name,
|
||||||
|
#if FF_API_MJPEG_EXTERN_HUFF
|
||||||
.option = options,
|
.option = options,
|
||||||
|
#endif
|
||||||
.version = LIBAVUTIL_VERSION_INT,
|
.version = LIBAVUTIL_VERSION_INT,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,9 @@ typedef struct MJpegDecodeContext {
|
|||||||
uint16_t (*ljpeg_buffer)[4];
|
uint16_t (*ljpeg_buffer)[4];
|
||||||
unsigned int ljpeg_buffer_size;
|
unsigned int ljpeg_buffer_size;
|
||||||
|
|
||||||
|
#if FF_API_MJPEG_EXTERN_HUFF
|
||||||
int extern_huff;
|
int extern_huff;
|
||||||
|
#endif
|
||||||
AVExifMetadata exif_metadata;
|
AVExifMetadata exif_metadata;
|
||||||
|
|
||||||
AVStereo3D *stereo3d; ///!< stereoscopic information (cached, since it is read before frame allocation)
|
AVStereo3D *stereo3d; ///!< stereoscopic information (cached, since it is read before frame allocation)
|
||||||
|
|||||||
@@ -49,6 +49,8 @@
|
|||||||
#define FF_API_PARSER_PRIVATE (LIBAVCODEC_VERSION_MAJOR < 63)
|
#define FF_API_PARSER_PRIVATE (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||||
#define FF_API_PARSER_CODECID (LIBAVCODEC_VERSION_MAJOR < 63)
|
#define FF_API_PARSER_CODECID (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||||
|
|
||||||
|
#define FF_API_MJPEG_EXTERN_HUFF (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||||
|
|
||||||
// reminder to remove the OMX encoder on next major bump
|
// reminder to remove the OMX encoder on next major bump
|
||||||
#define FF_CODEC_OMX (LIBAVCODEC_VERSION_MAJOR < 63)
|
#define FF_CODEC_OMX (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||||
// reminder to remove Sonic Lossy/Lossless encoders on next major bump
|
// reminder to remove Sonic Lossy/Lossless encoders on next major bump
|
||||||
|
|||||||
Reference in New Issue
Block a user