[x265] [PATCH 26 of 29] intrapred: remove deprecated all_angs_pred and planar_pred functions and unit test code

dnyaneshwar at multicorewareinc.com dnyaneshwar at multicorewareinc.com
Tue Jan 13 08:11:34 CET 2015


# HG changeset patch
# User Dnyaneshwar G <dnyaneshwar at multicorewareinc.com>
# Date 1421125486 -19800
#      Tue Jan 13 10:34:46 2015 +0530
# Node ID cefe5fd25fe6435445ba1606e39075c4d439c97f
# Parent  d5e831e36e2acee2c27e1f187351a4d536325c25
intrapred: remove deprecated all_angs_pred and planar_pred functions and unit test code

diff -r d5e831e36e2a -r cefe5fd25fe6 source/common/intrapred.cpp
--- a/source/common/intrapred.cpp	Wed Jan 07 18:40:30 2015 +0530
+++ b/source/common/intrapred.cpp	Tue Jan 13 10:34:46 2015 +0530
@@ -63,52 +63,6 @@
 }
 
 template<int log2Size>
-void planar_pred_c(pixel* dst, intptr_t dstStride, pixel* left, pixel* above, int /*dirMode*/, int /*bFilter*/)
-{
-    above += 1;
-    left  += 1;
-    int k, l;
-    pixel bottomLeft, topRight;
-    int horPred;
-    int32_t leftColumn[MAX_CU_SIZE + 1], topRow[MAX_CU_SIZE + 1];
-    // CHECK_ME: dynamic range is 9 bits or 15 bits(I assume max input bit_depth is 14 bits)
-    int16_t bottomRow[MAX_CU_SIZE], rightColumn[MAX_CU_SIZE];
-    const int blkSize = 1 << log2Size;
-    const int offset2D = blkSize;
-    const int shift1D = log2Size;
-    const int shift2D = shift1D + 1;
-
-    // Get left and above reference column and row
-    for (k = 0; k < blkSize + 1; k++)
-    {
-        topRow[k] = above[k];
-        leftColumn[k] = left[k];
-    }
-
-    // Prepare intermediate variables used in interpolation
-    bottomLeft = (pixel)leftColumn[blkSize];
-    topRight   = (pixel)topRow[blkSize];
-    for (k = 0; k < blkSize; k++)
-    {
-        bottomRow[k]   = (int16_t)(bottomLeft - topRow[k]);
-        rightColumn[k] = (int16_t)(topRight   - leftColumn[k]);
-        topRow[k]      <<= shift1D;
-        leftColumn[k]  <<= shift1D;
-    }
-
-    // Generate prediction signal
-    for (k = 0; k < blkSize; k++)
-    {
-        horPred = leftColumn[k] + offset2D;
-        for (l = 0; l < blkSize; l++)
-        {
-            horPred += rightColumn[k];
-            topRow[l] += bottomRow[l];
-            dst[k * dstStride + l] = (pixel)((horPred + topRow[l]) >> shift2D);
-        }
-    }
-}
-template<int log2Size>
 void planar_pred_c_new(pixel* dst, intptr_t dstStride, pixel* srcPix, int /*dirMode*/, int /*bFilter*/)
 {
     const int blkSize = 1 << log2Size;
@@ -329,37 +283,6 @@
 }
 
 template<int log2Size>
-void all_angs_pred_c(pixel *dest, pixel *above0, pixel *left0, pixel *above1, pixel *left1, int bLuma)
-{
-    const int size = 1 << log2Size;
-    for (int mode = 2; mode <= 34; mode++)
-    {
-        pixel *left  = (g_intraFilterFlags[mode] & size ? left1  : left0);
-        pixel *above = (g_intraFilterFlags[mode] & size ? above1 : above0);
-        pixel *out = dest + ((mode - 2) << (log2Size * 2));
-
-        intra_pred_ang_c<size>(out, size, left, above, mode, bLuma);
-
-        // Optimize code don't flip buffer
-        bool modeHor = (mode < 18);
-
-        // transpose the block if this is a horizontal mode
-        if (modeHor)
-        {
-            for (int k = 0; k < size - 1; k++)
-            {
-                for (int l = k + 1; l < size; l++)
-                {
-                    pixel tmp         = out[k * size + l];
-                    out[k * size + l] = out[l * size + k];
-                    out[l * size + k] = tmp;
-                }
-            }
-        }
-    }
-}
-
-template<int log2Size>
 void all_angs_pred_c_new(pixel *dest, pixel *refPix, pixel *filtPix, int bLuma)
 {
     const int size = 1 << log2Size;
@@ -395,11 +318,6 @@
 
 void Setup_C_IPredPrimitives(EncoderPrimitives& p)
 {
-    p.intra_pred[0][BLOCK_4x4] = planar_pred_c<2>;
-    p.intra_pred[0][BLOCK_8x8] = planar_pred_c<3>;
-    p.intra_pred[0][BLOCK_16x16] = planar_pred_c<4>;
-    p.intra_pred[0][BLOCK_32x32] = planar_pred_c<5>;
-
     p.intra_pred_new[0][BLOCK_4x4] = planar_pred_c_new<2>;
     p.intra_pred_new[0][BLOCK_8x8] = planar_pred_c_new<3>;
     p.intra_pred_new[0][BLOCK_16x16] = planar_pred_c_new<4>;
@@ -423,11 +341,6 @@
         p.intra_pred_new[i][BLOCK_32x32] = intra_pred_ang_c_new<32>;
     }
 
-    p.intra_pred_allangs[BLOCK_4x4] = all_angs_pred_c<2>;
-    p.intra_pred_allangs[BLOCK_8x8] = all_angs_pred_c<3>;
-    p.intra_pred_allangs[BLOCK_16x16] = all_angs_pred_c<4>;
-    p.intra_pred_allangs[BLOCK_32x32] = all_angs_pred_c<5>;
-
     p.intra_pred_allangs_new[BLOCK_4x4] = all_angs_pred_c_new<2>;
     p.intra_pred_allangs_new[BLOCK_8x8] = all_angs_pred_c_new<3>;
     p.intra_pred_allangs_new[BLOCK_16x16] = all_angs_pred_c_new<4>;
diff -r d5e831e36e2a -r cefe5fd25fe6 source/test/intrapredharness.cpp
--- a/source/test/intrapredharness.cpp	Wed Jan 07 18:40:30 2015 +0530
+++ b/source/test/intrapredharness.cpp	Tue Jan 13 10:34:46 2015 +0530
@@ -180,57 +180,6 @@
     return true;
 }
 
