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

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

Issue 478033002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 4 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/tools_common.sh ('k') | source/libvpx/test/video_source.h » ('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 #include <stdlib.h> 10 #include <stdlib.h>
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 virtual void SetUp() { 83 virtual void SetUp() {
84 const tuple<int, int, VarianceFunctionType>& params = this->GetParam(); 84 const tuple<int, int, VarianceFunctionType>& params = this->GetParam();
85 log2width_ = get<0>(params); 85 log2width_ = get<0>(params);
86 width_ = 1 << log2width_; 86 width_ = 1 << log2width_;
87 log2height_ = get<1>(params); 87 log2height_ = get<1>(params);
88 height_ = 1 << log2height_; 88 height_ = 1 << log2height_;
89 variance_ = get<2>(params); 89 variance_ = get<2>(params);
90 90
91 rnd(ACMRandom::DeterministicSeed()); 91 rnd(ACMRandom::DeterministicSeed());
92 block_size_ = width_ * height_; 92 block_size_ = width_ * height_;
93 src_ = new uint8_t[block_size_]; 93 src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_));
94 ref_ = new uint8_t[block_size_]; 94 ref_ = new uint8_t[block_size_];
95 ASSERT_TRUE(src_ != NULL); 95 ASSERT_TRUE(src_ != NULL);
96 ASSERT_TRUE(ref_ != NULL); 96 ASSERT_TRUE(ref_ != NULL);
97 } 97 }
98 98
99 virtual void TearDown() { 99 virtual void TearDown() {
100 delete[] src_; 100 vpx_free(src_);
101 delete[] ref_; 101 delete[] ref_;
102 libvpx_test::ClearSystemState(); 102 libvpx_test::ClearSystemState();
103 } 103 }
104 104
105 protected: 105 protected:
106 void ZeroTest(); 106 void ZeroTest();
107 void RefTest(); 107 void RefTest();
108 void OneQuarterTest(); 108 void OneQuarterTest();
109 109
110 ACMRandom rnd; 110 ACMRandom rnd;
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 make_tuple(4, 5, subpel_avg_variance16x32_ssse3), 700 make_tuple(4, 5, subpel_avg_variance16x32_ssse3),
701 make_tuple(5, 4, subpel_avg_variance32x16_ssse3), 701 make_tuple(5, 4, subpel_avg_variance32x16_ssse3),
702 make_tuple(5, 5, subpel_avg_variance32x32_ssse3), 702 make_tuple(5, 5, subpel_avg_variance32x32_ssse3),
703 make_tuple(5, 6, subpel_avg_variance32x64_ssse3), 703 make_tuple(5, 6, subpel_avg_variance32x64_ssse3),
704 make_tuple(6, 5, subpel_avg_variance64x32_ssse3), 704 make_tuple(6, 5, subpel_avg_variance64x32_ssse3),
705 make_tuple(6, 6, subpel_avg_variance64x64_ssse3))); 705 make_tuple(6, 6, subpel_avg_variance64x64_ssse3)));
706 #endif 706 #endif
707 #endif 707 #endif
708 708
709 #if HAVE_AVX2 709 #if HAVE_AVX2
710 // TODO(jzern): these prototypes can be removed after the avx2 versions are 710
711 // reenabled in vp9_rtcd_defs.pl.
712 extern "C" {
713 unsigned int vp9_sub_pixel_variance32x32_avx2(
714 const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset,
715 const uint8_t *ref_ptr, int ref_stride, unsigned int *sse);
716 unsigned int vp9_sub_pixel_variance64x64_avx2(
717 const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset,
718 const uint8_t *ref_ptr, int ref_stride, unsigned int *sse);
719 unsigned int vp9_sub_pixel_avg_variance32x32_avx2(
720 const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset,
721 const uint8_t *ref_ptr, int ref_stride, unsigned int *sse,
722 const uint8_t *second_pred);
723 unsigned int vp9_sub_pixel_avg_variance64x64_avx2(
724 const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset,
725 const uint8_t *ref_ptr, int ref_stride, unsigned int *sse,
726 const uint8_t *second_pred);
727 }
728 const vp9_variance_fn_t variance16x16_avx2 = vp9_variance16x16_avx2; 711 const vp9_variance_fn_t variance16x16_avx2 = vp9_variance16x16_avx2;
729 const vp9_variance_fn_t variance32x16_avx2 = vp9_variance32x16_avx2; 712 const vp9_variance_fn_t variance32x16_avx2 = vp9_variance32x16_avx2;
730 const vp9_variance_fn_t variance32x32_avx2 = vp9_variance32x32_avx2; 713 const vp9_variance_fn_t variance32x32_avx2 = vp9_variance32x32_avx2;
731 const vp9_variance_fn_t variance64x32_avx2 = vp9_variance64x32_avx2; 714 const vp9_variance_fn_t variance64x32_avx2 = vp9_variance64x32_avx2;
732 const vp9_variance_fn_t variance64x64_avx2 = vp9_variance64x64_avx2; 715 const vp9_variance_fn_t variance64x64_avx2 = vp9_variance64x64_avx2;
733 INSTANTIATE_TEST_CASE_P( 716 INSTANTIATE_TEST_CASE_P(
734 AVX2, VP9VarianceTest, 717 AVX2, VP9VarianceTest,
735 ::testing::Values(make_tuple(4, 4, variance16x16_avx2), 718 ::testing::Values(make_tuple(4, 4, variance16x16_avx2),
736 make_tuple(5, 4, variance32x16_avx2), 719 make_tuple(5, 4, variance32x16_avx2),
737 make_tuple(5, 5, variance32x32_avx2), 720 make_tuple(5, 5, variance32x32_avx2),
738 make_tuple(6, 5, variance64x32_avx2), 721 make_tuple(6, 5, variance64x32_avx2),
739 make_tuple(6, 6, variance64x64_avx2))); 722 make_tuple(6, 6, variance64x64_avx2)));
740 723
741 const vp9_subpixvariance_fn_t subpel_variance32x32_avx2 = 724 const vp9_subpixvariance_fn_t subpel_variance32x32_avx2 =
742 vp9_sub_pixel_variance32x32_avx2; 725 vp9_sub_pixel_variance32x32_avx2;
743 const vp9_subpixvariance_fn_t subpel_variance64x64_avx2 = 726 const vp9_subpixvariance_fn_t subpel_variance64x64_avx2 =
744 vp9_sub_pixel_variance64x64_avx2; 727 vp9_sub_pixel_variance64x64_avx2;
745 INSTANTIATE_TEST_CASE_P( 728 INSTANTIATE_TEST_CASE_P(
746 DISABLED_AVX2, VP9SubpelVarianceTest, 729 AVX2, VP9SubpelVarianceTest,
747 ::testing::Values(make_tuple(5, 5, subpel_variance32x32_avx2), 730 ::testing::Values(make_tuple(5, 5, subpel_variance32x32_avx2),
748 make_tuple(6, 6, subpel_variance64x64_avx2))); 731 make_tuple(6, 6, subpel_variance64x64_avx2)));
749 732
750 const vp9_subp_avg_variance_fn_t subpel_avg_variance32x32_avx2 = 733 const vp9_subp_avg_variance_fn_t subpel_avg_variance32x32_avx2 =
751 vp9_sub_pixel_avg_variance32x32_avx2; 734 vp9_sub_pixel_avg_variance32x32_avx2;
752 const vp9_subp_avg_variance_fn_t subpel_avg_variance64x64_avx2 = 735 const vp9_subp_avg_variance_fn_t subpel_avg_variance64x64_avx2 =
753 vp9_sub_pixel_avg_variance64x64_avx2; 736 vp9_sub_pixel_avg_variance64x64_avx2;
754 INSTANTIATE_TEST_CASE_P( 737 INSTANTIATE_TEST_CASE_P(
755 DISABLED_AVX2, VP9SubpelAvgVarianceTest, 738 AVX2, VP9SubpelAvgVarianceTest,
756 ::testing::Values(make_tuple(5, 5, subpel_avg_variance32x32_avx2), 739 ::testing::Values(make_tuple(5, 5, subpel_avg_variance32x32_avx2),
757 make_tuple(6, 6, subpel_avg_variance64x64_avx2))); 740 make_tuple(6, 6, subpel_avg_variance64x64_avx2)));
758 #endif // HAVE_AVX2 741 #endif // HAVE_AVX2
742 #if HAVE_NEON
743 const vp9_variance_fn_t variance8x8_neon = vp9_variance8x8_neon;
744 const vp9_variance_fn_t variance16x16_neon = vp9_variance16x16_neon;
745 const vp9_variance_fn_t variance32x32_neon = vp9_variance32x32_neon;
746 INSTANTIATE_TEST_CASE_P(
747 NEON, VP9VarianceTest,
748 ::testing::Values(make_tuple(3, 3, variance8x8_neon),
749 make_tuple(4, 4, variance16x16_neon),
750 make_tuple(5, 5, variance32x32_neon)));
751
752 const vp9_subpixvariance_fn_t subpel_variance8x8_neon =
753 vp9_sub_pixel_variance8x8_neon;
754 const vp9_subpixvariance_fn_t subpel_variance16x16_neon =
755 vp9_sub_pixel_variance16x16_neon;
756 const vp9_subpixvariance_fn_t subpel_variance32x32_neon =
757 vp9_sub_pixel_variance32x32_neon;
758 INSTANTIATE_TEST_CASE_P(
759 NEON, VP9SubpelVarianceTest,
760 ::testing::Values(make_tuple(3, 3, subpel_variance8x8_neon),
761 make_tuple(4, 4, subpel_variance16x16_neon),
762 make_tuple(5, 5, subpel_variance32x32_neon)));
763 #endif // HAVE_NEON
759 #endif // CONFIG_VP9_ENCODER 764 #endif // CONFIG_VP9_ENCODER
760 765
761 } // namespace vp9 766 } // namespace vp9
762 767
763 } // namespace 768 } // namespace
OLDNEW
« no previous file with comments | « source/libvpx/test/tools_common.sh ('k') | source/libvpx/test/video_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698