ref: 23391ea8353f9535ef12d0b797f994f1e181ca2d
parent: decb1b94deb4420ab540b0963f1ca91ed20137c6
author: Dmitry Kovalev <[email protected]>
date: Fri Jul 26 13:15:37 EDT 2013
Renaming TX_SIZE_MAX_SB to TX_SIZES. Change-Id: I6aa4191935aa93461a07c41b59fdae1eb5f5f107
--- a/vp9/common/vp9_entropymode.c
+++ b/vp9/common/vp9_entropymode.c
@@ -455,25 +455,25 @@
if (cm->tx_mode == TX_MODE_SELECT) {
int j;
- unsigned int branch_ct_8x8p[TX_SIZE_MAX_SB - 3][2];
- unsigned int branch_ct_16x16p[TX_SIZE_MAX_SB - 2][2];
- unsigned int branch_ct_32x32p[TX_SIZE_MAX_SB - 1][2];
+ unsigned int branch_ct_8x8p[TX_SIZES - 3][2];
+ unsigned int branch_ct_16x16p[TX_SIZES - 2][2];
+ unsigned int branch_ct_32x32p[TX_SIZES - 1][2];
for (i = 0; i < TX_SIZE_CONTEXTS; ++i) {
tx_counts_to_branch_counts_8x8(counts->tx.p8x8[i], branch_ct_8x8p);
- for (j = 0; j < TX_SIZE_MAX_SB - 3; ++j)
+ for (j = 0; j < TX_SIZES - 3; ++j)
fc->tx_probs.p8x8[i][j] = update_ct2(pre_fc->tx_probs.p8x8[i][j],
branch_ct_8x8p[j]);
tx_counts_to_branch_counts_16x16(counts->tx.p16x16[i],
branch_ct_16x16p);
- for (j = 0; j < TX_SIZE_MAX_SB - 2; ++j)
+ for (j = 0; j < TX_SIZES - 2; ++j)
fc->tx_probs.p16x16[i][j] = update_ct2(pre_fc->tx_probs.p16x16[i][j],
branch_ct_16x16p[j]);
tx_counts_to_branch_counts_32x32(counts->tx.p32x32[i],
branch_ct_32x32p);
- for (j = 0; j < TX_SIZE_MAX_SB - 1; ++j)
+ for (j = 0; j < TX_SIZES - 1; ++j)
fc->tx_probs.p32x32[i][j] = update_ct2(pre_fc->tx_probs.p32x32[i][j],
branch_ct_32x32p[j]);
}
--- a/vp9/common/vp9_entropymode.h
+++ b/vp9/common/vp9_entropymode.h
@@ -24,15 +24,15 @@
struct VP9Common;
struct tx_probs {
- vp9_prob p32x32[TX_SIZE_CONTEXTS][TX_SIZE_MAX_SB - 1];
- vp9_prob p16x16[TX_SIZE_CONTEXTS][TX_SIZE_MAX_SB - 2];
- vp9_prob p8x8[TX_SIZE_CONTEXTS][TX_SIZE_MAX_SB - 3];
+ vp9_prob p32x32[TX_SIZE_CONTEXTS][TX_SIZES - 1];
+ vp9_prob p16x16[TX_SIZE_CONTEXTS][TX_SIZES - 2];
+ vp9_prob p8x8[TX_SIZE_CONTEXTS][TX_SIZES - 3];
};
struct tx_counts {
- unsigned int p32x32[TX_SIZE_CONTEXTS][TX_SIZE_MAX_SB];
- unsigned int p16x16[TX_SIZE_CONTEXTS][TX_SIZE_MAX_SB - 1];
- unsigned int p8x8[TX_SIZE_CONTEXTS][TX_SIZE_MAX_SB - 2];
+ unsigned int p32x32[TX_SIZE_CONTEXTS][TX_SIZES];
+ unsigned int p16x16[TX_SIZE_CONTEXTS][TX_SIZES - 1];
+ unsigned int p8x8[TX_SIZE_CONTEXTS][TX_SIZES - 2];
};
extern const vp9_prob vp9_kf_uv_mode_prob[VP9_INTRA_MODES][VP9_INTRA_MODES - 1];
--- a/vp9/common/vp9_enums.h
+++ b/vp9/common/vp9_enums.h
@@ -54,7 +54,7 @@
TX_8X8 = 1, // 8x8 dct transform
TX_16X16 = 2, // 16x16 dct transform
TX_32X32 = 3, // 32x32 dct transform
- TX_SIZE_MAX_SB, // Number of transforms available to SBs
+ TX_SIZES
} TX_SIZE;
typedef enum {
--- a/vp9/common/vp9_onyxc_int.h
+++ b/vp9/common/vp9_onyxc_int.h
@@ -42,7 +42,7 @@
vp9_prob uv_mode_prob[VP9_INTRA_MODES][VP9_INTRA_MODES - 1];
vp9_prob partition_prob[NUM_FRAME_TYPES][NUM_PARTITION_CONTEXTS]
[PARTITION_TYPES - 1];
- vp9_coeff_probs_model coef_probs[TX_SIZE_MAX_SB][BLOCK_TYPES];
+ vp9_coeff_probs_model coef_probs[TX_SIZES][BLOCK_TYPES];
vp9_prob switchable_interp_prob[VP9_SWITCHABLE_FILTERS + 1]
[VP9_SWITCHABLE_FILTERS - 1];
vp9_prob inter_mode_probs[INTER_MODE_CONTEXTS][VP9_INTER_MODES - 1];
@@ -59,8 +59,8 @@
unsigned int y_mode[BLOCK_SIZE_GROUPS][VP9_INTRA_MODES];
unsigned int uv_mode[VP9_INTRA_MODES][VP9_INTRA_MODES];
unsigned int partition[NUM_PARTITION_CONTEXTS][PARTITION_TYPES];
- vp9_coeff_count_model coef[TX_SIZE_MAX_SB][BLOCK_TYPES];
- unsigned int eob_branch[TX_SIZE_MAX_SB][BLOCK_TYPES][REF_TYPES]
+ vp9_coeff_count_model coef[TX_SIZES][BLOCK_TYPES];
+ unsigned int eob_branch[TX_SIZES][BLOCK_TYPES][REF_TYPES]
[COEF_BANDS][PREV_COEF_CONTEXTS];
unsigned int switchable_interp[VP9_SWITCHABLE_FILTERS + 1]
[VP9_SWITCHABLE_FILTERS];
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -61,17 +61,17 @@
int i, j;
for (i = 0; i < TX_SIZE_CONTEXTS; ++i)
- for (j = 0; j < TX_SIZE_MAX_SB - 3; ++j)
+ for (j = 0; j < TX_SIZES - 3; ++j)
if (vp9_read(r, VP9_MODE_UPDATE_PROB))
vp9_diff_update_prob(r, &tx_probs->p8x8[i][j]);
for (i = 0; i < TX_SIZE_CONTEXTS; ++i)
- for (j = 0; j < TX_SIZE_MAX_SB - 2; ++j)
+ for (j = 0; j < TX_SIZES - 2; ++j)
if (vp9_read(r, VP9_MODE_UPDATE_PROB))
vp9_diff_update_prob(r, &tx_probs->p16x16[i][j]);
for (i = 0; i < TX_SIZE_CONTEXTS; ++i)
- for (j = 0; j < TX_SIZE_MAX_SB - 1; ++j)
+ for (j = 0; j < TX_SIZES - 1; ++j)
if (vp9_read(r, VP9_MODE_UPDATE_PROB))
vp9_diff_update_prob(r, &tx_probs->p32x32[i][j]);
}
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -44,7 +44,7 @@
int intra_mode_stats[VP9_INTRA_MODES]
[VP9_INTRA_MODES]
[VP9_INTRA_MODES];
-vp9_coeff_stats tree_update_hist[TX_SIZE_MAX_SB][BLOCK_TYPES];
+vp9_coeff_stats tree_update_hist[TX_SIZES][BLOCK_TYPES];
extern unsigned int active_section;
#endif
@@ -51,9 +51,9 @@
#ifdef MODE_STATS
-int64_t tx_count_32x32p_stats[TX_SIZE_CONTEXTS][TX_SIZE_MAX_SB];
-int64_t tx_count_16x16p_stats[TX_SIZE_CONTEXTS][TX_SIZE_MAX_SB - 1];
-int64_t tx_count_8x8p_stats[TX_SIZE_CONTEXTS][TX_SIZE_MAX_SB - 2];
+int64_t tx_count_32x32p_stats[TX_SIZE_CONTEXTS][TX_SIZES];
+int64_t tx_count_16x16p_stats[TX_SIZE_CONTEXTS][TX_SIZES - 1];
+int64_t tx_count_8x8p_stats[TX_SIZE_CONTEXTS][TX_SIZES - 2];
int64_t switchable_interp_stats[VP9_SWITCHABLE_FILTERS+1]
[VP9_SWITCHABLE_FILTERS];
@@ -70,17 +70,17 @@
static void update_tx_count_stats(VP9_COMMON *cm) {
int i, j;
for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
- for (j = 0; j < TX_SIZE_MAX_SB; j++) {
+ for (j = 0; j < TX_SIZES; j++) {
tx_count_32x32p_stats[i][j] += cm->fc.tx_count_32x32p[i][j];
}
}
for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
- for (j = 0; j < TX_SIZE_MAX_SB - 1; j++) {
+ for (j = 0; j < TX_SIZES - 1; j++) {
tx_count_16x16p_stats[i][j] += cm->fc.tx_count_16x16p[i][j];
}
}
for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
- for (j = 0; j < TX_SIZE_MAX_SB - 2; j++) {
+ for (j = 0; j < TX_SIZES - 2; j++) {
tx_count_8x8p_stats[i][j] += cm->fc.tx_count_8x8p[i][j];
}
}
@@ -103,10 +103,10 @@
fclose(fp);
printf(
- "vp9_default_tx_count_32x32p[TX_SIZE_CONTEXTS][TX_SIZE_MAX_SB] = {\n");
+ "vp9_default_tx_count_32x32p[TX_SIZE_CONTEXTS][TX_SIZES] = {\n");
for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
printf(" { ");
- for (j = 0; j < TX_SIZE_MAX_SB; j++) {
+ for (j = 0; j < TX_SIZES; j++) {
printf("%"PRId64", ", tx_count_32x32p_stats[i][j]);
}
printf("},\n");
@@ -113,10 +113,10 @@
}
printf("};\n");
printf(
- "vp9_default_tx_count_16x16p[TX_SIZE_CONTEXTS][TX_SIZE_MAX_SB-1] = {\n");
+ "vp9_default_tx_count_16x16p[TX_SIZE_CONTEXTS][TX_SIZES-1] = {\n");
for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
printf(" { ");
- for (j = 0; j < TX_SIZE_MAX_SB - 1; j++) {
+ for (j = 0; j < TX_SIZES - 1; j++) {
printf("%"PRId64", ", tx_count_16x16p_stats[i][j]);
}
printf("},\n");
@@ -123,10 +123,10 @@
}
printf("};\n");
printf(
- "vp9_default_tx_count_8x8p[TX_SIZE_CONTEXTS][TX_SIZE_MAX_SB-2] = {\n");
+ "vp9_default_tx_count_8x8p[TX_SIZE_CONTEXTS][TX_SIZES-2] = {\n");
for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
printf(" { ");
- for (j = 0; j < TX_SIZE_MAX_SB - 2; j++) {
+ for (j = 0; j < TX_SIZES - 2; j++) {
printf("%"PRId64", ", tx_count_8x8p_stats[i][j]);
}
printf("},\n");
@@ -1034,15 +1034,15 @@
// Probabilities
if (cm->tx_mode == TX_MODE_SELECT) {
int i, j;
- unsigned int ct_8x8p[TX_SIZE_MAX_SB - 3][2];
- unsigned int ct_16x16p[TX_SIZE_MAX_SB - 2][2];
- unsigned int ct_32x32p[TX_SIZE_MAX_SB - 1][2];
+ unsigned int ct_8x8p[TX_SIZES - 3][2];
+ unsigned int ct_16x16p[TX_SIZES - 2][2];
+ unsigned int ct_32x32p[TX_SIZES - 1][2];
for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
tx_counts_to_branch_counts_8x8(cm->counts.tx.p8x8[i],
ct_8x8p);
- for (j = 0; j < TX_SIZE_MAX_SB - 3; j++)
+ for (j = 0; j < TX_SIZES - 3; j++)
vp9_cond_prob_diff_update(w, &cm->fc.tx_probs.p8x8[i][j],
VP9_MODE_UPDATE_PROB, ct_8x8p[j]);
}
@@ -1050,7 +1050,7 @@
for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
tx_counts_to_branch_counts_16x16(cm->counts.tx.p16x16[i],
ct_16x16p);
- for (j = 0; j < TX_SIZE_MAX_SB - 2; j++)
+ for (j = 0; j < TX_SIZES - 2; j++)
vp9_cond_prob_diff_update(w, &cm->fc.tx_probs.p16x16[i][j],
VP9_MODE_UPDATE_PROB, ct_16x16p[j]);
}
@@ -1057,7 +1057,7 @@
for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
tx_counts_to_branch_counts_32x32(cm->counts.tx.p32x32[i], ct_32x32p);
- for (j = 0; j < TX_SIZE_MAX_SB - 1; j++)
+ for (j = 0; j < TX_SIZES - 1; j++)
vp9_cond_prob_diff_update(w, &cm->fc.tx_probs.p32x32[i][j],
VP9_MODE_UPDATE_PROB, ct_32x32p[j]);
}
--- a/vp9/encoder/vp9_block.h
+++ b/vp9/encoder/vp9_block.h
@@ -138,7 +138,7 @@
unsigned char *active_ptr;
// note that token_costs is the cost when eob node is skipped
- vp9_coeff_cost token_costs[TX_SIZE_MAX_SB];
+ vp9_coeff_cost token_costs[TX_SIZES];
int optimize;
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -2301,7 +2301,7 @@
} else {
unsigned int total = 0;
int i;
- for (i = 0; i < TX_SIZE_MAX_SB; ++i)
+ for (i = 0; i < TX_SIZES; ++i)
total += cpi->txfm_stepdown_count[i];
if (total) {
double fraction = (double)cpi->txfm_stepdown_count[0] / total;
@@ -2415,7 +2415,7 @@
int diff;
if (i == TX_MODE_SELECT)
pd -= RDCOST(cpi->mb.rdmult, cpi->mb.rddiv,
- 2048 * (TX_SIZE_MAX_SB - 1), 0);
+ 2048 * (TX_SIZES - 1), 0);
diff = (int) (pd / cpi->common.MBs);
cpi->rd_tx_select_threshes[frame_type][i] += diff;
cpi->rd_tx_select_threshes[frame_type][i] /= 2;
--- a/vp9/encoder/vp9_onyx_int.h
+++ b/vp9/encoder/vp9_onyx_int.h
@@ -77,7 +77,7 @@
// 0 = ZERO_MV, MV
signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS];
- vp9_coeff_probs_model coef_probs[TX_SIZE_MAX_SB][BLOCK_TYPES];
+ vp9_coeff_probs_model coef_probs[TX_SIZES][BLOCK_TYPES];
vp9_prob y_mode_prob[4][VP9_INTRA_MODES - 1];
vp9_prob uv_mode_prob[VP9_INTRA_MODES][VP9_INTRA_MODES - 1];
@@ -460,9 +460,9 @@
nmv_context_counts NMVcount;
- vp9_coeff_count coef_counts[TX_SIZE_MAX_SB][BLOCK_TYPES];
- vp9_coeff_probs_model frame_coef_probs[TX_SIZE_MAX_SB][BLOCK_TYPES];
- vp9_coeff_stats frame_branch_ct[TX_SIZE_MAX_SB][BLOCK_TYPES];
+ vp9_coeff_count coef_counts[TX_SIZES][BLOCK_TYPES];
+ vp9_coeff_probs_model frame_coef_probs[TX_SIZES][BLOCK_TYPES];
+ vp9_coeff_stats frame_branch_ct[TX_SIZES][BLOCK_TYPES];
int gfu_boost;
int last_boost;
@@ -622,7 +622,7 @@
unsigned int switchable_interp_count[VP9_SWITCHABLE_FILTERS + 1]
[VP9_SWITCHABLE_FILTERS];
- unsigned int txfm_stepdown_count[TX_SIZE_MAX_SB];
+ unsigned int txfm_stepdown_count[TX_SIZES];
int initial_width;
int initial_height;
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -518,7 +518,7 @@
* can skip this if the last coefficient in this transform block, e.g. the
* 16th coefficient in a 4x4 block or the 64th coefficient in a 8x8 block,
* were non-zero). */
-static const int16_t band_counts[TX_SIZE_MAX_SB][8] = {
+static const int16_t band_counts[TX_SIZES][8] = {
{ 1, 2, 3, 4, 3, 16 - 13, 0 },
{ 1, 2, 3, 4, 11, 64 - 21, 0 },
{ 1, 2, 3, 4, 11, 256 - 21, 0 },
@@ -874,7 +874,7 @@
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi;
vp9_prob skip_prob = vp9_get_pred_prob_mbskip(cm, xd);
- int64_t rd[TX_SIZE_MAX_SB][2];
+ int64_t rd[TX_SIZES][2];
int n, m;
int s0, s1;
@@ -979,11 +979,11 @@
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi;
vp9_prob skip_prob = vp9_get_pred_prob_mbskip(cm, xd);
- int64_t rd[TX_SIZE_MAX_SB][2];
+ int64_t rd[TX_SIZES][2];
int n, m;
int s0, s1;
- double scale_rd[TX_SIZE_MAX_SB] = {1.73, 1.44, 1.20, 1.00};
- // double scale_r[TX_SIZE_MAX_SB] = {2.82, 2.00, 1.41, 1.00};
+ double scale_rd[TX_SIZES] = {1.73, 1.44, 1.20, 1.00};
+ // double scale_r[TX_SIZES] = {2.82, 2.00, 1.41, 1.00};
const vp9_prob *tx_probs = get_tx_probs2(xd, &cm->fc.tx_probs);
@@ -1075,8 +1075,8 @@
int64_t txfm_cache[NB_TXFM_MODES],
int64_t ref_best_rd) {
VP9_COMMON *const cm = &cpi->common;
- int r[TX_SIZE_MAX_SB][2], s[TX_SIZE_MAX_SB];
- int64_t d[TX_SIZE_MAX_SB], sse[TX_SIZE_MAX_SB];
+ int r[TX_SIZES][2], s[TX_SIZES];
+ int64_t d[TX_SIZES], sse[TX_SIZES];
MACROBLOCKD *xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi;
@@ -1097,7 +1097,7 @@
if (cpi->sf.tx_size_search_method == USE_LARGESTINTRA_MODELINTER &&
mbmi->ref_frame[0] > INTRA_FRAME) {
- int model_used[TX_SIZE_MAX_SB] = {1, 1, 1, 1};
+ int model_used[TX_SIZES] = {1, 1, 1, 1};
if (bs >= BLOCK_SIZE_SB32X32) {
if (model_used[TX_32X32]) {
model_rd_for_sb_y_tx(cpi, bs, TX_32X32, x, xd,
@@ -3240,10 +3240,10 @@
// MB_PREDICTION_MODE best_inter_mode = ZEROMV;
MV_REFERENCE_FRAME best_inter_ref_frame = LAST_FRAME;
INTERPOLATIONFILTERTYPE tmp_best_filter = SWITCHABLE;
- int rate_uv_intra[TX_SIZE_MAX_SB], rate_uv_tokenonly[TX_SIZE_MAX_SB];
- int64_t dist_uv[TX_SIZE_MAX_SB];
- int skip_uv[TX_SIZE_MAX_SB];
- MB_PREDICTION_MODE mode_uv[TX_SIZE_MAX_SB];
+ int rate_uv_intra[TX_SIZES], rate_uv_tokenonly[TX_SIZES];
+ int64_t dist_uv[TX_SIZES];
+ int skip_uv[TX_SIZES];
+ MB_PREDICTION_MODE mode_uv[TX_SIZES];
struct scale_factors scale_factor[4];
unsigned int ref_frame_mask = 0;
unsigned int mode_mask = 0;
@@ -3284,7 +3284,7 @@
best_txfm_rd[i] = INT64_MAX;
for (i = 0; i <= VP9_SWITCHABLE_FILTERS; i++)
best_filter_rd[i] = INT64_MAX;
- for (i = 0; i < TX_SIZE_MAX_SB; i++)
+ for (i = 0; i < TX_SIZES; i++)
rate_uv_intra[i] = INT_MAX;
*returnrate = INT_MAX;
--- a/vp9/encoder/vp9_tokenize.c
+++ b/vp9/encoder/vp9_tokenize.c
@@ -25,8 +25,8 @@
compressions, then generating vp9_context.c = initial stats. */
#ifdef ENTROPY_STATS
-vp9_coeff_accum context_counters[TX_SIZE_MAX_SB][BLOCK_TYPES];
-extern vp9_coeff_stats tree_update_hist[TX_SIZE_MAX_SB][BLOCK_TYPES];
+vp9_coeff_accum context_counters[TX_SIZES][BLOCK_TYPES];
+extern vp9_coeff_stats tree_update_hist[TX_SIZES][BLOCK_TYPES];
#endif /* ENTROPY_STATS */
DECLARE_ALIGNED(16, extern const uint8_t,
--- a/vp9/encoder/vp9_tokenize.h
+++ b/vp9/encoder/vp9_tokenize.h
@@ -43,7 +43,7 @@
void init_context_counters();
void print_context_counters();
-extern vp9_coeff_accum context_counters[TX_SIZE_MAX_SB][BLOCK_TYPES];
+extern vp9_coeff_accum context_counters[TX_SIZES][BLOCK_TYPES];
#endif
extern const int *vp9_dct_value_cost_ptr;