Commit 997e46d3 authored by Hui Su's avatar Hui Su

Add macro for compound backward ref frame contexts

Change-Id: Ic9ecd2d4695c24feca109d7e4470b9f1da7a13f0
parent 7131b48b
......@@ -1436,12 +1436,10 @@ static const aom_cdf_prob
};
static const aom_cdf_prob
default_comp_bwdref_cdf[REF_CONTEXTS][BWD_REFS - 1][CDF_SIZE(2)] = {
default_comp_bwdref_cdf[COMP_BWDREF_CONTEXTS][BWD_REFS - 1][CDF_SIZE(2)] = {
{ { AOM_CDF2(2762) }, { AOM_CDF2(1614) } },
{ { AOM_CDF2(17976) }, { AOM_CDF2(15912) } },
{ { AOM_CDF2(30894) }, { AOM_CDF2(30639) } },
{ { AOM_CDF2(16384) }, { AOM_CDF2(16384) } },
{ { AOM_CDF2(16384) }, { AOM_CDF2(16384) } }
};
static const aom_cdf_prob default_single_ref_cdf[REF_CONTEXTS][SINGLE_REFS - 1]
......
......@@ -167,7 +167,7 @@ typedef struct frame_contexts {
#endif // CONFIG_EXT_COMP_REFS
aom_prob comp_ref_prob[REF_CONTEXTS][FWD_REFS - 1];
aom_cdf_prob comp_ref_cdf[REF_CONTEXTS][FWD_REFS - 1][CDF_SIZE(2)];
aom_cdf_prob comp_bwdref_cdf[REF_CONTEXTS][BWD_REFS - 1][CDF_SIZE(2)];
aom_cdf_prob comp_bwdref_cdf[COMP_BWDREF_CONTEXTS][BWD_REFS - 1][CDF_SIZE(2)];
aom_cdf_prob txfm_partition_cdf[TXFM_PARTITION_CONTEXTS][CDF_SIZE(2)];
#if CONFIG_JNT_COMP
aom_cdf_prob compound_index_cdf[COMP_INDEX_CONTEXTS][CDF_SIZE(2)];
......
......@@ -606,6 +606,7 @@ typedef enum ATTRIBUTE_PACKED {
#define INTRA_INTER_CONTEXTS 4
#define COMP_INTER_CONTEXTS 5
#define COMP_BWDREF_CONTEXTS 3
#define REF_CONTEXTS 5
#if CONFIG_EXT_COMP_REFS
......
......@@ -813,7 +813,7 @@ int av1_get_pred_context_brfarf2_or_arf(const MACROBLOCKD *xd) {
const int pred_context =
(brfarf2_count == arf_count) ? 1 : ((brfarf2_count < arf_count) ? 0 : 2);
assert(pred_context >= 0 && pred_context < REF_CONTEXTS);
assert(pred_context >= 0 && pred_context < COMP_BWDREF_CONTEXTS);
return pred_context;
}
......@@ -858,7 +858,7 @@ int av1_get_pred_context_brf_or_arf2(const MACROBLOCKD *xd) {
const int pred_context =
(brf_count == arf2_count) ? 1 : ((brf_count < arf2_count) ? 0 : 2);
assert(pred_context >= 0 && pred_context < REF_CONTEXTS);
assert(pred_context >= 0 && pred_context < COMP_BWDREF_CONTEXTS);
return pred_context;
}
......
......@@ -284,7 +284,7 @@ void av1_fill_mode_rates(AV1_COMMON *const cm, MACROBLOCK *x,
}
}
for (i = 0; i < REF_CONTEXTS; ++i) {
for (i = 0; i < COMP_BWDREF_CONTEXTS; ++i) {
for (j = 0; j < BWD_REFS - 1; ++j) {
av1_cost_tokens_from_cdf(x->comp_bwdref_cost[i][j],
fc->comp_bwdref_cdf[i][j], NULL);
......
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