diff options
author | Jingning Han <jingning@google.com> | 2013-06-26 11:59:46 -0700 |
---|---|---|
committer | Jingning Han <jingning@google.com> | 2013-06-26 11:59:46 -0700 |
commit | 9b744ce35b0e6527cb4170d032978f5004395e92 (patch) | |
tree | 39872a7da61851b4919d295166b9672fbba495ba /test | |
parent | e4f38c88da624a1634472e761dcb381ce3b95826 (diff) | |
download | libvpx-9b744ce35b0e6527cb4170d032978f5004395e92.tar libvpx-9b744ce35b0e6527cb4170d032978f5004395e92.tar.gz libvpx-9b744ce35b0e6527cb4170d032978f5004395e92.tar.bz2 libvpx-9b744ce35b0e6527cb4170d032978f5004395e92.zip |
Fix aligned memory allocation in unit tests
Change-Id: I38fac90e0ed25cb747453ab1d6396187cf5ef3b9
Diffstat (limited to 'test')
-rw-r--r-- | test/fdct4x4_test.cc | 12 | ||||
-rw-r--r-- | test/fdct8x8_test.cc | 19 |
2 files changed, 18 insertions, 13 deletions
diff --git a/test/fdct4x4_test.cc b/test/fdct4x4_test.cc index eabdee12f..3538c7bd9 100644 --- a/test/fdct4x4_test.cc +++ b/test/fdct4x4_test.cc @@ -20,6 +20,7 @@ extern "C" { #include "acm_random.h" #include "vpx/vpx_integer.h" +#include "vpx_ports/mem.h" using libvpx_test::ACMRandom; @@ -77,8 +78,8 @@ class FwdTrans4x4Test : public ::testing::TestWithParam<int> { TEST_P(FwdTrans4x4Test, SignBiasCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); - int16_t test_input_block[16]; - int16_t test_output_block[16]; + DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 16); + DECLARE_ALIGNED_ARRAY(16, int16_t, test_output_block, 16); const int pitch = 8; int count_sign_block[16][2]; const int count_test_block = 1000000; @@ -140,9 +141,10 @@ TEST_P(FwdTrans4x4Test, RoundTripErrorCheck) { double total_error = 0; const int count_test_block = 1000000; for (int i = 0; i < count_test_block; ++i) { - int16_t test_input_block[16]; - int16_t test_temp_block[16]; - uint8_t dst[16], src[16]; + DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 16); + DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, 16); + DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 16); + DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 16); for (int j = 0; j < 16; ++j) { src[j] = rnd.Rand8(); diff --git a/test/fdct8x8_test.cc b/test/fdct8x8_test.cc index 6d8511878..eeae208f2 100644 --- a/test/fdct8x8_test.cc +++ b/test/fdct8x8_test.cc @@ -13,6 +13,7 @@ #include <string.h> #include "third_party/googletest/src/include/gtest/gtest.h" +#include "vpx_ports/mem.h" extern "C" { #include "vp9_rtcd.h" @@ -81,8 +82,8 @@ class FwdTrans8x8Test : public ::testing::TestWithParam<int> { TEST_P(FwdTrans8x8Test, SignBiasCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); - int16_t test_input_block[64]; - int16_t test_output_block[64]; + DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64); + DECLARE_ALIGNED_ARRAY(16, int16_t, test_output_block, 64); const int pitch = 16; int count_sign_block[64][2]; const int count_test_block = 100000; @@ -152,9 +153,10 @@ TEST_P(FwdTrans8x8Test, RoundTripErrorCheck) { double total_error = 0; const int count_test_block = 100000; for (int i = 0; i < count_test_block; ++i) { - int16_t test_input_block[64]; - int16_t test_temp_block[64]; - uint8_t dst[64], src[64]; + DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64); + DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, 64); + DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 64); + DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 64); for (int j = 0; j < 64; ++j) { src[j] = rnd.Rand8(); @@ -202,9 +204,10 @@ TEST_P(FwdTrans8x8Test, ExtremalCheck) { double total_error = 0; const int count_test_block = 100000; for (int i = 0; i < count_test_block; ++i) { - int16_t test_input_block[64]; - int16_t test_temp_block[64]; - uint8_t dst[64], src[64]; + DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64); + DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, 64); + DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 64); + DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 64); for (int j = 0; j < 64; ++j) { src[j] = rnd.Rand8() % 2 ? 255 : 0; |