summaryrefslogtreecommitdiff
path: root/libavcodec/ratecontrol.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-07-03 16:46:44 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-07-08 16:36:39 +0100
commit1761ab838c75223a6b97d8c0720d09275374c53d (patch)
treeebf48492a61c5ab7ba46ba28405132f755adeb26 /libavcodec/ratecontrol.c
parent02b7c630875c0bc63cee5ec597aa33baf9bf4e20 (diff)
lavc: Deprecate avctx.rc_strategy
Only used by libxvid in ratecontrol module, so move it to a codec private option. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/ratecontrol.c')
-rw-r--r--libavcodec/ratecontrol.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c
index d0e13b9241..8332c7189c 100644
--- a/libavcodec/ratecontrol.c
+++ b/libavcodec/ratecontrol.c
@@ -26,6 +26,8 @@
*/
#include "libavutil/attributes.h"
+#include "libavutil/internal.h"
+
#include "avcodec.h"
#include "internal.h"
#include "ratecontrol.h"
@@ -135,6 +137,13 @@ av_cold int ff_rate_control_init(MpegEncContext *s)
return res;
}
+#if FF_API_RC_STRATEGY
+FF_DISABLE_DEPRECATION_WARNINGS
+ if (!s->rc_strategy)
+ s->rc_strategy = s->avctx->rc_strategy;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
for (i = 0; i < 5; i++) {
rcc->pred[i].coeff = FF_QP2LAMBDA * 7.0;
rcc->pred[i].count = 1.0;
@@ -218,7 +227,7 @@ av_cold int ff_rate_control_init(MpegEncContext *s)
}
// FIXME maybe move to end
- if ((s->avctx->flags & CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID) {
+ if ((s->avctx->flags & CODEC_FLAG_PASS2) && s->rc_strategy == 1) {
#if CONFIG_LIBXVID
return ff_xvid_rate_control_init(s);
#else
@@ -298,7 +307,7 @@ av_cold void ff_rate_control_uninit(MpegEncContext *s)
av_freep(&rcc->entry);
#if CONFIG_LIBXVID
- if ((s->avctx->flags & CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID)
+ if ((s->avctx->flags & CODEC_FLAG_PASS2) && s->rc_strategy == 1)
ff_xvid_rate_control_uninit(s);
#endif
}
@@ -748,8 +757,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
emms_c();
#if CONFIG_LIBXVID
- if ((s->avctx->flags & CODEC_FLAG_PASS2) &&
- s->avctx->rc_strategy == FF_RC_STRATEGY_XVID)
+ if ((s->avctx->flags & CODEC_FLAG_PASS2) && s->rc_strategy == 1)
return ff_xvid_rate_estimate_qscale(s, dry_run);
#endif