2016-10-17 15:14:07 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2020-03-30 06:28:32 +00:00
|
|
|
Import("env")
|
|
|
|
Import("env_modules")
|
2018-09-28 11:29:52 +00:00
|
|
|
|
|
|
|
# Thirdparty sources
|
|
|
|
|
2016-10-17 15:14:07 +00:00
|
|
|
libvpx_dir = "#thirdparty/libvpx/"
|
|
|
|
|
|
|
|
libvpx_sources = [
|
2016-10-30 17:44:57 +00:00
|
|
|
"vp8/vp8_dx_iface.c",
|
|
|
|
"vp8/common/generic/systemdependent.c",
|
|
|
|
"vp8/common/alloccommon.c",
|
|
|
|
"vp8/common/blockd.c",
|
|
|
|
"vp8/common/copy_c.c",
|
|
|
|
"vp8/common/debugmodes.c",
|
|
|
|
"vp8/common/dequantize.c",
|
|
|
|
"vp8/common/entropy.c",
|
|
|
|
"vp8/common/entropymode.c",
|
|
|
|
"vp8/common/entropymv.c",
|
|
|
|
"vp8/common/extend.c",
|
|
|
|
"vp8/common/filter.c",
|
|
|
|
"vp8/common/findnearmv.c",
|
|
|
|
"vp8/common/idct_blk.c",
|
|
|
|
"vp8/common/idctllm.c",
|
|
|
|
"vp8/common/loopfilter_filters.c",
|
|
|
|
"vp8/common/mbpitch.c",
|
|
|
|
"vp8/common/modecont.c",
|
|
|
|
"vp8/common/quant_common.c",
|
|
|
|
"vp8/common/reconinter.c",
|
|
|
|
"vp8/common/reconintra.c",
|
|
|
|
"vp8/common/reconintra4x4.c",
|
|
|
|
"vp8/common/rtcd.c",
|
|
|
|
"vp8/common/setupintrarecon.c",
|
|
|
|
"vp8/common/swapyv12buffer.c",
|
|
|
|
"vp8/common/treecoder.c",
|
|
|
|
"vp8/common/vp8_loopfilter.c",
|
|
|
|
"vp8/decoder/dboolhuff.c",
|
|
|
|
"vp8/decoder/decodeframe.c",
|
|
|
|
"vp8/decoder/decodemv.c",
|
|
|
|
"vp8/decoder/detokenize.c",
|
|
|
|
"vp8/decoder/onyxd_if.c",
|
|
|
|
"vp9/vp9_dx_iface.c",
|
|
|
|
"vp9/common/vp9_alloccommon.c",
|
|
|
|
"vp9/common/vp9_blockd.c",
|
|
|
|
"vp9/common/vp9_common_data.c",
|
|
|
|
"vp9/common/vp9_debugmodes.c",
|
|
|
|
"vp9/common/vp9_entropy.c",
|
|
|
|
"vp9/common/vp9_entropymode.c",
|
|
|
|
"vp9/common/vp9_entropymv.c",
|
|
|
|
"vp9/common/vp9_filter.c",
|
|
|
|
"vp9/common/vp9_frame_buffers.c",
|
|
|
|
"vp9/common/vp9_idct.c",
|
|
|
|
"vp9/common/vp9_loopfilter.c",
|
|
|
|
"vp9/common/vp9_mvref_common.c",
|
|
|
|
"vp9/common/vp9_pred_common.c",
|
|
|
|
"vp9/common/vp9_quant_common.c",
|
|
|
|
"vp9/common/vp9_reconinter.c",
|
|
|
|
"vp9/common/vp9_reconintra.c",
|
|
|
|
"vp9/common/vp9_rtcd.c",
|
|
|
|
"vp9/common/vp9_scale.c",
|
|
|
|
"vp9/common/vp9_scan.c",
|
|
|
|
"vp9/common/vp9_seg_common.c",
|
|
|
|
"vp9/common/vp9_thread_common.c",
|
|
|
|
"vp9/common/vp9_tile_common.c",
|
|
|
|
"vp9/decoder/vp9_decodeframe.c",
|
|
|
|
"vp9/decoder/vp9_decodemv.c",
|
|
|
|
"vp9/decoder/vp9_decoder.c",
|
|
|
|
"vp9/decoder/vp9_detokenize.c",
|
|
|
|
"vp9/decoder/vp9_dsubexp.c",
|
|
|
|
"vp9/decoder/vp9_dthread.c",
|
|
|
|
"vpx/src/vpx_codec.c",
|
|
|
|
"vpx/src/vpx_decoder.c",
|
|
|
|
"vpx/src/vpx_image.c",
|
|
|
|
"vpx/src/vpx_psnr.c",
|
|
|
|
"vpx_dsp/bitreader.c",
|
|
|
|
"vpx_dsp/bitreader_buffer.c",
|
|
|
|
"vpx_dsp/intrapred.c",
|
|
|
|
"vpx_dsp/inv_txfm.c",
|
|
|
|
"vpx_dsp/loopfilter.c",
|
|
|
|
"vpx_dsp/prob.c",
|
|
|
|
"vpx_dsp/vpx_convolve.c",
|
|
|
|
"vpx_dsp/vpx_dsp_rtcd.c",
|
|
|
|
"vpx_mem/vpx_mem.c",
|
|
|
|
"vpx_scale/vpx_scale_rtcd.c",
|
|
|
|
"vpx_scale/generic/yv12config.c",
|
|
|
|
"vpx_scale/generic/yv12extend.c",
|
2020-03-30 06:28:32 +00:00
|
|
|
"vpx_util/vpx_thread.c",
|
2016-10-17 15:14:07 +00:00
|
|
|
]
|
|
|
|
|
2018-08-27 02:08:04 +00:00
|
|
|
libvpx_sources_mt = [
|
|
|
|
"vp8/decoder/threading.c",
|
|
|
|
]
|
|
|
|
|
2016-10-17 15:14:07 +00:00
|
|
|
libvpx_sources_intrin_x86 = [
|
2016-10-30 17:44:57 +00:00
|
|
|
"vp8/common/x86/filter_x86.c",
|
|
|
|
"vp8/common/x86/loopfilter_x86.c",
|
|
|
|
"vp8/common/x86/vp8_asm_stubs.c",
|
2020-03-30 06:28:32 +00:00
|
|
|
"vpx_dsp/x86/vpx_asm_stubs.c",
|
2016-10-17 15:14:07 +00:00
|
|
|
]
|
|
|
|
libvpx_sources_intrin_x86_mmx = [
|
2016-10-30 17:44:57 +00:00
|
|
|
"vp8/common/x86/idct_blk_mmx.c",
|
2016-10-17 15:14:07 +00:00
|
|
|
]
|
|
|
|
libvpx_sources_intrin_x86_sse2 = [
|
2016-10-30 17:44:57 +00:00
|
|
|
"vp8/common/x86/idct_blk_sse2.c",
|
|
|
|
"vp9/common/x86/vp9_idct_intrin_sse2.c",
|
|
|
|
"vpx_dsp/x86/inv_txfm_sse2.c",
|
|
|
|
"vpx_dsp/x86/loopfilter_sse2.c",
|
2016-10-17 15:14:07 +00:00
|
|
|
]
|
2020-03-30 06:28:32 +00:00
|
|
|
libvpx_sources_intrin_x86_ssse3 = ["vpx_dsp/x86/vpx_subpixel_8t_intrin_ssse3.c"]
|
|
|
|
libvpx_sources_intrin_x86_avx2 = ["vpx_dsp/x86/loopfilter_avx2.c", "vpx_dsp/x86/vpx_subpixel_8t_intrin_avx2.c"]
|
2016-10-17 15:14:07 +00:00
|
|
|
libvpx_sources_x86asm = [
|
2016-10-30 17:44:57 +00:00
|
|
|
"vp8/common/x86/copy_sse2.asm",
|
|
|
|
"vp8/common/x86/copy_sse3.asm",
|
|
|
|
"vp8/common/x86/dequantize_mmx.asm",
|
|
|
|
"vp8/common/x86/idctllm_mmx.asm",
|
|
|
|
"vp8/common/x86/idctllm_sse2.asm",
|
|
|
|
"vp8/common/x86/iwalsh_mmx.asm",
|
|
|
|
"vp8/common/x86/iwalsh_sse2.asm",
|
|
|
|
"vp8/common/x86/loopfilter_sse2.asm",
|
|
|
|
"vp8/common/x86/recon_mmx.asm",
|
|
|
|
"vp8/common/x86/recon_sse2.asm",
|
|
|
|
"vp8/common/x86/subpixel_mmx.asm",
|
|
|
|
"vp8/common/x86/subpixel_sse2.asm",
|
|
|
|
"vp8/common/x86/subpixel_ssse3.asm",
|
|
|
|
"vp8/common/x86/vp8_loopfilter_mmx.asm",
|
|
|
|
"vpx_dsp/x86/intrapred_sse2.asm",
|
|
|
|
"vpx_dsp/x86/intrapred_ssse3.asm",
|
|
|
|
"vpx_dsp/x86/inv_wht_sse2.asm",
|
|
|
|
"vpx_dsp/x86/vpx_convolve_copy_sse2.asm",
|
|
|
|
"vpx_dsp/x86/vpx_subpixel_8t_sse2.asm",
|
|
|
|
"vpx_dsp/x86/vpx_subpixel_8t_ssse3.asm",
|
|
|
|
"vpx_dsp/x86/vpx_subpixel_bilinear_sse2.asm",
|
|
|
|
"vpx_dsp/x86/vpx_subpixel_bilinear_ssse3.asm",
|
2020-03-30 06:28:32 +00:00
|
|
|
"vpx_ports/emms.asm",
|
2016-10-17 15:14:07 +00:00
|
|
|
]
|
2020-03-30 06:28:32 +00:00
|
|
|
libvpx_sources_x86_64asm = ["vp8/common/x86/loopfilter_block_sse2_x86_64.asm", "vpx_dsp/x86/inv_txfm_ssse3_x86_64.asm"]
|
2016-10-17 15:14:07 +00:00
|
|
|
|
|
|
|
libvpx_sources_arm = [
|
2016-10-30 17:44:57 +00:00
|
|
|
"vpx_ports/arm_cpudetect.c",
|
|
|
|
"vp8/common/arm/loopfilter_arm.c",
|
2016-10-17 15:14:07 +00:00
|
|
|
]
|
|
|
|
libvpx_sources_arm_neon = [
|
2016-10-30 17:44:57 +00:00
|
|
|
"vp8/common/arm/neon/bilinearpredict_neon.c",
|
|
|
|
"vp8/common/arm/neon/copymem_neon.c",
|
|
|
|
"vp8/common/arm/neon/dc_only_idct_add_neon.c",
|
|
|
|
"vp8/common/arm/neon/dequant_idct_neon.c",
|
|
|
|
"vp8/common/arm/neon/dequantizeb_neon.c",
|
|
|
|
"vp8/common/arm/neon/idct_blk_neon.c",
|
|
|
|
"vp8/common/arm/neon/idct_dequant_0_2x_neon.c",
|
|
|
|
"vp8/common/arm/neon/idct_dequant_full_2x_neon.c",
|
|
|
|
"vp8/common/arm/neon/iwalsh_neon.c",
|
|
|
|
"vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.c",
|
|
|
|
"vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.c",
|
|
|
|
"vp8/common/arm/neon/mbloopfilter_neon.c",
|
|
|
|
"vp8/common/arm/neon/shortidct4x4llm_neon.c",
|
|
|
|
"vp8/common/arm/neon/sixtappredict_neon.c",
|
|
|
|
"vp8/common/arm/neon/vp8_loopfilter_neon.c",
|
|
|
|
"vp9/common/arm/neon/vp9_iht4x4_add_neon.c",
|
|
|
|
"vp9/common/arm/neon/vp9_iht8x8_add_neon.c",
|
|
|
|
"vpx_dsp/arm/idct16x16_1_add_neon.c",
|
|
|
|
"vpx_dsp/arm/idct16x16_add_neon.c",
|
|
|
|
"vpx_dsp/arm/idct16x16_neon.c",
|
|
|
|
"vpx_dsp/arm/idct32x32_1_add_neon.c",
|
|
|
|
"vpx_dsp/arm/idct32x32_add_neon.c",
|
|
|
|
"vpx_dsp/arm/idct4x4_1_add_neon.c",
|
|
|
|
"vpx_dsp/arm/idct4x4_add_neon.c",
|
|
|
|
"vpx_dsp/arm/idct8x8_1_add_neon.c",
|
|
|
|
"vpx_dsp/arm/idct8x8_add_neon.c",
|
|
|
|
"vpx_dsp/arm/intrapred_neon.c",
|
|
|
|
"vpx_dsp/arm/loopfilter_16_neon.c",
|
|
|
|
"vpx_dsp/arm/loopfilter_4_neon.c",
|
|
|
|
"vpx_dsp/arm/loopfilter_8_neon.c",
|
|
|
|
"vpx_dsp/arm/loopfilter_neon.c",
|
|
|
|
"vpx_dsp/arm/vpx_convolve8_avg_neon.c",
|
|
|
|
"vpx_dsp/arm/vpx_convolve8_neon.c",
|
|
|
|
"vpx_dsp/arm/vpx_convolve_avg_neon.c",
|
|
|
|
"vpx_dsp/arm/vpx_convolve_copy_neon.c",
|
2020-03-30 06:28:32 +00:00
|
|
|
"vpx_dsp/arm/vpx_convolve_neon.c",
|
2016-10-17 15:14:07 +00:00
|
|
|
]
|
|
|
|
libvpx_sources_arm_neon_gas = [
|
2016-10-30 17:44:57 +00:00
|
|
|
"vpx_dsp/arm/gas/intrapred_neon_asm.s",
|
|
|
|
"vpx_dsp/arm/gas/loopfilter_mb_neon.s",
|
2020-03-30 06:28:32 +00:00
|
|
|
"vpx_dsp/arm/gas/save_reg_neon.s",
|
2016-10-17 15:14:07 +00:00
|
|
|
]
|
|
|
|
libvpx_sources_arm_neon_armasm_ms = [
|
2016-10-30 17:44:57 +00:00
|
|
|
"vpx_dsp/arm/armasm_ms/intrapred_neon_asm.asm",
|
|
|
|
"vpx_dsp/arm/armasm_ms/loopfilter_mb_neon.asm",
|
2020-03-30 06:28:32 +00:00
|
|
|
"vpx_dsp/arm/armasm_ms/save_reg_neon.asm",
|
2016-10-17 15:14:07 +00:00
|
|
|
]
|
|
|
|
libvpx_sources_arm_neon_gas_apple = [
|
2016-10-30 17:44:57 +00:00
|
|
|
"vpx_dsp/arm/gas_apple/intrapred_neon_asm.s",
|
|
|
|
"vpx_dsp/arm/gas_apple/loopfilter_mb_neon.s",
|
2020-03-30 06:28:32 +00:00
|
|
|
"vpx_dsp/arm/gas_apple/save_reg_neon.s",
|
2016-10-17 15:14:07 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
libvpx_sources = [libvpx_dir + file for file in libvpx_sources]
|
2018-08-27 02:08:04 +00:00
|
|
|
libvpx_sources_mt = [libvpx_dir + file for file in libvpx_sources_mt]
|
2016-10-17 15:14:07 +00:00
|
|
|
libvpx_sources_intrin_x86 = [libvpx_dir + file for file in libvpx_sources_intrin_x86]
|
|
|
|
libvpx_sources_intrin_x86_mmx = [libvpx_dir + file for file in libvpx_sources_intrin_x86_mmx]
|
|
|
|
libvpx_sources_intrin_x86_sse2 = [libvpx_dir + file for file in libvpx_sources_intrin_x86_sse2]
|
|
|
|
libvpx_sources_intrin_x86_ssse3 = [libvpx_dir + file for file in libvpx_sources_intrin_x86_ssse3]
|
|
|
|
libvpx_sources_intrin_x86_avx2 = [libvpx_dir + file for file in libvpx_sources_intrin_x86_avx2]
|
|
|
|
libvpx_sources_x86asm = [libvpx_dir + file for file in libvpx_sources_x86asm]
|
|
|
|
libvpx_sources_x86_64asm = [libvpx_dir + file for file in libvpx_sources_x86_64asm]
|
|
|
|
libvpx_sources_arm = [libvpx_dir + file for file in libvpx_sources_arm]
|
|
|
|
libvpx_sources_arm_neon = [libvpx_dir + file for file in libvpx_sources_arm_neon]
|
|
|
|
libvpx_sources_arm_neon_gas = [libvpx_dir + file for file in libvpx_sources_arm_neon_gas]
|
|
|
|
libvpx_sources_arm_neon_armasm_ms = [libvpx_dir + file for file in libvpx_sources_arm_neon_armasm_ms]
|
|
|
|
libvpx_sources_arm_neon_gas_apple = [libvpx_dir + file for file in libvpx_sources_arm_neon_gas_apple]
|
|
|
|
|
|
|
|
|
2018-09-28 11:29:52 +00:00
|
|
|
env_libvpx = env_modules.Clone()
|
|
|
|
env_libvpx.disable_warnings()
|
2019-04-30 11:12:02 +00:00
|
|
|
env_libvpx.Prepend(CPPPATH=[libvpx_dir])
|
2016-10-17 15:14:07 +00:00
|
|
|
|
2020-03-30 06:28:32 +00:00
|
|
|
webm_multithread = env["platform"] != "javascript"
|
2018-08-27 02:08:04 +00:00
|
|
|
|
2016-10-17 15:14:07 +00:00
|
|
|
cpu_bits = env["bits"]
|
|
|
|
webm_cpu_x86 = False
|
|
|
|
webm_cpu_arm = False
|
2020-03-30 06:28:32 +00:00
|
|
|
if env["platform"] == "uwp":
|
|
|
|
if "arm" in env["PROGSUFFIX"]:
|
2016-10-30 17:44:57 +00:00
|
|
|
webm_cpu_arm = True
|
|
|
|
else:
|
|
|
|
webm_cpu_x86 = True
|
2021-10-18 13:48:41 +00:00
|
|
|
elif env["platform"] != "windows": # Disable for Windows, yasm SIMD optimizations trigger crash (GH-50862).
|
2016-12-06 12:21:26 +00:00
|
|
|
import platform
|
2020-03-30 06:28:32 +00:00
|
|
|
|
|
|
|
is_x11_or_server_arm = (env["platform"] == "x11" or env["platform"] == "server") and (
|
|
|
|
platform.machine().startswith("arm") or platform.machine().startswith("aarch")
|
|
|
|
)
|
2020-06-29 11:24:56 +00:00
|
|
|
is_macos_x86 = env["platform"] == "osx" and ("arch" in env and (env["arch"] != "arm64"))
|
2020-03-30 06:28:32 +00:00
|
|
|
is_ios_x86 = env["platform"] == "iphone" and ("arch" in env and env["arch"].startswith("x86"))
|
|
|
|
is_android_x86 = env["platform"] == "android" and env["android_arch"].startswith("x86")
|
2016-10-30 17:44:57 +00:00
|
|
|
if is_android_x86:
|
2020-03-30 06:28:32 +00:00
|
|
|
cpu_bits = "32" if env["android_arch"] == "x86" else "64"
|
|
|
|
webm_cpu_x86 = (
|
|
|
|
not is_x11_or_server_arm
|
|
|
|
and (cpu_bits == "32" or cpu_bits == "64")
|
|
|
|
and (
|
|
|
|
env["platform"] == "windows"
|
|
|
|
or env["platform"] == "x11"
|
|
|
|
or env["platform"] == "haiku"
|
2020-06-29 11:24:56 +00:00
|
|
|
or is_macos_x86
|
2020-03-30 06:28:32 +00:00
|
|
|
or is_android_x86
|
|
|
|
or is_ios_x86
|
|
|
|
)
|
|
|
|
)
|
|
|
|
webm_cpu_arm = (
|
|
|
|
is_x11_or_server_arm
|
2020-06-29 11:24:56 +00:00
|
|
|
or (not is_macos_x86 and env["platform"] == "osx")
|
2020-03-30 06:28:32 +00:00
|
|
|
or (not is_ios_x86 and env["platform"] == "iphone")
|
|
|
|
or (not is_android_x86 and env["platform"] == "android")
|
|
|
|
)
|
2016-10-17 15:14:07 +00:00
|
|
|
|
|
|
|
if webm_cpu_x86:
|
2016-10-30 17:44:57 +00:00
|
|
|
import subprocess
|
|
|
|
import os
|
|
|
|
|
|
|
|
yasm_paths = [
|
|
|
|
"yasm",
|
|
|
|
"../../../yasm",
|
|
|
|
]
|
|
|
|
|
|
|
|
yasm_found = False
|
|
|
|
|
|
|
|
devnull = open(os.devnull)
|
|
|
|
for yasm_path in yasm_paths:
|
|
|
|
try:
|
|
|
|
yasm_found = True
|
|
|
|
subprocess.Popen([yasm_path, "--version"], stdout=devnull, stderr=devnull).communicate()
|
2020-12-12 10:10:23 +00:00
|
|
|
except Exception:
|
2016-10-30 17:44:57 +00:00
|
|
|
yasm_found = False
|
|
|
|
if yasm_found:
|
|
|
|
break
|
|
|
|
|
|
|
|
if not yasm_found:
|
|
|
|
webm_cpu_x86 = False
|
2017-09-14 20:45:02 +00:00
|
|
|
print("YASM is necessary for WebM SIMD optimizations.")
|
2016-10-17 15:14:07 +00:00
|
|
|
|
|
|
|
webm_simd_optimizations = False
|
|
|
|
|
|
|
|
if webm_cpu_x86:
|
2020-03-30 06:28:32 +00:00
|
|
|
if env["platform"] == "windows" or env["platform"] == "uwp":
|
|
|
|
env_libvpx["ASFORMAT"] = "win"
|
|
|
|
elif env["platform"] == "osx" or env["platform"] == "iphone":
|
|
|
|
env_libvpx["ASFORMAT"] = "macho"
|
2016-10-30 17:44:57 +00:00
|
|
|
else:
|
2020-03-30 06:28:32 +00:00
|
|
|
env_libvpx["ASFORMAT"] = "elf"
|
2018-02-19 22:39:56 +00:00
|
|
|
env_libvpx["ASFORMAT"] += cpu_bits
|
|
|
|
|
2020-03-30 06:28:32 +00:00
|
|
|
env_libvpx["AS"] = "yasm"
|
|
|
|
env_libvpx["ASFLAGS"] = "-I" + libvpx_dir[1:] + " -f $ASFORMAT -D $ASCPU"
|
|
|
|
env_libvpx["ASCOM"] = "$AS $ASFLAGS -o $TARGET $SOURCES"
|
2016-10-30 17:44:57 +00:00
|
|
|
|
2020-03-30 06:28:32 +00:00
|
|
|
if cpu_bits == "32":
|
|
|
|
env_libvpx["ASCPU"] = "X86_32"
|
|
|
|
elif cpu_bits == "64":
|
|
|
|
env_libvpx["ASCPU"] = "X86_64"
|
2016-10-30 17:44:57 +00:00
|
|
|
|
2020-03-30 06:28:32 +00:00
|
|
|
env_libvpx.Append(CPPDEFINES=["WEBM_X86ASM"])
|
2016-10-30 17:44:57 +00:00
|
|
|
|
|
|
|
webm_simd_optimizations = True
|
2016-10-17 15:14:07 +00:00
|
|
|
|
|
|
|
if webm_cpu_arm:
|
2020-03-30 06:28:32 +00:00
|
|
|
if env["platform"] == "iphone":
|
|
|
|
env_libvpx["ASFLAGS"] = "-arch armv7"
|
|
|
|
elif (
|
|
|
|
env["platform"] == "android"
|
|
|
|
and env["android_arch"] == "armv7"
|
|
|
|
or env["platform"] == "x11"
|
|
|
|
or env["platform"] == "server"
|
|
|
|
):
|
2022-10-14 08:33:17 +00:00
|
|
|
# Append to preserve base ASFLAGS on Android.
|
|
|
|
env_libvpx.Append(ASFLAGS=["-mfpu=neon"])
|
2020-03-30 06:28:32 +00:00
|
|
|
elif env["platform"] == "uwp":
|
|
|
|
env_libvpx["AS"] = "armasm"
|
|
|
|
env_libvpx["ASFLAGS"] = ""
|
|
|
|
env_libvpx["ASCOM"] = "$AS $ASFLAGS -o $TARGET $SOURCES"
|
|
|
|
|
|
|
|
env_libvpx.Append(CPPDEFINES=["WEBM_ARMASM"])
|
2016-10-17 15:14:07 +00:00
|
|
|
|
2016-10-30 17:44:57 +00:00
|
|
|
webm_simd_optimizations = True
|
2016-10-17 15:14:07 +00:00
|
|
|
|
2021-10-18 13:48:41 +00:00
|
|
|
if webm_simd_optimizations == False and env["platform"] != "windows":
|
2017-09-14 20:45:02 +00:00
|
|
|
print("WebM SIMD optimizations are disabled. Check if your CPU architecture, CPU bits or platform are supported!")
|
2016-10-17 15:14:07 +00:00
|
|
|
|
|
|
|
env_libvpx.add_source_files(env.modules_sources, libvpx_sources)
|
2018-08-27 02:08:04 +00:00
|
|
|
|
|
|
|
if webm_multithread:
|
|
|
|
env_libvpx.add_source_files(env.modules_sources, libvpx_sources_mt)
|
|
|
|
|
2016-10-17 15:14:07 +00:00
|
|
|
if webm_cpu_x86:
|
2020-03-30 06:28:32 +00:00
|
|
|
is_clang_or_gcc = (
|
|
|
|
("gcc" in os.path.basename(env["CC"])) or ("clang" in os.path.basename(env["CC"])) or ("osxcross" in env)
|
|
|
|
)
|
2016-10-17 15:14:07 +00:00
|
|
|
|
2016-10-30 17:44:57 +00:00
|
|
|
env_libvpx_mmx = env_libvpx.Clone()
|
2020-03-30 06:28:32 +00:00
|
|
|
if cpu_bits == "32" and is_clang_or_gcc:
|
|
|
|
env_libvpx_mmx.Append(CCFLAGS=["-mmmx"])
|
2016-10-30 17:44:57 +00:00
|
|
|
env_libvpx_mmx.add_source_files(env.modules_sources, libvpx_sources_intrin_x86_mmx)
|
2016-10-17 15:14:07 +00:00
|
|
|
|
2016-10-30 17:44:57 +00:00
|
|
|
env_libvpx_sse2 = env_libvpx.Clone()
|
2020-03-30 06:28:32 +00:00
|
|
|
if cpu_bits == "32" and is_clang_or_gcc:
|
|
|
|
env_libvpx_sse2.Append(CCFLAGS=["-msse2"])
|
2016-10-30 17:44:57 +00:00
|
|
|
env_libvpx_sse2.add_source_files(env.modules_sources, libvpx_sources_intrin_x86_sse2)
|
2016-10-17 15:14:07 +00:00
|
|
|
|
2016-10-30 17:44:57 +00:00
|
|
|
env_libvpx_ssse3 = env_libvpx.Clone()
|
|
|
|
if is_clang_or_gcc:
|
2020-03-30 06:28:32 +00:00
|
|
|
env_libvpx_ssse3.Append(CCFLAGS=["-mssse3"])
|
2016-10-30 17:44:57 +00:00
|
|
|
env_libvpx_ssse3.add_source_files(env.modules_sources, libvpx_sources_intrin_x86_ssse3)
|
2016-10-17 15:14:07 +00:00
|
|
|
|
2016-10-30 17:44:57 +00:00
|
|
|
env_libvpx_avx2 = env_libvpx.Clone()
|
|
|
|
if is_clang_or_gcc:
|
2020-03-30 06:28:32 +00:00
|
|
|
env_libvpx_avx2.Append(CCFLAGS=["-mavx2"])
|
2016-10-30 17:44:57 +00:00
|
|
|
env_libvpx_avx2.add_source_files(env.modules_sources, libvpx_sources_intrin_x86_avx2)
|
2016-10-17 15:14:07 +00:00
|
|
|
|
2016-10-30 17:44:57 +00:00
|
|
|
env_libvpx.add_source_files(env.modules_sources, libvpx_sources_intrin_x86)
|
2016-10-17 15:14:07 +00:00
|
|
|
|
2016-10-30 17:44:57 +00:00
|
|
|
env_libvpx.add_source_files(env.modules_sources, libvpx_sources_x86asm)
|
2020-03-30 06:28:32 +00:00
|
|
|
if cpu_bits == "64":
|
2016-10-30 17:44:57 +00:00
|
|
|
env_libvpx.add_source_files(env.modules_sources, libvpx_sources_x86_64asm)
|
2016-10-17 15:14:07 +00:00
|
|
|
elif webm_cpu_arm:
|
2016-10-30 17:44:57 +00:00
|
|
|
env_libvpx.add_source_files(env.modules_sources, libvpx_sources_arm)
|
2020-03-30 06:28:32 +00:00
|
|
|
if env["platform"] == "android":
|
2019-04-30 11:12:02 +00:00
|
|
|
env_libvpx.Prepend(CPPPATH=[libvpx_dir + "third_party/android"])
|
2018-12-20 09:38:05 +00:00
|
|
|
env_libvpx.add_source_files(env.modules_sources, [libvpx_dir + "third_party/android/cpu-features.c"])
|
2016-10-30 17:44:57 +00:00
|
|
|
|
|
|
|
env_libvpx_neon = env_libvpx.Clone()
|
|
|
|
env_libvpx_neon.add_source_files(env.modules_sources, libvpx_sources_arm_neon)
|
|
|
|
|
2020-03-30 06:28:32 +00:00
|
|
|
if env["platform"] == "uwp":
|
2016-10-30 17:44:57 +00:00
|
|
|
env_libvpx.add_source_files(env.modules_sources, libvpx_sources_arm_neon_armasm_ms)
|
2020-03-30 06:28:32 +00:00
|
|
|
elif env["platform"] == "iphone":
|
2016-10-30 17:44:57 +00:00
|
|
|
env_libvpx.add_source_files(env.modules_sources, libvpx_sources_arm_neon_gas_apple)
|
2020-03-30 06:28:32 +00:00
|
|
|
elif (is_x11_or_server_arm and cpu_bits == "32") or (
|
|
|
|
env["platform"] == "android" and not env["android_arch"] == "arm64v8"
|
|
|
|
):
|
2016-10-30 17:44:57 +00:00
|
|
|
env_libvpx.add_source_files(env.modules_sources, libvpx_sources_arm_neon_gas)
|