[x265] [PATCH 5/6] intrapred: fix build error after simplify bLeft and bAbove

Min Chen chenm003 at 163.com
Tue Jun 18 18:43:37 CEST 2013


---
 source/common/primitives.h       |  8 ++++----
 source/test/intrapredharness.cpp | 26 +++++++++-----------------
 source/test/intrapredharness.h   |  4 ++--
 3 files changed, 15 insertions(+), 23 deletions(-)

diff --git a/source/common/primitives.h b/source/common/primitives.h
index aaa90c8..f43f8a2 100644
--- a/source/common/primitives.h
+++ b/source/common/primitives.h
@@ -192,8 +192,8 @@ typedef void (CDECL * blockcpy_p_p)(int bx, int by, pixel *dst, intptr_t dstride
 typedef void (CDECL * blockcpy_s_p)(int bx, int by, short *dst, intptr_t dstride, pixel *src, intptr_t sstride); // dst is aligned
 typedef void (CDECL * blockcpy_p_s)(int bx, int by, pixel *dst, intptr_t dstride, short *src, intptr_t sstride); // dst is aligned
 typedef void (CDECL * blockcpy_s_c)(int bx, int by, short *dst, intptr_t dstride, uint8_t *src, intptr_t sstride); // dst is aligned
-typedef void (CDECL * getIPredDC_p)(pixel* pSrc, intptr_t srcStride, pixel* pDst, intptr_t dstStride, int width, int bFilter);
-typedef void (CDECL * getIPredPlanar_p)(pixel* pSrc, intptr_t srcStride, pixel* rpDst, intptr_t dstStride, int width);
+typedef void (CDECL * getIPredDC_t)(pixel* pSrc, intptr_t srcStride, pixel* pDst, intptr_t dstStride, int width, int bFilter);
+typedef void (CDECL * getIPredPlanar_t)(pixel* pSrc, intptr_t srcStride, pixel* rpDst, intptr_t dstStride, int width);
 typedef void (CDECL * getIPredAng_p)(int bitDepth, pixel* rpDst, int dstStride, int width, int dirMode, bool bFilter, pixel *refLeft, pixel *refAbove);
 typedef void (CDECL * quant)(int bitDepth, const int* pSrc, int* pDes, int iWidth, int iHeight, int mcqp_miper, int mcqp_mirem, bool useScalingList, unsigned int uiLog2TrSize, int *piDequantCoef);
 typedef void (CDECL * cvt16to32_t)(short *psOrg, int *piDst, int);
@@ -235,8 +235,8 @@ struct EncoderPrimitives
     blockcpy_p_s cpyblock_p_s; // pixel from short
     blockcpy_s_p cpyblock_s_p; // short from pixel
     blockcpy_s_c cpyblock_s_c; // short from unsigned char
-    getIPredDC_p getIPredDC;
-    getIPredPlanar_p getIPredPlanar;
+    getIPredDC_t getIPredDC;
+    getIPredPlanar_t getIPredPlanar;
     getIPredAng_p getIPredAng;
     quant deQuant;
     dct_t dct[NUM_DCTS];
diff --git a/source/test/intrapredharness.cpp b/source/test/intrapredharness.cpp
index 15b9058..1f6bcf6 100644
--- a/source/test/intrapredharness.cpp
+++ b/source/test/intrapredharness.cpp
@@ -64,28 +64,22 @@ IntraPredHarness::~IntraPredHarness()
     free(pixel_out_Vec);
 }
 
