mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 11:19:55 +00:00
libvpxenc,vp9: add corpus-complexity option
Corpus VBR mode is a variant of standard VBR where the complexity distribution midpoint is passed in rather than calculated for a specific clip or chunk. The valid range is [0, 10000]. 0 (default) uses standard VBR. Signed-off-by: James Zern <jzern@google.com>
This commit is contained in:
parent
ed4a0c7923
commit
86cead5256
@ -1683,6 +1683,11 @@ colorspaces:
|
||||
Enable row based multi-threading.
|
||||
@item tune-content
|
||||
Set content type: default (0), screen (1), film (2).
|
||||
@item corpus-complexity
|
||||
Corpus VBR mode is a variant of standard VBR where the complexity distribution
|
||||
midpoint is passed in rather than calculated for a specific clip or chunk.
|
||||
|
||||
The valid range is [0, 10000]. 0 (default) uses standard VBR.
|
||||
@end table
|
||||
|
||||
@end table
|
||||
|
@ -110,6 +110,7 @@ typedef struct VPxEncoderContext {
|
||||
float level;
|
||||
int row_mt;
|
||||
int tune_content;
|
||||
int corpus_complexity;
|
||||
} VPxContext;
|
||||
|
||||
/** String mappings for enum vp8e_enc_control_id */
|
||||
@ -213,6 +214,10 @@ static av_cold void dump_enc_cfg(AVCodecContext *avctx,
|
||||
width, "rc_2pass_vbr_bias_pct:", cfg->rc_2pass_vbr_bias_pct,
|
||||
width, "rc_2pass_vbr_minsection_pct:", cfg->rc_2pass_vbr_minsection_pct,
|
||||
width, "rc_2pass_vbr_maxsection_pct:", cfg->rc_2pass_vbr_maxsection_pct);
|
||||
#if VPX_ENCODER_ABI_VERSION >= 14
|
||||
av_log(avctx, level, " %*s%u\n",
|
||||
width, "rc_2pass_vbr_corpus_complexity:", cfg->rc_2pass_vbr_corpus_complexity);
|
||||
#endif
|
||||
av_log(avctx, level, "keyframing settings\n"
|
||||
" %*s%d\n %*s%u\n %*s%u\n",
|
||||
width, "kf_mode:", cfg->kf_mode,
|
||||
@ -565,6 +570,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
if (avctx->rc_max_rate)
|
||||
enccfg.rc_2pass_vbr_maxsection_pct =
|
||||
avctx->rc_max_rate * 100LL / avctx->bit_rate;
|
||||
#if CONFIG_LIBVPX_VP9_ENCODER
|
||||
if (avctx->codec_id == AV_CODEC_ID_VP9) {
|
||||
#if VPX_ENCODER_ABI_VERSION >= 14
|
||||
if (ctx->corpus_complexity >= 0)
|
||||
enccfg.rc_2pass_vbr_corpus_complexity = ctx->corpus_complexity;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
if (avctx->rc_buffer_size)
|
||||
enccfg.rc_buf_sz =
|
||||
@ -1140,6 +1153,9 @@ static const AVOption vp9_options[] = {
|
||||
#if VPX_ENCODER_ABI_VERSION >= 14
|
||||
{ "film", "Film content; improves grain retention", 0, AV_OPT_TYPE_CONST, {.i64 = 2}, 0, 0, VE, "tune_content" },
|
||||
#endif
|
||||
#endif
|
||||
#if VPX_ENCODER_ABI_VERSION >= 14
|
||||
{ "corpus-complexity", "corpus vbr complexity midpoint", OFFSET(corpus_complexity), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 10000, VE },
|
||||
#endif
|
||||
LEGACY_OPTIONS
|
||||
{ NULL }
|
||||
|
Loading…
Reference in New Issue
Block a user