From f52b8da28eba3eba0305a4ef767aa8e3fd940a4e Mon Sep 17 00:00:00 2001 From: Carlos Date: Fri, 12 Nov 2021 07:15:21 +0100 Subject: [PATCH] - correct gitignore file so submodules will work - repair submodule configurations --- .gitignore | 2 + .gitmodules | 9 ++ components/flac/CMakeLists.txt | 21 +++ components/flac/config.h | 259 +++++++++++++++++++++++++++++++++ components/flac/flac | 1 + components/opus/CMakeLists.txt | 18 +++ components/opus/component.mk | 12 ++ components/opus/config.h | 208 ++++++++++++++++++++++++++ components/opus/opus | 1 + 9 files changed, 531 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 components/flac/CMakeLists.txt create mode 100644 components/flac/config.h create mode 160000 components/flac/flac create mode 100644 components/opus/CMakeLists.txt create mode 100644 components/opus/component.mk create mode 100644 components/opus/config.h create mode 160000 components/opus/opus diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cfcb420 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build +libopus diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..b6ebb88 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "components/opus/opus"] + path = components/opus/opus + url = https://github.com/xiph/opus +[submodule "components/esp-dsp"] + path = components/esp-dsp + url = https://github.com/espressif/esp-dsp +[submodule "components/flac/flac"] + path = components/flac/flac + url = https://github.com/xiph/flac.git diff --git a/components/flac/CMakeLists.txt b/components/flac/CMakeLists.txt new file mode 100644 index 0000000..27d4583 --- /dev/null +++ b/components/flac/CMakeLists.txt @@ -0,0 +1,21 @@ +# 3.1 is OK for most parts. However: +# 3.3 is needed in src/libFLAC +# 3.5 is needed in src/libFLAC/ia32 +# 3.9 is needed in 'doc' because of doxygen_add_docs() +cmake_minimum_required(VERSION 3.5) + +file(GLOB srcs "flac/src/libFLAC/*.c") + +#project(FLAC VERSION 1.3.3) # HOMEPAGE_URL "https://www.xiph.org/flac/") +set(VERSION "1.3.3") +set(PACKAGE_VERSION "1.3.3") + +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS . + "flac/include" + PRIV_INCLUDE_DIRS "flac/src/libFLAC/include/" + ) + +#set_source_files_properties(opus/silk/quant_LTP_gains.c PROPERTIES COMPILE_FLAGS -Wno-maybe-uninitialized) +#target_compile_definitions(${COMPONENT_TARGET} PRIVATE "-DHAVE_CONFIG_H") +target_compile_definitions(${COMPONENT_TARGET} PRIVATE "-DHAVE_CONFIG_H") diff --git a/components/flac/config.h b/components/flac/config.h new file mode 100644 index 0000000..48067b9 --- /dev/null +++ b/components/flac/config.h @@ -0,0 +1,259 @@ +/* + * config.h + * + * Created on: Aug 31, 2021 + * Author: karl + */ + +#ifndef COMPONENTS_FLAC_CONFIG_H_ +#define COMPONENTS_FLAC_CONFIG_H_ + +#define PGM_READ_UNALIGNED 0 + +#ifdef DEBUG +#undef NDEBUG +#else +#define NDEBUG +#endif + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Target processor is big endian. */ +#define CPU_IS_BIG_ENDIAN 0 + +/* Target processor is little endian. */ +#define CPU_IS_LITTLE_ENDIAN 1 + +/* Set FLAC__BYTES_PER_WORD to 8 (4 is the default) */ +#define ENABLE_64_BIT_WORDS 0 + +/* define to align allocated memory on 32-byte boundaries */ +#define FLAC__ALIGN_MALLOC_DATA 1 + +/* define if building for ia32/i386 */ +/* #undef FLAC__CPU_IA32 */ + +/* define if building for PowerPC */ +/* #undef FLAC__CPU_PPC */ + +/* define if building for PowerPC with SPE ABI */ +/* #undef FLAC__CPU_PPC_SPE */ + +/* define if building for SPARC */ +/* #undef FLAC__CPU_SPARC */ + +/* define if building for x86_64 */ +#undef FLAC__CPU_X86_64 + +/* define if you have docbook-to-man or docbook2man */ +#undef FLAC__HAS_DOCBOOK_TO_MAN + +/* define if you are compiling for x86 and have the NASM assembler */ +#undef FLAC__HAS_NASM + +/* define if you have the ogg library */ +#define FLAC__HAS_OGG 0 + +/* Set to 1 if is available. */ +#undef FLAC__HAS_X86INTRIN + +/* define to disable use of assembly code */ +#define FLAC__NO_ASM 1 + +/* define if building for Darwin / MacOS X */ +/* #undef FLAC__SYS_DARWIN */ + +/* define if building for Linux */ +#undef FLAC__SYS_LINUX + +/* define to enable use of Altivec instructions */ +#undef FLAC__USE_ALTIVEC + +/* define to enable use of AVX instructions */ +#undef FLAC__USE_AVX + +/* Compiler has the __builtin_bswap16 intrinsic */ +#undef HAVE_BSWAP16 + +/* Compiler has the __builtin_bswap32 intrinsic */ +#undef HAVE_BSWAP32 + +/* Define to 1 if you have the header file. */ +#undef HAVE_BYTESWAP_H + +/* define if you have clock_gettime */ +#undef HAVE_CLOCK_GETTIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_CPUID_H + +/* Define to 1 if C++ supports variable-length arrays. */ +#define HAVE_CXX_VARARRAYS 1 + +/* Define to 1 if C supports variable-length arrays. */ +#define HAVE_C_VARARRAYS 1 + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +#undef HAVE_FSEEKO + +/* Define to 1 if you have the `getopt_long' function. */ +#undef HAVE_GETOPT_LONG + +/* Define if you have the iconv() function and it works. */ +#undef HAVE_ICONV + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if you have and nl_langinfo(CODESET). */ +#define HAVE_LANGINFO_CODESET 1 + +/* lround support */ +#define HAVE_LROUND 1 + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if the system has the type `socklen_t'. */ +#undef HAVE_SOCKLEN_T + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_TERMIOS_H + +/* Define to 1 if typeof works with your compiler. */ +#define HAVE_TYPEOF 1 + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_X86INTRIN_H + +/* Define as const if the declaration of iconv() needs const. */ +#define ICONV_CONST + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "flac" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "flac-dev@xiph.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "flac" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "flac 1.3.2" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "flac" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "https://www.xiph.org/flac/" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.3.2" + +/* The size of `off_t', as computed by sizeof. */ +#define SIZEOF_OFF_T 4 + +/* The size of `void*', as computed by sizeof. */ +#define SIZEOF_VOIDP 4 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +#define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +#define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +#define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +#define __EXTENSIONS__ 1 +#endif + +/* Version number of package */ +#define VERSION "1.3.2" + +/* Target processor is big endian. */ +#define WORDS_BIGENDIAN 0 + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +#define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +/* #undef _LARGEFILE_SOURCE */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to __typeof__ if your compiler spells it that way. */ +/* #undef typeof */ + +#endif /* COMPONENTS_FLAC_CONFIG_H_ */ diff --git a/components/flac/flac b/components/flac/flac new file mode 160000 index 0000000..b358381 --- /dev/null +++ b/components/flac/flac @@ -0,0 +1 @@ +Subproject commit b358381a102a2c1c153ee4cf95dfc04af62faa1a diff --git a/components/opus/CMakeLists.txt b/components/opus/CMakeLists.txt new file mode 100644 index 0000000..6ddb221 --- /dev/null +++ b/components/opus/CMakeLists.txt @@ -0,0 +1,18 @@ +file(GLOB srcs "opus/src/*.c") +file(GLOB silk "opus/silk/*.c") +file(GLOB celt "opus/celt/*.c") +file(GLOB fixed "opus/slik/fixed/*.c") +file(GLOB float "opus/slik/float/*.c") + + +idf_component_register(SRCS "${srcs}" "${silk}" "${celt}" "${fixed}" "${float}" + INCLUDE_DIRS . + "opus/include" + "opus/silk" + "opus/silk/fixed" + "opus/silk/float" + "opus/celt" + ) + +set_source_files_properties(opus/silk/quant_LTP_gains.c PROPERTIES COMPILE_FLAGS -Wno-maybe-uninitialized) +target_compile_definitions(${COMPONENT_TARGET} PRIVATE "-DHAVE_CONFIG_H") diff --git a/components/opus/component.mk b/components/opus/component.mk new file mode 100644 index 0000000..024e046 --- /dev/null +++ b/components/opus/component.mk @@ -0,0 +1,12 @@ +# +# Main Makefile. This is basically the same as a component makefile. +# +# This Makefile should, at the very least, just include $(SDK_PATH)/make/component_common.mk. By default, +# this will take the sources in the src/ directory, compile them and link them into +# lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable, +# please read the ESP-IDF documents if you need to do this. +# + +COMPONENT_SRCDIRS := opus/src opus/silk opus/silk/fixed opus/celt +COMPONENT_ADD_INCLUDEDIRS := . opus/include opus/silk opus/silk/fixed opus/celt +CFLAGS += -DHAVE_CONFIG_H diff --git a/components/opus/config.h b/components/opus/config.h new file mode 100644 index 0000000..03f3999 --- /dev/null +++ b/components/opus/config.h @@ -0,0 +1,208 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Get CPU Info by asm method */ +/* #undef CPU_INFO_BY_ASM */ + +/* Get CPU Info by c method */ +/* #undef CPU_INFO_BY_C */ + +/* Custom modes */ +/* #undef CUSTOM_MODES */ + +/* Do not build the float API */ +//#define DISABLE_FLOAT_API 1 + +/* Assertions */ +/* #undef ENABLE_ASSERTIONS */ + +/* Ambisonics Support */ +/* #undef ENABLE_EXPERIMENTAL_AMBISONICS */ + +/* Enable bitstream changes from draft-ietf-codec-opus-update */ +/* #undef ENABLE_UPDATE_DRAFT */ + +/* Debug fixed-point implementation */ +/* #undef FIXED_DEBUG */ + +/* Compile as fixed-point (for machines without a fast enough FPU) */ +#define FIXED_POINT 1 + +/* Float approximations */ +/* #undef FLOAT_APPROX */ + +/* Fuzzing */ +/* #undef FUZZING */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ALLOCA_H */ + +/* NE10 library is installed on host. Make sure it is on target! */ +/* #undef HAVE_ARM_NE10 */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ +#define HAVE_DLFCN_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `lrint' function. */ +/* #undef HAVE_LRINT */ +#define HAVE_LRINT 1 +/* Define to 1 if you have the `lrintf' function. */ +/* #undef HAVE_LRINTF */ +#define HAVE_LRINTF 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MEMORY_H */ +#define HAVE_MEMORY_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `__malloc_hook' function. */ +/* #undef HAVE___MALLOC_HOOK */ + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Make use of ARM asm optimization */ +/* #undef OPUS_ARM_ASM */ + +/* Use generic ARMv4 inline asm optimizations */ +/* #undef OPUS_ARM_INLINE_ASM */ + +/* Use ARMv5E inline asm optimizations */ +/* #undef OPUS_ARM_INLINE_EDSP */ + +/* Use ARMv6 inline asm optimizations */ +/* #undef OPUS_ARM_INLINE_MEDIA */ + +/* Use ARM NEON inline asm optimizations */ +/* #undef OPUS_ARM_INLINE_NEON */ + +/* Define if assembler supports EDSP instructions */ +/* #undef OPUS_ARM_MAY_HAVE_EDSP */ + +/* Define if assembler supports ARMv6 media instructions */ +/* #undef OPUS_ARM_MAY_HAVE_MEDIA */ + +/* Define if compiler supports NEON instructions */ +/* #undef OPUS_ARM_MAY_HAVE_NEON */ + +/* Compiler supports ARMv7/Aarch64 Neon Intrinsics */ +/* #undef OPUS_ARM_MAY_HAVE_NEON_INTR */ + +/* Define if binary requires Aarch64 Neon Intrinsics */ +/* #undef OPUS_ARM_PRESUME_AARCH64_NEON_INTR */ + +/* Define if binary requires EDSP instruction support */ +/* #undef OPUS_ARM_PRESUME_EDSP */ + +/* Define if binary requires ARMv6 media instruction support */ +/* #undef OPUS_ARM_PRESUME_MEDIA */ + +/* Define if binary requires NEON instruction support */ +/* #undef OPUS_ARM_PRESUME_NEON */ + +/* Define if binary requires NEON intrinsics support */ +/* #undef OPUS_ARM_PRESUME_NEON_INTR */ + +/* This is a build of OPUS */ +#define OPUS_BUILD /**/ + +/* Run bit-exactness checks between optimized and c implementations */ +/* #undef OPUS_CHECK_ASM */ + +/* Use run-time CPU capabilities detection */ +/* #undef OPUS_HAVE_RTCD */ + +/* Compiler supports X86 AVX Intrinsics */ +/* #undef OPUS_X86_MAY_HAVE_AVX */ + +/* Compiler supports X86 SSE Intrinsics */ +/* #undef OPUS_X86_MAY_HAVE_SSE */ + +/* Compiler supports X86 SSE2 Intrinsics */ +/* #undef OPUS_X86_MAY_HAVE_SSE2 */ + +/* Compiler supports X86 SSE4.1 Intrinsics */ +/* #undef OPUS_X86_MAY_HAVE_SSE4_1 */ + +/* Define if binary requires AVX intrinsics support */ +/* #undef OPUS_X86_PRESUME_AVX */ + +/* Define if binary requires SSE intrinsics support */ +/* #undef OPUS_X86_PRESUME_SSE */ + +/* Define if binary requires SSE2 intrinsics support */ +/* #undef OPUS_X86_PRESUME_SSE2 */ + +/* Define if binary requires SSE4.1 intrinsics support */ +/* #undef OPUS_X86_PRESUME_SSE4_1 */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "opus@xiph.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "opus" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "opus 1.3.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "opus" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.3.1" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Make use of alloca */ +/* #undef USE_ALLOCA */ + +/* Use C99 variable-size arrays */ +#define VAR_ARRAYS 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#define restrict __restrict +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +#define _Restrict +#define __restrict__ +#endif diff --git a/components/opus/opus b/components/opus/opus new file mode 160000 index 0000000..df9c4c8 --- /dev/null +++ b/components/opus/opus @@ -0,0 +1 @@ +Subproject commit df9c4c8e562b952ca14fa90ef21dff9a8dd2b3a4