Skip to content

Effort free video editing!

2.3 KB
Raw Blame
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -58,7 +58,7 @@
 list(FIND POWER_ALIASES "${SYSPROC}" POWERMATCH)
 list(FIND RISCV64_ALIASES "${SYSPROC}" RISCV64MATCH)
 list(FIND LOONGARCH64_ALIASES "${SYSPROC}" LOONGARCH64MATCH)
-if(X86MATCH GREATER "-1")
+if(X86MATCH GREATER "-1" AND NOT EMSCRIPTEN)
     set(X86 1)
     add_definitions(-DX265_ARCH_X86=1)
     if(CMAKE_CXX_FLAGS STREQUAL "-m32")
--- a/source/common/CMakeLists.txt
+++ b/source/common/CMakeLists.txt
@@ -15,6 +15,8 @@
 
 if(ENABLE_ASSEMBLY)
     set_source_files_properties(threading.cpp primitives.cpp pixel.cpp PROPERTIES COMPILE_FLAGS -DENABLE_ASSEMBLY=1)
+    # Assembly overrides most of these C primitives; -O3 bloats them 3-8x
+    set_source_files_properties(ipfilter.cpp pixel.cpp PROPERTIES COMPILE_OPTIONS -Os)
     list(APPEND VFLAGS "-DENABLE_ASSEMBLY=1")
 endif(ENABLE_ASSEMBLY)
 
--- a/source/common/cpu.cpp
+++ b/source/common/cpu.cpp
@@ -177,6 +177,8 @@
 
 uint32_t cpu_detect(bool benableavx512 )
 {
+    /* No AVX-512 kernels are assembled, see strip_avx512_asm.nim */
+    benableavx512 = false;
 
     uint32_t cpu = 0;
     uint32_t eax, ebx, ecx, edx;
--- a/source/common/x86/asm-primitives.cpp
+++ b/source/common/x86/asm-primitives.cpp
@@ -2359,6 +2359,7 @@
     }
     if (cpuMask & X265_CPU_AVX512)
     {
+#if 0 /* not assembled, see strip_avx512_asm.nim */
         p.cu[BLOCK_16x16].var = PFX(pixel_var_16x16_avx512);
         p.cu[BLOCK_32x32].calcresidual[NONALIGNED] = PFX(getResidual32_avx512);
         p.cu[BLOCK_32x32].calcresidual[ALIGNED] = PFX(getResidual_aligned32_avx512);
@@ -3193,6 +3194,7 @@
         p.chroma[X265_CSP_I422].cu[BLOCK_422_32x64].sse_pp = (pixel_sse_t)PFX(pixel_ssd_32x64_avx512);
         p.planecopy_sp_shl = PFX(upShift_16_avx512);
 
+#endif
     }
 #endif
 }
@@ -4744,6 +4746,7 @@
     }
     if (cpuMask & X265_CPU_AVX512)
     {
+#if 0 /* not assembled, see strip_avx512_asm.nim */
         p.pu[LUMA_32x8].sad = PFX(pixel_sad_32x8_avx512);
       //  p.pu[LUMA_32x16].sad = PFX(pixel_sad_32x16_avx512);
         p.pu[LUMA_32x24].sad = PFX(pixel_sad_32x24_avx512);
@@ -5434,6 +5437,7 @@
         p.cu[BLOCK_16x16].count_nonzero = PFX(count_nonzero_16x16_avx512);
         p.cu[BLOCK_32x32].count_nonzero = PFX(count_nonzero_32x32_avx512);
 
+#endif
     }
 #endif
 }