[x265] [PATCH 2 of 5] ipfilter: remove unused filterRow primitives

Steve Borho steve at borho.org
Mon Oct 7 05:45:35 CEST 2013


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1381116775 18000
#      Sun Oct 06 22:32:55 2013 -0500
# Node ID 250299f4122107d41fe71b43bf401ca44022e846
# Parent  15c6e2451b347782300b6fe764cb4c9dac35a43a
ipfilter: remove unused filterRow primitives

diff -r 15c6e2451b34 -r 250299f41221 source/common/ipfilter.cpp
--- a/source/common/ipfilter.cpp	Sun Oct 06 22:30:10 2013 -0500
+++ b/source/common/ipfilter.cpp	Sun Oct 06 22:32:55 2013 -0500
@@ -495,190 +495,6 @@
 }
 }
 
-void filterRowH(pixel *src, intptr_t srcStride, short* midA, short* midB, short* midC, intptr_t midStride, pixel *dstA, pixel *dstB, pixel *dstC, int width, int height, int marginX, int marginY, int row, int isLastRow)
-{
-    // Extend FullPel Left and Right
-    extendCURowColBorder(src, srcStride, width, height, marginX);
-
-    // Extend FullPel Top
-    if (row == 0)
-    {
-        for(int y = 0; y < marginY; y++)
-        {
-            ::memcpy(src - marginX - (y + 1) * srcStride, src - marginX, sizeof(pixel) * (width + (marginX << 1)));
-        }
-    }
-
-    // Extend FullPel Bottom
-    if (isLastRow)
-    {
-        for(int y = 0; y < marginY; y++)
-        {
-            ::memcpy(src - marginX + (height + y) * srcStride, src - marginX + (height - 1) * srcStride, sizeof(pixel) * (width + (marginX << 1)));
-        }
-    }
-
-    filterHorizontal_p_s<8>(src - 4, srcStride, midA - 4, midStride, width + 7, height, g_lumaFilter[1]);
-    filterHorizontal_p_s<8>(src - 4, srcStride, midB - 4, midStride, width + 7, height, g_lumaFilter[2]);
-    filterHorizontal_p_s<8>(src - 4, srcStride, midC - 4, midStride, width + 7, height, g_lumaFilter[3]);
-    filterConvertShortToPel(midA - 4, midStride, dstA - 4, srcStride, width + 7, height);
-    filterConvertShortToPel(midB - 4, midStride, dstB - 4, srcStride, width + 7, height);
-    filterConvertShortToPel(midC - 4, midStride, dstC - 4, srcStride, width + 7, height);
-
-    // Extend SubPel Left and Right
-    for(int y = 0; y < height; y++)
-    {
-        for(int x = 0; x < marginX; x++)
-        {
-            // Left
-            if (x < marginX - 4)
-            {
-                dstA[y * srcStride - marginX + x] = dstA[y * srcStride - 4];
-                dstB[y * srcStride - marginX + x] = dstB[y * srcStride - 4];
-                dstC[y * srcStride - marginX + x] = dstC[y * srcStride - 4];
-            }
-
-            // Right
-            if (x > 2)
-            {
-                dstA[y * srcStride + width + x] = dstA[y * srcStride + width + 2];
-                dstB[y * srcStride + width + x] = dstB[y * srcStride + width + 2];
-                dstC[y * srcStride + width + x] = dstC[y * srcStride + width + 2];
-            }
-        }
-    }
-
-    if (row == 0)
-    {
-        // Extend SubPel Top
-        for(int y = 0; y < marginY; y++)
-        {
-            ::memcpy(dstA - marginX - (y + 1) * srcStride, dstA - marginX, sizeof(pixel) * srcStride);
-            ::memcpy(dstB - marginX - (y + 1) * srcStride, dstB - marginX, sizeof(pixel) * srcStride);
-            ::memcpy(dstC - marginX - (y + 1) * srcStride, dstC - marginX, sizeof(pixel) * srcStride);
-        }
-
-        // Extend midPel Top(7 rows)
-        for(int y = 0; y < 7; y++)
-        {
-            ::memcpy(midA - 4 - (y + 1) * midStride, midA - 4, midStride * sizeof(short));
-            ::memcpy(midB - 4 - (y + 1) * midStride, midB - 4, midStride * sizeof(short));
-            ::memcpy(midC - 4 - (y + 1) * midStride, midC - 4, midStride * sizeof(short));
-        }
-    }
-
-    if (isLastRow)
-    {
-        // Extend SubPel Bottom
-        for(int y = 0; y < marginY; y++)
-        {
-            ::memcpy(dstA - marginX + (height + y) * srcStride, dstA - marginX + (height - 1) * srcStride, sizeof(pixel) * srcStride);
-            ::memcpy(dstB - marginX + (height + y) * srcStride, dstB - marginX + (height - 1) * srcStride, sizeof(pixel) * srcStride);
-            ::memcpy(dstC - marginX + (height + y) * srcStride, dstC - marginX + (height - 1) * srcStride, sizeof(pixel) * srcStride);
-        }
-
-        // Extend midPel Bottom(7 rows)
-        for(int y = 0; y < 7; y++)
-        {
-            ::memcpy(midA - 4 + (height + y) * midStride, midA - 4 + (height - 1) * midStride, midStride * sizeof(short));
-            ::memcpy(midB - 4 + (height + y) * midStride, midB - 4 + (height - 1) * midStride, midStride * sizeof(short));
-            ::memcpy(midC - 4 + (height + y) * midStride, midC - 4 + (height - 1) * midStride, midStride * sizeof(short));
-        }
-    }
-}
-
-void filterRowV_0(pixel *src, intptr_t srcStride, pixel *dstA, pixel *dstB, pixel *dstC, int width, int height, int marginX, int marginY, int row, int isLastRow)
-{
-    int row_first = (row == 0 ? 4 : 0);
-    int row_last = (isLastRow ? 3 : 0);
-
-    filterVertical_p_p<8>(src - row_first * srcStride, srcStride, dstA - row_first * srcStride, srcStride, width, height + row_first + row_last, g_lumaFilter[1]);
-    filterVertical_p_p<8>(src - row_first * srcStride, srcStride, dstB - row_first * srcStride, srcStride, width, height + row_first + row_last, g_lumaFilter[2]);
-    filterVertical_p_p<8>(src - row_first * srcStride, srcStride, dstC - row_first * srcStride, srcStride, width, height + row_first + row_last, g_lumaFilter[3]);
-
-    // Extend SubPel Left and Right
-    extendCURowColBorder(dstA - row_first * srcStride, srcStride, width, height + row_first + row_last, marginX);
-    extendCURowColBorder(dstB - row_first * srcStride, srcStride, width, height + row_first + row_last, marginX);
-    extendCURowColBorder(dstC - row_first * srcStride, srcStride, width, height + row_first + row_last, marginX);
-
-    if (row == 0)
-    {
-        // Extend SubPel Top
-        for(int y = row_first; y < marginY; y++)
-        {
-            ::memcpy(dstA - marginX - (y + 1) * srcStride, dstA - marginX - row_first * srcStride, sizeof(pixel) * srcStride);
-            ::memcpy(dstB - marginX - (y + 1) * srcStride, dstB - marginX - row_first * srcStride, sizeof(pixel) * srcStride);
-            ::memcpy(dstC - marginX - (y + 1) * srcStride, dstC - marginX - row_first * srcStride, sizeof(pixel) * srcStride);
-        }
-    }
-
-    if (isLastRow)
-    {
-        // Extend SubPel Bottom
-        for(int y = row_last; y < marginY; y++)
-        {
-            ::memcpy(dstA - marginX + (height + y) * srcStride, dstA - marginX + (height - 1 + row_last) * srcStride, sizeof(pixel) * srcStride);
-            ::memcpy(dstB - marginX + (height + y) * srcStride, dstB - marginX + (height - 1 + row_last) * srcStride, sizeof(pixel) * srcStride);
-            ::memcpy(dstC - marginX + (height + y) * srcStride, dstC - marginX + (height - 1 + row_last) * srcStride, sizeof(pixel) * srcStride);
-        }
-    }
-}
-
-void filterRowV_N(short *midA, intptr_t midStride, pixel *dstA, pixel *dstB, pixel *dstC, intptr_t dstStride, int width, int height, int marginX, int marginY, int row, int isLastRow)
-{
-    int row_first = (row == 0 ? 4 : 0);
-    int row_last = (isLastRow ? 3 : 0);
-
-    filterVertical_s_p<8>(midA - 4 - row_first * midStride, midStride, dstA - 4 - row_first * dstStride, dstStride, width + 7, height + row_first + row_last, g_lumaFilter[1]);
-    filterVertical_s_p<8>(midA - 4 - row_first * midStride, midStride, dstB - 4 - row_first * dstStride, dstStride, width + 7, height + row_first + row_last, g_lumaFilter[2]);
-    filterVertical_s_p<8>(midA - 4 - row_first * midStride, midStride, dstC - 4 - row_first * dstStride, dstStride, width + 7, height + row_first + row_last, g_lumaFilter[3]);
-
-    // Extend SubPel Left and Right
-    for(int y = 0; y < height + row_first + row_last; y++)
-    {
-        for(int x = 0; x < marginX; x++)
-        {
-            // Left
-            if (x < marginX - 4)
-            {
-                dstA[(y - row_first) * dstStride - marginX + x] = dstA[(y - row_first) * dstStride - 4];
-                dstB[(y - row_first) * dstStride - marginX + x] = dstB[(y - row_first) * dstStride - 4];
-                dstC[(y - row_first) * dstStride - marginX + x] = dstC[(y - row_first) * dstStride - 4];
-            }
-
-            // Right
-            if (x > 2)
-            {
-                dstA[(y - row_first) * dstStride + width + x] = dstA[(y - row_first) * dstStride + width + 2];
-                dstB[(y - row_first) * dstStride + width + x] = dstB[(y - row_first) * dstStride + width + 2];
-                dstC[(y - row_first) * dstStride + width + x] = dstC[(y - row_first) * dstStride + width + 2];
-            }
-        }
-    }
-
-    if (row == 0)
-    {
-        // Extend SubPel Top
-        for(int y = row_first; y < marginY; y++)
-        {
-            ::memcpy(dstA - marginX - (y + 1) * dstStride, dstA - marginX - row_first * dstStride, sizeof(pixel) * dstStride);
-            ::memcpy(dstB - marginX - (y + 1) * dstStride, dstB - marginX - row_first * dstStride, sizeof(pixel) * dstStride);
-            ::memcpy(dstC - marginX - (y + 1) * dstStride, dstC - marginX - row_first * dstStride, sizeof(pixel) * dstStride);
-        }
-    }
-
-    if (isLastRow)
-    {
-        // Extend SubPel Bottom
-        for(int y = row_last; y < marginY; y++)
-        {
-            ::memcpy(dstA - marginX + (height + y) * dstStride, dstA - marginX + (height - 1 + row_last) * dstStride, sizeof(pixel) * dstStride);
-            ::memcpy(dstB - marginX + (height + y) * dstStride, dstB - marginX + (height - 1 + row_last) * dstStride, sizeof(pixel) * dstStride);
-            ::memcpy(dstC - marginX + (height + y) * dstStride, dstC - marginX + (height - 1 + row_last) * dstStride, sizeof(pixel) * dstStride);
-        }
-    }
-}
-
 namespace x265 {
 // x265 private namespace
 
@@ -700,10 +516,6 @@
     p.ipfilter_p2s = filterConvertPelToShort;
     p.ipfilter_s2p = filterConvertShortToPel;
 
-    p.filterRowH = filterRowH;
-    p.filterRowV_0 = filterRowV_0;
-    p.filterRowV_N = filterRowV_N;
-
     p.extendRowBorder = extendCURowColBorder;
 }
 }
