summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_enc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-02-27 12:23:19 +0100
committerAnton Khirnov <anton@khirnov.net>2012-02-29 07:13:58 +0100
commitaf3d804f9feebe34ad3815c501fba795b801cdd0 (patch)
tree65ed35dc0e5c52318fcf5c9728b1dda1466a2cf6 /libavcodec/mpegvideo_enc.c
parentff71a383ac884706903b2613d6f885021b69e552 (diff)
mpegvideo_enc: add cbp_rd flag to mpv_flags.
Deprecate CODEC_FLAG_CBP_RD.
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index bb348137aa..e6e6a95b48 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -495,7 +495,12 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
return -1;
}
- if ((s->flags & CODEC_FLAG_CBP_RD) && !avctx->trellis) {
+#if FF_API_MPV_GLOBAL_OPTS
+ if (s->flags & CODEC_FLAG_CBP_RD)
+ s->mpv_flags |= FF_MPV_FLAG_CBP_RD;
+#endif
+
+ if ((s->mpv_flags & FF_MPV_FLAG_CBP_RD) && !avctx->trellis) {
av_log(avctx, AV_LOG_ERROR, "CBP RD needs trellis quant\n");
return -1;
}
@@ -1998,7 +2003,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
for (i = 4; i < mb_block_count; i++)
dct_single_coeff_elimination(s, i, s->chroma_elim_threshold);
- if (s->flags & CODEC_FLAG_CBP_RD) {
+ if (s->mpv_flags & FF_MPV_FLAG_CBP_RD) {
for (i = 0; i < mb_block_count; i++) {
if (s->block_last_index[i] == -1)
s->coded_score[i] = INT_MAX / 256;