<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 4, 2013 at 9:02 AM,  <span dir="ltr"><<a href="mailto:praveen@multicorewareinc.com" target="_blank">praveen@multicorewareinc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Praveen Tiwari<br>
# Date 1383577321 -19800<br>
# Node ID df03ee5e3e440a4af0429be6404142ecd9a64861<br>
# Parent  20b712dce6c237f64ea3ca2a06fc4cb9370ad91f<br>
unit test code for blockcopy_ps_c<br>
<br>
diff -r 20b712dce6c2 -r df03ee5e3e44 source/test/pixelharness.cpp<br>
--- a/source/test/pixelharness.cpp      Mon Nov 04 19:34:23 2013 +0530<br>
+++ b/source/test/pixelharness.cpp      Mon Nov 04 20:32:01 2013 +0530<br>
@@ -553,6 +553,31 @@<br>
     return true;<br>
 }<br>
<br>
+bool PixelHarness::check_block_copy_ps(copy_ps_t ref, copy_ps_t opt)<br>
+{<br>
+    ALIGN_VAR_16(pixel, ref_dest[64 * 64]);<br>
+    ALIGN_VAR_16(pixel, opt_dest[64 * 64]);<br></blockquote><div><br></div><div>the naming scheme seems backwards to what we use for other primitives.  luma_hps takes pixel input and outputs short.  Here, it seems copy_ps takes short input and outputs pixel?  Let's rename these to be consistent.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+    // we don't know the partition size so we are checking the entire output buffer so<br>
+    // we must initialize the buffers<br>
+    memset(ref_dest, 0, sizeof(ref_dest));<br>
+    memset(opt_dest, 0, sizeof(opt_dest));<br>
+<br>
+    int j = 0;<br>
+    for (int i = 0; i < ITERS; i++)<br>
+    {<br>
+        opt(opt_dest, 64, (int16_t*)pbuf2 + j, STRIDE);<br>
+        ref(ref_dest, 64, (int16_t*)pbuf2 + j, STRIDE);<br></blockquote><div><br></div><div>the pixelharness has int16_t input buffers, why not use those?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

+<br>
+        if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(pixel)))<br>
+            return false;<br>
+<br>
+        j += INCR;<br>
+    }<br>
+<br>
+    return true;<br>
+}<br>
+<br>
 bool PixelHarness::testPartition(int part, const EncoderPrimitives& ref, const EncoderPrimitives& opt)<br>
 {<br>
     if (opt.satd[part])<br>
@@ -653,6 +678,24 @@<br>
             return false;<br>
         }<br>
     }<br>
+<br>
+    if (opt.luma_copy_ps[part])<br>
+    {<br>
+        if (!check_block_copy_ps(ref.luma_copy_ps[part], opt.luma_copy_ps[part]))<br>
+        {<br>
+            printf("luma_copy_ps[%s] failed\n", lumaPartStr[part]);<br>
+            return false;<br>
+        }<br>
+    }<br>
+<br>
+    if (opt.chroma_copy_ps[part])<br>
+    {<br>
+        if (!check_block_copy_ps(ref.chroma_copy_ps[part], opt.chroma_copy_ps[part]))<br>
+        {<br>
+            printf("chroma_copy_ps[%s] failed\n", chromaPartStr[part]);<br>
+            return false;<br>
+        }<br>
+    }<br>
     return true;<br>
 }<br>
<br>
@@ -884,6 +927,18 @@<br>
         printf("chroma_copy_pp[%s]", chromaPartStr[part]);<br>
         REPORT_SPEEDUP(opt.chroma_copy_pp[part], ref.chroma_copy_pp[part], pbuf1, 64, pbuf2, 128);<br>
     }<br>
+<br>
+    if (opt.luma_copy_ps[part])<br>
+    {<br>
+        printf("luma_copy_ps[%s]", lumaPartStr[part]);<br>
+        REPORT_SPEEDUP(opt.luma_copy_ps[part], ref.luma_copy_ps[part], pbuf1, 64, (int16_t*)pbuf2, 128);<br>
+    }<br>
+<br>
+    if (opt.chroma_copy_ps[part])<br>
+    {<br>
+        printf("chroma_copy_ps[%s]", chromaPartStr[part]);<br>
+        REPORT_SPEEDUP(opt.chroma_copy_ps[part], ref.chroma_copy_ps[part], pbuf1, 64, (int16_t*)pbuf2, 128);<br>
+    }<br>
 }<br>
<br>
 void PixelHarness::measureSpeed(const EncoderPrimitives& ref, const EncoderPrimitives& opt)<br>
diff -r 20b712dce6c2 -r df03ee5e3e44 source/test/pixelharness.h<br>
--- a/source/test/pixelharness.h        Mon Nov 04 19:34:23 2013 +0530<br>
+++ b/source/test/pixelharness.h        Mon Nov 04 20:32:01 2013 +0530<br>
@@ -58,6 +58,7 @@<br>
     bool check_pixelavg_pp(pixelavg_pp_t ref, pixelavg_pp_t opt);<br>
<br>
     bool check_block_copy_pp(copy_pp_t ref, copy_pp_t opt);<br>
+    bool check_block_copy_ps(copy_ps_t ref, copy_ps_t opt);<br>
 public:<br>
<br>
     PixelHarness();<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>