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 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs); | 172 DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs); |
173 DECLARE_ALIGNED_ARRAY(16, int16_t, output_ref_block, kNumCoeffs); | 173 DECLARE_ALIGNED_ARRAY(16, int16_t, output_ref_block, kNumCoeffs); |
174 DECLARE_ALIGNED_ARRAY(16, int16_t, output_block, kNumCoeffs); | 174 DECLARE_ALIGNED_ARRAY(16, int16_t, output_block, kNumCoeffs); |
175 | 175 |
176 for (int i = 0; i < count_test_block; ++i) { | 176 for (int i = 0; i < count_test_block; ++i) { |
177 // Initialize a test block with input range [-255, 255]. | 177 // Initialize a test block with input range [-255, 255]. |
178 for (int j = 0; j < kNumCoeffs; ++j) { | 178 for (int j = 0; j < kNumCoeffs; ++j) { |
179 input_block[j] = rnd.Rand8() - rnd.Rand8(); | 179 input_block[j] = rnd.Rand8() - rnd.Rand8(); |
180 input_extreme_block[j] = rnd.Rand8() & 1 ? 255 : -255; | 180 input_extreme_block[j] = rnd.Rand8() & 1 ? 255 : -255; |
181 } | 181 } |
182 if (i == 0) | 182 if (i == 0) { |
183 for (int j = 0; j < kNumCoeffs; ++j) | 183 for (int j = 0; j < kNumCoeffs; ++j) |
184 input_extreme_block[j] = 255; | 184 input_extreme_block[j] = 255; |
185 if (i == 1) | 185 } else if (i == 1) { |
186 for (int j = 0; j < kNumCoeffs; ++j) | 186 for (int j = 0; j < kNumCoeffs; ++j) |
187 input_extreme_block[j] = -255; | 187 input_extreme_block[j] = -255; |
| 188 } |
188 | 189 |
189 const int stride = 32; | 190 const int stride = 32; |
190 vp9_fdct32x32_c(input_extreme_block, output_ref_block, stride); | 191 vp9_fdct32x32_c(input_extreme_block, output_ref_block, stride); |
191 REGISTER_STATE_CHECK(fwd_txfm_(input_extreme_block, output_block, stride)); | 192 REGISTER_STATE_CHECK(fwd_txfm_(input_extreme_block, output_block, stride)); |
192 | 193 |
193 // The minimum quant value is 4. | 194 // The minimum quant value is 4. |
194 for (int j = 0; j < kNumCoeffs; ++j) { | 195 for (int j = 0; j < kNumCoeffs; ++j) { |
195 if (version_ == 0) { | 196 if (version_ == 0) { |
196 EXPECT_EQ(output_block[j], output_ref_block[j]) | 197 EXPECT_EQ(output_block[j], output_ref_block[j]) |
197 << "Error: 32x32 FDCT versions have mismatched coefficients"; | 198 << "Error: 32x32 FDCT versions have mismatched coefficients"; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 #if HAVE_AVX2 | 272 #if HAVE_AVX2 |
272 INSTANTIATE_TEST_CASE_P( | 273 INSTANTIATE_TEST_CASE_P( |
273 AVX2, Trans32x32Test, | 274 AVX2, Trans32x32Test, |
274 ::testing::Values( | 275 ::testing::Values( |
275 make_tuple(&vp9_fdct32x32_avx2, | 276 make_tuple(&vp9_fdct32x32_avx2, |
276 &vp9_idct32x32_1024_add_sse2, 0), | 277 &vp9_idct32x32_1024_add_sse2, 0), |
277 make_tuple(&vp9_fdct32x32_rd_avx2, | 278 make_tuple(&vp9_fdct32x32_rd_avx2, |
278 &vp9_idct32x32_1024_add_sse2, 1))); | 279 &vp9_idct32x32_1024_add_sse2, 1))); |
279 #endif | 280 #endif |
280 } // namespace | 281 } // namespace |
OLD | NEW |