summaryrefslogtreecommitdiff
path: root/media/libopus/moz.build
diff options
context:
space:
mode:
Diffstat (limited to 'media/libopus/moz.build')
-rw-r--r--media/libopus/moz.build47
1 files changed, 38 insertions, 9 deletions
diff --git a/media/libopus/moz.build b/media/libopus/moz.build
index 9ef3949401..bddaa3fc17 100644
--- a/media/libopus/moz.build
+++ b/media/libopus/moz.build
@@ -19,8 +19,9 @@ ALLOW_COMPILER_WARNINGS = True
FINAL_LIBRARY = 'gkmedias'
DEFINES['OPUS_BUILD'] = True
-DEFINES['OPUS_VERSION'] = '"v1.1.3-mozilla"'
+DEFINES['OPUS_VERSION'] = '2654707e86cc94413998976d179b2ab4a2aa3114'
DEFINES['USE_ALLOCA'] = True
+DEFINES['ENABLE_HARDENING'] = True
# We only need to export symbols if we're built into libgkmedias
# instead of libxul.
@@ -63,6 +64,8 @@ LOCAL_INCLUDES += [
'celt',
'include',
'silk',
+ 'silk/fixed',
+ 'silk/float',
'src',
]
@@ -76,18 +79,32 @@ UNIFIED_SOURCES += opus_sources
SOURCES += opus_nonunified_sources
if CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']:
- LOCAL_INCLUDES += [
- 'silk/float',
- ]
UNIFIED_SOURCES += silk_sources_float
UNIFIED_SOURCES += opus_sources_float
else:
- LOCAL_INCLUDES += [
- 'silk/fixed',
- ]
UNIFIED_SOURCES += silk_sources_fixed
-# for webrtc
- UNIFIED_SOURCES += opus_sources_float
+
+if CONFIG['CPU_ARCH'] in ('x86', 'x86_64'):
+ DEFINES['OPUS_HAVE_RTCD'] = True
+ DEFINES['OPUS_X86_MAY_HAVE_SSE'] = True
+ DEFINES['OPUS_X86_MAY_HAVE_SSE2'] = True
+ DEFINES['OPUS_X86_MAY_HAVE_SSE4_1'] = True
+ DEFINES['OPUS_X86_MAY_HAVE_AVX'] = True
+ SOURCES += celt_sources_sse
+ SOURCES += celt_sources_sse2
+ SOURCES += celt_sources_sse4_1
+ SOURCES += silk_sources_sse4_1
+ if not CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']:
+ SOURCES += silk_sources_fixed_sse4_1
+ for f in SOURCES:
+ if f in celt_sources_sse:
+ SOURCES[f].flags += CONFIG['SSE_FLAGS']
+ if f in celt_sources_sse2:
+ SOURCES[f].flags += CONFIG['SSE2_FLAGS']
+ if f in celt_sources_sse4_1 or \
+ f in silk_sources_sse4_1 or \
+ f in silk_sources_fixed_sse4_1:
+ SOURCES[f].flags += ['-msse4.1']
if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']:
SOURCES += celt_sources_arm
@@ -109,6 +126,18 @@ if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']:
]
ASFLAGS += CONFIG['NEON_FLAGS']
+if CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang', 'gcc'):
+ DEFINES['OPUS_ARM_PRESUME_AARCH64_NEON_INTR'] = True
+ DEFINES['OPUS_ARM_PRESUME_NEON'] = True
+ DEFINES['OPUS_ARM_PRESUME_NEON_INTR'] = True
+ SOURCES += celt_sources_arm_neon_intr
+ SOURCES += silk_sources_arm_neon_intr
+ if CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']:
+ DEFINES['OPUS_ARM_MAY_HAVE_NEON'] = True
+ DEFINES['OPUS_ARM_MAY_HAVE_NEON_INTR'] = True
+ else:
+ SOURCES += silk_sources_fixed_arm_neon_intr
+
# Suppress warnings in third-party code.
if CONFIG['GNU_CC']:
if CONFIG['CLANG_CXX']: