<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Oct 18, 2013 at 5:24 AM,  <span dir="ltr"><<a href="mailto:dnyaneshwar@multicorewareinc.com" target="_blank">dnyaneshwar@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 Dnyaneshwar Gorade <<a href="mailto:dnyaneshwar@multicorewareinc.com">dnyaneshwar@multicorewareinc.com</a>><br>
# Date 1382091792 -19800<br>
#      Fri Oct 18 15:53:12 2013 +0530<br>
# Node ID 979581c0f4d494ae0f4009eea71273b2ecf7697c<br>
# Parent  6d9bd6b6209e45cb49da804b23ad78424914b323<br>
added pixelavg_pp function to testbench.<br>
<br>
diff -r 6d9bd6b6209e -r 979581c0f4d4 source/common/x86/asm-primitives.cpp<br>
--- a/source/common/x86/asm-primitives.cpp      Fri Oct 18 14:18:05 2013 +0530<br>
+++ b/source/common/x86/asm-primitives.cpp      Fri Oct 18 15:53:12 2013 +0530<br>
@@ -233,7 +233,7 @@<br>
         p.pixelavg_pp[LUMA_4x8]  = x265_pixel_avg_4x8_mmx2;<br>
         p.pixelavg_pp[LUMA_4x4]  = x265_pixel_avg_4x4_mmx2;<br>
<br>
-        //PIXEL_AVE(sse2);<br>
+        PIXEL_AVE(sse2);<br>
         ASSGN_SSE(sse2);<br>
         INIT2(sad, _sse2);<br>
         INIT2(sad_x3, _sse2);<br>
@@ -264,7 +264,7 @@<br>
         SA8D_INTER_FROM_BLOCK(ssse3);<br>
         p.sse_pp[LUMA_4x4] = x265_pixel_ssd_4x4_ssse3;<br>
         ASSGN_SSE(ssse3);<br>
-        //PIXEL_AVE(ssse3);<br>
+        PIXEL_AVE(ssse3);<br>
<br>
         p.sad_x4[LUMA_8x4] = x265_pixel_sad_x4_8x4_ssse3;<br>
         p.sad_x4[LUMA_8x8] = x265_pixel_sad_x4_8x8_ssse3;<br>
diff -r 6d9bd6b6209e -r 979581c0f4d4 source/test/pixelharness.cpp<br>
--- a/source/test/pixelharness.cpp      Fri Oct 18 14:18:05 2013 +0530<br>
+++ b/source/test/pixelharness.cpp      Fri Oct 18 15:53:12 2013 +0530<br>
@@ -501,6 +501,27 @@<br>
         return true;<br>
 }<br>
<br>
+bool PixelHarness::check_pixelavg_pp(pixelavg_pp_t ref, pixelavg_pp_t opt)<br>
+{<br>
+    ALIGN_VAR_16(pixel, ref_dest[64 * 64]);<br>
+    ALIGN_VAR_16(pixel, opt_dest[64 * 64]);<br>
+<br>
+    int j = 0;<br>
+<br>
+    for (int i = 0; i < ITERS; i++)<br>
+    {<br>
+        opt(opt_dest, STRIDE, pbuf1 + j, STRIDE, pbuf2 + j, STRIDE, 32);<br>
+        ref(ref_dest, STRIDE, pbuf1 + j, STRIDE, pbuf2 + j, STRIDE, 32);<br>
+<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>
@@ -575,6 +596,15 @@<br>
         }<br>
     }<br>
<br>
+    if (opt.pixelavg_pp[part])<br>
+    {<br>
+        if (!check_pixelavg_pp(ref.pixelavg_pp[part], opt.pixelavg_pp[part]))<br>
+        {<br>
+            printf("pixelavg_pp[%s]: failed!\n", lumaPartStr[part]);<br>
+            return false;<br>
+        }<br>
+    }<br></blockquote><div><br></div><div>This function is for testing pixel primitives that have function pointers per luma partition size.  pixelavg_pp[] does, so this is the correct place for it.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

+<br>
     return true;<br>
 }<br>
<br>
@@ -633,6 +663,14 @@<br>
                 return false;<br>
             }<br>
         }<br>
+        if (opt.pixelavg_pp[i])<br>
+        {<br>
+            if (!check_pixelavg_pp(ref.pixelavg_pp[i], opt.pixelavg_pp[i]))<br>
+            {<br>
+                printf("pixelavg_pp[%dx%d]: failed!\n", 4 << i, 4 << i);<br>
+                return false;<br>
+            }<br>
+        }<br></blockquote><div><br></div><div>Here we're testing primitives with function pointers per square block size.  This is the wrong place for pixelavg.  Removing this bit from the patch.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

     }<br>
<br>
     if (opt.cvt32to16_shr)<br>
@@ -747,6 +785,12 @@<br>
         REPORT_SPEEDUP(opt.satd[part], ref.satd[part], pbuf1, STRIDE, fref, STRIDE);<br>
     }<br>
<br>
+    if (opt.pixelavg_pp[part])<br>
+    {<br>
+        printf("pixelavg_pp[%s]", lumaPartStr[part]);<br>
+        REPORT_SPEEDUP(opt.pixelavg_pp[part], ref.pixelavg_pp[part], pbuf1, STRIDE, pbuf2, STRIDE, pbuf3, STRIDE, 0);<br>
+    }<br>
+<br>
     if (opt.sa8d_inter[part])<br>
     {<br>
         printf("  sa8d[%s]", lumaPartStr[part]);<br>
@@ -837,6 +881,12 @@<br>
             printf("recon[%dx%d]", 4 << i, 4 << i);<br>
             REPORT_SPEEDUP(opt.calcrecon[i], ref.calcrecon[i], pbuf1, sbuf1, pbuf2, sbuf1, pbuf1, 64, 64, 64);<br>
         }<br>
+<br>
+        if (opt.pixelavg_pp[i])<br>
+        {<br>
+            printf("pixelavg_pp[%s]", lumaPartStr[i]);<br>
+            REPORT_SPEEDUP(opt.pixelavg_pp[i], ref.pixelavg_pp[i], pbuf1, STRIDE, pbuf2, STRIDE, pbuf3, STRIDE, 0);<br>
+        }<br></blockquote><div><br></div><div>and this bit.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
     }<br>
<br>
     if (opt.cvt32to16_shr)<br>
diff -r 6d9bd6b6209e -r 979581c0f4d4 source/test/pixelharness.h<br>
--- a/source/test/pixelharness.h        Fri Oct 18 14:18:05 2013 +0530<br>
+++ b/source/test/pixelharness.h        Fri Oct 18 15:53:12 2013 +0530<br>
@@ -55,6 +55,7 @@<br>
     bool check_pixeladd_pp(pixeladd_pp_t ref, pixeladd_pp_t opt);<br>
     bool check_downscale_t(downscale_t ref, downscale_t opt);<br>
     bool check_cvt32to16_shr_t(cvt32to16_shr_t ref, cvt32to16_shr_t opt);<br>
+    bool check_pixelavg_pp(pixelavg_pp_t ref, pixelavg_pp_t opt);<br>
<br>
 public:<br>
<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>