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

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

Issue 668403002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 2 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/convolve_test.cc ('k') | source/libvpx/test/dct32x32_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) 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 vp9_fht16x16_c(in, out, stride, tx_type); 280 vp9_fht16x16_c(in, out, stride, tx_type);
281 } 281 }
282 282
283 void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride, 283 void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
284 int tx_type) { 284 int tx_type) {
285 vp9_iht16x16_256_add_c(in, dest, stride, tx_type); 285 vp9_iht16x16_256_add_c(in, dest, stride, tx_type);
286 } 286 }
287 287
288 #if CONFIG_VP9_HIGHBITDEPTH 288 #if CONFIG_VP9_HIGHBITDEPTH
289 void idct16x16_10(const tran_low_t *in, uint8_t *out, int stride) { 289 void idct16x16_10(const tran_low_t *in, uint8_t *out, int stride) {
290 vp9_high_idct16x16_256_add_c(in, out, stride, 10); 290 vp9_highbd_idct16x16_256_add_c(in, out, stride, 10);
291 } 291 }
292 292
293 void idct16x16_12(const tran_low_t *in, uint8_t *out, int stride) { 293 void idct16x16_12(const tran_low_t *in, uint8_t *out, int stride) {
294 vp9_high_idct16x16_256_add_c(in, out, stride, 12); 294 vp9_highbd_idct16x16_256_add_c(in, out, stride, 12);
295 } 295 }
296 296
297 void idct16x16_10_ref(const tran_low_t *in, uint8_t *out, int stride, 297 void idct16x16_10_ref(const tran_low_t *in, uint8_t *out, int stride,
298 int tx_type) { 298 int tx_type) {
299 idct16x16_10(in, out, stride); 299 idct16x16_10(in, out, stride);
300 } 300 }
301 301
302 void idct16x16_12_ref(const tran_low_t *in, uint8_t *out, int stride, 302 void idct16x16_12_ref(const tran_low_t *in, uint8_t *out, int stride,
303 int tx_type) { 303 int tx_type) {
304 idct16x16_12(in, out, stride); 304 idct16x16_12(in, out, stride);
305 } 305 }
306 306
307 void iht16x16_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { 307 void iht16x16_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
308 vp9_high_iht16x16_256_add_c(in, out, stride, tx_type, 10); 308 vp9_highbd_iht16x16_256_add_c(in, out, stride, tx_type, 10);
309 } 309 }
310 310
311 void iht16x16_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { 311 void iht16x16_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
312 vp9_high_iht16x16_256_add_c(in, out, stride, tx_type, 12); 312 vp9_highbd_iht16x16_256_add_c(in, out, stride, tx_type, 12);
313 } 313 }
314 #endif 314 #endif
315 315
316 class Trans16x16TestBase { 316 class Trans16x16TestBase {
317 public: 317 public:
318 virtual ~Trans16x16TestBase() {} 318 virtual ~Trans16x16TestBase() {}
319 319
320 protected: 320 protected:
321 virtual void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) = 0; 321 virtual void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) = 0;
322 322
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 for (int j = 0; j < kNumCoeffs; ++j) { 436 for (int j = 0; j < kNumCoeffs; ++j) {
437 EXPECT_EQ(output_block[j], output_ref_block[j]); 437 EXPECT_EQ(output_block[j], output_ref_block[j]);
438 EXPECT_GE(4 * DCT_MAX_VALUE << (bit_depth_ - 8), abs(output_block[j])) 438 EXPECT_GE(4 * DCT_MAX_VALUE << (bit_depth_ - 8), abs(output_block[j]))
439 << "Error: 16x16 FDCT has coefficient larger than 4*DCT_MAX_VALUE"; 439 << "Error: 16x16 FDCT has coefficient larger than 4*DCT_MAX_VALUE";
440 } 440 }
441 } 441 }
442 } 442 }
443 443
444 void RunQuantCheck(int dc_thred, int ac_thred) { 444 void RunQuantCheck(int dc_thred, int ac_thred) {
445 ACMRandom rnd(ACMRandom::DeterministicSeed()); 445 ACMRandom rnd(ACMRandom::DeterministicSeed());
446 const int count_test_block = 1000; 446 const int count_test_block = 100000;
447 DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs); 447 DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
448 DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs); 448 DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs);
449 DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs); 449 DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
450 450
451 DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs); 451 DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
452 DECLARE_ALIGNED_ARRAY(16, uint8_t, ref, kNumCoeffs); 452 DECLARE_ALIGNED_ARRAY(16, uint8_t, ref, kNumCoeffs);
453 #if CONFIG_VP9_HIGHBITDEPTH 453 #if CONFIG_VP9_HIGHBITDEPTH
454 DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs); 454 DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
455 DECLARE_ALIGNED_ARRAY(16, uint16_t, ref16, kNumCoeffs); 455 DECLARE_ALIGNED_ARRAY(16, uint16_t, ref16, kNumCoeffs);
456 #endif 456 #endif
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 RunCoeffCheck(); 693 RunCoeffCheck();
694 } 694 }
695 695
696 TEST_P(Trans16x16HT, MemCheck) { 696 TEST_P(Trans16x16HT, MemCheck) {
697 RunMemCheck(); 697 RunMemCheck();
698 } 698 }
699 699
700 TEST_P(Trans16x16HT, QuantCheck) { 700 TEST_P(Trans16x16HT, QuantCheck) {
701 // The encoder skips any non-DC intra prediction modes, 701 // The encoder skips any non-DC intra prediction modes,
702 // when the quantization step size goes beyond 988. 702 // when the quantization step size goes beyond 988.
703 RunQuantCheck(549, 988); 703 RunQuantCheck(429, 729);
704 } 704 }
705 705
706 using std::tr1::make_tuple; 706 using std::tr1::make_tuple;
707 707
708 #if CONFIG_VP9_HIGHBITDEPTH 708 #if CONFIG_VP9_HIGHBITDEPTH
709 INSTANTIATE_TEST_CASE_P( 709 INSTANTIATE_TEST_CASE_P(
710 C, Trans16x16DCT, 710 C, Trans16x16DCT,
711 ::testing::Values( 711 ::testing::Values(
712 make_tuple(&vp9_high_fdct16x16_c, &idct16x16_10, 0, VPX_BITS_10), 712 make_tuple(&vp9_highbd_fdct16x16_c, &idct16x16_10, 0, VPX_BITS_10),
713 make_tuple(&vp9_high_fdct16x16_c, &idct16x16_12, 0, VPX_BITS_12), 713 make_tuple(&vp9_highbd_fdct16x16_c, &idct16x16_12, 0, VPX_BITS_12),
714 make_tuple(&vp9_fdct16x16_c, &vp9_idct16x16_256_add_c, 0, VPX_BITS_8))); 714 make_tuple(&vp9_fdct16x16_c, &vp9_idct16x16_256_add_c, 0, VPX_BITS_8)));
715 #else 715 #else
716 INSTANTIATE_TEST_CASE_P( 716 INSTANTIATE_TEST_CASE_P(
717 C, Trans16x16DCT, 717 C, Trans16x16DCT,
718 ::testing::Values( 718 ::testing::Values(
719 make_tuple(&vp9_fdct16x16_c, &vp9_idct16x16_256_add_c, 0, VPX_BITS_8))); 719 make_tuple(&vp9_fdct16x16_c, &vp9_idct16x16_256_add_c, 0, VPX_BITS_8)));
720 #endif 720 #endif
721 721
722 #if CONFIG_VP9_HIGHBITDEPTH 722 #if CONFIG_VP9_HIGHBITDEPTH
723 INSTANTIATE_TEST_CASE_P( 723 INSTANTIATE_TEST_CASE_P(
724 C, Trans16x16HT, 724 C, Trans16x16HT,
725 ::testing::Values( 725 ::testing::Values(
726 make_tuple(&vp9_high_fht16x16_c, &iht16x16_10, 0, VPX_BITS_10), 726 make_tuple(&vp9_highbd_fht16x16_c, &iht16x16_10, 0, VPX_BITS_10),
727 make_tuple(&vp9_high_fht16x16_c, &iht16x16_10, 1, VPX_BITS_10), 727 make_tuple(&vp9_highbd_fht16x16_c, &iht16x16_10, 1, VPX_BITS_10),
728 make_tuple(&vp9_high_fht16x16_c, &iht16x16_10, 2, VPX_BITS_10), 728 make_tuple(&vp9_highbd_fht16x16_c, &iht16x16_10, 2, VPX_BITS_10),
729 make_tuple(&vp9_high_fht16x16_c, &iht16x16_10, 3, VPX_BITS_10), 729 make_tuple(&vp9_highbd_fht16x16_c, &iht16x16_10, 3, VPX_BITS_10),
730 make_tuple(&vp9_high_fht16x16_c, &iht16x16_12, 0, VPX_BITS_12), 730 make_tuple(&vp9_highbd_fht16x16_c, &iht16x16_12, 0, VPX_BITS_12),
731 make_tuple(&vp9_high_fht16x16_c, &iht16x16_12, 1, VPX_BITS_12), 731 make_tuple(&vp9_highbd_fht16x16_c, &iht16x16_12, 1, VPX_BITS_12),
732 make_tuple(&vp9_high_fht16x16_c, &iht16x16_12, 2, VPX_BITS_12), 732 make_tuple(&vp9_highbd_fht16x16_c, &iht16x16_12, 2, VPX_BITS_12),
733 make_tuple(&vp9_high_fht16x16_c, &iht16x16_12, 3, VPX_BITS_12), 733 make_tuple(&vp9_highbd_fht16x16_c, &iht16x16_12, 3, VPX_BITS_12),
734 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 0, VPX_BITS_8), 734 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 0, VPX_BITS_8),
735 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 1, VPX_BITS_8), 735 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 1, VPX_BITS_8),
736 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 2, VPX_BITS_8), 736 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 2, VPX_BITS_8),
737 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 3, VPX_BITS_8))); 737 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 3, VPX_BITS_8)));
738 #else 738 #else
739 INSTANTIATE_TEST_CASE_P( 739 INSTANTIATE_TEST_CASE_P(
740 C, Trans16x16HT, 740 C, Trans16x16HT,
741 ::testing::Values( 741 ::testing::Values(
742 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 0, VPX_BITS_8), 742 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 0, VPX_BITS_8),
743 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 1, VPX_BITS_8), 743 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 1, VPX_BITS_8),
744 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 2, VPX_BITS_8), 744 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 2, VPX_BITS_8),
745 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 3, VPX_BITS_8))); 745 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 3, VPX_BITS_8)));
746 #endif 746 #endif
747 747
748 #if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH 748 #if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
749 INSTANTIATE_TEST_CASE_P( 749 INSTANTIATE_TEST_CASE_P(
750 NEON, Trans16x16DCT, 750 NEON, Trans16x16DCT,
751 ::testing::Values( 751 ::testing::Values(
752 make_tuple(&vp9_fdct16x16_c, 752 make_tuple(&vp9_fdct16x16_c,
753 &vp9_idct16x16_256_add_neon, 0, VPX_BITS_8))); 753 &vp9_idct16x16_256_add_neon, 0, VPX_BITS_8)));
754 #endif 754 #endif
755 755
756 #if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH 756 #if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
757 INSTANTIATE_TEST_CASE_P( 757 INSTANTIATE_TEST_CASE_P(
758 SSE2, Trans16x16DCT, 758 SSE2, Trans16x16DCT,
759 ::testing::Values( 759 ::testing::Values(
760 make_tuple(&vp9_fdct16x16_sse2, 760 make_tuple(&vp9_fdct16x16_sse2,
761 &vp9_idct16x16_256_add_sse2, 0, VPX_BITS_8))); 761 &vp9_idct16x16_256_add_sse2, 0, VPX_BITS_8)));
762 INSTANTIATE_TEST_CASE_P( 762 INSTANTIATE_TEST_CASE_P(
763 SSE2, Trans16x16HT, 763 SSE2, Trans16x16HT,
764 ::testing::Values( 764 ::testing::Values(
765 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 0, 765 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 0,
766 VPX_BITS_8), 766 VPX_BITS_8),
767 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 1, 767 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 1,
768 VPX_BITS_8), 768 VPX_BITS_8),
769 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 2, 769 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 2,
770 VPX_BITS_8), 770 VPX_BITS_8),
771 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 3, 771 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 3,
772 VPX_BITS_8))); 772 VPX_BITS_8)));
773 #endif 773 #endif
774 774
775 #if HAVE_SSSE3 && !CONFIG_VP9_HIGHBITDEPTH 775 #if HAVE_SSSE3 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
776 INSTANTIATE_TEST_CASE_P( 776 INSTANTIATE_TEST_CASE_P(
777 SSSE3, Trans16x16DCT, 777 SSSE3, Trans16x16DCT,
778 ::testing::Values( 778 ::testing::Values(
779 make_tuple(&vp9_fdct16x16_c, &vp9_idct16x16_256_add_ssse3, 0, 779 make_tuple(&vp9_fdct16x16_c, &vp9_idct16x16_256_add_ssse3, 0,
780 VPX_BITS_8))); 780 VPX_BITS_8)));
781 #endif 781 #endif
782 } // namespace 782 } // namespace
OLDNEW
« no previous file with comments | « source/libvpx/test/convolve_test.cc ('k') | source/libvpx/test/dct32x32_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698