| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 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 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 hv8_avg_(hv8_avg) {} | 37 hv8_avg_(hv8_avg) {} |
| 38 | 38 |
| 39 convolve_fn_t h8_; | 39 convolve_fn_t h8_; |
| 40 convolve_fn_t v8_; | 40 convolve_fn_t v8_; |
| 41 convolve_fn_t hv8_; | 41 convolve_fn_t hv8_; |
| 42 convolve_fn_t h8_avg_; | 42 convolve_fn_t h8_avg_; |
| 43 convolve_fn_t v8_avg_; | 43 convolve_fn_t v8_avg_; |
| 44 convolve_fn_t hv8_avg_; | 44 convolve_fn_t hv8_avg_; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 typedef std::tr1::tuple<int, int, const ConvolveFunctions*> convolve_param_t; |
| 48 |
| 47 // Reference 8-tap subpixel filter, slightly modified to fit into this test. | 49 // Reference 8-tap subpixel filter, slightly modified to fit into this test. |
| 48 #define VP9_FILTER_WEIGHT 128 | 50 #define VP9_FILTER_WEIGHT 128 |
| 49 #define VP9_FILTER_SHIFT 7 | 51 #define VP9_FILTER_SHIFT 7 |
| 50 uint8_t clip_pixel(int x) { | 52 uint8_t clip_pixel(int x) { |
| 51 return x < 0 ? 0 : | 53 return x < 0 ? 0 : |
| 52 x > 255 ? 255 : | 54 x > 255 ? 255 : |
| 53 x; | 55 x; |
| 54 } | 56 } |
| 55 | 57 |
| 56 void filter_block2d_8_c(const uint8_t *src_ptr, | 58 void filter_block2d_8_c(const uint8_t *src_ptr, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 uint8_t tmp[64 * 64]; | 164 uint8_t tmp[64 * 64]; |
| 163 | 165 |
| 164 assert(output_width <= 64); | 166 assert(output_width <= 64); |
| 165 assert(output_height <= 64); | 167 assert(output_height <= 64); |
| 166 filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, tmp, 64, | 168 filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, tmp, 64, |
| 167 output_width, output_height); | 169 output_width, output_height); |
| 168 block2d_average_c(tmp, 64, dst_ptr, dst_stride, | 170 block2d_average_c(tmp, 64, dst_ptr, dst_stride, |
| 169 output_width, output_height); | 171 output_width, output_height); |
| 170 } | 172 } |
| 171 | 173 |
| 172 class ConvolveTest : public PARAMS(int, int, const ConvolveFunctions*) { | 174 class ConvolveTest : public ::testing::TestWithParam<convolve_param_t> { |
| 173 public: | 175 public: |
| 174 static void SetUpTestCase() { | 176 static void SetUpTestCase() { |
| 175 // Force input_ to be unaligned, output to be 16 byte aligned. | 177 // Force input_ to be unaligned, output to be 16 byte aligned. |
| 176 input_ = reinterpret_cast<uint8_t*>( | 178 input_ = reinterpret_cast<uint8_t*>( |
| 177 vpx_memalign(kDataAlignment, kInputBufferSize + 1)) + 1; | 179 vpx_memalign(kDataAlignment, kInputBufferSize + 1)) + 1; |
| 178 output_ = reinterpret_cast<uint8_t*>( | 180 output_ = reinterpret_cast<uint8_t*>( |
| 179 vpx_memalign(kDataAlignment, kOutputBufferSize)); | 181 vpx_memalign(kDataAlignment, kOutputBufferSize)); |
| 180 } | 182 } |
| 181 | 183 |
| 182 static void TearDownTestCase() { | 184 static void TearDownTestCase() { |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 make_tuple(8, 16, &convolve8_dspr2), | 682 make_tuple(8, 16, &convolve8_dspr2), |
| 681 make_tuple(16, 16, &convolve8_dspr2), | 683 make_tuple(16, 16, &convolve8_dspr2), |
| 682 make_tuple(32, 16, &convolve8_dspr2), | 684 make_tuple(32, 16, &convolve8_dspr2), |
| 683 make_tuple(16, 32, &convolve8_dspr2), | 685 make_tuple(16, 32, &convolve8_dspr2), |
| 684 make_tuple(32, 32, &convolve8_dspr2), | 686 make_tuple(32, 32, &convolve8_dspr2), |
| 685 make_tuple(64, 32, &convolve8_dspr2), | 687 make_tuple(64, 32, &convolve8_dspr2), |
| 686 make_tuple(32, 64, &convolve8_dspr2), | 688 make_tuple(32, 64, &convolve8_dspr2), |
| 687 make_tuple(64, 64, &convolve8_dspr2))); | 689 make_tuple(64, 64, &convolve8_dspr2))); |
| 688 #endif | 690 #endif |
| 689 } // namespace | 691 } // namespace |
| OLD | NEW |