<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 6, 2014 at 12:46 AM, <span dir="ltr"><<a href="mailto:murugan@multicorewareinc.com" target="_blank">murugan@multicorewareinc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"># HG changeset patch<br>
# User Murugan Vairavel <<a href="mailto:murugan@multicorewareinc.com">murugan@multicorewareinc.com</a>><br>
# Date 1391669143 -19800<br>
# Thu Feb 06 12:15:43 2014 +0530<br>
# Node ID af9815d284efe0ce2d29c5009f7a34266f978931<br>
# Parent 634bc0b1c24653dd254df77cd80f96f81e71e888<br>
testbench: stress test support for all pixelharness functions<br></blockquote><div><br></div><div>I see this patch has been pushed, so now the test bench fails at least on Mac:</div><div><br></div><div>
<p class="">Using random seed 52F3AC24 8bpp</p>
<p class="">Testing primitives: SSE2</p>
<p class="">Testing primitives: SSE3</p>
<p class="">Testing primitives: SSSE3</p>
<p class="">Testing primitives: SSE4</p>
<p class="">Testing primitives: AVX</p>
<p class="">Testing primitives: AVX2</p>
<p class="">sad_x4[16x32]: failed!</p><p class=""><br></p></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
diff -r 634bc0b1c246 -r af9815d284ef source/test/pixelharness.cpp<br>
--- a/source/test/pixelharness.cpp Wed Feb 05 23:10:22 2014 -0600<br>
+++ b/source/test/pixelharness.cpp Thu Feb 06 12:15:43 2014 +0530<br>
@@ -33,39 +33,84 @@<br>
#define INCR 32<br>
#define STRIDE 64<br>
#define ITERS 100<br>
+#define MAX_HEIGHT 64<br>
+#define PAD_ROWS 64<br>
+#define BUFFSIZE STRIDE * (MAX_HEIGHT + PAD_ROWS) + INCR * ITERS<br>
+#define TEST_CASES 3<br>
+#define SMAX (1 << 12)<br>
+#define SMIN (-1 << 12)<br>
<br>
PixelHarness::PixelHarness()<br>
{<br>
- int maxheight = 64;<br>
- int padrows = 64;<br>
- int bufsize = STRIDE * (maxheight + padrows) + INCR * ITERS;<br>
+ int bufsize = STRIDE * (MAX_HEIGHT + PAD_ROWS) + INCR * ITERS;<br>
<br>
/* 64 pixels wide, 2k deep */<br>
- pbuf1 = X265_MALLOC(pixel, bufsize);<br>
- pbuf2 = X265_MALLOC(pixel, bufsize);<br>
- pbuf3 = X265_MALLOC(pixel, bufsize);<br>
- pbuf4 = X265_MALLOC(pixel, bufsize);<br>
+ pbuf1 = (pixel*)X265_MALLOC(pixel, bufsize);<br>
+ pbuf2 = (pixel*)X265_MALLOC(pixel, bufsize);<br>
+ pbuf3 = (pixel*)X265_MALLOC(pixel, bufsize);<br>
+ pbuf4 = (pixel*)X265_MALLOC(pixel, bufsize);<br>
<br>
- ibuf1 = X265_MALLOC(int, bufsize);<br>
+ ibuf1 = (int*)X265_MALLOC(int, bufsize);<br>
<br>
- sbuf1 = X265_MALLOC(int16_t, bufsize);<br>
- sbuf2 = X265_MALLOC(int16_t, bufsize);<br>
- sbuf3 = X265_MALLOC(int16_t, bufsize);<br>
+ sbuf1 = (int16_t*)X265_MALLOC(int16_t, bufsize);<br>
+ sbuf2 = (int16_t*)X265_MALLOC(int16_t, bufsize);<br>
+ sbuf3 = (int16_t*)X265_MALLOC(int16_t, bufsize);<br>
<br>
- if (!pbuf1 || !pbuf2 || !pbuf3 || !pbuf4 || !sbuf1 || !sbuf2 || !sbuf3 || !ibuf1)<br>
+ /*Test Case buffer array */<br>
+ pixel_test_buff = (pixel**)X265_MALLOC(pixel*, TEST_CASES);<br>
+ short_test_buff = (int16_t**)X265_MALLOC(int16_t*, TEST_CASES);<br>
+ short_test_buff1 = (int16_t**)X265_MALLOC(int16_t*, TEST_CASES);<br>
+ int_test_buff = (int**)X265_MALLOC(int*, TEST_CASES);<br>
+<br>
+ if (!pbuf1 || !pbuf2 || !pbuf3 || !pbuf4 || !sbuf1 || !sbuf2 || !sbuf3 || !ibuf1 ||<br>
+ !pixel_test_buff || !short_test_buff || !int_test_buff || !short_test_buff1)<br>
{<br>
fprintf(stderr, "malloc failed, unable to initiate tests!\n");<br>
exit(1);<br>
}<br>
<br>
+ for (int i = 0; i < TEST_CASES; i++)<br>
+ {<br>
+ pixel_test_buff[i] = (pixel*)X265_MALLOC(pixel, BUFFSIZE);<br>
+ short_test_buff[i] = (int16_t*)X265_MALLOC(int16_t, BUFFSIZE);<br>
+ short_test_buff1[i] = (int16_t*)X265_MALLOC(int16_t, BUFFSIZE);<br>
+ int_test_buff[i] = (int*)X265_MALLOC(int, BUFFSIZE);<br>
+ if (!pixel_test_buff[i] || !short_test_buff[i] || !int_test_buff[i] || !short_test_buff1[i])<br>
+ {<br>
+ fprintf(stderr, "Init_Test_Case_buffers: malloc failed, unable to initiate tests!\n");<br>
+ exit(-1);<br>
+ }<br>
+ }<br>
+<br>
+ /*[0] --- Random values */<br>
+ /*[1] --- Minimum */<br>
+ /*[2] --- Maximum */<br>
+<br>
+ for (int i = 0; i < BUFFSIZE; i++)<br>
+ {<br>
+ pixel_test_buff[0][i] = rand() % PIXEL_MAX;<br>
+ short_test_buff[0][i] = (rand() % (2 * SMAX + 1)) - SMAX - 1; //max(SHORT_MIN, min(rand(), SMAX));<br>
+ short_test_buff1[0][i] = rand() & PIXEL_MAX; //For block copy only<br>
+ int_test_buff[0][i] = rand() % SHORT_MAX;<br>
+<br>
+ pixel_test_buff[1][i] = PIXEL_MIN;<br>
+ short_test_buff[1][i] = SMIN;<br>
+ short_test_buff1[1][i] = PIXEL_MIN;<br>
+ int_test_buff[1][i] = SHORT_MIN;<br>
+<br>
+ pixel_test_buff[2][i] = PIXEL_MAX;<br>
+ short_test_buff[2][i] = SMAX;<br>
+ short_test_buff1[2][i] = PIXEL_MAX;<br>
+ int_test_buff[2][i] = SHORT_MAX;<br>
+ }<br>
+<br>
+<br>
for (int i = 0; i < bufsize; i++)<br>
{<br>
pbuf1[i] = rand() & PIXEL_MAX;<br>
pbuf2[i] = rand() & PIXEL_MAX;<br>
pbuf3[i] = rand() & PIXEL_MAX;<br>
pbuf4[i] = rand() & PIXEL_MAX;<br>
-<br>
-#define SMAX (1 << 12)<br>
sbuf1[i] = (rand() % (2 * SMAX + 1)) - SMAX - 1; //max(SHORT_MIN, min(rand(), SMAX));<br>
sbuf2[i] = (rand() % (2 * SMAX + 1)) - SMAX - 1; //max(SHORT_MIN, min(rand(), SMAX));<br>
ibuf1[i] = (rand() % (2 * SMAX + 1)) - SMAX - 1;<br>
@@ -83,6 +128,17 @@<br>
X265_FREE(sbuf1);<br>
X265_FREE(sbuf2);<br>
X265_FREE(sbuf3);<br>
+ for (int i = 0; i < TEST_CASES; i++)<br>
+ {<br>
+ X265_FREE(pixel_test_buff[i]);<br>
+ X265_FREE(short_test_buff[i]);<br>
+ X265_FREE(short_test_buff1[i]);<br>
+ X265_FREE(int_test_buff[i]);<br>
+ }<br>
+ X265_FREE(pixel_test_buff);<br>
+ X265_FREE(short_test_buff);<br>
+ X265_FREE(short_test_buff1);<br>
+ X265_FREE(int_test_buff);<br>
}<br>
<br>
bool PixelHarness::check_pixelcmp(pixelcmp_t ref, pixelcmp_t opt)<br>
@@ -91,8 +147,10 @@<br>
<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- int vres = opt(pbuf1, STRIDE, pbuf2 + j, STRIDE);<br>
- int cres = ref(pbuf1, STRIDE, pbuf2 + j, STRIDE);<br>
+ int index1 = rand() % TEST_CASES;<br>
+ int index2 = rand() % TEST_CASES;<br>
+ int vres = opt(pixel_test_buff[index1], STRIDE, pixel_test_buff[index2] + j, STRIDE);<br>
+ int cres = ref(pixel_test_buff[index1], STRIDE, pixel_test_buff[index2] + j, STRIDE);<br>
if (vres != cres)<br>
return false;<br>
<br>
@@ -108,8 +166,10 @@<br>
<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- int vres = opt(sbuf1, STRIDE, pbuf2 + j, STRIDE);<br>
- int cres = ref(sbuf1, STRIDE, pbuf2 + j, STRIDE);<br>
+ int index1 = rand() % TEST_CASES;<br>
+ int index2 = rand() % TEST_CASES;<br>
+ int vres = opt(short_test_buff[index1], STRIDE,pixel_test_buff[index2] + j, STRIDE);<br>
+ int cres = ref(short_test_buff[index1], STRIDE,pixel_test_buff[index2] + j, STRIDE);<br>
if (vres != cres)<br>
return false;<br>
<br>
@@ -125,8 +185,10 @@<br>
<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- int vres = opt(sbuf1, STRIDE, sbuf2 + j, STRIDE);<br>
- int cres = ref(sbuf1, STRIDE, sbuf2 + j, STRIDE);<br>
+ int index1 = rand() % TEST_CASES;<br>
+ int index2 = rand() % TEST_CASES;<br>
+ int vres = opt(short_test_buff[index1], STRIDE,short_test_buff[index2] + j, STRIDE);<br>
+ int cres = ref(short_test_buff[index1], STRIDE,short_test_buff[index2] + j, STRIDE);<br>
if (vres != cres)<br>
return false;<br>
<br>
@@ -143,9 +205,16 @@<br>
int j = 0;<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- opt(pbuf1, pbuf2 + j, pbuf2 + j + 1, pbuf2 + j + 2, FENC_STRIDE - 5, &vres[0]);<br>
- ref(pbuf1, pbuf2 + j, pbuf2 + j + 1, pbuf2 + j + 2, FENC_STRIDE - 5, &cres[0]);<br>
-<br>
+ int index1 = rand() % TEST_CASES;<br>
+ int index2 = rand() % TEST_CASES;<br>
+ opt(pixel_test_buff[index1],<br>
+ pixel_test_buff[index2] + j,<br>
+ pixel_test_buff[index2] + j + 1,<br>
+ pixel_test_buff[index2] + j + 2, FENC_STRIDE - 5, &vres[0]);<br>
+ ref(pixel_test_buff[index1],<br>
+ pixel_test_buff[index2] + j,<br>
+ pixel_test_buff[index2] + j + 1,<br>
+ pixel_test_buff[index2] + j + 2, FENC_STRIDE - 5, &cres[0]);<br>
if ((vres[0] != cres[0]) || ((vres[1] != cres[1])) || ((vres[2] != cres[2])))<br>
return false;<br>
<br>
@@ -162,8 +231,18 @@<br>
int j = 0;<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- opt(pbuf1, pbuf2 + j, pbuf2 + j + 1, pbuf2 + j + 2, pbuf2 + j + 3, FENC_STRIDE - 5, &vres[0]);<br>
- ref(pbuf1, pbuf2 + j, pbuf2 + j + 1, pbuf2 + j + 2, pbuf2 + j + 3, FENC_STRIDE - 5, &cres[0]);<br>
+ int index1 = rand() % TEST_CASES;<br>
+ int index2 = rand() % TEST_CASES;<br>
+ opt(pixel_test_buff[index1],<br>
+ pixel_test_buff[index2] + j,<br>
+ pixel_test_buff[index2] + j + 1,<br>
+ pixel_test_buff[index2] + j + 2,<br>
+ pixel_test_buff[index2] + j + 3, FENC_STRIDE - 5, &vres[0]);<br>
+ ref(pixel_test_buff[index1],<br>
+ pixel_test_buff[index2] + j,<br>
+ pixel_test_buff[index2] + j + 1,<br>
+ pixel_test_buff[index2] + j + 2,<br>
+ pixel_test_buff[index2] + j + 3, FENC_STRIDE - 5, &cres[0]);<br>
<br>
if ((vres[0] != cres[0]) || ((vres[1] != cres[1])) || ((vres[2] != cres[2])) || ((vres[3] != cres[3])))<br>
return false;<br>
@@ -183,8 +262,9 @@<br>
int j = 0;<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- opt(bx, by, opt_dest, 64, pbuf2 + j, 128);<br>
- ref(bx, by, ref_dest, 64, pbuf2 + j, 128);<br>
+ int index = i % TEST_CASES;<br>
+ opt(bx, by, opt_dest, 64, pixel_test_buff[index] + j, 128);<br>
+ ref(bx, by, ref_dest, 64, pixel_test_buff[index] + j, 128);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(pixel)))<br>
return false;<br>
@@ -206,8 +286,9 @@<br>
int j = 0;<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- opt(bx, by, opt_dest, 64, (int16_t*)sbuf3 + j, STRIDE);<br>
- ref(bx, by, ref_dest, 64, (int16_t*)sbuf3 + j, STRIDE);<br>
+ int index = i % TEST_CASES;<br>
+ opt(bx, by, opt_dest, 64, short_test_buff1[index] + j, STRIDE);<br>
+ ref(bx, by, ref_dest, 64, short_test_buff1[index] + j, STRIDE);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(pixel)))<br>
return false;<br>
@@ -230,8 +311,9 @@<br>
int j = 0;<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- opt(pbuf1 + j, pbuf2 + j, opt_dest, STRIDE);<br>
- ref(pbuf1 + j, pbuf2 + j, ref_dest, STRIDE);<br>
+ int index = i % TEST_CASES;<br>
+ opt(pbuf1 + j, pixel_test_buff[index] + j, opt_dest, STRIDE);<br>
+ ref(pbuf1 + j, pixel_test_buff[index] + j, ref_dest, STRIDE);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(int16_t)))<br>
return false;<br>
@@ -268,8 +350,12 @@<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
int stride = STRIDE;<br>
- ref(pbuf1 + j, sbuf1 + j, ref_reco, ref_recq, ref_pred, stride, stride, stride);<br>
- opt(pbuf1 + j, sbuf1 + j, opt_reco, opt_recq, opt_pred, stride, stride, stride);<br>
+ int index1 = rand() % TEST_CASES;<br>
+ int index2 = rand() % TEST_CASES;<br>
+ ref(pixel_test_buff[index1] + j,short_test_buff[index2] + j,<br>
+ ref_reco, ref_recq, ref_pred, stride, stride, stride);<br>
+ opt(pixel_test_buff[index1] + j,short_test_buff[index2] + j,<br>
+ opt_reco, opt_recq, opt_pred, stride, stride, stride);<br>
<br>
if (memcmp(ref_recq, opt_recq, 64 * 64 * sizeof(int16_t)))<br>
{<br>
@@ -295,7 +381,6 @@<br>
<br>
j += INCR;<br>
}<br>
-<br>
#if HIGH_BIT_DEPTH<br>
X265_DEPTH = old_depth;<br>
#endif<br>
@@ -318,8 +403,9 @@<br>
int offset = (rand() % 256) - 128;<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- opt((int16_t*)sbuf1 + j, opt_dest, 64, 64, width, height, w0, round, shift, offset);<br>
- ref((int16_t*)sbuf1 + j, ref_dest, 64, 64, width, height, w0, round, shift, offset);<br>
+ int index = i % TEST_CASES;<br>
+ opt(short_test_buff[index] + j, opt_dest, 64, 64, width, height, w0, round, shift, offset);<br>
+ ref(short_test_buff[index] + j, ref_dest, 64, 64, width, height, w0, round, shift, offset);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(pixel)))<br>
return false;<br>
@@ -346,8 +432,9 @@<br>
int offset = (rand() % 256) - 128;<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- opt(pbuf1 + j, opt_dest, 64, 64, width, height, w0, round, shift, offset);<br>
- ref(pbuf1 + j, ref_dest, 64, 64, width, height, w0, round, shift, offset);<br>
+ int index = i % TEST_CASES;<br>
+ opt(pixel_test_buff[index] + j, opt_dest, 64, 64, width, height, w0, round, shift, offset);<br>
+ ref(pixel_test_buff[index] + j, ref_dest, 64, 64, width, height, w0, round, shift, offset);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(pixel)))<br>
return false;<br>
@@ -367,8 +454,12 @@<br>
int j = 0;<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- opt(bx, by, opt_dest, STRIDE, sbuf2 + j, sbuf1 + j, STRIDE, STRIDE);<br>
- ref(bx, by, ref_dest, STRIDE, sbuf2 + j, sbuf1 + j, STRIDE, STRIDE);<br>
+ int index1 = rand() % TEST_CASES;<br>
+ int index2 = rand() % TEST_CASES;<br>
+ opt(bx, by, opt_dest, STRIDE, short_test_buff[index1] + j,<br>
+ short_test_buff[index2] + j, STRIDE, STRIDE);<br>
+ ref(bx, by, ref_dest, STRIDE, short_test_buff[index1] + j,<br>
+ short_test_buff[index2] + j, STRIDE, STRIDE);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(int16_t)))<br>
return false;<br>
@@ -402,8 +493,11 @@<br>
int j = 0;<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- ref(pbuf2 + j, ref_destf, ref_desth, ref_destv, ref_destc, src_stride, dst_stride, bx, by);<br>
- opt(pbuf2 + j, opt_destf, opt_desth, opt_destv, opt_destc, src_stride, dst_stride, bx, by);<br>
+ int index = i % TEST_CASES;<br>
+ ref(pixel_test_buff[index] + j, ref_destf, ref_desth, ref_destv,<br>
+ ref_destc, src_stride, dst_stride, bx, by);<br>
+ opt(pixel_test_buff[index] + j, opt_destf, opt_desth, opt_destv,<br>
+ opt_destc, src_stride, dst_stride, bx, by);<br>
<br>
if (memcmp(ref_destf, opt_destf, 32 * 32 * sizeof(pixel)))<br>
return false;<br>
@@ -430,8 +524,9 @@<br>
{<br>
int shift = (rand() % 7 + 1);<br>
<br>
- opt(opt_dest, ibuf1 + j, STRIDE, shift, STRIDE);<br>
- ref(ref_dest, ibuf1 + j, STRIDE, shift, STRIDE);<br>
+ int index = i % TEST_CASES;<br>
+ opt(opt_dest, int_test_buff[index] + j, STRIDE, shift, STRIDE);<br>
+ ref(ref_dest, int_test_buff[index] + j, STRIDE, shift, STRIDE);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(int16_t)))<br>
return false;<br>
@@ -452,8 +547,9 @@<br>
{<br>
int shift = (rand() % 7 + 1);<br>
<br>
- opt(opt_dest, sbuf1 + j, STRIDE, shift, STRIDE);<br>
- ref(ref_dest, sbuf1 + j, STRIDE, shift, STRIDE);<br>
+ int index = i % TEST_CASES;<br>
+ opt(opt_dest, short_test_buff[index] + j, STRIDE, shift, STRIDE);<br>
+ ref(ref_dest, short_test_buff[index] + j, STRIDE, shift, STRIDE);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(int32_t)))<br>
return false;<br>
@@ -476,8 +572,12 @@<br>
<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- ref(ref_dest, STRIDE, pbuf1 + j, STRIDE, pbuf2 + j, STRIDE, 32);<br>
- opt(opt_dest, STRIDE, pbuf1 + j, STRIDE, pbuf2 + j, STRIDE, 32);<br>
+ int index1 = rand() % TEST_CASES;<br>
+ int index2 = rand() % TEST_CASES;<br>
+ ref(ref_dest, STRIDE, pixel_test_buff[index1] + j,<br>
+ STRIDE, pixel_test_buff[index2] + j, STRIDE, 32);<br>
+ opt(opt_dest, STRIDE, pixel_test_buff[index1] + j,<br>
+ STRIDE, pixel_test_buff[index2] + j, STRIDE, 32);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(pixel)))<br>
return false;<br>
@@ -501,8 +601,9 @@<br>
int j = 0;<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- opt(opt_dest, STRIDE, pbuf2 + j, STRIDE);<br>
- ref(ref_dest, STRIDE, pbuf2 + j, STRIDE);<br>
+ int index = i % TEST_CASES;<br>
+ opt(opt_dest, STRIDE, pixel_test_buff[index] + j, STRIDE);<br>
+ ref(ref_dest, STRIDE, pixel_test_buff[index] + j, STRIDE);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(pixel)))<br>
return false;<br>
@@ -526,8 +627,9 @@<br>
int j = 0;<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- opt(opt_dest, 64, sbuf3 + j, STRIDE);<br>
- ref(ref_dest, 64, sbuf3 + j, STRIDE);<br>
+ int index = i % TEST_CASES;<br>
+ opt(opt_dest, 64, short_test_buff1[index] + j, STRIDE);<br>
+ ref(ref_dest, 64, short_test_buff1[index] + j, STRIDE);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(pixel)))<br>
return false;<br>
@@ -551,8 +653,9 @@<br>
int j = 0;<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- opt(opt_dest, STRIDE, pbuf2 + j, STRIDE);<br>
- ref(ref_dest, STRIDE, pbuf2 + j, STRIDE);<br>
+ int index = i % TEST_CASES;<br>
+ opt(opt_dest, STRIDE, pixel_test_buff[index] + j, STRIDE);<br>
+ ref(ref_dest, STRIDE, pixel_test_buff[index] + j, STRIDE);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(int16_t)))<br>
return false;<br>
@@ -596,8 +699,12 @@<br>
int j = 0;<br>
for (int i = 0; i < 1; i++)<br>
{<br>
- opt(opt_dest, 64, pbuf2 + j, pbuf1 + j, STRIDE, STRIDE);<br>
- ref(ref_dest, 64, pbuf2 + j, pbuf1 + j, STRIDE, STRIDE);<br>
+ int index1 = rand() % TEST_CASES;<br>
+ int index2 = rand() % TEST_CASES;<br>
+ opt(opt_dest, 64, pixel_test_buff[index1] + j,<br>
+ pixel_test_buff[index2] + j, STRIDE, STRIDE);<br>
+ ref(ref_dest, 64, pixel_test_buff[index1] + j,<br>
+ pixel_test_buff[index2] + j, STRIDE, STRIDE);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(int16_t)))<br>
return false;<br>
@@ -619,8 +726,9 @@<br>
int j = 0;<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- opt(opt_dest, pbuf1 + j, STRIDE);<br>
- ref(ref_dest, pbuf1 + j, STRIDE);<br>
+ int index = i % TEST_CASES;<br>
+ opt(opt_dest, pixel_test_buff[index] + j, STRIDE);<br>
+ ref(ref_dest, pixel_test_buff[index] + j, STRIDE);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(pixel)))<br>
return false;<br>
@@ -642,8 +750,9 @@<br>
int j = 0;<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- opt(opt_dest, pbuf1 + j, STRIDE);<br>
- ref(ref_dest, pbuf1 + j, STRIDE);<br>
+ int index = i % TEST_CASES;<br>
+ opt(opt_dest, pixel_test_buff[index] + j, STRIDE);<br>
+ ref(ref_dest, pixel_test_buff[index] + j, STRIDE);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(pixel)))<br>
return false;<br>
@@ -670,8 +779,10 @@<br>
int j = 0;<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- opt(opt_dest, 64, pbuf1 + j, sbuf1 + j, STRIDE, STRIDE);<br>
- ref(ref_dest, 64, pbuf1 + j, sbuf1 + j, STRIDE, STRIDE);<br>
+ int index1 = rand() % TEST_CASES;<br>
+ int index2 = rand() % TEST_CASES;<br>
+ opt(opt_dest, 64, pixel_test_buff[index1] + j, short_test_buff[index2] + j, STRIDE, STRIDE);<br>
+ ref(ref_dest, 64, pixel_test_buff[index1] + j, short_test_buff[index2] + j, STRIDE, STRIDE);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(pixel)))<br>
{<br>
@@ -695,8 +806,9 @@<br>
<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- uint64_t vres = opt(pbuf1, STRIDE);<br>
- uint64_t cres = ref(pbuf1, STRIDE);<br>
+ int index = i % TEST_CASES;<br>
+ uint64_t vres = opt(pixel_test_buff[index], STRIDE);<br>
+ uint64_t cres = ref(pixel_test_buff[index], STRIDE);<br>
if (vres != cres)<br>
return false;<br>
<br>
@@ -714,8 +826,10 @@<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
int stride = rand() % 64;<br>
- ref(pbuf1 + i, stride, pbuf2 + i, stride, sum0);<br>
- opt(pbuf1 + i, stride, pbuf2 + i, stride, sum1);<br>
+ int index1 = rand() % TEST_CASES;<br>
+ int index2 = rand() % TEST_CASES;<br>
+ ref(pixel_test_buff[index1] + i, stride, pixel_test_buff[index2] + i, stride, sum0);<br>
+ opt(pixel_test_buff[index1] + i, stride, pixel_test_buff[index2] + i, stride, sum1);<br>
<br>
if (memcmp(sum0, sum1, sizeof(sum0)))<br>
return false;<br>
@@ -776,8 +890,10 @@<br>
<br>
for (int i = 0; i < ITERS; i++)<br>
{<br>
- ref(sbuf1 + j, sbuf2 + j, ref_dest, STRIDE, STRIDE, STRIDE);<br>
- opt(sbuf1 + j, sbuf2 + j, opt_dest, STRIDE, STRIDE, STRIDE);<br>
+ int index1 = rand() % TEST_CASES;<br>
+ int index2 = rand() % TEST_CASES;<br>
+ ref(short_test_buff[index1] + j, short_test_buff[index2] + j, ref_dest, STRIDE, STRIDE, STRIDE);<br>
+ opt(short_test_buff[index1] + j, short_test_buff[index2] + j, opt_dest, STRIDE, STRIDE, STRIDE);<br>
<br>
if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(pixel)))<br>
return false;<br>
diff -r 634bc0b1c246 -r af9815d284ef source/test/pixelharness.h<br>
--- a/source/test/pixelharness.h Wed Feb 05 23:10:22 2014 -0600<br>
+++ b/source/test/pixelharness.h Thu Feb 06 12:15:43 2014 +0530<br>
@@ -31,11 +31,11 @@<br>
{<br>
protected:<br>
<br>
- pixel *pbuf1, *pbuf2, *pbuf3, *pbuf4;<br>
+ pixel *pbuf1, *pbuf2, *pbuf3, *pbuf4, **pixel_test_buff;<br>
<br>
- int *ibuf1;<br>
+ int *ibuf1, **int_test_buff;<br>
<br>
- int16_t *sbuf1, *sbuf2, *sbuf3;<br>
+ int16_t *sbuf1, *sbuf2, *sbuf3, **short_test_buff, **short_test_buff1;<br>
<br>
bool check_pixelcmp(pixelcmp_t ref, pixelcmp_t opt);<br>
bool check_pixelcmp_sp(pixelcmp_sp_t ref, pixelcmp_sp_t opt);<br>
_______________________________________________<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" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Steve Borho
</div></div>