From 2f24ad9e85e4db0d9d5b265a6d4c1f4b7db6babb Mon Sep 17 00:00:00 2001 From: John Koleszar <jkoleszar@google.com> Date: Fri, 18 Jan 2013 14:35:20 -0800 Subject: [PATCH] Use alt-ref frame context for keyframes This matches the behavior prior to generalizing the frame context selection, and intuitively makes sense in that the first forward ref is immediately after the keyframe, so it's quality is improved a bit by using the keyframe's entropy context rather than the default. Change-Id: Ia82cef79382b9d8cfafdc44ba0533d4dc3e44053 --- vp9/encoder/vp9_ratectrl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index b5e5fec2fa..be87326a03 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -286,6 +286,13 @@ void vp9_setup_key_frame(VP9_COMP *cpi) { sizeof(xd->mb_mv_ref_probs)); } #endif + + /* Choose which entropy context to use. When using a forward reference + * frame, it immediately follows the keyframe, and thus benefits from + * using the same entropy context established by the keyframe. Otherwise, + * use the default context 0. + */ + cm->frame_context_idx = cpi->oxcf.play_alternate; } void vp9_setup_inter_frame(VP9_COMP *cpi) { -- GitLab