Commit a14ae847 authored by Paul Wilkins's avatar Paul Wilkins Committed by Gerrit Code Review

Deprecate code_zerogroup experiment.

Delete code under the CONFIG_CODE_ZEROGROUP flag.

Change-Id: I5fe6c7b42a5da9b73118e33594301da4129f320a
parent 1ed57a6a
......@@ -245,7 +245,6 @@ EXPERIMENT_LIST="
scatterscan
oneshotq
multiple_arf
code_zerogroup
non420
ab4x4
"
......
......@@ -958,9 +958,4 @@ static TX_SIZE tx_size_for_plane(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize,
}
}
#if CONFIG_CODE_ZEROGROUP
static int get_zpc_used(TX_SIZE tx_size) {
return (tx_size >= TX_16X16);
}
#endif
#endif // VP9_COMMON_VP9_BLOCKD_H_
......@@ -18,10 +18,6 @@ static const vp9_prob vp9_coef_update_prob[ENTROPY_NODES] = {
252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252
};
#if CONFIG_CODE_ZEROGROUP
#define ZPC_UPDATE_PROB 248
#endif
#if CONFIG_MODELCOEFPROB
#define COEF_MODEL_UPDATE_PROB 16
#endif
......
......@@ -699,86 +699,3 @@ static const vp9_coeff_probs default_coef_probs_32x32[BLOCK_TYPES] = {
}
}
};
#if CONFIG_CODE_ZEROGROUP
// There are two probs: the first is the prob(0) of the isolated zero bit,
// the second is the prob(0) of the end of orientation symbol [if 0 that
// indicates a zerotree root].
static const vp9_zpc_probs default_zpc_probs_4x4 = {
{ /* Intra */
{ /* Coeff Band 0 */
{ 1, }, { 1, }, { 1, },
}, { /* Coeff Band 1 */
{ 1, }, { 1, }, { 1, },
}, { /* Coeff Band 2 */
{ 1, }, { 1, }, { 1, },
}
}, { /* Inter */
{ /* Coeff Band 0 */
{ 1, }, { 1, }, { 1, },
}, { /* Coeff Band 1 */
{ 1, }, { 1, }, { 1, },
}, { /* Coeff Band 2 */
{ 1, }, { 1, }, { 1, },
}
}
};
static const vp9_zpc_probs default_zpc_probs_8x8 = {
{ /* Intra */
{ /* ZPC Band 0 */
{ 4, }, { 2, }, { 1, },
}, { /* ZPC Band 1 */
{ 4, }, { 2, }, { 1, },
}, { /* ZPC Band 2 */
{ 4, }, { 2, }, { 1, },
}
}, { /* Inter */
{ /* ZPC Band 0 */
{ 4, }, { 2, }, { 1, },
}, { /* ZPC Band 1 */
{ 4, }, { 2, }, { 1, },
}, { /* ZPC Band 2 */
{ 4, }, { 2, }, { 1, },
}
}
};
static const vp9_zpc_probs default_zpc_probs_16x16 = {
{ /* Intra */
{ /* ZPC Band 0 */
{ 57, }, { 30, }, { 13, },
}, { /* ZPC Band 1 */
{ 46, }, { 23, }, { 4, },
}, { /* ZPC Band 1 */
{ 36, }, { 11, }, { 2, },
},
}, { /* Inter */
{ /* ZPC Band 0 */
{ 45, }, { 21 }, { 10, },
}, { /* ZPC Band 1 */
{ 24, }, { 14, }, { 3, },
}, { /* ZPC Band 2 */
{ 16, }, { 6, }, { 1, },
},
},
};
static const vp9_zpc_probs default_zpc_probs_32x32 = {
{ /* Intra */
{ /* ZPC Band 0 */
{ 132, }, { 60, }, { 19, },
}, { /* ZPC Band 1 */
{ 64, }, { 32, }, { 8, },
}, { /* ZPC Band 2 */
{ 25, }, { 11, }, { 1, },
},
}, { /* Inter */
{ /* ZPC Band 0 */
{ 134, }, { 39, }, { 25, },
}, { /* ZPC Band 1 */
{ 64, }, { 24, }, { 12, },
}, { /* ZPC Band 2 */
{ 21, }, { 10, }, { 1, },
},
},
};
#endif // CONFIG_CODE_ZEROGROUP
......@@ -1338,16 +1338,6 @@ void vp9_default_coef_probs(VP9_COMMON *pc) {
vpx_memcpy(pc->fc.coef_probs_32x32, default_coef_probs_32x32,
sizeof(pc->fc.coef_probs_32x32));
#endif
#if CONFIG_CODE_ZEROGROUP
vpx_memcpy(pc->fc.zpc_probs_4x4, default_zpc_probs_4x4,
sizeof(pc->fc.zpc_probs_4x4));
vpx_memcpy(pc->fc.zpc_probs_8x8, default_zpc_probs_8x8,
sizeof(pc->fc.zpc_probs_8x8));
vpx_memcpy(pc->fc.zpc_probs_16x16, default_zpc_probs_16x16,
sizeof(pc->fc.zpc_probs_16x16));
vpx_memcpy(pc->fc.zpc_probs_32x32, default_zpc_probs_32x32,
sizeof(pc->fc.zpc_probs_32x32));
#endif
}
// Neighborhood 5-tuples for various scans and blocksizes,
......@@ -1588,121 +1578,3 @@ void vp9_adapt_coef_probs(VP9_COMMON *cm) {
count_sat, update_factor);
#endif
}
#if CONFIG_CODE_ZEROGROUP
OrientationType vp9_get_orientation(int rc, TX_SIZE tx_size) {
int i = rc >> (tx_size + 2);
int j = rc & ((4 << tx_size) - 1);
if (i > 2 * j)
return VERTICAL;
else if (j > 2 * i)
return HORIZONTAL;
else
return DIAGONAL;
/*
if (i == 0 && j == 0) return DIAGONAL;
while (i > 1 || j > 1) {
i >>= 1;
j >>= 1;
}
if (i == 0 && j == 1)
return HORIZONTAL; // horizontal
else if (i == 1 && j == 1)
return DIAGONAL; // diagonal
else if (i == 1 && j == 0)
return VERTICAL; // vertical
assert(0);
*/
}
int vp9_use_eoo(int c, int seg_eob, const int *scan,
TX_SIZE tx_size, int *is_last_zero, int *is_eoo) {
// NOTE: returning 0 from this function will turn off eoo symbols
// For instance we can experiment with turning eoo off for smaller blocks
// and/or lower bands
int o = vp9_get_orientation(scan[c], tx_size);
int band = get_coef_band(scan, tx_size, c);
int use_eoo = (!is_last_zero[o] &&
!is_eoo[o] &&
band <= ZPC_EOO_BAND_UPPER &&
band >= ZPC_EOO_BAND_LOWER &&
get_zpc_used(tx_size) &&
seg_eob - c > (ZPC_USEEOO_THRESH << tx_size) &&
is_eoo[0] + is_eoo[1] + is_eoo[2] < 2);
return use_eoo;
}
int vp9_is_eoo(int c, int eob, const int *scan, TX_SIZE tx_size,
const int16_t *qcoeff_ptr, int *last_nz_pos) {
int rc = scan[c];
int o = vp9_get_orientation(rc, tx_size);
int eoo = c > last_nz_pos[o];
return eoo;
}
static void adapt_zpc_probs_common(VP9_COMMON *cm,
TX_SIZE tx_size,
int count_sat,
int update_factor) {
int r, b, p, n;
int count, factor;
vp9_zpc_probs *zpc_probs;
vp9_zpc_probs *pre_zpc_probs;
vp9_zpc_count *zpc_counts;
if (!get_zpc_used(tx_size)) return;
if (tx_size == TX_32X32) {
zpc_probs = &cm->fc.zpc_probs_32x32;
pre_zpc_probs = &cm->fc.pre_zpc_probs_32x32;
zpc_counts = &cm->fc.zpc_counts_32x32;
} else if (tx_size == TX_16X16) {
zpc_probs = &cm->fc.zpc_probs_16x16;
pre_zpc_probs = &cm->fc.pre_zpc_probs_16x16;
zpc_counts = &cm->fc.zpc_counts_16x16;
} else if (tx_size == TX_8X8) {
zpc_probs = &cm->fc.zpc_probs_8x8;
pre_zpc_probs = &cm->fc.pre_zpc_probs_8x8;
zpc_counts = &cm->fc.zpc_counts_8x8;
} else {
zpc_probs = &cm->fc.zpc_probs_4x4;
pre_zpc_probs = &cm->fc.pre_zpc_probs_4x4;
zpc_counts = &cm->fc.zpc_counts_4x4;
}
for (r = 0; r < REF_TYPES; ++r) {
for (b = 0; b < ZPC_BANDS; ++b) {
for (p = 0; p < ZPC_PTOKS; ++p) {
for (n = 0; n < ZPC_NODES; ++n) {
vp9_prob prob = get_binary_prob((*zpc_counts)[r][b][p][n][0],
(*zpc_counts)[r][b][p][n][1]);
count = (*zpc_counts)[r][b][p][n][0] + (*zpc_counts)[r][b][p][n][1];
count = count > count_sat ? count_sat : count;
factor = (update_factor * count / count_sat);
(*zpc_probs)[r][b][p][n] = weighted_prob(
(*pre_zpc_probs)[r][b][p][n], prob, factor);
}
}
}
}
}
// #define ZPC_COUNT_TESTING
void vp9_adapt_zpc_probs(VP9_COMMON *cm) {
int count_sat;
int update_factor; /* denominator 256 */
if (cm->frame_type == KEY_FRAME) {
update_factor = COEF_MAX_UPDATE_FACTOR_KEY;
count_sat = COEF_COUNT_SAT_KEY;
} else if (cm->last_frame_type == KEY_FRAME) {
update_factor = COEF_MAX_UPDATE_FACTOR_AFTER_KEY; /* adapt quickly */
count_sat = COEF_COUNT_SAT_AFTER_KEY;
} else {
update_factor = COEF_MAX_UPDATE_FACTOR;
count_sat = COEF_COUNT_SAT;
}
adapt_zpc_probs_common(cm, TX_4X4, count_sat, update_factor);
adapt_zpc_probs_common(cm, TX_8X8, count_sat, update_factor);
adapt_zpc_probs_common(cm, TX_16X16, count_sat, update_factor);
adapt_zpc_probs_common(cm, TX_32X32, count_sat, update_factor);
}
#endif // CONFIG_CODE_ZEROGROUP
......@@ -176,62 +176,6 @@ void vp9_get_model_distribution(vp9_prob model, vp9_prob *tree_probs,
int b, int r);
#endif // CONFIG_MODELCOEFPROB
#if CONFIG_CODE_ZEROGROUP
#define ZPC_STATS
typedef enum {
HORIZONTAL = 0,
DIAGONAL,
VERTICAL,
} OrientationType;
/* Note EOB should become part of this symbol eventually,
* but holding off on this for now because that is a major
* change in the rest of the codebase */
#define ZPC_ISOLATED (MAX_ENTROPY_TOKENS + 0) /* Isolated zero */
/* ZPC_EOORIENT: All remaining coefficients in the same orientation are 0.
* In other words all remaining coeffs in the current subband, and all
* children of the current subband are zero. Subbands are defined by
* dyadic partitioning in the coeff domain */
#define ZPC_EOORIENT (MAX_ENTROPY_TOKENS + 1) /* End of Orientation */
/* Band limits over which the eoo bit is sent */
#define ZPC_EOO_BAND_LOWER 0
#define ZPC_EOO_BAND_UPPER 5
#define USE_ZPC_EOORIENT 1 /* 0: not used */
/* 1: used */
#define ZPC_NODES 1
#define UNKNOWN_TOKEN 255 /* Not signalled, encoder only */
#define ZPC_BANDS 3 /* context bands for izr */
#define ZPC_PTOKS 3 /* context pt for zpcs */
#define coef_to_zpc_band(b) ((b) >> 1)
#define coef_to_zpc_ptok(p) ((p) > 2 ? 2 : (p))
typedef vp9_prob vp9_zpc_probs[REF_TYPES][ZPC_BANDS]
[ZPC_PTOKS][ZPC_NODES];
typedef unsigned int vp9_zpc_count[REF_TYPES][ZPC_BANDS]
[ZPC_PTOKS][ZPC_NODES][2];
OrientationType vp9_get_orientation(int rc, TX_SIZE tx_size);
int vp9_use_eoo(int c, int eob, const int *scan, TX_SIZE tx_size,
int *is_last_zero, int *is_eoo);
int vp9_is_eoo(int c, int eob, const int *scan, TX_SIZE tx_size,
const int16_t *qcoeff_ptr, int *last_nz_pos);
#define ZPC_USEEOO_THRESH 4
#define ZPC_ZEROSSAVED_EOO 7 /* encoder only */
void vp9_adapt_zpc_probs(struct VP9Common *cm);
#endif // CONFIG_CODE_ZEROGROUP
static INLINE const int* get_scan_4x4(TX_TYPE tx_type) {
switch (tx_type) {
case ADST_DCT:
......
......@@ -62,12 +62,6 @@ typedef struct frame_contexts {
vp9_coeff_probs coef_probs_8x8[BLOCK_TYPES];
vp9_coeff_probs coef_probs_16x16[BLOCK_TYPES];
vp9_coeff_probs coef_probs_32x32[BLOCK_TYPES];
#if CONFIG_CODE_ZEROGROUP
vp9_zpc_probs zpc_probs_4x4;
vp9_zpc_probs zpc_probs_8x8;
vp9_zpc_probs zpc_probs_16x16;
vp9_zpc_probs zpc_probs_32x32;
#endif
nmv_context nmvc;
nmv_context pre_nmvc;
......@@ -88,12 +82,6 @@ typedef struct frame_contexts {
vp9_coeff_probs pre_coef_probs_8x8[BLOCK_TYPES];
vp9_coeff_probs pre_coef_probs_16x16[BLOCK_TYPES];
vp9_coeff_probs pre_coef_probs_32x32[BLOCK_TYPES];
#if CONFIG_CODE_ZEROGROUP
vp9_zpc_probs pre_zpc_probs_4x4;
vp9_zpc_probs pre_zpc_probs_8x8;
vp9_zpc_probs pre_zpc_probs_16x16;
vp9_zpc_probs pre_zpc_probs_32x32;
#endif
vp9_coeff_count coef_counts_4x4[BLOCK_TYPES];
vp9_coeff_count coef_counts_8x8[BLOCK_TYPES];
......@@ -102,13 +90,6 @@ typedef struct frame_contexts {
unsigned int eob_branch_counts[TX_SIZE_MAX_SB][BLOCK_TYPES][REF_TYPES]
[COEF_BANDS][PREV_COEF_CONTEXTS];
#if CONFIG_CODE_ZEROGROUP
vp9_zpc_count zpc_counts_4x4;
vp9_zpc_count zpc_counts_8x8;
vp9_zpc_count zpc_counts_16x16;
vp9_zpc_count zpc_counts_32x32;
#endif
nmv_context_counts NMVcount;
vp9_prob switchable_interp_prob[VP9_SWITCHABLE_FILTERS + 1]
[VP9_SWITCHABLE_FILTERS - 1];
......@@ -343,10 +324,6 @@ static int get_mi_col(const MACROBLOCKD *xd) {
}
static int get_token_alloc(int mb_rows, int mb_cols) {
#if CONFIG_CODE_ZEROGROUP
return mb_rows * mb_cols * (24 * 16 * 2);
#else
return mb_rows * mb_cols * (24 * 16 + 4);
#endif
}
#endif // VP9_COMMON_VP9_ONYXC_INT_H_
......@@ -530,54 +530,6 @@ static void init_frame(VP9D_COMP *pbi) {
xd->mode_info_stride = pc->mode_info_stride;
}
#if CONFIG_CODE_ZEROGROUP
static void read_zpc_probs_common(VP9_COMMON *cm,
vp9_reader* bc,
TX_SIZE tx_size) {
int r, b, p, n;
vp9_zpc_probs *zpc_probs;
vp9_prob upd = ZPC_UPDATE_PROB;
if (!get_zpc_used(tx_size)) return;
if (!vp9_read_bit(bc)) return;
if (tx_size == TX_32X32) {
zpc_probs = &cm->fc.zpc_probs_32x32;
} else if (tx_size == TX_16X16) {
zpc_probs = &cm->fc.zpc_probs_16x16;
} else if (tx_size == TX_8X8) {
zpc_probs = &cm->fc.zpc_probs_8x8;
} else {
zpc_probs = &cm->fc.zpc_probs_4x4;
}
for (r = 0; r < REF_TYPES; ++r) {
for (b = 0; b < ZPC_BANDS; ++b) {
for (p = 0; p < ZPC_PTOKS; ++p) {
for (n = 0; n < ZPC_NODES; ++n) {
vp9_prob *q = &(*zpc_probs)[r][b][p][n];
#if USE_ZPC_EXTRA == 0
if (n == 1) continue;
#endif
if (vp9_read(bc, upd)) {
*q = read_prob_diff_update(bc, *q);
}
}
}
}
}
}
static void read_zpc_probs(VP9_COMMON *cm,
vp9_reader* bc) {
read_zpc_probs_common(cm, bc, TX_4X4);
if (cm->txfm_mode > ONLY_4X4)
read_zpc_probs_common(cm, bc, TX_8X8);
if (cm->txfm_mode > ALLOW_8X8)
read_zpc_probs_common(cm, bc, TX_16X16);
if (cm->txfm_mode > ALLOW_16X16)
read_zpc_probs_common(cm, bc, TX_32X32);
}
#endif // CONFIG_CODE_ZEROGROUP
static void read_coef_probs_common(vp9_coeff_probs *coef_probs,
TX_SIZE tx_size,
vp9_reader *r) {
......@@ -855,18 +807,6 @@ static void update_frame_context(FRAME_CONTEXT *fc) {
vp9_zero(fc->NMVcount);
vp9_zero(fc->mv_ref_ct);
vp9_zero(fc->partition_counts);
#if CONFIG_CODE_ZEROGROUP
vp9_copy(fc->pre_zpc_probs_4x4, fc->zpc_probs_4x4);
vp9_copy(fc->pre_zpc_probs_8x8, fc->zpc_probs_8x8);
vp9_copy(fc->pre_zpc_probs_16x16, fc->zpc_probs_16x16);
vp9_copy(fc->pre_zpc_probs_32x32, fc->zpc_probs_32x32);
vp9_zero(fc->zpc_counts_4x4);
vp9_zero(fc->zpc_counts_8x8);
vp9_zero(fc->zpc_counts_16x16);
vp9_zero(fc->zpc_counts_32x32);
#endif
}
static void decode_tile(VP9D_COMP *pbi, vp9_reader *r) {
......@@ -1124,9 +1064,6 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
update_frame_context(&pc->fc);
read_coef_probs(pbi, &header_bc);
#if CONFIG_CODE_ZEROGROUP
read_zpc_probs(pc, &header_bc);
#endif
// Initialize xd pointers. Any reference should do for xd->pre, so use 0.
setup_pre_planes(xd, &pc->yv12_fb[pc->active_ref_idx[0]], NULL,
......@@ -1164,9 +1101,7 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
// Adaptation
if (!pc->error_resilient_mode && !pc->frame_parallel_decoding_mode) {
vp9_adapt_coef_probs(pc);
#if CONFIG_CODE_ZEROGROUP
vp9_adapt_zpc_probs(pc);
#endif
if (pc->frame_type != KEY_FRAME) {
vp9_adapt_mode_probs(pc);
vp9_adapt_nmv_probs(pc, xd->allow_high_precision_mv);
......
......@@ -60,28 +60,12 @@ static const vp9_prob cat6_prob[15] = {
DECLARE_ALIGNED(16, extern const uint8_t, vp9_norm[256]);
#if CONFIG_CODE_ZEROGROUP
#define ZEROGROUP_ADVANCE() \
do { \
token_cache[scan[c]] = ZERO_TOKEN; \
is_last_zero[o] = 1; \
c++; \
} while (0)
#define INCREMENT_COUNT(token) \
do { \
coef_counts[type][ref][get_coef_band(scan, txfm_size, c)] \
[pt][token]++; \
token_cache[scan[c]] = token; \
is_last_zero[o] = (token == ZERO_TOKEN); \
} while (0)
#else
#define INCREMENT_COUNT(token) \
do { \
coef_counts[type][ref][get_coef_band(scan, txfm_size, c)] \
[pt][token]++; \
token_cache[scan[c]] = token; \
} while (0)
#endif
#define WRITE_COEF_CONTINUE(val, token) \
{ \
......@@ -117,20 +101,8 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
vp9_coeff_count *coef_counts;
const int ref = xd->mode_info_context->mbmi.ref_frame != INTRA_FRAME;
TX_TYPE tx_type = DCT_DCT;
#if CONFIG_CODE_ZEROGROUP
int is_eoo[3] = {0, 0, 0};
int is_last_zero[3] = {0, 0, 0};
int o, rc;
vp9_zpc_probs *zpc_probs;
vp9_zpc_count *zpc_count;
vp9_prob *zprobs;
int eoo = 0, use_eoo;
#endif
const int *scan, *nb;
uint8_t token_cache[1024];
#if CONFIG_CODE_ZEROGROUP
vpx_memset(token_cache, UNKNOWN_TOKEN, sizeof(token_cache));
#endif
switch (txfm_size) {
default:
......@@ -143,10 +115,6 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
coef_probs = fc->coef_probs_4x4;
coef_counts = fc->coef_counts_4x4;
default_eob = 16;
#if CONFIG_CODE_ZEROGROUP
zpc_probs = &(fc->zpc_probs_4x4);
zpc_count = &(fc->zpc_counts_4x4);
#endif
break;
}
case TX_8X8: {
......@@ -162,10 +130,6 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
above_ec = (A[0] + A[1]) != 0;
left_ec = (L[0] + L[1]) != 0;
default_eob = 64;
#if CONFIG_CODE_ZEROGROUP
zpc_probs = &(fc->zpc_probs_8x8);
zpc_count = &(fc->zpc_counts_8x8);
#endif
break;
}
case TX_16X16: {
......@@ -181,10 +145,6 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
above_ec = (A[0] + A[1] + A[2] + A[3]) != 0;
left_ec = (L[0] + L[1] + L[2] + L[3]) != 0;
default_eob = 256;
#if CONFIG_CODE_ZEROGROUP
zpc_probs = &(fc->zpc_probs_16x16);
zpc_count = &(fc->zpc_counts_16x16);
#endif
break;
}
case TX_32X32:
......@@ -194,10 +154,6 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
above_ec = (A[0] + A[1] + A[2] + A[3] + A[4] + A[5] + A[6] + A[7]) != 0;
left_ec = (L[0] + L[1] + L[2] + L[3] + L[4] + L[5] + L[6] + L[7]) != 0;
default_eob = 1024;
#if CONFIG_CODE_ZEROGROUP
zpc_probs = &fc->zpc_probs_32x32;
zpc_count = &fc->zpc_counts_32x32;
#endif
break;
}
......@@ -218,15 +174,6 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
fc->eob_branch_counts[txfm_size][type][ref][band][pt]++;
if (!vp9_read(r, prob[EOB_CONTEXT_NODE]))
break;
#if CONFIG_CODE_ZEROGROUP
rc = scan[c];
o = vp9_get_orientation(rc, txfm_size);
if (token_cache[rc] == ZERO_TOKEN || is_eoo[o]) {
coef_counts[type][ref][band][pt][ZERO_TOKEN]++;
ZEROGROUP_ADVANCE();
goto SKIP_START;
}
#endif
SKIP_START:
if (c >= seg_eob)
......@@ -236,35 +183,7 @@ SKIP_START:
c, default_eob);
band = get_coef_band(scan, txfm_size, c);
prob = coef_probs[type][ref][band][pt];
#if CONFIG_CODE_ZEROGROUP
rc = scan[c];
o = vp9_get_orientation(rc, txfm_size);
if (token_cache[rc] == ZERO_TOKEN || is_eoo[o]) {
ZEROGROUP_ADVANCE();
goto SKIP_START;
}
zprobs = (*zpc_probs)[ref]
[coef_to_zpc_band(band)]
[coef_to_zpc_ptok(pt)];
#endif
if (!vp9_read(r, prob[ZERO_CONTEXT_NODE])) {
#if CONFIG_CODE_ZEROGROUP
eoo = 0;
#if USE_ZPC_EOORIENT == 1
use_eoo = vp9_use_eoo(c, seg_eob, scan, txfm_size, is_last_zero, is_eoo);
#else
use_eoo = 0;
#endif
if (use_eoo) {
eoo = !vp9_read(r, zprobs[0]);
++(*zpc_count)[ref]
[coef_to_zpc_band(band)]
[coef_to_zpc_ptok(pt)][0][!eoo];
if (eoo) {
is_eoo[o] = 1;
}
}
#endif
INCREMENT_COUNT(ZERO_TOKEN);
++c;
goto SKIP_START;
......
This diff is collapsed.
......@@ -1499,12 +1499,6 @@ static void encode_frame_internal(VP9_COMP *cpi) {
vp9_zero(cpi->coef_counts_16x16);
vp9_zero(cpi->coef_counts_32x32);
vp9_zero(cm->fc.eob_branch_counts);
#if CONFIG_CODE_ZEROGROUP
vp9_zero(cm->fc.zpc_counts_4x4);
vp9_zero(cm->fc.zpc_counts_8x8);
vp9_zero(cm->fc.zpc_counts_16x16);
vp9_zero(cm->fc.zpc_counts_32x32);
#endif
cpi->mb.e_mbd.lossless = (cm->base_qindex == 0 &&
cm->y_dc_delta_q == 0 &&
......
......@@ -114,13 +114,6 @@ extern void init_nmvstats();
extern void print_nmvstats();
#endif
#if CONFIG_CODE_ZEROGROUP
#ifdef ZPC_STATS
extern void init_zpcstats();
extern void print_zpcstats();
#endif
#endif
#ifdef SPEEDSTATS
unsigned int frames_at_speed[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
#endif
......@@ -1397,11 +1390,6 @@ VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) {
#endif
#ifdef NMV_STATS
init_nmvstats();
#endif
#if CONFIG_CODE_ZEROGROUP
#ifdef ZPC_STATS
init_zpcstats();
#endif
#endif
/*Initialize the feed-forward activity masking.*/
......@@ -1612,12 +1600,6 @@ VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) {
cpi->common.error.setjmp = 0;
vp9_zero(cpi->y_uv_mode_count)
#if CONFIG_CODE_ZEROGROUP
vp9_zero(cm->fc.zpc_counts_4x4);
vp9_zero(cm->fc.zpc_counts_8x8);
vp9_zero(cm->fc.zpc_counts_16x16);
vp9_zero(cm->fc.zpc_counts_32x32);
#endif
return (VP9_PTR) cpi;
}
......@@ -1645,12 +1627,6 @@ void vp9_remove_compressor(VP9_PTR *ptr) {
if (cpi->pass != 1)
print_nmvstats();
#endif
#if CONFIG_CODE_ZEROGROUP
#ifdef ZPC_STATS
if (cpi->pass != 1)
print_zpcstats();
#endif
#endif
#if CONFIG_INTERNAL_STATS
......@@ -3235,9 +3211,6 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
if (!cpi->common.error_resilient_mode &&
!cpi->common.frame_parallel_decoding_mode) {
vp9_adapt_coef_probs(&cpi->common);
#if CONFIG_CODE_ZEROGROUP
vp9_adapt_zpc_probs(&cpi->common);
#endif
}
if (cpi->common.frame_type != KEY_FRAME) {
......
......@@ -104,12 +104,6 @@ typedef struct {
int mv_ref_ct[INTER_MODE_CONTEXTS][4][2];
int vp9_mode_contexts[INTER_MODE_CONTEXTS][4];
#if CONFIG_CODE_ZEROGROUP
vp9_zpc_probs zpc_probs_4x4;
vp9_zpc_probs zpc_probs_8x8;
vp9_zpc_probs zpc_probs_16x16;
vp9_zpc_probs zpc_probs_32x32;
#endif
} CODING_CONTEXT;
typedef struct {
......
......@@ -167,13 +167,6 @@ void vp9_save_coding_context(VP9_COMP *cpi) {
vp9_copy(cc->coef_probs_16x16, cm->fc.coef_probs_16x16);
vp9_copy(cc->coef_probs_32x32, cm->fc.coef_probs_32x32);
vp9_copy(cc->switchable_interp_prob, cm->fc.switchable_interp_prob);
#if CONFIG_CODE_ZEROGROUP
vp9_copy(cc->zpc_probs_4x4, cm->fc.zpc_probs_4x4);
vp9_copy(cc->zpc_probs_8x8, cm->fc.zpc_probs_8x8);
vp9_copy(cc->zpc_probs_16x16, cm->fc.zpc_probs_16x16);
vp9_copy(cc->zpc_probs_32x32, cm->fc.zpc_probs_32x32);
#endif
}
void vp9_restore_coding_context(VP9_COMP *cpi) {
......@@ -225,13 +218,6 @@ void vp9_restore_coding_context(VP9_COMP *cpi) {
vp9_copy(cm->fc.coef_probs_16x16, cc->coef_probs_16x16);
vp9_copy(cm->fc.coef_probs_32x32, cc->coef_probs_32x32);
vp9_copy(cm->fc.switchable_interp_prob, cc->switchable_interp_prob);
#if CONFIG_CODE_ZEROGROUP
vp9_copy(cm->fc.zpc_probs_4x4, cc->zpc_probs_4x4);
vp9_copy(cm->fc.zpc_probs_8x8, cc->zpc_probs_8x8);
vp9_copy(cm->fc.zpc_probs_16x16, cc->zpc_probs_16x16);
vp9_copy(cm->fc.zpc_probs_32x32, cc->zpc_probs_32x32);