diff options
author | Frank Barchard <fbarchard@google.com> | 2016-05-27 18:02:47 -0700 |
---|---|---|
committer | Frank Barchard <fbarchard@google.com> | 2016-05-27 18:02:47 -0700 |
commit | b00d40160a5a5d78a014ebbbdc4ced728d0f9cc5 (patch) | |
tree | 5a9c97835bbc8311aa89be75314b8743ce0925bd /unit_test | |
parent | ade85fb55c062d759269b06050feaa1f956c80ca (diff) | |
download | libyuv-b00d40160a5a5d78a014ebbbdc4ced728d0f9cc5.tar.gz |
make unittest allocator align to 64 bytes.
blur requires memory be aligned. change the unittest allocator to guarantee 64 byte alignment.
re-enable blur any test that fails if memory is unaligned.
TBR=harryjin@google.com
BUG=libyuv:596,libyuv:594
TESTED=local build passes with row.h removed from tests.
Review URL: https://codereview.chromium.org/2019753002 .
Diffstat (limited to 'unit_test')
-rw-r--r-- | unit_test/planar_test.cc | 2 | ||||
-rw-r--r-- | unit_test/unit_test.cc | 2 | ||||
-rw-r--r-- | unit_test/unit_test.h | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/unit_test/planar_test.cc b/unit_test/planar_test.cc index d2ae35d0..bc0eebb5 100644 --- a/unit_test/planar_test.cc +++ b/unit_test/planar_test.cc @@ -1929,7 +1929,7 @@ static int TestBlur(int width, int height, int benchmark_iterations, } static const int kBlurSize = 55; -TEST_F(LibYUVPlanarTest, DISABLED_ARGBBlur_Any) { +TEST_F(LibYUVPlanarTest, ARGBBlur_Any) { int max_diff = TestBlur(benchmark_width_ - 1, benchmark_height_, benchmark_iterations_, disable_cpu_flags_, benchmark_cpu_info_, diff --git a/unit_test/unit_test.cc b/unit_test/unit_test.cc index c98c285c..95398285 100644 --- a/unit_test/unit_test.cc +++ b/unit_test/unit_test.cc @@ -34,7 +34,7 @@ DEFINE_int32(libyuv_cpu_info, -1, // Set flags to -1 for benchmarking to avoid slower C code. LibYUVConvertTest::LibYUVConvertTest() : - benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(130), + benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128), benchmark_height_(72), disable_cpu_flags_(1), benchmark_cpu_info_(-1) { const char* repeat = getenv("LIBYUV_REPEAT"); if (repeat) { diff --git a/unit_test/unit_test.h b/unit_test/unit_test.h index 51e938df..f2c4bef0 100644 --- a/unit_test/unit_test.h +++ b/unit_test/unit_test.h @@ -67,9 +67,9 @@ static inline bool SizeValid(int src_width, int src_height, #define align_buffer_page_end(var, size) \ uint8* var; \ uint8* var##_mem; \ - var##_mem = reinterpret_cast<uint8*>(malloc((((size) + 4095) & ~4095) + \ - OFFBY)); \ - var = var##_mem + (-(size) & 4095) + OFFBY; + var##_mem = reinterpret_cast<uint8*>(malloc(((size) + 4095 + 63) & ~4095)); \ + var = (uint8*)((intptr_t)(var##_mem + (((size) + 4095 + 63) & ~4095) - \ + (size)) & ~63); #define free_aligned_buffer_page_end(var) \ free(var##_mem); \ |