History

lavc: move CODEC_FLAG_NORMALIZE_AQP to mpegvideo

Anton Khirnov committed 12 years ago

Commit b2c31711 parent 5fcceda7 files · +28 −4Browse files

Unified · Split

7 files
  1. doc/APIchanges +4 −0
  2. libavcodec/avcodec.h +7 −1
  3. libavcodec/mpegvideo.h +2 −0
  4. libavcodec/mpegvideo_enc.c +7 −0
  5. libavcodec/options_table.h +2 −0
  6. libavcodec/ratecontrol.c +2 −2
  7. libavcodec/version.h +4 −1
doc/APIchanges+4−0
@@ -13,6 +13,10 @@ libavutil: 2013-12-xx · 12 unmodified lines
1313
1414 API changes, most recent first:
1515
16+2014-04-xx - xxxxxxx - lavc 55.50.1 - avcodec.h
17+ Deprecate CODEC_FLAG_NORMALIZE_AQP. It is replaced by the flag "naq" in the
18+ "mpv_flags" private option of the mpegvideo encoders.
19+
1620 2014-04-xx - xxxxxxx - avcodec.h
1721 Deprecate CODEC_FLAG_INPUT_PRESERVED. Its functionality is replaced by passing
1822 reference-counted frames to encoders.
libavcodec/avcodec.h+7−1
@@ -691,7 +691,13 @@ typedef struct RcOverride{ · 690 unmodified lines
691691 #define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding.
692692 #define CODEC_FLAG_TRUNCATED 0x00010000 /** Input bitstream might be truncated at a random
693693 location instead of only at frame boundaries. */
694−#define CODEC_FLAG_NORMALIZE_AQP 0x00020000 ///< Normalize adaptive quantization.
694+#if FF_API_NORMALIZE_AQP
695+/**
696+ * @deprecated use the flag "naq" in the "mpv_flags" private option of the
697+ * mpegvideo encoders
698+ */
699+#define CODEC_FLAG_NORMALIZE_AQP 0x00020000
700+#endif
695701 #define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
696702 #define CODEC_FLAG_LOW_DELAY 0x00080000 ///< Force low delay.
697703 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< Place global headers in extradata instead of every keyframe.
libavcodec/mpegvideo.h+2−0
@@ -649,6 +649,7 @@ typedef struct MpegEncContext { · 648 unmodified lines
649649 #define FF_MPV_FLAG_STRICT_GOP 0x0002
650650 #define FF_MPV_FLAG_QP_RD 0x0004
651651 #define FF_MPV_FLAG_CBP_RD 0x0008
652+#define FF_MPV_FLAG_NAQ 0x0010
652653
653654 #define FF_MPV_OFFSET(x) offsetof(MpegEncContext, x)
654655 #define FF_MPV_OPT_FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
@@ -658,6 +659,7 @@ typedef struct MpegEncContext { · 3 unmodified lines
658659 { "strict_gop", "Strictly enforce gop size", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_STRICT_GOP }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
659660 { "qp_rd", "Use rate distortion optimization for qp selection", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_QP_RD }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
660661 { "cbp_rd", "use rate distortion optimization for CBP", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_CBP_RD }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
662+{ "naq", "normalize adaptive quantization", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_NAQ }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
661663 { "luma_elim_threshold", "single coefficient elimination threshold for luminance (negative values also consider dc coefficient)",\
662664 FF_MPV_OFFSET(luma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\
663665 { "chroma_elim_threshold", "single coefficient elimination threshold for chrominance (negative values also consider dc coefficient)",\
libavcodec/mpegvideo_enc.c+7−0
@@ -780,6 +780,13 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) · 779 unmodified lines
780780 FF_ENABLE_DEPRECATION_WARNINGS;
781781 #endif
782782
783+#if FF_API_NORMALIZE_AQP
784+ FF_DISABLE_DEPRECATION_WARNINGS
785+ if (avctx->flags & CODEC_FLAG_NORMALIZE_AQP)
786+ s->mpv_flags |= FF_MPV_FLAG_NAQ;
787+ FF_ENABLE_DEPRECATION_WARNINGS;
788+#endif
789+
783790 if (avctx->b_frame_strategy == 2) {
784791 for (i = 0; i < s->max_b_frames + 2; i++) {
785792 s->tmp_frames[i] = av_frame_alloc();
libavcodec/options_table.h+2−0
@@ -63,7 +63,9 @@ static const AVOption avcodec_options[] = { · 62 unmodified lines
6363 {"emu_edge", "do not draw edges", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_EMU_EDGE }, INT_MIN, INT_MAX, 0, "flags"},
6464 {"psnr", "error[?] variables will be set during encoding", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_PSNR }, INT_MIN, INT_MAX, V|E, "flags"},
6565 {"truncated", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_TRUNCATED }, INT_MIN, INT_MAX, 0, "flags"},
66+#if FF_API_NORMALIZE_AQP
6667 {"naq", "normalize adaptive quantization", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_NORMALIZE_AQP }, INT_MIN, INT_MAX, V|E, "flags"},
68+#endif
6769 {"ildct", "use interlaced DCT", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_INTERLACED_DCT }, INT_MIN, INT_MAX, V|E, "flags"},
6870 {"low_delay", "force low delay", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_LOW_DELAY }, INT_MIN, INT_MAX, V|D|E, "flags"},
6971 {"global_header", "place global headers in extradata instead of every keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_GLOBAL_HEADER }, INT_MIN, INT_MAX, V|A|E, "flags"},
libavcodec/ratecontrol.c+2−2
@@ -672,7 +672,7 @@ static void adaptive_quantization(MpegEncContext *s, double q) · 671 unmodified lines
672672 }
673673
674674 /* handle qmin/qmax clipping */
675− if (s->flags & CODEC_FLAG_NORMALIZE_AQP) {
675+ if (s->mpv_flags & FF_MPV_FLAG_NAQ) {
676676 float factor = bits_sum / cplx_sum;
677677 for (i = 0; i < s->mb_num; i++) {
678678 float newq = q * cplx_tab[i] / bits_tab[i];
@@ -697,7 +697,7 @@ static void adaptive_quantization(MpegEncContext *s, double q) · 18 unmodified lines
697697 float newq = q * cplx_tab[i] / bits_tab[i];
698698 int intq;
699699
700− if (s->flags & CODEC_FLAG_NORMALIZE_AQP) {
700+ if (s->mpv_flags & FF_MPV_FLAG_NAQ) {
701701 newq *= bits_sum / cplx_sum;
702702 }
703703
libavcodec/version.h+4−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030
3131 #define LIBAVCODEC_VERSION_MAJOR 55
3232 #define LIBAVCODEC_VERSION_MINOR 50
33−#define LIBAVCODEC_VERSION_MICRO 0
33+#define LIBAVCODEC_VERSION_MICRO 1
3434
3535 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
3636 LIBAVCODEC_VERSION_MINOR, \
@@ -132,5 +132,8 @@ · 95 unmodified lines
132132 #ifndef FF_API_INPUT_PRESERVED
133133 #define FF_API_INPUT_PRESERVED (LIBAVCODEC_VERSION_MAJOR < 57)
134134 #endif
135+#ifndef FF_API_NORMALIZE_AQP
136+#define FF_API_NORMALIZE_AQP (LIBAVCODEC_VERSION_MAJOR < 57)
137+#endif
135138
136139 #endif /* AVCODEC_VERSION_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t