aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libvpxenc.c
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2012-06-09 14:40:51 -0700
committerMichael Niedermayer <michaelni@gmx.at>2012-06-10 01:18:42 +0200
commit695e85f1895da2faf7dbc68ab8bf20add1562eed (patch)
treedfdd557994090684718a678f08af33657b8edc07 /libavcodec/libvpxenc.c
parent53dfc3845220a13dd969f9dd31e6938b2565e003 (diff)
downloadffmpeg-695e85f1895da2faf7dbc68ab8bf20add1562eed.tar.gz
libvpxenc: add VP8E_SET_MAX_INTRA_BITRATE_PCT mapping
defines 'max-intra-rate' in line with vpxenc param Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libvpxenc.c')
-rw-r--r--libavcodec/libvpxenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 58a44ec497..b3ec17d1ce 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -74,6 +74,7 @@ typedef struct VP8EncoderContext {
int lag_in_frames;
int error_resilient;
int crf;
+ int max_intra_rate;
} VP8Context;
/** String mappings for enum vp8e_enc_control_id */
@@ -95,6 +96,7 @@ static const char *const ctlidstr[] = {
[VP8E_SET_ARNR_STRENGTH] = "VP8E_SET_ARNR_STRENGTH",
[VP8E_SET_ARNR_TYPE] = "VP8E_SET_ARNR_TYPE",
[VP8E_SET_CQ_LEVEL] = "VP8E_SET_CQ_LEVEL",
+ [VP8E_SET_MAX_INTRA_BITRATE_PCT] = "VP8E_SET_MAX_INTRA_BITRATE_PCT",
};
static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc)
@@ -353,6 +355,8 @@ static av_cold int vp8_init(AVCodecContext *avctx)
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, ctx->crf);
+ if (ctx->max_intra_rate >= 0)
+ codecctl_int(avctx, VP8E_SET_MAX_INTRA_BITRATE_PCT, ctx->max_intra_rate);
av_log(avctx, AV_LOG_DEBUG, "Using deadline: %d\n", ctx->deadline);
@@ -556,6 +560,7 @@ static const AVOption options[] = {
{ "good", NULL, 0, AV_OPT_TYPE_CONST, {VPX_DL_GOOD_QUALITY}, 0, 0, VE, "quality"},
{ "realtime", NULL, 0, AV_OPT_TYPE_CONST, {VPX_DL_REALTIME}, 0, 0, VE, "quality"},
{ "error-resilient", "Error resilience configuration", OFFSET(error_resilient), AV_OPT_TYPE_FLAGS, {0}, INT_MIN, INT_MAX, VE, "er"},
+ { "max-intra-rate", "Maximum I-frame bitrate (pct) 0=unlimited", OFFSET(max_intra_rate), AV_OPT_TYPE_INT, {-1}, -1, INT_MAX, VE},
#ifdef VPX_ERROR_RESILIENT_DEFAULT
{ "default", "Improve resiliency against losses of whole frames", 0, AV_OPT_TYPE_CONST, {VPX_ERROR_RESILIENT_DEFAULT}, 0, 0, VE, "er"},
{ "partitions", "The frame partitions are independently decodable "