Commit 3ecf31db authored by Jingning Han's avatar Jingning Han Committed by Gerrit Code Review
Browse files

Merge "Separate frame context index for different frame types" into nextgenv2

parents 3bd709fa 8915eb8e
......@@ -47,7 +47,12 @@ extern "C" {
// normal reference pool.
#define FRAME_BUFFERS (REF_FRAMES + 7)
#if CONFIG_EXT_REFS
#define FRAME_CONTEXTS_LOG2 3
#else
#define FRAME_CONTEXTS_LOG2 2
#endif
#define FRAME_CONTEXTS (1 << FRAME_CONTEXTS_LOG2)
#define NUM_PING_PONG_BUFFERS 2
......
......@@ -285,7 +285,18 @@ static void setup_frame(VP10_COMP *cpi) {
if (frame_is_intra_only(cm) || cm->error_resilient_mode) {
vp10_setup_past_independence(cm);
} else {
cm->frame_context_idx = cpi->refresh_alt_ref_frame;
if (cpi->refresh_alt_ref_frame)
cm->frame_context_idx = ARF_FRAME;
else if (cpi->rc.is_src_frame_alt_ref)
cm->frame_context_idx = OVERLAY_FRAME;
else if (cpi->refresh_golden_frame)
cm->frame_context_idx = GLD_FRAME;
#if CONFIG_EXT_REFS
else if (cpi->refresh_bwd_ref_frame)
cm->frame_context_idx = BRF_FRAME;
#endif
else
cm->frame_context_idx = REGULAR_FRAME;
}
if (cm->frame_type == KEY_FRAME) {
......
......@@ -75,6 +75,21 @@ typedef struct {
FRAME_CONTEXT fc;
} CODING_CONTEXT;
typedef enum {
// regular inter frame
REGULAR_FRAME = 0,
// alternate reference frame
ARF_FRAME = 1,
// overlay frame
OVERLAY_FRAME = 2,
// golden frame
GLD_FRAME = 3,
#if CONFIG_EXT_REFS
// backward reference frame
BRF_FRAME = 4,
#endif
} FRAME_CONTEXT_INDEX;
typedef enum {
// encode_breakout is disabled.
ENCODE_BREAKOUT_DISABLED = 0,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment