if (ff_rate_control_init(s) < 0)
return -1;
- #if FF_API_ERROR_RATE
- FF_DISABLE_DEPRECATION_WARNINGS
- if (avctx->error_rate)
- s->error_rate = avctx->error_rate;
- FF_ENABLE_DEPRECATION_WARNINGS;
- #endif
-
+#if FF_API_RC_STRATEGY
+ av_assert0(MPV_RC_STRATEGY_XVID == FF_RC_STRATEGY_XVID);
+#endif
+
+ if ((s->avctx->flags & AV_CODEC_FLAG_PASS2) && s->rc_strategy == MPV_RC_STRATEGY_XVID) {
+#if CONFIG_LIBXVID
+ ret = ff_xvid_rate_control_init(s);
+#else
+ ret = AVERROR(ENOSYS);
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Xvid ratecontrol requires libavcodec compiled with Xvid support.\n");
+#endif
+ if (ret < 0)
+ return ret;
+ }
+
#if FF_API_NORMALIZE_AQP
FF_DISABLE_DEPRECATION_WARNINGS
if (avctx->flags & CODEC_FLAG_NORMALIZE_AQP)
#endif
{"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},
{"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT}, 0, UINT_MAX, V|A|E|D, "flags2"},
- #if FF_API_ERROR_RATE
- {"error", NULL, OFFSET(error_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
- #endif
-{"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, INT_MAX, V|E|D, "threads"},
+{"threads", "set the number of threads", OFFSET(thread_count), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, INT_MAX, V|A|E|D, "threads"},
{"auto", "autodetect a suitable number of threads to use", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, INT_MIN, INT_MAX, V|E|D, "threads"},
#if FF_API_MPV_OPT
{"me_threshold", "motion estimation threshold", OFFSET(me_threshold), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
* FF_API_* defines may be placed below to indicate public API that will be
* dropped at a future version bump. The defines themselves are not part of
* the public API and may change, break or disappear at any time.
+ *
+ * @note, when bumping the major version it is recommended to manually
+ * disable each FF_API_* in its own commit instead of disabling them all
+ * at once through the bump. This improves the git bisect-ability of the change.
*/
- #ifndef FF_API_ERROR_RATE
- #define FF_API_ERROR_RATE (LIBAVCODEC_VERSION_MAJOR < 58)
- #endif
+#ifndef FF_API_LOWRES
+#define FF_API_LOWRES (LIBAVCODEC_VERSION_MAJOR < 59)
+#endif
+#ifndef FF_API_DEBUG_MV
+#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 58)
+#endif
#ifndef FF_API_QSCALE_TYPE
#define FF_API_QSCALE_TYPE (LIBAVCODEC_VERSION_MAJOR < 58)
#endif