Commit 10ba2bed authored by Nathan E. Egge's avatar Nathan E. Egge Committed by Nathan Egge

Use kf_y_mode_cdf with CONFIG_EC_MULTISYMBOL.

Change-Id: Ic0eba16329d7b63dd7d18e9cd28b89be4b5f2710
parent ecc21ec8
......@@ -16,7 +16,7 @@
#include "av1/common/onyxc_int.h"
#include "av1/common/seg_common.h"
#if CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
aom_cdf_prob av1_kf_y_mode_cdf[INTRA_MODES][INTRA_MODES][INTRA_MODES];
#endif
......@@ -1775,8 +1775,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#if CONFIG_DAALA_EC
av1_tree_to_cdf_1D(av1_intra_mode_tree, fc->uv_mode_prob, fc->uv_mode_cdf,
INTRA_MODES);
av1_tree_to_cdf_2D(av1_intra_mode_tree, av1_kf_y_mode_prob, av1_kf_y_mode_cdf,
INTRA_MODES, INTRA_MODES);
#endif
#if CONFIG_EC_MULTISYMBOL
av1_tree_to_cdf_1D(av1_intra_mode_tree, fc->y_mode_prob, fc->y_mode_cdf,
......@@ -1793,6 +1791,8 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_tree_to_cdf_1D(av1_ext_tx_tree, fc->inter_ext_tx_prob,
fc->inter_ext_tx_cdf, EXT_TX_SIZES);
#endif
av1_tree_to_cdf_2D(av1_intra_mode_tree, av1_kf_y_mode_prob, av1_kf_y_mode_cdf,
INTRA_MODES, INTRA_MODES);
av1_tree_to_cdf(av1_segment_tree, fc->seg.tree_probs, fc->seg.tree_cdf);
#endif
#if CONFIG_DELTA_Q
......@@ -1816,6 +1816,11 @@ void av1_set_mode_cdfs(struct AV1Common *cm) {
av1_tree_to_cdf(av1_partition_tree, fc->partition_prob[i],
fc->partition_cdf[i]);
for (i = 0; i < INTRA_MODES; ++i)
for (j = 0; j < INTRA_MODES; ++j)
av1_tree_to_cdf(av1_intra_mode_tree, cm->kf_y_prob[i][j],
cm->kf_y_cdf[i][j]);
for (j = 0; j < SWITCHABLE_FILTER_CONTEXTS; ++j)
av1_tree_to_cdf(av1_switchable_interp_tree, fc->switchable_interp_prob[j],
fc->switchable_interp_cdf[j]);
......@@ -1842,11 +1847,6 @@ void av1_set_mode_cdfs(struct AV1Common *cm) {
av1_tree_to_cdf(av1_intra_mode_tree, fc->uv_mode_prob[i],
fc->uv_mode_cdf[i]);
for (i = 0; i < INTRA_MODES; ++i)
for (j = 0; j < INTRA_MODES; ++j)
av1_tree_to_cdf(av1_intra_mode_tree, cm->kf_y_prob[i][j],
cm->kf_y_cdf[i][j]);
#endif
}
#endif
......
......@@ -286,7 +286,7 @@ typedef struct FRAME_COUNTS {
extern const aom_prob av1_kf_y_mode_prob[INTRA_MODES][INTRA_MODES]
[INTRA_MODES - 1];
#if CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
extern aom_cdf_prob av1_kf_y_mode_cdf[INTRA_MODES][INTRA_MODES][INTRA_MODES];
#endif
#if CONFIG_PALETTE
......
......@@ -393,7 +393,7 @@ typedef struct AV1Common {
// - this is intentionally not placed in FRAME_CONTEXT since it's reset upon
// each keyframe and not used afterwards
aom_prob kf_y_prob[INTRA_MODES][INTRA_MODES][INTRA_MODES - 1];
#if CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
aom_cdf_prob kf_y_cdf[INTRA_MODES][INTRA_MODES][INTRA_MODES];
#endif
#if CONFIG_GLOBAL_MOTION
......@@ -626,7 +626,7 @@ static INLINE const aom_prob *get_y_mode_probs(const AV1_COMMON *cm,
return cm->kf_y_prob[above][left];
}
#if CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
static INLINE aom_cdf_prob *get_y_mode_cdf(AV1_COMMON *cm, const MODE_INFO *mi,
const MODE_INFO *above_mi,
const MODE_INFO *left_mi,
......
......@@ -4259,7 +4259,7 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
if (frame_is_intra_only(cm)) {
av1_copy(cm->kf_y_prob, av1_kf_y_mode_prob);
#if CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
av1_copy(cm->kf_y_cdf, av1_kf_y_mode_cdf);
#endif
#if !CONFIG_EC_ADAPT
......
......@@ -812,18 +812,19 @@ static void read_intra_frame_mode_info(AV1_COMMON *const cm,
#if CONFIG_CB4X4
(void)i;
mbmi->mode =
#if CONFIG_DAALA_EC
read_intra_mode(r, get_y_mode_cdf(cm, mi, above_mi, left_mi, 0));
#if CONFIG_EC_MULTISYMBOL
read_intra_mode_cdf(r, get_y_mode_cdf(cm, mi, above_mi, left_mi, 0));
#else
read_intra_mode(r, get_y_mode_probs(cm, mi, above_mi, left_mi, 0));
#endif // CONFIG_DAALA_EC
#endif
#else
switch (bsize) {
case BLOCK_4X4:
for (i = 0; i < 4; ++i)
mi->bmi[i].as_mode =
#if CONFIG_DAALA_EC
read_intra_mode(r, get_y_mode_cdf(cm, mi, above_mi, left_mi, i));
#if CONFIG_EC_MULTISYMBOL
read_intra_mode_cdf(r,
get_y_mode_cdf(cm, mi, above_mi, left_mi, i));
#else
read_intra_mode(r, get_y_mode_probs(cm, mi, above_mi, left_mi, i));
#endif
......@@ -831,36 +832,36 @@ static void read_intra_frame_mode_info(AV1_COMMON *const cm,
break;
case BLOCK_4X8:
mi->bmi[0].as_mode = mi->bmi[2].as_mode =
#if CONFIG_DAALA_EC
read_intra_mode(r, get_y_mode_cdf(cm, mi, above_mi, left_mi, 0));
#if CONFIG_EC_MULTISYMBOL
read_intra_mode_cdf(r, get_y_mode_cdf(cm, mi, above_mi, left_mi, 0));
#else
read_intra_mode(r, get_y_mode_probs(cm, mi, above_mi, left_mi, 0));
#endif
mi->bmi[1].as_mode = mi->bmi[3].as_mode = mbmi->mode =
#if CONFIG_DAALA_EC
read_intra_mode(r, get_y_mode_cdf(cm, mi, above_mi, left_mi, 1));
#if CONFIG_EC_MULTISYMBOL
read_intra_mode_cdf(r, get_y_mode_cdf(cm, mi, above_mi, left_mi, 1));
#else
read_intra_mode(r, get_y_mode_probs(cm, mi, above_mi, left_mi, 1));
#endif
break;
case BLOCK_8X4:
mi->bmi[0].as_mode = mi->bmi[1].as_mode =
#if CONFIG_DAALA_EC
read_intra_mode(r, get_y_mode_cdf(cm, mi, above_mi, left_mi, 0));
#if CONFIG_EC_MULTISYMBOL
read_intra_mode_cdf(r, get_y_mode_cdf(cm, mi, above_mi, left_mi, 0));
#else
read_intra_mode(r, get_y_mode_probs(cm, mi, above_mi, left_mi, 0));
#endif
mi->bmi[2].as_mode = mi->bmi[3].as_mode = mbmi->mode =
#if CONFIG_DAALA_EC
read_intra_mode(r, get_y_mode_cdf(cm, mi, above_mi, left_mi, 2));
#if CONFIG_EC_MULTISYMBOL
read_intra_mode_cdf(r, get_y_mode_cdf(cm, mi, above_mi, left_mi, 2));
#else
read_intra_mode(r, get_y_mode_probs(cm, mi, above_mi, left_mi, 2));
#endif
break;
default:
mbmi->mode =
#if CONFIG_DAALA_EC
read_intra_mode(r, get_y_mode_cdf(cm, mi, above_mi, left_mi, 0));
#if CONFIG_EC_MULTISYMBOL
read_intra_mode_cdf(r, get_y_mode_cdf(cm, mi, above_mi, left_mi, 0));
#else
read_intra_mode(r, get_y_mode_probs(cm, mi, above_mi, left_mi, 0));
#endif
......
......@@ -1699,7 +1699,7 @@ static void write_mb_modes_kf(AV1_COMMON *cm, const MACROBLOCKD *xd,
write_selected_tx_size(cm, xd, w);
if (bsize >= BLOCK_8X8 || unify_bsize) {
#if CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
aom_write_symbol(w, av1_intra_mode_ind[mbmi->mode],
get_y_mode_cdf(cm, mi, above_mi, left_mi, 0), INTRA_MODES);
#else
......@@ -1714,7 +1714,7 @@ static void write_mb_modes_kf(AV1_COMMON *cm, const MACROBLOCKD *xd,
for (idy = 0; idy < 2; idy += num_4x4_h) {
for (idx = 0; idx < 2; idx += num_4x4_w) {
const int block = idy * 2 + idx;
#if CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
aom_write_symbol(w, av1_intra_mode_ind[mi->bmi[block].as_mode],
get_y_mode_cdf(cm, mi, above_mi, left_mi, block),
INTRA_MODES);
......@@ -4238,7 +4238,7 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) {
#endif // CONFIG_EC_ADAPT, CONFIG_DAALA_EC
if (frame_is_intra_only(cm)) {
av1_copy(cm->kf_y_prob, av1_kf_y_mode_prob);
#if CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
av1_copy(cm->kf_y_cdf, av1_kf_y_mode_cdf);
#endif
......
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