ref: 32c51e82226a829c2f7564aaa07c9e7892668a5b
parent: b2904e2428e8c9978bb78f922050fca64dbfb581
parent: 889887aa682def080c9e221ea19325c75bb285f8
author: Dmitry Kovalev <[email protected]>
date: Tue May 13 11:00:22 EDT 2014
Merge "Inlining setup_key_frame() and setup_inter_frame()."
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -115,22 +115,6 @@
}
}
-static void setup_key_frame(VP9_COMP *cpi) {
- vp9_setup_past_independence(&cpi->common);
-
- // All buffers are implicitly updated on key frames.
- cpi->refresh_golden_frame = 1;
- cpi->refresh_alt_ref_frame = 1;
-}
-
-static void setup_inter_frame(VP9_COMMON *cm) {
- if (cm->error_resilient_mode || cm->intra_only)
- vp9_setup_past_independence(cm);
-
- assert(cm->frame_context_idx < FRAME_CONTEXTS);
- cm->fc = cm->frame_contexts[cm->frame_context_idx];
-}
-
static void setup_frame(VP9_COMP *cpi) {
VP9_COMMON *const cm = &cpi->common;
// Set up entropy context depending on frame type. The decoder mandates
@@ -138,16 +122,20 @@
// frames where the error_resilient_mode or intra_only flag is set. For
// other inter-frames the encoder currently uses only two contexts;
// context 1 for ALTREF frames and context 0 for the others.
+ if (frame_is_intra_only(cm) || cm->error_resilient_mode) {
+ vp9_setup_past_independence(cm);
+ } else {
+ if (!cpi->use_svc)
+ cm->frame_context_idx = cpi->refresh_alt_ref_frame;
+ }
+
if (cm->frame_type == KEY_FRAME) {
- setup_key_frame(cpi);
+ cpi->refresh_golden_frame = 1;
+ cpi->refresh_alt_ref_frame = 1;
} else {
- if (!cm->intra_only && !cm->error_resilient_mode && !cpi->use_svc)
- cm->frame_context_idx = cpi->refresh_alt_ref_frame;
- setup_inter_frame(cm);
+ cm->fc = cm->frame_contexts[cm->frame_context_idx];
}
}
-
-
void vp9_initialize_enc() {
static int init_done = 0;