diff -r 15c6e2451b34 -r 250299f41221 source/common/primitives.h
--- a/source/common/primitives.h	Sun Oct 06 22:30:10 2013 -0500
+++ b/source/common/primitives.h	Sun Oct 06 22:32:55 2013 -0500
@@ -219,17 +219,12 @@
 typedef void (*dequant_t)(const int* src, int* dst, int width, int height, int mcqp_miper, int mcqp_mirem, bool useScalingList,
                           unsigned int trSizeLog2, int *dequantCoef);
 
-typedef void (*filterRowH_t)(pixel *src, intptr_t srcStride, short* midA, short* midB, short* midC, intptr_t midStride, pixel *dstA, pixel *dstB, pixel *dstC, int width, int height, int marginX, int marginY, int row, int isLastRow);
-typedef void (*filterRowV_0_t)(pixel *src, intptr_t srcStride, pixel *dstA, pixel *dstB, pixel *dstC, int width, int height, int marginX, int marginY, int row, int isLastRow);
-typedef void (*filterRowV_N_t)(short *midA, intptr_t midStride, pixel *dstA, pixel *dstB, pixel *dstC, intptr_t dstStride, int width, int height, int marginX, int marginY, int row, int isLastRow);
-typedef void (*extendCURowBorder_t)(pixel* txt, intptr_t stride, int width, int height, int marginX);
-
-
 typedef void (*weightpUniPixel_t)(pixel *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset);
 typedef void (*weightpUni_t)(int16_t *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset);
 typedef void (*scale_t)(pixel *dst, pixel *src, intptr_t stride);
 typedef void (*downscale_t)(pixel *src0, pixel *dstf, pixel *dsth, pixel *dstv, pixel *dstc,
                             intptr_t src_stride, intptr_t dst_stride, int width, int height);
+typedef void (*extendCURowBorder_t)(pixel* txt, intptr_t stride, int width, int height, int marginX);
 
 /* Define a structure containing function pointers to optimized encoder
  * primitives.  Each pointer can reference either an assembly routine,
@@ -263,9 +258,6 @@
     ipfilter_ss_t   ipfilter_ss[NUM_IPFILTER_S_S];
     ipfilter_p2s_t  ipfilter_p2s;
     ipfilter_s2p_t  ipfilter_s2p;
-    filterRowH_t    filterRowH;
-    filterRowV_0_t  filterRowV_0;
-    filterRowV_N_t  filterRowV_N;
     extendCURowBorder_t extendRowBorder;
 
     intra_dc_t      intra_pred_dc;


More information about the x265-devel mailing list