Commit d0365c4a authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Replacing txfm with tx.

Renaming txfm_stepdown_count to tx_stepdown_count and max_txfm_size to
max_tx_size.

Change-Id: Ifc173e22c78240e561a57c4c741b64b1b8fc6fef
parent 682c2723
......@@ -2212,7 +2212,7 @@ static void encode_frame_internal(VP9_COMP *cpi) {
cpi->inter_zz_count = 0;
vp9_zero(cm->counts.switchable_interp);
vp9_zero(cpi->txfm_stepdown_count);
vp9_zero(cpi->tx_stepdown_count);
xd->mi_8x8 = cm->mi_grid_visible;
// required for vp9_frame_init_quantizer
......@@ -2458,9 +2458,9 @@ static void select_tx_mode(VP9_COMP *cpi) {
unsigned int total = 0;
int i;
for (i = 0; i < TX_SIZES; ++i)
total += cpi->txfm_stepdown_count[i];
total += cpi->tx_stepdown_count[i];
if (total) {
double fraction = (double)cpi->txfm_stepdown_count[0] / total;
double fraction = (double)cpi->tx_stepdown_count[0] / total;
cpi->common.tx_mode = fraction > 0.90 ? ALLOW_32X32 : TX_MODE_SELECT;
// printf("fraction = %f\n", fraction);
} // else keep unchanged
......
......@@ -649,7 +649,7 @@ typedef struct VP9_COMP {
unsigned int switchable_interp_count[SWITCHABLE_FILTERS + 1]
[SWITCHABLE_FILTERS];
unsigned int txfm_stepdown_count[TX_SIZES];
unsigned int tx_stepdown_count[TX_SIZES];
int initial_width;
int initial_height;
......
......@@ -715,15 +715,15 @@ static void choose_largest_txfm_size(VP9_COMP *cpi, MACROBLOCK *x,
int *skip, int64_t *sse,
int64_t ref_best_rd,
BLOCK_SIZE bs) {
const TX_SIZE max_txfm_size = max_txsize_lookup[bs];
const TX_SIZE max_tx_size = max_txsize_lookup[bs];
VP9_COMMON *const cm = &cpi->common;
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->this_mi->mbmi;
if (max_txfm_size == TX_32X32 &&
if (max_tx_size == TX_32X32 &&
(cm->tx_mode == ALLOW_32X32 ||
cm->tx_mode == TX_MODE_SELECT)) {
mbmi->tx_size = TX_32X32;
} else if (max_txfm_size >= TX_16X16 &&
} else if (max_tx_size >= TX_16X16 &&
(cm->tx_mode == ALLOW_16X16 ||
cm->tx_mode == ALLOW_32X32 ||
cm->tx_mode == TX_MODE_SELECT)) {
......@@ -736,7 +736,7 @@ static void choose_largest_txfm_size(VP9_COMP *cpi, MACROBLOCK *x,
txfm_rd_in_plane(x, rate, distortion, skip,
&sse[mbmi->tx_size], ref_best_rd, 0, bs,
mbmi->tx_size);
cpi->txfm_stepdown_count[0]++;
cpi->tx_stepdown_count[0]++;
}
static void choose_txfm_size_from_rd(VP9_COMP *cpi, MACROBLOCK *x,
......@@ -830,15 +830,15 @@ static void choose_txfm_size_from_rd(VP9_COMP *cpi, MACROBLOCK *x,
rd[TX_32X32][1] < rd[TX_16X16][1] &&
rd[TX_32X32][1] < rd[TX_8X8][1] &&
rd[TX_32X32][1] < rd[TX_4X4][1]) {
cpi->txfm_stepdown_count[0]++;
cpi->tx_stepdown_count[0]++;
} else if (max_tx_size >= TX_16X16 &&
rd[TX_16X16][1] < rd[TX_8X8][1] &&
rd[TX_16X16][1] < rd[TX_4X4][1]) {
cpi->txfm_stepdown_count[max_tx_size - TX_16X16]++;
cpi->tx_stepdown_count[max_tx_size - TX_16X16]++;
} else if (rd[TX_8X8][1] < rd[TX_4X4][1]) {
cpi->txfm_stepdown_count[max_tx_size - TX_8X8]++;
cpi->tx_stepdown_count[max_tx_size - TX_8X8]++;
} else {
cpi->txfm_stepdown_count[max_tx_size - TX_4X4]++;
cpi->tx_stepdown_count[max_tx_size - TX_4X4]++;
}
}
......@@ -848,7 +848,7 @@ static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
int *s, int *skip, int64_t *sse,
int64_t ref_best_rd,
BLOCK_SIZE bs) {
const TX_SIZE max_txfm_size = max_txsize_lookup[bs];
const TX_SIZE max_tx_size = max_txsize_lookup[bs];
VP9_COMMON *const cm = &cpi->common;
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->this_mi->mbmi;
......@@ -864,9 +864,9 @@ static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
// for (n = TX_4X4; n <= max_txfm_size; n++)
// r[n][0] = (r[n][0] * scale_r[n]);
for (n = TX_4X4; n <= max_txfm_size; n++) {
for (n = TX_4X4; n <= max_tx_size; n++) {
r[n][1] = r[n][0];
for (m = 0; m <= n - (n == max_txfm_size); m++) {
for (m = 0; m <= n - (n == max_tx_size); m++) {
if (m == n)
r[n][1] += vp9_cost_zero(tx_probs[m]);
else
......@@ -878,7 +878,7 @@ static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
s0 = vp9_cost_bit(skip_prob, 0);
s1 = vp9_cost_bit(skip_prob, 1);
for (n = TX_4X4; n <= max_txfm_size; n++) {
for (n = TX_4X4; n <= max_tx_size; n++) {
if (s[n]) {
rd[n][0] = rd[n][1] = RDCOST(x->rdmult, x->rddiv, s1, d[n]);
} else {
......@@ -886,19 +886,19 @@ static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
rd[n][1] = RDCOST(x->rdmult, x->rddiv, r[n][1] + s0, d[n]);
}
}
for (n = TX_4X4; n <= max_txfm_size; n++) {
for (n = TX_4X4; n <= max_tx_size; n++) {
rd[n][0] = (int64_t)(scale_rd[n] * rd[n][0]);
rd[n][1] = (int64_t)(scale_rd[n] * rd[n][1]);
}
if (max_txfm_size == TX_32X32 &&
if (max_tx_size == TX_32X32 &&
(cm->tx_mode == ALLOW_32X32 ||
(cm->tx_mode == TX_MODE_SELECT &&
rd[TX_32X32][1] <= rd[TX_16X16][1] &&
rd[TX_32X32][1] <= rd[TX_8X8][1] &&
rd[TX_32X32][1] <= rd[TX_4X4][1]))) {
mbmi->tx_size = TX_32X32;
} else if (max_txfm_size >= TX_16X16 &&
} else if (max_tx_size >= TX_16X16 &&
(cm->tx_mode == ALLOW_16X16 ||
cm->tx_mode == ALLOW_32X32 ||
(cm->tx_mode == TX_MODE_SELECT &&
......@@ -920,19 +920,19 @@ static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
txfm_rd_in_plane(x, rate, distortion, skip, &sse[mbmi->tx_size],
ref_best_rd, 0, bs, mbmi->tx_size);
if (max_txfm_size == TX_32X32 &&
if (max_tx_size == TX_32X32 &&
rd[TX_32X32][1] <= rd[TX_16X16][1] &&
rd[TX_32X32][1] <= rd[TX_8X8][1] &&
rd[TX_32X32][1] <= rd[TX_4X4][1]) {
cpi->txfm_stepdown_count[0]++;
} else if (max_txfm_size >= TX_16X16 &&
cpi->tx_stepdown_count[0]++;
} else if (max_tx_size >= TX_16X16 &&
rd[TX_16X16][1] <= rd[TX_8X8][1] &&
rd[TX_16X16][1] <= rd[TX_4X4][1]) {
cpi->txfm_stepdown_count[max_txfm_size - TX_16X16]++;
cpi->tx_stepdown_count[max_tx_size - TX_16X16]++;
} else if (rd[TX_8X8][1] <= rd[TX_4X4][1]) {
cpi->txfm_stepdown_count[max_txfm_size - TX_8X8]++;
cpi->tx_stepdown_count[max_tx_size - TX_8X8]++;
} else {
cpi->txfm_stepdown_count[max_txfm_size - TX_4X4]++;
cpi->tx_stepdown_count[max_tx_size - TX_4X4]++;
}
}
......
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