[x265] [PATCH 2 of 3] Adding C primitive for chroma vss filter functions

nabajit at multicorewareinc.com nabajit at multicorewareinc.com
Fri Nov 15 12:31:27 CET 2013


# HG changeset patch
# User Nabajit Deka
# Date 1384514673 -19800
#      Fri Nov 15 16:54:33 2013 +0530
# Node ID 583a306d9d644682c966b7e25a1ddd30c1aa2455
# Parent  98bb7d2f07c89a241d8ba9c1d4f145e1feb62307
Adding C primitive for chroma vss filter functions

diff -r 98bb7d2f07c8 -r 583a306d9d64 source/common/ipfilter.cpp
--- a/source/common/ipfilter.cpp	Fri Nov 15 16:53:18 2013 +0530
+++ b/source/common/ipfilter.cpp	Fri Nov 15 16:54:33 2013 +0530
@@ -468,6 +468,41 @@
     }
 }
 
+template<int N, int width, int height>
+void interp_vert_ss_c(int16_t *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride, int coeffIdx)
+{
+    const int16_t *const c = (N == 8 ? g_lumaFilter[coeffIdx] : g_chromaFilter[coeffIdx]);
+    int shift = IF_FILTER_PREC;
+    int row, col;
+
+    src -= (N / 2 - 1) * srcStride;
+    for (row = 0; row < height; row++)
+    {
+        for (col = 0; col < width; col++)
+        {
+            int sum;
+
+            sum  = src[col + 0 * srcStride] * c[0];
+            sum += src[col + 1 * srcStride] * c[1];
+            sum += src[col + 2 * srcStride] * c[2];
+            sum += src[col + 3 * srcStride] * c[3];
+            if (N == 8)
+            {
+                sum += src[col + 4 * srcStride] * c[4];
+                sum += src[col + 5 * srcStride] * c[5];
+                sum += src[col + 6 * srcStride] * c[6];
+                sum += src[col + 7 * srcStride] * c[7];
+            }
+
+            int16_t val = (int16_t)((sum) >> shift);
+            dst[col] = val;
+        }
+
+        src += srcStride;
+        dst += dstStride;
+    }
+}
+
 typedef void (*ipfilter_ps_t)(pixel *src, intptr_t srcStride, short *dst, intptr_t dstStride, int width, int height, const short *coeff);
 typedef void (*ipfilter_sp_t)(short *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int width, int height, const short *coeff);
 
@@ -489,7 +524,8 @@
     p.chroma_hps[CHROMA_ ## W ## x ## H] = interp_horiz_ps_c<4, W, H>; \
     p.chroma_vpp[CHROMA_ ## W ## x ## H] = interp_vert_pp_c < 4, W, H >; \
     p.chroma_vps[CHROMA_ ## W ## x ## H] = interp_vert_ps_c<4, W, H>; \
-    p.chroma_vsp[CHROMA_ ## W ## x ## H] = interp_vert_sp_c < 4, W, H >
+    p.chroma_vsp[CHROMA_ ## W ## x ## H] = interp_vert_sp_c < 4, W, H >; \
+    p.chroma_vss[CHROMA_ ## W ## x ## H] = interp_vert_ss_c < 4, W, H >;
 
 #define LUMA(W, H) \
     p.luma_hpp[LUMA_ ## W ## x ## H]     = interp_horiz_pp_c<8, W, H>; \


More information about the x265-devel mailing list