Commit fcc34796 authored by Dmitry Kovalev's avatar Dmitry Kovalev

Removing CONFIG_BALANCED_COEFTREE experiment.

Change-Id: I61a8b0101eac3ee2e0621d56151b90c269fd4db4
parent 1787b002
......@@ -250,7 +250,6 @@ EXPERIMENT_LIST="
multiple_arf
non420
alpha
balanced_coeftree
"
CONFIG_LIST="
external_build
......
This diff is collapsed.
......@@ -202,13 +202,8 @@ DECLARE_ALIGNED(16, const int16_t, vp9_default_scan_32x32[1024]) = {
const vp9_tree_index vp9_coef_tree[ 22] = /* corresponding _CONTEXT_NODEs */
{
#if CONFIG_BALANCED_COEFTREE
-ZERO_TOKEN, 2, /* 0 = ZERO */
-DCT_EOB_TOKEN, 4, /* 1 = EOB */
#else
-DCT_EOB_TOKEN, 2, /* 0 = EOB */
-ZERO_TOKEN, 4, /* 1 = ZERO */
#endif
-ONE_TOKEN, 6, /* 2 = ONE */
8, 12, /* 3 = LOW_VAL */
-TWO_TOKEN, 10, /* 4 = TWO */
......@@ -235,13 +230,8 @@ static const vp9_prob Pcat6[] = {
};
const vp9_tree_index vp9_coefmodel_tree[6] = {
#if CONFIG_BALANCED_COEFTREE
-ZERO_TOKEN, 2,
-DCT_EOB_MODEL_TOKEN, 4,
#else
-DCT_EOB_MODEL_TOKEN, 2, /* 0 = EOB */
-ZERO_TOKEN, 4, /* 1 = ZERO */
#endif
-ONE_TOKEN, -TWO_TOKEN,
};
......@@ -648,13 +638,8 @@ static void adapt_coef_probs(VP9_COMMON *cm, TX_SIZE txfm_size,
vp9_coefmodel_tree,
coef_probs, branch_ct,
coef_counts[i][j][k][l], 0);
#if CONFIG_BALANCED_COEFTREE
branch_ct[1][1] = eob_branch_count[i][j][k][l] - branch_ct[1][0];
coef_probs[1] = get_binary_prob(branch_ct[1][0], branch_ct[1][1]);
#else
branch_ct[0][1] = eob_branch_count[i][j][k][l] - branch_ct[0][0];
coef_probs[0] = get_binary_prob(branch_ct[0][0], branch_ct[0][1]);
#endif
for (t = 0; t < entropy_nodes_adapt; ++t) {
count = branch_ct[t][0] + branch_ct[t][1];
count = count > count_sat ? count_sat : count;
......
......@@ -18,14 +18,8 @@
#include "vp9/decoder/vp9_detokenize.h"
#include "vp9/decoder/vp9_onyxd_int.h"
#if CONFIG_BALANCED_COEFTREE
#define ZERO_CONTEXT_NODE 0
#define EOB_CONTEXT_NODE 1
#else
#define EOB_CONTEXT_NODE 0
#define ZERO_CONTEXT_NODE 1
#endif
#define ONE_CONTEXT_NODE 2
#define LOW_VAL_CONTEXT_NODE 3
#define TWO_CONTEXT_NODE 4
......@@ -118,10 +112,6 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
const int16_t *scan, *nb;
uint8_t token_cache[1024];
const uint8_t * band_translate;
#if CONFIG_BALANCED_COEFTREE
int skip_eob_node = 0;
#endif
coef_probs = fc->coef_probs[txfm_size][type][ref];
coef_counts = counts->coef[txfm_size];
switch (txfm_size) {
......@@ -167,13 +157,11 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
pt = get_coef_context(nb, token_cache, c);
band = get_coef_band(band_translate, c);
prob = coef_probs[band][pt];
#if !CONFIG_BALANCED_COEFTREE
counts->eob_branch[txfm_size][type][ref][band][pt]++;
if (!vp9_read(r, prob[EOB_CONTEXT_NODE]))
break;
SKIP_START:
#endif
if (c >= seg_eob)
break;
if (c)
......@@ -184,21 +172,8 @@ SKIP_START:
if (!vp9_read(r, prob[ZERO_CONTEXT_NODE])) {
INCREMENT_COUNT(ZERO_TOKEN);
++c;
#if CONFIG_BALANCED_COEFTREE
skip_eob_node = 1;
continue;
#else
goto SKIP_START;
#endif
}
#if CONFIG_BALANCED_COEFTREE
if (!skip_eob_node) {
fc->eob_branch_counts[txfm_size][type][ref][band][pt]++;
if (!vp9_read(r, prob[EOB_CONTEXT_NODE]))
break;
}
skip_eob_node = 0;
#endif
// ONE_CONTEXT_NODE_0_
if (!vp9_read(r, prob[ONE_CONTEXT_NODE])) {
......
......@@ -302,22 +302,13 @@ static void pack_mb_tokens(vp9_writer* const bc,
assert(pp != 0);
/* skip one or two nodes */
#if !CONFIG_BALANCED_COEFTREE
if (p->skip_eob_node) {
n -= p->skip_eob_node;
i = 2 * p->skip_eob_node;
}
#endif
do {
const int bb = (v >> --n) & 1;
#if CONFIG_BALANCED_COEFTREE
if (i == 2 && p->skip_eob_node) {
i += 2;
assert(bb == 1);
continue;
}
#endif
vp9_write(bc, bb, pp[i >> 1]);
i = vp9_coef_tree[i + bb];
} while (n);
......@@ -757,19 +748,11 @@ static void build_tree_distribution(VP9_COMP *cpi, TX_SIZE txfm_size) {
coef_counts[i][j][k][l], 0);
vpx_memcpy(coef_probs[i][j][k][l], full_probs,
sizeof(vp9_prob) * UNCONSTRAINED_NODES);
#if CONFIG_BALANCED_COEFTREE
coef_branch_ct[i][j][k][l][1][1] = eob_branch_ct[i][j][k][l] -
coef_branch_ct[i][j][k][l][1][0];
coef_probs[i][j][k][l][1] =
get_binary_prob(coef_branch_ct[i][j][k][l][1][0],
coef_branch_ct[i][j][k][l][1][1]);
#else
coef_branch_ct[i][j][k][l][0][1] = eob_branch_ct[i][j][k][l] -
coef_branch_ct[i][j][k][l][0][0];
coef_probs[i][j][k][l][0] =
get_binary_prob(coef_branch_ct[i][j][k][l][0][0],
coef_branch_ct[i][j][k][l][0][1]);
#endif
#ifdef ENTROPY_STATS
if (!cpi->dummy_packing) {
int t;
......
......@@ -122,17 +122,10 @@ static void fill_token_costs(vp9_coeff_count (*c)[BLOCK_TYPES][2],
vp9_model_to_full_probs(p[t][i][j][k][l], probs);
vp9_cost_tokens((int *)c[t][i][j][0][k][l], probs,
vp9_coef_tree);
#if CONFIG_BALANCED_COEFTREE
// Replace the eob node prob with a very small value so that the
// cost approximately equals the cost without the eob node
probs[1] = 1;
vp9_cost_tokens((int *)c[t][i][j][1][k][l], probs, vp9_coef_tree);
#else
vp9_cost_tokens_skip((int *)c[t][i][j][1][k][l], probs,
vp9_coef_tree);
assert(c[t][i][j][0][k][l][DCT_EOB_TOKEN] ==
c[t][i][j][1][k][l][DCT_EOB_TOKEN]);
#endif
}
}
......
......@@ -196,20 +196,11 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE_TYPE bsize,
t->context_tree = coef_probs[type][ref][band][pt];
t->skip_eob_node = (c > 0) && (token_cache[scan[c - 1]] == 0);
#if CONFIG_BALANCED_COEFTREE
assert(token <= ZERO_TOKEN ||
vp9_coef_encodings[t->token].len - t->skip_eob_node > 0);
#else
assert(vp9_coef_encodings[t->token].len - t->skip_eob_node > 0);
#endif
if (!dry_run) {
++counts[type][ref][band][pt][token];
#if CONFIG_BALANCED_COEFTREE
if (!t->skip_eob_node && token > ZERO_TOKEN)
#else
if (!t->skip_eob_node)
#endif
++cpi->common.counts.eob_branch[tx_size][type][ref][band][pt];
}
token_cache[scan[c]] = vp9_pt_energy_class[token];
......
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