From 65dd157c3c28bdfd3b4c20aa25cc6d5a28f4de03 Mon Sep 17 00:00:00 2001 From: Yunqing Wang Date: Wed, 16 May 2012 15:06:42 -0400 Subject: multi-res: force Key frame sychronization In multi-resolution encoding, frame_type decision for each frame is made by the lowest-resolution encoder. For all other higher- resolution encoders, kf_mode is always set to VPX_KF_DISABLED, and they are forced to use the same frame_type picked by the lowest-resolution encoder. Change-Id: Ic4d52ec65bbc012ca9c2d236210e28a295591eaf --- vpx/src/vpx_encoder.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'vpx') diff --git a/vpx/src/vpx_encoder.c b/vpx/src/vpx_encoder.c index 03ddc62b2..db0120c35 100644 --- a/vpx/src/vpx_encoder.c +++ b/vpx/src/vpx_encoder.c @@ -117,6 +117,13 @@ vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx, mr_cfg.mr_down_sampling_factor.num = dsf->num; mr_cfg.mr_down_sampling_factor.den = dsf->den; + /* Force Key-frame synchronization. Namely, encoder at higher + * resolution always use the same frame_type chosen by the + * lowest-resolution encoder. + */ + if(mr_cfg.mr_encoder_id) + cfg->kf_mode = VPX_KF_DISABLED; + ctx->iface = iface; ctx->name = iface->name; ctx->priv = NULL; -- cgit v1.2.3