JNT_COMP: reduce context model number
Reduce context model number from 9 to 6.
Let context be two kinds: two reference frames are equal distance
or not.
Also, give equal distance compound weight {9, 7} instead of {8, 8}/16
Reducing context model gives neutral performance.
New compound weight provides -0.14% gain.
Change-Id: I8a3f3021eac9e446ac826e5992f42931af4c8962
diff --git a/av1/common/common_data.h b/av1/common/common_data.h
index 5edd740..a2a0d8e 100644
--- a/av1/common/common_data.h
+++ b/av1/common/common_data.h
@@ -1846,8 +1846,8 @@
// the unit tests need to be changed accordingly.
static const double quant_dist_category[4] = { 1.5, 2.5, 3.5, 255 };
static const int quant_dist_lookup_table[2][4][2] = {
- { { 8, 8 }, { 11, 5 }, { 12, 4 }, { 13, 3 } },
- { { 8, 8 }, { 5, 11 }, { 4, 12 }, { 3, 13 } },
+ { { 9, 7 }, { 11, 5 }, { 12, 4 }, { 13, 3 } },
+ { { 7, 9 }, { 5, 11 }, { 4, 12 }, { 3, 13 } },
};
#endif // CONFIG_JNT_COMP
diff --git a/av1/common/entropymode.c b/av1/common/entropymode.c
index a50a20f..6eac13b 100644
--- a/av1/common/entropymode.c
+++ b/av1/common/entropymode.c
@@ -1629,13 +1629,10 @@
{ AOM_ICDF(24576), AOM_ICDF(32768), 0 },
{ AOM_ICDF(16384), AOM_ICDF(32768), 0 },
{ AOM_ICDF(8192), AOM_ICDF(32768), 0 },
- { AOM_ICDF(24576), AOM_ICDF(32768), 0 },
- { AOM_ICDF(16384), AOM_ICDF(32768), 0 },
- { AOM_ICDF(8192), AOM_ICDF(32768), 0 }
};
#endif // CONFIG_NEW_MULTISYMBOL
static const aom_prob default_compound_idx_probs[COMP_INDEX_CONTEXTS] = {
- 192, 128, 64, 192, 128, 64, 192, 128, 64,
+ 192, 128, 64, 192, 128, 64
};
#endif // CONFIG_JNT_COMP
diff --git a/av1/common/enums.h b/av1/common/enums.h
index bbd2fb3..c643edb 100644
--- a/av1/common/enums.h
+++ b/av1/common/enums.h
@@ -606,7 +606,7 @@
#endif // CONFIG_EXT_SKIP
#if CONFIG_JNT_COMP
-#define COMP_INDEX_CONTEXTS 9
+#define COMP_INDEX_CONTEXTS 6
#endif // CONFIG_JNT_COMP
#define NMV_CONTEXTS 3
diff --git a/av1/common/pred_common.h b/av1/common/pred_common.h
index 5002769..4455c34 100644
--- a/av1/common/pred_common.h
+++ b/av1/common/pred_common.h
@@ -107,11 +107,7 @@
const MODE_INFO *const left_mi = xd->left_mi;
int above_ctx = 0, left_ctx = 0;
- int offset = (fwd > bck) ? 0 : 1;
-
- if (fwd < (bck >> 1) + bck && bck < (fwd >> 1) + fwd) {
- offset = 2;
- }
+ const int offset = (fwd == bck);
if (above_mi) {
const MB_MODE_INFO *above_mbmi = &above_mi->mbmi;