summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vp9/common/vp9_entropy.c22
-rw-r--r--vp9/common/vp9_entropy.h8
-rw-r--r--vp9/common/vp9_filter.c18
-rw-r--r--vp9/decoder/vp9_decodframe.c2
-rw-r--r--vp9/decoder/vp9_detokenize.c18
-rw-r--r--vp9/encoder/vp9_encodemb.c16
-rw-r--r--vp9/encoder/vp9_quantize.c12
-rw-r--r--vp9/encoder/vp9_rdopt.c18
-rw-r--r--vp9/encoder/vp9_tokenize.c14
9 files changed, 63 insertions, 65 deletions
diff --git a/vp9/common/vp9_entropy.c b/vp9/common/vp9_entropy.c
index 1e5848843..27e90b66c 100644
--- a/vp9/common/vp9_entropy.c
+++ b/vp9/common/vp9_entropy.c
@@ -24,8 +24,6 @@
typedef const uchar cuchar;
typedef const uint cuint;
-typedef vp9_prob Prob;
-
#include "vp9/common/vp9_coefupdateprobs.h"
const int vp9_i8x8_block[4] = {0, 2, 8, 10};
@@ -49,7 +47,7 @@ DECLARE_ALIGNED(16, const unsigned char, vp9_norm[256]) = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
-DECLARE_ALIGNED(16, const int, vp9_coef_bands[16]) = {
+DECLARE_ALIGNED(16, const int, vp9_coef_bands_4x4[16]) = {
0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7
};
@@ -57,20 +55,20 @@ DECLARE_ALIGNED(16, cuchar, vp9_prev_token_class[MAX_ENTROPY_TOKENS]) = {
0, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 0
};
-DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d[16]) = {
+DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d_4x4[16]) = {
0, 1, 4, 8,
5, 2, 3, 6,
9, 12, 13, 10,
7, 11, 14, 15,
};
-DECLARE_ALIGNED(16, const int, vp9_col_scan[16]) = {
+DECLARE_ALIGNED(16, const int, vp9_col_scan_4x4[16]) = {
0, 4, 8, 12,
1, 5, 9, 13,
2, 6, 10, 14,
3, 7, 11, 15
};
-DECLARE_ALIGNED(16, const int, vp9_row_scan[16]) = {
+DECLARE_ALIGNED(16, const int, vp9_row_scan_4x4[16]) = {
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11,
@@ -490,12 +488,12 @@ struct vp9_token_struct vp9_coef_encodings[MAX_ENTROPY_TOKENS];
/* Trees for extra bits. Probabilities are constant and
do not depend on previously encoded bits */
-static const Prob Pcat1[] = { 159};
-static const Prob Pcat2[] = { 165, 145};
-static const Prob Pcat3[] = { 173, 148, 140};
-static const Prob Pcat4[] = { 176, 155, 140, 135};
-static const Prob Pcat5[] = { 180, 157, 141, 134, 130};
-static const Prob Pcat6[] = {
+static const vp9_prob Pcat1[] = { 159};
+static const vp9_prob Pcat2[] = { 165, 145};
+static const vp9_prob Pcat3[] = { 173, 148, 140};
+static const vp9_prob Pcat4[] = { 176, 155, 140, 135};
+static const vp9_prob Pcat5[] = { 180, 157, 141, 134, 130};
+static const vp9_prob Pcat6[] = {
254, 254, 254, 252, 249, 243, 230, 196, 177, 153, 140, 133, 130, 129
};
diff --git a/vp9/common/vp9_entropy.h b/vp9/common/vp9_entropy.h
index 4262b3030..f55ab8c93 100644
--- a/vp9/common/vp9_entropy.h
+++ b/vp9/common/vp9_entropy.h
@@ -74,7 +74,7 @@ extern vp9_extra_bit_struct vp9_extra_bits[12]; /* indexed by token value */
position within the 4x4 DCT. */
#define COEF_BANDS 8
-extern DECLARE_ALIGNED(16, const int, vp9_coef_bands[16]);
+extern DECLARE_ALIGNED(16, const int, vp9_coef_bands_4x4[16]);
extern DECLARE_ALIGNED(64, const int, vp9_coef_bands_8x8[64]);
extern DECLARE_ALIGNED(16, const int, vp9_coef_bands_16x16[256]);
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
@@ -114,10 +114,10 @@ extern DECLARE_ALIGNED(16, const unsigned char, vp9_prev_token_class[MAX_ENTROPY
struct VP9Common;
void vp9_default_coef_probs(struct VP9Common *);
-extern DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d[16]);
+extern DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d_4x4[16]);
-extern DECLARE_ALIGNED(16, const int, vp9_col_scan[16]);
-extern DECLARE_ALIGNED(16, const int, vp9_row_scan[16]);
+extern DECLARE_ALIGNED(16, const int, vp9_col_scan_4x4[16]);
+extern DECLARE_ALIGNED(16, const int, vp9_row_scan_4x4[16]);
extern DECLARE_ALIGNED(64, const int, vp9_default_zig_zag1d_8x8[64]);
extern DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d_16x16[256]);
diff --git a/vp9/common/vp9_filter.c b/vp9/common/vp9_filter.c
index 9e1f71757..54d45f5a3 100644
--- a/vp9/common/vp9_filter.c
+++ b/vp9/common/vp9_filter.c
@@ -470,9 +470,6 @@ static const unsigned int filter_size_to_wh[][2] = {
{16,16},
};
-static const unsigned int filter_max_height = 16;
-static const unsigned int filter_max_width = 16;
-
static void filter_block2d_8_c(const unsigned char *src_ptr,
const unsigned int src_stride,
const short *HFilter,
@@ -490,14 +487,15 @@ static void filter_block2d_8_c(const unsigned char *src_ptr,
const int kInterp_Extend = 4;
const unsigned int intermediate_height =
(kInterp_Extend - 1) + output_height + kInterp_Extend;
- const unsigned int max_intermediate_height =
- (kInterp_Extend - 1) + filter_max_height + kInterp_Extend;
-#ifdef _MSC_VER
- // MSVC does not support C99 style declaration
+
+ /* Size of intermediate_buffer is max_intermediate_height * filter_max_width,
+ * where max_intermediate_height = (kInterp_Extend - 1) + filter_max_height
+ * + kInterp_Extend
+ * = 3 + 16 + 4
+ * = 23
+ * and filter_max_width = 16
+ */
unsigned char intermediate_buffer[23 * 16];
-#else
- unsigned char intermediate_buffer[max_intermediate_height * filter_max_width];
-#endif
const int intermediate_next_stride = 1 - intermediate_height * output_width;
// Horizontal pass (src -> transposed intermediate).
diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c
index d72d08698..8d9f77b77 100644
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -88,7 +88,7 @@ void vp9_init_de_quantizer(VP9D_COMP *pbi) {
/* all the ac values =; */
for (i = 1; i < 16; i++) {
- int rc = vp9_default_zig_zag1d[i];
+ int rc = vp9_default_zig_zag1d_4x4[i];
pc->Y1dequant[Q][rc] = (short)vp9_ac_yquant(Q);
pc->Y2dequant[Q][rc] = (short)vp9_ac2quant(Q, pc->y2ac_delta_q);
diff --git a/vp9/decoder/vp9_detokenize.c b/vp9/decoder/vp9_detokenize.c
index 117b8649f..7211b9094 100644
--- a/vp9/decoder/vp9_detokenize.c
+++ b/vp9/decoder/vp9_detokenize.c
@@ -388,7 +388,8 @@ static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
eobs[24] = c = decode_coefs(pbi, xd, bc, a, l, PLANE_TYPE_Y2,
DCT_DCT, get_eob(xd, segment_id, 4),
xd->block[24].qcoeff,
- vp9_default_zig_zag1d, TX_8X8, vp9_coef_bands);
+ vp9_default_zig_zag1d_4x4, TX_8X8,
+ vp9_coef_bands_4x4);
eobtotal += c - 4;
type = PLANE_TYPE_Y_NO_DC;
} else {
@@ -432,7 +433,8 @@ static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
eobs[i] = c = decode_coefs(pbi, xd, bc, a, l, PLANE_TYPE_UV,
DCT_DCT, seg_eob, xd->block[i].qcoeff,
- vp9_default_zig_zag1d, TX_4X4, vp9_coef_bands);
+ vp9_default_zig_zag1d_4x4, TX_4X4,
+ vp9_coef_bands_4x4);
eobtotal += c;
}
} else {
@@ -473,7 +475,7 @@ static int decode_coefs_4x4(VP9D_COMP *dx, MACROBLOCKD *xd,
int c;
c = decode_coefs(dx, xd, bc, a, l, type, tx_type, seg_eob,
- xd->block[i].qcoeff, scan, TX_4X4, vp9_coef_bands);
+ xd->block[i].qcoeff, scan, TX_4X4, vp9_coef_bands_4x4);
eobs[i] = c;
return c;
@@ -488,13 +490,13 @@ static int decode_coefs_4x4_y(VP9D_COMP *dx, MACROBLOCKD *xd,
switch (tx_type) {
case ADST_DCT:
- scan = vp9_row_scan;
+ scan = vp9_row_scan_4x4;
break;
case DCT_ADST:
- scan = vp9_col_scan;
+ scan = vp9_col_scan_4x4;
break;
default:
- scan = vp9_default_zig_zag1d;
+ scan = vp9_default_zig_zag1d_4x4;
break;
}
@@ -519,7 +521,7 @@ static int decode_mb_tokens_4x4_uv(VP9D_COMP* const dx,
// chroma blocks
for (i = 16; i < 24; i++) {
eobtotal += decode_coefs_4x4(dx, xd, bc, PLANE_TYPE_UV, i, seg_eob,
- DCT_DCT, vp9_default_zig_zag1d);
+ DCT_DCT, vp9_default_zig_zag1d_4x4);
}
return eobtotal;
@@ -546,7 +548,7 @@ static int vp9_decode_mb_tokens_4x4(VP9D_COMP* const dx,
// 2nd order DC block
if (has_2nd_order) {
eobtotal += decode_coefs_4x4(dx, xd, bc, PLANE_TYPE_Y2, 24, seg_eob,
- DCT_DCT, vp9_default_zig_zag1d) - 16;
+ DCT_DCT, vp9_default_zig_zag1d_4x4) - 16;
type = PLANE_TYPE_Y_NO_DC;
} else {
xd->above_context->y2 = 0;
diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c
index 497509995..6b175085f 100644
--- a/vp9/encoder/vp9_encodemb.c
+++ b/vp9/encoder/vp9_encodemb.c
@@ -384,8 +384,8 @@ static void optimize_b(MACROBLOCK *mb, int i, PLANE_TYPE type,
switch (tx_size) {
default:
case TX_4X4:
- scan = vp9_default_zig_zag1d;
- bands = vp9_coef_bands;
+ scan = vp9_default_zig_zag1d_4x4;
+ bands = vp9_coef_bands_4x4;
default_eob = 16;
// TODO: this isn't called (for intra4x4 modes), but will be left in
// since it could be used later
@@ -394,19 +394,19 @@ static void optimize_b(MACROBLOCK *mb, int i, PLANE_TYPE type,
if (tx_type != DCT_DCT) {
switch (tx_type) {
case ADST_DCT:
- scan = vp9_row_scan;
+ scan = vp9_row_scan_4x4;
break;
case DCT_ADST:
- scan = vp9_col_scan;
+ scan = vp9_col_scan_4x4;
break;
default:
- scan = vp9_default_zig_zag1d;
+ scan = vp9_default_zig_zag1d_4x4;
break;
}
} else {
- scan = vp9_default_zig_zag1d;
+ scan = vp9_default_zig_zag1d_4x4;
}
}
break;
@@ -601,7 +601,7 @@ static void check_reset_2nd_coeffs(MACROBLOCKD *xd,
return;
for (i = 0; i < bd->eob; i++) {
- int coef = bd->dqcoeff[vp9_default_zig_zag1d[i]];
+ int coef = bd->dqcoeff[vp9_default_zig_zag1d_4x4[i]];
sum += (coef >= 0) ? coef : -coef;
if (sum >= SUM_2ND_COEFF_THRESH)
return;
@@ -609,7 +609,7 @@ static void check_reset_2nd_coeffs(MACROBLOCKD *xd,
if (sum < SUM_2ND_COEFF_THRESH) {
for (i = 0; i < bd->eob; i++) {
- int rc = vp9_default_zig_zag1d[i];
+ int rc = vp9_default_zig_zag1d_4x4[i];
bd->qcoeff[rc] = 0;
bd->dqcoeff[rc] = 0;
}
diff --git a/vp9/encoder/vp9_quantize.c b/vp9/encoder/vp9_quantize.c
index fcc7d2948..1f5f8f72d 100644
--- a/vp9/encoder/vp9_quantize.c
+++ b/vp9/encoder/vp9_quantize.c
@@ -40,15 +40,15 @@ void vp9_ht_quantize_b_4x4(BLOCK *b, BLOCKD *d, TX_TYPE tx_type) {
switch (tx_type) {
case ADST_DCT :
- pt_scan = vp9_row_scan;
+ pt_scan = vp9_row_scan_4x4;
break;
case DCT_ADST :
- pt_scan = vp9_col_scan;
+ pt_scan = vp9_col_scan_4x4;
break;
default :
- pt_scan = vp9_default_zig_zag1d;
+ pt_scan = vp9_default_zig_zag1d_4x4;
break;
}
@@ -106,7 +106,7 @@ void vp9_regular_quantize_b_4x4(BLOCK *b, BLOCKD *d) {
eob = -1;
for (i = 0; i < b->eob_max_offset; i++) {
- rc = vp9_default_zig_zag1d[i];
+ rc = vp9_default_zig_zag1d_4x4[i];
z = coeff_ptr[rc];
zbin = zbin_ptr[rc] + *zbin_boost_ptr + zbin_oq_value;
@@ -192,7 +192,7 @@ void vp9_regular_quantize_b_2x2(BLOCK *b, BLOCKD *d) {
eob = -1;
for (i = 0; i < b->eob_max_offset_8x8; i++) {
- rc = vp9_default_zig_zag1d[i];
+ rc = vp9_default_zig_zag1d_4x4[i];
z = coeff_ptr[rc];
zbin_boost_ptr = &b->zrun_zbin_boost[zbin_zrun_index];
@@ -606,7 +606,7 @@ void vp9_init_quantizer(VP9_COMP *cpi) {
// all the 4x4 ac values =;
for (i = 1; i < 16; i++) {
- int rc = vp9_default_zig_zag1d[i];
+ int rc = vp9_default_zig_zag1d_4x4[i];
quant_val = vp9_ac_yquant(Q);
invert_quant(cpi->Y1quant[Q] + rc,
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 9df59861e..df41bac88 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -526,15 +526,15 @@ static int cost_coeffs_2x2(MACROBLOCK *mb,
assert(eob <= 4);
for (; c < eob; c++) {
- int v = qcoeff_ptr[vp9_default_zig_zag1d[c]];
+ int v = qcoeff_ptr[vp9_default_zig_zag1d_4x4[c]];
int t = vp9_dct_value_tokens_ptr[v].Token;
- cost += mb->token_costs[TX_8X8][type][vp9_coef_bands[c]][pt][t];
+ cost += mb->token_costs[TX_8X8][type][vp9_coef_bands_4x4[c]][pt][t];
cost += vp9_dct_value_cost_ptr[v];
pt = vp9_prev_token_class[t];
}
if (c < 4)
- cost += mb->token_costs[TX_8X8][type][vp9_coef_bands[c]]
+ cost += mb->token_costs[TX_8X8][type][vp9_coef_bands_4x4[c]]
[pt] [DCT_EOB_TOKEN];
// is eob first coefficient;
pt = (c > !type);
@@ -555,8 +555,8 @@ static int cost_coeffs(MACROBLOCK *mb, BLOCKD *b, PLANE_TYPE type,
MB_MODE_INFO *mbmi = &mb->e_mbd.mode_info_context->mbmi;
TX_TYPE tx_type = DCT_DCT;
int segment_id = mbmi->segment_id;
- scan = vp9_default_zig_zag1d;
- band = vp9_coef_bands;
+ scan = vp9_default_zig_zag1d_4x4;
+ band = vp9_coef_bands_4x4;
default_eob = 16;
switch (tx_size) {
@@ -566,15 +566,15 @@ static int cost_coeffs(MACROBLOCK *mb, BLOCKD *b, PLANE_TYPE type,
if (tx_type != DCT_DCT) {
switch (tx_type) {
case ADST_DCT:
- scan = vp9_row_scan;
+ scan = vp9_row_scan_4x4;
break;
case DCT_ADST:
- scan = vp9_col_scan;
+ scan = vp9_col_scan_4x4;
break;
default:
- scan = vp9_default_zig_zag1d;
+ scan = vp9_default_zig_zag1d_4x4;
break;
}
}
@@ -1381,7 +1381,7 @@ static int64_t rd_pick_intra16x16mby_mode(VP9_COMP *cpi,
int *skippable,
int64_t txfm_cache[NB_TXFM_MODES]) {
MB_PREDICTION_MODE mode;
- TX_SIZE txfm_size;
+ TX_SIZE UNINITIALIZED_IS_SAFE(txfm_size);
MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(mode_selected);
#if CONFIG_COMP_INTRA_PRED
MB_PREDICTION_MODE mode2;
diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c
index 491914a5b..b0b5e6d5f 100644
--- a/vp9/encoder/vp9_tokenize.c
+++ b/vp9/encoder/vp9_tokenize.c
@@ -142,15 +142,15 @@ static void tokenize_b(VP9_COMP *cpi,
default:
case TX_4X4:
seg_eob = 16;
- bands = vp9_coef_bands;
- scan = vp9_default_zig_zag1d;
+ bands = vp9_coef_bands_4x4;
+ scan = vp9_default_zig_zag1d_4x4;
if (tx_type != DCT_DCT) {
counts = cpi->hybrid_coef_counts_4x4;
probs = cpi->common.fc.hybrid_coef_probs_4x4;
if (tx_type == ADST_DCT) {
- scan = vp9_row_scan;
+ scan = vp9_row_scan_4x4;
} else if (tx_type == DCT_ADST) {
- scan = vp9_col_scan;
+ scan = vp9_col_scan_4x4;
}
} else {
counts = cpi->coef_counts_4x4;
@@ -160,8 +160,8 @@ static void tokenize_b(VP9_COMP *cpi,
case TX_8X8:
if (type == PLANE_TYPE_Y2) {
seg_eob = 4;
- bands = vp9_coef_bands;
- scan = vp9_default_zig_zag1d;
+ bands = vp9_coef_bands_4x4;
+ scan = vp9_default_zig_zag1d_4x4;
} else {
#if CONFIG_CNVCONTEXT
a_ec = (a[0] + a[1]) != 0;
@@ -756,7 +756,7 @@ static __inline void stuff_b(VP9_COMP *cpi,
switch (tx_size) {
default:
case TX_4X4:
- bands = vp9_coef_bands;
+ bands = vp9_coef_bands_4x4;
if (tx_type != DCT_DCT) {
counts = cpi->hybrid_coef_counts_4x4;
probs = cpi->common.fc.hybrid_coef_probs_4x4;