mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-22 02:48:37 +00:00
libx264: add 'aq_strength' private option.
Deprecate corresponding global option.
This commit is contained in:
parent
85254fcb46
commit
5c75b2a0b7
@ -2732,7 +2732,6 @@ typedef struct AVCodecContext {
|
|||||||
* - decoding: unused
|
* - decoding: unused
|
||||||
*/
|
*/
|
||||||
attribute_deprecated int aq_mode;
|
attribute_deprecated int aq_mode;
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AQ strength
|
* AQ strength
|
||||||
@ -2740,7 +2739,8 @@ typedef struct AVCodecContext {
|
|||||||
* - encoding: Set by user
|
* - encoding: Set by user
|
||||||
* - decoding: unused
|
* - decoding: unused
|
||||||
*/
|
*/
|
||||||
float aq_strength;
|
attribute_deprecated float aq_strength;
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PSY RD
|
* PSY RD
|
||||||
|
@ -44,6 +44,7 @@ typedef struct X264Context {
|
|||||||
float crf;
|
float crf;
|
||||||
int cqp;
|
int cqp;
|
||||||
int aq_mode;
|
int aq_mode;
|
||||||
|
float aq_strength;
|
||||||
} X264Context;
|
} X264Context;
|
||||||
|
|
||||||
static void X264_log(void *p, int level, const char *fmt, va_list args)
|
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;
|
x4->params.analyse.i_me_method = X264_ME_TESA;
|
||||||
else x4->params.analyse.i_me_method = X264_ME_HEX;
|
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.rc.i_lookahead = avctx->rc_lookahead;
|
||||||
|
|
||||||
x4->params.analyse.b_psy = avctx->flags2 & CODEC_FLAG2_PSY;
|
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 FF_API_X264_GLOBAL_OPTS
|
||||||
if (avctx->aq_mode >= 0)
|
if (avctx->aq_mode >= 0)
|
||||||
x4->params.rc.i_aq_mode = avctx->aq_mode;
|
x4->params.rc.i_aq_mode = avctx->aq_mode;
|
||||||
|
if (avctx->aq_strength >= 0)
|
||||||
|
x4->params.rc.f_aq_strength = avctx->aq_strength;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (x4->aq_mode >= 0)
|
if (x4->aq_mode >= 0)
|
||||||
x4->params.rc.i_aq_mode = x4->aq_mode;
|
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)
|
if (x4->fastfirstpass)
|
||||||
x264_param_apply_fastfirstpass(&x4->params);
|
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" },
|
{ "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" },
|
{ "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" },
|
{ "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 },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -441,8 +441,8 @@ static const AVOption options[]={
|
|||||||
{"psy_trellis", "specify psycho visual trellis", OFFSET(psy_trellis), FF_OPT_TYPE_FLOAT, {.dbl = 0 }, 0, FLT_MAX, V|E},
|
{"psy_trellis", "specify psycho visual trellis", OFFSET(psy_trellis), FF_OPT_TYPE_FLOAT, {.dbl = 0 }, 0, FLT_MAX, V|E},
|
||||||
#if FF_API_X264_GLOBAL_OPTS
|
#if FF_API_X264_GLOBAL_OPTS
|
||||||
{"aq_mode", "specify aq method", OFFSET(aq_mode), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, INT_MAX, V|E},
|
{"aq_mode", "specify aq method", OFFSET(aq_mode), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, INT_MAX, V|E},
|
||||||
|
{"aq_strength", "specify aq strength", OFFSET(aq_strength), FF_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1, FLT_MAX, V|E},
|
||||||
#endif
|
#endif
|
||||||
{"aq_strength", "specify aq strength", OFFSET(aq_strength), FF_OPT_TYPE_FLOAT, {.dbl = 1.0 }, 0, FLT_MAX, V|E},
|
|
||||||
{"rc_lookahead", "specify number of frames to look ahead for frametype", OFFSET(rc_lookahead), FF_OPT_TYPE_INT, {.dbl = 40 }, 0, INT_MAX, V|E},
|
{"rc_lookahead", "specify number of frames to look ahead for frametype", OFFSET(rc_lookahead), FF_OPT_TYPE_INT, {.dbl = 40 }, 0, INT_MAX, V|E},
|
||||||
{"ssim", "ssim will be calculated during encoding", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SSIM }, INT_MIN, INT_MAX, V|E, "flags2"},
|
{"ssim", "ssim will be calculated during encoding", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SSIM }, INT_MIN, INT_MAX, V|E, "flags2"},
|
||||||
{"intra_refresh", "use periodic insertion of intra blocks instead of keyframes", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_INTRA_REFRESH }, INT_MIN, INT_MAX, V|E, "flags2"},
|
{"intra_refresh", "use periodic insertion of intra blocks instead of keyframes", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_INTRA_REFRESH }, INT_MIN, INT_MAX, V|E, "flags2"},
|
||||||
|
Loading…
Reference in New Issue
Block a user