summaryrefslogtreecommitdiff
path: root/libavcodec/libx264.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-08-22 07:55:34 +0200
committerAnton Khirnov <anton@khirnov.net>2011-08-24 14:30:00 +0200
commit5c75b2a0b75f2d12a289af70c0ad99eac0533eb3 (patch)
treede3499f4cf38b52d539f5b86f3833c3eeba9ee7c /libavcodec/libx264.c
parent85254fcb46b4af38510685bc48ae6aa557f861aa (diff)
libx264: add 'aq_strength' private option.
Deprecate corresponding global option.
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 7d6f1408d0..b46e10a73d 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -44,6 +44,7 @@ typedef struct X264Context {
float crf;
int cqp;
int aq_mode;
+ float aq_strength;
} X264Context;
static void X264_log(void *p, int level, const char *fmt, va_list args)
@@ -235,7 +236,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.analyse.i_me_method = X264_ME_TESA;
else x4->params.analyse.i_me_method = X264_ME_HEX;
- x4->params.rc.f_aq_strength = avctx->aq_strength;
x4->params.rc.i_lookahead = avctx->rc_lookahead;
x4->params.analyse.b_psy = avctx->flags2 & CODEC_FLAG2_PSY;
@@ -311,11 +311,14 @@ static av_cold int X264_init(AVCodecContext *avctx)
#if FF_API_X264_GLOBAL_OPTS
if (avctx->aq_mode >= 0)
x4->params.rc.i_aq_mode = avctx->aq_mode;
+ if (avctx->aq_strength >= 0)
+ x4->params.rc.f_aq_strength = avctx->aq_strength;
#endif
if (x4->aq_mode >= 0)
x4->params.rc.i_aq_mode = x4->aq_mode;
-
+ if (x4->aq_strength >= 0)
+ x4->params.rc.f_aq_strength = x4->aq_strength;
if (x4->fastfirstpass)
x264_param_apply_fastfirstpass(&x4->params);
@@ -395,6 +398,7 @@ static const AVOption options[] = {
{ "none", NULL, 0, FF_OPT_TYPE_CONST, {X264_AQ_NONE}, INT_MIN, INT_MAX, VE, "aq_mode" },
{ "variance", "Variance AQ (complexity mask)", 0, FF_OPT_TYPE_CONST, {X264_AQ_VARIANCE}, INT_MIN, INT_MAX, VE, "aq_mode" },
{ "autovariance", "Auto-variance AQ (experimental)", 0, FF_OPT_TYPE_CONST, {X264_AQ_AUTOVARIANCE}, INT_MIN, INT_MAX, VE, "aq_mode" },
+ { "aq_strength", "AQ strength. Reduces blocking and blurring in flat and textured areas.", OFFSET(aq_strength), FF_OPT_TYPE_FLOAT, {-1}, -1, FLT_MAX, VE},
{ NULL },
};