Commit f476e1a6 authored by Jingning Han's avatar Jingning Han

Regularize the minimum tx_size

Make TX_4x4 as the minimum selectable transform size form bit-stream
syntax perspective. Use value 0 as the minimum supported transform
size unit for the block coding.

Change-Id: Ieb3167216a96aaddb0810a424ccaaf8ae896fec5
parent 3f59590e
......@@ -984,19 +984,19 @@ void av1_adapt_intra_frame_probs(AV1_COMMON *cm) {
for (i = 0; i < TX_SIZE_CONTEXTS; ++i) {
av1_tx_counts_to_branch_counts_8x8(counts->tx.p8x8[i], branch_ct_8x8p);
for (j = 0; j < TX_SIZES - 3; ++j)
for (j = TX_4X4; j < TX_SIZES - 3; ++j)
fc->tx_probs.p8x8[i][j] =
mode_mv_merge_probs(pre_fc->tx_probs.p8x8[i][j], branch_ct_8x8p[j]);
av1_tx_counts_to_branch_counts_16x16(counts->tx.p16x16[i],
branch_ct_16x16p);
for (j = 0; j < TX_SIZES - 2; ++j)
for (j = TX_4X4; j < TX_SIZES - 2; ++j)
fc->tx_probs.p16x16[i][j] = mode_mv_merge_probs(
pre_fc->tx_probs.p16x16[i][j], branch_ct_16x16p[j]);
av1_tx_counts_to_branch_counts_32x32(counts->tx.p32x32[i],
branch_ct_32x32p);
for (j = 0; j < TX_SIZES - 1; ++j)
for (j = TX_4X4; j < TX_SIZES - 1; ++j)
fc->tx_probs.p32x32[i][j] = mode_mv_merge_probs(
pre_fc->tx_probs.p32x32[i][j], branch_ct_32x32p[j]);
}
......
......@@ -489,7 +489,7 @@ void av1_accumulate_frame_counts(AV1_COMMON *cm, FRAME_COUNTS *counts,
if (is_dec) {
int n;
for (i = 0; i < TX_SIZES; i++)
for (i = TX_4X4; i < TX_SIZES; i++)
for (j = 0; j < PLANE_TYPES; j++)
for (k = 0; k < REF_TYPES; k++)
for (l = 0; l < COEF_BANDS; l++)
......@@ -501,7 +501,7 @@ void av1_accumulate_frame_counts(AV1_COMMON *cm, FRAME_COUNTS *counts,
counts->coef[i][j][k][l][m][n];
}
} else {
for (i = 0; i < TX_SIZES; i++)
for (i = TX_4X4; i < TX_SIZES; i++)
for (j = 0; j < PLANE_TYPES; j++)
for (k = 0; k < REF_TYPES; k++)
for (l = 0; l < COEF_BANDS; l++)
......@@ -574,17 +574,17 @@ void av1_accumulate_frame_counts(AV1_COMMON *cm, FRAME_COUNTS *counts,
#endif // CONFIG_EXT_REFS
for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
for (j = 0; j < TX_SIZES; j++)
for (j = TX_4X4; j < TX_SIZES; j++)
cm->counts.tx.p32x32[i][j] += counts->tx.p32x32[i][j];
for (j = 0; j < TX_SIZES - 1; j++)
for (j = TX_4X4; j < TX_SIZES - 1; j++)
cm->counts.tx.p16x16[i][j] += counts->tx.p16x16[i][j];
for (j = 0; j < TX_SIZES - 2; j++)
for (j = TX_4X4; j < TX_SIZES - 2; j++)
cm->counts.tx.p8x8[i][j] += counts->tx.p8x8[i][j];
}
for (i = 0; i < TX_SIZES; i++)
for (i = TX_4X4; i < TX_SIZES; i++)
cm->counts.tx.tx_totals[i] += counts->tx.tx_totals[i];
for (i = 0; i < SKIP_CONTEXTS; i++)
......
......@@ -115,15 +115,15 @@ static void read_tx_mode_probs(struct tx_probs *tx_probs, aom_reader *r) {
int i, j;
for (i = 0; i < TX_SIZE_CONTEXTS; ++i)
for (j = 0; j < TX_SIZES - 3; ++j)
for (j = TX_4X4; j < TX_SIZES - 3; ++j)
av1_diff_update_prob(r, &tx_probs->p8x8[i][j]);
for (i = 0; i < TX_SIZE_CONTEXTS; ++i)
for (j = 0; j < TX_SIZES - 2; ++j)
for (j = TX_4X4; j < TX_SIZES - 2; ++j)
av1_diff_update_prob(r, &tx_probs->p16x16[i][j]);
for (i = 0; i < TX_SIZE_CONTEXTS; ++i)
for (j = 0; j < TX_SIZES - 1; ++j)
for (j = TX_4X4; j < TX_SIZES - 1; ++j)
av1_diff_update_prob(r, &tx_probs->p32x32[i][j]);
}
......@@ -727,7 +727,7 @@ static void read_coef_probs_common(av1_coeff_probs_model *coef_probs,
static void read_coef_probs(FRAME_CONTEXT *fc, TX_MODE tx_mode, aom_reader *r) {
const TX_SIZE max_tx_size = tx_mode_to_biggest_tx_size[tx_mode];
TX_SIZE tx_size;
for (tx_size = TX_4X4; tx_size <= max_tx_size; ++tx_size)
for (tx_size = 0; tx_size <= max_tx_size; ++tx_size)
read_coef_probs_common(fc->coef_probs[tx_size], r);
#if CONFIG_RANS || CONFIG_DAALA_EC
av1_coef_pareto_cdfs(fc);
......
......@@ -1238,7 +1238,7 @@ static void update_coef_probs(AV1_COMP *cpi, aom_writer *w) {
const TX_MODE tx_mode = cpi->common.tx_mode;
const TX_SIZE max_tx_size = tx_mode_to_biggest_tx_size[tx_mode];
TX_SIZE tx_size;
for (tx_size = TX_4X4; tx_size <= max_tx_size; ++tx_size) {
for (tx_size = 0; tx_size <= max_tx_size; ++tx_size) {
av1_coeff_stats frame_branch_ct[PLANE_TYPES];
av1_coeff_probs_model frame_coef_probs[PLANE_TYPES];
if (cpi->td.counts->tx.tx_totals[tx_size] <= 20 ||
......@@ -1462,20 +1462,20 @@ static void update_txfm_probs(AV1_COMMON *cm, aom_writer *w,
for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
av1_tx_counts_to_branch_counts_8x8(counts->tx.p8x8[i], ct_8x8p);
for (j = 0; j < TX_SIZES - 3; j++)
for (j = TX_4X4; j < TX_SIZES - 3; j++)
av1_cond_prob_diff_update(w, &cm->fc->tx_probs.p8x8[i][j], ct_8x8p[j]);
}
for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
av1_tx_counts_to_branch_counts_16x16(counts->tx.p16x16[i], ct_16x16p);
for (j = 0; j < TX_SIZES - 2; j++)
for (j = TX_4X4; j < TX_SIZES - 2; j++)
av1_cond_prob_diff_update(w, &cm->fc->tx_probs.p16x16[i][j],
ct_16x16p[j]);
}
for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
av1_tx_counts_to_branch_counts_32x32(counts->tx.p32x32[i], ct_32x32p);
for (j = 0; j < TX_SIZES - 1; j++)
for (j = TX_4X4; j < TX_SIZES - 1; j++)
av1_cond_prob_diff_update(w, &cm->fc->tx_probs.p32x32[i][j],
ct_32x32p[j]);
}
......
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