-bool IntraPredHarness::check_getIPredDC_primitive(x265::getIPredDC_p ref, x265::getIPredDC_p opt)
+bool IntraPredHarness::check_getIPredDC_primitive(x265::getIPredDC_t ref, x265::getIPredDC_t opt)
 {
     int j = ADI_BUF_STRIDE;
 
     for (int i = 0; i <= 100; i++)
     {
-        int blkAboveAvailable = rand() & 1;
-        int blkLeftAvailable = rand() & 1;
         int rand_width = 1 << ((rand() % 5) + 2);                  // Randomly generated Width
         int rand_filter = rand() & 1;
 
-        // The Left and Above can't both be false
-        if (!blkLeftAvailable)
-            blkAboveAvailable = 1;
-
 #if _DEBUG
         memset(pixel_out_Vec, 0xCD, out_size);
         memset(pixel_out_C, 0xCD, out_size);
 #endif
 
-        opt(pixel_buff + j, ADI_BUF_STRIDE, pixel_out_Vec, FENC_STRIDE, rand_width, rand_width, blkAboveAvailable, blkLeftAvailable, rand_filter);
-        ref(pixel_buff + j, ADI_BUF_STRIDE, pixel_out_C,   FENC_STRIDE, rand_width, rand_width, blkAboveAvailable, blkLeftAvailable, rand_filter);
+        opt(pixel_buff + j, ADI_BUF_STRIDE, pixel_out_Vec, FENC_STRIDE, rand_width, rand_filter);
+        ref(pixel_buff + j, ADI_BUF_STRIDE, pixel_out_C,   FENC_STRIDE, rand_width, rand_filter);
 
         for (int k = 0; k < rand_width; k++)
         {
@@ -99,7 +93,7 @@ bool IntraPredHarness::check_getIPredDC_primitive(x265::getIPredDC_p ref, x265::
     return true;
 }
 
-bool IntraPredHarness::check_getIPredPlanar_primitive(x265::getIPredPlanar_p ref, x265::getIPredPlanar_p opt)
+bool IntraPredHarness::check_getIPredPlanar_primitive(x265::getIPredPlanar_t ref, x265::getIPredPlanar_t opt)
 {
     int j = ADI_BUF_STRIDE;
 
@@ -111,8 +105,8 @@ bool IntraPredHarness::check_getIPredPlanar_primitive(x265::getIPredPlanar_p ref
             memset(pixel_out_Vec, 0xCD, out_size);
             memset(pixel_out_C, 0xCD, out_size);
 #endif
-            ref(pixel_buff + j, ADI_BUF_STRIDE, pixel_out_C,   FENC_STRIDE, width, 0);
-            opt(pixel_buff + j, ADI_BUF_STRIDE, pixel_out_Vec, FENC_STRIDE, width, 0);
+            ref(pixel_buff + j, ADI_BUF_STRIDE, pixel_out_C,   FENC_STRIDE, width);
+            opt(pixel_buff + j, ADI_BUF_STRIDE, pixel_out_Vec, FENC_STRIDE, width);
 
             for (int k = 0; k < width; k++)
             {
@@ -207,17 +201,15 @@ void IntraPredHarness::measureSpeed(const EncoderPrimitives& ref, const EncoderP
 {
     int width = 64;
     short srcStride = 96;
-    int blkAboveAvailable = 1;
-    int blkLeftAvailable = 1;
 
     if (opt.getIPredDC)
     {
         printf("IPred_getIPredDC_pel[filter=0]");
         REPORT_SPEEDUP(opt.getIPredDC, ref.getIPredDC,
-                       pixel_buff + srcStride, srcStride, pixel_out_Vec, FENC_STRIDE, width, width, blkAboveAvailable, blkLeftAvailable, 0);
+                       pixel_buff + srcStride, srcStride, pixel_out_Vec, FENC_STRIDE, width, 0);
         printf("IPred_getIPredDC_pel[filter=1]");
         REPORT_SPEEDUP(opt.getIPredDC, ref.getIPredDC,
-                       pixel_buff + srcStride, srcStride, pixel_out_Vec, FENC_STRIDE, width, width, blkAboveAvailable, blkLeftAvailable, 1);
+                       pixel_buff + srcStride, srcStride, pixel_out_Vec, FENC_STRIDE, width, 1);
     }
     if (opt.getIPredPlanar)
     {
@@ -226,7 +218,7 @@ void IntraPredHarness::measureSpeed(const EncoderPrimitives& ref, const EncoderP
             width = ii;
             printf("IPred_getIPredPlanar[width=%d]", ii);
             REPORT_SPEEDUP(opt.getIPredPlanar, ref.getIPredPlanar,
-                           pixel_buff + srcStride, srcStride, pixel_out_Vec, FENC_STRIDE, width, 1);
+                           pixel_buff + srcStride, srcStride, pixel_out_Vec, FENC_STRIDE, width);
         }
     }
     if (opt.getIPredAng)
diff --git a/source/test/intrapredharness.h b/source/test/intrapredharness.h
index 56bf9b1..5f138d3 100644
--- a/source/test/intrapredharness.h
+++ b/source/test/intrapredharness.h
@@ -40,8 +40,8 @@ protected:
     static const int ip_t_size = 4 * 65 * 65 * 100;
     static const int out_size = 64 * FENC_STRIDE;
 
-    bool check_getIPredDC_primitive(x265::getIPredDC_p ref, x265::getIPredDC_p opt);
-    bool check_getIPredPlanar_primitive(x265::getIPredPlanar_p ref, x265::getIPredPlanar_p opt);
+    bool check_getIPredDC_primitive(x265::getIPredDC_t ref, x265::getIPredDC_t opt);
+    bool check_getIPredPlanar_primitive(x265::getIPredPlanar_t ref, x265::getIPredPlanar_t opt);
     bool check_getIPredAng_primitive(x265::getIPredAng_p ref, x265::getIPredAng_p opt);
 
 public:
-- 
1.8.3.msysgit.0




More information about the x265-devel mailing list