[x265-commits] [x265] vec: fix compile warnings with clang at 16bpp - remove de...

Steve Borho steve at borho.org
Wed Nov 20 21:43:40 CET 2013


details:   http://hg.videolan.org/x265/rev/f7590776c5b2
branches:  
changeset: 5206:f7590776c5b2
user:      Steve Borho <steve at borho.org>
date:      Wed Nov 20 14:42:59 2013 -0600
description:
vec: fix compile warnings with clang at 16bpp - remove dead functions

diffstat:

 source/common/vec/blockcopy-sse3.cpp |    5 +-
 source/common/vec/dct-sse3.cpp       |    3 +-
 source/common/vec/dct-sse41.cpp      |    4 +-
 source/common/vec/dct-ssse3.cpp      |    2 +
 source/common/vec/intra-sse41.cpp    |    3 +-
 source/common/vec/intra-ssse3.cpp    |  546 +----------------------------------
 6 files changed, 18 insertions(+), 545 deletions(-)

diffs (truncated from 755 to 300 lines):

diff -r c75b72fcd284 -r f7590776c5b2 source/common/vec/blockcopy-sse3.cpp
--- a/source/common/vec/blockcopy-sse3.cpp	Wed Nov 20 19:48:22 2013 +0530
+++ b/source/common/vec/blockcopy-sse3.cpp	Wed Nov 20 14:42:59 2013 -0600
@@ -130,7 +130,6 @@ void blockcopy_ps(int bx, int by, pixel 
         }
     }
 }
-#endif /* if HIGH_BIT_DEPTH */
 
 void blockcopy_sp(int bx, int by, int16_t *dst, intptr_t dstride, uint8_t *src, intptr_t sstride)
 {
@@ -218,6 +217,7 @@ void pixelsub_ps(int bx, int by, int16_t
         }
     }
 }
