From 14828e756f92175c1a3c097c1048c01bbfba43a9 Mon Sep 17 00:00:00 2001 From: James Zern Date: Wed, 24 Feb 2016 20:24:51 -0800 Subject: vp9: set kf_max_dist to a reasonable default (128) the same as vp8, with the same reasoning from: 2a0d7b1 Reduce the default kf_max_dist to 128. see also: https://trac.ffmpeg.org/ticket/4904 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815673 + restore vpxenc behavior of taking the library default rather than forcing 5s This change also exposes an issue with one-pass svc in cbr mode, keep the old default in datarate_test.cc for now. Change-Id: Id6d1244f42490b06fefc1a7b4e12a423a1f83e88 --- vpxenc.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'vpxenc.c') diff --git a/vpxenc.c b/vpxenc.c index f14470a6f..f24b1805b 100644 --- a/vpxenc.c +++ b/vpxenc.c @@ -804,7 +804,6 @@ struct stream_config { int arg_ctrls[ARG_CTRL_CNT_MAX][2]; int arg_ctrl_cnt; int write_webm; - int have_kf_max_dist; #if CONFIG_VP9_HIGHBITDEPTH // whether to use 16bit internal buffers int use_16bit_internal; @@ -1224,7 +1223,6 @@ static int parse_stream_params(struct VpxEncoderConfig *global, config->cfg.kf_min_dist = arg_parse_uint(&arg); } else if (arg_match(&arg, &kf_max_dist, argi)) { config->cfg.kf_max_dist = arg_parse_uint(&arg); - config->have_kf_max_dist = 1; } else if (arg_match(&arg, &kf_disabled, argi)) { config->cfg.kf_mode = VPX_KF_DISABLED; #if CONFIG_VP9_HIGHBITDEPTH @@ -1352,19 +1350,6 @@ static void set_stream_dimensions(struct stream_state *stream, } } - -static void set_default_kf_interval(struct stream_state *stream, - struct VpxEncoderConfig *global) { - /* Use a max keyframe interval of 5 seconds, if none was - * specified on the command line. - */ - if (!stream->config.have_kf_max_dist) { - double framerate = (double)global->framerate.num / global->framerate.den; - if (framerate > 0.0) - stream->config.cfg.kf_max_dist = (unsigned int)(5.0 * framerate); - } -} - static const char* file_type_to_string(enum VideoFileType t) { switch (t) { case FILE_TYPE_RAW: return "RAW"; @@ -2086,8 +2071,6 @@ int main(int argc, const char **argv_) { stream->config.cfg.g_timebase.num = global.framerate.den); } - FOREACH_STREAM(set_default_kf_interval(stream, &global)); - /* Show configuration */ if (global.verbose && pass == 0) FOREACH_STREAM(show_stream_config(stream, &global, &input)); -- cgit v1.2.3