Commit 70423376 authored by Anton Khirnov's avatar Anton Khirnov

libx264: add 'cplxblur' private option

Deprecate AVCodecContext.complexityblur
parent 71b5f442
...@@ -2449,14 +2449,14 @@ typedef struct AVCodecContext { ...@@ -2449,14 +2449,14 @@ typedef struct AVCodecContext {
*/ */
int trellis; int trellis;
#if FF_API_X264_GLOBAL_OPTS
/** /**
* Reduce fluctuations in qp (before curve compression). * Reduce fluctuations in qp (before curve compression).
* - encoding: Set by user. * - encoding: Set by user.
* - decoding: unused * - decoding: unused
*/ */
float complexityblur; attribute_deprecated float complexityblur;
#if FF_API_X264_GLOBAL_OPTS
/** /**
* in-loop deblocking filter alphac0 parameter * in-loop deblocking filter alphac0 parameter
* alpha is in the range -6...6 * alpha is in the range -6...6
......
...@@ -61,6 +61,7 @@ typedef struct X264Context { ...@@ -61,6 +61,7 @@ typedef struct X264Context {
int aud; int aud;
int mbtree; int mbtree;
char *deblock; char *deblock;
float cplxblur;
} 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)
...@@ -206,8 +207,6 @@ static av_cold int X264_init(AVCodecContext *avctx) ...@@ -206,8 +207,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.b_deblocking_filter = avctx->flags & CODEC_FLAG_LOOP_FILTER; x4->params.b_deblocking_filter = avctx->flags & CODEC_FLAG_LOOP_FILTER;
x4->params.rc.f_complexity_blur = avctx->complexityblur;
x4->params.analyse.inter = 0; x4->params.analyse.inter = 0;
if (avctx->partitions) { if (avctx->partitions) {
if (avctx->partitions & X264_PART_I4X4) if (avctx->partitions & X264_PART_I4X4)
...@@ -319,6 +318,8 @@ static av_cold int X264_init(AVCodecContext *avctx) ...@@ -319,6 +318,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.i_deblocking_filter_alphac0 = avctx->deblockalpha; x4->params.i_deblocking_filter_alphac0 = avctx->deblockalpha;
if (avctx->deblockbeta) if (avctx->deblockbeta)
x4->params.i_deblocking_filter_beta = avctx->deblockbeta; x4->params.i_deblocking_filter_beta = avctx->deblockbeta;
if (avctx->complexityblur >= 0)
x4->params.rc.f_complexity_blur = avctx->complexityblur;
x4->params.analyse.b_ssim = avctx->flags2 & CODEC_FLAG2_SSIM; x4->params.analyse.b_ssim = avctx->flags2 & CODEC_FLAG2_SSIM;
x4->params.b_intra_refresh = avctx->flags2 & CODEC_FLAG2_INTRA_REFRESH; x4->params.b_intra_refresh = avctx->flags2 & CODEC_FLAG2_INTRA_REFRESH;
x4->params.i_bframe_pyramid = avctx->flags2 & CODEC_FLAG2_BPYRAMID ? X264_B_PYRAMID_NORMAL : X264_B_PYRAMID_NONE; x4->params.i_bframe_pyramid = avctx->flags2 & CODEC_FLAG2_BPYRAMID ? X264_B_PYRAMID_NORMAL : X264_B_PYRAMID_NONE;
...@@ -364,6 +365,8 @@ static av_cold int X264_init(AVCodecContext *avctx) ...@@ -364,6 +365,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.analyse.i_weighted_pred = x4->weightp; x4->params.analyse.i_weighted_pred = x4->weightp;
if (x4->weightb >= 0) if (x4->weightb >= 0)
x4->params.analyse.b_weighted_bipred = x4->weightb; x4->params.analyse.b_weighted_bipred = x4->weightb;
if (x4->cplxblur >= 0)
x4->params.rc.f_complexity_blur = x4->cplxblur;
if (x4->ssim >= 0) if (x4->ssim >= 0)
x4->params.analyse.b_ssim = x4->ssim; x4->params.analyse.b_ssim = x4->ssim;
...@@ -482,6 +485,7 @@ static const AVOption options[] = { ...@@ -482,6 +485,7 @@ static const AVOption options[] = {
{ "aud", "Use access unit delimiters.", OFFSET(aud), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE}, { "aud", "Use access unit delimiters.", OFFSET(aud), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE},
{ "mbtree", "Use macroblock tree ratecontrol.", OFFSET(mbtree), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE}, { "mbtree", "Use macroblock tree ratecontrol.", OFFSET(mbtree), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE},
{ "deblock", "Loop filter parameters, in <alpha:beta> form.", OFFSET(deblock), FF_OPT_TYPE_STRING, { 0 }, 0, 0, VE}, { "deblock", "Loop filter parameters, in <alpha:beta> form.", OFFSET(deblock), FF_OPT_TYPE_STRING, { 0 }, 0, 0, VE},
{ "cplxblur", "Reduce fluctuations in QP (before curve compression)", OFFSET(cplxblur), FF_OPT_TYPE_FLOAT, {-1 }, -1, FLT_MAX, VE},
{ NULL }, { NULL },
}; };
......
...@@ -412,8 +412,8 @@ static const AVOption options[]={ ...@@ -412,8 +412,8 @@ static const AVOption options[]={
{"aud", "access unit delimiters (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_AUD }, INT_MIN, INT_MAX, V|E, "flags2"}, {"aud", "access unit delimiters (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_AUD }, INT_MIN, INT_MAX, V|E, "flags2"},
#endif #endif
{"skiprd", "RD optimal MB level residual skipping", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SKIP_RD }, INT_MIN, INT_MAX, V|E, "flags2"}, {"skiprd", "RD optimal MB level residual skipping", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SKIP_RD }, INT_MIN, INT_MAX, V|E, "flags2"},
{"complexityblur", "reduce fluctuations in qp (before curve compression)", OFFSET(complexityblur), FF_OPT_TYPE_FLOAT, {.dbl = 20.0 }, FLT_MIN, FLT_MAX, V|E},
#if FF_API_X264_GLOBAL_OPTS #if FF_API_X264_GLOBAL_OPTS
{"complexityblur", "reduce fluctuations in qp (before curve compression)", OFFSET(complexityblur), FF_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, V|E},
{"deblockalpha", "in-loop deblocking filter alphac0 parameter", OFFSET(deblockalpha), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, -6, 6, V|E}, {"deblockalpha", "in-loop deblocking filter alphac0 parameter", OFFSET(deblockalpha), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, -6, 6, V|E},
{"deblockbeta", "in-loop deblocking filter beta parameter", OFFSET(deblockbeta), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, -6, 6, V|E}, {"deblockbeta", "in-loop deblocking filter beta parameter", OFFSET(deblockbeta), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, -6, 6, V|E},
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment