This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit f37cfb370f87e2598c500f3d51b47577c6dbbcb5 Author: Andreas Rheinhardt <[email protected]> AuthorDate: Thu Jul 3 02:31:52 2025 +0200 Commit: Andreas Rheinhardt <[email protected]> CommitDate: Sat Mar 7 20:14:36 2026 +0100 avcodec/avcodec: Deprecate intra_dc_precision It is only used by the MPEG-2 encoder, so replace it by a private option instead. Use a more elaborate term for it: intra_dc_precision ("dc" could be anything). Signed-off-by: Andreas Rheinhardt <[email protected]> --- doc/APIchanges | 3 +++ libavcodec/avcodec.h | 4 ++++ libavcodec/mpeg12enc.c | 12 +++++++++++- libavcodec/options_table.h | 4 +++- libavcodec/version.h | 4 ++-- libavcodec/version_major.h | 1 + tests/fate/lavf-container.mak | 2 +- tests/fate/vcodec.mak | 2 +- 8 files changed, 26 insertions(+), 6 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 88005bb28e..081483b130 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2025-03-28 API changes, most recent first: +2026-03-07 - xxxxxxxxxx - lavc 62.25.100 - avcodec.h + Deprecate AVCodecContext.intra_dc_precision. + 2026-02-xx - xxxxxxxxxx - lsws 9.4.100 - swscale.h Add sws_test_hw_format(). diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 1a8f77af82..6824bfc9a6 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -971,12 +971,16 @@ typedef struct AVCodecContext { */ uint16_t *chroma_intra_matrix; +#if FF_API_INTRA_DC_PRECISION /** * precision of the intra DC coefficient - 8 * - encoding: Set by user. * - decoding: Set by libavcodec + * @deprecated Use the MPEG-2 encoder's private option "intra_dc_precision" instead. */ + attribute_deprecated int intra_dc_precision; +#endif /** * minimum MB Lagrange multiplier diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index c4a16d1508..7537327149 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -1126,8 +1126,11 @@ static av_cold int encode_init(AVCodecContext *avctx) s->min_qcoeff = -2047; s->max_qcoeff = 2047; s->mpeg_quant = 1; - +#if FF_API_INTRA_DC_PRECISION + if (s->c.intra_dc_precision < 0) { +FF_DISABLE_DEPRECATION_WARNINGS s->c.intra_dc_precision = avctx->intra_dc_precision; +FF_ENABLE_DEPRECATION_WARNINGS // workaround some differences between how applications specify dc precision if (s->c.intra_dc_precision < 0) { s->c.intra_dc_precision += 8; @@ -1145,6 +1148,8 @@ static av_cold int encode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_ERROR, "intra dc precision too large\n"); return AVERROR(EINVAL); } + } +#endif } s->c.y_dc_scale_table = s->c.c_dc_scale_table = ff_mpeg12_dc_scale_table[s->c.intra_dc_precision]; @@ -1254,6 +1259,11 @@ static const AVOption mpeg1_options[] = { static const AVOption mpeg2_options[] = { COMMON_OPTS +#if FF_API_INTRA_DC_PRECISION + { "intra_dc_precision", "Precision of the DC coefficient - 8", FF_MPV_OFFSET(c.intra_dc_precision), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 3, VE }, +#else + { "intra_dc_precision", "Precision of the DC coefficient - 8", FF_MPV_OFFSET(c.intra_dc_precision), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 3, VE }, +#endif { "intra_vlc", "Use MPEG-2 intra VLC table.", FF_MPV_OFFSET(c.intra_vlc_format), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { "non_linear_quant", "Use nonlinear quantizer.", FF_MPV_OFFSET(c.q_scale_type), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h index 8567451919..99e7002076 100644 --- a/libavcodec/options_table.h +++ b/libavcodec/options_table.h @@ -214,7 +214,9 @@ static const AVOption avcodec_options[] = { {"rc_init_occupancy", "number of bits which should be loaded into the rc buffer before decoding starts", OFFSET(rc_initial_buffer_occupancy), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"threads", "set the number of threads", OFFSET(thread_count), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, INT_MAX, V|A|E|D, .unit = "threads"}, {"auto", "autodetect a suitable number of threads to use", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, INT_MIN, INT_MAX, V|E|D, .unit = "threads"}, -{"dc", "intra_dc_precision", OFFSET(intra_dc_precision), AV_OPT_TYPE_INT, {.i64 = 0 }, -8, 16, V|E}, +#if FF_API_INTRA_DC_PRECISION +{"dc", "deprecated; use intra_dc_precision for MPEG-2 instead", OFFSET(intra_dc_precision), AV_OPT_TYPE_INT, {.i64 = 0 }, -8, 16, AV_OPT_FLAG_DEPRECATED|V|E}, +#endif {"nssew", "nsse weight", OFFSET(nsse_weight), AV_OPT_TYPE_INT, {.i64 = 8 }, INT_MIN, INT_MAX, V|E}, {"skip_top", "number of macroblock rows at the top which are skipped", OFFSET(skip_top), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D}, {"skip_bottom", "number of macroblock rows at the bottom which are skipped", OFFSET(skip_bottom), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D}, diff --git a/libavcodec/version.h b/libavcodec/version.h index 906d0518e4..a744e7469f 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,8 +29,8 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 24 -#define LIBAVCODEC_VERSION_MICRO 101 +#define LIBAVCODEC_VERSION_MINOR 25 +#define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h index 5eed53e038..6c652374dd 100644 --- a/libavcodec/version_major.h +++ b/libavcodec/version_major.h @@ -42,6 +42,7 @@ #define FF_API_V408_CODECID (LIBAVCODEC_VERSION_MAJOR < 63) #define FF_API_CODEC_PROPS (LIBAVCODEC_VERSION_MAJOR < 63) #define FF_API_EXR_GAMMA (LIBAVCODEC_VERSION_MAJOR < 63) +#define FF_API_INTRA_DC_PRECISION (LIBAVCODEC_VERSION_MAJOR < 63) #define FF_API_NVDEC_OLD_PIX_FMTS (LIBAVCODEC_VERSION_MAJOR < 63) diff --git a/tests/fate/lavf-container.mak b/tests/fate/lavf-container.mak index d1007a428a..6194f18f28 100644 --- a/tests/fate/lavf-container.mak +++ b/tests/fate/lavf-container.mak @@ -55,7 +55,7 @@ fate-lavf-mov_hybrid_frag: CMD = lavf_container "" "-movflags +hybrid_fragmented fate-lavf-mp4: CMD = lavf_container_timecode "-c:v mpeg4 -an -threads 1" fate-lavf-mpg: CMD = lavf_container_timecode "-ar 44100 -threads 1" fate-lavf-mxf: CMD = lavf_container_timecode "-af aresample=48000:tsf=s16p -bf 2 -threads 1" -fate-lavf-mxf_d10: CMD = lavf_container "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,pad=720:608:0:32,setfield=tff -c:v mpeg2video -g 0 -flags +ildct+low_delay -dc 10 -non_linear_quant 1 -intra_vlc 1 -qscale 1 -ps 1 -qmin 1 -rc_max_vbv_use 1 -rc_min_vbv_use 1 -pix_fmt yuv422p -minrate 30000k -maxrate 30000k -b 30000k -bufsize 1200000 -rc_init_occupancy 1200000 -qmax 12 -f mxf_d10" +fate-lavf-mxf_d10: CMD = lavf_container "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,pad=720:608:0:32,setfield=tff -c:v mpeg2video -g 0 -flags +ildct+low_delay -intra_dc_precision 2 -non_linear_quant 1 -intra_vlc 1 -qscale 1 -ps 1 -qmin 1 -rc_max_vbv_use 1 -rc_min_vbv_use 1 -pix_fmt yuv422p -minrate 30000k -maxrate 30000k -b 30000k -bufsize 1200000 -rc_init_occupancy 1200000 -qmax 12 -f mxf_d10" fate-lavf-mxf_dv25: CMD = lavf_container "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,setdar=4/3,setfield=bff -c:v dvvideo -pix_fmt yuv420p -b 25000k -f mxf" fate-lavf-mxf_dvcpro50: CMD = lavf_container "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,setdar=16/9,setfield=bff -c:v dvvideo -pix_fmt yuv422p -b 50000k -f mxf" fate-lavf-mxf_dvcpro100: CMD = lavf_container "-ar 48000 -ac 2" "-r 25 -vf scale=1440:1080,setdar=16/9,setfield=bff -c:v dvvideo -pix_fmt yuv422p -b 100000k -f mxf" diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak index 0261ca30b6..895d5d55bc 100644 --- a/tests/fate/vcodec.mak +++ b/tests/fate/vcodec.mak @@ -284,7 +284,7 @@ fate-vsynth%-mpeg2-422: ENCOPTS = -b:v 1000k \ -intra_vlc 1 \ -mbd rd \ -pix_fmt yuv422p -fate-vsynth%-mpeg2-idct-int: ENCOPTS = -qscale 10 -idct int -dct int -dc 2 +fate-vsynth%-mpeg2-idct-int: ENCOPTS = -qscale 10 -idct int -dct int -intra_dc_precision 2 fate-vsynth%-mpeg2-ilace: ENCOPTS = -qscale 10 -flags +ildct+ilme fate-vsynth%-mpeg2-ivlc-qprd: ENCOPTS = -b:v 500k \ -bf 2 \ _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
