| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 | 11 |
| 12 #include <string.h> | 12 #include <string.h> |
| 13 #include "test/acm_random.h" | 13 #include "test/acm_random.h" |
| 14 #include "test/clear_system_state.h" | 14 #include "test/clear_system_state.h" |
| 15 #include "test/register_state_check.h" | 15 #include "test/register_state_check.h" |
| 16 #include "third_party/googletest/src/include/gtest/gtest.h" | 16 #include "third_party/googletest/src/include/gtest/gtest.h" |
| 17 | 17 |
| 18 #include "./vpx_config.h" | 18 #include "./vpx_config.h" |
| 19 #include "./vp8_rtcd.h" | 19 #include "./vp8_rtcd.h" |
| 20 #include "vp8/common/blockd.h" | 20 #include "vp8/common/blockd.h" |
| 21 #include "vpx_mem/vpx_mem.h" | 21 #include "vpx_mem/vpx_mem.h" |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 using libvpx_test::ACMRandom; | 25 using libvpx_test::ACMRandom; |
| 26 | 26 |
| 27 class IntraPredBase { | 27 class IntraPredBase { |
| 28 public: | 28 public: |
| 29 virtual ~IntraPredBase() {} | 29 virtual ~IntraPredBase() { libvpx_test::ClearSystemState(); } |
| 30 | |
| 31 virtual void TearDown() { | |
| 32 libvpx_test::ClearSystemState(); | |
| 33 } | |
| 34 | 30 |
| 35 protected: | 31 protected: |
| 36 void SetupMacroblock(MACROBLOCKD *mbptr, | 32 void SetupMacroblock(MACROBLOCKD *mbptr, |
| 37 MODE_INFO *miptr, | 33 MODE_INFO *miptr, |
| 38 uint8_t *data, | 34 uint8_t *data, |
| 39 int block_size, | 35 int block_size, |
| 40 int stride, | 36 int stride, |
| 41 int num_planes) { | 37 int num_planes) { |
| 42 mbptr_ = mbptr; | 38 mbptr_ = mbptr; |
| 43 miptr_ = miptr; | 39 miptr_ = miptr; |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 int num_planes_; | 216 int num_planes_; |
| 221 }; | 217 }; |
| 222 | 218 |
| 223 typedef void (*intra_pred_y_fn_t)(MACROBLOCKD *x, | 219 typedef void (*intra_pred_y_fn_t)(MACROBLOCKD *x, |
| 224 uint8_t *yabove_row, | 220 uint8_t *yabove_row, |
| 225 uint8_t *yleft, | 221 uint8_t *yleft, |
| 226 int left_stride, | 222 int left_stride, |
| 227 uint8_t *ypred_ptr, | 223 uint8_t *ypred_ptr, |
| 228 int y_stride); | 224 int y_stride); |
| 229 | 225 |
| 230 class IntraPredYTest : public ::testing::TestWithParam<intra_pred_y_fn_t>, | 226 class IntraPredYTest |
| 231 protected IntraPredBase { | 227 : public IntraPredBase, |
| 228 public ::testing::TestWithParam<intra_pred_y_fn_t> { |
| 232 public: | 229 public: |
| 233 static void SetUpTestCase() { | 230 static void SetUpTestCase() { |
| 234 mb_ = reinterpret_cast<MACROBLOCKD*>( | 231 mb_ = reinterpret_cast<MACROBLOCKD*>( |
| 235 vpx_memalign(32, sizeof(MACROBLOCKD))); | 232 vpx_memalign(32, sizeof(MACROBLOCKD))); |
| 236 mi_ = reinterpret_cast<MODE_INFO*>( | 233 mi_ = reinterpret_cast<MODE_INFO*>( |
| 237 vpx_memalign(32, sizeof(MODE_INFO))); | 234 vpx_memalign(32, sizeof(MODE_INFO))); |
| 238 data_array_ = reinterpret_cast<uint8_t*>( | 235 data_array_ = reinterpret_cast<uint8_t*>( |
| 239 vpx_memalign(kDataAlignment, kDataBufferSize)); | 236 vpx_memalign(kDataAlignment, kDataBufferSize)); |
| 240 } | 237 } |
| 241 | 238 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 typedef void (*intra_pred_uv_fn_t)(MACROBLOCKD *x, | 298 typedef void (*intra_pred_uv_fn_t)(MACROBLOCKD *x, |
| 302 uint8_t *uabove_row, | 299 uint8_t *uabove_row, |
| 303 uint8_t *vabove_row, | 300 uint8_t *vabove_row, |
| 304 uint8_t *uleft, | 301 uint8_t *uleft, |
| 305 uint8_t *vleft, | 302 uint8_t *vleft, |
| 306 int left_stride, | 303 int left_stride, |
| 307 uint8_t *upred_ptr, | 304 uint8_t *upred_ptr, |
| 308 uint8_t *vpred_ptr, | 305 uint8_t *vpred_ptr, |
| 309 int pred_stride); | 306 int pred_stride); |
| 310 | 307 |
| 311 class IntraPredUVTest : public ::testing::TestWithParam<intra_pred_uv_fn_t>, | 308 class IntraPredUVTest |
| 312 protected IntraPredBase { | 309 : public IntraPredBase, |
| 310 public ::testing::TestWithParam<intra_pred_uv_fn_t> { |
| 313 public: | 311 public: |
| 314 static void SetUpTestCase() { | 312 static void SetUpTestCase() { |
| 315 mb_ = reinterpret_cast<MACROBLOCKD*>( | 313 mb_ = reinterpret_cast<MACROBLOCKD*>( |
| 316 vpx_memalign(32, sizeof(MACROBLOCKD))); | 314 vpx_memalign(32, sizeof(MACROBLOCKD))); |
| 317 mi_ = reinterpret_cast<MODE_INFO*>( | 315 mi_ = reinterpret_cast<MODE_INFO*>( |
| 318 vpx_memalign(32, sizeof(MODE_INFO))); | 316 vpx_memalign(32, sizeof(MODE_INFO))); |
| 319 data_array_ = reinterpret_cast<uint8_t*>( | 317 data_array_ = reinterpret_cast<uint8_t*>( |
| 320 vpx_memalign(kDataAlignment, kDataBufferSize)); | 318 vpx_memalign(kDataAlignment, kDataBufferSize)); |
| 321 } | 319 } |
| 322 | 320 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 ::testing::Values( | 377 ::testing::Values( |
| 380 vp8_build_intra_predictors_mbuv_s_sse2)); | 378 vp8_build_intra_predictors_mbuv_s_sse2)); |
| 381 #endif | 379 #endif |
| 382 #if HAVE_SSSE3 | 380 #if HAVE_SSSE3 |
| 383 INSTANTIATE_TEST_CASE_P(SSSE3, IntraPredUVTest, | 381 INSTANTIATE_TEST_CASE_P(SSSE3, IntraPredUVTest, |
| 384 ::testing::Values( | 382 ::testing::Values( |
| 385 vp8_build_intra_predictors_mbuv_s_ssse3)); | 383 vp8_build_intra_predictors_mbuv_s_ssse3)); |
| 386 #endif | 384 #endif |
| 387 | 385 |
| 388 } // namespace | 386 } // namespace |
| OLD | NEW |