Commit 00803a77 authored by Jingning Han's avatar Jingning Han

Consolidate lv-map experiment

Change-Id: I2ae2a33574bc3072561e696a31e0ea2e0770afa9
parent 2457ec8c
......@@ -2156,20 +2156,6 @@ void av1_default_coef_probs(AV1_COMMON *cm) {
av1_coef_pareto_cdfs(cm->fc);
}
#if CONFIG_LV_MAP
void av1_adapt_coef_probs(AV1_COMMON *cm) {
unsigned int count_sat, update_factor;
if (!frame_is_intra_only(cm) && 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;
}
av1_adapt_txb_probs(cm, count_sat, update_factor);
}
#endif // CONFIG_LV_MAP
static void av1_average_cdf(aom_cdf_prob *cdf_ptr[], aom_cdf_prob *fc_cdf_ptr,
int cdf_size, const int num_tiles) {
int i;
......
......@@ -6352,9 +6352,7 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->hv_eob, default_hv_eob);
#endif // CONFIG_CTX1D
#if LV_MAP_PROB
av1_init_txb_probs(fc);
#endif // LV_MAP_PROB
#endif
av1_copy(fc->comp_bwdref_prob, default_comp_bwdref_p);
#if CONFIG_NEW_MULTISYMBOL
......
......@@ -165,7 +165,6 @@ typedef struct frame_contexts {
aom_prob hv_eob[TX_SIZES][PLANE_TYPES][TX_CLASSES][HV_EOB_CONTEXTS];
#endif // CONFIG_CTX1D
#if LV_MAP_PROB
aom_cdf_prob txb_skip_cdf[TX_SIZES][TXB_SKIP_CONTEXTS][CDF_SIZE(2)];
aom_cdf_prob nz_map_cdf[TX_SIZES][PLANE_TYPES][SIG_COEF_CONTEXTS]
[CDF_SIZE(2)];
......@@ -191,7 +190,6 @@ typedef struct frame_contexts {
aom_cdf_prob hv_eob_cdf[TX_SIZES][PLANE_TYPES][TX_CLASSES][HV_EOB_CONTEXTS]
[CDF_SIZE(2)];
#endif // CONFIG_CTX1D
#endif // LV_MAP_PROB
#endif
aom_prob newmv_prob[NEWMV_MODE_CONTEXTS];
......
......@@ -96,7 +96,6 @@ const int16_t av1_coeff_band_32x32[1024] = {
22, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24,
};
#if LV_MAP_PROB
void av1_init_txb_probs(FRAME_CONTEXT *fc) {
TX_SIZE tx_size;
int plane, ctx, level;
......@@ -220,101 +219,6 @@ void av1_init_txb_probs(FRAME_CONTEXT *fc) {
}
#endif // CONFIG_CTX1D
}
#endif // LV_MAP_PROB
void av1_adapt_txb_probs(AV1_COMMON *cm, unsigned int count_sat,
unsigned int update_factor) {
FRAME_CONTEXT *fc = cm->fc;
const FRAME_CONTEXT *pre_fc = cm->pre_fc;
const FRAME_COUNTS *counts = &cm->counts;
TX_SIZE tx_size;
int plane, ctx, level;
// Update probability models for transform block skip flag
for (tx_size = 0; tx_size < TX_SIZES; ++tx_size)
for (ctx = 0; ctx < TXB_SKIP_CONTEXTS; ++ctx)
fc->txb_skip[tx_size][ctx] = mode_mv_merge_probs(
pre_fc->txb_skip[tx_size][ctx], counts->txb_skip[tx_size][ctx]);
for (plane = 0; plane < PLANE_TYPES; ++plane)
for (ctx = 0; ctx < DC_SIGN_CONTEXTS; ++ctx)
fc->dc_sign[plane][ctx] = mode_mv_merge_probs(
pre_fc->dc_sign[plane][ctx], counts->dc_sign[plane][ctx]);
// Update probability models for non-zero coefficient map and eob flag.
for (tx_size = 0; tx_size < TX_SIZES; ++tx_size)
for (plane = 0; plane < PLANE_TYPES; ++plane)
for (level = 0; level < NUM_BASE_LEVELS; ++level)
for (ctx = 0; ctx < COEFF_BASE_CONTEXTS; ++ctx)
fc->coeff_base[tx_size][plane][level][ctx] =
merge_probs(pre_fc->coeff_base[tx_size][plane][level][ctx],
counts->coeff_base[tx_size][plane][level][ctx],
count_sat, update_factor);
for (tx_size = 0; tx_size < TX_SIZES; ++tx_size) {
for (plane = 0; plane < PLANE_TYPES; ++plane) {
for (ctx = 0; ctx < SIG_COEF_CONTEXTS; ++ctx) {
fc->nz_map[tx_size][plane][ctx] = merge_probs(
pre_fc->nz_map[tx_size][plane][ctx],
counts->nz_map[tx_size][plane][ctx], count_sat, update_factor);
}
for (ctx = 0; ctx < EOB_COEF_CONTEXTS; ++ctx) {
fc->eob_flag[tx_size][plane][ctx] = merge_probs(
pre_fc->eob_flag[tx_size][plane][ctx],
counts->eob_flag[tx_size][plane][ctx], count_sat, update_factor);
}
}
}
for (tx_size = 0; tx_size < TX_SIZES; ++tx_size) {
for (plane = 0; plane < PLANE_TYPES; ++plane) {
for (ctx = 0; ctx < LEVEL_CONTEXTS; ++ctx) {
fc->coeff_lps[tx_size][plane][ctx] = merge_probs(
pre_fc->coeff_lps[tx_size][plane][ctx],
counts->coeff_lps[tx_size][plane][ctx], count_sat, update_factor);
}
#if BR_NODE
for (int br = 0; br < BASE_RANGE_SETS; ++br) {
for (ctx = 0; ctx < LEVEL_CONTEXTS; ++ctx) {
fc->coeff_br[tx_size][plane][br][ctx] =
merge_probs(pre_fc->coeff_br[tx_size][plane][br][ctx],
counts->coeff_br[tx_size][plane][br][ctx], count_sat,
update_factor);
}
}
#endif // BR_NODE
}
}
#if CONFIG_CTX1D
for (tx_size = 0; tx_size < TX_SIZES; ++tx_size) {
for (plane = 0; plane < PLANE_TYPES; ++plane)
for (int tx_class = 0; tx_class < TX_CLASSES; ++tx_class)
fc->eob_mode[tx_size][plane][tx_class] =
merge_probs(pre_fc->eob_mode[tx_size][plane][tx_class],
counts->eob_mode[tx_size][plane][tx_class], count_sat,
update_factor);
}
for (tx_size = 0; tx_size < TX_SIZES; ++tx_size) {
for (plane = 0; plane < PLANE_TYPES; ++plane)
for (int tx_class = 0; tx_class < TX_CLASSES; ++tx_class)
for (ctx = 0; ctx < EMPTY_LINE_CONTEXTS; ++ctx)
fc->empty_line[tx_size][plane][tx_class][ctx] =
merge_probs(pre_fc->empty_line[tx_size][plane][tx_class][ctx],
counts->empty_line[tx_size][plane][tx_class][ctx],
count_sat, update_factor);
}
for (tx_size = 0; tx_size < TX_SIZES; ++tx_size) {
for (plane = 0; plane < PLANE_TYPES; ++plane)
for (int tx_class = 0; tx_class < TX_CLASSES; ++tx_class)
for (ctx = 0; ctx < HV_EOB_CONTEXTS; ++ctx)
fc->hv_eob[tx_size][plane][tx_class][ctx] =
merge_probs(pre_fc->hv_eob[tx_size][plane][tx_class][ctx],
counts->hv_eob[tx_size][plane][tx_class][ctx],
count_sat, update_factor);
}
#endif
}
void av1_init_lv_map(AV1_COMMON *cm) {
LV_MAP_CTX_TABLE *coeff_ctx_table = &cm->coeff_ctx_table;
......
......@@ -607,12 +607,7 @@ static INLINE void get_txb_ctx(BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
}
}
#if LV_MAP_PROB
void av1_init_txb_probs(FRAME_CONTEXT *fc);
#endif // LV_MAP_PROB
void av1_adapt_txb_probs(AV1_COMMON *cm, unsigned int count_sat,
unsigned int update_factor);
void av1_init_lv_map(AV1_COMMON *cm);
......
......@@ -3513,10 +3513,6 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
av1_diff_update_prob(&r, &fc->quarter_tx_size_prob, ACCT_STR);
#endif
#if CONFIG_LV_MAP && !LV_MAP_PROB
av1_read_txb_probs(fc, cm->tx_mode, &r, &cm->counts);
#endif // CONFIG_LV_MAP && !LV_MAP_PROB
#if !CONFIG_NEW_MULTISYMBOL
if (cm->tx_mode == TX_MODE_SELECT)
for (int i = 0; i < TXFM_PARTITION_CONTEXTS; ++i)
......@@ -3968,9 +3964,6 @@ void av1_decode_tg_tiles_and_wrapup(AV1Decoder *pbi, const uint8_t *data,
#else
make_update_tile_list_dec(pbi, 0, num_bwd_ctxs, tile_ctxs);
#endif
#if CONFIG_LV_MAP
av1_adapt_coef_probs(cm);
#endif // CONFIG_LV_MAP
#if CONFIG_SYMBOLRATE
av1_dump_symbol_rate(cm);
#endif
......
......@@ -65,10 +65,6 @@ static INLINE int read_nz_map(aom_reader *const r, uint8_t *const levels,
const PLANE_TYPE plane_type = get_plane_type(plane);
unsigned int(*nz_map_count)[SIG_COEF_CONTEXTS][2] =
(counts) ? &counts->nz_map[txs_ctx][plane_type] : NULL;
#if !LV_MAP_PROB
aom_prob *nz_map = fc->nz_map[txs_ctx][plane_type];
aom_prob *eob_flag = fc->eob_flag[txs_ctx][plane_type];
#endif
int c;
for (c = 0; c < seg_eob; ++c) {
int is_nz;
......@@ -76,13 +72,9 @@ static INLINE int read_nz_map(aom_reader *const r, uint8_t *const levels,
int eob_ctx = get_eob_ctx(scan[c], txs_ctx, tx_type);
if (c < seg_eob - 1) {
#if LV_MAP_PROB
is_nz = av1_read_record_bin(
counts, r, fc->nz_map_cdf[txs_ctx][plane_type][coeff_ctx], 2,
ACCT_STR);
#else
is_nz = aom_read(r, nz_map[coeff_ctx], ACCT_STR);
#endif
} else {
is_nz = 1;
}
......@@ -98,13 +90,9 @@ static INLINE int read_nz_map(aom_reader *const r, uint8_t *const levels,
if (counts) ++(*nz_map_count)[coeff_ctx][is_nz];
if (is_nz) {
#if LV_MAP_PROB
int is_eob = av1_read_record_bin(
counts, r, fc->eob_flag_cdf[txs_ctx][plane_type][eob_ctx], 2,
ACCT_STR);
#else
int is_eob = aom_read(r, eob_flag[eob_ctx], ACCT_STR);
#endif
if (counts) ++counts->eob_flag[txs_ctx][plane_type][eob_ctx][is_eob];
if (is_eob) break;
}
......@@ -285,10 +273,6 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *xd,
FRAME_COUNTS *counts = xd->counts;
TX_SIZE txs_ctx = get_txsize_context(tx_size);
PLANE_TYPE plane_type = get_plane_type(plane);
#if !LV_MAP_PROB
aom_prob *nz_map = ec_ctx->nz_map[txs_ctx][plane_type];
aom_prob *eob_flag = ec_ctx->eob_flag[txs_ctx][plane_type];
#endif
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
const int seg_eob = tx_size_2d[tx_size];
int c = 0;
......@@ -303,14 +287,9 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *xd,
memset(tcoeffs, 0, sizeof(*tcoeffs) * seg_eob);
#if LV_MAP_PROB
int all_zero = av1_read_record_bin(
counts, r, ec_ctx->txb_skip_cdf[txs_ctx][txb_ctx->txb_skip_ctx], 2,
ACCT_STR);
#else
int all_zero =
aom_read(r, ec_ctx->txb_skip[txs_ctx][txb_ctx->txb_skip_ctx], ACCT_STR);
#endif
if (xd->counts)
++xd->counts->txb_skip[txs_ctx][txb_ctx->txb_skip_ctx][all_zero];
......@@ -398,13 +377,9 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *xd,
// int eob_ctx = get_eob_ctx(tcoeffs, scan[c], txs_ctx, tx_type);
if (c < *eob - 1) {
#if LV_MAP_PROB
is_nz = av1_read_record_bin(
counts, r, ec_ctx->nz_map_cdf[txs_ctx][plane_type][coeff_ctx], 2,
ACCT_STR);
#else
is_nz = aom_read(r, nz_map[coeff_ctx], ACCT_STR);
#endif
} else {
is_nz = 1;
}
......@@ -454,9 +429,6 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *xd,
int i;
for (i = 0; i < NUM_BASE_LEVELS; ++i) {
#if !LV_MAP_PROB
aom_prob *coeff_base = ec_ctx->coeff_base[txs_ctx][plane_type][i];
#endif
update_eob = 0;
for (c = *eob - 1; c >= 0; --c) {
uint8_t *const level = &levels[scan[c]];
......@@ -467,14 +439,9 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *xd,
ctx = get_base_ctx(levels, scan[c], bwl, height, i + 1);
#if LV_MAP_PROB
if (av1_read_record_bin(
counts, r, ec_ctx->coeff_base_cdf[txs_ctx][plane_type][i][ctx], 2,
ACCT_STR))
#else
if (aom_read(r, coeff_base[ctx], ACCT_STR))
#endif
{
ACCT_STR)) {
assert(*level == i + 1);
cul_level += i + 1;
......@@ -482,14 +449,9 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *xd,
if (c == 0) {
int dc_sign_ctx = txb_ctx->dc_sign_ctx;
#if LV_MAP_PROB
*sign = av1_read_record_bin(
counts, r, ec_ctx->dc_sign_cdf[plane_type][dc_sign_ctx], 2,
ACCT_STR);
#else
*sign =
aom_read(r, ec_ctx->dc_sign[plane_type][dc_sign_ctx], ACCT_STR);
#endif
if (counts) ++counts->dc_sign[plane_type][dc_sign_ctx][*sign];
} else {
*sign = av1_read_record_bit(counts, r, ACCT_STR);
......@@ -514,12 +476,8 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *xd,
if (c == 0) {
int dc_sign_ctx = txb_ctx->dc_sign_ctx;
#if LV_MAP_PROB
*sign = av1_read_record_bin(
counts, r, ec_ctx->dc_sign_cdf[plane_type][dc_sign_ctx], 2, ACCT_STR);
#else
*sign = aom_read(r, ec_ctx->dc_sign[plane_type][dc_sign_ctx], ACCT_STR);
#endif
if (counts) ++counts->dc_sign[plane_type][dc_sign_ctx][*sign];
} else {
*sign = av1_read_record_bit(counts, r, ACCT_STR);
......@@ -529,30 +487,18 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *xd,
#if BR_NODE
for (idx = 0; idx < BASE_RANGE_SETS; ++idx) {
#if LV_MAP_PROB
if (av1_read_record_bin(
counts, r, ec_ctx->coeff_br_cdf[txs_ctx][plane_type][idx][ctx], 2,
ACCT_STR))
#else // LV_MAP_PROB
if (aom_read(r, ec_ctx->coeff_br[txs_ctx][plane_type][idx][ctx],
ACCT_STR))
#endif // LV_MAP_PROB
{
ACCT_STR)) {
int extra_bits = (1 << br_extra_bits[idx]) - 1;
// int br_offset = aom_read_literal(r, extra_bits, ACCT_STR);
int br_offset = 0;
int tok;
if (counts) ++counts->coeff_br[txs_ctx][plane_type][idx][ctx][1];
for (tok = 0; tok < extra_bits; ++tok) {
#if LV_MAP_PROB
if (av1_read_record_bin(
counts, r, ec_ctx->coeff_lps_cdf[txs_ctx][plane_type][ctx], 2,
ACCT_STR))
#else
if (aom_read(r, ec_ctx->coeff_lps[txs_ctx][plane_type][ctx],
ACCT_STR))
#endif
{
ACCT_STR)) {
br_offset = tok;
if (counts) ++counts->coeff_lps[txs_ctx][plane_type][ctx][1];
break;
......@@ -645,50 +591,3 @@ uint8_t av1_read_coeffs_txb_facade(AV1_COMMON *cm, MACROBLOCKD *xd,
av1_set_contexts(xd, pd, plane, tx_size, cul_level, col, row);
return cul_level;
}
#if !LV_MAP_PROB
static void read_txb_probs(FRAME_CONTEXT *fc, const TX_SIZE tx_size,
aom_reader *r, FRAME_COUNTS *counts) {
#if !CONFIG_SYMBOLRATE
(void)counts;
#endif
int plane, ctx, level;
if (av1_read_record_bit(counts, r, ACCT_STR) == 0) return;
for (ctx = 0; ctx < TXB_SKIP_CONTEXTS; ++ctx)
av1_diff_update_prob(r, &fc->txb_skip[tx_size][ctx], ACCT_STR);
for (plane = 0; plane < PLANE_TYPES; ++plane)
for (ctx = 0; ctx < SIG_COEF_CONTEXTS; ++ctx)
av1_diff_update_prob(r, &fc->nz_map[tx_size][plane][ctx], ACCT_STR);
for (plane = 0; plane < PLANE_TYPES; ++plane)
for (ctx = 0; ctx < EOB_COEF_CONTEXTS; ++ctx)
av1_diff_update_prob(r, &fc->eob_flag[tx_size][plane][ctx], ACCT_STR);
for (level = 0; level < NUM_BASE_LEVELS; ++level)
for (plane = 0; plane < PLANE_TYPES; ++plane)
for (ctx = 0; ctx < COEFF_BASE_CONTEXTS; ++ctx)
av1_diff_update_prob(r, &fc->coeff_base[tx_size][plane][level][ctx],
ACCT_STR);
for (plane = 0; plane < PLANE_TYPES; ++plane)
for (ctx = 0; ctx < LEVEL_CONTEXTS; ++ctx)
av1_diff_update_prob(r, &fc->coeff_lps[tx_size][plane][ctx], ACCT_STR);
}
void av1_read_txb_probs(FRAME_CONTEXT *fc, TX_MODE tx_mode, aom_reader *r,
FRAME_COUNTS *counts) {
const TX_SIZE max_tx_size = tx_mode_to_biggest_tx_size[tx_mode];
TX_SIZE tx_size;
int ctx, plane;
for (plane = 0; plane < PLANE_TYPES; ++plane)
for (ctx = 0; ctx < DC_SIGN_CONTEXTS; ++ctx)
av1_diff_update_prob(r, &fc->dc_sign[plane][ctx], ACCT_STR);
for (tx_size = TX_4X4; tx_size <= max_tx_size; ++tx_size)
read_txb_probs(fc, tx_size, r, counts);
}
#endif // !LV_MAP_PROB
......@@ -28,8 +28,4 @@ uint8_t av1_read_coeffs_txb_facade(AV1_COMMON *cm, MACROBLOCKD *xd,
int plane, tran_low_t *tcoeffs,
TX_SIZE tx_size, int16_t *max_scan_line,
int *eob);
#if !LV_MAP_PROB
void av1_read_txb_probs(FRAME_CONTEXT *fc, TX_MODE tx_mode, aom_reader *r,
FRAME_COUNTS *counts);
#endif // !LV_MAP_PROB
#endif // DECODETXB_H_
......@@ -4557,9 +4557,6 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) {
av1_cond_prob_diff_update(header_bc, &cm->fc->quarter_tx_size_prob,
cm->counts.quarter_tx_size, probwt);
#endif
#if CONFIG_LV_MAP
av1_write_txb_probs(cpi, header_bc);
#endif // CONFIG_LV_MAP
#if !CONFIG_NEW_MULTISYMBOL
if (cm->tx_mode == TX_MODE_SELECT)
......
......@@ -3311,7 +3311,7 @@ static void encode_rd_sb_row(AV1_COMP *cpi, ThreadData *td,
MODE_INFO **mi = cm->mi_grid_visible + idx_str;
PC_TREE *const pc_root = td->pc_root[cm->mib_size_log2 - MIN_MIB_SIZE_LOG2];
#if CONFIG_LV_MAP && LV_MAP_PROB
#if CONFIG_LV_MAP
av1_fill_coeff_costs(&td->mb, xd->tile_ctx);
#else
av1_fill_token_costs_from_cdf(x->token_head_costs,
......
......@@ -5585,9 +5585,6 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
&cm->counts);
#endif // CONFIG_ENTROPY_STATS
if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD) {
#if CONFIG_LV_MAP
av1_adapt_coef_probs(cm);
#endif // CONFIG_LV_MAP
av1_adapt_intra_frame_probs(cm);
#if CONFIG_SIMPLE_BWD_ADAPT
make_update_tile_list_enc(cpi, cm->largest_tile_id, 1, tile_ctxs);
......
This diff is collapsed.
......@@ -85,7 +85,6 @@ int av1_get_txb_entropy_context(const tran_low_t *qcoeff,
void av1_update_txb_context(const AV1_COMP *cpi, ThreadData *td,
RUN_TYPE dry_run, BLOCK_SIZE bsize, int *rate,
const int mi_row, const int mi_col);
void av1_write_txb_probs(AV1_COMP *cpi, aom_writer *w);
void av1_update_txb_context_b(int plane, int block, int blk_row, int blk_col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
......
......@@ -578,19 +578,11 @@ void av1_set_mvcost(MACROBLOCK *x, MV_REFERENCE_FRAME ref_frame, int ref,
}
#if CONFIG_LV_MAP
#if !LV_MAP_PROB
static void get_rate_cost(aom_prob p, int cost[2]) {
cost[0] = av1_cost_bit(p, 0);
cost[1] = av1_cost_bit(p, 1);
}
#endif // !LV_MAP_PROB
void av1_fill_coeff_costs(MACROBLOCK *x, FRAME_CONTEXT *fc) {
for (int tx_size = 0; tx_size < TX_SIZES; ++tx_size) {
for (int plane = 0; plane < PLANE_TYPES; ++plane) {
LV_MAP_COEFF_COST *pcost = &x->coeff_costs[tx_size][plane];
#if LV_MAP_PROB
for (int ctx = 0; ctx < TXB_SKIP_CONTEXTS; ++ctx)
av1_cost_tokens_from_cdf(pcost->txb_skip_cost[ctx],
fc->txb_skip_cdf[tx_size][ctx], NULL);
......@@ -685,43 +677,6 @@ void av1_fill_coeff_costs(MACROBLOCK *x, FRAME_CONTEXT *fc) {
pcost->hv_eob_cost[tx_class][ctx],
fc->hv_eob_cdf[tx_size][plane][tx_class][ctx], NULL);
#endif // CONFIG_CTX1D
#else // LV_MAP_PROB
for (int ctx = 0; ctx < TXB_SKIP_CONTEXTS; ++ctx)
get_rate_cost(fc->txb_skip[tx_size][ctx], pcost->txb_skip_cost[ctx]);
for (int ctx = 0; ctx < SIG_COEF_CONTEXTS; ++ctx)
get_rate_cost(fc->nz_map[tx_size][plane][ctx], pcost->nz_map_cost[ctx]);
for (int ctx = 0; ctx < EOB_COEF_CONTEXTS; ++ctx)
get_rate_cost(fc->eob_flag[tx_size][plane][ctx], pcost->eob_cost[ctx]);
for (int ctx = 0; ctx < DC_SIGN_CONTEXTS; ++ctx)
get_rate_cost(fc->dc_sign[plane][ctx], pcost->dc_sign_cost[ctx]);
for (int layer = 0; layer < NUM_BASE_LEVELS; ++layer)
for (int ctx = 0; ctx < COEFF_BASE_CONTEXTS; ++ctx)
get_rate_cost(fc->coeff_base[tx_size][plane][layer][ctx],
pcost->base_cost[layer][ctx]);
for (int ctx = 0; ctx < LEVEL_CONTEXTS; ++ctx)
get_rate_cost(fc->coeff_lps[tx_size][plane][ctx], pcost->lps_cost[ctx]);
#if CONFIG_CTX1D
for (int tx_class = 0; tx_class < TX_CLASSES; ++tx_class)
get_rate_cost(fc->eob_mode[tx_size][plane][tx_class],
pcost->eob_mode_cost[tx_class]);
for (int tx_class = 0; tx_class < TX_CLASSES; ++tx_class)
for (int ctx = 0; ctx < EMPTY_LINE_CONTEXTS; ++ctx)
get_rate_cost(fc->empty_line[tx_size][plane][tx_class][ctx],
pcost->empty_line_cost[tx_class][ctx]);
for (int tx_class = 0; tx_class < TX_CLASSES; ++tx_class)
for (int ctx = 0; ctx < HV_EOB_CONTEXTS; ++ctx)
get_rate_cost(fc->hv_eob[tx_size][plane][tx_class][ctx],
pcost->hv_eob_cost[tx_class][ctx]);
#endif // CONFIG_CTX1D
#endif // LV_MAP_PROB
}
}
}
......
......@@ -4106,13 +4106,8 @@ static void select_tx_block(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row,
TXB_CTX txb_ctx;
get_txb_ctx(plane_bsize, tx_size, plane, pta, ptl, &txb_ctx);
#if LV_MAP_PROB
zero_blk_rate = x->coeff_costs[txs_ctx][get_plane_type(plane)]
.txb_skip_cost[txb_ctx.txb_skip_ctx][1];
#else
zero_blk_rate =
av1_cost_bit(xd->fc->txb_skip[txs_ctx][txb_ctx.txb_skip_ctx], 1);
#endif // LV_MAP_PROB
#else
TX_SIZE tx_size_ctx = txsize_sqr_map[tx_size];
int coeff_ctx = get_entropy_context(tx_size, pta, ptl);
......
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