Inlining setup_key_frame() and setup_inter_frame().
Change-Id: I6c0f0f91c189c041559f724f4faeada144390353
This commit is contained in:
parent
38f3cf125e
commit
889887aa68
@ -115,22 +115,6 @@ static void set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
static void setup_frame(VP9_COMP *cpi) {
|
||||||
VP9_COMMON *const cm = &cpi->common;
|
VP9_COMMON *const cm = &cpi->common;
|
||||||
// Set up entropy context depending on frame type. The decoder mandates
|
// Set up entropy context depending on frame type. The decoder mandates
|
||||||
@ -138,17 +122,21 @@ static void setup_frame(VP9_COMP *cpi) {
|
|||||||
// frames where the error_resilient_mode or intra_only flag is set. For
|
// frames where the error_resilient_mode or intra_only flag is set. For
|
||||||
// other inter-frames the encoder currently uses only two contexts;
|
// other inter-frames the encoder currently uses only two contexts;
|
||||||
// context 1 for ALTREF frames and context 0 for the others.
|
// context 1 for ALTREF frames and context 0 for the others.
|
||||||
if (cm->frame_type == KEY_FRAME) {
|
if (frame_is_intra_only(cm) || cm->error_resilient_mode) {
|
||||||
setup_key_frame(cpi);
|
vp9_setup_past_independence(cm);
|
||||||
} else {
|
} else {
|
||||||
if (!cm->intra_only && !cm->error_resilient_mode && !cpi->use_svc)
|
if (!cpi->use_svc)
|
||||||
cm->frame_context_idx = cpi->refresh_alt_ref_frame;
|
cm->frame_context_idx = cpi->refresh_alt_ref_frame;
|
||||||
setup_inter_frame(cm);
|
}
|
||||||
|
|
||||||
|
if (cm->frame_type == KEY_FRAME) {
|
||||||
|
cpi->refresh_golden_frame = 1;
|
||||||
|
cpi->refresh_alt_ref_frame = 1;
|
||||||
|
} else {
|
||||||
|
cm->fc = cm->frame_contexts[cm->frame_context_idx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void vp9_initialize_enc() {
|
void vp9_initialize_enc() {
|
||||||
static int init_done = 0;
|
static int init_done = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user