X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fratecontrol.c;h=6c2b4af174545b4410c0392eea69299d5347ace8;hb=bd4d192081230b217ecab14d39daf06f40067191;hp=e96550cc69fa3a68f0d25bfa01d7d2cc620cf0d1;hpb=f62fe535d5c08562abcc1b302b0220c95acb307d;p=ffmpeg diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c index e96550cc69f..6c2b4af1745 100644 --- a/libavcodec/ratecontrol.c +++ b/libavcodec/ratecontrol.c @@ -233,8 +233,12 @@ FF_ENABLE_DEPRECATION_WARNINGS return -1; } +#if FF_API_RC_STRATEGY + av_assert0(MPV_RC_STRATEGY_XVID == FF_RC_STRATEGY_XVID); +#endif + // FIXME maybe move to end - if ((s->avctx->flags & AV_CODEC_FLAG_PASS2) && s->rc_strategy == 1) { + if ((s->avctx->flags & AV_CODEC_FLAG_PASS2) && s->rc_strategy == MPV_RC_STRATEGY_XVID) { #if CONFIG_LIBXVID return ff_xvid_rate_control_init(s); #else @@ -314,7 +318,7 @@ av_cold void ff_rate_control_uninit(MpegEncContext *s) av_freep(&rcc->entry); #if CONFIG_LIBXVID - if ((s->avctx->flags & AV_CODEC_FLAG_PASS2) && s->rc_strategy == 1) + if ((s->avctx->flags & AV_CODEC_FLAG_PASS2) && s->rc_strategy == MPV_RC_STRATEGY_XVID) ff_xvid_rate_control_uninit(s); #endif } @@ -767,7 +771,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run) emms_c(); #if CONFIG_LIBXVID - if ((s->avctx->flags & AV_CODEC_FLAG_PASS2) && s->rc_strategy == 1) + if ((s->avctx->flags & AV_CODEC_FLAG_PASS2) && s->rc_strategy == MPV_RC_STRATEGY_XVID) return ff_xvid_rate_estimate_qscale(s, dry_run); #endif