<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif;color:#000000"><br></div><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername"></b> <span dir="ltr"><<a href="mailto:vignesh@multicorewareinc.com">vignesh@multicorewareinc.com</a>></span><br>Date: 2017-05-02 15:16 GMT+05:30<br>Subject: [x265] [PATCH 2 of 3] SEA motion search:Add testbench for integralv functions<br>To: <a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br><br><br># HG changeset patch<br>
# User Vignesh Vijayakumar<br>
# Date 1493358749 -19800<br>
# Fri Apr 28 11:22:29 2017 +0530<br>
# Node ID 1afc127e62b4502c8f052ee989843c<wbr>64b45ffc56<br>
# Parent cb67dffd0e2a596c8d3c6d042b8e6c<wbr>532487d427<br>
SEA motion search:Add testbench for integralv functions<br>
<br>
diff -r cb67dffd0e2a -r 1afc127e62b4 source/test/pixelharness.cpp<br>
--- a/source/test/pixelharness.cpp Tue May 02 09:58:13 2017 +0530<br>
+++ b/source/test/pixelharness.cpp Fri Apr 28 11:22:29 2017 +0530<br>
@@ -2003,6 +2003,228 @@<br>
return true;<br>
}<br>
<br>
+bool PixelHarness::check_integral_<wbr>init4v(integral4v_t ref, integral4v_t opt)<br>
+{<br>
+ intptr_t srcStep = 64;<br>
+ int j = 0;<br>
<div class="gmail_default" style="font-family:georgia,serif;color:rgb(0,0,0);display:inline">>></div>+ uint32_t sum_ans[BUFFSIZE] = { 0 };<br>
<div class="gmail_default" style="font-family:georgia,serif;color:rgb(0,0,0);display:inline">>></div>+ uint32_t sum_ans1[BUFFSIZE] = { 0 };</div><div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_default" style="font-family:georgia,serif;color:rgb(0,0,0)">Better names please, check existing naming conventions. </div></div><div class="gmail_quote"><br></div><div class="gmail_quote">
+<br>
+ for (int i = 0; i < 64; i++)<br>
+ {<br>
+ sum_ans[i] = pixel_test_buff[0][i];<br>
+ sum_ans1[i] = pixel_test_buff[0][i];<br>
+ }<br>
+ for (int i = 0, k = 0; i < BUFFSIZE; i++)<br>
+ {<br>
+ if (i % 64 == 0)<br>
+ k++;<br>
+ sum_ans[i] = sum_ans[i % 64] + k;<br>
+ sum_ans1[i] = sum_ans1[i % 64] + k;<br>
+ }<br>
+ int padx = 4;<br>
+ int pady = 4;<br>
+ uint32_t *sum_ans_ptr = sum_ans + srcStep * pady + padx;<br>
+ uint32_t *sum_ans1_ptr = sum_ans1 + srcStep * pady + padx;<br>
+ for (int i = 0; i < ITERS; i++)<br>
+ {<br>
+ ref(sum_ans_ptr, srcStep);<br>
+ checked(opt, sum_ans1_ptr, srcStep);<br>
+<br>
+ if (memcmp(sum_ans, sum_ans1, sizeof(uint32_t) * BUFFSIZE))<br>
+ return false;<br>
+<br>
+ reportfail()<br>
+ j += INCR;<br>
+ }<br>
+ return true;<br>
+}<br>
+<br>
+bool PixelHarness::check_integral_<wbr>init8v(integral8v_t ref, integral8v_t opt)<br>
+ {<br>
+ intptr_t srcStep = 64;<br>
+ int j = 0;<br>
+ uint32_t sum_ans[BUFFSIZE] = { 0 };<br>
+ uint32_t sum_ans1[BUFFSIZE] = { 0 };<br>
+<br>
+ for (int i = 0; i < 64; i++)<br>
+ {<br>
+ sum_ans[i] = pixel_test_buff[0][i];<br>
+ sum_ans1[i] = pixel_test_buff[0][i];<br>
+ }<br>
+ for (int i = 0, k = 0; i < BUFFSIZE; i++)<br>
+ {<br>
+ if (i % 64 == 0)<br>
+ k++;<br>
+ sum_ans[i] = sum_ans[i % 64] + k;<br>
+ sum_ans1[i] = sum_ans1[i % 64] + k;<br>
+ }<br>
+ int padx = 4;<br>
+ int pady = 4;<br>
+ uint32_t *sum_ans_ptr = sum_ans + srcStep * pady + padx;<br>
+ uint32_t *sum_ans1_ptr = sum_ans1 + srcStep * pady + padx;<br>
+ for (int i = 0; i < ITERS; i++)<br>
+ {<br>
+ ref(sum_ans_ptr, srcStep);<br>
+ checked(opt, sum_ans1_ptr, srcStep);<br>
+<br>
+ if (memcmp(sum_ans, sum_ans1, sizeof(uint32_t) * BUFFSIZE))<br>
+ return false;<br>
+<br>
+ reportfail()<br>
+ j += INCR;<br>
+ }<br>
+ return true;<br>
+}<br>
+<br>
+bool PixelHarness::check_integral_<wbr>init12v(integral12v_t ref, integral12v_t opt)<br>
+ {<br>
+ intptr_t srcStep = 64;<br>
+ int j = 0;<br>
+ uint32_t sum_ans[BUFFSIZE] = { 0 };<br>
+ uint32_t sum_ans1[BUFFSIZE] = { 0 };<br>
+<br>
+ for (int i = 0; i < 64; i++)<br>
+ {<br>
+ sum_ans[i] = pixel_test_buff[0][i];<br>
+ sum_ans1[i] = pixel_test_buff[0][i];<br>
+ }<br>
+ for (int i = 0, k = 0; i < BUFFSIZE; i++)<br>
+ {<br>
+ if (i % 64 == 0)<br>
+ k++;<br>
+ sum_ans[i] = sum_ans[i % 64] + k;<br>
+ sum_ans1[i] = sum_ans1[i % 64] + k;<br>
+ }<br>
+ int padx = 4;<br>
+ int pady = 4;<br>
+ uint32_t *sum_ans_ptr = sum_ans + srcStep * pady + padx;<br>
+ uint32_t *sum_ans1_ptr = sum_ans1 + srcStep * pady + padx;<br>
+ for (int i = 0; i < ITERS; i++)<br>
+ {<br>
+ ref(sum_ans_ptr, srcStep);<br>
+ checked(opt, sum_ans1_ptr, srcStep);<br>
+<br>
+ if (memcmp(sum_ans, sum_ans1, sizeof(uint32_t) * BUFFSIZE))<br>
+ return false;<br>
+<br>
+ reportfail()<br>
+ j += INCR;<br>
+ }<br>
+ return true;<br>
+}<br>
+<br>
+bool PixelHarness::check_integral_<wbr>init16v(integral16v_t ref, integral16v_t opt)<br>
+{<br>
+ intptr_t srcStep = 64;<br>
+ int j = 0;<br>
+ uint32_t sum_ans[BUFFSIZE] = { 0 };<br>
+ uint32_t sum_ans1[BUFFSIZE] = { 0 };<br>
+<br>
+ for (int i = 0; i < 64; i++)<br>
+ {<br>
+ sum_ans[i] = pixel_test_buff[0][i];<br>
+ sum_ans1[i] = pixel_test_buff[0][i];<br>
+ }<br>
+ for (int i = 0, k = 0; i < BUFFSIZE; i++)<br>
+ {<br>
+ if (i % 64 == 0)<br>
+ k++;<br>
+ sum_ans[i] = sum_ans[i % 64] + k;<br>
+ sum_ans1[i] = sum_ans1[i % 64] + k;<br>
+ }<br>
+ int padx = 4;<br>
+ int pady = 4;<br>
+ uint32_t *sum_ans_ptr = sum_ans + srcStep * pady + padx;<br>
+ uint32_t *sum_ans1_ptr = sum_ans1 + srcStep * pady + padx;<br>
+ for (int i = 0; i < ITERS; i++)<br>
+ {<br>
+ ref(sum_ans_ptr, srcStep);<br>
+ checked(opt, sum_ans1_ptr, srcStep);<br>
+<br>
+ if (memcmp(sum_ans, sum_ans1, sizeof(uint32_t) * BUFFSIZE))<br>
+ return false;<br>
+<br>
+ reportfail()<br>
+ j += INCR;<br>
+ }<br>
+ return true;<br>
+}<br>
+<br>
+bool PixelHarness::check_integral_<wbr>init24v(integral24v_t ref, integral24v_t opt)<br>
+{<br>
+ intptr_t srcStep = 64;<br>
+ int j = 0;<br>
+ uint32_t sum_ans[BUFFSIZE] = { 0 };<br>
+ uint32_t sum_ans1[BUFFSIZE] = { 0 };<br>
+<br>
+ for (int i = 0; i < 64; i++)<br>
+ {<br>
+ sum_ans[i] = pixel_test_buff[0][i];<br>
+ sum_ans1[i] = pixel_test_buff[0][i];<br>
+ }<br>
+ for (int i = 0, k = 0; i < BUFFSIZE; i++)<br>
+ {<br>
+ if (i % 64 == 0)<br>
+ k++;<br>
+ sum_ans[i] = sum_ans[i % 64] + k;<br>
+ sum_ans1[i] = sum_ans1[i % 64] + k;<br>
+ }<br>
+ int padx = 4;<br>
+ int pady = 4;<br>
+ uint32_t *sum_ans_ptr = sum_ans + srcStep * pady + padx;<br>
+ uint32_t *sum_ans1_ptr = sum_ans1 + srcStep * pady + padx;<br>
+ for (int i = 0; i < ITERS; i++)<br>
+ {<br>
+ ref(sum_ans_ptr, srcStep);<br>
+ checked(opt, sum_ans1_ptr, srcStep);<br>
+<br>
+ if (memcmp(sum_ans, sum_ans1, sizeof(uint32_t) * BUFFSIZE))<br>
+ return false;<br>
+<br>
+ reportfail()<br>
+ j += INCR;<br>
+ }<br>
+ return true;<br>
+}<br>
+<br>
+bool PixelHarness::check_integral_<wbr>init32v(integral32v_t ref, integral32v_t opt)<br>
+{<br>
+ intptr_t srcStep = 64;<br>
+ int j = 0;<br>
+ uint32_t sum_ans[BUFFSIZE] = { 0 };<br>
+ uint32_t sum_ans1[BUFFSIZE] = { 0 };<br>
+<br>
+ for (int i = 0; i < 64; i++)<br>
+ {<br>
+ sum_ans[i] = pixel_test_buff[0][i];<br>
+ sum_ans1[i] = pixel_test_buff[0][i];<br>
+ }<br>
+ for (int i = 0, k = 0; i < BUFFSIZE; i++)<br>
+ {<br>
+ if (i % 64 == 0)<br>
+ k++;<br>
+ sum_ans[i] = sum_ans[i % 64] + k;<br>
+ sum_ans1[i] = sum_ans1[i % 64] + k;<br>
+ }<br>
+ int padx = 4;<br>
+ int pady = 4;<br>
+ uint32_t *sum_ans_ptr = sum_ans + srcStep * pady + padx;<br>
+ uint32_t *sum_ans1_ptr = sum_ans1 + srcStep * pady + padx;<br>
+ for (int i = 0; i < ITERS; i++)<br>
+ {<br>
+ ref(sum_ans_ptr, srcStep);<br>
+ checked(opt, sum_ans1_ptr, srcStep);<br>
+<br>
+ if (memcmp(sum_ans, sum_ans1, sizeof(uint32_t) * BUFFSIZE))<br>
+ return false;<br>
+<br>
+ reportfail()<br>
+ j += INCR;<br>
+ }<br>
+ return true;<br>
+}<br>
+</div><div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_default" style="font-family:georgia,serif;color:rgb(0,0,0)">Two uint test codes can do the job (one for horizontal and another for vertial), use a width variable to implemet this.</div><br></div><div class="gmail_quote"><br>
bool PixelHarness::testPU(int part, const EncoderPrimitives& ref, const EncoderPrimitives& opt)<br>
{<br>
if (opt.pu[part].satd)<br>
@@ -2688,6 +2910,59 @@<br>
}<br>
}<br>
<br>
+ if (opt.integral_init4v)<br>
+ {<br>
+ if (!check_integral_init4v(ref.<wbr>integral_init4v, opt.integral_init4v))<br>
+ {<br>
+ printf("Integral4v failed!\n");<br>
+ return false;<br>
+ }<br>
+ }<br>
+<br>
+ if (opt.integral_init8v)<br>
+ {<br>
+ if (!check_integral_init8v(ref.<wbr>integral_init8v, opt.integral_init8v))<br>
+ {<br>
+ printf("Integral8v failed!\n");<br>
+ return false;<br>
+ }<br>
+ }<br>
+<br>
+ if (opt.integral_init12v)<br>
+ {<br>
+ if (!check_integral_init12v(ref.<wbr>integral_init12v, opt.integral_init12v))<br>
+ {<br>
+ printf("Integral12v failed!\n");<br>
+ return false;<br>
+ }<br>
+ }<br>
+<br>
+ if (opt.integral_init16v)<br>
+ {<br>
+ if (!check_integral_init16v(ref.<wbr>integral_init16v, opt.integral_init16v))<br>
+ {<br>
+ printf("Integral16v failed!\n");<br>
+ return false;<br>
+ }<br>
+ }<br>
+<br>
+ if (opt.integral_init24v)<br>
+ {<br>
+ if (!check_integral_init24v(ref.<wbr>integral_init24v, opt.integral_init24v))<br>
+ {<br>
+ printf("Integral24v failed!\n");<br>
+ return false;<br>
+ }<br>
+ }<br>
+<br>
+ if (opt.integral_init32v)<br>
+ {<br>
+ if (!check_integral_init32v(ref.<wbr>integral_init32v, opt.integral_init32v))<br>
+ {<br>
+ printf("Integral32v failed!\n");<br>
+ return false;<br>
+ }<br>
+ }<br>
return true;<br>
}<br>
<br>
@@ -3210,4 +3485,40 @@<br>
HEADER0("pelFilterChroma_<wbr>Horizontal");<br>
REPORT_SPEEDUP(opt.<wbr>pelFilterChroma[1], ref.pelFilterChroma[1], pbuf1, 1, STRIDE, tc, maskP, maskQ);<br>
}<br>
+<br>
+ if (opt.integral_init4v)<br>
+ {<br>
+ HEADER0("integral_init4v");<br>
+ REPORT_SPEEDUP(opt.integral_<wbr>init4v, ref.integral_init4v, (uint32_t*)pbuf1, STRIDE);<br>
+ }<br>
+<br>
+ if (opt.integral_init8v)<br>
+ {<br>
+ HEADER0("integral_init8v");<br>
+ REPORT_SPEEDUP(opt.integral_<wbr>init8v, ref.integral_init8v, (uint32_t*)pbuf1, STRIDE);<br>
+ }<br>
+<br>
+ if (opt.integral_init12v)<br>
+ {<br>
+ HEADER0("integral_init12v");<br>
+ REPORT_SPEEDUP(opt.integral_<wbr>init12v, ref.integral_init12v, (uint32_t*)pbuf1, STRIDE);<br>
+ }<br>
+<br>
+ if (opt.integral_init16v)<br>
+ {<br>
+ HEADER0("integral_init16v");<br>
+ REPORT_SPEEDUP(opt.integral_<wbr>init16v, ref.integral_init16v, (uint32_t*)pbuf1, STRIDE);<br>
+ }<br>
+<br>
+ if (opt.integral_init24v)<br>
+ {<br>
+ HEADER0("integral_init24v");<br>
+ REPORT_SPEEDUP(opt.integral_<wbr>init24v, ref.integral_init24v, (uint32_t*)pbuf1, STRIDE);<br>
+ }<br>
+<br>
+ if (opt.integral_init32v)<br>
+ {<br>
+ HEADER0("integral_init32v");<br>
+ REPORT_SPEEDUP(opt.integral_<wbr>init32v, ref.integral_init32v, (uint32_t*)pbuf1, STRIDE);<br>
+ }<br>
}<br>
diff -r cb67dffd0e2a -r 1afc127e62b4 source/test/pixelharness.h<br>
--- a/source/test/pixelharness.h Tue May 02 09:58:13 2017 +0530<br>
+++ b/source/test/pixelharness.h Fri Apr 28 11:22:29 2017 +0530<br>
@@ -126,6 +126,12 @@<br>
bool check_pelFilterLumaStrong_H(<wbr>pelFilterLumaStrong_t ref, pelFilterLumaStrong_t opt);<br>
bool check_pelFilterChroma_V(<wbr>pelFilterChroma_t ref, pelFilterChroma_t opt);<br>
bool check_pelFilterChroma_H(<wbr>pelFilterChroma_t ref, pelFilterChroma_t opt);<br>
+ bool check_integral_init4v(<wbr>integral4v_t ref, integral4v_t opt);<br>
+ bool check_integral_init8v(<wbr>integral8v_t ref, integral8v_t opt);<br>
+ bool check_integral_init12v(<wbr>integral12v_t ref, integral12v_t opt);<br>
+ bool check_integral_init16v(<wbr>integral16v_t ref, integral16v_t opt);<br>
+ bool check_integral_init24v(<wbr>integral24v_t ref, integral24v_t opt);<br>
+ bool check_integral_init32v(<wbr>integral32v_t ref, integral32v_t opt);<br>
<br>
public:<br>
<br>
<br>______________________________<wbr>_________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
<br></div><br></div>