[x265] [PATCH] added pixelavg_pp function to testbench

dnyaneshwar at multicorewareinc.com dnyaneshwar at multicorewareinc.com
Fri Oct 18 12:24:32 CEST 2013


# HG changeset patch
# User Dnyaneshwar Gorade <dnyaneshwar at multicorewareinc.com>
# Date 1382091792 -19800
#      Fri Oct 18 15:53:12 2013 +0530
# Node ID 979581c0f4d494ae0f4009eea71273b2ecf7697c
# Parent  6d9bd6b6209e45cb49da804b23ad78424914b323
added pixelavg_pp function to testbench.

diff -r 6d9bd6b6209e -r 979581c0f4d4 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Fri Oct 18 14:18:05 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Fri Oct 18 15:53:12 2013 +0530
@@ -233,7 +233,7 @@
         p.pixelavg_pp[LUMA_4x8]  = x265_pixel_avg_4x8_mmx2;
         p.pixelavg_pp[LUMA_4x4]  = x265_pixel_avg_4x4_mmx2;
 
-        //PIXEL_AVE(sse2);
+        PIXEL_AVE(sse2);
         ASSGN_SSE(sse2);
         INIT2(sad, _sse2);
         INIT2(sad_x3, _sse2);
@@ -264,7 +264,7 @@
         SA8D_INTER_FROM_BLOCK(ssse3);
         p.sse_pp[LUMA_4x4] = x265_pixel_ssd_4x4_ssse3;
         ASSGN_SSE(ssse3);
-        //PIXEL_AVE(ssse3);
+        PIXEL_AVE(ssse3);
 
         p.sad_x4[LUMA_8x4] = x265_pixel_sad_x4_8x4_ssse3;
         p.sad_x4[LUMA_8x8] = x265_pixel_sad_x4_8x8_ssse3;
diff -r 6d9bd6b6209e -r 979581c0f4d4 source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp	Fri Oct 18 14:18:05 2013 +0530
+++ b/source/test/pixelharness.cpp	Fri Oct 18 15:53:12 2013 +0530
@@ -501,6 +501,27 @@
         return true;
 }
 
+bool PixelHarness::check_pixelavg_pp(pixelavg_pp_t ref, pixelavg_pp_t opt)
+{
+    ALIGN_VAR_16(pixel, ref_dest[64 * 64]);
+    ALIGN_VAR_16(pixel, opt_dest[64 * 64]);
+
+    int j = 0;
+
+    for (int i = 0; i < ITERS; i++)
+    {
+        opt(opt_dest, STRIDE, pbuf1 + j, STRIDE, pbuf2 + j, STRIDE, 32);
+        ref(ref_dest, STRIDE, pbuf1 + j, STRIDE, pbuf2 + j, STRIDE, 32);
+
+        if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(pixel)))
+            return false;
+
+        j += INCR;
+    }
+
+    return true;
+}
+
 bool PixelHarness::testPartition(int part, const EncoderPrimitives& ref, const EncoderPrimitives& opt)
 {
     if (opt.satd[part])
@@ -575,6 +596,15 @@
         }
     }
 
+    if (opt.pixelavg_pp[part])
+    {
+        if (!check_pixelavg_pp(ref.pixelavg_pp[part], opt.pixelavg_pp[part]))
+        {
+            printf("pixelavg_pp[%s]: failed!\n", lumaPartStr[part]);
+            return false;
+        }
+    }
+
     return true;
 }
 
@@ -633,6 +663,14 @@
                 return false;
             }
         }
+        if (opt.pixelavg_pp[i])
+        {
+            if (!check_pixelavg_pp(ref.pixelavg_pp[i], opt.pixelavg_pp[i]))
+            {
+                printf("pixelavg_pp[%dx%d]: failed!\n", 4 << i, 4 << i);
+                return false;
+            }
+        }
     }
 
     if (opt.cvt32to16_shr)
@@ -747,6 +785,12 @@
         REPORT_SPEEDUP(opt.satd[part], ref.satd[part], pbuf1, STRIDE, fref, STRIDE);
     }
 
+    if (opt.pixelavg_pp[part])
+    {
+        printf("pixelavg_pp[%s]", lumaPartStr[part]);
+        REPORT_SPEEDUP(opt.pixelavg_pp[part], ref.pixelavg_pp[part], pbuf1, STRIDE, pbuf2, STRIDE, pbuf3, STRIDE, 0);
+    }
+
     if (opt.sa8d_inter[part])
     {
         printf("  sa8d[%s]", lumaPartStr[part]);
@@ -837,6 +881,12 @@
             printf("recon[%dx%d]", 4 << i, 4 << i);
             REPORT_SPEEDUP(opt.calcrecon[i], ref.calcrecon[i], pbuf1, sbuf1, pbuf2, sbuf1, pbuf1, 64, 64, 64);
         }
+
+        if (opt.pixelavg_pp[i])
+        {
+            printf("pixelavg_pp[%s]", lumaPartStr[i]);
+            REPORT_SPEEDUP(opt.pixelavg_pp[i], ref.pixelavg_pp[i], pbuf1, STRIDE, pbuf2, STRIDE, pbuf3, STRIDE, 0);
+        }
     }
 
     if (opt.cvt32to16_shr)
diff -r 6d9bd6b6209e -r 979581c0f4d4 source/test/pixelharness.h
--- a/source/test/pixelharness.h	Fri Oct 18 14:18:05 2013 +0530
+++ b/source/test/pixelharness.h	Fri Oct 18 15:53:12 2013 +0530
@@ -55,6 +55,7 @@
     bool check_pixeladd_pp(pixeladd_pp_t ref, pixeladd_pp_t opt);
     bool check_downscale_t(downscale_t ref, downscale_t opt);
     bool check_cvt32to16_shr_t(cvt32to16_shr_t ref, cvt32to16_shr_t opt);
+    bool check_pixelavg_pp(pixelavg_pp_t ref, pixelavg_pp_t opt);
 
 public:
 


More information about the x265-devel mailing list