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

Use kf_y_mode_cdf with CONFIG_EC_MULTISYMBOL.

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