-bool IntraPredHarness::check_allangs_primitive(const intra_allangs_t ref[], const intra_allangs_t opt[])
-{
-    int j = Predict::ADI_BUF_STRIDE;
-    int isLuma;
-
-#if _DEBUG
-    memset(pixel_out_33_vec, 0xCD, OUTPUT_SIZE_33);
-    memset(pixel_out_33_c, 0xCD, OUTPUT_SIZE_33);
-#endif
-
-    for (int size = 2; size <= 5; size++)
-    {
-        if (opt[size - 2] == NULL) continue;
-
-        const int width = (1 << size);
-
-        for (int i = 0; i <= 100; i++)
-        {
-            isLuma = (width <= 16) ? true : false;  // bFilter is true for 4x4, 8x8, 16x16 and false for 32x32
-
-            pixel * refAbove0 = pixel_buff + j;
-            pixel * refLeft0 = refAbove0 + 3 * width;
-
-            pixel * refAbove1 = pixel_buff + j + 3 * FENC_STRIDE;   // keep this offset, since vector code may broken input buffer range [-(width-1), 0]
-            pixel * refLeft1 = refAbove1 + 3 * width + FENC_STRIDE;
-            refLeft0[0] = refAbove0[0] = refLeft1[0] = refAbove1[0];
-
-            ref[size - 2](pixel_out_33_c,   refAbove0, refLeft0, refAbove1, refLeft1, isLuma);
-            checked(opt[size - 2], pixel_out_33_vec, refAbove0, refLeft0, refAbove1, refLeft1, isLuma);
-
-            for (int p = 2 - 2; p <= 34 - 2; p++)
-            {
-                for (int k = 0; k < width; k++)
-                {
-                    if (memcmp(pixel_out_33_c + p * (width * width) + k * width, pixel_out_33_vec + p * (width * width) + k * width, width * sizeof(pixel)))
-                    {
-                        printf("\nFailed: (%dx%d) Mode(%2d), Line[%2d], bfilter=%d\n", width, width, p + 2, k, isLuma);
-                        opt[size - 2](pixel_out_33_vec, refAbove0, refLeft0, refAbove1, refLeft1, isLuma);
-                        return false;
-                    }
-                }
-            }
-
-            reportfail();
-            j += FENC_STRIDE;
-        }
-    }
-
-    return true;
-}
-
 bool IntraPredHarness::check_allangs_new_primitive(const intra_allangs_new_t ref[], const intra_allangs_new_t opt[])
 {
     int j = Predict::ADI_BUF_STRIDE;
@@ -317,15 +266,6 @@
         return false;
     }
 
-    if (opt.intra_pred_allangs[0])
-    {
-        if (!check_allangs_primitive(ref.intra_pred_allangs, opt.intra_pred_allangs))
-        {
-            printf("intra_allangs failed\n");
-            return false;
-        }
-    }
-
     if (opt.intra_pred_allangs_new[0])
     {
         if (!check_allangs_new_primitive(ref.intra_pred_allangs_new, opt.intra_pred_allangs_new))
@@ -352,16 +292,6 @@
             REPORT_SPEEDUP(opt.intra_pred_new[0][i], ref.intra_pred_new[0][i],
                            pixel_out_vec, FENC_STRIDE, pixel_buff + srcStride, 0, 0);
         }
-        if (opt.intra_pred_allangs[i])
-        {
-            bool bFilter = (size <= 16);
-            pixel * refAbove = pixel_buff + srcStride;
-            pixel * refLeft = refAbove + 3 * size;
-            refLeft[0] = refAbove[0];
-            printf("intra_allangs%dx%d", size, size);
-            REPORT_SPEEDUP(opt.intra_pred_allangs[i], ref.intra_pred_allangs[i],
-                           pixel_out_33_vec, refAbove, refLeft, refAbove, refLeft, bFilter);
-        }
         if (opt.intra_pred_allangs_new[i])
         {
             bool bFilter = (size <= 16);
diff -r d5e831e36e2a -r cefe5fd25fe6 source/test/intrapredharness.h
--- a/source/test/intrapredharness.h	Wed Jan 07 18:40:30 2015 +0530
+++ b/source/test/intrapredharness.h	Tue Jan 13 10:34:46 2015 +0530
@@ -45,7 +45,6 @@
     bool check_planar_primitive(intra_pred_new_t ref, intra_pred_new_t opt, int width);
     bool check_angular_primitive(const intra_pred_t ref[][NUM_TR_SIZE], const intra_pred_t opt[][NUM_TR_SIZE]);
     bool check_angular_primitive(const intra_pred_new_t ref[][NUM_TR_SIZE], const intra_pred_new_t opt[][NUM_TR_SIZE]);
-    bool check_allangs_primitive(const intra_allangs_t ref[], const intra_allangs_t opt[]);
     bool check_allangs_new_primitive(const intra_allangs_new_t ref[], const intra_allangs_new_t opt[]);
 
 public:


More information about the x265-devel mailing list