avcodec/mjpegenc: Deprecate unused prediction type

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-12-22 00:46:39 +01:00
parent bd2ec3d345
commit 7aee9e326f
4 changed files with 8 additions and 6 deletions

View File

@ -77,7 +77,7 @@ static av_cold void init_uni_ac_vlc(const uint8_t huff_size_ac[256],
static void mjpeg_encode_picture_header(MpegEncContext *s)
{
ff_mjpeg_encode_picture_header(s->avctx, &s->pb, &s->intra_scantable,
s->pred, s->intra_matrix, s->chroma_intra_matrix);
0, s->intra_matrix, s->chroma_intra_matrix);
s->esc_pos = put_bytes_count(&s->pb, 0);
for (int i = 1; i < s->slice_context_count; i++)
@ -620,10 +620,12 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
FF_MPV_COMMON_OPTS
{ "pred", "Prediction method", FF_MPV_OFFSET(pred), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, 3, VE, "pred" },
#if FF_API_MJPEG_PRED
{ "pred", "Deprecated, does nothing", FF_MPV_OFFSET(dummy), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, 3, VE, "pred" },
{ "left", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "pred" },
{ "plane", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, "pred" },
{ "median", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 3 }, INT_MIN, INT_MAX, VE, "pred" },
#endif
{ "huffman", "Huffman table strategy", OFFSET(huffman), AV_OPT_TYPE_INT, { .i64 = HUFFMAN_TABLE_OPTIMAL }, 0, NB_HUFFMAN_TABLE_OPTION - 1, VE, "huffman" },
{ "default", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = HUFFMAN_TABLE_DEFAULT }, INT_MIN, INT_MAX, VE, "huffman" },
{ "optimal", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = HUFFMAN_TABLE_OPTIMAL }, INT_MIN, INT_MAX, VE, "huffman" },

View File

@ -310,7 +310,7 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
put_bits(pb, 4, 0); /* AC huffman table index */
}
put_bits(pb, 8, lossless ? pred : 0); /* Ss (not used) */
put_bits(pb, 8, pred); /* Ss (not used); pred only nonzero for LJPEG */
switch (avctx->codec_id) {
case AV_CODEC_ID_MJPEG: put_bits(pb, 8, 63); break; /* Se (not used) */

View File

@ -412,7 +412,6 @@ typedef struct MpegEncContext {
/* MJPEG specific */
struct MJpegContext *mjpeg_ctx;
int esc_pos;
int pred;
/* MSMPEG4 specific */
int mv_table_index;
@ -574,7 +573,7 @@ typedef struct MpegEncContext {
int intra_penalty;
#if FF_API_MPEGVIDEO_OPTS
#if FF_API_MPEGVIDEO_OPTS || FF_API_MJPEG_PRED
int dummy; ///< used as target for deprecated options
#endif
} MpegEncContext;

View File

@ -28,7 +28,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 59
#define LIBAVCODEC_VERSION_MINOR 19
#define LIBAVCODEC_VERSION_MINOR 20
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@ -63,5 +63,6 @@
#define FF_API_MPEGVIDEO_OPTS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_FLAG_TRUNCATED (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_SUB_TEXT_FORMAT (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_MJPEG_PRED (LIBAVCODEC_VERSION_MAJOR < 60)
#endif /* AVCODEC_VERSION_H */