Renaming txfm to tx for consistency in some places.
Change-Id: I2a6a646570e2af66315e7c658d00d99f80c4b127
This commit is contained in:
parent
730a34416f
commit
828119d6ab
@ -609,16 +609,16 @@ void vp9_coef_tree_initialize() {
|
|||||||
#define COEF_COUNT_SAT_AFTER_KEY 24
|
#define COEF_COUNT_SAT_AFTER_KEY 24
|
||||||
#define COEF_MAX_UPDATE_FACTOR_AFTER_KEY 128
|
#define COEF_MAX_UPDATE_FACTOR_AFTER_KEY 128
|
||||||
|
|
||||||
static void adapt_coef_probs(VP9_COMMON *cm, TX_SIZE txfm_size,
|
static void adapt_coef_probs(VP9_COMMON *cm, TX_SIZE tx_size,
|
||||||
unsigned int count_sat,
|
unsigned int count_sat,
|
||||||
unsigned int update_factor) {
|
unsigned int update_factor) {
|
||||||
FRAME_CONTEXT *pre_fc = &cm->frame_contexts[cm->frame_context_idx];
|
FRAME_CONTEXT *pre_fc = &cm->frame_contexts[cm->frame_context_idx];
|
||||||
|
|
||||||
vp9_coeff_probs_model *dst_coef_probs = cm->fc.coef_probs[txfm_size];
|
vp9_coeff_probs_model *dst_coef_probs = cm->fc.coef_probs[tx_size];
|
||||||
vp9_coeff_probs_model *pre_coef_probs = pre_fc->coef_probs[txfm_size];
|
vp9_coeff_probs_model *pre_coef_probs = pre_fc->coef_probs[tx_size];
|
||||||
vp9_coeff_count_model *coef_counts = cm->counts.coef[txfm_size];
|
vp9_coeff_count_model *coef_counts = cm->counts.coef[tx_size];
|
||||||
unsigned int (*eob_branch_count)[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS] =
|
unsigned int (*eob_branch_count)[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS] =
|
||||||
cm->counts.eob_branch[txfm_size];
|
cm->counts.eob_branch[tx_size];
|
||||||
int t, i, j, k, l;
|
int t, i, j, k, l;
|
||||||
unsigned int branch_ct[UNCONSTRAINED_NODES][2];
|
unsigned int branch_ct[UNCONSTRAINED_NODES][2];
|
||||||
vp9_prob coef_probs[UNCONSTRAINED_NODES];
|
vp9_prob coef_probs[UNCONSTRAINED_NODES];
|
||||||
|
@ -75,7 +75,7 @@ DECLARE_ALIGNED(16, extern const uint8_t,
|
|||||||
#define WRITE_COEF_CONTINUE(val, token) \
|
#define WRITE_COEF_CONTINUE(val, token) \
|
||||||
{ \
|
{ \
|
||||||
qcoeff_ptr[scan[c]] = vp9_read_and_apply_sign(r, val) * \
|
qcoeff_ptr[scan[c]] = vp9_read_and_apply_sign(r, val) * \
|
||||||
dq[c > 0] / (1 + (txfm_size == TX_32X32)); \
|
dq[c > 0] / (1 + (tx_size == TX_32X32)); \
|
||||||
INCREMENT_COUNT(token); \
|
INCREMENT_COUNT(token); \
|
||||||
c++; \
|
c++; \
|
||||||
continue; \
|
continue; \
|
||||||
@ -90,7 +90,7 @@ DECLARE_ALIGNED(16, extern const uint8_t,
|
|||||||
static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
|
static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
|
||||||
vp9_reader *r, int block_idx,
|
vp9_reader *r, int block_idx,
|
||||||
PLANE_TYPE type, int seg_eob, int16_t *qcoeff_ptr,
|
PLANE_TYPE type, int seg_eob, int16_t *qcoeff_ptr,
|
||||||
TX_SIZE txfm_size, const int16_t *dq,
|
TX_SIZE tx_size, const int16_t *dq,
|
||||||
ENTROPY_CONTEXT *A, ENTROPY_CONTEXT *L) {
|
ENTROPY_CONTEXT *A, ENTROPY_CONTEXT *L) {
|
||||||
FRAME_CONTEXT *const fc = &cm->fc;
|
FRAME_CONTEXT *const fc = &cm->fc;
|
||||||
FRAME_COUNTS *const counts = &cm->counts;
|
FRAME_COUNTS *const counts = &cm->counts;
|
||||||
@ -98,16 +98,16 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
|
|||||||
const int ref = xd->mode_info_context->mbmi.ref_frame[0] != INTRA_FRAME;
|
const int ref = xd->mode_info_context->mbmi.ref_frame[0] != INTRA_FRAME;
|
||||||
int band, pt, c = 0;
|
int band, pt, c = 0;
|
||||||
vp9_prob (*coef_probs)[PREV_COEF_CONTEXTS][UNCONSTRAINED_NODES] =
|
vp9_prob (*coef_probs)[PREV_COEF_CONTEXTS][UNCONSTRAINED_NODES] =
|
||||||
fc->coef_probs[txfm_size][type][ref];
|
fc->coef_probs[tx_size][type][ref];
|
||||||
vp9_prob coef_probs_full[COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES];
|
vp9_prob coef_probs_full[COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES];
|
||||||
uint8_t load_map[COEF_BANDS][PREV_COEF_CONTEXTS] = { { 0 } };
|
uint8_t load_map[COEF_BANDS][PREV_COEF_CONTEXTS] = { { 0 } };
|
||||||
vp9_prob *prob;
|
vp9_prob *prob;
|
||||||
vp9_coeff_count_model *coef_counts = counts->coef[txfm_size];
|
vp9_coeff_count_model *coef_counts = counts->coef[tx_size];
|
||||||
const int16_t *scan, *nb;
|
const int16_t *scan, *nb;
|
||||||
uint8_t token_cache[1024];
|
uint8_t token_cache[1024];
|
||||||
const uint8_t * band_translate;
|
const uint8_t * band_translate;
|
||||||
|
|
||||||
switch (txfm_size) {
|
switch (tx_size) {
|
||||||
default:
|
default:
|
||||||
case TX_4X4: {
|
case TX_4X4: {
|
||||||
scan = get_scan_4x4(get_tx_type_4x4(type, xd, block_idx));
|
scan = get_scan_4x4(get_tx_type_4x4(type, xd, block_idx));
|
||||||
@ -150,7 +150,7 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
|
|||||||
pt = get_coef_context(nb, token_cache, c);
|
pt = get_coef_context(nb, token_cache, c);
|
||||||
band = get_coef_band(band_translate, c);
|
band = get_coef_band(band_translate, c);
|
||||||
prob = coef_probs[band][pt];
|
prob = coef_probs[band][pt];
|
||||||
counts->eob_branch[txfm_size][type][ref][band][pt]++;
|
counts->eob_branch[tx_size][type][ref][band][pt]++;
|
||||||
if (!vp9_read(r, prob[EOB_CONTEXT_NODE]))
|
if (!vp9_read(r, prob[EOB_CONTEXT_NODE]))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -200,8 +200,8 @@ static void update_mbintra_mode_probs(VP9_COMP* const cpi,
|
|||||||
(unsigned int *)cpi->y_mode_count[j]);
|
(unsigned int *)cpi->y_mode_count[j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write_selected_txfm_size(const VP9_COMP *cpi, TX_SIZE tx_size,
|
static void write_selected_tx_size(const VP9_COMP *cpi, TX_SIZE tx_size,
|
||||||
BLOCK_SIZE_TYPE bsize, vp9_writer *w) {
|
BLOCK_SIZE_TYPE bsize, vp9_writer *w) {
|
||||||
const MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
const MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
||||||
const vp9_prob *tx_probs = get_tx_probs2(xd, &cpi->common.fc.tx_probs);
|
const vp9_prob *tx_probs = get_tx_probs2(xd, &cpi->common.fc.tx_probs);
|
||||||
vp9_write(w, tx_size != TX_4X4, tx_probs[0]);
|
vp9_write(w, tx_size != TX_4X4, tx_probs[0]);
|
||||||
@ -434,7 +434,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
|
|||||||
if (bsize >= BLOCK_SIZE_SB8X8 && pc->tx_mode == TX_MODE_SELECT &&
|
if (bsize >= BLOCK_SIZE_SB8X8 && pc->tx_mode == TX_MODE_SELECT &&
|
||||||
!(rf != INTRA_FRAME &&
|
!(rf != INTRA_FRAME &&
|
||||||
(skip_coeff || vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP)))) {
|
(skip_coeff || vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP)))) {
|
||||||
write_selected_txfm_size(cpi, mi->txfm_size, bsize, bc);
|
write_selected_tx_size(cpi, mi->txfm_size, bsize, bc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rf == INTRA_FRAME) {
|
if (rf == INTRA_FRAME) {
|
||||||
@ -541,7 +541,7 @@ static void write_mb_modes_kf(const VP9_COMP *cpi,
|
|||||||
write_skip_coeff(cpi, segment_id, m, bc);
|
write_skip_coeff(cpi, segment_id, m, bc);
|
||||||
|
|
||||||
if (m->mbmi.sb_type >= BLOCK_SIZE_SB8X8 && c->tx_mode == TX_MODE_SELECT)
|
if (m->mbmi.sb_type >= BLOCK_SIZE_SB8X8 && c->tx_mode == TX_MODE_SELECT)
|
||||||
write_selected_txfm_size(cpi, m->mbmi.txfm_size, m->mbmi.sb_type, bc);
|
write_selected_tx_size(cpi, m->mbmi.txfm_size, m->mbmi.sb_type, bc);
|
||||||
|
|
||||||
if (m->mbmi.sb_type >= BLOCK_SIZE_SB8X8) {
|
if (m->mbmi.sb_type >= BLOCK_SIZE_SB8X8) {
|
||||||
const MB_PREDICTION_MODE A = above_block_mode(m, 0, mis);
|
const MB_PREDICTION_MODE A = above_block_mode(m, 0, mis);
|
||||||
@ -724,12 +724,12 @@ static void print_prob_tree(vp9_coeff_probs *coef_probs, int block_types) {
|
|||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void build_tree_distribution(VP9_COMP *cpi, TX_SIZE txfm_size) {
|
static void build_tree_distribution(VP9_COMP *cpi, TX_SIZE tx_size) {
|
||||||
vp9_coeff_probs_model *coef_probs = cpi->frame_coef_probs[txfm_size];
|
vp9_coeff_probs_model *coef_probs = cpi->frame_coef_probs[tx_size];
|
||||||
vp9_coeff_count *coef_counts = cpi->coef_counts[txfm_size];
|
vp9_coeff_count *coef_counts = cpi->coef_counts[tx_size];
|
||||||
unsigned int (*eob_branch_ct)[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS] =
|
unsigned int (*eob_branch_ct)[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS] =
|
||||||
cpi->common.counts.eob_branch[txfm_size];
|
cpi->common.counts.eob_branch[tx_size];
|
||||||
vp9_coeff_stats *coef_branch_ct = cpi->frame_branch_ct[txfm_size];
|
vp9_coeff_stats *coef_branch_ct = cpi->frame_branch_ct[tx_size];
|
||||||
vp9_prob full_probs[ENTROPY_NODES];
|
vp9_prob full_probs[ENTROPY_NODES];
|
||||||
int i, j, k, l;
|
int i, j, k, l;
|
||||||
|
|
||||||
@ -754,9 +754,9 @@ static void build_tree_distribution(VP9_COMP *cpi, TX_SIZE txfm_size) {
|
|||||||
if (!cpi->dummy_packing) {
|
if (!cpi->dummy_packing) {
|
||||||
int t;
|
int t;
|
||||||
for (t = 0; t < MAX_ENTROPY_TOKENS; ++t)
|
for (t = 0; t < MAX_ENTROPY_TOKENS; ++t)
|
||||||
context_counters[txfm_size][i][j][k][l][t] +=
|
context_counters[tx_size][i][j][k][l][t] +=
|
||||||
coef_counts[i][j][k][l][t];
|
coef_counts[i][j][k][l][t];
|
||||||
context_counters[txfm_size][i][j][k][l][MAX_ENTROPY_TOKENS] +=
|
context_counters[tx_size][i][j][k][l][MAX_ENTROPY_TOKENS] +=
|
||||||
eob_branch_ct[i][j][k][l];
|
eob_branch_ct[i][j][k][l];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -257,8 +257,7 @@ void vp9_tokenize_sb(VP9_COMP *cpi, TOKENEXTRA **t, int dry_run,
|
|||||||
const int mb_skip_context = vp9_get_pred_context_mbskip(xd);
|
const int mb_skip_context = vp9_get_pred_context_mbskip(xd);
|
||||||
const int skip_inc = !vp9_segfeature_active(&xd->seg, mbmi->segment_id,
|
const int skip_inc = !vp9_segfeature_active(&xd->seg, mbmi->segment_id,
|
||||||
SEG_LVL_SKIP);
|
SEG_LVL_SKIP);
|
||||||
const TX_SIZE txfm_size = mbmi->txfm_size;
|
struct tokenize_b_args arg = { cpi, xd, t, mbmi->txfm_size, dry_run };
|
||||||
struct tokenize_b_args arg = { cpi, xd, t, txfm_size, dry_run };
|
|
||||||
|
|
||||||
mbmi->mb_skip_coeff = vp9_sb_is_skippable(xd, bsize);
|
mbmi->mb_skip_coeff = vp9_sb_is_skippable(xd, bsize);
|
||||||
if (mbmi->mb_skip_coeff) {
|
if (mbmi->mb_skip_coeff) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user