+#endif /* if HIGH_BIT_DEPTH */
 
 void pixeladd_ss(int bx, int by, int16_t *dst, intptr_t dstride, int16_t *src0, int16_t *src1, intptr_t sstride0, intptr_t sstride1)
 {
@@ -306,9 +306,6 @@ void Setup_Vec_BlockCopyPrimitives_sse3(
     p.blockcpy_pp = blockcopy_pp;
     p.blockcpy_ps = (blockcpy_ps_t)blockcopy_pp;
     p.blockcpy_sp = (blockcpy_sp_t)blockcopy_pp;
-#endif
-
-#if HIGH_BIT_DEPTH
     // At high bit depth, a pixel is a short
     p.pixeladd_ss = pixeladd_ss;
 #else
diff -r c75b72fcd284 -r f7590776c5b2 source/common/vec/dct-sse3.cpp
--- a/source/common/vec/dct-sse3.cpp	Wed Nov 20 19:48:22 2013 +0530
+++ b/source/common/vec/dct-sse3.cpp	Wed Nov 20 14:42:59 2013 -0600
@@ -122,8 +122,6 @@ void dct4(int16_t *src, int32_t *dst, in
     _mm_storeu_si128((__m128i*)&dst[3 * 4], T73);
 }
 
-#endif // if !HIGH_BIT_DEPTH
-
 ALIGN_VAR_32(static const int16_t, tab_idct_4x4[4][8]) =
 {
     { 64,  64, 64,  64, 64,  64, 64,  64 },
@@ -1731,6 +1729,7 @@ void idct32(int32_t *src, int16_t *dst, 
 #undef STORE_LINE
     }
 }
+#endif
 }
 
 namespace x265 {
diff -r c75b72fcd284 -r f7590776c5b2 source/common/vec/dct-sse41.cpp
--- a/source/common/vec/dct-sse41.cpp	Wed Nov 20 19:48:22 2013 +0530
+++ b/source/common/vec/dct-sse41.cpp	Wed Nov 20 14:42:59 2013 -0600
@@ -159,6 +159,7 @@ void dequant(const int32_t* quantCoef, i
     }
 }
 
+#if !HIGH_BIT_DEPTH
 ALIGN_VAR_32(static const int16_t, tab_idst_4x4[8][8]) =
 {
     {   29, +84, 29,  +84,  29, +84,  29, +84 },
@@ -266,6 +267,7 @@ void idst4(int32_t *src, int16_t *dst, i
     _mm_storel_epi64((__m128i*)&dst[2 * stride], m128iBD);
     _mm_storeh_pi((__m64*)&dst[3 * stride], _mm_castsi128_ps(m128iBD));
 }
+#endif
 }
 
 namespace x265 {
@@ -273,7 +275,7 @@ void Setup_Vec_DCTPrimitives_sse41(Encod
 {
     p.dequant = dequant;
 #if !HIGH_BIT_DEPTH
-    p.idct[IDST_4x4] = idst4;
+    p.idct[IDST_4x4] = idst4; // fails with 10bit inputs
 #endif
 }
 }
diff -r c75b72fcd284 -r f7590776c5b2 source/common/vec/dct-ssse3.cpp
--- a/source/common/vec/dct-ssse3.cpp	Wed Nov 20 19:48:22 2013 +0530
+++ b/source/common/vec/dct-ssse3.cpp	Wed Nov 20 14:42:59 2013 -0600
@@ -39,6 +39,7 @@
 
 using namespace x265;
 
+#if !HIGH_BIT_DEPTH
 namespace {
 ALIGN_VAR_32(static const int16_t, tab_dst_4[][8]) =
 {
@@ -1340,6 +1341,7 @@ void dct32(int16_t *src, int32_t *dst, i
     }
 }
 }
+#endif
 
 namespace x265 {
 void Setup_Vec_DCTPrimitives_ssse3(EncoderPrimitives &p)
diff -r c75b72fcd284 -r f7590776c5b2 source/common/vec/intra-sse41.cpp
--- a/source/common/vec/intra-sse41.cpp	Wed Nov 20 19:48:22 2013 +0530
+++ b/source/common/vec/intra-sse41.cpp	Wed Nov 20 14:42:59 2013 -0600
@@ -620,8 +620,6 @@ void intra_pred_planar(pixel* above, pix
     intraPlanarN[nLog2Size - 2](above, left, dst, dstStride);
 }
 
-#endif // if !HIGH_BIT_DEPTH
-
 ALIGN_VAR_32(static const unsigned char, tab_angle_0[][16]) =
 {
     { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 },         //  0
@@ -8698,6 +8696,7 @@ void predIntraAngs32(pixel *dst0, pixel 
 #undef HALF
 #undef N
 }
+#endif // if !HIGH_BIT_DEPTH
 }
 
 namespace x265 {
diff -r c75b72fcd284 -r f7590776c5b2 source/common/vec/intra-ssse3.cpp
--- a/source/common/vec/intra-ssse3.cpp	Wed Nov 20 19:48:22 2013 +0530
+++ b/source/common/vec/intra-ssse3.cpp	Wed Nov 20 14:42:59 2013 -0600
@@ -34,6 +34,7 @@
 using namespace x265;
 
 namespace {
+#if !HIGH_BIT_DEPTH
 const int angAP[17][64] =
 {
     {
@@ -91,7 +92,6 @@ const int angAP[17][64] =
 
 #define GETAP(X, Y) angAP[8 - (X)][(Y)]
 
-#if !HIGH_BIT_DEPTH
 #define PRED_INTRA_ANGLE_4_START() \
     __m128i row11, row12, row21, row22, row31, row32, row41, row42; \
     __m128i tmp16_1, tmp16_2, tmp2, deltaFract; \
@@ -3203,7 +3203,6 @@ void intra_pred_ang(pixel* dst, int dstS
         return;
     }
 }
-
 #endif // !HIGH_BIT_DEPTH
 }
 
@@ -3212,7 +3211,6 @@ void intra_pred_ang(pixel* dst, int dstS
 #if defined(_MSC_VER)
 #define ALWAYSINLINE  __forceinline
 #endif
-
 #define INSTRSET 3
 #include "vectorclass.h"
 
@@ -3269,41 +3267,6 @@ inline void predDCFiltering(pixel* above
         im2 = (im1 + im2) >> const_int(2);
         im2.store(&dst[1 + 24]);
         break;
-
-    //case 64:
-    default:
-        im2.load(&above[1]);
-        im2 = (im1 + im2) >> const_int(2);
-        im2.store(&dst[1]);
-
-        im2.load(&above[1 + 8]);
-        im2 = (im1 + im2) >> const_int(2);
-        im2.store(&dst[1 + 8]);
-
-        im2.load(&above[1 + 16]);
-        im2 = (im1 + im2) >> const_int(2);
-        im2.store(&dst[1 + 16]);
-
-        im2.load(&above[1 + 24]);
-        im2 = (im1 + im2) >> const_int(2);
-        im2.store(&dst[1 + 24]);
-
-        im2.load(&above[1 + 32]);
-        im2 = (im1 + im2) >> const_int(2);
-        im2.store(&dst[1 + 32]);
-
-        im2.load(&above[1 + 40]);
-        im2 = (im1 + im2) >> const_int(2);
-        im2.store(&dst[1 + 40]);
-
-        im2.load(&above[1 + 48]);
-        im2 = (im1 + im2) >> const_int(2);
-        im2.store(&dst[1 + 48]);
-
-        im2.load(&above[1 + 56]);
-        im2 = (im1 + im2) >> const_int(2);
-        im2.store(&dst[1 + 56]);
-        break;
     }
 
     for (y = 1; y < width; y++)
@@ -3313,7 +3276,8 @@ inline void predDCFiltering(pixel* above
     }
 }
 
-void intra_pred_dc(pixel* above, pixel* left, pixel* dst, intptr_t dstStride, int width, int filter)
+template<int width>
+void intra_pred_dc(pixel* above, pixel* left, pixel* dst, intptr_t dstStride, int filter)
 {
     int sum;
     int logSize = g_convertToBit[width] + 2;
@@ -3328,12 +3292,14 @@ void intra_pred_dc(pixel* above, pixel* 
         sumLeft  = load_partial(const_int(8), left);
         sumAbove = load_partial(const_int(8), above);
         break;
+
     case 8:
         m0.load(left);
         sumLeft = m0;
         m0.load(above);
         sumAbove = m0;
         break;
+
     case 16:
         m0.load(left);
         sumLeft  = m0;
@@ -3345,6 +3311,7 @@ void intra_pred_dc(pixel* above, pixel* 
         m0.load(above + 8);
         sumAbove += m0;
         break;
+
     case 32:
         m0.load(left);
         sumLeft  = m0;
@@ -3364,43 +3331,6 @@ void intra_pred_dc(pixel* above, pixel* 
         m0.load(above + 24);
         sumAbove += m0;
         break;
-    //case 64:
-    default:
-        // CHECK_ME: the max support bit_depth is 13-bits
-        m0.load(left);
-        sumLeft  = m0;
-        m0.load(left + 8);
-        sumLeft += m0;
-        m0.load(left + 16);
-        sumLeft += m0;
-        m0.load(left + 24);
-        sumLeft += m0;
-        m0.load(left + 32);
-        sumLeft += m0;
-        m0.load(left + 40);
-        sumLeft += m0;
-        m0.load(left + 48);
-        sumLeft += m0;
-        m0.load(left + 56);
-        sumLeft += m0;
-
-        m0.load(above);
-        sumAbove  = m0;
-        m0.load(above + 8);
-        sumAbove += m0;
-        m0.load(above + 16);
-        sumAbove += m0;
-        m0.load(above + 24);
-        sumAbove += m0;
-        m0.load(above + 32);
-        sumAbove += m0;
-        m0.load(above + 40);
-        sumAbove += m0;
-        m0.load(above + 48);
-        sumAbove += m0;
-        m0.load(above + 56);
-        sumAbove += m0;
-        break;
     }
 
     sum = horizontal_add_x(sumAbove) + horizontal_add_x(sumLeft);
@@ -3465,24 +3395,6 @@ void intra_pred_dc(pixel* above, pixel* 
             dcValN.store(dst1 + 24);
             dst1 += dstStride;
         }
-
-        break;
-
-    //case 64:
-    default:
-        for (k = 0; k < 64; k++)
-        {
-            dcValN.store(dst1);
-            dcValN.store(dst1 +  8);
-            dcValN.store(dst1 + 16);
-            dcValN.store(dst1 + 24);
-            dcValN.store(dst1 + 32);
-            dcValN.store(dst1 + 40);
-            dcValN.store(dst1 + 48);
-            dcValN.store(dst1 + 56);
-            dst1 += dstStride;
-        }
-
         break;
     }
 
@@ -3491,447 +3403,6 @@ void intra_pred_dc(pixel* above, pixel* 
         predDCFiltering(above, left, dst, dstStride, width);
     }
 }
-


More information about the x265-commits mailing list