From 1cc573966932d4054c5ba9a7702a566632d844c3 Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Wed, 28 Nov 2012 11:07:50 -0800 Subject: [PATCH] remove the vp9_default_mode_contexts_a Given the way mode_context is updated, the benefit of an additional default is not signficant. Change-Id: I67489453e8781340b18e26a1cc2f04e9221004a2 --- vp9/common/vp9_entropymode.c | 3 +++ vp9/common/vp9_modecont.c | 9 --------- vp9/common/vp9_modecont.h | 1 - vp9/decoder/vp9_decodframe.c | 8 -------- vp9/encoder/vp9_ratectrl.c | 7 ------- 5 files changed, 3 insertions(+), 25 deletions(-) diff --git a/vp9/common/vp9_entropymode.c b/vp9/common/vp9_entropymode.c index 0eb21ca82..be8c1a0ca 100644 --- a/vp9/common/vp9_entropymode.c +++ b/vp9/common/vp9_entropymode.c @@ -448,6 +448,9 @@ void vp9_entropy_mode_init() { void vp9_init_mode_contexts(VP9_COMMON *pc) { vpx_memset(pc->fc.mv_ref_ct, 0, sizeof(pc->fc.mv_ref_ct)); + vpx_memcpy(pc->fc.vp9_mode_contexts, + vp9_default_mode_contexts, + sizeof(vp9_default_mode_contexts)); } void vp9_accum_mv_refs(VP9_COMMON *pc, diff --git a/vp9/common/vp9_modecont.c b/vp9/common/vp9_modecont.c index 2f5bbd2ba..70bcd5d63 100644 --- a/vp9/common/vp9_modecont.c +++ b/vp9/common/vp9_modecont.c @@ -20,12 +20,3 @@ const int vp9_default_mode_contexts[INTER_MODE_CONTEXTS][4] = { {14, 122, 22, 164}, // strong nz candidate(s), split {16, 70, 9, 183}, // weak nz candidate(s), split }; -const int vp9_default_mode_contexts_a[INTER_MODE_CONTEXTS][4] = { - {204, 1, 1, 213}, // 0,0 best: Only candidate - {106, 139, 22, 203}, // 0,0 best: non zero candidates - {75, 52, 15, 118}, // 0,0 best: non zero candidates, split - {12, 148, 61, 211}, // strong nz candidate(s), no split - {18, 98, 17, 199}, // weak nz candidate(s), no split - {11, 91, 25, 148}, // strong nz candidate(s), split - {10, 53, 9, 145}, // weak nz candidate(s), split -}; diff --git a/vp9/common/vp9_modecont.h b/vp9/common/vp9_modecont.h index 1fa4558e1..b142bd0f3 100644 --- a/vp9/common/vp9_modecont.h +++ b/vp9/common/vp9_modecont.h @@ -13,5 +13,4 @@ #define __INC_MODECONT_H extern const int vp9_default_mode_contexts[INTER_MODE_CONTEXTS][4]; -extern const int vp9_default_mode_contexts_a[INTER_MODE_CONTEXTS][4]; #endif diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c index a89670108..5a9e8185d 100644 --- a/vp9/decoder/vp9_decodframe.c +++ b/vp9/decoder/vp9_decodframe.c @@ -863,17 +863,9 @@ static void init_frame(VP9D_COMP *pbi) { pc->ref_frame_sign_bias[ALTREF_FRAME] = 0; vp9_init_mode_contexts(&pbi->common); - vpx_memcpy(pbi->common.fc.vp9_mode_contexts, - vp9_default_mode_contexts, - sizeof(vp9_default_mode_contexts)); - vpx_memcpy(&pc->lfc, &pc->fc, sizeof(pc->fc)); vpx_memcpy(&pc->lfc_a, &pc->fc, sizeof(pc->fc)); - vpx_memcpy(pbi->common.lfc.vp9_mode_contexts, - vp9_default_mode_contexts_a, - sizeof(vp9_default_mode_contexts_a)); - vpx_memset(pc->prev_mip, 0, (pc->mb_cols + 1) * (pc->mb_rows + 1)* sizeof(MODE_INFO)); vpx_memset(pc->mip, 0, diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index 0ceb4f653..ef9261d4b 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -261,16 +261,9 @@ void vp9_setup_key_frame(VP9_COMP *cpi) { cpi->common.refresh_alt_ref_frame = TRUE; vp9_init_mode_contexts(&cpi->common); - vpx_memcpy(cpi->common.fc.vp9_mode_contexts, - vp9_default_mode_contexts, - sizeof(vp9_default_mode_contexts)); vpx_memcpy(&cpi->common.lfc, &cpi->common.fc, sizeof(cpi->common.fc)); vpx_memcpy(&cpi->common.lfc_a, &cpi->common.fc, sizeof(cpi->common.fc)); - vpx_memcpy(cpi->common.lfc.vp9_mode_contexts, - vp9_default_mode_contexts_a, - sizeof(vp9_default_mode_contexts_a)); - vpx_memset(cm->prev_mip, 0, (cm->mb_cols + 1) * (cm->mb_rows + 1)* sizeof(MODE_INFO)); vpx_memset(cm->mip, 0, -- 2.40.0