diff options
author | James Zern <jzern@google.com> | 2011-04-11 17:00:35 -0700 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-04-12 03:54:28 +0200 |
commit | 8eeed0db05966e94bfff53b2010b8c7d4e52e3f9 (patch) | |
tree | b101ba746167b11ec948958fd1af9542dfefdbf8 /libavcodec/libvpxenc.c | |
parent | a299a261de798ddc694111e539c32f0413a02bd8 (diff) | |
download | ffmpeg-8eeed0db05966e94bfff53b2010b8c7d4e52e3f9.tar.gz |
vpxenc: add CQ_LEVEL mapping
via the equivalent AVCodecContext::crf modifying the range allowed by
options.c (0-51 -> 0-63)
update configure check to require libvpx 0.9.6 (Bali)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libvpxenc.c')
-rw-r--r-- | libavcodec/libvpxenc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 8097b67bf2..1cdac740b4 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -72,6 +72,7 @@ static const char *ctlidstr[] = { [VP8E_SET_ARNR_MAXFRAMES] = "VP8E_SET_ARNR_MAXFRAMES", [VP8E_SET_ARNR_STRENGTH] = "VP8E_SET_ARNR_STRENGTH", [VP8E_SET_ARNR_TYPE] = "VP8E_SET_ARNR_TYPE", + [VP8E_SET_CQ_LEVEL] = "VP8E_SET_CQ_LEVEL", }; static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc) @@ -234,6 +235,8 @@ static av_cold int vp8_init(AVCodecContext *avctx) if (avctx->rc_min_rate == avctx->rc_max_rate && avctx->rc_min_rate == avctx->bit_rate) enccfg.rc_end_usage = VPX_CBR; + else if (avctx->crf) + enccfg.rc_end_usage = VPX_CQ; enccfg.rc_target_bitrate = av_rescale_rnd(avctx->bit_rate, 1, 1000, AV_ROUND_NEAR_INF); @@ -312,6 +315,7 @@ static av_cold int vp8_init(AVCodecContext *avctx) codecctl_int(avctx, VP8E_SET_NOISE_SENSITIVITY, avctx->noise_reduction); codecctl_int(avctx, VP8E_SET_TOKEN_PARTITIONS, av_log2(avctx->slices)); codecctl_int(avctx, VP8E_SET_STATIC_THRESHOLD, avctx->mb_threshold); + codecctl_int(avctx, VP8E_SET_CQ_LEVEL, (int)avctx->crf); //provide dummy value to initialize wrapper, values will be updated each _encode() vpx_img_wrap(&ctx->rawimg, VPX_IMG_FMT_I420, avctx->width, avctx->height, 1, |