[x265] [PATCH 2 of 3] SEA motion search:Add testbench for integralv functions
vignesh at multicorewareinc.com
vignesh at multicorewareinc.com
Tue May 2 11:46:16 CEST 2017
# HG changeset patch
# User Vignesh Vijayakumar
# Date 1493358749 -19800
# Fri Apr 28 11:22:29 2017 +0530
# Node ID 1afc127e62b4502c8f052ee989843c64b45ffc56
# Parent cb67dffd0e2a596c8d3c6d042b8e6c532487d427
SEA motion search:Add testbench for integralv functions
diff -r cb67dffd0e2a -r 1afc127e62b4 source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp Tue May 02 09:58:13 2017 +0530
+++ b/source/test/pixelharness.cpp Fri Apr 28 11:22:29 2017 +0530
@@ -2003,6 +2003,228 @@
return true;
}
+bool PixelHarness::check_integral_init4v(integral4v_t ref, integral4v_t opt)
+{
+ intptr_t srcStep = 64;
+ int j = 0;
+ uint32_t sum_ans[BUFFSIZE] = { 0 };
+ uint32_t sum_ans1[BUFFSIZE] = { 0 };
+
+ for (int i = 0; i < 64; i++)
+ {
+ sum_ans[i] = pixel_test_buff[0][i];
+ sum_ans1[i] = pixel_test_buff[0][i];
+ }
+ for (int i = 0, k = 0; i < BUFFSIZE; i++)
+ {
+ if (i % 64 == 0)
+ k++;
+ sum_ans[i] = sum_ans[i % 64] + k;
+ sum_ans1[i] = sum_ans1[i % 64] + k;
+ }
+ int padx = 4;
+ int pady = 4;
+ uint32_t *sum_ans_ptr = sum_ans + srcStep * pady + padx;
+ uint32_t *sum_ans1_ptr = sum_ans1 + srcStep * pady + padx;
+ for (int i = 0; i < ITERS; i++)
+ {
+ ref(sum_ans_ptr, srcStep);
+ checked(opt, sum_ans1_ptr, srcStep);
+
+ if (memcmp(sum_ans, sum_ans1, sizeof(uint32_t) * BUFFSIZE))
+ return false;
+
+ reportfail()
+ j += INCR;
+ }
+ return true;
+}
+
+bool PixelHarness::check_integral_init8v(integral8v_t ref, integral8v_t opt)
+ {
+ intptr_t srcStep = 64;
+ int j = 0;
+ uint32_t sum_ans[BUFFSIZE] = { 0 };
+ uint32_t sum_ans1[BUFFSIZE] = { 0 };
+
+ for (int i = 0; i < 64; i++)
+ {
+ sum_ans[i] = pixel_test_buff[0][i];
+ sum_ans1[i] = pixel_test_buff[0][i];
+ }
+ for (int i = 0, k = 0; i < BUFFSIZE; i++)
+ {
+ if (i % 64 == 0)
+ k++;
+ sum_ans[i] = sum_ans[i % 64] + k;
+ sum_ans1[i] = sum_ans1[i % 64] + k;
+ }
+ int padx = 4;
+ int pady = 4;
+ uint32_t *sum_ans_ptr = sum_ans + srcStep * pady + padx;
+ uint32_t *sum_ans1_ptr = sum_ans1 + srcStep * pady + padx;
+ for (int i = 0; i < ITERS; i++)
+ {
+ ref(sum_ans_ptr, srcStep);
+ checked(opt, sum_ans1_ptr, srcStep);
+
+ if (memcmp(sum_ans, sum_ans1, sizeof(uint32_t) * BUFFSIZE))
+ return false;
+
+ reportfail()
+ j += INCR;
+ }
+ return true;
+}
+
+bool PixelHarness::check_integral_init12v(integral12v_t ref, integral12v_t opt)
+ {
+ intptr_t srcStep = 64;
+ int j = 0;
+ uint32_t sum_ans[BUFFSIZE] = { 0 };
+ uint32_t sum_ans1[BUFFSIZE] = { 0 };
+
+ for (int i = 0; i < 64; i++)
+ {
+ sum_ans[i] = pixel_test_buff[0][i];
+ sum_ans1[i] = pixel_test_buff[0][i];
+ }
+ for (int i = 0, k = 0; i < BUFFSIZE; i++)
+ {
+ if (i % 64 == 0)
+ k++;
+ sum_ans[i] = sum_ans[i % 64] + k;
+ sum_ans1[i] = sum_ans1[i % 64] + k;
+ }
+ int padx = 4;
+ int pady = 4;
+ uint32_t *sum_ans_ptr = sum_ans + srcStep * pady + padx;
+ uint32_t *sum_ans1_ptr = sum_ans1 + srcStep * pady + padx;
+ for (int i = 0; i < ITERS; i++)
+ {
+ ref(sum_ans_ptr, srcStep);
+ checked(opt, sum_ans1_ptr, srcStep);
+
+ if (memcmp(sum_ans, sum_ans1, sizeof(uint32_t) * BUFFSIZE))
+ return false;
+
+ reportfail()
+ j += INCR;
+ }
+ return true;
+}
+
+bool PixelHarness::check_integral_init16v(integral16v_t ref, integral16v_t opt)
+{
+ intptr_t srcStep = 64;
+ int j = 0;
+ uint32_t sum_ans[BUFFSIZE] = { 0 };
+ uint32_t sum_ans1[BUFFSIZE] = { 0 };
+
+ for (int i = 0; i < 64; i++)
+ {
+ sum_ans[i] = pixel_test_buff[0][i];
+ sum_ans1[i] = pixel_test_buff[0][i];
+ }
+ for (int i = 0, k = 0; i < BUFFSIZE; i++)
+ {
+ if (i % 64 == 0)
+ k++;
+ sum_ans[i] = sum_ans[i % 64] + k;
+ sum_ans1[i] = sum_ans1[i % 64] + k;
+ }
+ int padx = 4;
+ int pady = 4;
+ uint32_t *sum_ans_ptr = sum_ans + srcStep * pady + padx;
+ uint32_t *sum_ans1_ptr = sum_ans1 + srcStep * pady + padx;
+ for (int i = 0; i < ITERS; i++)
+ {
+ ref(sum_ans_ptr, srcStep);
+ checked(opt, sum_ans1_ptr, srcStep);
+
+ if (memcmp(sum_ans, sum_ans1, sizeof(uint32_t) * BUFFSIZE))
+ return false;
+
+ reportfail()
+ j += INCR;
+ }
+ return true;
+}
+
+bool PixelHarness::check_integral_init24v(integral24v_t ref, integral24v_t opt)
+{
+ intptr_t srcStep = 64;
+ int j = 0;
+ uint32_t sum_ans[BUFFSIZE] = { 0 };
+ uint32_t sum_ans1[BUFFSIZE] = { 0 };
+
+ for (int i = 0; i < 64; i++)
+ {
+ sum_ans[i] = pixel_test_buff[0][i];
+ sum_ans1[i] = pixel_test_buff[0][i];
+ }
+ for (int i = 0, k = 0; i < BUFFSIZE; i++)
+ {
+ if (i % 64 == 0)
+ k++;
+ sum_ans[i] = sum_ans[i % 64] + k;
+ sum_ans1[i] = sum_ans1[i % 64] + k;
+ }
+ int padx = 4;
+ int pady = 4;
+ uint32_t *sum_ans_ptr = sum_ans + srcStep * pady + padx;
+ uint32_t *sum_ans1_ptr = sum_ans1 + srcStep * pady + padx;
+ for (int i = 0; i < ITERS; i++)
+ {
+ ref(sum_ans_ptr, srcStep);
+ checked(opt, sum_ans1_ptr, srcStep);
+
+ if (memcmp(sum_ans, sum_ans1, sizeof(uint32_t) * BUFFSIZE))
+ return false;
+
+ reportfail()
+ j += INCR;
+ }
+ return true;
+}
+
+bool PixelHarness::check_integral_init32v(integral32v_t ref, integral32v_t opt)
+{
+ intptr_t srcStep = 64;
+ int j = 0;
+ uint32_t sum_ans[BUFFSIZE] = { 0 };
+ uint32_t sum_ans1[BUFFSIZE] = { 0 };
+
+ for (int i = 0; i < 64; i++)
+ {
+ sum_ans[i] = pixel_test_buff[0][i];
+ sum_ans1[i] = pixel_test_buff[0][i];
+ }
+ for (int i = 0, k = 0; i < BUFFSIZE; i++)
+ {
+ if (i % 64 == 0)
+ k++;
+ sum_ans[i] = sum_ans[i % 64] + k;
+ sum_ans1[i] = sum_ans1[i % 64] + k;
+ }
+ int padx = 4;
+ int pady = 4;
+ uint32_t *sum_ans_ptr = sum_ans + srcStep * pady + padx;
+ uint32_t *sum_ans1_ptr = sum_ans1 + srcStep * pady + padx;
+ for (int i = 0; i < ITERS; i++)
+ {
+ ref(sum_ans_ptr, srcStep);
+ checked(opt, sum_ans1_ptr, srcStep);
+
+ if (memcmp(sum_ans, sum_ans1, sizeof(uint32_t) * BUFFSIZE))
+ return false;
+
+ reportfail()
+ j += INCR;
+ }
+ return true;
+}
+
bool PixelHarness::testPU(int part, const EncoderPrimitives& ref, const EncoderPrimitives& opt)
{
if (opt.pu[part].satd)
@@ -2688,6 +2910,59 @@
}
}
+ if (opt.integral_init4v)
+ {
+ if (!check_integral_init4v(ref.integral_init4v, opt.integral_init4v))
+ {
+ printf("Integral4v failed!\n");
+ return false;
+ }
+ }
+
+ if (opt.integral_init8v)
+ {
+ if (!check_integral_init8v(ref.integral_init8v, opt.integral_init8v))
+ {
+ printf("Integral8v failed!\n");
+ return false;
+ }
+ }
+
+ if (opt.integral_init12v)
+ {
+ if (!check_integral_init12v(ref.integral_init12v, opt.integral_init12v))
+ {
+ printf("Integral12v failed!\n");
+ return false;
+ }
+ }
+
+ if (opt.integral_init16v)
+ {
+ if (!check_integral_init16v(ref.integral_init16v, opt.integral_init16v))
+ {
+ printf("Integral16v failed!\n");
+ return false;
+ }
+ }
+
+ if (opt.integral_init24v)
+ {
+ if (!check_integral_init24v(ref.integral_init24v, opt.integral_init24v))
+ {
+ printf("Integral24v failed!\n");
+ return false;
+ }
+ }
+
+ if (opt.integral_init32v)
+ {
+ if (!check_integral_init32v(ref.integral_init32v, opt.integral_init32v))
+ {
+ printf("Integral32v failed!\n");
+ return false;
+ }
+ }
return true;
}
@@ -3210,4 +3485,40 @@
HEADER0("pelFilterChroma_Horizontal");
REPORT_SPEEDUP(opt.pelFilterChroma[1], ref.pelFilterChroma[1], pbuf1, 1, STRIDE, tc, maskP, maskQ);
}
+
+ if (opt.integral_init4v)
+ {
+ HEADER0("integral_init4v");
+ REPORT_SPEEDUP(opt.integral_init4v, ref.integral_init4v, (uint32_t*)pbuf1, STRIDE);
+ }
+
+ if (opt.integral_init8v)
+ {
+ HEADER0("integral_init8v");
+ REPORT_SPEEDUP(opt.integral_init8v, ref.integral_init8v, (uint32_t*)pbuf1, STRIDE);
+ }
+
+ if (opt.integral_init12v)
+ {
+ HEADER0("integral_init12v");
+ REPORT_SPEEDUP(opt.integral_init12v, ref.integral_init12v, (uint32_t*)pbuf1, STRIDE);
+ }
+
+ if (opt.integral_init16v)
+ {
+ HEADER0("integral_init16v");
+ REPORT_SPEEDUP(opt.integral_init16v, ref.integral_init16v, (uint32_t*)pbuf1, STRIDE);
+ }
+
+ if (opt.integral_init24v)
+ {
+ HEADER0("integral_init24v");
+ REPORT_SPEEDUP(opt.integral_init24v, ref.integral_init24v, (uint32_t*)pbuf1, STRIDE);
+ }
+
+ if (opt.integral_init32v)
+ {
+ HEADER0("integral_init32v");
+ REPORT_SPEEDUP(opt.integral_init32v, ref.integral_init32v, (uint32_t*)pbuf1, STRIDE);
+ }
}
diff -r cb67dffd0e2a -r 1afc127e62b4 source/test/pixelharness.h
--- a/source/test/pixelharness.h Tue May 02 09:58:13 2017 +0530
+++ b/source/test/pixelharness.h Fri Apr 28 11:22:29 2017 +0530
@@ -126,6 +126,12 @@
bool check_pelFilterLumaStrong_H(pelFilterLumaStrong_t ref, pelFilterLumaStrong_t opt);
bool check_pelFilterChroma_V(pelFilterChroma_t ref, pelFilterChroma_t opt);
bool check_pelFilterChroma_H(pelFilterChroma_t ref, pelFilterChroma_t opt);
+ bool check_integral_init4v(integral4v_t ref, integral4v_t opt);
+ bool check_integral_init8v(integral8v_t ref, integral8v_t opt);
+ bool check_integral_init12v(integral12v_t ref, integral12v_t opt);
+ bool check_integral_init16v(integral16v_t ref, integral16v_t opt);
+ bool check_integral_init24v(integral24v_t ref, integral24v_t opt);
+ bool check_integral_init32v(integral32v_t ref, integral32v_t opt);
public:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x265-2.patch
Type: text/x-patch
Size: 10272 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20170502/e95cf89a/attachment.bin>
More information about the x265-devel
mailing list