From fd3658b0e4b52b5045b4881900292258ed106f39 Mon Sep 17 00:00:00 2001 From: James Zern Date: Sat, 2 May 2015 13:24:16 -0700 Subject: [PATCH] replace DECLARE_ALIGNED_ARRAY w/DECLARE_ALIGNED this macro was used inconsistently and only differs in behavior from DECLARE_ALIGNED when an alignment attribute is unavailable. this macro is used with calls to assembly, while generic c-code doesn't rely on it, so in a c-only build without an alignment attribute the code will function as expected. Change-Id: Ie9d06d4028c0de17c63b3a27e6c1b0491cc4ea79 --- test/dct16x16_test.cc | 65 ++++++------- test/dct32x32_test.cc | 38 ++++---- test/fdct4x4_test.cc | 39 ++++---- test/fdct8x8_test.cc | 58 +++++------ test/lpf_8_test.cc | 32 +++--- test/partial_idct_test.cc | 20 ++-- test/vp8_denoiser_sse2_test.cc | 10 +- test/vp9_denoiser_sse2_test.cc | 8 +- test/vp9_error_block_test.cc | 8 +- test/vp9_intrapred_test.cc | 8 +- test/vp9_quantize_test.cc | 96 +++++++++--------- vp8/common/arm/filter_arm.c | 6 +- vp8/common/arm/neon/vp8_subpixelvariance_neon.c | 34 +++---- vp8/common/x86/vp8_asm_stubs.c | 22 ++--- vp8/encoder/mcomp.c | 2 +- vp8/encoder/rdopt.c | 4 +- vp8/encoder/temporal_filter.c | 6 +- vp8/encoder/x86/quantize_sse2.c | 4 +- vp9/common/arm/neon/vp9_convolve_neon.c | 4 +- vp9/common/mips/dspr2/vp9_convolve8_avg_dspr2.c | 2 +- vp9/common/mips/dspr2/vp9_convolve8_dspr2.c | 2 +- vp9/common/vp9_convolve.c | 4 +- vp9/common/vp9_reconintra.c | 8 +- vp9/common/x86/vp9_asm_stubs.c | 8 +- vp9/common/x86/vp9_high_loopfilter_intrin_sse2.c | 24 ++--- vp9/common/x86/vp9_loopfilter_intrin_sse2.c | 34 +++---- vp9/encoder/arm/neon/vp9_variance_neon.c | 119 ++++++++++------------- vp9/encoder/vp9_encodeframe.c | 2 +- vp9/encoder/vp9_mcomp.c | 6 +- vp9/encoder/vp9_pickmode.c | 4 +- vp9/encoder/vp9_rdopt.c | 8 +- vp9/encoder/vp9_temporal_filter.c | 10 +- vp9/encoder/vp9_variance.c | 8 +- vp9/encoder/x86/vp9_dct_impl_sse2.c | 2 +- vpx_ports/mem.h | 11 --- 35 files changed, 337 insertions(+), 379 deletions(-) diff --git a/test/dct16x16_test.cc b/test/dct16x16_test.cc index 125e2b0..587b27a 100644 --- a/test/dct16x16_test.cc +++ b/test/dct16x16_test.cc @@ -356,13 +356,13 @@ class Trans16x16TestBase { int64_t total_error = 0; const int count_test_block = 10000; for (int i = 0; i < count_test_block; ++i) { - DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs); + DECLARE_ALIGNED(16, int16_t, test_input_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, test_temp_block[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs); + DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); + DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); #endif // Initialize a test block with input range [-mask_, mask_]. @@ -416,9 +416,9 @@ class Trans16x16TestBase { void RunCoeffCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 1000; - DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs); + DECLARE_ALIGNED(16, int16_t, input_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]); for (int i = 0; i < count_test_block; ++i) { // Initialize a test block with input range [-mask_, mask_]. @@ -437,15 +437,13 @@ class Trans16x16TestBase { void RunMemCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 1000; - DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs); + DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]); for (int i = 0; i < count_test_block; ++i) { // Initialize a test block with input range [-mask_, mask_]. for (int j = 0; j < kNumCoeffs; ++j) { - input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_); input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_; } if (i == 0) { @@ -472,24 +470,19 @@ class Trans16x16TestBase { void RunQuantCheck(int dc_thred, int ac_thred) { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 100000; - DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs); + DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]); - DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, ref, kNumCoeffs); + DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]); #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint16_t, ref16, kNumCoeffs); + DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); + DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]); #endif for (int i = 0; i < count_test_block; ++i) { // Initialize a test block with input range [-mask_, mask_]. for (int j = 0; j < kNumCoeffs; ++j) { - if (bit_depth_ == VPX_BITS_8) - input_block[j] = rnd.Rand8() - rnd.Rand8(); - else - input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_); input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_; } if (i == 0) @@ -539,13 +532,13 @@ class Trans16x16TestBase { void RunInvAccuracyCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 1000; - DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs); + DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs); + DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); + DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); #endif // CONFIG_VP9_HIGHBITDEPTH for (int i = 0; i < count_test_block; ++i) { @@ -599,12 +592,12 @@ class Trans16x16TestBase { const int count_test_block = 10000; const int eob = 10; const int16_t *scan = vp9_default_scan_orders[TX_16X16].scan; - DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, ref, kNumCoeffs); + DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]); #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint16_t, ref16, kNumCoeffs); + DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); + DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]); #endif // CONFIG_VP9_HIGHBITDEPTH for (int i = 0; i < count_test_block; ++i) { diff --git a/test/dct32x32_test.cc b/test/dct32x32_test.cc index 7cda809..cddfb8b 100644 --- a/test/dct32x32_test.cc +++ b/test/dct32x32_test.cc @@ -119,13 +119,13 @@ TEST_P(Trans32x32Test, AccuracyCheck) { uint32_t max_error = 0; int64_t total_error = 0; const int count_test_block = 10000; - DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs); + DECLARE_ALIGNED(16, int16_t, test_input_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, test_temp_block[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs); + DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); + DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); #endif for (int i = 0; i < count_test_block; ++i) { @@ -184,9 +184,9 @@ TEST_P(Trans32x32Test, CoeffCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 1000; - DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs); + DECLARE_ALIGNED(16, int16_t, input_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]); for (int i = 0; i < count_test_block; ++i) { for (int j = 0; j < kNumCoeffs; ++j) @@ -212,15 +212,13 @@ TEST_P(Trans32x32Test, MemCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 2000; - DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs); + DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]); for (int i = 0; i < count_test_block; ++i) { // Initialize a test block with input range [-mask_, mask_]. for (int j = 0; j < kNumCoeffs; ++j) { - input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_); input_extreme_block[j] = rnd.Rand8() & 1 ? mask_ : -mask_; } if (i == 0) { @@ -257,13 +255,13 @@ TEST_P(Trans32x32Test, MemCheck) { TEST_P(Trans32x32Test, InverseAccuracy) { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 1000; - DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs); + DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs); + DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); + DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); #endif for (int i = 0; i < count_test_block; ++i) { diff --git a/test/fdct4x4_test.cc b/test/fdct4x4_test.cc index 5357a8d..610dbd4 100644 --- a/test/fdct4x4_test.cc +++ b/test/fdct4x4_test.cc @@ -102,13 +102,13 @@ class Trans4x4TestBase { int64_t total_error = 0; const int count_test_block = 10000; for (int i = 0; i < count_test_block; ++i) { - DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs); + DECLARE_ALIGNED(16, int16_t, test_input_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, test_temp_block[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs); + DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); + DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); #endif // Initialize a test block with input range [-255, 255]. @@ -142,6 +142,7 @@ class Trans4x4TestBase { const uint32_t diff = bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j]; #else + ASSERT_EQ(VPX_BITS_8, bit_depth_); const uint32_t diff = dst[j] - src[j]; #endif const uint32_t error = diff * diff; @@ -163,9 +164,9 @@ class Trans4x4TestBase { void RunCoeffCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 5000; - DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs); + DECLARE_ALIGNED(16, int16_t, input_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]); for (int i = 0; i < count_test_block; ++i) { // Initialize a test block with input range [-mask_, mask_]. @@ -184,15 +185,13 @@ class Trans4x4TestBase { void RunMemCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 5000; - DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs); + DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]); for (int i = 0; i < count_test_block; ++i) { // Initialize a test block with input range [-mask_, mask_]. for (int j = 0; j < kNumCoeffs; ++j) { - input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_); input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_; } if (i == 0) { @@ -219,13 +218,13 @@ class Trans4x4TestBase { void RunInvAccuracyCheck(int limit) { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 1000; - DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs); + DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs); + DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); + DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); #endif for (int i = 0; i < count_test_block; ++i) { diff --git a/test/fdct8x8_test.cc b/test/fdct8x8_test.cc index 6f2c89b..795a608 100644 --- a/test/fdct8x8_test.cc +++ b/test/fdct8x8_test.cc @@ -139,8 +139,8 @@ class FwdTrans8x8TestBase { void RunSignBiasCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); - DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_output_block, 64); + DECLARE_ALIGNED(16, int16_t, test_input_block[64]); + DECLARE_ALIGNED(16, tran_low_t, test_output_block[64]); int count_sign_block[64][2]; const int count_test_block = 100000; @@ -210,13 +210,13 @@ class FwdTrans8x8TestBase { int max_error = 0; int total_error = 0; const int count_test_block = 100000; - DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, 64); - DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 64); - DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 64); + DECLARE_ALIGNED(16, int16_t, test_input_block[64]); + DECLARE_ALIGNED(16, tran_low_t, test_temp_block[64]); + DECLARE_ALIGNED(16, uint8_t, dst[64]); + DECLARE_ALIGNED(16, uint8_t, src[64]); #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, 64); - DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, 64); + DECLARE_ALIGNED(16, uint16_t, dst16[64]); + DECLARE_ALIGNED(16, uint16_t, src16[64]); #endif for (int i = 0; i < count_test_block; ++i) { @@ -287,14 +287,14 @@ class FwdTrans8x8TestBase { int total_error = 0; int total_coeff_error = 0; const int count_test_block = 100000; - DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, 64); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_temp_block, 64); - DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 64); - DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 64); + DECLARE_ALIGNED(16, int16_t, test_input_block[64]); + DECLARE_ALIGNED(16, tran_low_t, test_temp_block[64]); + DECLARE_ALIGNED(16, tran_low_t, ref_temp_block[64]); + DECLARE_ALIGNED(16, uint8_t, dst[64]); + DECLARE_ALIGNED(16, uint8_t, src[64]); #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, 64); - DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, 64); + DECLARE_ALIGNED(16, uint16_t, dst16[64]); + DECLARE_ALIGNED(16, uint16_t, src16[64]); #endif for (int i = 0; i < count_test_block; ++i) { @@ -376,13 +376,13 @@ class FwdTrans8x8TestBase { void RunInvAccuracyCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 1000; - DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs); + DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs); + DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); + DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); #endif for (int i = 0; i < count_test_block; ++i) { @@ -434,9 +434,9 @@ class FwdTrans8x8TestBase { void RunFwdAccuracyCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 1000; - DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff_r, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs); + DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, coeff_r[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); for (int i = 0; i < count_test_block; ++i) { double out_r[kNumCoeffs]; @@ -464,12 +464,12 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 10000; const int eob = 12; - DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, ref, kNumCoeffs); + DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]); #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint16_t, ref16, kNumCoeffs); + DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); + DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]); #endif const int16_t *scan = vp9_default_scan_orders[TX_8X8].scan; diff --git a/test/lpf_8_test.cc b/test/lpf_8_test.cc index d60ed74..3d21e6c 100644 --- a/test/lpf_8_test.cc +++ b/test/lpf_8_test.cc @@ -182,11 +182,11 @@ TEST_P(Loop8Test6Param, OperationCheck) { const int count_test_block = number_of_iterations; #if CONFIG_VP9_HIGHBITDEPTH int32_t bd = bit_depth_; - DECLARE_ALIGNED_ARRAY(16, uint16_t, s, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_s, kNumCoeffs); + DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); + DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); #else - DECLARE_ALIGNED_ARRAY(8, uint8_t, s, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(8, uint8_t, ref_s, kNumCoeffs); + DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]); + DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]); #endif // CONFIG_VP9_HIGHBITDEPTH int err_count_total = 0; int first_failure = -1; @@ -267,11 +267,11 @@ TEST_P(Loop8Test6Param, ValueCheck) { const int count_test_block = number_of_iterations; #if CONFIG_VP9_HIGHBITDEPTH const int32_t bd = bit_depth_; - DECLARE_ALIGNED_ARRAY(16, uint16_t, s, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_s, kNumCoeffs); + DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); + DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); #else - DECLARE_ALIGNED_ARRAY(8, uint8_t, s, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(8, uint8_t, ref_s, kNumCoeffs); + DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]); + DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]); #endif // CONFIG_VP9_HIGHBITDEPTH int err_count_total = 0; int first_failure = -1; @@ -338,11 +338,11 @@ TEST_P(Loop8Test9Param, OperationCheck) { const int count_test_block = number_of_iterations; #if CONFIG_VP9_HIGHBITDEPTH const int32_t bd = bit_depth_; - DECLARE_ALIGNED_ARRAY(16, uint16_t, s, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_s, kNumCoeffs); + DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); + DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); #else - DECLARE_ALIGNED_ARRAY(8, uint8_t, s, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(8, uint8_t, ref_s, kNumCoeffs); + DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]); + DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]); #endif // CONFIG_VP9_HIGHBITDEPTH int err_count_total = 0; int first_failure = -1; @@ -440,11 +440,11 @@ TEST_P(Loop8Test9Param, ValueCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = number_of_iterations; #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, s, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_s, kNumCoeffs); + DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); + DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); #else - DECLARE_ALIGNED_ARRAY(8, uint8_t, s, kNumCoeffs); - DECLARE_ALIGNED_ARRAY(8, uint8_t, ref_s, kNumCoeffs); + DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]); + DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]); #endif // CONFIG_VP9_HIGHBITDEPTH int err_count_total = 0; int first_failure = -1; diff --git a/test/partial_idct_test.cc b/test/partial_idct_test.cc index b259b08..87856a1 100644 --- a/test/partial_idct_test.cc +++ b/test/partial_idct_test.cc @@ -74,16 +74,16 @@ TEST_P(PartialIDctTest, RunQuantCheck) { FAIL() << "Wrong Size!"; break; } - DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_coef_block1, kMaxNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_coef_block2, kMaxNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, dst1, kMaxNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, dst2, kMaxNumCoeffs); + DECLARE_ALIGNED(16, tran_low_t, test_coef_block1[kMaxNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, test_coef_block2[kMaxNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, dst1[kMaxNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, dst2[kMaxNumCoeffs]); const int count_test_block = 1000; const int block_size = size * size; - DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kMaxNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kMaxNumCoeffs); + DECLARE_ALIGNED(16, int16_t, input_extreme_block[kMaxNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kMaxNumCoeffs]); int max_error = 0; for (int i = 0; i < count_test_block; ++i) { @@ -153,10 +153,10 @@ TEST_P(PartialIDctTest, ResultsMatch) { FAIL() << "Wrong Size!"; break; } - DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_coef_block1, kMaxNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_coef_block2, kMaxNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, dst1, kMaxNumCoeffs); - DECLARE_ALIGNED_ARRAY(16, uint8_t, dst2, kMaxNumCoeffs); + DECLARE_ALIGNED(16, tran_low_t, test_coef_block1[kMaxNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, test_coef_block2[kMaxNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, dst1[kMaxNumCoeffs]); + DECLARE_ALIGNED(16, uint8_t, dst2[kMaxNumCoeffs]); const int count_test_block = 1000; const int max_coeff = 32766 / 4; const int block_size = size * size; diff --git a/test/vp8_denoiser_sse2_test.cc b/test/vp8_denoiser_sse2_test.cc index d4abdad..e8ca8d3 100644 --- a/test/vp8_denoiser_sse2_test.cc +++ b/test/vp8_denoiser_sse2_test.cc @@ -52,13 +52,13 @@ TEST_P(VP8DenoiserTest, BitexactCheck) { // mc_avg_block is the denoised reference block, // avg_block_c is the denoised result from C code, // avg_block_sse2 is the denoised result from SSE2 code. - DECLARE_ALIGNED_ARRAY(16, uint8_t, sig_block_c, kNumPixels); + DECLARE_ALIGNED(16, uint8_t, sig_block_c[kNumPixels]); // Since in VP8 denoiser, the source signal will be changed, // we need another copy of the source signal as the input of sse2 code. - DECLARE_ALIGNED_ARRAY(16, uint8_t, sig_block_sse2, kNumPixels); - DECLARE_ALIGNED_ARRAY(16, uint8_t, mc_avg_block, kNumPixels); - DECLARE_ALIGNED_ARRAY(16, uint8_t, avg_block_c, kNumPixels); - DECLARE_ALIGNED_ARRAY(16, uint8_t, avg_block_sse2, kNumPixels); + DECLARE_ALIGNED(16, uint8_t, sig_block_sse2[kNumPixels]); + DECLARE_ALIGNED(16, uint8_t, mc_avg_block[kNumPixels]); + DECLARE_ALIGNED(16, uint8_t, avg_block_c[kNumPixels]); + DECLARE_ALIGNED(16, uint8_t, avg_block_sse2[kNumPixels]); for (int i = 0; i < count_test_block; ++i) { // Generate random motion magnitude, 20% of which exceed the threshold. diff --git a/test/vp9_denoiser_sse2_test.cc b/test/vp9_denoiser_sse2_test.cc index 0ecba07..17c799d 100644 --- a/test/vp9_denoiser_sse2_test.cc +++ b/test/vp9_denoiser_sse2_test.cc @@ -52,10 +52,10 @@ TEST_P(VP9DenoiserTest, BitexactCheck) { // mc_avg_block is the denoised reference block, // avg_block_c is the denoised result from C code, // avg_block_sse2 is the denoised result from SSE2 code. - DECLARE_ALIGNED_ARRAY(16, uint8_t, sig_block, kNumPixels); - DECLARE_ALIGNED_ARRAY(16, uint8_t, mc_avg_block, kNumPixels); - DECLARE_ALIGNED_ARRAY(16, uint8_t, avg_block_c, kNumPixels); - DECLARE_ALIGNED_ARRAY(16, uint8_t, avg_block_sse2, kNumPixels); + DECLARE_ALIGNED(16, uint8_t, sig_block[kNumPixels]); + DECLARE_ALIGNED(16, uint8_t, mc_avg_block[kNumPixels]); + DECLARE_ALIGNED(16, uint8_t, avg_block_c[kNumPixels]); + DECLARE_ALIGNED(16, uint8_t, avg_block_sse2[kNumPixels]); for (int i = 0; i < count_test_block; ++i) { // Generate random motion magnitude, 20% of which exceed the threshold. diff --git a/test/vp9_error_block_test.cc b/test/vp9_error_block_test.cc index b59d95e..d7ba1b0 100644 --- a/test/vp9_error_block_test.cc +++ b/test/vp9_error_block_test.cc @@ -57,8 +57,8 @@ class ErrorBlockTest TEST_P(ErrorBlockTest, OperationCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, 4096); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, dqcoeff, 4096); + DECLARE_ALIGNED(16, tran_low_t, coeff[4096]); + DECLARE_ALIGNED(16, tran_low_t, dqcoeff[4096]); int err_count_total = 0; int first_failure = -1; intptr_t block_size; @@ -90,8 +90,8 @@ TEST_P(ErrorBlockTest, OperationCheck) { TEST_P(ErrorBlockTest, ExtremeValues) { ACMRandom rnd(ACMRandom::DeterministicSeed()); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, 4096); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, dqcoeff, 4096); + DECLARE_ALIGNED(16, tran_low_t, coeff[4096]); + DECLARE_ALIGNED(16, tran_low_t, dqcoeff[4096]); int err_count_total = 0; int first_failure = -1; intptr_t block_size; diff --git a/test/vp9_intrapred_test.cc b/test/vp9_intrapred_test.cc index 694db1b..75d55d0 100644 --- a/test/vp9_intrapred_test.cc +++ b/test/vp9_intrapred_test.cc @@ -120,10 +120,10 @@ class VP9IntraPredTest TEST_P(VP9IntraPredTest, IntraPredTests) { // max block size is 32 - DECLARE_ALIGNED_ARRAY(16, uint16_t, left_col, 2*32); - DECLARE_ALIGNED_ARRAY(16, uint16_t, above_data, 2*32+32); - DECLARE_ALIGNED_ARRAY(16, uint16_t, dst, 3 * 32 * 32); - DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_dst, 3 * 32 * 32); + DECLARE_ALIGNED(16, uint16_t, left_col[2*32]); + DECLARE_ALIGNED(16, uint16_t, above_data[2*32+32]); + DECLARE_ALIGNED(16, uint16_t, dst[3 * 32 * 32]); + DECLARE_ALIGNED(16, uint16_t, ref_dst[3 * 32 * 32]); RunTest(left_col, above_data, dst, ref_dst); } diff --git a/test/vp9_quantize_test.cc b/test/vp9_quantize_test.cc index 862edbe..2d91046 100644 --- a/test/vp9_quantize_test.cc +++ b/test/vp9_quantize_test.cc @@ -80,18 +80,18 @@ class VP9Quantize32Test : public ::testing::TestWithParam { TEST_P(VP9QuantizeTest, OperationCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff_ptr, 256); - DECLARE_ALIGNED_ARRAY(16, int16_t, zbin_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, int16_t, round_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, int16_t, quant_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, int16_t, quant_shift_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, qcoeff_ptr, 256); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, dqcoeff_ptr, 256); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_qcoeff_ptr, 256); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_dqcoeff_ptr, 256); - DECLARE_ALIGNED_ARRAY(16, int16_t, dequant_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, uint16_t, eob_ptr, 1); - DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_eob_ptr, 1); + DECLARE_ALIGNED(16, tran_low_t, coeff_ptr[256]); + DECLARE_ALIGNED(16, int16_t, zbin_ptr[2]); + DECLARE_ALIGNED(16, int16_t, round_ptr[2]); + DECLARE_ALIGNED(16, int16_t, quant_ptr[2]); + DECLARE_ALIGNED(16, int16_t, quant_shift_ptr[2]); + DECLARE_ALIGNED(16, tran_low_t, qcoeff_ptr[256]); + DECLARE_ALIGNED(16, tran_low_t, dqcoeff_ptr[256]); + DECLARE_ALIGNED(16, tran_low_t, ref_qcoeff_ptr[256]); + DECLARE_ALIGNED(16, tran_low_t, ref_dqcoeff_ptr[256]); + DECLARE_ALIGNED(16, int16_t, dequant_ptr[2]); + DECLARE_ALIGNED(16, uint16_t, eob_ptr[1]); + DECLARE_ALIGNED(16, uint16_t, ref_eob_ptr[1]); int err_count_total = 0; int first_failure = -1; for (int i = 0; i < number_of_iterations; ++i) { @@ -139,18 +139,18 @@ TEST_P(VP9QuantizeTest, OperationCheck) { TEST_P(VP9Quantize32Test, OperationCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff_ptr, 1024); - DECLARE_ALIGNED_ARRAY(16, int16_t, zbin_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, int16_t, round_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, int16_t, quant_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, int16_t, quant_shift_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, qcoeff_ptr, 1024); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, dqcoeff_ptr, 1024); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_qcoeff_ptr, 1024); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_dqcoeff_ptr, 1024); - DECLARE_ALIGNED_ARRAY(16, int16_t, dequant_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, uint16_t, eob_ptr, 1); - DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_eob_ptr, 1); + DECLARE_ALIGNED(16, tran_low_t, coeff_ptr[1024]); + DECLARE_ALIGNED(16, int16_t, zbin_ptr[2]); + DECLARE_ALIGNED(16, int16_t, round_ptr[2]); + DECLARE_ALIGNED(16, int16_t, quant_ptr[2]); + DECLARE_ALIGNED(16, int16_t, quant_shift_ptr[2]); + DECLARE_ALIGNED(16, tran_low_t, qcoeff_ptr[1024]); + DECLARE_ALIGNED(16, tran_low_t, dqcoeff_ptr[1024]); + DECLARE_ALIGNED(16, tran_low_t, ref_qcoeff_ptr[1024]); + DECLARE_ALIGNED(16, tran_low_t, ref_dqcoeff_ptr[1024]); + DECLARE_ALIGNED(16, int16_t, dequant_ptr[2]); + DECLARE_ALIGNED(16, uint16_t, eob_ptr[1]); + DECLARE_ALIGNED(16, uint16_t, ref_eob_ptr[1]); int err_count_total = 0; int first_failure = -1; for (int i = 0; i < number_of_iterations; ++i) { @@ -198,18 +198,18 @@ TEST_P(VP9Quantize32Test, OperationCheck) { TEST_P(VP9QuantizeTest, EOBCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff_ptr, 256); - DECLARE_ALIGNED_ARRAY(16, int16_t, zbin_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, int16_t, round_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, int16_t, quant_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, int16_t, quant_shift_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, qcoeff_ptr, 256); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, dqcoeff_ptr, 256); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_qcoeff_ptr, 256); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_dqcoeff_ptr, 256); - DECLARE_ALIGNED_ARRAY(16, int16_t, dequant_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, uint16_t, eob_ptr, 1); - DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_eob_ptr, 1); + DECLARE_ALIGNED(16, tran_low_t, coeff_ptr[256]); + DECLARE_ALIGNED(16, int16_t, zbin_ptr[2]); + DECLARE_ALIGNED(16, int16_t, round_ptr[2]); + DECLARE_ALIGNED(16, int16_t, quant_ptr[2]); + DECLARE_ALIGNED(16, int16_t, quant_shift_ptr[2]); + DECLARE_ALIGNED(16, tran_low_t, qcoeff_ptr[256]); + DECLARE_ALIGNED(16, tran_low_t, dqcoeff_ptr[256]); + DECLARE_ALIGNED(16, tran_low_t, ref_qcoeff_ptr[256]); + DECLARE_ALIGNED(16, tran_low_t, ref_dqcoeff_ptr[256]); + DECLARE_ALIGNED(16, int16_t, dequant_ptr[2]); + DECLARE_ALIGNED(16, uint16_t, eob_ptr[1]); + DECLARE_ALIGNED(16, uint16_t, ref_eob_ptr[1]); int err_count_total = 0; int first_failure = -1; for (int i = 0; i < number_of_iterations; ++i) { @@ -262,18 +262,18 @@ TEST_P(VP9QuantizeTest, EOBCheck) { TEST_P(VP9Quantize32Test, EOBCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff_ptr, 1024); - DECLARE_ALIGNED_ARRAY(16, int16_t, zbin_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, int16_t, round_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, int16_t, quant_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, int16_t, quant_shift_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, qcoeff_ptr, 1024); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, dqcoeff_ptr, 1024); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_qcoeff_ptr, 1024); - DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_dqcoeff_ptr, 1024); - DECLARE_ALIGNED_ARRAY(16, int16_t, dequant_ptr, 2); - DECLARE_ALIGNED_ARRAY(16, uint16_t, eob_ptr, 1); - DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_eob_ptr, 1); + DECLARE_ALIGNED(16, tran_low_t, coeff_ptr[1024]); + DECLARE_ALIGNED(16, int16_t, zbin_ptr[2]); + DECLARE_ALIGNED(16, int16_t, round_ptr[2]); + DECLARE_ALIGNED(16, int16_t, quant_ptr[2]); + DECLARE_ALIGNED(16, int16_t, quant_shift_ptr[2]); + DECLARE_ALIGNED(16, tran_low_t, qcoeff_ptr[1024]); + DECLARE_ALIGNED(16, tran_low_t, dqcoeff_ptr[1024]); + DECLARE_ALIGNED(16, tran_low_t, ref_qcoeff_ptr[1024]); + DECLARE_ALIGNED(16, tran_low_t, ref_dqcoeff_ptr[1024]); + DECLARE_ALIGNED(16, int16_t, dequant_ptr[2]); + DECLARE_ALIGNED(16, uint16_t, eob_ptr[1]); + DECLARE_ALIGNED(16, uint16_t, ref_eob_ptr[1]); int err_count_total = 0; int first_failure = -1; for (int i = 0; i < number_of_iterations; ++i) { diff --git a/vp8/common/arm/filter_arm.c b/vp8/common/arm/filter_arm.c index 7fe3967..d6a6781 100644 --- a/vp8/common/arm/filter_arm.c +++ b/vp8/common/arm/filter_arm.c @@ -99,7 +99,7 @@ void vp8_sixtap_predict4x4_armv6 { const short *HFilter; const short *VFilter; - DECLARE_ALIGNED_ARRAY(4, short, FData, 12*4); /* Temp data buffer used in filtering */ + DECLARE_ALIGNED(4, short, FData[12*4]); /* Temp data buffer used in filtering */ HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */ @@ -147,7 +147,7 @@ void vp8_sixtap_predict8x8_armv6 { const short *HFilter; const short *VFilter; - DECLARE_ALIGNED_ARRAY(4, short, FData, 16*8); /* Temp data buffer used in filtering */ + DECLARE_ALIGNED(4, short, FData[16*8]); /* Temp data buffer used in filtering */ HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */ VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */ @@ -189,7 +189,7 @@ void vp8_sixtap_predict16x16_armv6 { const short *HFilter; const short *VFilter; - DECLARE_ALIGNED_ARRAY(4, short, FData, 24*16); /* Temp data buffer used in filtering */ + DECLARE_ALIGNED(4, short, FData[24*16]); /* Temp data buffer used in filtering */ HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */ VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */ diff --git a/vp8/common/arm/neon/vp8_subpixelvariance_neon.c b/vp8/common/arm/neon/vp8_subpixelvariance_neon.c index f2bb162..974d3b6 100644 --- a/vp8/common/arm/neon/vp8_subpixelvariance_neon.c +++ b/vp8/common/arm/neon/vp8_subpixelvariance_neon.c @@ -32,7 +32,7 @@ unsigned int vp8_sub_pixel_variance16x16_neon_func( int dst_pixels_per_line, unsigned int *sse) { int i; - DECLARE_ALIGNED_ARRAY(16, unsigned char, tmp, 528); + DECLARE_ALIGNED(16, unsigned char, tmp[528]); unsigned char *tmpp; unsigned char *tmpp2; uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8, d8u8, d9u8; @@ -911,12 +911,6 @@ unsigned int vp8_variance_halfpixvar16x16_hv_neon( return vget_lane_u32(d0u32, 0); } -enum { kWidth8 = 8 }; -enum { kHeight8 = 8 }; -enum { kHeight8PlusOne = 9 }; -enum { kPixelStepOne = 1 }; -enum { kAlign16 = 16 }; - #define FILTER_BITS 7 static INLINE int horizontal_add_s16x8(const int16x8_t v_16x8) { @@ -968,8 +962,8 @@ static unsigned int variance8x8_neon(const uint8_t *a, int a_stride, const uint8_t *b, int b_stride, unsigned int *sse) { int sum; - variance_neon_w8(a, a_stride, b, b_stride, kWidth8, kHeight8, sse, &sum); - return *sse - (((int64_t)sum * sum) / (kWidth8 * kHeight8)); + variance_neon_w8(a, a_stride, b, b_stride, 8, 8, sse, &sum); + return *sse - (((int64_t)sum * sum) / (8 * 8)); } static void var_filter_block2d_bil_w8(const uint8_t *src_ptr, @@ -1003,21 +997,21 @@ unsigned int vp8_sub_pixel_variance8x8_neon( const unsigned char *dst, int dst_stride, unsigned int *sse) { - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, temp2, kHeight8PlusOne * kWidth8); - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, fdata3, kHeight8PlusOne * kWidth8); + DECLARE_ALIGNED(16, uint8_t, temp2[9 * 8]); + DECLARE_ALIGNED(16, uint8_t, fdata3[9 * 8]); if (xoffset == 0) { - var_filter_block2d_bil_w8(src, temp2, src_stride, kWidth8, kHeight8, - kWidth8, bilinear_taps_coeff[yoffset]); + var_filter_block2d_bil_w8(src, temp2, src_stride, 8, 8, + 8, bilinear_taps_coeff[yoffset]); } else if (yoffset == 0) { - var_filter_block2d_bil_w8(src, temp2, src_stride, kPixelStepOne, - kHeight8PlusOne, kWidth8, + var_filter_block2d_bil_w8(src, temp2, src_stride, 1, + 9, 8, bilinear_taps_coeff[xoffset]); } else { - var_filter_block2d_bil_w8(src, fdata3, src_stride, kPixelStepOne, - kHeight8PlusOne, kWidth8, + var_filter_block2d_bil_w8(src, fdata3, src_stride, 1, + 9, 8, bilinear_taps_coeff[xoffset]); - var_filter_block2d_bil_w8(fdata3, temp2, kWidth8, kWidth8, kHeight8, - kWidth8, bilinear_taps_coeff[yoffset]); + var_filter_block2d_bil_w8(fdata3, temp2, 8, 8, 8, + 8, bilinear_taps_coeff[yoffset]); } - return variance8x8_neon(temp2, kWidth8, dst, dst_stride, sse); + return variance8x8_neon(temp2, 8, dst, dst_stride, sse); } diff --git a/vp8/common/x86/vp8_asm_stubs.c b/vp8/common/x86/vp8_asm_stubs.c index b409293..fb0b57e 100644 --- a/vp8/common/x86/vp8_asm_stubs.c +++ b/vp8/common/x86/vp8_asm_stubs.c @@ -127,7 +127,7 @@ void vp8_sixtap_predict4x4_mmx int dst_pitch ) { - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 16*16); /* Temp data bufffer used in filtering */ + DECLARE_ALIGNED(16, unsigned short, FData2[16*16]); /* Temp data bufffer used in filtering */ const short *HFilter, *VFilter; HFilter = vp8_six_tap_mmx[xoffset]; vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 9, 8, HFilter); @@ -148,7 +148,7 @@ void vp8_sixtap_predict16x16_mmx ) { - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 24*24); /* Temp data bufffer used in filtering */ + DECLARE_ALIGNED(16, unsigned short, FData2[24*24]); /* Temp data bufffer used in filtering */ const short *HFilter, *VFilter; @@ -180,7 +180,7 @@ void vp8_sixtap_predict8x8_mmx ) { - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256); /* Temp data bufffer used in filtering */ + DECLARE_ALIGNED(16, unsigned short, FData2[256]); /* Temp data bufffer used in filtering */ const short *HFilter, *VFilter; @@ -206,7 +206,7 @@ void vp8_sixtap_predict8x4_mmx ) { - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256); /* Temp data bufffer used in filtering */ + DECLARE_ALIGNED(16, unsigned short, FData2[256]); /* Temp data bufffer used in filtering */ const short *HFilter, *VFilter; @@ -252,7 +252,7 @@ void vp8_sixtap_predict16x16_sse2 ) { - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 24*24); /* Temp data bufffer used in filtering */ + DECLARE_ALIGNED(16, unsigned short, FData2[24*24]); /* Temp data bufffer used in filtering */ const short *HFilter, *VFilter; @@ -292,7 +292,7 @@ void vp8_sixtap_predict8x8_sse2 int dst_pitch ) { - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256); /* Temp data bufffer used in filtering */ + DECLARE_ALIGNED(16, unsigned short, FData2[256]); /* Temp data bufffer used in filtering */ const short *HFilter, *VFilter; if (xoffset) @@ -330,7 +330,7 @@ void vp8_sixtap_predict8x4_sse2 int dst_pitch ) { - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256); /* Temp data bufffer used in filtering */ + DECLARE_ALIGNED(16, unsigned short, FData2[256]); /* Temp data bufffer used in filtering */ const short *HFilter, *VFilter; if (xoffset) @@ -432,7 +432,7 @@ void vp8_sixtap_predict16x16_ssse3 ) { - DECLARE_ALIGNED_ARRAY(16, unsigned char, FData2, 24*24); + DECLARE_ALIGNED(16, unsigned char, FData2[24*24]); if (xoffset) { @@ -480,7 +480,7 @@ void vp8_sixtap_predict8x8_ssse3 int dst_pitch ) { - DECLARE_ALIGNED_ARRAY(16, unsigned char, FData2, 256); + DECLARE_ALIGNED(16, unsigned char, FData2[256]); if (xoffset) { @@ -528,7 +528,7 @@ void vp8_sixtap_predict8x4_ssse3 int dst_pitch ) { - DECLARE_ALIGNED_ARRAY(16, unsigned char, FData2, 256); + DECLARE_ALIGNED(16, unsigned char, FData2[256]); if (xoffset) { @@ -576,7 +576,7 @@ void vp8_sixtap_predict4x4_ssse3 int dst_pitch ) { - DECLARE_ALIGNED_ARRAY(16, unsigned char, FData2, 4*9); + DECLARE_ALIGNED(16, unsigned char, FData2[4*9]); if (xoffset) { diff --git a/vp8/encoder/mcomp.c b/vp8/encoder/mcomp.c index 06f7f46..f848e8f 100644 --- a/vp8/encoder/mcomp.c +++ b/vp8/encoder/mcomp.c @@ -1591,7 +1591,7 @@ int vp8_full_search_sadx8(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv, int col_max = ref_col + distance; // TODO(johannkoenig): check if this alignment is necessary. - DECLARE_ALIGNED_ARRAY(16, unsigned int, sad_array8, 8); + DECLARE_ALIGNED(16, unsigned int, sad_array8[8]); unsigned int sad_array[3]; int *mvsadcost[2]; diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index 4f90402..9ccd85e 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -650,8 +650,8 @@ static int rd_pick_intra4x4block( * a temp buffer that meets the stride requirements, but we are only * interested in the left 4x4 block * */ - DECLARE_ALIGNED_ARRAY(16, unsigned char, best_predictor, 16*4); - DECLARE_ALIGNED_ARRAY(16, short, best_dqcoeff, 16); + DECLARE_ALIGNED(16, unsigned char, best_predictor[16*4]); + DECLARE_ALIGNED(16, short, best_dqcoeff[16]); int dst_stride = x->e_mbd.dst.y_stride; unsigned char *dst = x->e_mbd.dst.y_buffer + b->offset; diff --git a/vp8/encoder/temporal_filter.c b/vp8/encoder/temporal_filter.c index 0fa0d8d..ba8b009 100644 --- a/vp8/encoder/temporal_filter.c +++ b/vp8/encoder/temporal_filter.c @@ -238,12 +238,12 @@ static void vp8_temporal_filter_iterate_c int mb_rows = cpi->common.mb_rows; int mb_y_offset = 0; int mb_uv_offset = 0; - DECLARE_ALIGNED_ARRAY(16, unsigned int, accumulator, 16*16 + 8*8 + 8*8); - DECLARE_ALIGNED_ARRAY(16, unsigned short, count, 16*16 + 8*8 + 8*8); + DECLARE_ALIGNED(16, unsigned int, accumulator[16*16 + 8*8 + 8*8]); + DECLARE_ALIGNED(16, unsigned short, count[16*16 + 8*8 + 8*8]); MACROBLOCKD *mbd = &cpi->mb.e_mbd; YV12_BUFFER_CONFIG *f = cpi->frames[alt_ref_index]; unsigned char *dst1, *dst2; - DECLARE_ALIGNED_ARRAY(16, unsigned char, predictor, 16*16 + 8*8 + 8*8); + DECLARE_ALIGNED(16, unsigned char, predictor[16*16 + 8*8 + 8*8]); /* Save input state */ unsigned char *y_buffer = mbd->pre.y_buffer; diff --git a/vp8/encoder/x86/quantize_sse2.c b/vp8/encoder/x86/quantize_sse2.c index 7dfb013..b4e92e0 100644 --- a/vp8/encoder/x86/quantize_sse2.c +++ b/vp8/encoder/x86/quantize_sse2.c @@ -37,8 +37,8 @@ void vp8_regular_quantize_b_sse2(BLOCK *b, BLOCKD *d) char eob = 0; short *zbin_boost_ptr; short *qcoeff_ptr = d->qcoeff; - DECLARE_ALIGNED_ARRAY(16, short, x, 16); - DECLARE_ALIGNED_ARRAY(16, short, y, 16); + DECLARE_ALIGNED(16, short, x[16]); + DECLARE_ALIGNED(16, short, y[16]); __m128i sz0, x0, sz1, x1, y0, y1, x_minus_zbin0, x_minus_zbin1; __m128i quant_shift0 = _mm_load_si128((__m128i *)(b->quant_shift)); diff --git a/vp9/common/arm/neon/vp9_convolve_neon.c b/vp9/common/arm/neon/vp9_convolve_neon.c index f0881b5..2e28cb2 100644 --- a/vp9/common/arm/neon/vp9_convolve_neon.c +++ b/vp9/common/arm/neon/vp9_convolve_neon.c @@ -20,7 +20,7 @@ void vp9_convolve8_neon(const uint8_t *src, ptrdiff_t src_stride, /* Given our constraints: w <= 64, h <= 64, taps == 8 we can reduce the * maximum buffer size to 64 * 64 + 7 (+ 1 to make it divisible by 4). */ - DECLARE_ALIGNED_ARRAY(8, uint8_t, temp, 64 * 72); + DECLARE_ALIGNED(8, uint8_t, temp[64 * 72]); // Account for the vertical phase needing 3 lines prior and 4 lines post int intermediate_height = h + 7; @@ -56,7 +56,7 @@ void vp9_convolve8_avg_neon(const uint8_t *src, ptrdiff_t src_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h) { - DECLARE_ALIGNED_ARRAY(8, uint8_t, temp, 64 * 72); + DECLARE_ALIGNED(8, uint8_t, temp[64 * 72]); int intermediate_height = h + 7; if (x_step_q4 != 16 || y_step_q4 != 16) { diff --git a/vp9/common/mips/dspr2/vp9_convolve8_avg_dspr2.c b/vp9/common/mips/dspr2/vp9_convolve8_avg_dspr2.c index ab18490..1742279 100644 --- a/vp9/common/mips/dspr2/vp9_convolve8_avg_dspr2.c +++ b/vp9/common/mips/dspr2/vp9_convolve8_avg_dspr2.c @@ -413,7 +413,7 @@ void vp9_convolve8_avg_dspr2(const uint8_t *src, ptrdiff_t src_stride, const int16_t *filter_y, int y_step_q4, int w, int h) { /* Fixed size intermediate buffer places limits on parameters. */ - DECLARE_ALIGNED_ARRAY(32, uint8_t, temp, 64 * 135); + DECLARE_ALIGNED(32, uint8_t, temp[64 * 135]); int32_t intermediate_height = ((h * y_step_q4) >> 4) + 7; assert(w <= 64); diff --git a/vp9/common/mips/dspr2/vp9_convolve8_dspr2.c b/vp9/common/mips/dspr2/vp9_convolve8_dspr2.c index 0ef9dd5..58b50d2 100644 --- a/vp9/common/mips/dspr2/vp9_convolve8_dspr2.c +++ b/vp9/common/mips/dspr2/vp9_convolve8_dspr2.c @@ -950,7 +950,7 @@ void vp9_convolve8_dspr2(const uint8_t *src, ptrdiff_t src_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h) { - DECLARE_ALIGNED_ARRAY(32, uint8_t, temp, 64 * 135); + DECLARE_ALIGNED(32, uint8_t, temp[64 * 135]); int32_t intermediate_height = ((h * y_step_q4) >> 4) + 7; uint32_t pos = 38; diff --git a/vp9/common/vp9_convolve.c b/vp9/common/vp9_convolve.c index 5fb56ec..90e337f 100644 --- a/vp9/common/vp9_convolve.c +++ b/vp9/common/vp9_convolve.c @@ -236,7 +236,7 @@ void vp9_convolve8_avg_c(const uint8_t *src, ptrdiff_t src_stride, const int16_t *filter_y, int y_step_q4, int w, int h) { /* Fixed size intermediate buffer places limits on parameters. */ - DECLARE_ALIGNED_ARRAY(16, uint8_t, temp, 64 * 64); + DECLARE_ALIGNED(16, uint8_t, temp[64 * 64]); assert(w <= 64); assert(h <= 64); @@ -501,7 +501,7 @@ void vp9_highbd_convolve8_avg_c(const uint8_t *src, ptrdiff_t src_stride, const int16_t *filter_y, int y_step_q4, int w, int h, int bd) { // Fixed size intermediate buffer places limits on parameters. - DECLARE_ALIGNED_ARRAY(16, uint16_t, temp, 64 * 64); + DECLARE_ALIGNED(16, uint16_t, temp[64 * 64]); assert(w <= 64); assert(h <= 64); diff --git a/vp9/common/vp9_reconintra.c b/vp9/common/vp9_reconintra.c index 709a782..11dd3f3 100644 --- a/vp9/common/vp9_reconintra.c +++ b/vp9/common/vp9_reconintra.c @@ -657,8 +657,8 @@ static void build_intra_predictors_high(const MACROBLOCKD *xd, int i; uint16_t *dst = CONVERT_TO_SHORTPTR(dst8); uint16_t *ref = CONVERT_TO_SHORTPTR(ref8); - DECLARE_ALIGNED_ARRAY(16, uint16_t, left_col, 64); - DECLARE_ALIGNED_ARRAY(16, uint16_t, above_data, 128 + 16); + DECLARE_ALIGNED(16, uint16_t, left_col[64]); + DECLARE_ALIGNED(16, uint16_t, above_data[128 + 16]); uint16_t *above_row = above_data + 16; const uint16_t *const_above_row = above_row; const int bs = 4 << tx_size; @@ -780,8 +780,8 @@ static void build_intra_predictors(const MACROBLOCKD *xd, const uint8_t *ref, int right_available, int x, int y, int plane) { int i; - DECLARE_ALIGNED_ARRAY(16, uint8_t, left_col, 64); - DECLARE_ALIGNED_ARRAY(16, uint8_t, above_data, 128 + 16); + DECLARE_ALIGNED(16, uint8_t, left_col[64]); + DECLARE_ALIGNED(16, uint8_t, above_data[128 + 16]); uint8_t *above_row = above_data + 16; const uint8_t *const_above_row = above_row; const int bs = 4 << tx_size; diff --git a/vp9/common/x86/vp9_asm_stubs.c b/vp9/common/x86/vp9_asm_stubs.c index a0a5996..963023c 100644 --- a/vp9/common/x86/vp9_asm_stubs.c +++ b/vp9/common/x86/vp9_asm_stubs.c @@ -118,7 +118,7 @@ void vp9_convolve8_##avg##opt(const uint8_t *src, ptrdiff_t src_stride, \ if (x_step_q4 == 16 && y_step_q4 == 16) { \ if (filter_x[0] || filter_x[1] || filter_x[2] || filter_x[3] == 128 || \ filter_y[0] || filter_y[1] || filter_y[2] || filter_y[3] == 128) { \ - DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 64 * 71); \ + DECLARE_ALIGNED(16, unsigned char, fdata2[64 * 71]); \ vp9_convolve8_horiz_##opt(src - 3 * src_stride, src_stride, fdata2, 64, \ filter_x, x_step_q4, filter_y, y_step_q4, \ w, h + 7); \ @@ -126,7 +126,7 @@ void vp9_convolve8_##avg##opt(const uint8_t *src, ptrdiff_t src_stride, \ filter_x, x_step_q4, filter_y, \ y_step_q4, w, h); \ } else { \ - DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 64 * 65); \ + DECLARE_ALIGNED(16, unsigned char, fdata2[64 * 65]); \ vp9_convolve8_horiz_##opt(src, src_stride, fdata2, 64, \ filter_x, x_step_q4, filter_y, y_step_q4, \ w, h + 1); \ @@ -259,7 +259,7 @@ void vp9_highbd_convolve8_##avg##opt(const uint8_t *src, ptrdiff_t src_stride, \ if (x_step_q4 == 16 && y_step_q4 == 16) { \ if (filter_x[0] || filter_x[1] || filter_x[2] || filter_x[3] == 128 || \ filter_y[0] || filter_y[1] || filter_y[2] || filter_y[3] == 128) { \ - DECLARE_ALIGNED_ARRAY(16, uint16_t, fdata2, 64 * 71); \ + DECLARE_ALIGNED(16, uint16_t, fdata2[64 * 71]); \ vp9_highbd_convolve8_horiz_##opt(src - 3 * src_stride, src_stride, \ CONVERT_TO_BYTEPTR(fdata2), 64, \ filter_x, x_step_q4, \ @@ -271,7 +271,7 @@ void vp9_highbd_convolve8_##avg##opt(const uint8_t *src, ptrdiff_t src_stride, \ filter_y, y_step_q4, \ w, h, bd); \ } else { \ - DECLARE_ALIGNED_ARRAY(16, uint16_t, fdata2, 64 * 65); \ + DECLARE_ALIGNED(16, uint16_t, fdata2[64 * 65]); \ vp9_highbd_convolve8_horiz_##opt(src, src_stride, \ CONVERT_TO_BYTEPTR(fdata2), 64, \ filter_x, x_step_q4, \ diff --git a/vp9/common/x86/vp9_high_loopfilter_intrin_sse2.c b/vp9/common/x86/vp9_high_loopfilter_intrin_sse2.c index 4bd8ac4..1637f0e 100644 --- a/vp9/common/x86/vp9_high_loopfilter_intrin_sse2.c +++ b/vp9/common/x86/vp9_high_loopfilter_intrin_sse2.c @@ -524,12 +524,12 @@ void vp9_highbd_lpf_horizontal_8_sse2(uint16_t *s, int p, const uint8_t *_limit, const uint8_t *_thresh, int count, int bd) { - DECLARE_ALIGNED_ARRAY(16, uint16_t, flat_op2, 16); - DECLARE_ALIGNED_ARRAY(16, uint16_t, flat_op1, 16); - DECLARE_ALIGNED_ARRAY(16, uint16_t, flat_op0, 16); - DECLARE_ALIGNED_ARRAY(16, uint16_t, flat_oq2, 16); - DECLARE_ALIGNED_ARRAY(16, uint16_t, flat_oq1, 16); - DECLARE_ALIGNED_ARRAY(16, uint16_t, flat_oq0, 16); + DECLARE_ALIGNED(16, uint16_t, flat_op2[16]); + DECLARE_ALIGNED(16, uint16_t, flat_op1[16]); + DECLARE_ALIGNED(16, uint16_t, flat_op0[16]); + DECLARE_ALIGNED(16, uint16_t, flat_oq2[16]); + DECLARE_ALIGNED(16, uint16_t, flat_oq1[16]); + DECLARE_ALIGNED(16, uint16_t, flat_oq0[16]); const __m128i zero = _mm_set1_epi16(0); __m128i blimit, limit, thresh; __m128i mask, hev, flat; @@ -1059,7 +1059,7 @@ void vp9_highbd_lpf_vertical_4_sse2(uint16_t *s, int p, const uint8_t *limit, const uint8_t *thresh, int count, int bd) { - DECLARE_ALIGNED_ARRAY(16, uint16_t, t_dst, 8 * 8); + DECLARE_ALIGNED(16, uint16_t, t_dst[8 * 8]); uint16_t *src[1]; uint16_t *dst[1]; (void)count; @@ -1089,7 +1089,7 @@ void vp9_highbd_lpf_vertical_4_dual_sse2(uint16_t *s, int p, const uint8_t *limit1, const uint8_t *thresh1, int bd) { - DECLARE_ALIGNED_ARRAY(16, uint16_t, t_dst, 16 * 8); + DECLARE_ALIGNED(16, uint16_t, t_dst[16 * 8]); uint16_t *src[2]; uint16_t *dst[2]; @@ -1113,7 +1113,7 @@ void vp9_highbd_lpf_vertical_8_sse2(uint16_t *s, int p, const uint8_t *limit, const uint8_t *thresh, int count, int bd) { - DECLARE_ALIGNED_ARRAY(16, uint16_t, t_dst, 8 * 8); + DECLARE_ALIGNED(16, uint16_t, t_dst[8 * 8]); uint16_t *src[1]; uint16_t *dst[1]; (void)count; @@ -1143,7 +1143,7 @@ void vp9_highbd_lpf_vertical_8_dual_sse2(uint16_t *s, int p, const uint8_t *limit1, const uint8_t *thresh1, int bd) { - DECLARE_ALIGNED_ARRAY(16, uint16_t, t_dst, 16 * 8); + DECLARE_ALIGNED(16, uint16_t, t_dst[16 * 8]); uint16_t *src[2]; uint16_t *dst[2]; @@ -1168,7 +1168,7 @@ void vp9_highbd_lpf_vertical_16_sse2(uint16_t *s, int p, const uint8_t *limit, const uint8_t *thresh, int bd) { - DECLARE_ALIGNED_ARRAY(16, uint16_t, t_dst, 8 * 16); + DECLARE_ALIGNED(16, uint16_t, t_dst[8 * 16]); uint16_t *src[2]; uint16_t *dst[2]; @@ -1198,7 +1198,7 @@ void vp9_highbd_lpf_vertical_16_dual_sse2(uint16_t *s, const uint8_t *limit, const uint8_t *thresh, int bd) { - DECLARE_ALIGNED_ARRAY(16, uint16_t, t_dst, 256); + DECLARE_ALIGNED(16, uint16_t, t_dst[256]); // Transpose 16x16 highbd_transpose8x16(s - 8, s - 8 + 8 * p, p, t_dst, 16); diff --git a/vp9/common/x86/vp9_loopfilter_intrin_sse2.c b/vp9/common/x86/vp9_loopfilter_intrin_sse2.c index 320328e..8723d32 100644 --- a/vp9/common/x86/vp9_loopfilter_intrin_sse2.c +++ b/vp9/common/x86/vp9_loopfilter_intrin_sse2.c @@ -729,12 +729,12 @@ void vp9_lpf_horizontal_8_sse2(unsigned char *s, int p, const unsigned char *_blimit, const unsigned char *_limit, const unsigned char *_thresh, int count) { - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op2, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op1, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op0, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq2, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq1, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq0, 16); + DECLARE_ALIGNED(16, unsigned char, flat_op2[16]); + DECLARE_ALIGNED(16, unsigned char, flat_op1[16]); + DECLARE_ALIGNED(16, unsigned char, flat_op0[16]); + DECLARE_ALIGNED(16, unsigned char, flat_oq2[16]); + DECLARE_ALIGNED(16, unsigned char, flat_oq1[16]); + DECLARE_ALIGNED(16, unsigned char, flat_oq0[16]); const __m128i zero = _mm_set1_epi16(0); const __m128i blimit = _mm_load_si128((const __m128i *)_blimit); const __m128i limit = _mm_load_si128((const __m128i *)_limit); @@ -948,12 +948,12 @@ void vp9_lpf_horizontal_8_dual_sse2(uint8_t *s, int p, const uint8_t *_blimit1, const uint8_t *_limit1, const uint8_t *_thresh1) { - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op2, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op1, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op0, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq2, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq1, 16); - DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq0, 16); + DECLARE_ALIGNED(16, unsigned char, flat_op2[16]); + DECLARE_ALIGNED(16, unsigned char, flat_op1[16]); + DECLARE_ALIGNED(16, unsigned char, flat_op0[16]); + DECLARE_ALIGNED(16, unsigned char, flat_oq2[16]); + DECLARE_ALIGNED(16, unsigned char, flat_oq1[16]); + DECLARE_ALIGNED(16, unsigned char, flat_oq0[16]); const __m128i zero = _mm_set1_epi16(0); const __m128i blimit = _mm_unpacklo_epi64(_mm_load_si128((const __m128i *)_blimit0), @@ -1461,7 +1461,7 @@ void vp9_lpf_vertical_4_dual_sse2(uint8_t *s, int p, const uint8_t *blimit0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1) { - DECLARE_ALIGNED_ARRAY(16, unsigned char, t_dst, 16 * 8); + DECLARE_ALIGNED(16, unsigned char, t_dst[16 * 8]); unsigned char *src[2]; unsigned char *dst[2]; @@ -1484,7 +1484,7 @@ void vp9_lpf_vertical_8_sse2(unsigned char *s, int p, const unsigned char *blimit, const unsigned char *limit, const unsigned char *thresh, int count) { - DECLARE_ALIGNED_ARRAY(8, unsigned char, t_dst, 8 * 8); + DECLARE_ALIGNED(8, unsigned char, t_dst[8 * 8]); unsigned char *src[1]; unsigned char *dst[1]; (void)count; @@ -1511,7 +1511,7 @@ void vp9_lpf_vertical_8_dual_sse2(uint8_t *s, int p, const uint8_t *blimit0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1) { - DECLARE_ALIGNED_ARRAY(16, unsigned char, t_dst, 16 * 8); + DECLARE_ALIGNED(16, unsigned char, t_dst[16 * 8]); unsigned char *src[2]; unsigned char *dst[2]; @@ -1535,7 +1535,7 @@ void vp9_lpf_vertical_16_sse2(unsigned char *s, int p, const unsigned char *blimit, const unsigned char *limit, const unsigned char *thresh) { - DECLARE_ALIGNED_ARRAY(8, unsigned char, t_dst, 8 * 16); + DECLARE_ALIGNED(8, unsigned char, t_dst[8 * 16]); unsigned char *src[2]; unsigned char *dst[2]; @@ -1562,7 +1562,7 @@ void vp9_lpf_vertical_16_sse2(unsigned char *s, int p, void vp9_lpf_vertical_16_dual_sse2(unsigned char *s, int p, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh) { - DECLARE_ALIGNED_ARRAY(16, unsigned char, t_dst, 256); + DECLARE_ALIGNED(16, unsigned char, t_dst[256]); // Transpose 16x16 transpose8x16(s - 8, s - 8 + 8 * p, p, t_dst, 16); diff --git a/vp9/encoder/arm/neon/vp9_variance_neon.c b/vp9/encoder/arm/neon/vp9_variance_neon.c index b1ad837..cf82dd7 100644 --- a/vp9/encoder/arm/neon/vp9_variance_neon.c +++ b/vp9/encoder/arm/neon/vp9_variance_neon.c @@ -20,21 +20,6 @@ #include "vp9/encoder/vp9_variance.h" -enum { kWidth8 = 8 }; -enum { kHeight8 = 8 }; -enum { kHeight8PlusOne = 9 }; -enum { kWidth16 = 16 }; -enum { kHeight16 = 16 }; -enum { kHeight16PlusOne = 17 }; -enum { kWidth32 = 32 }; -enum { kHeight32 = 32 }; -enum { kHeight32PlusOne = 33 }; -enum { kWidth64 = 64 }; -enum { kHeight64 = 64 }; -enum { kHeight64PlusOne = 65 }; -enum { kPixelStepOne = 1 }; -enum { kAlign16 = 16 }; - static INLINE int horizontal_add_s16x8(const int16x8_t v_16x8) { const int32x4_t a = vpaddlq_s16(v_16x8); const int64x2_t b = vpaddlq_s32(a); @@ -84,30 +69,30 @@ static void variance_neon_w8(const uint8_t *a, int a_stride, void vp9_get8x8var_neon(const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, int *sum) { - variance_neon_w8(src_ptr, source_stride, ref_ptr, ref_stride, kWidth8, - kHeight8, sse, sum); + variance_neon_w8(src_ptr, source_stride, ref_ptr, ref_stride, 8, + 8, sse, sum); } unsigned int vp9_variance8x8_neon(const uint8_t *a, int a_stride, const uint8_t *b, int b_stride, unsigned int *sse) { int sum; - variance_neon_w8(a, a_stride, b, b_stride, kWidth8, kHeight8, sse, &sum); + variance_neon_w8(a, a_stride, b, b_stride, 8, 8, sse, &sum); return *sse - (((int64_t)sum * sum) >> 6); // >> 6 = / 8 * 8 } void vp9_get16x16var_neon(const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, int *sum) { - variance_neon_w8(src_ptr, source_stride, ref_ptr, ref_stride, kWidth16, - kHeight16, sse, sum); + variance_neon_w8(src_ptr, source_stride, ref_ptr, ref_stride, 16, + 16, sse, sum); } unsigned int vp9_variance16x16_neon(const uint8_t *a, int a_stride, const uint8_t *b, int b_stride, unsigned int *sse) { int sum; - variance_neon_w8(a, a_stride, b, b_stride, kWidth16, kHeight16, sse, &sum); + variance_neon_w8(a, a_stride, b, b_stride, 16, 16, sse, &sum); return *sse - (((int64_t)sum * sum) >> 8); // >> 8 = / 16 * 16 } @@ -169,15 +154,15 @@ unsigned int vp9_sub_pixel_variance8x8_neon(const uint8_t *src, const uint8_t *dst, int dst_stride, unsigned int *sse) { - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, temp2, kHeight8 * kWidth8); - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, fdata3, kHeight8PlusOne * kWidth8); + DECLARE_ALIGNED(16, uint8_t, temp2[8 * 8]); + DECLARE_ALIGNED(16, uint8_t, fdata3[9 * 8]); - var_filter_block2d_bil_w8(src, fdata3, src_stride, kPixelStepOne, - kHeight8PlusOne, kWidth8, + var_filter_block2d_bil_w8(src, fdata3, src_stride, 1, + 9, 8, BILINEAR_FILTERS_2TAP(xoffset)); - var_filter_block2d_bil_w8(fdata3, temp2, kWidth8, kWidth8, kHeight8, - kWidth8, BILINEAR_FILTERS_2TAP(yoffset)); - return vp9_variance8x8_neon(temp2, kWidth8, dst, dst_stride, sse); + var_filter_block2d_bil_w8(fdata3, temp2, 8, 8, 8, + 8, BILINEAR_FILTERS_2TAP(yoffset)); + return vp9_variance8x8_neon(temp2, 8, dst, dst_stride, sse); } unsigned int vp9_sub_pixel_variance16x16_neon(const uint8_t *src, @@ -187,29 +172,29 @@ unsigned int vp9_sub_pixel_variance16x16_neon(const uint8_t *src, const uint8_t *dst, int dst_stride, unsigned int *sse) { - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, temp2, kHeight16 * kWidth16); - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, fdata3, kHeight16PlusOne * kWidth16); + DECLARE_ALIGNED(16, uint8_t, temp2[16 * 16]); + DECLARE_ALIGNED(16, uint8_t, fdata3[17 * 16]); - var_filter_block2d_bil_w16(src, fdata3, src_stride, kPixelStepOne, - kHeight16PlusOne, kWidth16, + var_filter_block2d_bil_w16(src, fdata3, src_stride, 1, + 17, 16, BILINEAR_FILTERS_2TAP(xoffset)); - var_filter_block2d_bil_w16(fdata3, temp2, kWidth16, kWidth16, kHeight16, - kWidth16, BILINEAR_FILTERS_2TAP(yoffset)); - return vp9_variance16x16_neon(temp2, kWidth16, dst, dst_stride, sse); + var_filter_block2d_bil_w16(fdata3, temp2, 16, 16, 16, + 16, BILINEAR_FILTERS_2TAP(yoffset)); + return vp9_variance16x16_neon(temp2, 16, dst, dst_stride, sse); } void vp9_get32x32var_neon(const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, int *sum) { - variance_neon_w8(src_ptr, source_stride, ref_ptr, ref_stride, kWidth32, - kHeight32, sse, sum); + variance_neon_w8(src_ptr, source_stride, ref_ptr, ref_stride, 32, + 32, sse, sum); } unsigned int vp9_variance32x32_neon(const uint8_t *a, int a_stride, const uint8_t *b, int b_stride, unsigned int *sse) { int sum; - variance_neon_w8(a, a_stride, b, b_stride, kWidth32, kHeight32, sse, &sum); + variance_neon_w8(a, a_stride, b, b_stride, 32, 32, sse, &sum); return *sse - (((int64_t)sum * sum) >> 10); // >> 10 = / 32 * 32 } @@ -218,9 +203,9 @@ unsigned int vp9_variance32x64_neon(const uint8_t *a, int a_stride, unsigned int *sse) { int sum1, sum2; uint32_t sse1, sse2; - variance_neon_w8(a, a_stride, b, b_stride, kWidth32, kHeight32, &sse1, &sum1); - variance_neon_w8(a + (kHeight32 * a_stride), a_stride, - b + (kHeight32 * b_stride), b_stride, kWidth32, kHeight32, + variance_neon_w8(a, a_stride, b, b_stride, 32, 32, &sse1, &sum1); + variance_neon_w8(a + (32 * a_stride), a_stride, + b + (32 * b_stride), b_stride, 32, 32, &sse2, &sum2); *sse = sse1 + sse2; sum1 += sum2; @@ -232,9 +217,9 @@ unsigned int vp9_variance64x32_neon(const uint8_t *a, int a_stride, unsigned int *sse) { int sum1, sum2; uint32_t sse1, sse2; - variance_neon_w8(a, a_stride, b, b_stride, kWidth64, kHeight16, &sse1, &sum1); - variance_neon_w8(a + (kHeight16 * a_stride), a_stride, - b + (kHeight16 * b_stride), b_stride, kWidth64, kHeight16, + variance_neon_w8(a, a_stride, b, b_stride, 64, 16, &sse1, &sum1); + variance_neon_w8(a + (16 * a_stride), a_stride, + b + (16 * b_stride), b_stride, 64, 16, &sse2, &sum2); *sse = sse1 + sse2; sum1 += sum2; @@ -247,22 +232,22 @@ unsigned int vp9_variance64x64_neon(const uint8_t *a, int a_stride, int sum1, sum2; uint32_t sse1, sse2; - variance_neon_w8(a, a_stride, b, b_stride, kWidth64, kHeight16, &sse1, &sum1); - variance_neon_w8(a + (kHeight16 * a_stride), a_stride, - b + (kHeight16 * b_stride), b_stride, kWidth64, kHeight16, + variance_neon_w8(a, a_stride, b, b_stride, 64, 16, &sse1, &sum1); + variance_neon_w8(a + (16 * a_stride), a_stride, + b + (16 * b_stride), b_stride, 64, 16, &sse2, &sum2); sse1 += sse2; sum1 += sum2; - variance_neon_w8(a + (kHeight16 * 2 * a_stride), a_stride, - b + (kHeight16 * 2 * b_stride), b_stride, - kWidth64, kHeight16, &sse2, &sum2); + variance_neon_w8(a + (16 * 2 * a_stride), a_stride, + b + (16 * 2 * b_stride), b_stride, + 64, 16, &sse2, &sum2); sse1 += sse2; sum1 += sum2; - variance_neon_w8(a + (kHeight16 * 3 * a_stride), a_stride, - b + (kHeight16 * 3 * b_stride), b_stride, - kWidth64, kHeight16, &sse2, &sum2); + variance_neon_w8(a + (16 * 3 * a_stride), a_stride, + b + (16 * 3 * b_stride), b_stride, + 64, 16, &sse2, &sum2); *sse = sse1 + sse2; sum1 += sum2; return *sse - (((int64_t)sum1 * sum1) >> 12); // >> 12 = / 64 * 64 @@ -275,15 +260,15 @@ unsigned int vp9_sub_pixel_variance32x32_neon(const uint8_t *src, const uint8_t *dst, int dst_stride, unsigned int *sse) { - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, temp2, kHeight32 * kWidth32); - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, fdata3, kHeight32PlusOne * kWidth32); + DECLARE_ALIGNED(16, uint8_t, temp2[32 * 32]); + DECLARE_ALIGNED(16, uint8_t, fdata3[33 * 32]); - var_filter_block2d_bil_w16(src, fdata3, src_stride, kPixelStepOne, - kHeight32PlusOne, kWidth32, + var_filter_block2d_bil_w16(src, fdata3, src_stride, 1, + 33, 32, BILINEAR_FILTERS_2TAP(xoffset)); - var_filter_block2d_bil_w16(fdata3, temp2, kWidth32, kWidth32, kHeight32, - kWidth32, BILINEAR_FILTERS_2TAP(yoffset)); - return vp9_variance32x32_neon(temp2, kWidth32, dst, dst_stride, sse); + var_filter_block2d_bil_w16(fdata3, temp2, 32, 32, 32, + 32, BILINEAR_FILTERS_2TAP(yoffset)); + return vp9_variance32x32_neon(temp2, 32, dst, dst_stride, sse); } unsigned int vp9_sub_pixel_variance64x64_neon(const uint8_t *src, @@ -293,13 +278,13 @@ unsigned int vp9_sub_pixel_variance64x64_neon(const uint8_t *src, const uint8_t *dst, int dst_stride, unsigned int *sse) { - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, temp2, kHeight64 * kWidth64); - DECLARE_ALIGNED_ARRAY(kAlign16, uint8_t, fdata3, kHeight64PlusOne * kWidth64); + DECLARE_ALIGNED(16, uint8_t, temp2[64 * 64]); + DECLARE_ALIGNED(16, uint8_t, fdata3[65 * 64]); - var_filter_block2d_bil_w16(src, fdata3, src_stride, kPixelStepOne, - kHeight64PlusOne, kWidth64, + var_filter_block2d_bil_w16(src, fdata3, src_stride, 1, + 65, 64, BILINEAR_FILTERS_2TAP(xoffset)); - var_filter_block2d_bil_w16(fdata3, temp2, kWidth64, kWidth64, kHeight64, - kWidth64, BILINEAR_FILTERS_2TAP(yoffset)); - return vp9_variance64x64_neon(temp2, kWidth64, dst, dst_stride, sse); + var_filter_block2d_bil_w16(fdata3, temp2, 64, 64, 64, + 64, BILINEAR_FILTERS_2TAP(yoffset)); + return vp9_variance64x64_neon(temp2, 64, dst, dst_stride, sse); } diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 39dffbd..0e74784 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -3657,7 +3657,7 @@ static int set_var_thresh_from_histogram(VP9_COMP *cpi) { const int cutoff = (MIN(cm->width, cm->height) >= 720) ? (cm->MBs * VAR_HIST_LARGE_CUT_OFF / 100) : (cm->MBs * VAR_HIST_SMALL_CUT_OFF / 100); - DECLARE_ALIGNED_ARRAY(16, int, hist, VAR_HIST_BINS); + DECLARE_ALIGNED(16, int, hist[VAR_HIST_BINS]); diff *var16 = cpi->source_diff_var; int sum = 0; diff --git a/vp9/encoder/vp9_mcomp.c b/vp9/encoder/vp9_mcomp.c index ec089f1..80c509a 100644 --- a/vp9/encoder/vp9_mcomp.c +++ b/vp9/encoder/vp9_mcomp.c @@ -301,13 +301,13 @@ static INLINE unsigned int setup_center_error(const MACROBLOCKD *xd, #if CONFIG_VP9_HIGHBITDEPTH if (second_pred != NULL) { if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - DECLARE_ALIGNED_ARRAY(16, uint16_t, comp_pred16, 64 * 64); + DECLARE_ALIGNED(16, uint16_t, comp_pred16[64 * 64]); vp9_highbd_comp_avg_pred(comp_pred16, second_pred, w, h, y + offset, y_stride); besterr = vfp->vf(CONVERT_TO_BYTEPTR(comp_pred16), w, src, src_stride, sse1); } else { - DECLARE_ALIGNED_ARRAY(16, uint8_t, comp_pred, 64 * 64); + DECLARE_ALIGNED(16, uint8_t, comp_pred[64 * 64]); vp9_comp_avg_pred(comp_pred, second_pred, w, h, y + offset, y_stride); besterr = vfp->vf(comp_pred, w, src, src_stride, sse1); } @@ -319,7 +319,7 @@ static INLINE unsigned int setup_center_error(const MACROBLOCKD *xd, #else (void) xd; if (second_pred != NULL) { - DECLARE_ALIGNED_ARRAY(16, uint8_t, comp_pred, 64 * 64); + DECLARE_ALIGNED(16, uint8_t, comp_pred[64 * 64]); vp9_comp_avg_pred(comp_pred, second_pred, w, h, y + offset, y_stride); besterr = vfp->vf(comp_pred, w, src, src_stride, sse1); } else { diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c index 221e14d..9fb7cfb 100644 --- a/vp9/encoder/vp9_pickmode.c +++ b/vp9/encoder/vp9_pickmode.c @@ -1099,9 +1099,9 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, // process. // tmp[3] points to dst buffer, and the other 3 point to allocated buffers. PRED_BUFFER tmp[4]; - DECLARE_ALIGNED_ARRAY(16, uint8_t, pred_buf, 3 * 64 * 64); + DECLARE_ALIGNED(16, uint8_t, pred_buf[3 * 64 * 64]); #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, pred_buf_16, 3 * 64 * 64); + DECLARE_ALIGNED(16, uint16_t, pred_buf_16[3 * 64 * 64]); #endif struct buf_2d orig_dst = pd->dst; PRED_BUFFER *best_pred = NULL; diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 676e3ca..7382562 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -1573,10 +1573,10 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x, // Prediction buffer from second frame. #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, second_pred_alloc_16, 64 * 64); + DECLARE_ALIGNED(16, uint16_t, second_pred_alloc_16[64 * 64]); uint8_t *second_pred; #else - DECLARE_ALIGNED_ARRAY(16, uint8_t, second_pred, 64 * 64); + DECLARE_ALIGNED(16, uint8_t, second_pred[64 * 64]); #endif // CONFIG_VP9_HIGHBITDEPTH for (ref = 0; ref < 2; ++ref) { @@ -2420,10 +2420,10 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, (mbmi->ref_frame[1] < 0 ? 0 : mbmi->ref_frame[1]) }; int_mv cur_mv[2]; #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, tmp_buf16, MAX_MB_PLANE * 64 * 64); + DECLARE_ALIGNED(16, uint16_t, tmp_buf16[MAX_MB_PLANE * 64 * 64]); uint8_t *tmp_buf; #else - DECLARE_ALIGNED_ARRAY(16, uint8_t, tmp_buf, MAX_MB_PLANE * 64 * 64); + DECLARE_ALIGNED(16, uint8_t, tmp_buf[MAX_MB_PLANE * 64 * 64]); #endif // CONFIG_VP9_HIGHBITDEPTH int pred_exists = 0; int intpel_mv; diff --git a/vp9/encoder/vp9_temporal_filter.c b/vp9/encoder/vp9_temporal_filter.c index ed17c7c..d7979ab 100644 --- a/vp9/encoder/vp9_temporal_filter.c +++ b/vp9/encoder/vp9_temporal_filter.c @@ -280,17 +280,17 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi, int mb_rows = (frames[alt_ref_index]->y_crop_height + 15) >> 4; int mb_y_offset = 0; int mb_uv_offset = 0; - DECLARE_ALIGNED_ARRAY(16, unsigned int, accumulator, 16 * 16 * 3); - DECLARE_ALIGNED_ARRAY(16, uint16_t, count, 16 * 16 * 3); + DECLARE_ALIGNED(16, unsigned int, accumulator[16 * 16 * 3]); + DECLARE_ALIGNED(16, uint16_t, count[16 * 16 * 3]); MACROBLOCKD *mbd = &cpi->td.mb.e_mbd; YV12_BUFFER_CONFIG *f = frames[alt_ref_index]; uint8_t *dst1, *dst2; #if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED_ARRAY(16, uint16_t, predictor16, 16 * 16 * 3); - DECLARE_ALIGNED_ARRAY(16, uint8_t, predictor8, 16 * 16 * 3); + DECLARE_ALIGNED(16, uint16_t, predictor16[16 * 16 * 3]); + DECLARE_ALIGNED(16, uint8_t, predictor8[16 * 16 * 3]); uint8_t *predictor; #else - DECLARE_ALIGNED_ARRAY(16, uint8_t, predictor, 16 * 16 * 3); + DECLARE_ALIGNED(16, uint8_t, predictor[16 * 16 * 3]); #endif const int mb_uv_height = 16 >> mbd->plane[1].subsampling_y; const int mb_uv_width = 16 >> mbd->plane[1].subsampling_x; diff --git a/vp9/encoder/vp9_variance.c b/vp9/encoder/vp9_variance.c index fea5f33..f38f96d 100644 --- a/vp9/encoder/vp9_variance.c +++ b/vp9/encoder/vp9_variance.c @@ -145,7 +145,7 @@ unsigned int vp9_sub_pixel_avg_variance##W##x##H##_c( \ const uint8_t *second_pred) { \ uint16_t fdata3[(H + 1) * W]; \ uint8_t temp2[H * W]; \ - DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, H * W); \ + DECLARE_ALIGNED(16, uint8_t, temp3[H * W]); \ \ var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, W, \ BILINEAR_FILTERS_2TAP(xoffset)); \ @@ -464,7 +464,7 @@ unsigned int vp9_highbd_sub_pixel_avg_variance##W##x##H##_c( \ const uint8_t *second_pred) { \ uint16_t fdata3[(H + 1) * W]; \ uint16_t temp2[H * W]; \ - DECLARE_ALIGNED_ARRAY(16, uint16_t, temp3, H * W); \ + DECLARE_ALIGNED(16, uint16_t, temp3[H * W]); \ \ highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \ W, BILINEAR_FILTERS_2TAP(xoffset)); \ @@ -486,7 +486,7 @@ unsigned int vp9_highbd_10_sub_pixel_avg_variance##W##x##H##_c( \ const uint8_t *second_pred) { \ uint16_t fdata3[(H + 1) * W]; \ uint16_t temp2[H * W]; \ - DECLARE_ALIGNED_ARRAY(16, uint16_t, temp3, H * W); \ + DECLARE_ALIGNED(16, uint16_t, temp3[H * W]); \ \ highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \ W, BILINEAR_FILTERS_2TAP(xoffset)); \ @@ -508,7 +508,7 @@ unsigned int vp9_highbd_12_sub_pixel_avg_variance##W##x##H##_c( \ const uint8_t *second_pred) { \ uint16_t fdata3[(H + 1) * W]; \ uint16_t temp2[H * W]; \ - DECLARE_ALIGNED_ARRAY(16, uint16_t, temp3, H * W); \ + DECLARE_ALIGNED(16, uint16_t, temp3[H * W]); \ \ highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \ W, BILINEAR_FILTERS_2TAP(xoffset)); \ diff --git a/vp9/encoder/x86/vp9_dct_impl_sse2.c b/vp9/encoder/x86/vp9_dct_impl_sse2.c index 12fa747..e03a76d 100644 --- a/vp9/encoder/x86/vp9_dct_impl_sse2.c +++ b/vp9/encoder/x86/vp9_dct_impl_sse2.c @@ -578,7 +578,7 @@ void FDCT16x16_2D(const int16_t *input, tran_low_t *output, int stride) { // in normal/row positions). int pass; // We need an intermediate buffer between passes. - DECLARE_ALIGNED_ARRAY(16, int16_t, intermediate, 256); + DECLARE_ALIGNED(16, int16_t, intermediate[256]); const int16_t *in = input; int16_t *out0 = intermediate; tran_low_t *out1 = output; diff --git a/vpx_ports/mem.h b/vpx_ports/mem.h index 1cb8c8c..0106a45 100644 --- a/vpx_ports/mem.h +++ b/vpx_ports/mem.h @@ -24,17 +24,6 @@ #define DECLARE_ALIGNED(n,typ,val) typ val #endif - -/* Declare an aligned array on the stack, for situations where the stack - * pointer may not have the alignment we expect. Creates an array with a - * modified name, then defines val to be a pointer, and aligns that pointer - * within the array. - */ -#define DECLARE_ALIGNED_ARRAY(a,typ,val,n)\ - typ val##_[(n)+(a)/sizeof(typ)+1];\ - typ *val = (typ*)((((intptr_t)val##_)+(a)-1)&((intptr_t)-(a))) - - /* Indicates that the usage of the specified variable has been audited to assure * that it's safe to use uninitialized. Silences 'may be used uninitialized' * warnings on gcc. -- 2.7.4