Commit 037ee412 authored by David Barker's avatar David Barker

new-multisymbol: Don't signal ext-comp-refs probs

Currently, when new-multisymbol and ext-comp-refs are
both enabled, the comp_ref_type_prob and uni_comp_ref_prob
arrays are forward updated in the compressed header, but
their values are never used.

We can save a tiny bit of space by not signalling the
forward updates at all; as a side benefit, we can wrap
the whole of read_frame_reference_mode_probs() in
a #if !CONFIG_NEW_MULTISYMBOL block.

Note: It seems the encoder already does this; I think
the reason it doesn't cause mismatches is because we
effectively pad the compressed header out to a full byte,
and av1_diff_update_prob() reads a bit with a very high
probability of being 0.

Change-Id: Ia1fca05ee498609c98c7ea1f89578f6783357d7f
parent db5d66fe
...@@ -200,15 +200,11 @@ static REFERENCE_MODE read_frame_reference_mode( ...@@ -200,15 +200,11 @@ static REFERENCE_MODE read_frame_reference_mode(
} }
} }
#if !CONFIG_NEW_MULTISYMBOL
static void read_frame_reference_mode_probs(AV1_COMMON *cm, aom_reader *r) { static void read_frame_reference_mode_probs(AV1_COMMON *cm, aom_reader *r) {
#if CONFIG_NEW_MULTISYMBOL && !CONFIG_EXT_COMP_REFS
(void)r;
#else
FRAME_CONTEXT *const fc = cm->fc; FRAME_CONTEXT *const fc = cm->fc;
int i; int i;
#endif
#if !CONFIG_NEW_MULTISYMBOL
if (cm->reference_mode == REFERENCE_MODE_SELECT) if (cm->reference_mode == REFERENCE_MODE_SELECT)
for (i = 0; i < COMP_INTER_CONTEXTS; ++i) for (i = 0; i < COMP_INTER_CONTEXTS; ++i)
av1_diff_update_prob(r, &fc->comp_inter_prob[i], ACCT_STR); av1_diff_update_prob(r, &fc->comp_inter_prob[i], ACCT_STR);
...@@ -221,7 +217,6 @@ static void read_frame_reference_mode_probs(AV1_COMMON *cm, aom_reader *r) { ...@@ -221,7 +217,6 @@ static void read_frame_reference_mode_probs(AV1_COMMON *cm, aom_reader *r) {
} }
} }
} }
#endif
if (cm->reference_mode != SINGLE_REFERENCE) { if (cm->reference_mode != SINGLE_REFERENCE) {
#if CONFIG_EXT_COMP_REFS #if CONFIG_EXT_COMP_REFS
...@@ -235,7 +230,6 @@ static void read_frame_reference_mode_probs(AV1_COMMON *cm, aom_reader *r) { ...@@ -235,7 +230,6 @@ static void read_frame_reference_mode_probs(AV1_COMMON *cm, aom_reader *r) {
} }
#endif // CONFIG_EXT_COMP_REFS #endif // CONFIG_EXT_COMP_REFS
#if !CONFIG_NEW_MULTISYMBOL
for (i = 0; i < REF_CONTEXTS; ++i) { for (i = 0; i < REF_CONTEXTS; ++i) {
int j; int j;
#if CONFIG_EXT_REFS #if CONFIG_EXT_REFS
...@@ -248,11 +242,9 @@ static void read_frame_reference_mode_probs(AV1_COMMON *cm, aom_reader *r) { ...@@ -248,11 +242,9 @@ static void read_frame_reference_mode_probs(AV1_COMMON *cm, aom_reader *r) {
av1_diff_update_prob(r, &fc->comp_ref_prob[i][j], ACCT_STR); av1_diff_update_prob(r, &fc->comp_ref_prob[i][j], ACCT_STR);
#endif // CONFIG_EXT_REFS #endif // CONFIG_EXT_REFS
} }
#endif // CONFIG_NEW_MULTISYMBOL
} }
} }
#if !CONFIG_NEW_MULTISYMBOL
static void update_mv_probs(aom_prob *p, int n, aom_reader *r) { static void update_mv_probs(aom_prob *p, int n, aom_reader *r) {
int i; int i;
for (i = 0; i < n; ++i) av1_diff_update_prob(r, &p[i], ACCT_STR); for (i = 0; i < n; ++i) av1_diff_update_prob(r, &p[i], ACCT_STR);
...@@ -5061,7 +5053,9 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data, ...@@ -5061,7 +5053,9 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
if (cm->reference_mode != SINGLE_REFERENCE) if (cm->reference_mode != SINGLE_REFERENCE)
setup_compound_reference_mode(cm); setup_compound_reference_mode(cm);
#if !CONFIG_NEW_MULTISYMBOL
read_frame_reference_mode_probs(cm, &r); read_frame_reference_mode_probs(cm, &r);
#endif
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF #if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
for (i = 0; i < COMP_INTER_MODE_CONTEXTS; i++) for (i = 0; i < COMP_INTER_MODE_CONTEXTS; i++)
......
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