Vignesh Venkatasubramanian | 2bd8b54 | 2014-02-20 10:50:35 -0800 | [diff] [blame] | 1 | LOCAL_PATH := $(call my-dir) |
| 2 | |
| 3 | include $(CLEAR_VARS) |
flim | c91ee5b | 2016-01-26 14:33:44 +0100 | [diff] [blame] | 4 | |
| 5 | include $(LOCAL_PATH)/celt_sources.mk |
| 6 | include $(LOCAL_PATH)/opus_sources.mk |
| 7 | include $(LOCAL_PATH)/silk_sources.mk |
| 8 | |
Vignesh Venkatasubramanian | 2bd8b54 | 2014-02-20 10:50:35 -0800 | [diff] [blame] | 9 | LOCAL_MODULE := libopus |
| 10 | OGG_DIR := external/libogg |
| 11 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/include $(LOCAL_PATH)/src $(LOCAL_PATH)/silk \ |
| 12 | $(LOCAL_PATH)/celt $(LOCAL_PATH)/silk/fixed $(OGG_DIR)/include |
flim | c91ee5b | 2016-01-26 14:33:44 +0100 | [diff] [blame] | 13 | LOCAL_SRC_FILES := $(CELT_SOURCES) $(SILK_SOURCES) $(SILK_SOURCES_FIXED) \ |
| 14 | $(OPUS_SOURCES) $(OPUS_SOURCES_FLOAT) src/repacketizer_demo.c |
Vignesh Venkatasubramanian | 2bd8b54 | 2014-02-20 10:50:35 -0800 | [diff] [blame] | 15 | |
Vignesh Venkatasubramanian | 2bd8b54 | 2014-02-20 10:50:35 -0800 | [diff] [blame] | 16 | LOCAL_CFLAGS := -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED \ |
| 17 | -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 \ |
| 18 | -Drestrict='' -D__EMX__ -DOPUS_BUILD -DFIXED_POINT \ |
flim | c91ee5b | 2016-01-26 14:33:44 +0100 | [diff] [blame] | 19 | -DUSE_ALLOCA -DHAVE_LRINT -DHAVE_LRINTF -O2 -fno-math-errno |
| 20 | LOCAL_CPPFLAGS := -DBSD=1 -ffast-math -O2 -funroll-loops |
| 21 | |
Victor Khimenko | da5155b | 2016-06-04 00:11:43 +0200 | [diff] [blame^] | 22 | # Note: OPUS enhanced DSP/NEON implementation is not yet compatible with arm64. |
| 23 | # Only add the appropriate defines for 32-bit arm architecture. |
| 24 | LOCAL_SRC_FILES_arm += $(CELT_SOURCES_ARM) |
| 25 | LOCAL_CFLAGS_arm += -DOPUS_ARM_ASM -DOPUS_ARM_INLINE_ASM \ |
| 26 | -DOPUS_ARM_MAY_HAVE_EDSP -DOPUS_ARM_PRESUME_EDSP \ |
| 27 | -DOPUS_ARM_INLINE_EDSP -DOPUS_ARM_MAY_HAVE_MEDIA \ |
| 28 | -DOPUS_ARM_PRESUME_MEDIA -DOPUS_ARM_INLINE_MEDIA \ |
| 29 | -DOPUS_HAVE_RTCD |
| 30 | # DSP, MEDIA and NEON instructions are in the same assembler file - thus we |
| 31 | # need to include it even if NEON is not supported on target platform. |
| 32 | LOCAL_SRC_FILES_arm += $(subst .s,_gnu.s,$(CELT_SOURCES_ARM_ASM)) |
| 33 | ifeq ($(ARCH_ARM_HAVE_NEON),true) |
| 34 | LOCAL_SRC_FILES_arm += $(CELT_SOURCES_ARM_NEON_INTR) |
| 35 | LOCAL_CFLAGS_arm += -DOPUS_ARM_MAY_HAVE_NEON -DOPUS_ARM_MAY_HAVE_NEON_INTR \ |
| 36 | -DOPUS_ARM_PRESUME_NEON -DOPUS_ARM_INLINE_NEON |
flim | c91ee5b | 2016-01-26 14:33:44 +0100 | [diff] [blame] | 37 | endif |
| 38 | |
Victor Khimenko | da5155b | 2016-06-04 00:11:43 +0200 | [diff] [blame^] | 39 | LIBOPUS_X86_FILES := |
| 40 | LIBOPUS_X86_CFLAGS := |
flim | c91ee5b | 2016-01-26 14:33:44 +0100 | [diff] [blame] | 41 | ifeq ($(ARCH_X86_HAVE_SSSE3),true) |
Victor Khimenko | da5155b | 2016-06-04 00:11:43 +0200 | [diff] [blame^] | 42 | LIBOPUS_X86_FILES += $(CELT_SOURCES_SSE) $(CELT_SOURCES_SSE2) |
| 43 | LIBOPUS_X86_CFLAGS += -DOPUS_X86_MAY_HAVE_SSE -DOPUS_X86_PRESUME_SSE \ |
| 44 | -DOPUS_X86_MAY_HAVE_SSE2 -DOPUS_X86_PRESUME_SSE2 |
flim | c91ee5b | 2016-01-26 14:33:44 +0100 | [diff] [blame] | 45 | endif |
| 46 | |
| 47 | ifeq ($(ARCH_X86_HAVE_SSE4_1),true) |
Victor Khimenko | da5155b | 2016-06-04 00:11:43 +0200 | [diff] [blame^] | 48 | LIBOPUS_X86_FILES += $(CELT_SOURCES_SSE4_1) \ |
flim | c91ee5b | 2016-01-26 14:33:44 +0100 | [diff] [blame] | 49 | $(SILK_SOURCES_SSE4_1) $(SILK_SOURCES_FIXED_SSE4_1) |
Victor Khimenko | da5155b | 2016-06-04 00:11:43 +0200 | [diff] [blame^] | 50 | LIBOPUS_X86_CFLAGS += -DOPUS_X86_MAY_HAVE_SSE4_1 -DOPUS_X86_PRESUME_SSE4_1 |
flim | c91ee5b | 2016-01-26 14:33:44 +0100 | [diff] [blame] | 51 | endif |
Vignesh Venkatasubramanian | 2bd8b54 | 2014-02-20 10:50:35 -0800 | [diff] [blame] | 52 | |
Victor Khimenko | da5155b | 2016-06-04 00:11:43 +0200 | [diff] [blame^] | 53 | LOCAL_SRC_FILES_x86 += $(LIBOPUS_X86_FILES) |
| 54 | LOCAL_SRC_FILES_x86_64 += $(LIBOPUS_X86_FILES) |
| 55 | LOCAL_CFLAGS_x86 += $(LIBOPUS_X86_CFLAGS) |
| 56 | LOCAL_CFLAGS_x86_64 += $(LIBOPUS_X86_CFLAGS) |
| 57 | |
Vignesh Venkatasubramanian | 2bd8b54 | 2014-02-20 10:50:35 -0800 | [diff] [blame] | 58 | LOCAL_STATIC_LIBRARIES := libogg |
| 59 | |
Vignesh Venkatasubramanian | 2bd8b54 | 2014-02-20 10:50:35 -0800 | [diff] [blame] | 60 | include $(BUILD_SHARED_LIBRARY) |