Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Side by Side Diff: source/libvpx/test/sixtap_predict_test.cc

Issue 390713002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: libvpx: Pull from upstream Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/test/simple_encoder.sh ('k') | source/libvpx/test/subtract_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 161, 81, 106, 72, 135, 222, 234, 137, 66, 137, 106, 243, 210, 147, 95, 136 161, 81, 106, 72, 135, 222, 234, 137, 66, 137, 106, 243, 210, 147, 95,
137 15, 137, 110, 85, 66, 16, 96, 167, 147, 150, 173, 203, 140, 118, 196, 137 15, 137, 110, 85, 66, 16, 96, 167, 147, 150, 173, 203, 140, 118, 196,
138 84, 147, 160, 19, 95, 101, 123, 74, 132, 202, 82, 166, 12, 131, 166, 138 84, 147, 160, 19, 95, 101, 123, 74, 132, 202, 82, 166, 12, 131, 166,
139 189, 170, 159, 85, 79, 66, 57, 152, 132, 203, 194, 0, 1, 56, 146, 180, 139 189, 170, 159, 85, 79, 66, 57, 152, 132, 203, 194, 0, 1, 56, 146, 180,
140 224, 156, 28, 83, 181, 79, 76, 80, 46, 160, 175, 59, 106, 43, 87, 75, 140 224, 156, 28, 83, 181, 79, 76, 80, 46, 160, 175, 59, 106, 43, 87, 75,
141 136, 85, 189, 46, 71, 200, 90 141 136, 85, 189, 46, 71, 200, 90
142 }; 142 };
143 143
144 uint8_t *src = const_cast<uint8_t*>(test_data); 144 uint8_t *src = const_cast<uint8_t*>(test_data);
145 145
146 REGISTER_STATE_CHECK(sixtap_predict_(&src[kSrcStride * 2 + 2 + 1], kSrcStride, 146 ASM_REGISTER_STATE_CHECK(
147 2, 2, dst_, kDstStride)); 147 sixtap_predict_(&src[kSrcStride * 2 + 2 + 1], kSrcStride,
148 2, 2, dst_, kDstStride));
148 149
149 for (int i = 0; i < height_; ++i) 150 for (int i = 0; i < height_; ++i)
150 for (int j = 0; j < width_; ++j) 151 for (int j = 0; j < width_; ++j)
151 ASSERT_EQ(expected_dst[i * kDstStride + j], dst_[i * kDstStride + j]) 152 ASSERT_EQ(expected_dst[i * kDstStride + j], dst_[i * kDstStride + j])
152 << "i==" << (i * width_ + j); 153 << "i==" << (i * width_ + j);
153 } 154 }
154 155
155 using libvpx_test::ACMRandom; 156 using libvpx_test::ACMRandom;
156 157
157 TEST_P(SixtapPredictTest, TestWithRandomData) { 158 TEST_P(SixtapPredictTest, TestWithRandomData) {
158 ACMRandom rnd(ACMRandom::DeterministicSeed()); 159 ACMRandom rnd(ACMRandom::DeterministicSeed());
159 for (int i = 0; i < kSrcSize; ++i) 160 for (int i = 0; i < kSrcSize; ++i)
160 src_[i] = rnd.Rand8(); 161 src_[i] = rnd.Rand8();
161 162
162 // Run tests for all possible offsets. 163 // Run tests for all possible offsets.
163 for (int xoffset = 0; xoffset < 8; ++xoffset) { 164 for (int xoffset = 0; xoffset < 8; ++xoffset) {
164 for (int yoffset = 0; yoffset < 8; ++yoffset) { 165 for (int yoffset = 0; yoffset < 8; ++yoffset) {
165 // Call c reference function. 166 // Call c reference function.
166 // Move start point to next pixel to test if the function reads 167 // Move start point to next pixel to test if the function reads
167 // unaligned data correctly. 168 // unaligned data correctly.
168 vp8_sixtap_predict16x16_c(&src_[kSrcStride * 2 + 2 + 1], kSrcStride, 169 vp8_sixtap_predict16x16_c(&src_[kSrcStride * 2 + 2 + 1], kSrcStride,
169 xoffset, yoffset, dst_c_, kDstStride); 170 xoffset, yoffset, dst_c_, kDstStride);
170 171
171 // Run test. 172 // Run test.
172 REGISTER_STATE_CHECK( 173 ASM_REGISTER_STATE_CHECK(
173 sixtap_predict_(&src_[kSrcStride * 2 + 2 + 1], kSrcStride, 174 sixtap_predict_(&src_[kSrcStride * 2 + 2 + 1], kSrcStride,
174 xoffset, yoffset, dst_, kDstStride)); 175 xoffset, yoffset, dst_, kDstStride));
175 176
176 for (int i = 0; i < height_; ++i) 177 for (int i = 0; i < height_; ++i)
177 for (int j = 0; j < width_; ++j) 178 for (int j = 0; j < width_; ++j)
178 ASSERT_EQ(dst_c_[i * kDstStride + j], dst_[i * kDstStride + j]) 179 ASSERT_EQ(dst_c_[i * kDstStride + j], dst_[i * kDstStride + j])
179 << "i==" << (i * width_ + j); 180 << "i==" << (i * width_ + j);
180 } 181 }
181 } 182 }
182 } 183 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 const sixtap_predict_fn_t sixtap_8x4_ssse3 = vp8_sixtap_predict8x4_ssse3; 232 const sixtap_predict_fn_t sixtap_8x4_ssse3 = vp8_sixtap_predict8x4_ssse3;
232 const sixtap_predict_fn_t sixtap_4x4_ssse3 = vp8_sixtap_predict4x4_ssse3; 233 const sixtap_predict_fn_t sixtap_4x4_ssse3 = vp8_sixtap_predict4x4_ssse3;
233 INSTANTIATE_TEST_CASE_P( 234 INSTANTIATE_TEST_CASE_P(
234 SSSE3, SixtapPredictTest, ::testing::Values( 235 SSSE3, SixtapPredictTest, ::testing::Values(
235 make_tuple(16, 16, sixtap_16x16_ssse3), 236 make_tuple(16, 16, sixtap_16x16_ssse3),
236 make_tuple(8, 8, sixtap_8x8_ssse3), 237 make_tuple(8, 8, sixtap_8x8_ssse3),
237 make_tuple(8, 4, sixtap_8x4_ssse3), 238 make_tuple(8, 4, sixtap_8x4_ssse3),
238 make_tuple(4, 4, sixtap_4x4_ssse3))); 239 make_tuple(4, 4, sixtap_4x4_ssse3)));
239 #endif 240 #endif
240 } // namespace 241 } // namespace
OLDNEW
« no previous file with comments | « source/libvpx/test/simple_encoder.sh ('k') | source/libvpx/test/subtract_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698