shithub: openh264

Download patch

ref: 0fd900be473e035dd16a490e83fd359c78b7d4e8
parent: 8fcef67c70e37e3cb207a26e374a79334eda8bf7
author: Karina <[email protected]>
date: Fri Aug 5 13:09:10 EDT 2016

fix build issue when disable AVX2 assembly

--- a/codec/encoder/core/src/decode_mb_aux.cpp
+++ b/codec/encoder/core/src/decode_mb_aux.cpp
@@ -270,10 +270,13 @@
     pFuncList->pfIDctFourT4     = WelsIDctFourT4Rec_sse2;
     pFuncList->pfIDctI16x16Dc   = WelsIDctRecI16x16Dc_sse2;
   }
+#if defined(HAVE_AVX2)
   if (uiCpuFlag & WELS_CPU_AVX2) {
     pFuncList->pfIDctT4     = WelsIDctT4Rec_avx2;
     pFuncList->pfIDctFourT4 = WelsIDctFourT4Rec_avx2;
   }
+#endif
+
 #endif//X86_ASM
 
 #if defined(HAVE_NEON)
--- a/codec/encoder/core/src/encode_mb_aux.cpp
+++ b/codec/encoder/core/src/encode_mb_aux.cpp
@@ -526,6 +526,7 @@
   if (uiCpuFlag & WELS_CPU_SSE42) {
     pFuncList->pfGetNoneZeroCount       = WelsGetNoneZeroCount_sse42;
   }
+#if defined(HAVE_AVX2)
   if (uiCpuFlag & WELS_CPU_AVX2) {
     pFuncList->pfDctT4                  = WelsDctT4_avx2;
     pFuncList->pfDctFourT4              = WelsDctFourT4_avx2;
@@ -535,7 +536,7 @@
     pFuncList->pfQuantizationFour4x4    = WelsQuantFour4x4_avx2;
     pFuncList->pfQuantizationFour4x4Max = WelsQuantFour4x4Max_avx2;
   }
-
+#endif
 //#endif//MACOS
 
 #endif//X86_ASM
--- a/codec/encoder/core/src/sample.cpp
+++ b/codec/encoder/core/src/sample.cpp
@@ -404,7 +404,7 @@
     pFuncList->sSampleDealingFuncs.pfIntra16x16Combined3Satd = WelsIntra16x16Combined3Satd_sse41;
     pFuncList->sSampleDealingFuncs.pfIntra8x8Combined3Satd = WelsIntraChroma8x8Combined3Satd_sse41;
   }
-
+#if defined(HAVE_AVX2)
   if (uiCpuFlag & WELS_CPU_AVX2) {
     pFuncList->sSampleDealingFuncs.pfSampleSatd[BLOCK_16x16] = WelsSampleSatd16x16_avx2;
     pFuncList->sSampleDealingFuncs.pfSampleSatd[BLOCK_16x8]  = WelsSampleSatd16x8_avx2;
@@ -411,7 +411,7 @@
     pFuncList->sSampleDealingFuncs.pfSampleSatd[BLOCK_8x16]  = WelsSampleSatd8x16_avx2;
     pFuncList->sSampleDealingFuncs.pfSampleSatd[BLOCK_8x8]   = WelsSampleSatd8x8_avx2;
   }
-
+#endif
 #endif //(X86_ASM)
 
 #if defined (HAVE_NEON)
--- a/codec/processing/src/vaacalc/vaacalculation.cpp
+++ b/codec/processing/src/vaacalc/vaacalculation.cpp
@@ -64,6 +64,7 @@
     sVaaFuncs.pfVAACalcSadSsdBgd = VAACalcSadSsdBgd_sse2;
     sVaaFuncs.pfVAACalcSadVar    = VAACalcSadVar_sse2;
   }
+#ifdef HAVE_AVX2
   if (iCpuFlag & WELS_CPU_AVX2) {
     sVaaFuncs.pfVAACalcSad       = VAACalcSad_avx2;
     sVaaFuncs.pfVAACalcSadBgd    = VAACalcSadBgd_avx2;
@@ -71,6 +72,7 @@
     sVaaFuncs.pfVAACalcSadSsdBgd = VAACalcSadSsdBgd_avx2;
     sVaaFuncs.pfVAACalcSadVar    = VAACalcSadVar_avx2;
   }
+#endif
 #endif//X86_ASM
 #ifdef HAVE_NEON
   if ((iCpuFlag & WELS_CPU_NEON) == WELS_CPU_NEON) {