Commit cff9171e authored by Thomas Davies's avatar Thomas Davies

NEW_MULTISYMBOL: adapt remaining INTERINTRA syntax elements.

AWCY, objective-1-fast, High Latency :
-0.14% all metrics with NEW_MULTISYMBOL on (reference
    with NEW_MULTISYMBOL off).

Change-Id: I7cb3d05977d5e424fd38a40ab558c87c5d811f14
parent 299ff04f
...@@ -5716,6 +5716,10 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc, ...@@ -5716,6 +5716,10 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
AVERAGE_TILE_CDFS(compound_type_cdf) AVERAGE_TILE_CDFS(compound_type_cdf)
#if CONFIG_INTERINTRA #if CONFIG_INTERINTRA
#if CONFIG_NEW_MULTISYMBOL
AVERAGE_TILE_CDFS(interintra_cdf)
AVERAGE_TILE_CDFS(wedge_interintra_cdf)
#endif
AVERAGE_TILE_CDFS(interintra_mode_cdf) AVERAGE_TILE_CDFS(interintra_mode_cdf)
#endif #endif
......
...@@ -1226,6 +1226,14 @@ static const aom_cdf_prob default_compound_type_cdf[BLOCK_SIZES] ...@@ -1226,6 +1226,14 @@ static const aom_cdf_prob default_compound_type_cdf[BLOCK_SIZES]
static const aom_prob default_interintra_prob[BLOCK_SIZE_GROUPS] = { static const aom_prob default_interintra_prob[BLOCK_SIZE_GROUPS] = {
208, 208, 208, 208, 208, 208, 208, 208,
}; };
#if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob default_interintra_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(
2)] = { { AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 } };
#endif
static const aom_prob static const aom_prob
default_interintra_mode_prob[BLOCK_SIZE_GROUPS][INTERINTRA_MODES - 1] = { default_interintra_mode_prob[BLOCK_SIZE_GROUPS][INTERINTRA_MODES - 1] = {
{ 88, 16, 150 }, // block_size < 8x8 { 88, 16, 150 }, // block_size < 8x8
...@@ -1254,6 +1262,35 @@ static const aom_prob default_wedge_interintra_prob[BLOCK_SIZES] = { ...@@ -1254,6 +1262,35 @@ static const aom_prob default_wedge_interintra_prob[BLOCK_SIZES] = {
#endif // CONFIG_EXT_PARTITION #endif // CONFIG_EXT_PARTITION
}; };
#if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob
default_wedge_interintra_cdf[BLOCK_SIZES][CDF_SIZE(2)] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
#endif
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(216 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(216 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(216 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(224 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(224 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(224 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(240 * 128), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
};
#endif // CONFIG_NEW_MULTISYMBOL
#endif // CONFIG_INTERINTRA #endif // CONFIG_INTERINTRA
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
...@@ -4880,6 +4917,10 @@ static void init_mode_probs(FRAME_CONTEXT *fc) { ...@@ -4880,6 +4917,10 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#if CONFIG_INTERINTRA #if CONFIG_INTERINTRA
av1_copy(fc->interintra_prob, default_interintra_prob); av1_copy(fc->interintra_prob, default_interintra_prob);
av1_copy(fc->wedge_interintra_prob, default_wedge_interintra_prob); av1_copy(fc->wedge_interintra_prob, default_wedge_interintra_prob);
#if CONFIG_NEW_MULTISYMBOL
av1_copy(fc->interintra_cdf, default_interintra_cdf);
av1_copy(fc->wedge_interintra_cdf, default_wedge_interintra_cdf);
#endif // CONFIG_NEW_MULTISYMBOL
av1_copy(fc->interintra_mode_prob, default_interintra_mode_prob); av1_copy(fc->interintra_mode_prob, default_interintra_mode_prob);
#if CONFIG_EC_ADAPT #if CONFIG_EC_ADAPT
av1_copy(fc->interintra_mode_cdf, default_interintra_mode_cdf); av1_copy(fc->interintra_mode_cdf, default_interintra_mode_cdf);
......
...@@ -212,6 +212,10 @@ typedef struct frame_contexts { ...@@ -212,6 +212,10 @@ typedef struct frame_contexts {
aom_prob wedge_interintra_prob[BLOCK_SIZES]; aom_prob wedge_interintra_prob[BLOCK_SIZES];
aom_prob interintra_mode_prob[BLOCK_SIZE_GROUPS][INTERINTRA_MODES - 1]; aom_prob interintra_mode_prob[BLOCK_SIZE_GROUPS][INTERINTRA_MODES - 1];
#if CONFIG_EC_ADAPT #if CONFIG_EC_ADAPT
#if CONFIG_NEW_MULTISYMBOL
aom_cdf_prob interintra_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(2)];
aom_cdf_prob wedge_interintra_cdf[BLOCK_SIZES][CDF_SIZE(2)];
#endif
aom_cdf_prob interintra_mode_cdf[BLOCK_SIZE_GROUPS] aom_cdf_prob interintra_mode_cdf[BLOCK_SIZE_GROUPS]
[CDF_SIZE(INTERINTRA_MODES)]; [CDF_SIZE(INTERINTRA_MODES)];
#endif #endif
......
...@@ -5112,18 +5112,20 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data, ...@@ -5112,18 +5112,20 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
#if CONFIG_INTERINTRA #if CONFIG_INTERINTRA
if (cm->reference_mode != COMPOUND_REFERENCE && if (cm->reference_mode != COMPOUND_REFERENCE &&
cm->allow_interintra_compound) { cm->allow_interintra_compound) {
#if !CONFIG_NEW_MULTISYMBOL
for (i = 0; i < BLOCK_SIZE_GROUPS; i++) { for (i = 0; i < BLOCK_SIZE_GROUPS; i++) {
if (is_interintra_allowed_bsize_group(i)) { if (is_interintra_allowed_bsize_group(i)) {
av1_diff_update_prob(&r, &fc->interintra_prob[i], ACCT_STR); av1_diff_update_prob(&r, &fc->interintra_prob[i], ACCT_STR);
} }
} }
#endif
#if !CONFIG_EC_ADAPT #if !CONFIG_EC_ADAPT
for (i = 0; i < BLOCK_SIZE_GROUPS; i++) { for (i = 0; i < BLOCK_SIZE_GROUPS; i++) {
for (j = 0; j < INTERINTRA_MODES - 1; j++) for (j = 0; j < INTERINTRA_MODES - 1; j++)
av1_diff_update_prob(&r, &fc->interintra_mode_prob[i][j], ACCT_STR); av1_diff_update_prob(&r, &fc->interintra_mode_prob[i][j], ACCT_STR);
} }
#endif #endif
#if CONFIG_WEDGE #if CONFIG_WEDGE && !CONFIG_NEW_MULTISYMBOL
for (i = 0; i < BLOCK_SIZES; i++) { for (i = 0; i < BLOCK_SIZES; i++) {
if (is_interintra_allowed_bsize(i) && is_interintra_wedge_used(i)) { if (is_interintra_allowed_bsize(i) && is_interintra_wedge_used(i)) {
av1_diff_update_prob(&r, &fc->wedge_interintra_prob[i], ACCT_STR); av1_diff_update_prob(&r, &fc->wedge_interintra_prob[i], ACCT_STR);
......
...@@ -2559,8 +2559,13 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi, ...@@ -2559,8 +2559,13 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
#endif #endif
cm->allow_interintra_compound && is_interintra_allowed(mbmi)) { cm->allow_interintra_compound && is_interintra_allowed(mbmi)) {
const int bsize_group = size_group_lookup[bsize]; const int bsize_group = size_group_lookup[bsize];
#if CONFIG_NEW_MULTISYMBOL
const int interintra =
aom_read_symbol(r, ec_ctx->interintra_cdf[bsize_group], 2, ACCT_STR);
#else
const int interintra = const int interintra =
aom_read(r, cm->fc->interintra_prob[bsize_group], ACCT_STR); aom_read(r, cm->fc->interintra_prob[bsize_group], ACCT_STR);
#endif
if (xd->counts) xd->counts->interintra[bsize_group][interintra]++; if (xd->counts) xd->counts->interintra[bsize_group][interintra]++;
assert(mbmi->ref_frame[1] == NONE_FRAME); assert(mbmi->ref_frame[1] == NONE_FRAME);
if (interintra) { if (interintra) {
...@@ -2580,8 +2585,13 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi, ...@@ -2580,8 +2585,13 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
mbmi->filter_intra_mode_info.use_filter_intra_mode[1] = 0; mbmi->filter_intra_mode_info.use_filter_intra_mode[1] = 0;
#endif // CONFIG_FILTER_INTRA #endif // CONFIG_FILTER_INTRA
if (is_interintra_wedge_used(bsize)) { if (is_interintra_wedge_used(bsize)) {
#if CONFIG_NEW_MULTISYMBOL
mbmi->use_wedge_interintra = aom_read_symbol(
r, ec_ctx->wedge_interintra_cdf[bsize], 2, ACCT_STR);
#else
mbmi->use_wedge_interintra = mbmi->use_wedge_interintra =
aom_read(r, cm->fc->wedge_interintra_prob[bsize], ACCT_STR); aom_read(r, cm->fc->wedge_interintra_prob[bsize], ACCT_STR);
#endif
if (xd->counts) if (xd->counts)
xd->counts->wedge_interintra[bsize][mbmi->use_wedge_interintra]++; xd->counts->wedge_interintra[bsize][mbmi->use_wedge_interintra]++;
if (mbmi->use_wedge_interintra) { if (mbmi->use_wedge_interintra) {
......
...@@ -2226,7 +2226,11 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row, ...@@ -2226,7 +2226,11 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
cpi->common.allow_interintra_compound && is_interintra_allowed(mbmi)) { cpi->common.allow_interintra_compound && is_interintra_allowed(mbmi)) {
const int interintra = mbmi->ref_frame[1] == INTRA_FRAME; const int interintra = mbmi->ref_frame[1] == INTRA_FRAME;
const int bsize_group = size_group_lookup[bsize]; const int bsize_group = size_group_lookup[bsize];
#if CONFIG_NEW_MULTISYMBOL
aom_write_symbol(w, interintra, ec_ctx->interintra_cdf[bsize_group], 2);
#else
aom_write(w, interintra, cm->fc->interintra_prob[bsize_group]); aom_write(w, interintra, cm->fc->interintra_prob[bsize_group]);
#endif
if (interintra) { if (interintra) {
#if CONFIG_EC_ADAPT #if CONFIG_EC_ADAPT
aom_write_symbol(w, mbmi->interintra_mode, aom_write_symbol(w, mbmi->interintra_mode,
...@@ -2238,8 +2242,13 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row, ...@@ -2238,8 +2242,13 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
&interintra_mode_encodings[mbmi->interintra_mode]); &interintra_mode_encodings[mbmi->interintra_mode]);
#endif #endif
if (is_interintra_wedge_used(bsize)) { if (is_interintra_wedge_used(bsize)) {
#if CONFIG_NEW_MULTISYMBOL
aom_write_symbol(w, mbmi->use_wedge_interintra,
ec_ctx->wedge_interintra_cdf[bsize], 2);
#else
aom_write(w, mbmi->use_wedge_interintra, aom_write(w, mbmi->use_wedge_interintra,
cm->fc->wedge_interintra_prob[bsize]); cm->fc->wedge_interintra_prob[bsize]);
#endif
if (mbmi->use_wedge_interintra) { if (mbmi->use_wedge_interintra) {
aom_write_literal(w, mbmi->interintra_wedge_index, aom_write_literal(w, mbmi->interintra_wedge_index,
get_wedge_bits_lookup(bsize)); get_wedge_bits_lookup(bsize));
...@@ -5112,12 +5121,14 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) { ...@@ -5112,12 +5121,14 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) {
#if CONFIG_INTERINTRA #if CONFIG_INTERINTRA
if (cm->reference_mode != COMPOUND_REFERENCE && if (cm->reference_mode != COMPOUND_REFERENCE &&
cm->allow_interintra_compound) { cm->allow_interintra_compound) {
#if !CONFIG_NEW_MULTISYMBOL
for (i = 0; i < BLOCK_SIZE_GROUPS; i++) { for (i = 0; i < BLOCK_SIZE_GROUPS; i++) {
if (is_interintra_allowed_bsize_group(i)) { if (is_interintra_allowed_bsize_group(i)) {
av1_cond_prob_diff_update(header_bc, &fc->interintra_prob[i], av1_cond_prob_diff_update(header_bc, &fc->interintra_prob[i],
cm->counts.interintra[i], probwt); cm->counts.interintra[i], probwt);
} }
} }
#endif
#if !CONFIG_EC_ADAPT #if !CONFIG_EC_ADAPT
for (i = 0; i < BLOCK_SIZE_GROUPS; i++) { for (i = 0; i < BLOCK_SIZE_GROUPS; i++) {
prob_diff_update( prob_diff_update(
...@@ -5125,13 +5136,13 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) { ...@@ -5125,13 +5136,13 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) {
counts->interintra_mode[i], INTERINTRA_MODES, probwt, header_bc); counts->interintra_mode[i], INTERINTRA_MODES, probwt, header_bc);
} }
#endif #endif
#if CONFIG_WEDGE #if CONFIG_WEDGE && !CONFIG_NEW_MULTISYMBOL
for (i = 0; i < BLOCK_SIZES; i++) { for (i = 0; i < BLOCK_SIZES; i++) {
if (is_interintra_allowed_bsize(i) && is_interintra_wedge_used(i)) if (is_interintra_allowed_bsize(i) && is_interintra_wedge_used(i))
av1_cond_prob_diff_update(header_bc, &fc->wedge_interintra_prob[i], av1_cond_prob_diff_update(header_bc, &fc->wedge_interintra_prob[i],
cm->counts.wedge_interintra[i], probwt); cm->counts.wedge_interintra[i], probwt);
} }
#endif // CONFIG_WEDGE #endif // CONFIG_WEDGE && CONFIG_NEW_MULTISYMBOL
} }
#endif // CONFIG_INTERINTRA #endif // CONFIG_INTERINTRA
#if !CONFIG_EC_ADAPT && (CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE) #if !CONFIG_EC_ADAPT && (CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE)
......
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