diff options
author | John Koleszar <jkoleszar@google.com> | 2010-06-24 08:41:51 -0400 |
---|---|---|
committer | John Koleszar <jkoleszar@google.com> | 2010-06-24 08:41:56 -0400 |
commit | b1e36f2872b8f645b806a151e3e88540adcde614 (patch) | |
tree | e3f526ed2b9dbbcd5cb22721858f89c0fea62ab6 | |
parent | 3d5cd513fa47cd100bbc6018be072f247fe717fc (diff) | |
download | libvpx-b1e36f2872b8f645b806a151e3e88540adcde614.tar libvpx-b1e36f2872b8f645b806a151e3e88540adcde614.tar.gz libvpx-b1e36f2872b8f645b806a151e3e88540adcde614.tar.bz2 libvpx-b1e36f2872b8f645b806a151e3e88540adcde614.zip |
ivfenc: correct fixed kf interval, --disable-kf
ivfenc was setting the VPX_KF_FIXED mode when the kf_min_dist and
kf_max_dist parameters were set to each other. This flag actually means
that keyframes are disabled, and that name was deprecated to avoid
confusion such as this. Instead, a new option is exposed for setting the
VPX_KF_DISABLED mode, and the intervals are passed through to the codec,
which will do automatic placement at a fixed interval as expected.
Change-Id: I15abbec5936f39d5901878b4bc154372fbc23a43
-rw-r--r-- | ivfenc.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -505,9 +505,11 @@ static const arg_def_t kf_min_dist = ARG_DEF(NULL, "kf-min-dist", 1, "Minimum keyframe interval (frames)"); static const arg_def_t kf_max_dist = ARG_DEF(NULL, "kf-max-dist", 1, "Maximum keyframe interval (frames)"); +static const arg_def_t kf_disabled = ARG_DEF(NULL, "disable-kf", 0, + "Disable keyframe placement"); static const arg_def_t *kf_args[] = { - &kf_min_dist, &kf_max_dist, NULL + &kf_min_dist, &kf_max_dist, &kf_disabled, NULL }; @@ -800,6 +802,8 @@ int main(int argc, const char **argv_) cfg.kf_min_dist = arg_parse_uint(&arg); else if (arg_match(&arg, &kf_max_dist, argi)) cfg.kf_max_dist = arg_parse_uint(&arg); + else if (arg_match(&arg, &kf_disabled, argi)) + cfg.kf_mode = VPX_KF_DISABLED; else argj++; } @@ -1016,9 +1020,6 @@ int main(int argc, const char **argv_) /* Construct Encoder Context */ - if (cfg.kf_min_dist == cfg.kf_max_dist) - cfg.kf_mode = VPX_KF_FIXED; - vpx_codec_enc_init(&encoder, codec->iface, &cfg, show_psnr ? VPX_CODEC_USE_PSNR : 0); ctx_exit_on_error(&encoder, "Failed to initialize encoder"); |