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

Unified Diff: source/libvpx/test/convolve_test.cc

Issue 341293003: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/libs.mk ('k') | source/libvpx/test/dct16x16_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/test/convolve_test.cc
===================================================================
--- source/libvpx/test/convolve_test.cc (revision 278778)
+++ source/libvpx/test/convolve_test.cc (working copy)
@@ -221,8 +221,12 @@
}
::libvpx_test::ACMRandom prng;
- for (int i = 0; i < kInputBufferSize; ++i)
- input_[i] = prng.Rand8Extremes();
+ for (int i = 0; i < kInputBufferSize; ++i) {
+ if (i & 1)
+ input_[i] = 255;
+ else
+ input_[i] = prng.Rand8Extremes();
+ }
}
void SetConstantInput(int value) {
@@ -341,6 +345,9 @@
for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
const InterpKernel *filters =
vp9_get_interp_kernel(static_cast<INTERP_FILTER>(filter_bank));
+ const InterpKernel *const eighttap_smooth =
+ vp9_get_interp_kernel(EIGHTTAP_SMOOTH);
+
for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
filter_block2d_8_c(in, kInputStride,
@@ -348,7 +355,7 @@
ref, kOutputStride,
Width(), Height());
- if (filters == vp9_sub_pel_filters_8lp || (filter_x && filter_y))
+ if (filters == eighttap_smooth || (filter_x && filter_y))
REGISTER_STATE_CHECK(
UUT_->hv8_(in, kInputStride, out, kOutputStride,
filters[filter_x], 16, filters[filter_y], 16,
@@ -396,6 +403,8 @@
for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
const InterpKernel *filters =
vp9_get_interp_kernel(static_cast<INTERP_FILTER>(filter_bank));
+ const InterpKernel *const eighttap_smooth =
+ vp9_get_interp_kernel(EIGHTTAP_SMOOTH);
for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
@@ -404,7 +413,7 @@
ref, kOutputStride,
Width(), Height());
- if (filters == vp9_sub_pel_filters_8lp || (filter_x && filter_y))
+ if (filters == eighttap_smooth || (filter_x && filter_y))
REGISTER_STATE_CHECK(
UUT_->hv8_avg_(in, kInputStride, out, kOutputStride,
filters[filter_x], 16, filters[filter_y], 16,
@@ -544,6 +553,7 @@
TEST_P(ConvolveTest, CheckScalingFiltering) {
uint8_t* const in = input();
uint8_t* const out = output();
+ const InterpKernel *const eighttap = vp9_get_interp_kernel(EIGHTTAP);
SetConstantInput(127);
@@ -551,8 +561,8 @@
for (int step = 1; step <= 32; ++step) {
/* Test the horizontal and vertical filters in combination. */
REGISTER_STATE_CHECK(UUT_->hv8_(in, kInputStride, out, kOutputStride,
- vp9_sub_pel_filters_8[frac], step,
- vp9_sub_pel_filters_8[frac], step,
+ eighttap[frac], step,
+ eighttap[frac], step,
Width(), Height()));
CheckGuardBlocks();
@@ -634,6 +644,50 @@
make_tuple(64, 64, &convolve8_ssse3)));
#endif
+#if HAVE_AVX2
+// TODO(jzern): these prototypes can be removed after the avx2 versions are
+// reenabled in vp9_rtcd_defs.pl.
+extern "C" {
+void vp9_convolve8_vert_avx2(const uint8_t *src, ptrdiff_t src_stride,
+ uint8_t *dst, ptrdiff_t dst_stride,
+ const int16_t *filter_x, int x_step_q4,
+ const int16_t *filter_y, int y_step_q4,
+ int w, int h);
+void vp9_convolve8_horiz_avx2(const uint8_t *src, ptrdiff_t src_stride,
+ uint8_t *dst, ptrdiff_t dst_stride,
+ const int16_t *filter_x, int x_step_q4,
+ const int16_t *filter_y, int y_step_q4,
+ int w, int h);
+void vp9_convolve8_avx2(const uint8_t *src, ptrdiff_t src_stride,
+ uint8_t *dst, ptrdiff_t dst_stride,
+ const int16_t *filter_x, int x_step_q4,
+ const int16_t *filter_y, int y_step_q4,
+ int w, int h);
+}
+
+const ConvolveFunctions convolve8_avx2(
+ vp9_convolve8_horiz_avx2, vp9_convolve8_avg_horiz_ssse3,
+ vp9_convolve8_vert_avx2, vp9_convolve8_avg_vert_ssse3,
+ vp9_convolve8_avx2, vp9_convolve8_avg_ssse3);
+
+INSTANTIATE_TEST_CASE_P(AVX2, ConvolveTest, ::testing::Values(
+ make_tuple(4, 4, &convolve8_avx2),
+ make_tuple(8, 4, &convolve8_avx2),
+ make_tuple(4, 8, &convolve8_avx2),
+ make_tuple(8, 8, &convolve8_avx2),
+ make_tuple(8, 16, &convolve8_avx2)));
+
+INSTANTIATE_TEST_CASE_P(DISABLED_AVX2, ConvolveTest, ::testing::Values(
+ make_tuple(16, 8, &convolve8_avx2),
+ make_tuple(16, 16, &convolve8_avx2),
+ make_tuple(32, 16, &convolve8_avx2),
+ make_tuple(16, 32, &convolve8_avx2),
+ make_tuple(32, 32, &convolve8_avx2),
+ make_tuple(64, 32, &convolve8_avx2),
+ make_tuple(32, 64, &convolve8_avx2),
+ make_tuple(64, 64, &convolve8_avx2)));
+#endif
+
#if HAVE_NEON_ASM
const ConvolveFunctions convolve8_neon(
vp9_convolve8_horiz_neon, vp9_convolve8_avg_horiz_neon,
« no previous file with comments | « source/libvpx/libs.mk ('k') | source/libvpx/test/dct16x16_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698