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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 } | 209 } |
210 | 210 |
211 MACROBLOCKD *mbptr_; | 211 MACROBLOCKD *mbptr_; |
212 MODE_INFO *miptr_; | 212 MODE_INFO *miptr_; |
213 uint8_t *data_ptr_[2]; // in the case of Y, only [0] is used | 213 uint8_t *data_ptr_[2]; // in the case of Y, only [0] is used |
214 int stride_; | 214 int stride_; |
215 int block_size_; | 215 int block_size_; |
216 int num_planes_; | 216 int num_planes_; |
217 }; | 217 }; |
218 | 218 |
219 typedef void (*intra_pred_y_fn_t)(MACROBLOCKD *x, | 219 typedef void (*IntraPredYFunc)(MACROBLOCKD *x, |
220 uint8_t *yabove_row, | 220 uint8_t *yabove_row, |
221 uint8_t *yleft, | 221 uint8_t *yleft, |
222 int left_stride, | 222 int left_stride, |
223 uint8_t *ypred_ptr, | 223 uint8_t *ypred_ptr, |
224 int y_stride); | 224 int y_stride); |
225 | 225 |
226 class IntraPredYTest | 226 class IntraPredYTest |
227 : public IntraPredBase, | 227 : public IntraPredBase, |
228 public ::testing::TestWithParam<intra_pred_y_fn_t> { | 228 public ::testing::TestWithParam<IntraPredYFunc> { |
229 public: | 229 public: |
230 static void SetUpTestCase() { | 230 static void SetUpTestCase() { |
231 mb_ = reinterpret_cast<MACROBLOCKD*>( | 231 mb_ = reinterpret_cast<MACROBLOCKD*>( |
232 vpx_memalign(32, sizeof(MACROBLOCKD))); | 232 vpx_memalign(32, sizeof(MACROBLOCKD))); |
233 mi_ = reinterpret_cast<MODE_INFO*>( | 233 mi_ = reinterpret_cast<MODE_INFO*>( |
234 vpx_memalign(32, sizeof(MODE_INFO))); | 234 vpx_memalign(32, sizeof(MODE_INFO))); |
235 data_array_ = reinterpret_cast<uint8_t*>( | 235 data_array_ = reinterpret_cast<uint8_t*>( |
236 vpx_memalign(kDataAlignment, kDataBufferSize)); | 236 vpx_memalign(kDataAlignment, kDataBufferSize)); |
237 } | 237 } |
238 | 238 |
(...skipping 21 matching lines...) Expand all Loading... |
260 } | 260 } |
261 | 261 |
262 virtual void Predict(MB_PREDICTION_MODE mode) { | 262 virtual void Predict(MB_PREDICTION_MODE mode) { |
263 mbptr_->mode_info_context->mbmi.mode = mode; | 263 mbptr_->mode_info_context->mbmi.mode = mode; |
264 ASM_REGISTER_STATE_CHECK(pred_fn_(mbptr_, | 264 ASM_REGISTER_STATE_CHECK(pred_fn_(mbptr_, |
265 data_ptr_[0] - kStride, | 265 data_ptr_[0] - kStride, |
266 data_ptr_[0] - 1, kStride, | 266 data_ptr_[0] - 1, kStride, |
267 data_ptr_[0], kStride)); | 267 data_ptr_[0], kStride)); |
268 } | 268 } |
269 | 269 |
270 intra_pred_y_fn_t pred_fn_; | 270 IntraPredYFunc pred_fn_; |
271 static uint8_t* data_array_; | 271 static uint8_t* data_array_; |
272 static MACROBLOCKD * mb_; | 272 static MACROBLOCKD * mb_; |
273 static MODE_INFO *mi_; | 273 static MODE_INFO *mi_; |
274 }; | 274 }; |
275 | 275 |
276 MACROBLOCKD* IntraPredYTest::mb_ = NULL; | 276 MACROBLOCKD* IntraPredYTest::mb_ = NULL; |
277 MODE_INFO* IntraPredYTest::mi_ = NULL; | 277 MODE_INFO* IntraPredYTest::mi_ = NULL; |
278 uint8_t* IntraPredYTest::data_array_ = NULL; | 278 uint8_t* IntraPredYTest::data_array_ = NULL; |
279 | 279 |
280 TEST_P(IntraPredYTest, IntraPredTests) { | 280 TEST_P(IntraPredYTest, IntraPredTests) { |
281 RunTest(); | 281 RunTest(); |
282 } | 282 } |
283 | 283 |
284 INSTANTIATE_TEST_CASE_P(C, IntraPredYTest, | 284 INSTANTIATE_TEST_CASE_P(C, IntraPredYTest, |
285 ::testing::Values( | 285 ::testing::Values( |
286 vp8_build_intra_predictors_mby_s_c)); | 286 vp8_build_intra_predictors_mby_s_c)); |
287 #if HAVE_SSE2 | 287 #if HAVE_SSE2 |
288 INSTANTIATE_TEST_CASE_P(SSE2, IntraPredYTest, | 288 INSTANTIATE_TEST_CASE_P(SSE2, IntraPredYTest, |
289 ::testing::Values( | 289 ::testing::Values( |
290 vp8_build_intra_predictors_mby_s_sse2)); | 290 vp8_build_intra_predictors_mby_s_sse2)); |
291 #endif | 291 #endif |
292 #if HAVE_SSSE3 | 292 #if HAVE_SSSE3 |
293 INSTANTIATE_TEST_CASE_P(SSSE3, IntraPredYTest, | 293 INSTANTIATE_TEST_CASE_P(SSSE3, IntraPredYTest, |
294 ::testing::Values( | 294 ::testing::Values( |
295 vp8_build_intra_predictors_mby_s_ssse3)); | 295 vp8_build_intra_predictors_mby_s_ssse3)); |
296 #endif | 296 #endif |
297 | 297 |
298 typedef void (*intra_pred_uv_fn_t)(MACROBLOCKD *x, | 298 typedef void (*IntraPredUvFunc)(MACROBLOCKD *x, |
299 uint8_t *uabove_row, | 299 uint8_t *uabove_row, |
300 uint8_t *vabove_row, | 300 uint8_t *vabove_row, |
301 uint8_t *uleft, | 301 uint8_t *uleft, |
302 uint8_t *vleft, | 302 uint8_t *vleft, |
303 int left_stride, | 303 int left_stride, |
304 uint8_t *upred_ptr, | 304 uint8_t *upred_ptr, |
305 uint8_t *vpred_ptr, | 305 uint8_t *vpred_ptr, |
306 int pred_stride); | 306 int pred_stride); |
307 | 307 |
308 class IntraPredUVTest | 308 class IntraPredUVTest |
309 : public IntraPredBase, | 309 : public IntraPredBase, |
310 public ::testing::TestWithParam<intra_pred_uv_fn_t> { | 310 public ::testing::TestWithParam<IntraPredUvFunc> { |
311 public: | 311 public: |
312 static void SetUpTestCase() { | 312 static void SetUpTestCase() { |
313 mb_ = reinterpret_cast<MACROBLOCKD*>( | 313 mb_ = reinterpret_cast<MACROBLOCKD*>( |
314 vpx_memalign(32, sizeof(MACROBLOCKD))); | 314 vpx_memalign(32, sizeof(MACROBLOCKD))); |
315 mi_ = reinterpret_cast<MODE_INFO*>( | 315 mi_ = reinterpret_cast<MODE_INFO*>( |
316 vpx_memalign(32, sizeof(MODE_INFO))); | 316 vpx_memalign(32, sizeof(MODE_INFO))); |
317 data_array_ = reinterpret_cast<uint8_t*>( | 317 data_array_ = reinterpret_cast<uint8_t*>( |
318 vpx_memalign(kDataAlignment, kDataBufferSize)); | 318 vpx_memalign(kDataAlignment, kDataBufferSize)); |
319 } | 319 } |
320 | 320 |
(...skipping 21 matching lines...) Expand all Loading... |
342 SetupMacroblock(mb_, mi_, data_array_, kBlockSize, kStride, 2); | 342 SetupMacroblock(mb_, mi_, data_array_, kBlockSize, kStride, 2); |
343 } | 343 } |
344 | 344 |
345 virtual void Predict(MB_PREDICTION_MODE mode) { | 345 virtual void Predict(MB_PREDICTION_MODE mode) { |
346 mbptr_->mode_info_context->mbmi.uv_mode = mode; | 346 mbptr_->mode_info_context->mbmi.uv_mode = mode; |
347 pred_fn_(mbptr_, data_ptr_[0] - kStride, data_ptr_[1] - kStride, | 347 pred_fn_(mbptr_, data_ptr_[0] - kStride, data_ptr_[1] - kStride, |
348 data_ptr_[0] - 1, data_ptr_[1] - 1, kStride, | 348 data_ptr_[0] - 1, data_ptr_[1] - 1, kStride, |
349 data_ptr_[0], data_ptr_[1], kStride); | 349 data_ptr_[0], data_ptr_[1], kStride); |
350 } | 350 } |
351 | 351 |
352 intra_pred_uv_fn_t pred_fn_; | 352 IntraPredUvFunc pred_fn_; |
353 // We use 24 so that the data pointer of the first pixel in each row of | 353 // We use 24 so that the data pointer of the first pixel in each row of |
354 // each macroblock is 8-byte aligned, and this gives us access to the | 354 // each macroblock is 8-byte aligned, and this gives us access to the |
355 // top-left and top-right corner pixels belonging to the top-left/right | 355 // top-left and top-right corner pixels belonging to the top-left/right |
356 // macroblocks. | 356 // macroblocks. |
357 // We use 9 lines so we have one line above us for top-prediction. | 357 // We use 9 lines so we have one line above us for top-prediction. |
358 // [0] = U, [1] = V | 358 // [0] = U, [1] = V |
359 static uint8_t* data_array_; | 359 static uint8_t* data_array_; |
360 static MACROBLOCKD* mb_; | 360 static MACROBLOCKD* mb_; |
361 static MODE_INFO* mi_; | 361 static MODE_INFO* mi_; |
362 }; | 362 }; |
(...skipping 14 matching lines...) Expand all Loading... |
377 ::testing::Values( | 377 ::testing::Values( |
378 vp8_build_intra_predictors_mbuv_s_sse2)); | 378 vp8_build_intra_predictors_mbuv_s_sse2)); |
379 #endif | 379 #endif |
380 #if HAVE_SSSE3 | 380 #if HAVE_SSSE3 |
381 INSTANTIATE_TEST_CASE_P(SSSE3, IntraPredUVTest, | 381 INSTANTIATE_TEST_CASE_P(SSSE3, IntraPredUVTest, |
382 ::testing::Values( | 382 ::testing::Values( |
383 vp8_build_intra_predictors_mbuv_s_ssse3)); | 383 vp8_build_intra_predictors_mbuv_s_ssse3)); |
384 #endif | 384 #endif |
385 | 385 |
386 } // namespace | 386 } // namespace |
OLD | NEW |