diff --git a/Engine/lib/CMakeLists.txt b/Engine/lib/CMakeLists.txt index 229a840d4..c4e81803b 100644 --- a/Engine/lib/CMakeLists.txt +++ b/Engine/lib/CMakeLists.txt @@ -258,32 +258,30 @@ if(TORQUE_SFX_OPENAL) mark_as_advanced(AUDIOUNIT_INCLUDE_DIR) endif() -set(INSTALL_DOCS OFF CACHE BOOL "" FORCE) -set(INSTALL_PKG_CONFIG_MODULE OFF CACHE BOOL "" FORCE) -set(INSTALL_CMAKE_PACKAGE_MODULE OFF CACHE BOOL "" FORCE) -set(BUILD_TESTING OFF CACHE BOOL "" FORCE) +advanced_option(INSTALL_DOCS "" OFF) +advanced_option(INSTALL_PKG_CONFIG_MODULE "" OFF) +advanced_option(INSTALL_CMAKE_PACKAGE_MODULE "" OFF) +advanced_option(BUILD_TESTING "" OFF) add_subdirectory(libogg ${TORQUE_LIB_TARG_DIRECTORY}/libogg ) add_subdirectory(libvorbis ${TORQUE_LIB_TARG_DIRECTORY}/libvorbis EXCLUDE_FROM_ALL) -set(INSTALL_PKGCONFIG_MODULES OFF CACHE BOOL "" FORCE) -set(INSTALL_CMAKE_CONFIG_MODULE OFF CACHE BOOL "" FORCE) +advanced_option(INSTALL_PKGCONFIG_MODULES "" OFF) +sadvanced_optionet(INSTALL_CMAKE_CONFIG_MODULE "" OFF) add_subdirectory(flac ${TORQUE_LIB_TARG_DIRECTORY}/flac EXCLUDE_FROM_ALL) -add_subdirectory(speex ${TORQUE_LIB_TARG_DIRECTORY}/speex EXCLUDE_FROM_ALL) - -set(INSTALL_DOCS OFF CACHE BOOL "" FORCE) -set(OPUS_INSTALL_PKG_CONFIG_MODULE OFF CACHE BOOL "" FORCE) -set(OPUS_INSTALL_CMAKE_CONFIG_MODULE OFF CACHE BOOL "" FORCE) +advanced_option(INSTALL_DOCS "" OFF) +advanced_option(OPUS_INSTALL_PKG_CONFIG_MODULE "" OFF) +advanced_option(OPUS_INSTALL_CMAKE_CONFIG_MODULE "" OFF) add_subdirectory(opus ${TORQUE_LIB_TARG_DIRECTORY}/opus EXCLUDE_FROM_ALL) add_subdirectory(libtheora ${TORQUE_LIB_TARG_DIRECTORY}/libtheora EXCLUDE_FROM_ALL) -set(BUILD_PROGRAMS OFF CACHE BOOL "" FORCE) -set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) -set(ENABLE_CPACK OFF CACHE BOOL "" FORCE) -set(ENABLE_PACKAGE_CONFIG OFF CACHE BOOL "" FORCE) -set(INSTALL_PKGCONFIG_MODULE OFF CACHE BOOL "" FORCE) -set(ENABLE_MPEG OFF CACHE BOOL "" FORCE) -set(ENABLE_EXPERIMENTAL ON CACHE BOOL "" FORCE) +advanced_option(BUILD_PROGRAMS "" OFF) +advanced_option(BUILD_EXAMPLES "" OFF) +advanced_option(ENABLE_CPACK "" OFF) +advanced_option(ENABLE_PACKAGE_CONFIG "" OFF) +advanced_option(INSTALL_PKGCONFIG_MODULE "" OFF) +advanced_option(ENABLE_MPEG "" OFF) +advanced_option(ENABLE_EXPERIMENTAL "" OFF) add_subdirectory(libsndfile ${TORQUE_LIB_TARG_DIRECTORY}/libsndfile EXCLUDE_FROM_ALL) if(TORQUE_TESTING) diff --git a/Engine/lib/libogg/CMakeLists.txt b/Engine/lib/libogg/CMakeLists.txt index fe20f2da9..98d24064b 100644 --- a/Engine/lib/libogg/CMakeLists.txt +++ b/Engine/lib/libogg/CMakeLists.txt @@ -200,5 +200,3 @@ if(BUILD_TESTING) add_test(NAME test_framing COMMAND $) endif() -set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) -include(CPack) diff --git a/Engine/lib/libsndfile/CMakeLists.txt b/Engine/lib/libsndfile/CMakeLists.txt index b1cab0870..7b21ee6c1 100644 --- a/Engine/lib/libsndfile/CMakeLists.txt +++ b/Engine/lib/libsndfile/CMakeLists.txt @@ -394,7 +394,7 @@ target_link_libraries (sndfile $<$:Ogg::ogg> $<$:vorbisenc> $<$:FLAC::FLAC> - $<$,$,$>:speex> + $<$,$,$>:Speex::Speex> $<$:Opus::opus> $<$:MPG123::libmpg123> $<$:mp3lame::mp3lame> diff --git a/Engine/lib/speex/.appveyor.yml b/Engine/lib/speex/.appveyor.yml deleted file mode 100644 index 0e7f8318c..000000000 --- a/Engine/lib/speex/.appveyor.yml +++ /dev/null @@ -1,20 +0,0 @@ -version: 1.2-{build} -image: Visual Studio 2017 -configuration: Debug -platform: - - Win32 - - x64 -install: - - if %platform%==Win32 set VCPKG_TRIPLET=x86-windows - - if %platform%==x64 set VCPKG_TRIPLET=x64-windows - - vcpkg install libogg:%VCPKG_TRIPLET% fftw3:%VCPKG_TRIPLET% -before_build: - - mkdir CMakeBuild - - cd CMakeBuild - - if %platform%==Win32 set CMAKE_GENERATOR=Visual Studio 15 2017 - - if %platform%==x64 set CMAKE_GENERATOR=Visual Studio 15 2017 Win64 - - cmake .. -G"%CMAKE_GENERATOR%" -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake -build_script: - - cmake --build . --config %configuration% -cache: - C:\Tools\vcpkg\Installed -> appveyor.yml diff --git a/Engine/lib/speex/.cvsignore b/Engine/lib/speex/.cvsignore deleted file mode 100644 index 0c6bca2d7..000000000 --- a/Engine/lib/speex/.cvsignore +++ /dev/null @@ -1,17 +0,0 @@ -Makefile -Makefile.in -Speex.spec -aclocal.m4 -autom4te.cache -config.guess -config.log -config.status -config.sub -configure -depcomp -install-sh -libtool -ltconfig -ltmain.sh -missing -mkinstalldirs diff --git a/Engine/lib/speex/.gitignore b/Engine/lib/speex/.gitignore deleted file mode 100644 index 99a35e59c..000000000 --- a/Engine/lib/speex/.gitignore +++ /dev/null @@ -1,55 +0,0 @@ -*.o -*.lo -Makefile.in -*~ -*.orig -fixed -float -Speex.kdevelop.pcs -Speex.kdevses -aclocal.m4 -autom4te.cache -compile -config.guess -config.h.in -config.sub -configure -depcomp -install-sh -ltmain.sh -m4/libtool.m4 -m4/ltoptions.m4 -m4/ltsugar.m4 -m4/ltversion.m4 -m4/lt~obsolete.m4 -missing -Makefile -.deps -.libs -*.la -work -Speex.spec -config.h -config.log -config.status -include/speex/speex_config_types.h -*.sw[lmnop] -testenc -testenc_uwb -testenc_wb -libtool -speex.pc -src/speexdec -src/speexenc -stamp-* -patches - -CMakeCache.txt -CMakeFiles -CMakeScripts -Testing -Makefile -cmake_install.cmake -install_manifest.txt -compile_commands.json -CTestTestfile.cmake diff --git a/Engine/lib/speex/.travis.yml b/Engine/lib/speex/.travis.yml deleted file mode 100644 index 2bc028b3d..000000000 --- a/Engine/lib/speex/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -language: c -sudo: false -dist: trusty -addons: - apt: - packages: - - libogg-dev - - libspeexdsp-dev - - libfftw3-dev - -env: - matrix: - - CMAKE=1 CONFIG="" - - CMAKE=1 CONFIG="-DENABLE_FIXED_POINT:BOOL=TRUE -DENABLE_FLOATING_POINT:BOOL=FALSE" - - CMAKE=1 CONFIG="-DENABLE_FIXED_POINT:BOOL=TRUE -DENABLE_FLOATING_POINT:BOOL=FALSE -DDISABLE_FLOAT_API:BOOL=TRUE" - - CMAKE=1 CONFIG="-DENABLE_VORBIS_PSY:BOOL=TRUE" - - CMAKE=1 CONFIG="-DDISABLE_BINARIES:BOOL=TRUE" - - AUTOTOOLS=1 CONFIG="" - - AUTOTOOLS=1 CONFIG="--enable-fixed-point" - - AUTOTOOLS=1 CONFIG="--enable-fixed-point --disable-float-api" - - AUTOTOOLS=1 CONFIG="--enable-vorbis-psy" - - AUTOTOOLS=1 CONFIG="--disable-binaries" - -os: - - linux - - osx - -compiler: - - gcc - - clang - -before_install: - - if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then - brew install libogg speexdsp fftw; - fi - -script: - - if [ "$CMAKE" == "1" ]; then mkdir cmake-build; cd cmake-build; cmake .. $CONFIG -DBUILD_SHARED_LIBS:BOOL=TRUE -DCMAKE_INSTALL_PREFIX:PATH=$HOME/cmake-check; make install; fi - - if [ "$AUTOTOOLS" == "1" ]; then ./autogen.sh; ./configure $CONFIG; make distcheck; fi diff --git a/Engine/lib/speex/AUTHORS b/Engine/lib/speex/AUTHORS deleted file mode 100644 index 395c3fec2..000000000 --- a/Engine/lib/speex/AUTHORS +++ /dev/null @@ -1,18 +0,0 @@ -Jean-Marc Valin - All the code except the following - -David Rowe - lsp.c lsp.h - Also ideas and feedback - -John Francis Edwards - wave_out.[ch], some #ifdefs for windows port and MSVC project files - -Segher Boessenkool - Misc. optimizations (for QMF in particular) - -Atsuhiko Yamanaka : - Patch to speexenc.c to add Vorbis comment format - -Radim Kolar : - Patch to speexenc.c for supporting more input formats diff --git a/Engine/lib/speex/CMakeLists.txt b/Engine/lib/speex/CMakeLists.txt deleted file mode 100644 index 22a956142..000000000 --- a/Engine/lib/speex/CMakeLists.txt +++ /dev/null @@ -1,435 +0,0 @@ -cmake_minimum_required(VERSION 3.1) - -project(speex VERSION 1.2.0 LANGUAGES C) - -set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") - -include(CheckIncludeFile) -include(CheckSymbolExists) -include(CheckLibraryExists) -include(CMakeDependentOption) -include(FeatureSummary) -include(TestVarArrays) -include(CheckCCompilerFlag) -include(GNUInstallDirs) -include(TestBigEndian) - -test_big_endian(WORDS_BIGENDIAN) - -check_include_file(inttypes.h HAVE_INTTYPES_H) -if(HAVE_INTTYPES_H) - set(INCLUDE_STDINT "#include ") -else() - check_include_file(stdint.h HAVE_STDINT_H) - if(HAVE_STDINT_H) - set(INCLUDE_STDINT "#include ") - else() - check_include_file(sys/types.h INCLUDE_SYS_TYPES_H) - if(HAVE_SYS_TYPES_H) - set(INCLUDE_STDINT "#include ") - endif() - endif() -endif() -set(SIZE16 int16_t) -set(USIZE16 uint16_t) -set(SIZE32 int32_t) -set(USIZE32 uint32_t) -set(SIZE64 int64_t) -configure_file(include/speex/speex_config_types.h.in include/speex/speex_config_types.h @ONLY) - -test_vararrays(VAR_ARRAYS) -if(NOT VAR_ARRAYS) - check_include_file(alloca.h HAVE_ALLOCA_H) - if(WIN32) - set(USE_ALLOCA 1) - else() - check_symbol_exists(alloca "stdlib.h;alloca.h" USE_ALLOCA) - endif() -endif() - -option(ENABLE_FLOATING_POINT "Compile as floating-point" ON) -option(ENABLE_FIXED_POINT "Compile as fixed-point" OFF) - - -if(ENABLE_FLOATING_POINT AND ENABLE_FIXED_POINT) - message(FATAL_ERROR "Select one of ENABLE_FLOATING_POINT of ENABLE_FIXED_POINT.") -endif() -if((NOT ENABLE_FLOATING_POINT) AND (NOT ENABLE_FIXED_POINT)) - message(FATAL_ERROR "Select one of ENABLE_FLOATING_POINT of ENABLE_FIXED_POINT.") -endif() - -find_package(FFTW3) - -cmake_dependent_option(USE_GPL_FFTW3 "Use FFTW3 for FFT" OFF "FFTW3_FOUND; ENABLE_FLOATING_POINT" OFF) - -if(ENABLE_FLOATING_POINT) - set(FLOATING_POINT 1) - set(FIXED_POINT 0) - set(USE_KISS_FFT 0) - if(NOT USE_GPL_FFTW3) - set(USE_SMALLFT 1) - endif() -else() - set(FLOATING_POINT 0) - set(FIXED_POINT 1) - set(USE_KISS_FFT 1) - set(USE_SMALLFT 0) - set(USE_GPL_FFTW3 0) -endif() - -cmake_dependent_option(ENABLE_FIXED_POINT_DEBUG "Debug fixed-point implementation" OFF "ENABLE_FIXED_POINT" OFF) -set(FIXED_POINT_DEBUG ${ENABLE_FIXED_POINT_DEBUG}) - -option(DISABLE_FLOAT_API "Disable all parts of the API that are using floats" OFF) -option(DISABLE_VBR "Disable VBR and VAD from the codec" OFF) -cmake_dependent_option(ENABLE_VORBIS_PSY "Enable the Vorbis psy model" OFF "NOT ENABLE_FIXED_POINT;VAR_ARRAYS" OFF) -set(VORBIS_PSYCHO ${ENABLE_VORBIS_PSY}) - -if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)") - set(CPU_IS_X86 TRUE) -else() - set(CPU_IS_X86 FALSE) -endif() -if(CPU_IS_X86) - check_include_file(xmmintrin.h HAVE_XMMINTRIN_H) -endif() -cmake_dependent_option(ENABLE_SSE "Enable SSE support" ON "CPU_IS_X86;HAVE_XMMINTRIN_H;ENABLE_FLOATING_POINT" OFF) -if(ENABLE_SSE) - set(_USE_SSE 1) - check_c_compiler_flag("/arch:SSE" ARCH_SSE_FLAG) - if(ARCH_SSE_FLAG) - set(SSE_FLAGS "/arch:SSE") - else() - check_c_compiler_flag("-msse" MSSE_FLAG) - if(MSSE_FLAG) - set(SSE_FLAGS "-msse") - endif() - endif() -endif() - -if (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") - set(CPU_IS_ARM 1) -endif () -cmake_dependent_option(ENABLE_ARM4_ASM "Make use of ARM4 assembly optimizations" OFF "CPU_IS_ARM;ENABLE_FIXED_POINT" OFF) -set(ARM4_ASM ${ENABLE_ARM4_ASM}) -cmake_dependent_option(ENABLE_ARM5E_ASM "Make use of ARM5E assembly optimizations" OFF "CPU_IS_ARM;ENABLE_FIXED_POINT" OFF) -set(ARM5E_ASM ${ENABLE_ARM5E_ASM}) -cmake_dependent_option(ENABLE_BLACKFIN_ASM "Make use of Blackfin assembly optimizations" OFF "NOT CPU_IS_X86;ENABLE_FIXED_POINT" OFF) -set(BFIN_ASM ${ENABLE_BLACKFIN_ASM}) -cmake_dependent_option(ENABLE_TI_C55X "Enable support for TI C55X DSP" OFF "NOT CPU_IS_X86" OFF) -set(TI_C55X ${ENABLE_TI_C55X}) - -if(NOT WIN32) - check_library_exists(m cos "" HAVE_LIBM) - if(HAVE_LIBM) - find_library(LIBM m) - endif() -endif() - -if(MSVC) - add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE) -endif(MSVC) - -find_package(Ogg) -find_package(SpeexDsp) - -cmake_dependent_option(USE_SPEEXDSP "Enable SpeexDSP library" ON "SpeexDsp_FOUND" OFF) -cmake_dependent_option(BUILD_PROGRAMS "Build the encoder and decoder programs, not only the library" ON "Ogg_FOUND" ON) - -check_c_compiler_flag("-fvisibility=hidden" HAS_VISIBILITY) -if(HAS_VISIBILITY) - SET(EXPORT "__attribute__((visibility(\"default\")))") -endif() - -check_include_file(getopt.h HAVE_GETOPT_H) -if(HAVE_GETOPT_H) - check_symbol_exists(getopt_long getopt.h HAVE_GETOPT_LONG) -endif() - -option (ENABLE_PACKAGE_CONFIG "Generate and install package config file" ON) - -set_package_properties(Ogg PROPERTIES TYPE RECOMMENDED - URL "www.xiph.org/ogg/" - DESCRIPTION "library for manipulating ogg bitstreams" - PURPOSE "Required to build speexenc and speexdec tools") -set_package_properties(SpeexDsp PROPERTIES TYPE RECOMMENDED - URL "https://speex.org/" - DESCRIPTION "speech processing library that goes along with the Speex codec" - PURPOSE "Enables speexenc tool preprocessing options") -set_package_properties(FFTW3 PROPERTIES TYPE OPTIONAL - URL "http://www.fftw.org/" - DESCRIPTION "fast Fourier transform library" - PURPOSE "Enables use of FFTW3 for fast Fourier transforms") -add_feature_info(ENABLE_ALLOCA USE_ALLOCA "Make use of alloca function.") -add_feature_info(ENABLE_VAR_ARRAYS VAR_ARRAYS "Make use of variable-length arrays.") -add_feature_info(ENABLE_FLOATING_POINT ENABLE_FLOATING_POINT "compile as floating-point.") -add_feature_info(ENABLE_FIXED_POINT ENABLE_FIXED_POINT "compile as fixed-point.") -add_feature_info(ENABLE_FIXED_POINT_DEBUG ENABLE_FIXED_POINT_DEBUG "debug fixed-point implementation.") -add_feature_info(ENABLE_SSE ENABLE_SSE "enable SSE support.") -add_feature_info(ENABLE_ARM4_ASM ENABLE_ARM4_ASM "make use of ARM4 assembly optimizations.") -add_feature_info(ENABLE_ARM5E_ASM ENABLE_ARM5E_ASM "make use of ARM5E assembly optimizations.") -add_feature_info(ENABLE_BLACKFIN_ASM ENABLE_BLACKFIN_ASM "make use of Blackfin assembly optimizations.") -add_feature_info(ENABLE_TI_C55X ENABLE_TI_C55X "enable support for TI C55X DSP.") -add_feature_info(DISABLE_FLOAT_API DISABLE_FLOAT_API "disable all parts of the API that are using floats.") -add_feature_info(DISABLE_VBR DISABLE_VBR "disable VBR and VAD from the codec.") -add_feature_info(ENABLE_VORBIS_PSY ENABLE_VORBIS_PSY "enable the Vorbis psy model.") -add_feature_info(ENABLE_SPEEXDSP USE_SPEEXDSP "enable speexenc preprocessing options.") -add_feature_info(BUILD_BINARIES BUILD_BINARIES "build the encoder and decoder programs, not only the library.") -add_feature_info(ENABLE_PACKAGE_CONFIG ENABLE_PACKAGE_CONFIG "generate and install package config file") -add_feature_info(USE_GPL_FFTW3 USE_GPL_FFTW3 "Use FFTW3 library for fast Fourier transforms") -feature_summary(WHAT ALL) - -configure_file(config.h.cmake config.h) - -set(speex_PUBLIC_HEADERS - include/speex/speex.h - include/speex/speex_bits.h - include/speex/speex_callbacks.h - include/speex/speex_header.h - include/speex/speex_stereo.h - include/speex/speex_types.h - ${CMAKE_CURRENT_BINARY_DIR}/include/speex/speex_config_types.h) - -set(speex_SOURCES - libspeex/cb_search.c - libspeex/exc_10_32_table.c - libspeex/exc_8_128_table.c - libspeex/filters.c - libspeex/gain_table.c - libspeex/hexc_table.c - libspeex/high_lsp_tables.c - libspeex/lsp.c - libspeex/ltp.c - libspeex/speex.c - libspeex/stereo.c - libspeex/vbr.c - libspeex/vq.c - libspeex/bits.c - libspeex/exc_10_16_table.c - libspeex/exc_20_32_table.c - libspeex/exc_5_256_table.c - libspeex/exc_5_64_table.c - libspeex/gain_table_lbr.c - libspeex/hexc_10_32_table.c - libspeex/lpc.c - libspeex/lsp_tables_nb.c - libspeex/modes.c - libspeex/modes_wb.c - libspeex/nb_celp.c - libspeex/quant_lsp.c - libspeex/sb_celp.c - libspeex/speex_callbacks.c - libspeex/speex_header.c - libspeex/window.c - libspeex/arch.h - libspeex/bfin.h - libspeex/cb_search_arm4.h - libspeex/cb_search_bfin.h - libspeex/cb_search_sse.h - libspeex/filters.h - libspeex/filters_arm4.h - libspeex/filters_bfin.h - libspeex/filters_sse.h - libspeex/fixed_arm4.h - libspeex/fixed_arm5e.h - libspeex/fixed_bfin.h - libspeex/fixed_debug.h - libspeex/lpc.h - libspeex/lpc_bfin.h - libspeex/ltp.h - libspeex/ltp_arm4.h - libspeex/ltp_sse.h - libspeex/math_approx.h - libspeex/misc_bfin.h - libspeex/nb_celp.h - libspeex/quant_lsp.h - libspeex/sb_celp.h - libspeex/stack_alloc.h - libspeex/vbr.h - libspeex/vq.h - libspeex/vq_arm4.h - libspeex/vq_bfin.h - libspeex/vq_sse.h - libspeex/cb_search.h - libspeex/fftwrap.h - libspeex/fftwrap.c - libspeex/fixed_generic.h - libspeex/lsp.h - libspeex/lsp_bfin.h - libspeex/ltp_bfin.h - libspeex/modes.h - libspeex/os_support.h - libspeex/quant_lsp_bfin.h - libspeex/smallft.h) - -add_library(speex ${speex_PUBLIC_HEADERS} ${speex_SOURCES}) -target_compile_definitions(speex - PRIVATE -DHAVE_CONFIG_H) -target_include_directories(speex - PRIVATE $ - PUBLIC $ - PUBLIC $ - PUBLIC $) -if(USE_GPL_FFTW3) - target_include_directories(speex - PRIVATE $) - if(BUILD_SHARED_LIBS) - target_link_libraries(speex PRIVATE ${FFTW3_LIBRARIES}) - else() - target_link_libraries(speex PUBLIC ${FFTW3_LIBRARIES}) - endif() -endif() -if(HAVE_LIBM) - if(BUILD_SHARED_LIBS) - target_link_libraries(speex PRIVATE ${LIBM}) - else() - target_link_libraries(speex PUBLIC ${LIBM}) - endif() -endif() -target_compile_options(speex PRIVATE ${SSE_FLAGS}) -if(WIN32 AND BUILD_SHARED_LIBS) - target_sources(speex PRIVATE win32/libspeex.def) - set_target_properties (speex PROPERTIES OUTPUT_NAME "libspeex") -endif() -set_target_properties (speex PROPERTIES - PUBLIC_HEADER "${speex_PUBLIC_HEADERS}" - SOVERSION 1.5.1 - VERSION 1) -if(EXPORT AND BUILD_SHARED_LIBS) - set_target_properties (speex PROPERTIES - C_VISIBILITY_PRESET hidden) -endif() -if(USE_SMALLFT) - target_sources(speex PRIVATE - libspeex/smallft.c) -elseif(USE_KISS_FFT) - target_sources(speex PRIVATE - libspeex/kiss_fft.c - libspeex/_kiss_fft_guts.h - libspeex/kiss_fft.h - libspeex/kiss_fftr.c - libspeex/kiss_fftr.h) -endif() -if(VORBIS_PSYCHO) - target_sources(speex PRIVATE - libspeex/vorbis_psy.h - libspeex/vorbis_psy.c) -endif() - -# Programs - -if(BUILD_BINARIES) - -SET(speexenc_SOURCES - src/speexenc.c - src/wav_io.c - src/skeleton.c) -add_executable(speexenc ${speexenc_SOURCES}) -target_include_directories(speexenc - PRIVATE - $ - $) -target_link_libraries(speexenc - PUBLIC speex Ogg::ogg ${SPEEXDSP_LIBRARIES}) -if(WIN32) - target_link_libraries(speexenc PRIVATE winmm.lib) -endif() -target_compile_definitions(speexenc - PRIVATE -DHAVE_CONFIG_H) -if(NOT HAVE_GETOPT_LONG) - target_sources(speexenc PRIVATE - src/getopt.c - src/getopt1.c - src/wave_out.c) -endif() - -SET(speexdec_SOURCES - src/speexdec.c - src/wav_io.c) -add_executable(speexdec ${speexdec_SOURCES}) -target_include_directories(speexdec - PRIVATE - $ - $) -target_link_libraries(speexdec PUBLIC speex ${OGG_LIBRARIES}) -if(WIN32) - target_link_libraries(speexdec PRIVATE winmm.lib) -endif() -target_compile_definitions(speexdec - PRIVATE -DHAVE_CONFIG_H) -if(NOT HAVE_GETOPT_LONG) - target_sources(speexdec PRIVATE - src/getopt.c - src/getopt1.c - src/wave_out.c) -endif() - -# Tests (no automatic checking supported) - -add_executable(testenc libspeex/testenc.c) -target_include_directories(testenc - PRIVATE $) -target_link_libraries(testenc - PRIVATE ${LIBM} - PUBLIC speex) -target_compile_definitions(testenc - PRIVATE -DHAVE_CONFIG_H) -add_executable(testenc_wb libspeex/testenc_wb.c) -target_include_directories(testenc_wb - PRIVATE $) -target_link_libraries(testenc_wb - PRIVATE ${LIBM} - PUBLIC speex) -target_compile_definitions(testenc_wb - PRIVATE -DHAVE_CONFIG_H) -add_executable(testenc_uwb libspeex/testenc_uwb.c) -target_include_directories(testenc_uwb - PRIVATE $) -target_link_libraries(testenc_uwb - PRIVATE ${LIBM} - PUBLIC speex) -target_compile_definitions(testenc_uwb - PRIVATE -DHAVE_CONFIG_H) - -endif() - -# Installation - -install(TARGETS speex - EXPORT speex-targets - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/speex) - -if(BUILD_BINARIES) - install(TARGETS speexdec speexenc RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif() - -install(FILES doc/manual.pdf DESTINATION ${CMAKE_INSTALL_DOCDIR}) -install(FILES src/speexenc.1 src/speexdec.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) -install(FILES speex.m4 DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/aclocal) - -set(prefix ${CMAKE_INSTALL_PREFIX}) -set(exec_prefix $\{prefix\}) -set(libdir $\{exec_prefix\}/${CMAKE_INSTALL_LIBDIR}) -set(includedir $\{prefix\}/${CMAKE_INSTALL_INCLUDEDIR}) -set(SPEEX_VERSION ${PROJECT_VERSION}) -if(HAVE_LIBM) - set(LIBM -lm) -endif() -configure_file(speex.pc.in speex.pc @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/speex.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) - -set(PACKAGE ${PROJECT_NAME}) -set(VERSION ${PROJECT_VERSION}) -configure_file(Speex.spec.in Speex.spec @ONLY) - -if (ENABLE_PACKAGE_CONFIG) - include (CMakePackageConfigHelpers) - write_basic_package_version_file (speex-config-version.cmake COMPATIBILITY SameMajorVersion) - set(CMAKE_INSTALL_PACKAGEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) - install(EXPORT speex-targets NAMESPACE Speex:: DESTINATION ${CMAKE_INSTALL_PACKAGEDIR}) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/speex-config-version.cmake DESTINATION ${CMAKE_INSTALL_PACKAGEDIR}) - install(FILES cmake/speex-config.cmake DESTINATION ${CMAKE_INSTALL_PACKAGEDIR}) -endif() diff --git a/Engine/lib/speex/COPYING b/Engine/lib/speex/COPYING deleted file mode 100644 index de6fbe2c9..000000000 --- a/Engine/lib/speex/COPYING +++ /dev/null @@ -1,35 +0,0 @@ -Copyright 2002-2008 Xiph.org Foundation -Copyright 2002-2008 Jean-Marc Valin -Copyright 2005-2007 Analog Devices Inc. -Copyright 2005-2008 Commonwealth Scientific and Industrial Research - Organisation (CSIRO) -Copyright 1993, 2002, 2006 David Rowe -Copyright 2003 EpicGames -Copyright 1992-1994 Jutta Degener, Carsten Bormann - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -- Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -- Neither the name of the Xiph.org Foundation nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Engine/lib/speex/ChangeLog b/Engine/lib/speex/ChangeLog deleted file mode 100644 index 9a6cd8af0..000000000 --- a/Engine/lib/speex/ChangeLog +++ /dev/null @@ -1,21 +0,0 @@ -2005-09-07 Thomas Vander Stichele - - * libspeex/cb_search.c: (split_cb_search_shape_sign_N1): - add declaration for n, seems like an obvious build fix, slap - me down if it's not - -2004-02-18 Jean-Marc Valin - Patch for compiling with mingw32 sent by j@thing.net - -2004-02-18 Jean-Marc Valin - Integrated IRIX patch (getopt stuff) from Michael Pruett - -2004-02-18 Jean-Marc Valin - Changed the Makefile.am so that KDevelop can parse SUBDIRS correctly - -2002/03/27 Jean-Marc Valin: -Working encoder and decoder for both narrowband and wideband. - -2002/02/27 Jean-Marc Valin: -Got the basic encoder working as a demo with quantization only on some -parameters. diff --git a/Engine/lib/speex/Doxyfile b/Engine/lib/speex/Doxyfile deleted file mode 100644 index 772934fc3..000000000 --- a/Engine/lib/speex/Doxyfile +++ /dev/null @@ -1,225 +0,0 @@ -# Doxyfile 1.5.1-KDevelop - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = Speex -PROJECT_NUMBER = 1.2-beta2 -OUTPUT_DIRECTORY = doc -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -BUILTIN_STL_SUPPORT = NO -DISTRIBUTE_GROUP_DOC = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = NO -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = NO -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = YES -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = include/speex -FILE_PATTERNS = -RECURSIVE = NO -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = speex_config_types.h -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -REFERENCES_LINK_SOURCE = YES -USE_HTAGS = NO -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = NO -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = YES -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = YES -USE_PDFLATEX = YES -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -CALLER_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = gif -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff --git a/Engine/lib/speex/IDEAS b/Engine/lib/speex/IDEAS deleted file mode 100644 index 73fe26e72..000000000 --- a/Engine/lib/speex/IDEAS +++ /dev/null @@ -1,4 +0,0 @@ -- Non-linear adaptive codebook (use exc[n]*|exc[n]| to reduce noise - component in adaptive codebook excitation) - -- Include time-domain masking for VBR diff --git a/Engine/lib/speex/INSTALL b/Engine/lib/speex/INSTALL deleted file mode 100644 index ca9d5d1f4..000000000 --- a/Engine/lib/speex/INSTALL +++ /dev/null @@ -1,8 +0,0 @@ -Installing Speex is as easy as: - -% ./configure [--prefix=] -% make -% make install - -Note that if you are using the code from Git, you will need to run "autogen.sh" -and then "configure". diff --git a/Engine/lib/speex/Makefile.am b/Engine/lib/speex/Makefile.am deleted file mode 100644 index 2b4bedeee..000000000 --- a/Engine/lib/speex/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# To disable automatic dependency tracking if using other tools than -# gcc and gmake, add the option 'no-dependencies' -AUTOMAKE_OPTIONS = 1.8 -ACLOCAL_AMFLAGS = -I m4 - -m4datadir = $(datadir)/aclocal -m4data_DATA = speex.m4 - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = speex.pc - -EXTRA_DIST = Speex.spec Speex.spec.in Speex.kdevelop speex.m4 speex.pc.in \ - README.blackfin README.symbian README.TI-DSP CMakeLists.txt config.h.cmake \ - $(cmake_files) .appveyor.yml - -cmake_files = cmake/FindOgg.cmake cmake/FindSpeexDsp.cmake \ - cmake/FindSpeexDsp.cmake cmake/speex-config.cmake cmake/TestVarArrays.cmake - -#Fools KDevelop into including all files -SUBDIRS = libspeex include doc win32 symbian ti - -if BUILD_BINARIES -SUBDIRS += src -endif - -DIST_SUBDIRS = libspeex include src doc win32 symbian ti - -rpm: dist - rpmbuild -ta ${PACKAGE}-${VERSION}.tar.gz diff --git a/Engine/lib/speex/NEWS b/Engine/lib/speex/NEWS deleted file mode 100644 index 9a9952914..000000000 --- a/Engine/lib/speex/NEWS +++ /dev/null @@ -1 +0,0 @@ -2002/02/13: Creation of the "Speex" project diff --git a/Engine/lib/speex/OPTIMIZE b/Engine/lib/speex/OPTIMIZE deleted file mode 100644 index d36f5f7d6..000000000 --- a/Engine/lib/speex/OPTIMIZE +++ /dev/null @@ -1,10 +0,0 @@ -Narrowband: - -- pitch_gain_search_3tap calls syn_filt_zero more times than it should (we're -computing some things twice) - -Wideband - -- All narrowband optimizations apply -- Lots of time spent in the codebook search. We could speed that up by using - a hierarchical codebook diff --git a/Engine/lib/speex/README b/Engine/lib/speex/README deleted file mode 100644 index 84fe74adb..000000000 --- a/Engine/lib/speex/README +++ /dev/null @@ -1,9 +0,0 @@ -See INSTALL file for instruction on how to install Speex. - -The Speex is a patent-free, Open Source/Free Software voice codec. Unlike other codecs like MP3 and Ogg Vorbis, Speex is designed to compress voice at bitrates in the 2-45 kbps range. Possible applications include VoIP, internet audio streaming, archiving of speech data (e.g. voice mail), and audio books. In some sense, it is meant to be complementary to the Ogg Vorbis codec. - -To use the Speex command line tools: - -% speexenc [options] input_file.wav compressed_file.spx - -% speexdec [options] compressed_file.spx output_file.wav diff --git a/Engine/lib/speex/README.TI-DSP b/Engine/lib/speex/README.TI-DSP deleted file mode 100644 index c3b757671..000000000 --- a/Engine/lib/speex/README.TI-DSP +++ /dev/null @@ -1,56 +0,0 @@ -These are all of the changes and additions necessary to build a loopback application for the -TI C6415, C5509A, or C5416 simulators using the TI Code Composer Studio (CCS) development system. -A trial version of the tools can be downloaded from the TI website. - -This build runs 8kbps narrowband, with minimum complexity. - -Several changes are introduced in Speex 1.1.11 which are used in these applications: - -arch.h: Added switch for compilers not supporting "long long" (C55x does, C54x, CCS 2.x C64x does not) -bits.c: Allow external definition for max buffer size, changed MAX_BYTES_PER_FRAME - to MAX_CHARS_PER_FRAME for consistency -misc.c: Added override switches to alloc routines, conditional include of user file "user_misc.h". - These changes allow manual memory allocation rather than using heap - -The arch.h change allows operation with 2.x versions of Code Composer Studio. -The bits.c change reduces the data memory usage. -The misc.c change allows private memory allocation, for cases where it is not -desirable to use the normal heap. - -Added files: - -testenc-TI-C5x.c (For C54x and C55x builds, derived from testenc.c, - manual alloc, byte packing/unpacking added) -testenc-TI-C64x.c (For C64x builds, derived from testenc.c, manual alloc, byte packing/unpacking added) - -config.h (not automatically generated, sets memory sizes, enables/disables manual alloc) -user_misc.h (contains the manual memory alloc routines, with debug code to display mem usage) -speex\speex_config_types.h (match Speex types to compiler types, not generated from types.in) - -speex_c54_test\speex_c54_test.cmd (C5416 linker command file) -speex_c54_test\speex_c54_test.pjt (Code Composer Studio Project File ) -speex_c55_test\speex_c55_test.cmd (C5509A linker command file) -speex_c55_test\speex_c55_test.pjt (Code Composer Studio Project File ) -speex_c64_test\speex_c64_test.cmd (C6415 linker command file) -speex_c64_test\speex_c64_test.pjt (Code Composer Studio Project File ) - -samples\male.snd - -Usage: -1. Create a Speex 1.1.11 (or later) source tree. -2. Edit the files testenc-TI-C5x.c and/or testenc-TI-C64x.c to change the hard-coded path - for the test audio and data files. - This build uses the file e:\speextrunktest\samples\male.snd. - Note: This is a headerless 16-bit stereo audio file derived from the male.wav test file - http://www.speex.org/samples/male.wav -3. Edit the .pjt file with a text editor and change projdir or projectdir to the correct path - (one place near the top of the file). -4. Edit config.h if desired, to change the memory allocation method (calloc or manual), - and to enable/disable debug prints for the memory allocation - (this makes it easier to determine the required size). -5. Run Code Composer Studio, and open the project for the desired target (e.g. speex_c55_test). - Note that the correct simulator must be selected (in CCS Setup) before starting CCS. -6. Build and run the simulation. - -Note that assembly optimizations will be required to run C54x in real time. -There are no assembly optimizations in any of these builds. diff --git a/Engine/lib/speex/README.Trimedia b/Engine/lib/speex/README.Trimedia deleted file mode 100644 index 8adc80e99..000000000 --- a/Engine/lib/speex/README.Trimedia +++ /dev/null @@ -1,191 +0,0 @@ -################# REMOVE warnings on trimedia compiler ############################## -################# Not critical to compilation ############################## - -1. Change the following statements to remove warning for constant expression -(i) mdf.c [if(0) --> #if 0] -(ii) ltp.c [if(1) --> #if 1] -(iii) preprocess.c [if(1) --> #if 1] -(iv) sb_celp.c [if (SPEEX_SET_VBR_MAX_BITRATE<1) --> #if (SPEEX_SET_VBR_MAX_BITRATE<1)] - -2. add REMARK_ON macro to remove warning on not reference variable --- uses (void) to remove warning on not referenced variable --- #define REMARK_ON --- (void) --- #endif --- search for REMARK_ON on the following files -(i) jitter.c -(ii) lsp.c -(iii) ltp.c -(iv) mdf.c -(v) filters.c -(vi) filterbank.c -(vii) cb_search.c -(viii) vq.c -(ix) vbr.c -(x) stereo.c -(xi) speex_callbacks.c -(xii) preprocess.c - -3. commented out the following in pseudofloat.h for unused variable -//static const spx_float_t FLOAT_HALF = {16384,-15}; - -4. commented out unused variable in nb_celp.c -//spx_word16_t *sp; ***unused variable*** -//sp=out+offset; ***unused variable*** -//int submode; ***unused variable*** -// ***unused variable*** -// advance = submode = speex_bits_unpack_unsigned(bits, SB_SUBMODE_BITS); -advance = speex_bits_unpack_unsigned(bits, SB_SUBMODE_BITS); -// ***unused variable*** -//advance = submode = speex_bits_unpack_unsigned(bits, SB_SUBMODE_BITS); -advance = speex_bits_unpack_unsigned(bits, SB_SUBMODE_BITS); -// spx_word16_t *exc; ***unused variable*** -// exc=st->exc+offset; ***unused variable*** - -5. commented out unused variable in vbr.c -//int va; ***unused variable*** -//va = 0; ***unused variable*** -//va = 1; ***unused variable*** - -6. added HAVE_CONFIG into medfilter.c - -################# Patches for trimedia compiler ############################## -################# Critical to compilation ############################## --- change the following in modes.c and speex.h as compiler does not support const * const... -(i) modes.c -#ifdef __TCS__ -const SpeexMode * speex_mode_list[SPEEX_NB_MODES] = {&speex_nb_mode, &speex_wb_mode, &speex_uwb_mode}; -#else -const SpeexMode * const speex_mode_list[SPEEX_NB_MODES] = {&speex_nb_mode, &speex_wb_mode, &speex_uwb_mode}; -#endif - -(ii) speex.h -#ifdef __TCS__ -extern const SpeexMode * speex_mode_list[SPEEX_NB_MODES]; -#else -extern const SpeexMode * const speex_mode_list[SPEEX_NB_MODES]; -#endif - --- added the #elif defined (TM_ASM) to the following files for optimized codes -(1) arch.h -(2) cb_search.c -(3) fftwrap.c -(4) filterbank.c -(5) filters.c -(6) kiss_fft.c -(7) kiss_fftr.c -(8) lpc.c -(9) lsp.c -(10) ltp.c -(11) mdf.c -(12) misc.c -(13) preprocess.c -(14) quant_lsp.c -(15) vq.c - --- reorder macro definations in quant_lsp.c -#ifdef FIXED_POINT - -#define LSP_LINEAR(i) (SHL16(i+1,11)) -#define LSP_LINEAR_HIGH(i) (ADD16(MULT16_16_16(i,2560),6144)) -#define LSP_DIV_256(x) (SHL16((spx_word16_t)x, 5)) -#define LSP_DIV_512(x) (SHL16((spx_word16_t)x, 4)) -#define LSP_DIV_1024(x) (SHL16((spx_word16_t)x, 3)) -#define LSP_PI 25736 - -#else - -#define LSP_LINEAR(i) (.25*(i)+.25) -#define LSP_LINEAR_HIGH(i) (.3125*(i)+.75) -#define LSP_SCALE 256. -#define LSP_DIV_256(x) (0.0039062*(x)) -#define LSP_DIV_512(x) (0.0019531*(x)) -#define LSP_DIV_1024(x) (0.00097656*(x)) -#define LSP_PI M_PI - -#endif - -#ifdef BFIN_ASM -#include "quant_lsp_bfin.h" -#elif defined (TM_ASM) -#include "quant_lsp_tm.h" -#endif - --- added macro PREPROCESS_MDF_FLOAT to allow using of floating point --- in mdf and preprocess while keeping fixed point in encoder/decoder --- This is due to the fact that preprocess/mdf run faster on floating --- point on trimedia --- added the following 3 lines to the files below -#ifdef PREPROCESS_MDF_FLOAT -#undef FIXED_POINT -#endif -(1) mdf.c -(2) preprocess.c -(3) filterbank.c -(4) fftwrap.c -(5) kiss_fft.c -(6) kiss_fftr.c - --- created a new USE_COMPACT_KISS_FFT for fftwrap.c and shifted defination --- to config file so that user configure the usage of fft on config.h --- TOEXPLORE:is it possible to share table between mdf/preprocess? --- Introducing this macro made the following changes in C code --- New macro to facilitate integration -(grouping real/complex for dc and nyquist frequency seems to require a large -amount of memory for mdf, therefore did not made the changes for that) -(1) modify preprocess.c on init and destroy -(2) modify mdf.c on init and destroy -(3) shifted power_spectrum to fftwrap.c to share optimised code between - preprocess.c and mdf.c - -################# NOTES ############################## -(1) fixed point encoding/decoding is tested on narrowband - - some of the QX fractions are packed together to - (frac1 * a + frac2 * a) >> X (should be more accurate in rounding) - instead of - ((frac1 * a) >> X) + ((frac2 * a) >> X) - will cause some different between optimized and unoptimized code. - tried decoding/encoding optimized code on some audio files retains - the clearity of the word - - - wideband/ultrawideband is not heavily tested yet - -(2) optimized fixed point code requires memory alignment - - used config to debug on functions where memory is not align - -(3) floating point optimization for preprocess/mdf is tested - fixed point is not tested yet (except fft/filterbank) - Note (1) also applies to sround in fft for fixed point - some optimization is provided for fixed point as it requires lesser - memory compared to floating point. - -(4) unroll configurations provided to reduce code size if required - -(5) use profile options only if compiler profiling fails to work - -(6) can't include the makefile as it is close proprietary - -################# TODO:For Trimedia ############################## -(1) Possible add TSSA wrapper for codec but don't think this can be open source. -(2) Optimizations for fixed point in mdf/preprocess - -################# Added Files ############################## -- _kiss_fft_guts_tm.h -- cb_search_tm.h -- fftwrap_tm.h -- filterbank_tm.h -- filters_tm.h -- fixed_tm.h -- kiss_fft_tm.h -- kiss_fftr_tm.h -- lpc_tm.h -- lsp_tm.h -- ltp_tm.h -- mdf_tm.h -- misc_tm.h -- preprocess_tm.h -- profile_tm.h -- quant_lsp_tm.h -- vq_tm.h -- config.h -- speex_config_types.h diff --git a/Engine/lib/speex/README.blackfin b/Engine/lib/speex/README.blackfin deleted file mode 100644 index 5923e8645..000000000 --- a/Engine/lib/speex/README.blackfin +++ /dev/null @@ -1,21 +0,0 @@ -Speex has been ported to the Blackfin DSP, for the STAMP development board. - -This port has been tested on the STAMP development board and requires the -toolchain available at http://blackfin.uclinux.org/ - -1/ In order to cross-compile for uClinux from the Speex tarball: - - ./configure --enable-blackfin-asm --enable-fixed-point --host=bfin-uclinux - cd libspeex - make - -The --enable-blackfin-asm option is not required, but it speeds up Speex by -approximately a factor of two. - -2/ In order to cross-compile for uClinux from the Speex Git: - - git clone git://git.xiph.org/speex.git - cd speex - ./autogen.sh --enable-blackfin-asm --enable-fixed-point --host=bfin-uclinux - cd libspeex - make diff --git a/Engine/lib/speex/README.symbian b/Engine/lib/speex/README.symbian deleted file mode 100644 index a4f8d9586..000000000 --- a/Engine/lib/speex/README.symbian +++ /dev/null @@ -1,43 +0,0 @@ -Using Speex on Symbian OS -Conrad Parker and Colin Ward, CSIRO Australia, July 2004 - - -Introduction ------------- - -The symbian/ directory contains the following files for Symbian's abuild tool: - - bld.inf Component definition file - speex.mmp Project specification file - config.h Configuration options for both emulator and device builds - - -Developing applications for libspeex for Symbian OS ---------------------------------------------------- - - Any references to the statically defined SpeexMode structures must be - replaced by a call to a speex_lib_get_mode () for that mode. - - * References to the statically defined array speex_mode_list[modeID] - must be replaced by a call to speex_lib_get_mode (modeID): - -- mode = speex_mode_list[modeID]; -+ mode = speex_lib_get_mode (modeID); - - * References to the statically defined mode structures must be replaced: - - SpeexMode * mode1, * mode2, * mode3; - -- mode1 = &speex_nb_mode; -+ mode1 = speex_lib_get_mode (SPEEX_MODEID_NB); - -- mode2 = &speex_wb_mode; -+ mode2 = speex_lib_get_mode (SPEEX_MODEID_WB); - -- mode3 = &speex_uwb_mode; -+ mode3 = speex_lib_get_mode (SPEEX_MODEID_UWB); - - Note that the constants SPEEX_MODEID_NB, SPEEX_MODEID_WB and - SPEEX_MODEID_UWB were introduced in libspeex 1.1.6, and are - defined in . speex_lib_get_mode() was introduced - in libspeex 1.1.7 and is declared in . diff --git a/Engine/lib/speex/README.win32 b/Engine/lib/speex/README.win32 deleted file mode 100644 index 51426b8c4..000000000 --- a/Engine/lib/speex/README.win32 +++ /dev/null @@ -1,11 +0,0 @@ -Win32 Specific options - -In order to enable the following options within Speex, you will need to manually edit the project options for the appropriate VC configuration. These macros can be specified by adding them as "Preprocessor Definitions" under the appropriate Configuration's project options. If you don't know how to do this, please check your Visual C documentation. - -Feature: - -Intel Streaming SIMD Extensions - SSE - macro: USE_SSE -Fixed point - macro: FIXED_POINT -Epic 48 - macro: EPIC_48K - -Note: USE_SSE and FIXED_POINT are mutually exclusive. diff --git a/Engine/lib/speex/Speex.kdevelop b/Engine/lib/speex/Speex.kdevelop deleted file mode 100644 index 1b3d683b0..000000000 --- a/Engine/lib/speex/Speex.kdevelop +++ /dev/null @@ -1,201 +0,0 @@ - - - - Jean-Marc Valin - jean-marc.valin@usherbrooke.ca - $VERSION$ - KDevAutoProject - C - - . - false - - - kdevsubversion - - Speex - - - - libspeex/libspeex.la - float - - - src/Speex - executable - / - - false - true - - false - false - - - - float - kdevgccoptions - kdevgppoptions - kdevpgf77options - -O2 -g -Wall - - --disable-shared - - - - - - - - - - - --enable-fixed-point --disable-shared - fixed - kdevgccoptions - kdevgppoptions - kdevpgf77options - -O2 -g -Wall - - - - - - - - - - - - - - - - - - - - false - 4 - false - - true - 0 - - - - - libtool - - - - - - true - false - false - - - false - true - 10 - - - - - - - - - - - - - true - true - true - false - true - true - true - 350 - 400 - 250 - false - 0 - true - true - false - std=_GLIBCXX_STD;__gnu_cxx=std - true - true - false - false - true - true - true - true - .; - false - false - - - false - 3 - /usr/share/qt3 - 3 - EmbeddedKDevDesigner - /usr/share/qt3/bin/qmake - /usr/bin/designer-qt3 - - - - - set - m_,_ - theValue - true - true - - - true - true - Horizontal - - - - - false - false - - - *.o,*.lo,CVS - true - false - - - - - html/ - html/ - - - - - - - - - - .h - .cpp - - - - - - - - - - diff --git a/Engine/lib/speex/Speex.spec.in b/Engine/lib/speex/Speex.spec.in deleted file mode 100644 index bccfc2351..000000000 --- a/Engine/lib/speex/Speex.spec.in +++ /dev/null @@ -1,71 +0,0 @@ -%define name @PACKAGE@ -%define ver @VERSION@ -%define rel 1 - -Summary: An open-source, patent-free speech codec -Name: %name -Version: %ver -Release: %rel -License: BSD -Group: Application/Devel -Source: http://www.speex.org/download/%{name}-%{ver}.tar.gz -URL: http://www.speex.org/ -Vendor: Speex -Packager: Jean-Marc Valin (jean-marc.valin@usherbrooke.ca) -BuildRoot: /var/tmp/%{name}-build-root -Docdir: /usr/share/doc - -%description -Speex is a patent-free audio codec designed especially for voice (unlike -Vorbis which targets general audio) signals and providing good narrowband -and wideband quality. This project aims to be complementary to the Vorbis -codec. - -%package devel -Summary: Speex development files -Group: Development/Libraries -Requires: %{name} = %{version} - -%description devel -Speex development files. - -%changelog -* Thu Oct 03 2002 Jean-Marc Valin -- Added devel package inspired from PLD spec file - -* Tue Jul 30 2002 Fredrik Rambris 0.5.2 -- Added buildroot and docdir and ldconfig. Makes it builadble by non-roots - and also doesn't write to actual library paths when building. - -%prep -%setup - -%build -export CFLAGS='-O3' -./configure --prefix=/usr --enable-shared --enable-static -make - -%install -rm -rf $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT install - -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig - -%files -%defattr(644,root,root,755) -%doc COPYING AUTHORS ChangeLog NEWS README -%doc doc/manual.pdf -/usr/share/man/man1/speexenc.1* -/usr/share/man/man1/speexdec.1* -%attr(755,root,root) %{_bindir}/speex* -%attr(755,root,root) %{_libdir}/libspeex*.so* - -%files devel -%defattr(644,root,root,755) -%attr(755,root,root) %{_libdir}/libspeex*.la -%{_includedir}/speex/speex*.h -/usr/share/aclocal/speex.m4 -%{_libdir}/pkgconfig/speex.pc -%{_libdir}/pkgconfig/speexdsp.pc -%{_libdir}/libspeex*.a diff --git a/Engine/lib/speex/TODO b/Engine/lib/speex/TODO deleted file mode 100644 index 47be3f640..000000000 --- a/Engine/lib/speex/TODO +++ /dev/null @@ -1,38 +0,0 @@ -For 1.2: -Major points: -- Make documentation match the actual code -- Stabilise all APIs (need feedback) -- NaN checks? -- Better error reporting -- Make kiss-fft 32-bit safe - -Minor issues: -- Fix last frame of speexenc - - -Post 1.2: -improve float<->int conversion -split encoder and decoder? -Merge TriMedia stuff -packet dump -Do VAD properly - -Optimisations -- Add restrict in a few places? -- enable 4x4 version of pitch_xcorr() at least on some archs? -- use __builtin_expect() (likely()/unlikely()) - -Would be nice: -Implement wideband split as IIR instead of QMF? - -Allocator override (speex_lib_ctl?) -Fixed-point: - - VBR - -Standards --Complete Speex RTP profile --MIME type registration - -ideas: -Peelable stream (double codebook, higher bands, stereo) -LPC from spectral domain diff --git a/Engine/lib/speex/autogen.sh b/Engine/lib/speex/autogen.sh deleted file mode 100644 index dc6f71134..000000000 --- a/Engine/lib/speex/autogen.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Run this to set up the build system: configure, makefiles, etc. -set -e - -srcdir=`dirname $0` -test -n "$srcdir" && cd "$srcdir" - -echo "Updating build configuration files, please wait...." - -autoreconf -if - diff --git a/Engine/lib/speex/cmake/FindFFTW3.cmake b/Engine/lib/speex/cmake/FindFFTW3.cmake deleted file mode 100644 index ff1961c5d..000000000 --- a/Engine/lib/speex/cmake/FindFFTW3.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# - Find fftw3 -# Find the native fftw3 includes and libraries -# -# FFTW3_INCLUDE_DIRS - where to find fftw3.h, etc. -# FFTW3_LIBRARIES - List of libraries when using fftw3. -# FFTW3_FOUND - True if fftw3 found. - -if(FFTW3_INCLUDE_DIR) - # Already in cache, be silent - set(FFTW3_FIND_QUIETLY TRUE) -endif(FFTW3_INCLUDE_DIR) - -find_package (PkgConfig QUIET) -pkg_check_modules(PC_FFTW QUIET fftw3f) - -find_path(FFTW3_INCLUDE_DIR fftw3.h HINTS ${PC_FFTW3_INCLUDEDIR} ${PC_FFTW3_INCLUDE_DIRS} ${FFTW3_ROOT} PATH_SUFFIXES include) -find_library(FFTW3_LIBRARY NAMES fftw3f HINTS ${PC_FFTW3_LIBDIR} ${PC_FFTW3_LIBRARY_DIRS} ${FFTW3_ROOT} PATH_SUFFIXES lib) -# Handle the QUIETLY and REQUIRED arguments and set FFTW3_FOUND -# to TRUE if all listed variables are TRUE. -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(FFTW3 REQUIRED_VARS FFTW3_INCLUDE_DIR FFTW3_LIBRARY) - -if (FFTW3_FOUND) - set (FFTW3_LIBRARIES ${FFTW3_LIBRARY}) - set (FFTW3_INCLUDE_DIRS ${FFTW3_INCLUDE_DIR}) -endif (FFTW3_FOUND) - -mark_as_advanced(FFTW3_INCLUDE_DIR FFTW3_LIBRARY) diff --git a/Engine/lib/speex/cmake/FindOgg.cmake b/Engine/lib/speex/cmake/FindOgg.cmake deleted file mode 100644 index 793c0869a..000000000 --- a/Engine/lib/speex/cmake/FindOgg.cmake +++ /dev/null @@ -1,38 +0,0 @@ -# - Find ogg -# Find the native ogg includes and libraries -# -# OGG_INCLUDE_DIRS - where to find ogg.h, etc. -# OGG_LIBRARIES - List of libraries when using ogg. -# Ogg_FOUND - True if ogg found. - -if(OGG_INCLUDE_DIR) - # Already in cache, be silent - set(OGG_FIND_QUIETLY TRUE) -endif(OGG_INCLUDE_DIR) - -find_package (PkgConfig QUIET) -pkg_check_modules(PC_OGG QUIET ogg) - -find_path(OGG_INCLUDE_DIR ogg/ogg.h HINTS ${PC_OGG_INCLUDEDIR} ${PC_OGG_INCLUDE_DIRS} ${OGG_ROOT} PATH_SUFFIXES include) -# MSVC built ogg may be named ogg_static. -# The provided project files name the library with the lib prefix. -find_library(OGG_LIBRARY NAMES ogg ogg_static libogg libogg_static HINTS ${PC_OGG_LIBDIR} ${PC_OGG_LIBRARY_DIRS} ${OGG_ROOT} PATH_SUFFIXES lib) -# Handle the QUIETLY and REQUIRED arguments and set OGG_FOUND -# to TRUE if all listed variables are TRUE. -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Ogg DEFAULT_MSG OGG_INCLUDE_DIR OGG_LIBRARY) - -if (OGG_FOUND) - set (OGG_LIBRARIES ${OGG_LIBRARY}) - set (OGG_INCLUDE_DIRS ${OGG_INCLUDE_DIR}) - - if (NOT TARGET Ogg::ogg) - add_library(Ogg::ogg UNKNOWN IMPORTED) - set_target_properties(Ogg::ogg PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${OGG_INCLUDE_DIRS}" - IMPORTED_LOCATION "${OGG_LIBRARIES}" - ) - endif () -endif (OGG_FOUND) - -mark_as_advanced(OGG_INCLUDE_DIR OGG_LIBRARY) diff --git a/Engine/lib/speex/cmake/FindSpeexDsp.cmake b/Engine/lib/speex/cmake/FindSpeexDsp.cmake deleted file mode 100644 index d4a332f51..000000000 --- a/Engine/lib/speex/cmake/FindSpeexDsp.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# - Find speexdsp -# Find the native speexdsp includes and libraries -# -# SPEEXDSP_INCLUDE_DIRS - where to find speex_preprocess.h, etc. -# SPEEXDSP_LIBRARIES - List of libraries when using speexdsp. -# SpeexDsp_FOUND - True if speexdsp found. - -if(SPEEXDSP_INCLUDE_DIR) - # Already in cache, be silent - set(SPEEXDSP_FIND_QUIETLY TRUE) -endif(SPEEXDSP_INCLUDE_DIR) - -find_package (PkgConfig QUIET) -pkg_check_modules(PC_SPEEXDSP QUIET speexdsp) - -find_path(SPEEXDSP_INCLUDE_DIR speex/speex_preprocess.h HINTS ${PC_SPEEXDSP_INCLUDEDIR} ${PC_SPEEXDSP_INCLUDE_DIRS} ${SPEEXDSP_ROOT} PATH_SUFFIXES include) -find_library(SPEEXDSP_LIBRARY NAMES speexdsp HINTS ${PC_SPEEXDSP_LIBDIR} ${PC_SPEEXDSP_LIBRARY_DIRS} ${SPEEXDSP_ROOT} PATH_SUFFIXES lib) -# Handle the QUIETLY and REQUIRED arguments and set SPEEXDSP_FOUND -# to TRUE if all listed variables are TRUE. -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(SpeexDsp DEFAULT_MSG SPEEXDSP_INCLUDE_DIR SPEEXDSP_LIBRARY) - -if (SPEEXDSP_FOUND) - set (SPEEXDSP_LIBRARIES ${SPEEXDSP_LIBRARY}) - set (SPEEXDSP_INCLUDE_DIRS ${SPEEXDSP_INCLUDE_DIR}) -endif (SPEEXDSP_FOUND) - -mark_as_advanced(SPEEXDSP_INCLUDE_DIR SPEEXDSP_LIBRARY) diff --git a/Engine/lib/speex/cmake/TestVarArrays.cmake b/Engine/lib/speex/cmake/TestVarArrays.cmake deleted file mode 100644 index 11f413fd8..000000000 --- a/Engine/lib/speex/cmake/TestVarArrays.cmake +++ /dev/null @@ -1,22 +0,0 @@ -include(CheckCSourceCompiles) - -macro(TEST_VARARRAYS VARIABLE) - if(NOT DEFINED ${VARIABLE}) - check_c_source_compiles( - " - void main(void) - { - int foo; - foo = 10; - int array[foo]; - }; - " - VARARRAYS_SUPPORT) - set(${VARIABLE} ${VARARRAYS_SUPPORT} CACHE INTERNAL "C99 variable-size arrays support" FORCE) - if(${VARIABLE}) - set(RESULT_TEXT "success") - else() - set(RESULT_TEXT "failed") - endif() - endif() -endmacro(TEST_VARARRAYS VARIABLE) diff --git a/Engine/lib/speex/cmake/speex-config.cmake b/Engine/lib/speex/cmake/speex-config.cmake deleted file mode 100644 index 8b7e4043a..000000000 --- a/Engine/lib/speex/cmake/speex-config.cmake +++ /dev/null @@ -1 +0,0 @@ -include (${CMAKE_CURRENT_LIST_DIR}/speex-targets.cmake) diff --git a/Engine/lib/speex/config.h.cmake b/Engine/lib/speex/config.h.cmake deleted file mode 100644 index cbf88b15b..000000000 --- a/Engine/lib/speex/config.h.cmake +++ /dev/null @@ -1,23 +0,0 @@ -#cmakedefine WORDS_BIGENDIAN -#cmakedefine FLOATING_POINT -#cmakedefine FIXED_POINT -#cmakedefine FIXED_POINT_DEBUG -#cmakedefine DISABLE_FLOAT_API -#cmakedefine _USE_SSE -#cmakedefine ARM4_ASM -#cmakedefine ARM5E_ASM -#cmakedefine BFIN_ASM -#cmakedefine TI_C55X -#cmakedefine DISABLE_VBR -#cmakedefine USE_SPEEXDSP -#cmakedefine VORBIS_PSYCHO -#cmakedefine HAVE_GETOPT_H -#cmakedefine HAVE_GETOPT_LONG -#cmakedefine VAR_ARRAYS -#cmakedefine USE_ALLOCA -#cmakedefine HAVE_ALLOCA_H -#cmakedefine USE_SMALLFT -#cmakedefine USE_KISS_FFT -#cmakedefine USE_GPL_FFTW3 - -#define EXPORT @EXPORT@ diff --git a/Engine/lib/speex/configure.ac b/Engine/lib/speex/configure.ac deleted file mode 100644 index dc6dbbc89..000000000 --- a/Engine/lib/speex/configure.ac +++ /dev/null @@ -1,358 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -*-m4-*- - -AC_INIT([speex],[1.2.0],[speex-dev@xiph.org]) - -AC_CONFIG_SRCDIR([libspeex/speex.c]) -AC_CONFIG_MACRO_DIR([m4]) - -dnl enable silent rules on automake 1.11 and later -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - - -SPEEX_MAJOR_VERSION=1 -SPEEX_MINOR_VERSION=1 -SPEEX_MICRO_VERSION=16 -SPEEX_EXTRA_VERSION= - -SPEEX_LT_CURRENT=6 -SPEEX_LT_REVISION=1 -SPEEX_LT_AGE=5 - - -AC_SUBST(SPEEX_LT_CURRENT) -AC_SUBST(SPEEX_LT_REVISION) -AC_SUBST(SPEEX_LT_AGE) - -AM_INIT_AUTOMAKE([foreign no-define]) -AM_MAINTAINER_MODE([enable]) - -AC_CANONICAL_HOST -AC_LIBTOOL_WIN32_DLL -AM_PROG_LIBTOOL - -AC_C_BIGENDIAN -AC_C_CONST -AC_C_INLINE -AC_C_RESTRICT - - -AC_MSG_CHECKING(for C99 variable-size arrays) -AC_TRY_COMPILE( , [ -int foo; -foo = 10; -int array[foo]; -], -[has_var_arrays=yes;AC_DEFINE([VAR_ARRAYS], [], [Use C99 variable-size arrays]) -], -has_var_arrays=no -) -AC_MSG_RESULT($has_var_arrays) - -AC_CHECK_HEADERS([alloca.h getopt.h]) -AC_MSG_CHECKING(for alloca) -AC_TRY_COMPILE( [ -#ifdef HAVE_ALLOCA_H -# include -#endif -#include -], [ -int foo=10; -int *array = alloca(foo); -], -[ -has_alloca=yes; -if test x$has_var_arrays = "xno" ; then -AC_DEFINE([USE_ALLOCA], [], [Make use of alloca]) -fi -], -has_alloca=no -) -AC_MSG_RESULT($has_alloca) - -AC_MSG_CHECKING(for SSE in current arch/CFLAGS) -AC_LINK_IFELSE([ -AC_LANG_PROGRAM([[ -#include -__m128 testfunc(float *a, float *b) { - return _mm_add_ps(_mm_loadu_ps(a), _mm_loadu_ps(b)); -} -]])], -[ -has_sse=yes -], -[ -has_sse=no -] -) -AC_MSG_RESULT($has_sse) - -SAVE_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -fvisibility=hidden" -AC_MSG_CHECKING(for ELF visibility) -AC_COMPILE_IFELSE([ -AC_LANG_PROGRAM([[ -#pragma GCC visibility push(hidden) -__attribute__((visibility("default"))) -int var=10; -]])], -[ -has_visibility=yes -AC_DEFINE([EXPORT], [__attribute__((visibility("default")))], [Symbol visibility prefix]) -], -[ -has_visibility=no -AC_DEFINE([EXPORT], [], [Symbol visibility prefix]) -CFLAGS="$SAVE_CFLAGS" -] -) -AC_MSG_RESULT($has_visibility) - -AC_CHECK_HEADERS(sys/soundcard.h sys/audioio.h) - -LT_LIB_M - -# Check for getopt_long; if not found, use included source. -AC_CHECK_FUNCS([getopt_long],, -[# FreeBSD has a gnugetopt library. - AC_CHECK_LIB([gnugetopt],[getopt_long], -[AC_DEFINE([HAVE_GETOPT_LONG])], -[# Use the GNU replacement. -AC_LIBOBJ(getopt) -AC_LIBOBJ(getopt1)])]) - -SPEEX_VERSION=$PACKAGE_VERSION - -AC_SUBST(SPEEX_VERSION) - -AC_DEFINE_UNQUOTED(SPEEX_VERSION, "${PACKAGE_VERSION}", [Complete version string]) -AC_DEFINE_UNQUOTED(SPEEX_MAJOR_VERSION, ${SPEEX_MAJOR_VERSION}, [Version major]) -AC_DEFINE_UNQUOTED(SPEEX_MINOR_VERSION, ${SPEEX_MINOR_VERSION}, [Version minor]) -AC_DEFINE_UNQUOTED(SPEEX_MICRO_VERSION, ${SPEEX_MICRO_VERSION}, [Version micro]) -AC_DEFINE_UNQUOTED(SPEEX_EXTRA_VERSION, "${SPEEX_EXTRA_VERSION}", [Version extra]) - -AC_ARG_ENABLE(valgrind, [ --enable-valgrind Enable valgrind extra checks], -[if test "$enableval" = yes; then - AC_DEFINE([ENABLE_VALGRIND], , [Enable valgrind extra checks]) -fi]) - -AC_ARG_ENABLE(sse, [ --enable-sse Enable SSE support], [ -if test "x$enableval" != xno; then -has_sse=yes -CFLAGS="$CFLAGS -O3 -msse" -else -has_sse=no -fi -]) - - -FFT=smallft - -AC_ARG_ENABLE(fixed-point, [ --enable-fixed-point Compile as fixed-point], -[if test "$enableval" = yes; then - FFT=kiss - has_sse=no - AC_DEFINE([FIXED_POINT], , [Compile as fixed-point]) -else - AC_DEFINE([FLOATING_POINT], , [Compile as floating-point]) -fi], -AC_DEFINE([FLOATING_POINT], , [Compile as floating-point])) - -if test "$has_sse" = yes; then - AC_DEFINE([_USE_SSE], , [Enable SSE support]) -fi - -AC_ARG_ENABLE(float-api, [ --disable-float-api Disable the floating-point API], -[if test "$enableval" = no; then - AC_DEFINE([DISABLE_FLOAT_API], , [Disable all parts of the API that are using floats]) -fi]) - -AC_ARG_ENABLE(binaries, [ --disable-binaries Do not build the encoder and decoder programs, only the library]) -if test "$enableval" != no; then - PKG_CHECK_MODULES([OGG], [ogg], - AM_CONDITIONAL([BUILD_BINARIES], true), - AM_CONDITIONAL([BUILD_BINARIES], false)) -else - AM_CONDITIONAL([BUILD_BINARIES], false) -fi - -AC_ARG_ENABLE(vbr, [ --disable-vbr Disable VBR and VAD from the codec], -[if test "$enableval" = no; then - AC_DEFINE([DISABLE_VBR], , [Disable VBR and VAD from the codec]) -fi]) - -AC_ARG_ENABLE(arm4-asm, [ --enable-arm4-asm Make use of ARM4 assembly optimizations], -[if test "$enableval" = yes; then - AC_DEFINE([ARM4_ASM], , [Make use of ARM4 assembly optimizations]) -fi]) - -AC_ARG_ENABLE(arm5e-asm, [ --enable-arm5e-asm Make use of ARM5E assembly optimizations], -[if test "$enableval" = yes; then - AC_DEFINE([ARM5E_ASM], , [Make use of ARM5E assembly optimizations]) -fi]) - -AC_ARG_ENABLE(blackfin-asm, [ --enable-blackfin-asm Make use of Blackfin assembly optimizations], -[if test "$enableval" = yes; then - AC_DEFINE([BFIN_ASM], , [Make use of Blackfin assembly optimizations]) -fi]) -WINMM_LIBS="" -case $host_os in - uclinux) LDFLAGS="-Wl,-elf2flt=-s100000 $LDFLAGS";; - *mingw*) WINMM_LIBS="-lwinmm";; -esac -AC_SUBST(WINMM_LIBS) - -AC_ARG_ENABLE(fixed-point-debug, [ --enable-fixed-point-debug Debug fixed-point implementation], -[if test "$enableval" = yes; then - AC_DEFINE([FIXED_DEBUG], , [Debug fixed-point implementation]) -fi]) - -AC_ARG_ENABLE(ti-c55x, [ --enable-ti-c55x Enable support for TI C55X DSP], -[if test "$enableval" = yes; then - has_char16=yes; - AC_DEFINE([TI_C55X], , [Enable support for TI C55X DSP]) -fi]) - -AC_ARG_ENABLE(vorbis-psy, [ --enable-vorbis-psy Enable the Vorbis psy model], -[if test "$enableval" = yes; then - vorbis_psy=yes; - AC_DEFINE([VORBIS_PSYCHO], , [Enable support for the Vorbis psy model]) -fi]) - -AC_ARG_WITH([fft], [AS_HELP_STRING([--with-fft=choice],[use an alternate FFT implementation. The available choices are -kiss (default fixed point), smallft (default floating point), gpl-fftw3 and proprietary-intel-mkl])], -[FFT=$withval] -) - -FFT_PKGCONFIG= -AS_CASE([$FFT], - [kiss], [ - AC_DEFINE([USE_KISS_FFT], [], [Use KISS Fast Fourier Transform]) - ], - [smallft], [ - AC_DEFINE([USE_SMALLFT], [], [Use FFT from OggVorbis]) - ], - [gpl-fftw3], [ - AC_DEFINE([USE_GPL_FFTW3], [], [Use FFTW3 for FFT]) - PKG_CHECK_MODULES([FFT], [fftw3f]) - ], - [proprietary-intel-mkl], [ - AC_DEFINE([USE_INTEL_MKL], [], [Use Intel Math Kernel Library for FFT]) - AC_MSG_CHECKING(for valid MKL) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ -#include -void func() { - DFTI_DESCRIPTOR_HANDLE h; - MKL_LONG result=DftiCreateDescriptor(&h, DFTI_SINGLE, DFTI_REAL, 0); -}]])], - [AC_MSG_RESULT(yes)], - [AC_MSG_FAILURE([Failed to compile MKL test program. Make sure you set CFLAGS to include the include directory and set LDFLAGS to include the library directory and all necesarry libraries.])] - ) - ], - [AC_MSG_FAILURE([Unknown FFT $FFT specified for --with-fft])] -) -AM_CONDITIONAL(BUILD_KISS_FFT, [test "$FFT" = "kiss"]) -AM_CONDITIONAL(BUILD_SMALLFT, [test "$FFT" = "smallft"]) -AC_SUBST(FFT_PKGCONFIG) - -AM_CONDITIONAL(BUILD_VORBIS_PSY, [test "x$vorbis_psy" = "xyes"]) - -PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [AC_DEFINE([USE_SPEEXDSP], [], [Use SpeexDSP library])], [speexdsp_failed=yes]) - - -AC_CHECK_SIZEOF([int16_t]) -AC_CHECK_SIZEOF([uint16_t]) -AC_CHECK_SIZEOF([u_int16_t]) -AC_CHECK_SIZEOF([int32_t]) -AC_CHECK_SIZEOF([uint32_t]) -AC_CHECK_SIZEOF([u_int32_t]) -AC_CHECK_SIZEOF([short]) -AC_CHECK_SIZEOF([int]) -AC_CHECK_SIZEOF([long]) - -AS_IF([test "$has_char16" = "yes"], - [ - SIZEOF16=1 - SIZEOF32=2 - ],[ - SIZEOF16=2 - SIZEOF32=4 - ]) - -case $SIZEOF16 in - $ac_cv_sizeof_int16_t) SIZE16="int16_t";; - $ac_cv_sizeof_short) SIZE16="short";; - $ac_cv_sizeof_int) SIZE16="int";; -esac - -case $SIZEOF16 in - $ac_cv_sizeof_uint16_t) USIZE16="uint16_t";; - $ac_cv_sizeof_u_int16_t) USIZE16="u_int16_t";; - $ac_cv_sizeof_short) USIZE16="unsigned short";; - $ac_cv_sizeof_int) USIZE16="unsigned int";; -esac - -case $SIZEOF32 in - $ac_cv_sizeof_int32_t) SIZE32="int32_t";; - $ac_cv_sizeof_int) SIZE32="int";; - $ac_cv_sizeof_long) SIZE32="long";; - $ac_cv_sizeof_short) SIZE32="short";; -esac - -case $SIZEOF32 in - $ac_cv_sizeof_uint32_t) USIZE32="uint32_t";; - $ac_cv_sizeof_u_int32_t) USIZE32="u_int32_t";; - $ac_cv_sizeof_short) USIZE32="unsigned short";; - $ac_cv_sizeof_int) USIZE32="unsigned int";; - $ac_cv_sizeof_long) USIZE32="unsigned long";; -esac - -XIPH_ADD_CFLAGS([-Wall]) - -AS_IF([test -z "$SIZE16"],[AC_MSG_ERROR([No 16 bit type found on this platform!])]) -AS_IF([test -z "$SIZE32"],[AC_MSG_ERROR([No 32 bit type found on this platform!])]) -AS_IF([test -z "$USIZE16"],[AC_MSG_ERROR([No unsigned 16 bit type found on this platform!])]) -AS_IF([test -z "$USIZE32"],[AC_MSG_ERROR([No unsigned 32 bit type found on this platform!])]) - -AC_SUBST([SIZE16]) -AC_SUBST([USIZE16]) -AC_SUBST([SIZE32]) -AC_SUBST([USIZE32]) - -AS_IF([test "$ac_cv_header_stdint_h" = "yes"], [INCLUDE_STDINT="#include "], - [test "$ac_cv_header_inttypes_h" = "yes"], [INCLUDE_STDINT="#include "], - [test "$ac_cv_header_sys_types_h" = "yes"], [INCLUDE_STDINT="#include "]) - -AC_SUBST([INCLUDE_STDINT]) - - -AC_CONFIG_FILES([ - Makefile libspeex/Makefile src/Makefile doc/Makefile Speex.spec - include/Makefile include/speex/Makefile speex.pc - win32/Makefile win32/libspeex/Makefile win32/speexenc/Makefile - win32/speexdec/Makefile symbian/Makefile - win32/VS2003/Makefile - win32/VS2003/tests/Makefile - win32/VS2003/libspeex/Makefile - win32/VS2003/speexdec/Makefile - win32/VS2003/speexenc/Makefile - win32/VS2005/Makefile - win32/VS2005/libspeex/Makefile - win32/VS2005/speexdec/Makefile - win32/VS2005/speexenc/Makefile - win32/VS2005/tests/Makefile - win32/VS2008/Makefile - win32/VS2008/speexdec/Makefile - win32/VS2008/tests/Makefile - win32/VS2008/libspeex/Makefile - win32/VS2008/speexenc/Makefile - include/speex/speex_config_types.h ti/Makefile - ti/speex_C54_test/Makefile ti/speex_C55_test/Makefile - ti/speex_C64_test/Makefile -]) - -AC_CONFIG_HEADERS([config.h]) - -AC_OUTPUT - -echo "Type \"make; make install\" to compile and install Speex"; diff --git a/Engine/lib/speex/doc/.cvsignore b/Engine/lib/speex/doc/.cvsignore deleted file mode 100644 index 282522db0..000000000 --- a/Engine/lib/speex/doc/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/Engine/lib/speex/doc/Makefile.am b/Engine/lib/speex/doc/Makefile.am deleted file mode 100644 index d2896efab..000000000 --- a/Engine/lib/speex/doc/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -doc_DATA = manual.pdf - -EXTRA_DIST = $(doc_DATA) diff --git a/Engine/lib/speex/doc/celp_decoder.eps b/Engine/lib/speex/doc/celp_decoder.eps deleted file mode 100644 index 87f070446..000000000 --- a/Engine/lib/speex/doc/celp_decoder.eps +++ /dev/null @@ -1,688 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%BoundingBox: 0 0 442 315 -%%Pages: 0 -%%Creator: Sun Microsystems, Inc. -%%Title: none -%%CreationDate: none -%%LanguageLevel: 2 -%%EndComments -%%BeginProlog -%%BeginResource: SDRes -/b4_inc_state save def -/dict_count countdictstack def -/op_count count 1 sub def -userdict begin -0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit[] 0 setdash newpath -/languagelevel where {pop languagelevel 1 ne {false setstrokeadjust false setoverprint} if} if -/bdef {bind def} bind def -/c {setgray} bdef -/l {neg lineto} bdef -/rl {neg rlineto} bdef -/lc {setlinecap} bdef -/lj {setlinejoin} bdef -/lw {setlinewidth} bdef -/ml {setmiterlimit} bdef -/ld {setdash} bdef -/m {neg moveto} bdef -/ct {6 2 roll neg 6 2 roll neg 6 2 roll neg curveto} bdef -/r {rotate} bdef -/t {neg translate} bdef -/s {scale} bdef -/sw {show} bdef -/gs {gsave} bdef -/gr {grestore} bdef -/f {findfont dup length dict begin -{1 index /FID ne {def} {pop pop} ifelse} forall /Encoding ISOLatin1Encoding def -currentdict end /NFont exch definefont pop /NFont findfont} bdef -/p {closepath} bdef -/sf {scalefont setfont} bdef -/ef {eofill}bdef -/pc {closepath stroke}bdef -/ps {stroke}bdef -/pum {matrix currentmatrix}bdef -/pom {setmatrix}bdef -/bs {/aString exch def /nXOfs exch def /nWidth exch def currentpoint nXOfs 0 rmoveto pum nWidth aString stringwidth pop div 1 scale aString show pom moveto} bdef -%%EndResource -%%EndProlog -%%BeginSetup -%%EndSetup -%%Page: 1 1 -%%BeginPageSetup -%%EndPageSetup -pum -0.02836 0.02834 s -0 -11113 t -/tm matrix currentmatrix def -tm setmatrix --5152 -9418 t -1 1 s -0 lw 1 lj 0.000 c 6935 14318 m 5435 14318 l 5435 10318 l 8435 10318 l -8435 14318 l 6935 14318 l pc -11436 12317 m 10934 12818 l 10936 11817 l 11436 12317 l pc -5831 11966 m 8109 11966 l ps -6425 11966 m 6425 11636 l ps -6123 11966 m 6123 12366 l ps -6727 11966 m 6727 11707 l ps -7719 11966 m 7719 11872 l ps -7070 11966 m 7070 12248 l ps -7439 11966 m 7439 11636 l ps -5830 10920 m 8108 10920 l ps -6163 10920 m 6163 10590 l ps -6470 10920 m 6470 11320 l ps -6726 10920 m 6726 10661 l ps -7109 10920 m 7109 10826 l ps -7417 10920 m 7417 11202 l ps -7699 10920 m 7699 10590 l ps -5831 10921 m 8109 10921 l ps -6164 10921 m 6164 10591 l ps -6471 10921 m 6471 11321 l ps -6727 10921 m 6727 10662 l ps -7110 10921 m 7110 10827 l ps -7418 10921 m 7418 11203 l ps -7700 10921 m 7700 10591 l ps -5857 12918 m 8135 12918 l ps -6190 12918 m 6188 12729 l ps -6497 12918 m 6497 13318 l ps -6753 12918 m 6751 13247 l ps -7136 12918 m 7136 12824 l ps -7444 12918 m 7442 12611 l ps -7796 12919 m 7794 13248 l ps -6935 17818 m 5435 17818 l 5435 15818 l 8435 15818 l 8435 17818 l 6935 17818 l -pc -gs -pum -6263 17039 t -219 -104 m 214 -66 184 -39 147 -39 ct 120 -39 99 -51 85 -74 ct 74 -92 71 -110 69 -147 ct -268 -147 l 266 -213 260 -244 245 -277 ct 224 -321 193 -341 149 -341 ct 71 -341 20 -271 20 -160 ct -20 -55 68 9 146 9 ct 208 9 252 -32 264 -104 ct 219 -104 l p -69 -192 m 72 -252 104 -292 147 -292 ct 171 -292 191 -280 203 -260 ct 214 -243 218 -226 220 -192 ct -69 -192 l p ef -362 -412 m 418 -412 l 418 -458 l 321 -458 l 321 124 l 418 124 l 418 78 l -362 78 l 362 -412 l p ef -508 -332 m 465 -332 l 465 0 l 511 0 l 511 -180 l 511 -250 539 -292 586 -292 ct -625 -292 642 -265 642 -204 ct 642 0 l 687 0 l 687 -226 l 687 -299 653 -341 595 -341 ct -558 -341 532 -324 508 -283 ct 508 -332 l p ef -870 -204 m 742 -204 l 742 -147 l 870 -147 l 870 -204 l p ef -899 -400 m 1026 -400 l 1026 0 l 1077 0 l 1077 -400 l 1204 -400 l -1204 -455 l 899 -455 l 899 -400 l p ef -1281 78 m 1225 78 l 1225 124 l 1322 124 l 1322 -458 l 1225 -458 l -1225 -412 l 1281 -412 l 1281 78 l p ef -pom -gr -10410 12492 m 10410 12142 l 10935 12317 l 10410 12492 l p ef -1 lw 0 lj 8435 12318 m 9685 12318 l 9685 12317 l 10515 12317 l ps -0 lw 1 lj 11434 16817 m 10932 17318 l 10934 16317 l 11434 16817 l pc -10483 16967 m 10483 16667 l 10933 16817 l 10483 16967 l p ef -1 lw 0 lj 8435 16818 m 9684 16818 l 9684 16817 l 10573 16817 l ps -0 lw 1 lj 13085 14818 m 12947 14818 12835 14706 12835 14568 ct 12835 14430 12947 14318 13085 14318 ct -13223 14318 13335 14430 13335 14568 ct 13335 14706 13223 14818 13085 14818 ct -pc -gs -pum -12931 14791 t -133 -183 m 20 -183 l 20 -137 l 133 -137 l 133 0 l 171 0 l 171 -137 l -283 -137 l 283 -183 l 171 -183 l 171 -320 l 133 -320 l 133 -183 l -p ef -pom -gr -13234 15268 m 12934 15268 l 13084 14818 l 13234 15268 l p ef -1 lw 0 lj 11435 16817 m 13084 16817 l 13084 15178 l ps -12934 13868 m 13234 13868 l 13084 14318 l 12934 13868 l p ef -11437 12317 m 13084 12317 l 13084 13958 l ps -0 lw 1 lj 17835 15318 m 16335 15318 l 16335 13818 l 19335 13818 l 19335 15318 l -17835 15318 l pc -16668 15023 m 16778 14801 16891 14569 16925 14316 ct 16997 13766 17307 14273 17221 14551 ct -17165 14731 17523 15058 17694 14622 ct 17856 14213 18050 14912 18286 15000 ct -18489 15075 18680 14999 18878 15000 ct 18878 15000 18878 15000 19076 15047 ct -19076 15047 19076 15047 19135 15118 ct ps -15885 14718 m 15885 14418 l 16335 14568 l 15885 14718 l p ef -1 lw 0 lj 13335 14567 m 14935 14567 l 14935 14568 l 15975 14568 l ps -gs -pum -17085 13052 t -208 -214 m 206 -241 203 -254 195 -269 ct 180 -296 151 -311 114 -311 ct 84 -311 61 -302 46 -283 ct -33 -266 25 -243 25 -219 ct 25 -180 43 -156 78 -146 ct 129 -131 l 170 -120 182 -108 182 -79 ct -182 -46 158 -27 118 -27 ct 90 -27 69 -37 58 -56 ct 51 -68 49 -78 48 -98 ct 16 -98 l -17 -65 22 -48 35 -30 ct 54 -3 78 8 116 8 ct 177 8 214 -26 214 -83 ct 214 -126 195 -154 158 -164 ct -87 -184 l 67 -190 57 -202 57 -224 ct 57 -257 78 -276 114 -276 ct 137 -276 156 -267 166 -250 ct -172 -240 175 -231 176 -214 ct 208 -214 l p ef -319 -39 m 271 -221 l 236 -221 l 304 5 l 300 16 297 25 296 28 ct 289 51 284 57 271 57 ct -265 57 259 55 253 53 ct 253 87 l 255 87 l 261 90 263 90 268 90 ct 304 90 309 83 337 -4 ct -402 -221 l 368 -221 l 319 -39 l p ef -457 -221 m 428 -221 l 428 0 l 458 0 l 458 -120 l 458 -166 477 -194 508 -194 ct -534 -194 546 -176 546 -136 ct 546 0 l 576 0 l 576 -150 l 576 -199 553 -227 515 -227 ct -490 -227 472 -216 457 -188 ct 457 -221 l p ef -690 -190 m 690 -221 l 660 -221 l 660 -282 l 630 -282 l 630 -221 l -605 -221 l 605 -190 l 630 -190 l 630 -44 l 630 -12 641 2 665 2 ct 667 2 669 2 676 1 ct -678 1 683 0 689 0 ct 689 -29 l 679 -29 l 665 -29 660 -34 660 -46 ct 660 -190 l -690 -190 l p ef -751 -303 m 721 -303 l 721 0 l 751 0 l 751 -120 l 751 -167 770 -194 803 -194 ct -828 -194 839 -179 839 -144 ct 839 0 l 869 0 l 869 -150 l 869 -199 846 -227 808 -227 ct -784 -227 769 -218 751 -190 ct 751 -303 l p ef -1038 -69 m 1035 -44 1015 -26 991 -26 ct 973 -26 958 -34 950 -49 ct 942 -61 940 -73 939 -98 ct -1071 -98 l 1070 -142 1066 -162 1056 -184 ct 1042 -214 1022 -227 992 -227 ct -940 -227 906 -180 906 -106 ct 906 -36 938 6 990 6 ct 1032 6 1061 -21 1069 -69 ct -1038 -69 l p -939 -128 m 941 -167 962 -194 991 -194 ct 1007 -194 1020 -186 1028 -173 ct 1035 -162 1038 -151 1040 -128 ct -939 -128 l p ef -1242 -158 m 1240 -202 1215 -227 1174 -227 ct 1132 -227 1104 -200 1104 -157 ct -1104 -129 1118 -111 1146 -103 ct 1182 -92 l 1210 -84 1218 -77 1218 -60 ct 1218 -39 1202 -26 1175 -26 ct -1144 -26 1130 -39 1128 -71 ct 1099 -71 l 1100 -49 1102 -38 1108 -27 ct 1120 -5 1143 6 1173 6 ct -1219 6 1248 -22 1248 -66 ct 1248 -97 1234 -113 1197 -125 ct 1167 -134 l 1140 -142 1134 -148 1134 -163 ct -1134 -183 1148 -195 1172 -195 ct 1198 -195 1211 -183 1213 -158 ct 1242 -158 l -p ef -1315 -221 m 1285 -221 l 1285 0 l 1315 0 l 1315 -221 l p -1315 -261 m 1315 -303 l 1285 -303 l 1285 -261 l 1315 -261 l p ef -1492 -158 m 1490 -202 1465 -227 1424 -227 ct 1382 -227 1354 -200 1354 -157 ct -1354 -129 1368 -111 1396 -103 ct 1432 -92 l 1460 -84 1468 -77 1468 -60 ct 1468 -39 1452 -26 1425 -26 ct -1394 -26 1380 -39 1378 -71 ct 1349 -71 l 1350 -49 1352 -38 1358 -27 ct 1370 -5 1393 6 1423 6 ct -1469 6 1498 -22 1498 -66 ct 1498 -97 1484 -113 1447 -125 ct 1417 -134 l 1390 -142 1384 -148 1384 -163 ct -1384 -183 1398 -195 1422 -195 ct 1448 -195 1461 -183 1463 -158 ct 1492 -158 l -p ef -pom -pum -17085 13581 t -90 -190 m 90 -221 l 60 -221 l 60 -248 l 60 -266 65 -274 78 -274 ct 81 -274 85 -274 90 -273 ct -90 -307 l 81 -307 79 -307 76 -307 ct 46 -307 30 -291 30 -259 ct 30 -221 l 4 -221 l -4 -190 l 30 -190 l 30 0 l 60 0 l 60 -190 l 90 -190 l p ef -150 -221 m 120 -221 l 120 0 l 150 0 l 150 -221 l p -150 -261 m 150 -303 l 120 -303 l 120 -261 l 150 -261 l p ef -227 -303 m 197 -303 l 197 0 l 227 0 l 227 -303 l p ef -339 -190 m 339 -221 l 309 -221 l 309 -282 l 279 -282 l 279 -221 l -254 -221 l 254 -190 l 279 -190 l 279 -44 l 279 -12 290 2 314 2 ct 316 2 318 2 325 1 ct -327 1 332 0 338 0 ct 338 -29 l 328 -29 l 314 -29 309 -34 309 -46 ct 309 -190 l -339 -190 l p ef -492 -69 m 489 -44 469 -26 445 -26 ct 427 -26 412 -34 404 -49 ct 396 -61 394 -73 393 -98 ct -525 -98 l 524 -142 520 -162 510 -184 ct 496 -214 476 -227 446 -227 ct 394 -227 360 -180 360 -106 ct -360 -36 392 6 444 6 ct 486 6 515 -21 523 -69 ct 492 -69 l p -393 -128 m 395 -167 416 -194 445 -194 ct 461 -194 474 -186 482 -173 ct 489 -162 492 -151 494 -128 ct -393 -128 l p ef -657 -188 m 657 -226 l 654 -227 651 -227 649 -227 ct 627 -227 613 -215 597 -183 ct -597 -221 l 568 -221 l 568 0 l 599 0 l 599 -129 l 599 -163 618 -188 645 -188 ct -657 -188 l p ef -878 -297 m 854 -297 l 844 -253 834 -244 789 -240 ct 789 -211 l 845 -211 l -845 0 l 878 0 l 878 -297 l p ef -1050 -311 m 1027 -311 l 943 8 l 965 8 l 1050 -311 l p ef -1211 -88 m 1235 0 l 1272 0 l 1182 -303 l 1144 -303 l 1050 0 l 1085 0 l -1111 -88 l 1211 -88 l p -1121 -125 m 1161 -259 l 1199 -125 l 1121 -125 l p ef -1360 -310 m 1316 -231 1301 -179 1301 -110 ct 1301 -42 1314 1 1361 87 ct 1381 87 l -1343 -5 1334 -42 1334 -107 ct 1334 -182 1344 -225 1381 -310 ct 1360 -310 l p ef -1552 -190 m 1552 -221 l 1412 -221 l 1412 -190 l 1513 -190 l 1403 -29 l -1403 0 l 1555 0 l 1555 -30 l 1444 -30 l 1552 -190 l p ef -1599 87 m 1642 8 1657 -43 1657 -111 ct 1657 -179 1644 -223 1598 -310 ct 1577 -310 l -1616 -217 1625 -179 1625 -115 ct 1625 -40 1615 2 1578 87 ct 1599 87 l p ef -pom -gr -gs -pum -5708 9956 t -63 -137 m 185 -137 l 185 -174 l 63 -174 l 63 -266 l 202 -266 l 202 -303 l -30 -303 l 30 0 l 63 0 l 63 -137 l p ef -265 -221 m 235 -221 l 235 0 l 265 0 l 265 -221 l p -265 -261 m 265 -303 l 235 -303 l 235 -261 l 265 -261 l p ef -394 -113 m 455 -221 l 418 -221 l 375 -143 l 334 -221 l 294 -221 l -355 -113 l 291 0 l 330 0 l 373 -83 l 419 0 l 458 0 l 394 -113 l -p ef -606 -69 m 603 -44 583 -26 559 -26 ct 541 -26 526 -34 518 -49 ct 510 -61 508 -73 507 -98 ct -639 -98 l 638 -142 634 -162 624 -184 ct 610 -214 590 -227 560 -227 ct 508 -227 474 -180 474 -106 ct -474 -36 506 6 558 6 ct 600 6 629 -21 637 -69 ct 606 -69 l p -507 -128 m 509 -167 530 -194 559 -194 ct 575 -194 588 -186 596 -173 ct 603 -162 606 -151 608 -128 ct -507 -128 l p ef -829 -303 m 798 -303 l 798 -187 l 784 -216 768 -227 743 -227 ct 698 -227 668 -182 668 -115 ct -668 -41 699 6 747 6 ct 772 6 787 -4 800 -31 ct 800 0 l 829 0 l 829 -303 l -p -749 -194 m 780 -194 798 -162 798 -104 ct 798 -76 793 -57 782 -43 ct 773 -32 761 -26 748 -26 ct -717 -26 699 -58 699 -113 ct 699 -167 716 -194 749 -194 ct p ef -1113 -146 m 1107 -200 1085 -227 1044 -227 ct 991 -227 958 -180 958 -106 ct -958 -37 990 6 1039 6 ct 1081 6 1106 -22 1113 -78 ct 1083 -78 l 1077 -43 1062 -26 1039 -26 ct -1008 -26 991 -56 991 -109 ct 991 -163 1009 -194 1041 -194 ct 1065 -194 1078 -180 1083 -146 ct -1113 -146 l p ef -1219 -227 m 1168 -227 1134 -180 1134 -110 ct 1134 -41 1168 5 1218 5 ct 1268 5 1302 -41 1302 -110 ct -1302 -178 1268 -227 1219 -227 ct p -1219 -195 m 1250 -195 1270 -161 1270 -110 ct 1270 -59 1250 -26 1218 -26 ct -1186 -26 1165 -59 1165 -110 ct 1165 -162 1186 -195 1219 -195 ct p ef -1490 -303 m 1459 -303 l 1459 -187 l 1445 -216 1429 -227 1404 -227 ct 1359 -227 1329 -182 1329 -115 ct -1329 -41 1360 6 1408 6 ct 1433 6 1448 -4 1461 -31 ct 1461 0 l 1490 0 l 1490 -303 l -p -1410 -194 m 1441 -194 1459 -162 1459 -104 ct 1459 -76 1454 -57 1443 -43 ct -1434 -32 1422 -26 1409 -26 ct 1378 -26 1360 -58 1360 -113 ct 1360 -167 1377 -194 1410 -194 ct -p ef -1656 -69 m 1653 -44 1633 -26 1609 -26 ct 1591 -26 1576 -34 1568 -49 ct 1560 -61 1558 -73 1557 -98 ct -1689 -98 l 1688 -142 1684 -162 1674 -184 ct 1660 -214 1640 -227 1610 -227 ct -1558 -227 1524 -180 1524 -106 ct 1524 -36 1556 6 1608 6 ct 1650 6 1679 -21 1687 -69 ct -1656 -69 l p -1557 -128 m 1559 -167 1580 -194 1609 -194 ct 1625 -194 1638 -186 1646 -173 ct -1653 -162 1656 -151 1658 -128 ct 1557 -128 l p ef -1755 0 m 1755 -28 l 1768 -3 1782 6 1806 6 ct 1854 6 1885 -41 1885 -115 ct -1885 -182 1855 -227 1810 -227 ct 1788 -227 1772 -217 1756 -192 ct 1756 -303 l -1726 -303 l 1726 0 l 1755 0 l p -1805 -194 m 1837 -194 1853 -167 1853 -113 ct 1853 -58 1835 -26 1804 -26 ct -1792 -26 1780 -32 1771 -43 ct 1760 -57 1755 -76 1755 -105 ct 1755 -163 1772 -194 1805 -194 ct -p ef -1998 -227 m 1947 -227 1913 -180 1913 -110 ct 1913 -41 1947 5 1997 5 ct 2047 5 2081 -41 2081 -110 ct -2081 -178 2047 -227 1998 -227 ct p -1998 -195 m 2029 -195 2049 -161 2049 -110 ct 2049 -59 2029 -26 1997 -26 ct -1965 -26 1944 -59 1944 -110 ct 1944 -162 1965 -195 1998 -195 ct p ef -2193 -227 m 2142 -227 2108 -180 2108 -110 ct 2108 -41 2142 5 2192 5 ct 2242 5 2276 -41 2276 -110 ct -2276 -178 2242 -227 2193 -227 ct p -2193 -195 m 2224 -195 2244 -161 2244 -110 ct 2244 -59 2224 -26 2192 -26 ct -2160 -26 2139 -59 2139 -110 ct 2139 -162 2160 -195 2193 -195 ct p ef -2390 -138 m 2459 -221 l 2421 -221 l 2342 -127 l 2342 -303 l 2313 -303 l -2313 0 l 2342 0 l 2342 -83 l 2368 -111 l 2424 0 l 2463 0 l 2390 -138 l -p ef -pom -gr -gs -pum -5390 15539 t -165 -88 m 189 0 l 226 0 l 136 -303 l 98 -303 l 4 0 l 39 0 l 65 -88 l -165 -88 l p -75 -125 m 115 -259 l 153 -125 l 75 -125 l p ef -406 -303 m 375 -303 l 375 -187 l 361 -216 345 -227 320 -227 ct 275 -227 245 -182 245 -115 ct -245 -41 276 6 324 6 ct 349 6 364 -4 377 -31 ct 377 0 l 406 0 l 406 -303 l -p -326 -194 m 357 -194 375 -162 375 -104 ct 375 -76 370 -57 359 -43 ct 350 -32 338 -26 325 -26 ct -294 -26 276 -58 276 -113 ct 276 -167 293 -194 326 -194 ct p ef -477 -153 m 481 -184 493 -196 520 -196 ct 547 -196 562 -184 562 -159 ct 562 -143 557 -136 546 -134 ct -495 -126 l 460 -121 440 -96 440 -58 ct 440 -19 463 6 498 6 ct 524 6 543 -4 562 -29 ct -565 -5 573 4 594 4 ct 598 4 602 3 608 1 ct 610 0 610 0 612 0 ct 612 -27 l 605 -25 603 -25 601 -25 ct -595 -25 591 -30 591 -38 ct 591 -165 l 591 -204 565 -227 522 -227 ct 493 -227 472 -217 460 -198 ct -453 -186 450 -175 449 -153 ct 477 -153 l p -561 -76 m 561 -48 535 -24 504 -24 ct 484 -24 472 -38 472 -61 ct 472 -83 483 -94 511 -98 ct -546 -104 554 -107 561 -112 ct 561 -76 l p ef -642 87 m 672 87 l 672 -24 l 685 -2 699 6 722 6 ct 770 6 801 -42 801 -115 ct -801 -182 771 -227 726 -227 ct 701 -227 687 -217 671 -188 ct 671 -221 l 642 -221 l -642 87 l p -721 -194 m 752 -194 769 -166 769 -114 ct 769 -58 751 -26 720 -26 ct 690 -26 671 -55 671 -103 ct -671 -163 688 -194 721 -194 ct p ef -906 -190 m 906 -221 l 876 -221 l 876 -282 l 846 -282 l 846 -221 l -821 -221 l 821 -190 l 846 -190 l 846 -44 l 846 -12 857 2 881 2 ct 883 2 885 2 892 1 ct -894 1 899 0 905 0 ct 905 -29 l 895 -29 l 881 -29 876 -34 876 -46 ct 876 -190 l -906 -190 l p ef -967 -221 m 937 -221 l 937 0 l 967 0 l 967 -221 l p -967 -261 m 967 -303 l 937 -303 l 937 -261 l 967 -261 l p ef -1076 -39 m 1029 -221 l 993 -221 l 1059 0 l 1092 0 l 1161 -221 l 1128 -221 l -1076 -39 l p ef -1309 -69 m 1306 -44 1286 -26 1262 -26 ct 1244 -26 1229 -34 1221 -49 ct 1213 -61 1211 -73 1210 -98 ct -1342 -98 l 1341 -142 1337 -162 1327 -184 ct 1313 -214 1293 -227 1263 -227 ct -1211 -227 1177 -180 1177 -106 ct 1177 -36 1209 6 1261 6 ct 1303 6 1332 -21 1340 -69 ct -1309 -69 l p -1210 -128 m 1212 -167 1233 -194 1262 -194 ct 1278 -194 1291 -186 1299 -173 ct -1306 -162 1309 -151 1311 -128 ct 1210 -128 l p ef -1621 -146 m 1615 -200 1593 -227 1552 -227 ct 1499 -227 1466 -180 1466 -106 ct -1466 -37 1498 6 1547 6 ct 1589 6 1614 -22 1621 -78 ct 1591 -78 l 1585 -43 1570 -26 1547 -26 ct -1516 -26 1499 -56 1499 -109 ct 1499 -163 1517 -194 1549 -194 ct 1573 -194 1586 -180 1591 -146 ct -1621 -146 l p ef -1727 -227 m 1676 -227 1642 -180 1642 -110 ct 1642 -41 1676 5 1726 5 ct 1776 5 1810 -41 1810 -110 ct -1810 -178 1776 -227 1727 -227 ct p -1727 -195 m 1758 -195 1778 -161 1778 -110 ct 1778 -59 1758 -26 1726 -26 ct -1694 -26 1673 -59 1673 -110 ct 1673 -162 1694 -195 1727 -195 ct p ef -1998 -303 m 1967 -303 l 1967 -187 l 1953 -216 1937 -227 1912 -227 ct 1867 -227 1837 -182 1837 -115 ct -1837 -41 1868 6 1916 6 ct 1941 6 1956 -4 1969 -31 ct 1969 0 l 1998 0 l 1998 -303 l -p -1918 -194 m 1949 -194 1967 -162 1967 -104 ct 1967 -76 1962 -57 1951 -43 ct -1942 -32 1930 -26 1917 -26 ct 1886 -26 1868 -58 1868 -113 ct 1868 -167 1885 -194 1918 -194 ct -p ef -2164 -69 m 2161 -44 2141 -26 2117 -26 ct 2099 -26 2084 -34 2076 -49 ct 2068 -61 2066 -73 2065 -98 ct -2197 -98 l 2196 -142 2192 -162 2182 -184 ct 2168 -214 2148 -227 2118 -227 ct -2066 -227 2032 -180 2032 -106 ct 2032 -36 2064 6 2116 6 ct 2158 6 2187 -21 2195 -69 ct -2164 -69 l p -2065 -128 m 2067 -167 2088 -194 2117 -194 ct 2133 -194 2146 -186 2154 -173 ct -2161 -162 2164 -151 2166 -128 ct 2065 -128 l p ef -2263 0 m 2263 -28 l 2276 -3 2290 6 2314 6 ct 2362 6 2393 -41 2393 -115 ct -2393 -182 2363 -227 2318 -227 ct 2296 -227 2280 -217 2264 -192 ct 2264 -303 l -2234 -303 l 2234 0 l 2263 0 l p -2313 -194 m 2345 -194 2361 -167 2361 -113 ct 2361 -58 2343 -26 2312 -26 ct -2300 -26 2288 -32 2279 -43 ct 2268 -57 2263 -76 2263 -105 ct 2263 -163 2280 -194 2313 -194 ct -p ef -2506 -227 m 2455 -227 2421 -180 2421 -110 ct 2421 -41 2455 5 2505 5 ct 2555 5 2589 -41 2589 -110 ct -2589 -178 2555 -227 2506 -227 ct p -2506 -195 m 2537 -195 2557 -161 2557 -110 ct 2557 -59 2537 -26 2505 -26 ct -2473 -26 2452 -59 2452 -110 ct 2452 -162 2473 -195 2506 -195 ct p ef -2701 -227 m 2650 -227 2616 -180 2616 -110 ct 2616 -41 2650 5 2700 5 ct 2750 5 2784 -41 2784 -110 ct -2784 -178 2750 -227 2701 -227 ct p -2701 -195 m 2732 -195 2752 -161 2752 -110 ct 2752 -59 2732 -26 2700 -26 ct -2668 -26 2647 -59 2647 -110 ct 2647 -162 2668 -195 2701 -195 ct p ef -2898 -138 m 2967 -221 l 2929 -221 l 2850 -127 l 2850 -303 l 2821 -303 l -2821 0 l 2850 0 l 2850 -83 l 2876 -111 l 2932 0 l 2971 0 l 2898 -138 l -p ef -pom -gr -gs -pum -14016 13846 t -213 -36 m 63 -36 l 63 -137 l 199 -137 l 199 -174 l 63 -174 l 63 -266 l -211 -266 l 211 -303 l 30 -303 l 30 0 l 213 0 l 213 -36 l p ef -339 -113 m 400 -221 l 363 -221 l 320 -143 l 279 -221 l 239 -221 l -300 -113 l 236 0 l 275 0 l 318 -83 l 364 0 l 403 0 l 339 -113 l -p ef -571 -146 m 565 -200 543 -227 502 -227 ct 449 -227 416 -180 416 -106 ct 416 -37 448 6 497 6 ct -539 6 564 -22 571 -78 ct 541 -78 l 535 -43 520 -26 497 -26 ct 466 -26 449 -56 449 -109 ct -449 -163 467 -194 499 -194 ct 523 -194 536 -180 541 -146 ct 571 -146 l p ef -633 -221 m 603 -221 l 603 0 l 633 0 l 633 -221 l p -633 -261 m 633 -303 l 603 -303 l 603 -261 l 633 -261 l p ef -745 -190 m 745 -221 l 715 -221 l 715 -282 l 685 -282 l 685 -221 l -660 -221 l 660 -190 l 685 -190 l 685 -44 l 685 -12 696 2 720 2 ct 722 2 724 2 731 1 ct -733 1 738 0 744 0 ct 744 -29 l 734 -29 l 720 -29 715 -34 715 -46 ct 715 -190 l -745 -190 l p ef -803 -153 m 807 -184 819 -196 846 -196 ct 873 -196 888 -184 888 -159 ct 888 -143 883 -136 872 -134 ct -821 -126 l 786 -121 766 -96 766 -58 ct 766 -19 789 6 824 6 ct 850 6 869 -4 888 -29 ct -891 -5 899 4 920 4 ct 924 4 928 3 934 1 ct 936 0 936 0 938 0 ct 938 -27 l 931 -25 929 -25 927 -25 ct -921 -25 917 -30 917 -38 ct 917 -165 l 917 -204 891 -227 848 -227 ct 819 -227 798 -217 786 -198 ct -779 -186 776 -175 775 -153 ct 803 -153 l p -887 -76 m 887 -48 861 -24 830 -24 ct 810 -24 798 -38 798 -61 ct 798 -83 809 -94 837 -98 ct -872 -104 880 -107 887 -112 ct 887 -76 l p ef -1037 -190 m 1037 -221 l 1007 -221 l 1007 -282 l 977 -282 l 977 -221 l -952 -221 l 952 -190 l 977 -190 l 977 -44 l 977 -12 988 2 1012 2 ct 1014 2 1016 2 1023 1 ct -1025 1 1030 0 1036 0 ct 1036 -29 l 1026 -29 l 1012 -29 1007 -34 1007 -46 ct -1007 -190 l 1037 -190 l p ef -1099 -221 m 1069 -221 l 1069 0 l 1099 0 l 1099 -221 l p -1099 -261 m 1099 -303 l 1069 -303 l 1069 -261 l 1099 -261 l p ef -1219 -227 m 1168 -227 1134 -180 1134 -110 ct 1134 -41 1168 5 1218 5 ct 1268 5 1302 -41 1302 -110 ct -1302 -178 1268 -227 1219 -227 ct p -1219 -195 m 1250 -195 1270 -161 1270 -110 ct 1270 -59 1250 -26 1218 -26 ct -1186 -26 1165 -59 1165 -110 ct 1165 -162 1186 -195 1219 -195 ct p ef -1368 -221 m 1339 -221 l 1339 0 l 1369 0 l 1369 -120 l 1369 -166 1388 -194 1419 -194 ct -1445 -194 1457 -176 1457 -136 ct 1457 0 l 1487 0 l 1487 -150 l 1487 -199 1464 -227 1426 -227 ct -1401 -227 1383 -216 1368 -188 ct 1368 -221 l p ef -pom -pum -14480 14375 t -145 -69 m 142 -44 122 -26 98 -26 ct 80 -26 65 -34 57 -49 ct 49 -61 47 -73 46 -98 ct -178 -98 l 177 -142 173 -162 163 -184 ct 149 -214 129 -227 99 -227 ct 47 -227 13 -180 13 -106 ct -13 -36 45 6 97 6 ct 139 6 168 -21 176 -69 ct 145 -69 l p -46 -128 m 48 -167 69 -194 98 -194 ct 114 -194 127 -186 135 -173 ct 142 -162 145 -151 147 -128 ct -46 -128 l p ef -244 -274 m 281 -274 l 281 -305 l 217 -305 l 217 82 l 281 82 l 281 52 l -244 52 l 244 -274 l p ef -343 -221 m 314 -221 l 314 0 l 344 0 l 344 -120 l 344 -166 363 -194 394 -194 ct -420 -194 432 -176 432 -136 ct 432 0 l 462 0 l 462 -150 l 462 -199 439 -227 401 -227 ct -376 -227 358 -216 343 -188 ct 343 -221 l p ef -533 52 m 496 52 l 496 82 l 561 82 l 561 -305 l 496 -305 l 496 -274 l -533 -274 l 533 52 l p ef -pom -gr -gs -pum -9491 13237 t -63 -137 m 185 -137 l 185 -174 l 63 -174 l 63 -266 l 202 -266 l 202 -303 l -30 -303 l 30 0 l 63 0 l 63 -137 l p ef -265 -221 m 235 -221 l 235 0 l 265 0 l 265 -221 l p -265 -261 m 265 -303 l 235 -303 l 235 -261 l 265 -261 l p ef -394 -113 m 455 -221 l 418 -221 l 375 -143 l 334 -221 l 294 -221 l -355 -113 l 291 0 l 330 0 l 373 -83 l 419 0 l 458 0 l 394 -113 l -p ef -606 -69 m 603 -44 583 -26 559 -26 ct 541 -26 526 -34 518 -49 ct 510 -61 508 -73 507 -98 ct -639 -98 l 638 -142 634 -162 624 -184 ct 610 -214 590 -227 560 -227 ct 508 -227 474 -180 474 -106 ct -474 -36 506 6 558 6 ct 600 6 629 -21 637 -69 ct 606 -69 l p -507 -128 m 509 -167 530 -194 559 -194 ct 575 -194 588 -186 596 -173 ct 603 -162 606 -151 608 -128 ct -507 -128 l p ef -829 -303 m 798 -303 l 798 -187 l 784 -216 768 -227 743 -227 ct 698 -227 668 -182 668 -115 ct -668 -41 699 6 747 6 ct 772 6 787 -4 800 -31 ct 800 0 l 829 0 l 829 -303 l -p -749 -194 m 780 -194 798 -162 798 -104 ct 798 -76 793 -57 782 -43 ct 773 -32 761 -26 748 -26 ct -717 -26 699 -58 699 -113 ct 699 -167 716 -194 749 -194 ct p ef -1113 -146 m 1107 -200 1085 -227 1044 -227 ct 991 -227 958 -180 958 -106 ct -958 -37 990 6 1039 6 ct 1081 6 1106 -22 1113 -78 ct 1083 -78 l 1077 -43 1062 -26 1039 -26 ct -1008 -26 991 -56 991 -109 ct 991 -163 1009 -194 1041 -194 ct 1065 -194 1078 -180 1083 -146 ct -1113 -146 l p ef -1219 -227 m 1168 -227 1134 -180 1134 -110 ct 1134 -41 1168 5 1218 5 ct 1268 5 1302 -41 1302 -110 ct -1302 -178 1268 -227 1219 -227 ct p -1219 -195 m 1250 -195 1270 -161 1270 -110 ct 1270 -59 1250 -26 1218 -26 ct -1186 -26 1165 -59 1165 -110 ct 1165 -162 1186 -195 1219 -195 ct p ef -1490 -303 m 1459 -303 l 1459 -187 l 1445 -216 1429 -227 1404 -227 ct 1359 -227 1329 -182 1329 -115 ct -1329 -41 1360 6 1408 6 ct 1433 6 1448 -4 1461 -31 ct 1461 0 l 1490 0 l 1490 -303 l -p -1410 -194 m 1441 -194 1459 -162 1459 -104 ct 1459 -76 1454 -57 1443 -43 ct -1434 -32 1422 -26 1409 -26 ct 1378 -26 1360 -58 1360 -113 ct 1360 -167 1377 -194 1410 -194 ct -p ef -1656 -69 m 1653 -44 1633 -26 1609 -26 ct 1591 -26 1576 -34 1568 -49 ct 1560 -61 1558 -73 1557 -98 ct -1689 -98 l 1688 -142 1684 -162 1674 -184 ct 1660 -214 1640 -227 1610 -227 ct -1558 -227 1524 -180 1524 -106 ct 1524 -36 1556 6 1608 6 ct 1650 6 1679 -21 1687 -69 ct -1656 -69 l p -1557 -128 m 1559 -167 1580 -194 1609 -194 ct 1625 -194 1638 -186 1646 -173 ct -1653 -162 1656 -151 1658 -128 ct 1557 -128 l p ef -1755 0 m 1755 -28 l 1768 -3 1782 6 1806 6 ct 1854 6 1885 -41 1885 -115 ct -1885 -182 1855 -227 1810 -227 ct 1788 -227 1772 -217 1756 -192 ct 1756 -303 l -1726 -303 l 1726 0 l 1755 0 l p -1805 -194 m 1837 -194 1853 -167 1853 -113 ct 1853 -58 1835 -26 1804 -26 ct -1792 -26 1780 -32 1771 -43 ct 1760 -57 1755 -76 1755 -105 ct 1755 -163 1772 -194 1805 -194 ct -p ef -1998 -227 m 1947 -227 1913 -180 1913 -110 ct 1913 -41 1947 5 1997 5 ct 2047 5 2081 -41 2081 -110 ct -2081 -178 2047 -227 1998 -227 ct p -1998 -195 m 2029 -195 2049 -161 2049 -110 ct 2049 -59 2029 -26 1997 -26 ct -1965 -26 1944 -59 1944 -110 ct 1944 -162 1965 -195 1998 -195 ct p ef -2193 -227 m 2142 -227 2108 -180 2108 -110 ct 2108 -41 2142 5 2192 5 ct 2242 5 2276 -41 2276 -110 ct -2276 -178 2242 -227 2193 -227 ct p -2193 -195 m 2224 -195 2244 -161 2244 -110 ct 2244 -59 2224 -26 2192 -26 ct -2160 -26 2139 -59 2139 -110 ct 2139 -162 2160 -195 2193 -195 ct p ef -2390 -138 m 2459 -221 l 2421 -221 l 2342 -127 l 2342 -303 l 2313 -303 l -2313 0 l 2342 0 l 2342 -83 l 2368 -111 l 2424 0 l 2463 0 l 2390 -138 l -p ef -2734 -221 m 2705 -221 l 2705 -188 l 2688 -217 2674 -227 2649 -227 ct 2604 -227 2574 -182 2574 -115 ct -2574 -42 2606 6 2654 6 ct 2676 6 2691 -2 2703 -24 ct 2703 -15 l 2703 11 2701 25 2695 37 ct -2687 54 2673 62 2651 62 ct 2628 62 2616 52 2610 27 ct 2580 27 l 2585 55 2591 68 2605 79 ct -2617 88 2632 93 2650 93 ct 2681 93 2705 80 2719 57 ct 2729 39 2734 17 2734 -18 ct -2734 -221 l p -2656 -194 m 2687 -194 2704 -162 2704 -104 ct 2704 -55 2686 -26 2654 -26 ct -2624 -26 2606 -58 2606 -113 ct 2606 -167 2623 -194 2656 -194 ct p ef -2805 -153 m 2809 -184 2821 -196 2848 -196 ct 2875 -196 2890 -184 2890 -159 ct -2890 -143 2885 -136 2874 -134 ct 2823 -126 l 2788 -121 2768 -96 2768 -58 ct -2768 -19 2791 6 2826 6 ct 2852 6 2871 -4 2890 -29 ct 2893 -5 2901 4 2922 4 ct 2926 4 2930 3 2936 1 ct -2938 0 2938 0 2940 0 ct 2940 -27 l 2933 -25 2931 -25 2929 -25 ct 2923 -25 2919 -30 2919 -38 ct -2919 -165 l 2919 -204 2893 -227 2850 -227 ct 2821 -227 2800 -217 2788 -198 ct -2781 -186 2778 -175 2777 -153 ct 2805 -153 l p -2889 -76 m 2889 -48 2863 -24 2832 -24 ct 2812 -24 2800 -38 2800 -61 ct 2800 -83 2811 -94 2839 -98 ct -2874 -104 2882 -107 2889 -112 ct 2889 -76 l p ef -3004 -221 m 2974 -221 l 2974 0 l 3004 0 l 3004 -221 l p -3004 -261 m 3004 -303 l 2974 -303 l 2974 -261 l 3004 -261 l p ef -3078 -221 m 3049 -221 l 3049 0 l 3079 0 l 3079 -120 l 3079 -166 3098 -194 3129 -194 ct -3155 -194 3167 -176 3167 -136 ct 3167 0 l 3197 0 l 3197 -150 l 3197 -199 3174 -227 3136 -227 ct -3111 -227 3093 -216 3078 -188 ct 3078 -221 l p ef -pom -gr -gs -pum -9174 17762 t -165 -88 m 189 0 l 226 0 l 136 -303 l 98 -303 l 4 0 l 39 0 l 65 -88 l -165 -88 l p -75 -125 m 115 -259 l 153 -125 l 75 -125 l p ef -406 -303 m 375 -303 l 375 -187 l 361 -216 345 -227 320 -227 ct 275 -227 245 -182 245 -115 ct -245 -41 276 6 324 6 ct 349 6 364 -4 377 -31 ct 377 0 l 406 0 l 406 -303 l -p -326 -194 m 357 -194 375 -162 375 -104 ct 375 -76 370 -57 359 -43 ct 350 -32 338 -26 325 -26 ct -294 -26 276 -58 276 -113 ct 276 -167 293 -194 326 -194 ct p ef -477 -153 m 481 -184 493 -196 520 -196 ct 547 -196 562 -184 562 -159 ct 562 -143 557 -136 546 -134 ct -495 -126 l 460 -121 440 -96 440 -58 ct 440 -19 463 6 498 6 ct 524 6 543 -4 562 -29 ct -565 -5 573 4 594 4 ct 598 4 602 3 608 1 ct 610 0 610 0 612 0 ct 612 -27 l 605 -25 603 -25 601 -25 ct -595 -25 591 -30 591 -38 ct 591 -165 l 591 -204 565 -227 522 -227 ct 493 -227 472 -217 460 -198 ct -453 -186 450 -175 449 -153 ct 477 -153 l p -561 -76 m 561 -48 535 -24 504 -24 ct 484 -24 472 -38 472 -61 ct 472 -83 483 -94 511 -98 ct -546 -104 554 -107 561 -112 ct 561 -76 l p ef -642 87 m 672 87 l 672 -24 l 685 -2 699 6 722 6 ct 770 6 801 -42 801 -115 ct -801 -182 771 -227 726 -227 ct 701 -227 687 -217 671 -188 ct 671 -221 l 642 -221 l -642 87 l p -721 -194 m 752 -194 769 -166 769 -114 ct 769 -58 751 -26 720 -26 ct 690 -26 671 -55 671 -103 ct -671 -163 688 -194 721 -194 ct p ef -906 -190 m 906 -221 l 876 -221 l 876 -282 l 846 -282 l 846 -221 l -821 -221 l 821 -190 l 846 -190 l 846 -44 l 846 -12 857 2 881 2 ct 883 2 885 2 892 1 ct -894 1 899 0 905 0 ct 905 -29 l 895 -29 l 881 -29 876 -34 876 -46 ct 876 -190 l -906 -190 l p ef -967 -221 m 937 -221 l 937 0 l 967 0 l 967 -221 l p -967 -261 m 967 -303 l 937 -303 l 937 -261 l 967 -261 l p ef -1076 -39 m 1029 -221 l 993 -221 l 1059 0 l 1092 0 l 1161 -221 l 1128 -221 l -1076 -39 l p ef -1309 -69 m 1306 -44 1286 -26 1262 -26 ct 1244 -26 1229 -34 1221 -49 ct 1213 -61 1211 -73 1210 -98 ct -1342 -98 l 1341 -142 1337 -162 1327 -184 ct 1313 -214 1293 -227 1263 -227 ct -1211 -227 1177 -180 1177 -106 ct 1177 -36 1209 6 1261 6 ct 1303 6 1332 -21 1340 -69 ct -1309 -69 l p -1210 -128 m 1212 -167 1233 -194 1262 -194 ct 1278 -194 1291 -186 1299 -173 ct -1306 -162 1309 -151 1311 -128 ct 1210 -128 l p ef -1621 -146 m 1615 -200 1593 -227 1552 -227 ct 1499 -227 1466 -180 1466 -106 ct -1466 -37 1498 6 1547 6 ct 1589 6 1614 -22 1621 -78 ct 1591 -78 l 1585 -43 1570 -26 1547 -26 ct -1516 -26 1499 -56 1499 -109 ct 1499 -163 1517 -194 1549 -194 ct 1573 -194 1586 -180 1591 -146 ct -1621 -146 l p ef -1727 -227 m 1676 -227 1642 -180 1642 -110 ct 1642 -41 1676 5 1726 5 ct 1776 5 1810 -41 1810 -110 ct -1810 -178 1776 -227 1727 -227 ct p -1727 -195 m 1758 -195 1778 -161 1778 -110 ct 1778 -59 1758 -26 1726 -26 ct -1694 -26 1673 -59 1673 -110 ct 1673 -162 1694 -195 1727 -195 ct p ef -1998 -303 m 1967 -303 l 1967 -187 l 1953 -216 1937 -227 1912 -227 ct 1867 -227 1837 -182 1837 -115 ct -1837 -41 1868 6 1916 6 ct 1941 6 1956 -4 1969 -31 ct 1969 0 l 1998 0 l 1998 -303 l -p -1918 -194 m 1949 -194 1967 -162 1967 -104 ct 1967 -76 1962 -57 1951 -43 ct -1942 -32 1930 -26 1917 -26 ct 1886 -26 1868 -58 1868 -113 ct 1868 -167 1885 -194 1918 -194 ct -p ef -2164 -69 m 2161 -44 2141 -26 2117 -26 ct 2099 -26 2084 -34 2076 -49 ct 2068 -61 2066 -73 2065 -98 ct -2197 -98 l 2196 -142 2192 -162 2182 -184 ct 2168 -214 2148 -227 2118 -227 ct -2066 -227 2032 -180 2032 -106 ct 2032 -36 2064 6 2116 6 ct 2158 6 2187 -21 2195 -69 ct -2164 -69 l p -2065 -128 m 2067 -167 2088 -194 2117 -194 ct 2133 -194 2146 -186 2154 -173 ct -2161 -162 2164 -151 2166 -128 ct 2065 -128 l p ef -2263 0 m 2263 -28 l 2276 -3 2290 6 2314 6 ct 2362 6 2393 -41 2393 -115 ct -2393 -182 2363 -227 2318 -227 ct 2296 -227 2280 -217 2264 -192 ct 2264 -303 l -2234 -303 l 2234 0 l 2263 0 l p -2313 -194 m 2345 -194 2361 -167 2361 -113 ct 2361 -58 2343 -26 2312 -26 ct -2300 -26 2288 -32 2279 -43 ct 2268 -57 2263 -76 2263 -105 ct 2263 -163 2280 -194 2313 -194 ct -p ef -2506 -227 m 2455 -227 2421 -180 2421 -110 ct 2421 -41 2455 5 2505 5 ct 2555 5 2589 -41 2589 -110 ct -2589 -178 2555 -227 2506 -227 ct p -2506 -195 m 2537 -195 2557 -161 2557 -110 ct 2557 -59 2537 -26 2505 -26 ct -2473 -26 2452 -59 2452 -110 ct 2452 -162 2473 -195 2506 -195 ct p ef -2701 -227 m 2650 -227 2616 -180 2616 -110 ct 2616 -41 2650 5 2700 5 ct 2750 5 2784 -41 2784 -110 ct -2784 -178 2750 -227 2701 -227 ct p -2701 -195 m 2732 -195 2752 -161 2752 -110 ct 2752 -59 2732 -26 2700 -26 ct -2668 -26 2647 -59 2647 -110 ct 2647 -162 2668 -195 2701 -195 ct p ef -2898 -138 m 2967 -221 l 2929 -221 l 2850 -127 l 2850 -303 l 2821 -303 l -2821 0 l 2850 0 l 2850 -83 l 2876 -111 l 2932 0 l 2971 0 l 2898 -138 l -p ef -3242 -221 m 3213 -221 l 3213 -188 l 3196 -217 3182 -227 3157 -227 ct 3112 -227 3082 -182 3082 -115 ct -3082 -42 3114 6 3162 6 ct 3184 6 3199 -2 3211 -24 ct 3211 -15 l 3211 11 3209 25 3203 37 ct -3195 54 3181 62 3159 62 ct 3136 62 3124 52 3118 27 ct 3088 27 l 3093 55 3099 68 3113 79 ct -3125 88 3140 93 3158 93 ct 3189 93 3213 80 3227 57 ct 3237 39 3242 17 3242 -18 ct -3242 -221 l p -3164 -194 m 3195 -194 3212 -162 3212 -104 ct 3212 -55 3194 -26 3162 -26 ct -3132 -26 3114 -58 3114 -113 ct 3114 -167 3131 -194 3164 -194 ct p ef -3313 -153 m 3317 -184 3329 -196 3356 -196 ct 3383 -196 3398 -184 3398 -159 ct -3398 -143 3393 -136 3382 -134 ct 3331 -126 l 3296 -121 3276 -96 3276 -58 ct -3276 -19 3299 6 3334 6 ct 3360 6 3379 -4 3398 -29 ct 3401 -5 3409 4 3430 4 ct 3434 4 3438 3 3444 1 ct -3446 0 3446 0 3448 0 ct 3448 -27 l 3441 -25 3439 -25 3437 -25 ct 3431 -25 3427 -30 3427 -38 ct -3427 -165 l 3427 -204 3401 -227 3358 -227 ct 3329 -227 3308 -217 3296 -198 ct -3289 -186 3286 -175 3285 -153 ct 3313 -153 l p -3397 -76 m 3397 -48 3371 -24 3340 -24 ct 3320 -24 3308 -38 3308 -61 ct 3308 -83 3319 -94 3347 -98 ct -3382 -104 3390 -107 3397 -112 ct 3397 -76 l p ef -3512 -221 m 3482 -221 l 3482 0 l 3512 0 l 3512 -221 l p -3512 -261 m 3512 -303 l 3482 -303 l 3482 -261 l 3512 -261 l p ef -3586 -221 m 3557 -221 l 3557 0 l 3587 0 l 3587 -120 l 3587 -166 3606 -194 3637 -194 ct -3663 -194 3675 -176 3675 -136 ct 3675 0 l 3705 0 l 3705 -150 l 3705 -199 3682 -227 3644 -227 ct -3619 -227 3601 -216 3586 -188 ct 3586 -221 l p ef -pom -gr -0 lw 1 lj 11185 19818 m 9435 19818 l 9435 18318 l 12935 18318 l 12935 19818 l -11185 19818 l pc -gs -pum -10523 19288 t -41 0 m 191 0 l 234 0 272 -17 297 -48 ct 332 -92 351 -157 351 -233 ct 351 -368 289 -455 193 -455 ct -41 -455 l 41 0 l p -92 -403 m 187 -403 l 259 -403 299 -341 299 -227 ct 299 -119 257 -52 190 -52 ct -92 -52 l 92 -403 l p ef -596 -104 m 591 -66 561 -39 524 -39 ct 497 -39 476 -51 462 -74 ct 451 -92 448 -110 446 -147 ct -645 -147 l 643 -213 637 -244 622 -277 ct 601 -321 570 -341 526 -341 ct 448 -341 397 -271 397 -160 ct -397 -55 445 9 523 9 ct 585 9 629 -32 641 -104 ct 596 -104 l p -446 -192 m 449 -252 481 -292 524 -292 ct 548 -292 568 -280 580 -260 ct 591 -243 595 -226 597 -192 ct -446 -192 l p ef -745 -455 m 699 -455 l 699 0 l 745 0 l 745 -455 l p ef -853 -231 m 859 -277 877 -295 917 -295 ct 958 -295 980 -276 980 -240 ct 980 -215 973 -204 956 -201 ct -880 -190 l 827 -182 798 -145 798 -87 ct 798 -29 832 9 885 9 ct 923 9 951 -6 981 -44 ct -984 -8 997 6 1028 6 ct 1035 6 1040 5 1049 1 ct 1052 0 1053 0 1055 0 ct 1055 -40 l -1045 -38 1043 -38 1039 -38 ct 1029 -38 1024 -45 1024 -57 ct 1024 -248 l 1024 -306 985 -341 920 -341 ct -878 -341 845 -326 827 -297 ct 817 -280 813 -264 811 -231 ct 853 -231 l p -979 -114 m 979 -73 940 -36 894 -36 ct 863 -36 845 -57 845 -92 ct 845 -125 862 -141 904 -148 ct -956 -157 969 -160 979 -169 ct 979 -114 l p ef -1197 -59 m 1124 -332 l 1072 -332 l 1173 8 l 1168 24 1164 38 1162 43 ct -1152 76 1144 85 1125 85 ct 1115 85 1106 83 1097 80 ct 1097 130 l 1101 132 l -1109 135 1113 135 1119 135 ct 1174 135 1182 125 1223 -6 ct 1321 -332 l 1270 -332 l -1197 -59 l p ef -pom -gr -13385 18918 m 13385 19218 l 12935 19068 l 13385 18918 l p ef -1 lw 0 lj 14935 14567 m 14935 19068 l 13295 19068 l ps -7085 18268 m 6785 18268 l 6935 17818 l 7085 18268 l p ef -9435 19068 m 6935 19068 l 6935 18178 l ps -20025 14718 m 20031 14418 l 20478 14577 l 20025 14718 l p ef -19335 14568 m 20127 14568 l ps -gs -pum -10179 20249 t -63 -128 m 141 -128 l 186 -128 215 -163 215 -217 ct 215 -269 186 -303 141 -303 ct -30 -303 l 30 0 l 63 0 l 63 -128 l p -63 -268 m 131 -268 l 164 -268 181 -251 181 -216 ct 181 -181 164 -163 130 -163 ct -63 -163 l 63 -268 l p ef -282 -153 m 286 -184 298 -196 325 -196 ct 352 -196 367 -184 367 -159 ct 367 -143 362 -136 351 -134 ct -300 -126 l 265 -121 245 -96 245 -58 ct 245 -19 268 6 303 6 ct 329 6 348 -4 367 -29 ct -370 -5 378 4 399 4 ct 403 4 407 3 413 1 ct 415 0 415 0 417 0 ct 417 -27 l 410 -25 408 -25 406 -25 ct -400 -25 396 -30 396 -38 ct 396 -165 l 396 -204 370 -227 327 -227 ct 298 -227 277 -217 265 -198 ct -258 -186 255 -175 254 -153 ct 282 -153 l p -366 -76 m 366 -48 340 -24 309 -24 ct 289 -24 277 -38 277 -61 ct 277 -83 288 -94 316 -98 ct -351 -104 359 -107 366 -112 ct 366 -76 l p ef -582 -158 m 580 -202 555 -227 514 -227 ct 472 -227 444 -200 444 -157 ct 444 -129 458 -111 486 -103 ct -522 -92 l 550 -84 558 -77 558 -60 ct 558 -39 542 -26 515 -26 ct 484 -26 470 -39 468 -71 ct -439 -71 l 440 -49 442 -38 448 -27 ct 460 -5 483 6 513 6 ct 559 6 588 -22 588 -66 ct -588 -97 574 -113 537 -125 ct 507 -134 l 480 -142 474 -148 474 -163 ct 474 -183 488 -195 512 -195 ct -538 -195 551 -183 553 -158 ct 582 -158 l p ef -690 -190 m 690 -221 l 660 -221 l 660 -282 l 630 -282 l 630 -221 l -605 -221 l 605 -190 l 630 -190 l 630 -44 l 630 -12 641 2 665 2 ct 667 2 669 2 676 1 ct -678 1 683 0 689 0 ct 689 -29 l 679 -29 l 665 -29 660 -34 660 -46 ct 660 -190 l -690 -190 l p ef -950 -158 m 948 -202 923 -227 882 -227 ct 840 -227 812 -200 812 -157 ct 812 -129 826 -111 854 -103 ct -890 -92 l 918 -84 926 -77 926 -60 ct 926 -39 910 -26 883 -26 ct 852 -26 838 -39 836 -71 ct -807 -71 l 808 -49 810 -38 816 -27 ct 828 -5 851 6 881 6 ct 927 6 956 -22 956 -66 ct -956 -97 942 -113 905 -125 ct 875 -134 l 848 -142 842 -148 842 -163 ct 842 -183 856 -195 880 -195 ct -906 -195 919 -183 921 -158 ct 950 -158 l p ef -1138 0 m 1138 -221 l 1108 -221 l 1108 -99 l 1108 -54 1088 -26 1058 -26 ct -1034 -26 1023 -42 1023 -74 ct 1023 -221 l 992 -221 l 992 -62 l 992 -19 1015 6 1052 6 ct -1079 6 1093 -3 1109 -34 ct 1109 0 l 1138 0 l p ef -1213 0 m 1213 -28 l 1226 -3 1240 6 1264 6 ct 1312 6 1343 -41 1343 -115 ct -1343 -182 1313 -227 1268 -227 ct 1246 -227 1230 -217 1214 -192 ct 1214 -303 l -1184 -303 l 1184 0 l 1213 0 l p -1263 -194 m 1295 -194 1311 -167 1311 -113 ct 1311 -58 1293 -26 1262 -26 ct -1250 -26 1238 -32 1229 -43 ct 1218 -57 1213 -76 1213 -105 ct 1213 -163 1230 -194 1263 -194 ct -p ef -1449 -190 m 1449 -221 l 1419 -221 l 1419 -248 l 1419 -266 1424 -274 1437 -274 ct -1440 -274 1444 -274 1449 -273 ct 1449 -307 l 1440 -307 1438 -307 1435 -307 ct -1405 -307 1389 -291 1389 -259 ct 1389 -221 l 1363 -221 l 1363 -190 l 1389 -190 l -1389 0 l 1419 0 l 1419 -190 l 1449 -190 l p ef -1571 -188 m 1571 -226 l 1568 -227 1565 -227 1563 -227 ct 1541 -227 1527 -215 1511 -183 ct -1511 -221 l 1482 -221 l 1482 0 l 1513 0 l 1513 -129 l 1513 -163 1532 -188 1559 -188 ct -1571 -188 l p ef -1620 -153 m 1624 -184 1636 -196 1663 -196 ct 1690 -196 1705 -184 1705 -159 ct -1705 -143 1700 -136 1689 -134 ct 1638 -126 l 1603 -121 1583 -96 1583 -58 ct -1583 -19 1606 6 1641 6 ct 1667 6 1686 -4 1705 -29 ct 1708 -5 1716 4 1737 4 ct 1741 4 1745 3 1751 1 ct -1753 0 1753 0 1755 0 ct 1755 -27 l 1748 -25 1746 -25 1744 -25 ct 1738 -25 1734 -30 1734 -38 ct -1734 -165 l 1734 -204 1708 -227 1665 -227 ct 1636 -227 1615 -217 1603 -198 ct -1596 -186 1593 -175 1592 -153 ct 1620 -153 l p -1704 -76 m 1704 -48 1678 -24 1647 -24 ct 1627 -24 1615 -38 1615 -61 ct 1615 -83 1626 -94 1654 -98 ct -1689 -104 1697 -107 1704 -112 ct 1704 -76 l p ef -1787 0 m 1817 0 l 1817 -120 l 1817 -165 1836 -194 1866 -194 ct 1883 -194 1894 -179 1894 -153 ct -1894 0 l 1924 0 l 1924 -134 l 1924 -168 1943 -194 1968 -194 ct 1990 -194 2001 -177 2001 -142 ct -2001 0 l 2031 0 l 2031 -153 l 2031 -199 2009 -227 1974 -227 ct 1952 -227 1940 -219 1920 -191 ct -1908 -217 1894 -227 1872 -227 ct 1848 -227 1831 -216 1816 -188 ct 1816 -221 l -1787 -221 l 1787 0 l p ef -2198 -69 m 2195 -44 2175 -26 2151 -26 ct 2133 -26 2118 -34 2110 -49 ct 2102 -61 2100 -73 2099 -98 ct -2231 -98 l 2230 -142 2226 -162 2216 -184 ct 2202 -214 2182 -227 2152 -227 ct -2100 -227 2066 -180 2066 -106 ct 2066 -36 2098 6 2150 6 ct 2192 6 2221 -21 2229 -69 ct -2198 -69 l p -2099 -128 m 2101 -167 2122 -194 2151 -194 ct 2167 -194 2180 -186 2188 -173 ct -2195 -162 2198 -151 2200 -128 ct 2099 -128 l p ef -pom -gr -tm setmatrix -0 0 t -1 1 s -0 11113 t -pom -count op_count sub {pop} repeat countdictstack dict_count sub {end} repeat b4_inc_state restore -%%PageTrailer -%%Trailer -%%EOF diff --git a/Engine/lib/speex/doc/celp_decoder.odg b/Engine/lib/speex/doc/celp_decoder.odg deleted file mode 100644 index ed537ad44..000000000 Binary files a/Engine/lib/speex/doc/celp_decoder.odg and /dev/null differ diff --git a/Engine/lib/speex/doc/components.eps b/Engine/lib/speex/doc/components.eps deleted file mode 100644 index 8ac53a4ae..000000000 --- a/Engine/lib/speex/doc/components.eps +++ /dev/null @@ -1,1361 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%BoundingBox: 0 0 770 174 -%%Pages: 0 -%%Creator: Sun Microsystems, Inc. -%%Title: none -%%CreationDate: none -%%LanguageLevel: 2 -%%EndComments -%%BeginProlog -%%BeginResource: procset SDRes-Prolog 1.0 0 -/b4_inc_state save def -/dict_count countdictstack def -/op_count count 1 sub def -userdict begin -0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit[] 0 setdash newpath -/languagelevel where {pop languagelevel 1 ne {false setstrokeadjust false setoverprint} if} if -/bdef {bind def} bind def -/c {setrgbcolor} bdef -/l {neg lineto} bdef -/rl {neg rlineto} bdef -/lc {setlinecap} bdef -/lj {setlinejoin} bdef -/lw {setlinewidth} bdef -/ml {setmiterlimit} bdef -/ld {setdash} bdef -/m {neg moveto} bdef -/ct {6 2 roll neg 6 2 roll neg 6 2 roll neg curveto} bdef -/r {rotate} bdef -/t {neg translate} bdef -/s {scale} bdef -/sw {show} bdef -/gs {gsave} bdef -/gr {grestore} bdef -/f {findfont dup length dict begin -{1 index /FID ne {def} {pop pop} ifelse} forall /Encoding ISOLatin1Encoding def -currentdict end /NFont exch definefont pop /NFont findfont} bdef -/p {closepath} bdef -/sf {scalefont setfont} bdef -/ef {eofill}bdef -/pc {closepath stroke}bdef -/ps {stroke}bdef -/pum {matrix currentmatrix}bdef -/pom {setmatrix}bdef -/bs {/aString exch def /nXOfs exch def /nWidth exch def currentpoint nXOfs 0 rmoveto pum nWidth aString stringwidth pop div 1 scale aString show pom moveto} bdef -%%EndResource -%%EndProlog -%%BeginSetup -%%EndSetup -%%Page: 1 1 -%%BeginPageSetup -%%EndPageSetup -pum -0.02835 0.0284 s -0 -6126 t -/tm matrix currentmatrix def -tm setmatrix --450 -7975 t -1 1 s -50 lw 1 lj 0.003 0.003 0.003 c 4400 9500 m 2900 9500 l 2900 8000 l 5900 8000 l -5900 9500 l 4400 9500 l pc -gs -gs -pum -3380 8974 t -50 0 m 50 -455 l 251 -455 l 292 -455 323 -451 344 -443 ct 365 -435 382 -420 394 -399 ct -407 -379 413 -356 413 -331 ct 413 -299 403 -271 382 -249 ct 361 -227 329 -213 285 -207 ct -301 -199 313 -192 322 -184 ct 339 -168 356 -148 371 -124 ct 451 0 l 375 0 l -315 -95 l 297 -122 283 -143 271 -157 ct 260 -172 250 -182 241 -188 ct 232 -194 223 -198 213 -200 ct -207 -201 195 -202 180 -202 ct 110 -202 l 110 0 l 50 0 l p -110 -254 m 239 -254 l 267 -254 288 -257 304 -263 ct 319 -268 331 -277 339 -290 ct -347 -303 351 -316 351 -331 ct 351 -352 344 -370 328 -384 ct 312 -398 288 -405 254 -405 ct -110 -405 l 110 -254 l p ef -724 -107 m 782 -99 l 773 -66 756 -40 731 -21 ct 707 -2 675 7 637 7 ct 589 7 551 -8 523 -37 ct -494 -67 480 -109 480 -162 ct 480 -218 495 -261 523 -291 ct 552 -322 589 -337 634 -337 ct -678 -337 714 -322 742 -292 ct 770 -262 784 -220 784 -166 ct 784 -163 784 -158 783 -151 ct -538 -151 l 540 -115 550 -87 569 -68 ct 587 -49 610 -39 637 -39 ct 658 -39 675 -44 690 -55 ct -704 -66 716 -83 724 -107 ct p -541 -197 m 725 -197 l 722 -225 715 -245 704 -259 ct 686 -280 663 -291 635 -291 ct -609 -291 587 -283 570 -265 ct 553 -248 543 -226 541 -197 ct p ef -1066 -121 m 1121 -114 l 1115 -76 1099 -46 1075 -25 ct 1050 -4 1020 7 984 7 ct -939 7 902 -8 875 -37 ct 848 -67 834 -109 834 -164 ct 834 -199 840 -230 851 -257 ct -863 -284 881 -304 905 -317 ct 929 -330 956 -337 984 -337 ct 1020 -337 1049 -328 1072 -310 ct -1094 -292 1109 -266 1115 -233 ct 1061 -224 l 1056 -247 1047 -263 1034 -274 ct -1021 -286 1005 -291 986 -291 ct 958 -291 935 -281 918 -261 ct 900 -241 891 -209 891 -165 ct -891 -121 900 -89 917 -69 ct 934 -49 956 -39 983 -39 ct 1005 -39 1023 -46 1038 -59 ct -1053 -72 1062 -93 1066 -121 ct p ef -1147 -165 m 1147 -226 1164 -271 1198 -301 ct 1226 -325 1261 -337 1302 -337 ct -1347 -337 1384 -322 1412 -293 ct 1441 -263 1456 -222 1456 -170 ct 1456 -127 1449 -94 1437 -70 ct -1424 -45 1405 -27 1381 -13 ct 1357 0 1330 7 1302 7 ct 1255 7 1218 -8 1190 -37 ct -1161 -67 1147 -110 1147 -165 ct p -1204 -165 m 1204 -123 1214 -91 1232 -70 ct 1250 -49 1274 -39 1302 -39 ct 1329 -39 1352 -49 1371 -71 ct -1389 -92 1398 -124 1398 -167 ct 1398 -208 1389 -239 1370 -260 ct 1352 -281 1329 -291 1302 -291 ct -1274 -291 1250 -281 1232 -260 ct 1214 -239 1204 -207 1204 -165 ct p ef -1518 0 m 1518 -330 l 1568 -330 l 1568 -280 l 1581 -303 1593 -318 1604 -326 ct -1615 -333 1627 -337 1640 -337 ct 1659 -337 1678 -331 1697 -319 ct 1678 -267 l -1664 -275 1651 -279 1637 -279 ct 1625 -279 1614 -276 1604 -268 ct 1594 -261 1587 -251 1583 -238 ct -1577 -218 1574 -196 1574 -173 ct 1574 0 l 1518 0 l p ef -1944 0 m 1944 -42 l 1924 -9 1893 7 1852 7 ct 1826 7 1802 0 1780 -15 ct 1758 -29 1741 -49 1729 -75 ct -1717 -101 1711 -131 1711 -165 ct 1711 -198 1716 -228 1727 -254 ct 1738 -281 1755 -302 1776 -316 ct -1798 -330 1823 -337 1850 -337 ct 1870 -337 1887 -333 1903 -325 ct 1918 -316 1931 -305 1941 -292 ct -1941 -455 l 1996 -455 l 1996 0 l 1944 0 l p -1768 -165 m 1768 -123 1777 -91 1795 -70 ct 1813 -49 1833 -39 1858 -39 ct 1882 -39 1903 -49 1920 -69 ct -1937 -89 1945 -119 1945 -160 ct 1945 -205 1937 -238 1919 -259 ct 1902 -280 1881 -291 1855 -291 ct -1830 -291 1810 -281 1793 -261 ct 1776 -240 1768 -208 1768 -165 ct p ef -pom -gr -gr -12748 9525 m 12697 9525 l 12697 9475 l 12748 9475 l 12748 9525 l p ef -12646 9525 m 12595 9525 l 12595 9475 l 12646 9475 l 12646 9525 l p ef -12544 9525 m 12493 9525 l 12493 9475 l 12544 9475 l 12544 9525 l p ef -12442 9525 m 12391 9525 l 12391 9475 l 12442 9475 l 12442 9525 l p ef -12340 9525 m 12289 9525 l 12289 9475 l 12340 9475 l 12340 9525 l p ef -12238 9525 m 12187 9525 l 12187 9475 l 12238 9475 l 12238 9525 l p ef -12136 9525 m 12085 9525 l 12085 9475 l 12136 9475 l 12136 9525 l p ef -12034 9525 m 11983 9525 l 11983 9475 l 12034 9475 l 12034 9525 l p ef -11932 9525 m 11881 9525 l 11881 9475 l 11932 9475 l 11932 9525 l p ef -11830 9525 m 11779 9525 l 11779 9475 l 11830 9475 l 11830 9525 l p ef -11728 9525 m 11677 9525 l 11677 9475 l 11728 9475 l 11728 9525 l p ef -11626 9525 m 11575 9525 l 11575 9475 l 11626 9475 l 11626 9525 l p ef -11524 9525 m 11473 9525 l 11473 9475 l 11524 9475 l 11524 9525 l p ef -11422 9525 m 11400 9525 l 11400 9500 l 11400 9475 l 11422 9475 l 11422 9500 l -11422 9525 l p ef -11400 9500 m 11400 9525 l 11396 9525 l 11391 9523 l 11388 9522 l 11384 9519 l -11381 9516 l 11378 9513 l 11377 9509 l 11375 9504 l 11375 9500 l 11375 9500 l -11400 9500 l p ef -11375 9500 m 11375 9471 l 11400 9471 l 11425 9471 l 11425 9500 l 11400 9500 l -11375 9500 l p ef -11375 9420 m 11375 9369 l 11425 9369 l 11425 9420 l 11375 9420 l p ef -11375 9318 m 11375 9267 l 11425 9267 l 11425 9318 l 11375 9318 l p ef -11375 9216 m 11375 9165 l 11425 9165 l 11425 9216 l 11375 9216 l p ef -11375 9114 m 11375 9063 l 11425 9063 l 11425 9114 l 11375 9114 l p ef -11375 9012 m 11375 8961 l 11425 8961 l 11425 9012 l 11375 9012 l p ef -11375 8910 m 11375 8859 l 11425 8859 l 11425 8910 l 11375 8910 l p ef -11375 8808 m 11375 8757 l 11425 8757 l 11425 8808 l 11375 8808 l p ef -11375 8706 m 11375 8655 l 11425 8655 l 11425 8706 l 11375 8706 l p ef -11375 8604 m 11375 8553 l 11425 8553 l 11425 8604 l 11375 8604 l p ef -11375 8502 m 11375 8451 l 11425 8451 l 11425 8502 l 11375 8502 l p ef -11375 8400 m 11375 8349 l 11425 8349 l 11425 8400 l 11375 8400 l p ef -11375 8298 m 11375 8247 l 11425 8247 l 11425 8298 l 11375 8298 l p ef -11375 8196 m 11375 8145 l 11425 8145 l 11425 8196 l 11375 8196 l p ef -11375 8094 m 11375 8043 l 11425 8043 l 11425 8094 l 11375 8094 l p ef -11408 7975 m 11459 7975 l 11459 8025 l 11408 8025 l 11408 7975 l p ef -11510 7975 m 11561 7975 l 11561 8025 l 11510 8025 l 11510 7975 l p ef -11612 7975 m 11663 7975 l 11663 8025 l 11612 8025 l 11612 7975 l p ef -11714 7975 m 11765 7975 l 11765 8025 l 11714 8025 l 11714 7975 l p ef -11816 7975 m 11867 7975 l 11867 8025 l 11816 8025 l 11816 7975 l p ef -11918 7975 m 11969 7975 l 11969 8025 l 11918 8025 l 11918 7975 l p ef -12020 7975 m 12071 7975 l 12071 8025 l 12020 8025 l 12020 7975 l p ef -12122 7975 m 12173 7975 l 12173 8025 l 12122 8025 l 12122 7975 l p ef -12224 7975 m 12275 7975 l 12275 8025 l 12224 8025 l 12224 7975 l p ef -12326 7975 m 12377 7975 l 12377 8025 l 12326 8025 l 12326 7975 l p ef -12428 7975 m 12479 7975 l 12479 8025 l 12428 8025 l 12428 7975 l p ef -12530 7975 m 12581 7975 l 12581 8025 l 12530 8025 l 12530 7975 l p ef -12632 7975 m 12683 7975 l 12683 8025 l 12632 8025 l 12632 7975 l p ef -12734 7975 m 12785 7975 l 12785 8025 l 12734 8025 l 12734 7975 l p ef -12836 7975 m 12887 7975 l 12887 8025 l 12836 8025 l 12836 7975 l p ef -12938 7975 m 12989 7975 l 12989 8025 l 12938 8025 l 12938 7975 l p ef -13040 7975 m 13091 7975 l 13091 8025 l 13040 8025 l 13040 7975 l p ef -13142 7975 m 13193 7975 l 13193 8025 l 13142 8025 l 13142 7975 l p ef -13244 7975 m 13295 7975 l 13295 8025 l 13244 8025 l 13244 7975 l p ef -13346 7975 m 13397 7975 l 13397 8025 l 13346 8025 l 13346 7975 l p ef -13448 7975 m 13499 7975 l 13499 8025 l 13448 8025 l 13448 7975 l p ef -13550 7975 m 13601 7975 l 13601 8025 l 13550 8025 l 13550 7975 l p ef -13652 7975 m 13703 7975 l 13703 8025 l 13652 8025 l 13652 7975 l p ef -13754 7975 m 13805 7975 l 13805 8025 l 13754 8025 l 13754 7975 l p ef -13856 7975 m 13907 7975 l 13907 8025 l 13856 8025 l 13856 7975 l p ef -13958 7975 m 14009 7975 l 14009 8025 l 13958 8025 l 13958 7975 l p ef -14060 7975 m 14111 7975 l 14111 8025 l 14060 8025 l 14060 7975 l p ef -14162 7975 m 14213 7975 l 14213 8025 l 14162 8025 l 14162 7975 l p ef -14264 7975 m 14300 7975 l 14300 8000 l 14300 8025 l 14264 8025 l 14264 8000 l -14264 7975 l p ef -14300 8000 m 14300 7975 l 14304 7975 l 14309 7977 l 14312 7978 l 14316 7981 l -14319 7984 l 14322 7987 l 14323 7991 l 14325 7996 l 14325 8000 l 14325 8000 l -14300 8000 l p ef -14325 8000 m 14325 8015 l 14300 8015 l 14275 8015 l 14275 8000 l 14300 8000 l -14325 8000 l p ef -14325 8066 m 14325 8117 l 14275 8117 l 14275 8066 l 14325 8066 l p ef -14325 8168 m 14325 8219 l 14275 8219 l 14275 8168 l 14325 8168 l p ef -14325 8270 m 14325 8321 l 14275 8321 l 14275 8270 l 14325 8270 l p ef -14325 8372 m 14325 8423 l 14275 8423 l 14275 8372 l 14325 8372 l p ef -14325 8474 m 14325 8525 l 14275 8525 l 14275 8474 l 14325 8474 l p ef -14325 8576 m 14325 8627 l 14275 8627 l 14275 8576 l 14325 8576 l p ef -14325 8678 m 14325 8729 l 14275 8729 l 14275 8678 l 14325 8678 l p ef -14325 8780 m 14325 8831 l 14275 8831 l 14275 8780 l 14325 8780 l p ef -14325 8882 m 14325 8933 l 14275 8933 l 14275 8882 l 14325 8882 l p ef -14325 8984 m 14325 9035 l 14275 9035 l 14275 8984 l 14325 8984 l p ef -14325 9086 m 14325 9137 l 14275 9137 l 14275 9086 l 14325 9086 l p ef -14325 9188 m 14325 9239 l 14275 9239 l 14275 9188 l 14325 9188 l p ef -14325 9290 m 14325 9341 l 14275 9341 l 14275 9290 l 14325 9290 l p ef -14325 9392 m 14325 9443 l 14275 9443 l 14275 9392 l 14325 9392 l p ef -14325 9494 m 14325 9500 l 14300 9500 l 14275 9500 l 14275 9494 l 14300 9494 l -14325 9494 l p ef -14300 9500 m 14325 9500 l 14325 9504 l 14323 9509 l 14322 9512 l 14319 9516 l -14316 9519 l 14313 9522 l 14309 9523 l 14304 9525 l 14300 9525 l 14300 9525 l -14300 9500 l p ef -14300 9525 m 14255 9525 l 14255 9500 l 14255 9475 l 14300 9475 l 14300 9500 l -14300 9525 l p ef -14204 9525 m 14153 9525 l 14153 9475 l 14204 9475 l 14204 9525 l p ef -14102 9525 m 14051 9525 l 14051 9475 l 14102 9475 l 14102 9525 l p ef -14000 9525 m 13949 9525 l 13949 9475 l 14000 9475 l 14000 9525 l p ef -13898 9525 m 13847 9525 l 13847 9475 l 13898 9475 l 13898 9525 l p ef -13796 9525 m 13745 9525 l 13745 9475 l 13796 9475 l 13796 9525 l p ef -13694 9525 m 13643 9525 l 13643 9475 l 13694 9475 l 13694 9525 l p ef -13592 9525 m 13541 9525 l 13541 9475 l 13592 9475 l 13592 9525 l p ef -13490 9525 m 13439 9525 l 13439 9475 l 13490 9475 l 13490 9525 l p ef -13388 9525 m 13337 9525 l 13337 9475 l 13388 9475 l 13388 9525 l p ef -13286 9525 m 13235 9525 l 13235 9475 l 13286 9475 l 13286 9525 l p ef -13184 9525 m 13133 9525 l 13133 9475 l 13184 9475 l 13184 9525 l p ef -13082 9525 m 13031 9525 l 13031 9475 l 13082 9475 l 13082 9525 l p ef -12980 9525 m 12929 9525 l 12929 9475 l 12980 9475 l 12980 9525 l p ef -12878 9525 m 12850 9525 l 12850 9500 l 12850 9475 l 12878 9475 l 12878 9500 l -12878 9525 l p ef -12850 9525 m 12799 9525 l 12799 9500 l 12799 9475 l 12850 9475 l 12850 9500 l -12850 9525 l p ef -gs -gs -pum -12191 8974 t --1 0 m 174 -455 l 238 -455 l 424 0 l 356 0 l 303 -138 l 113 -138 l -63 0 l -1 0 l p -130 -187 m 284 -187 l 237 -313 l 222 -351 212 -383 205 -407 ct 199 -378 191 -349 180 -320 ct -130 -187 l p ef -473 0 m 473 -455 l 802 -455 l 802 -401 l 533 -401 l 533 -262 l 785 -262 l -785 -209 l 533 -209 l 533 -54 l 812 -54 l 812 0 l 473 0 l p ef -1220 -159 m 1280 -144 l 1268 -95 1245 -57 1212 -31 ct 1180 -5 1140 8 1092 8 ct -1043 8 1003 -2 973 -22 ct 942 -42 919 -71 903 -109 ct 887 -147 879 -187 879 -231 ct -879 -278 888 -319 906 -355 ct 924 -390 950 -417 983 -435 ct 1016 -453 1053 -463 1093 -463 ct -1139 -463 1177 -451 1208 -428 ct 1239 -405 1261 -372 1273 -330 ct 1213 -316 l -1203 -349 1188 -373 1168 -388 ct 1148 -403 1122 -411 1092 -411 ct 1057 -411 1028 -403 1004 -386 ct -981 -369 964 -347 955 -318 ct 945 -290 941 -261 941 -231 ct 941 -192 946 -159 958 -130 ct -969 -101 986 -79 1010 -65 ct 1034 -51 1060 -44 1087 -44 ct 1121 -44 1150 -53 1173 -73 ct -1196 -92 1212 -121 1220 -159 ct p ef -pom -gr -gr -17600 9525 m 17549 9525 l 17549 9475 l 17600 9475 l 17600 9525 l p ef -17498 9525 m 17447 9525 l 17447 9475 l 17498 9475 l 17498 9525 l p ef -17396 9525 m 17345 9525 l 17345 9475 l 17396 9475 l 17396 9525 l p ef -17294 9525 m 17243 9525 l 17243 9475 l 17294 9475 l 17294 9525 l p ef -17192 9525 m 17141 9525 l 17141 9475 l 17192 9475 l 17192 9525 l p ef -17090 9525 m 17039 9525 l 17039 9475 l 17090 9475 l 17090 9525 l p ef -16988 9525 m 16937 9525 l 16937 9475 l 16988 9475 l 16988 9525 l p ef -16886 9525 m 16835 9525 l 16835 9475 l 16886 9475 l 16886 9525 l p ef -16784 9525 m 16733 9525 l 16733 9475 l 16784 9475 l 16784 9525 l p ef -16682 9525 m 16631 9525 l 16631 9475 l 16682 9475 l 16682 9525 l p ef -16580 9525 m 16529 9525 l 16529 9475 l 16580 9475 l 16580 9525 l p ef -16478 9525 m 16427 9525 l 16427 9475 l 16478 9475 l 16478 9525 l p ef -16376 9525 m 16325 9525 l 16325 9475 l 16376 9475 l 16376 9525 l p ef -16274 9525 m 16223 9525 l 16223 9475 l 16274 9475 l 16274 9525 l p ef -16172 9525 m 16121 9525 l 16121 9475 l 16172 9475 l 16172 9525 l p ef -16070 9525 m 16019 9525 l 16019 9475 l 16070 9475 l 16070 9525 l p ef -15968 9525 m 15917 9525 l 15917 9475 l 15968 9475 l 15968 9525 l p ef -15866 9525 m 15815 9525 l 15815 9475 l 15866 9475 l 15866 9525 l p ef -15764 9525 m 15713 9525 l 15713 9475 l 15764 9475 l 15764 9525 l p ef -15662 9525 m 15611 9525 l 15611 9475 l 15662 9475 l 15662 9525 l p ef -15560 9525 m 15509 9525 l 15509 9475 l 15560 9475 l 15560 9525 l p ef -15458 9525 m 15407 9525 l 15407 9475 l 15458 9475 l 15458 9525 l p ef -15375 9456 m 15375 9405 l 15425 9405 l 15425 9456 l 15375 9456 l p ef -15375 9354 m 15375 9303 l 15425 9303 l 15425 9354 l 15375 9354 l p ef -15375 9252 m 15375 9201 l 15425 9201 l 15425 9252 l 15375 9252 l p ef -15375 9150 m 15375 9099 l 15425 9099 l 15425 9150 l 15375 9150 l p ef -15375 9048 m 15375 8997 l 15425 8997 l 15425 9048 l 15375 9048 l p ef -15375 8946 m 15375 8895 l 15425 8895 l 15425 8946 l 15375 8946 l p ef -15375 8844 m 15375 8793 l 15425 8793 l 15425 8844 l 15375 8844 l p ef -15375 8742 m 15375 8691 l 15425 8691 l 15425 8742 l 15375 8742 l p ef -15375 8640 m 15375 8589 l 15425 8589 l 15425 8640 l 15375 8640 l p ef -15375 8538 m 15375 8487 l 15425 8487 l 15425 8538 l 15375 8538 l p ef -15375 8436 m 15375 8385 l 15425 8385 l 15425 8436 l 15375 8436 l p ef -15375 8334 m 15375 8283 l 15425 8283 l 15425 8334 l 15375 8334 l p ef -15375 8232 m 15375 8181 l 15425 8181 l 15425 8232 l 15375 8232 l p ef -15375 8130 m 15375 8079 l 15425 8079 l 15425 8130 l 15375 8130 l p ef -15375 8028 m 15375 8000 l 15400 8000 l 15425 8000 l 15425 8028 l 15400 8028 l -15375 8028 l p ef -15400 8000 m 15375 8000 l 15375 7996 l 15377 7991 l 15378 7988 l 15381 7984 l -15384 7981 l 15387 7978 l 15391 7977 l 15396 7975 l 15400 7975 l 15400 7975 l -15400 8000 l p ef -15400 7975 m 15423 7975 l 15423 8000 l 15423 8025 l 15400 8025 l 15400 8000 l -15400 7975 l p ef -15474 7975 m 15525 7975 l 15525 8025 l 15474 8025 l 15474 7975 l p ef -15576 7975 m 15627 7975 l 15627 8025 l 15576 8025 l 15576 7975 l p ef -15678 7975 m 15729 7975 l 15729 8025 l 15678 8025 l 15678 7975 l p ef -15780 7975 m 15831 7975 l 15831 8025 l 15780 8025 l 15780 7975 l p ef -15882 7975 m 15933 7975 l 15933 8025 l 15882 8025 l 15882 7975 l p ef -15984 7975 m 16035 7975 l 16035 8025 l 15984 8025 l 15984 7975 l p ef -16086 7975 m 16137 7975 l 16137 8025 l 16086 8025 l 16086 7975 l p ef -16188 7975 m 16239 7975 l 16239 8025 l 16188 8025 l 16188 7975 l p ef -16290 7975 m 16341 7975 l 16341 8025 l 16290 8025 l 16290 7975 l p ef -16392 7975 m 16443 7975 l 16443 8025 l 16392 8025 l 16392 7975 l p ef -16494 7975 m 16545 7975 l 16545 8025 l 16494 8025 l 16494 7975 l p ef -16596 7975 m 16647 7975 l 16647 8025 l 16596 8025 l 16596 7975 l p ef -16698 7975 m 16749 7975 l 16749 8025 l 16698 8025 l 16698 7975 l p ef -16800 7975 m 16851 7975 l 16851 8025 l 16800 8025 l 16800 7975 l p ef -16902 7975 m 16953 7975 l 16953 8025 l 16902 8025 l 16902 7975 l p ef -17004 7975 m 17055 7975 l 17055 8025 l 17004 8025 l 17004 7975 l p ef -17106 7975 m 17157 7975 l 17157 8025 l 17106 8025 l 17106 7975 l p ef -17208 7975 m 17259 7975 l 17259 8025 l 17208 8025 l 17208 7975 l p ef -17310 7975 m 17361 7975 l 17361 8025 l 17310 8025 l 17310 7975 l p ef -17412 7975 m 17463 7975 l 17463 8025 l 17412 8025 l 17412 7975 l p ef -17514 7975 m 17565 7975 l 17565 8025 l 17514 8025 l 17514 7975 l p ef -17616 7975 m 17667 7975 l 17667 8025 l 17616 8025 l 17616 7975 l p ef -17718 7975 m 17769 7975 l 17769 8025 l 17718 8025 l 17718 7975 l p ef -17820 7975 m 17871 7975 l 17871 8025 l 17820 8025 l 17820 7975 l p ef -17922 7975 m 17973 7975 l 17973 8025 l 17922 8025 l 17922 7975 l p ef -18024 7975 m 18075 7975 l 18075 8025 l 18024 8025 l 18024 7975 l p ef -18126 7975 m 18177 7975 l 18177 8025 l 18126 8025 l 18126 7975 l p ef -18228 7975 m 18279 7975 l 18279 8025 l 18228 8025 l 18228 7975 l p ef -18330 7975 m 18381 7975 l 18381 8025 l 18330 8025 l 18330 7975 l p ef -18432 7975 m 18483 7975 l 18483 8025 l 18432 8025 l 18432 7975 l p ef -18534 7975 m 18585 7975 l 18585 8025 l 18534 8025 l 18534 7975 l p ef -18636 7975 m 18687 7975 l 18687 8025 l 18636 8025 l 18636 7975 l p ef -18738 7975 m 18789 7975 l 18789 8025 l 18738 8025 l 18738 7975 l p ef -18840 7975 m 18891 7975 l 18891 8025 l 18840 8025 l 18840 7975 l p ef -18942 7975 m 18993 7975 l 18993 8025 l 18942 8025 l 18942 7975 l p ef -19044 7975 m 19095 7975 l 19095 8025 l 19044 8025 l 19044 7975 l p ef -19146 7975 m 19197 7975 l 19197 8025 l 19146 8025 l 19146 7975 l p ef -19248 7975 m 19299 7975 l 19299 8025 l 19248 8025 l 19248 7975 l p ef -19350 7975 m 19401 7975 l 19401 8025 l 19350 8025 l 19350 7975 l p ef -19452 7975 m 19503 7975 l 19503 8025 l 19452 8025 l 19452 7975 l p ef -19554 7975 m 19605 7975 l 19605 8025 l 19554 8025 l 19554 7975 l p ef -19656 7975 m 19707 7975 l 19707 8025 l 19656 8025 l 19656 7975 l p ef -19758 7975 m 19800 7975 l 19800 8000 l 19800 8025 l 19758 8025 l 19758 8000 l -19758 7975 l p ef -19800 8000 m 19800 7975 l 19804 7975 l 19809 7977 l 19812 7978 l 19816 7981 l -19819 7984 l 19822 7987 l 19823 7991 l 19825 7996 l 19825 8000 l 19825 8000 l -19800 8000 l p ef -19825 8000 m 19825 8009 l 19800 8009 l 19775 8009 l 19775 8000 l 19800 8000 l -19825 8000 l p ef -19825 8060 m 19825 8111 l 19775 8111 l 19775 8060 l 19825 8060 l p ef -19825 8162 m 19825 8213 l 19775 8213 l 19775 8162 l 19825 8162 l p ef -19825 8264 m 19825 8315 l 19775 8315 l 19775 8264 l 19825 8264 l p ef -19825 8366 m 19825 8417 l 19775 8417 l 19775 8366 l 19825 8366 l p ef -19825 8468 m 19825 8519 l 19775 8519 l 19775 8468 l 19825 8468 l p ef -19825 8570 m 19825 8621 l 19775 8621 l 19775 8570 l 19825 8570 l p ef -19825 8672 m 19825 8723 l 19775 8723 l 19775 8672 l 19825 8672 l p ef -19825 8774 m 19825 8825 l 19775 8825 l 19775 8774 l 19825 8774 l p ef -19825 8876 m 19825 8927 l 19775 8927 l 19775 8876 l 19825 8876 l p ef -19825 8978 m 19825 9029 l 19775 9029 l 19775 8978 l 19825 8978 l p ef -19825 9080 m 19825 9131 l 19775 9131 l 19775 9080 l 19825 9080 l p ef -19825 9182 m 19825 9233 l 19775 9233 l 19775 9182 l 19825 9182 l p ef -19825 9284 m 19825 9335 l 19775 9335 l 19775 9284 l 19825 9284 l p ef -19825 9386 m 19825 9437 l 19775 9437 l 19775 9386 l 19825 9386 l p ef -19825 9488 m 19825 9500 l 19800 9500 l 19775 9500 l 19775 9488 l 19800 9488 l -19825 9488 l p ef -19800 9500 m 19825 9500 l 19825 9504 l 19823 9509 l 19822 9512 l 19819 9516 l -19816 9519 l 19813 9522 l 19809 9523 l 19804 9525 l 19800 9525 l 19800 9525 l -19800 9500 l p ef -19800 9525 m 19761 9525 l 19761 9500 l 19761 9475 l 19800 9475 l 19800 9500 l -19800 9525 l p ef -19710 9525 m 19659 9525 l 19659 9475 l 19710 9475 l 19710 9525 l p ef -19608 9525 m 19557 9525 l 19557 9475 l 19608 9475 l 19608 9525 l p ef -19506 9525 m 19455 9525 l 19455 9475 l 19506 9475 l 19506 9525 l p ef -19404 9525 m 19353 9525 l 19353 9475 l 19404 9475 l 19404 9525 l p ef -19302 9525 m 19251 9525 l 19251 9475 l 19302 9475 l 19302 9525 l p ef -19200 9525 m 19149 9525 l 19149 9475 l 19200 9475 l 19200 9525 l p ef -19098 9525 m 19047 9525 l 19047 9475 l 19098 9475 l 19098 9525 l p ef -18996 9525 m 18945 9525 l 18945 9475 l 18996 9475 l 18996 9525 l p ef -18894 9525 m 18843 9525 l 18843 9475 l 18894 9475 l 18894 9525 l p ef -18792 9525 m 18741 9525 l 18741 9475 l 18792 9475 l 18792 9525 l p ef -18690 9525 m 18639 9525 l 18639 9475 l 18690 9475 l 18690 9525 l p ef -18588 9525 m 18537 9525 l 18537 9475 l 18588 9475 l 18588 9525 l p ef -18486 9525 m 18435 9525 l 18435 9475 l 18486 9475 l 18486 9525 l p ef -18384 9525 m 18333 9525 l 18333 9475 l 18384 9475 l 18384 9525 l p ef -18282 9525 m 18231 9525 l 18231 9475 l 18282 9475 l 18282 9525 l p ef -18180 9525 m 18129 9525 l 18129 9475 l 18180 9475 l 18180 9525 l p ef -18078 9525 m 18027 9525 l 18027 9475 l 18078 9475 l 18078 9525 l p ef -17976 9525 m 17925 9525 l 17925 9475 l 17976 9475 l 17976 9525 l p ef -17874 9525 m 17823 9525 l 17823 9475 l 17874 9475 l 17874 9525 l p ef -17772 9525 m 17721 9525 l 17721 9475 l 17772 9475 l 17772 9525 l p ef -17670 9525 m 17619 9525 l 17619 9475 l 17670 9475 l 17670 9525 l p ef -gs -gs -pum -15705 8974 t -49 0 m 49 -455 l 220 -455 l 251 -455 274 -454 290 -451 ct 312 -447 331 -440 346 -429 ct -361 -419 373 -404 382 -385 ct 391 -367 396 -346 396 -323 ct 396 -285 384 -252 359 -225 ct -334 -198 290 -185 226 -185 ct 109 -185 l 109 0 l 49 0 l p -109 -239 m 227 -239 l 266 -239 293 -246 309 -260 ct 326 -275 334 -295 334 -322 ct -334 -341 329 -357 320 -370 ct 310 -384 297 -393 282 -397 ct 271 -400 253 -401 225 -401 ct -109 -401 l 109 -239 l p ef -464 0 m 464 -330 l 514 -330 l 514 -280 l 527 -303 539 -318 550 -326 ct -561 -333 573 -337 586 -337 ct 605 -337 624 -331 643 -319 ct 624 -267 l 610 -275 597 -279 583 -279 ct -571 -279 560 -276 550 -268 ct 540 -261 533 -251 529 -238 ct 523 -218 520 -196 520 -173 ct -520 0 l 464 0 l p ef -902 -107 m 960 -99 l 951 -66 934 -40 909 -21 ct 885 -2 853 7 815 7 ct 767 7 729 -8 701 -37 ct -672 -67 658 -109 658 -162 ct 658 -218 673 -261 701 -291 ct 730 -322 767 -337 812 -337 ct -856 -337 892 -322 920 -292 ct 948 -262 962 -220 962 -166 ct 962 -163 962 -158 961 -151 ct -716 -151 l 718 -115 728 -87 747 -68 ct 765 -49 788 -39 815 -39 ct 836 -39 853 -44 868 -55 ct -882 -66 894 -83 902 -107 ct p -719 -197 m 903 -197 l 900 -225 893 -245 882 -259 ct 864 -280 841 -291 813 -291 ct -787 -291 765 -283 748 -265 ct 731 -248 721 -226 719 -197 ct p ef -1028 126 m 1028 -330 l 1079 -330 l 1079 -287 l 1091 -304 1104 -316 1119 -324 ct -1134 -333 1153 -337 1174 -337 ct 1202 -337 1227 -330 1249 -315 ct 1270 -301 1286 -280 1297 -254 ct -1308 -228 1314 -199 1314 -167 ct 1314 -134 1308 -103 1296 -77 ct 1284 -50 1266 -29 1243 -15 ct -1220 0 1196 7 1170 7 ct 1152 7 1135 3 1120 -5 ct 1105 -13 1093 -23 1084 -35 ct -1084 126 l 1028 126 l p -1078 -163 m 1078 -121 1087 -90 1104 -69 ct 1121 -49 1142 -39 1166 -39 ct 1191 -39 1213 -49 1230 -70 ct -1248 -91 1257 -124 1257 -168 ct 1257 -210 1248 -241 1231 -262 ct 1214 -283 1193 -293 1169 -293 ct -1145 -293 1124 -282 1106 -260 ct 1088 -238 1078 -205 1078 -163 ct p ef -1379 0 m 1379 -330 l 1429 -330 l 1429 -280 l 1442 -303 1454 -318 1465 -326 ct -1476 -333 1488 -337 1501 -337 ct 1520 -337 1539 -331 1558 -319 ct 1539 -267 l -1525 -275 1512 -279 1498 -279 ct 1486 -279 1475 -276 1465 -268 ct 1455 -261 1448 -251 1444 -238 ct -1438 -218 1435 -196 1435 -173 ct 1435 0 l 1379 0 l p ef -1570 -165 m 1570 -226 1587 -271 1621 -301 ct 1649 -325 1684 -337 1725 -337 ct -1770 -337 1807 -322 1835 -293 ct 1864 -263 1879 -222 1879 -170 ct 1879 -127 1872 -94 1860 -70 ct -1847 -45 1828 -27 1804 -13 ct 1780 0 1753 7 1725 7 ct 1678 7 1641 -8 1613 -37 ct -1584 -67 1570 -110 1570 -165 ct p -1627 -165 m 1627 -123 1637 -91 1655 -70 ct 1673 -49 1697 -39 1725 -39 ct 1752 -39 1775 -49 1794 -71 ct -1812 -92 1821 -124 1821 -167 ct 1821 -208 1812 -239 1793 -260 ct 1775 -281 1752 -291 1725 -291 ct -1697 -291 1673 -281 1655 -260 ct 1637 -239 1627 -207 1627 -165 ct p ef -2158 -121 m 2213 -114 l 2207 -76 2191 -46 2167 -25 ct 2142 -4 2112 7 2076 7 ct -2031 7 1994 -8 1967 -37 ct 1940 -67 1926 -109 1926 -164 ct 1926 -199 1932 -230 1943 -257 ct -1955 -284 1973 -304 1997 -317 ct 2021 -330 2048 -337 2076 -337 ct 2112 -337 2141 -328 2164 -310 ct -2186 -292 2201 -266 2207 -233 ct 2153 -224 l 2148 -247 2139 -263 2126 -274 ct -2113 -286 2097 -291 2078 -291 ct 2050 -291 2027 -281 2010 -261 ct 1992 -241 1983 -209 1983 -165 ct -1983 -121 1992 -89 2009 -69 ct 2026 -49 2048 -39 2075 -39 ct 2097 -39 2115 -46 2130 -59 ct -2145 -72 2154 -93 2158 -121 ct p ef -2485 -107 m 2543 -99 l 2534 -66 2517 -40 2492 -21 ct 2468 -2 2436 7 2398 7 ct -2350 7 2312 -8 2284 -37 ct 2255 -67 2241 -109 2241 -162 ct 2241 -218 2256 -261 2284 -291 ct -2313 -322 2350 -337 2395 -337 ct 2439 -337 2475 -322 2503 -292 ct 2531 -262 2545 -220 2545 -166 ct -2545 -163 2545 -158 2544 -151 ct 2299 -151 l 2301 -115 2311 -87 2330 -68 ct -2348 -49 2371 -39 2398 -39 ct 2419 -39 2436 -44 2451 -55 ct 2465 -66 2477 -83 2485 -107 ct -p -2302 -197 m 2486 -197 l 2483 -225 2476 -245 2465 -259 ct 2447 -280 2424 -291 2396 -291 ct -2370 -291 2348 -283 2331 -265 ct 2314 -248 2304 -226 2302 -197 ct p ef -2590 -99 m 2645 -107 l 2648 -85 2656 -68 2671 -57 ct 2685 -45 2705 -39 2730 -39 ct -2756 -39 2775 -44 2787 -55 ct 2799 -65 2806 -77 2806 -91 ct 2806 -104 2800 -114 2789 -121 ct -2782 -126 2763 -132 2732 -140 ct 2691 -150 2663 -159 2647 -167 ct 2631 -174 2619 -185 2611 -198 ct -2603 -211 2599 -226 2599 -242 ct 2599 -257 2602 -270 2609 -283 ct 2616 -295 2625 -306 2636 -314 ct -2645 -320 2657 -326 2672 -330 ct 2687 -335 2703 -337 2720 -337 ct 2746 -337 2769 -333 2788 -326 ct -2808 -318 2822 -308 2831 -296 ct 2841 -283 2847 -266 2851 -245 ct 2796 -237 l -2794 -254 2786 -267 2774 -277 ct 2763 -286 2746 -291 2724 -291 ct 2698 -291 2680 -287 2669 -278 ct -2658 -270 2653 -260 2653 -249 ct 2653 -241 2655 -235 2660 -229 ct 2664 -223 2671 -218 2681 -214 ct -2687 -212 2703 -207 2730 -200 ct 2770 -189 2797 -181 2813 -174 ct 2829 -167 2841 -158 2850 -145 ct -2859 -132 2863 -116 2863 -97 ct 2863 -79 2858 -61 2847 -45 ct 2836 -28 2820 -15 2800 -6 ct -2779 3 2756 7 2730 7 ct 2688 7 2655 -2 2632 -20 ct 2610 -37 2596 -64 2590 -99 ct -p ef -2907 -99 m 2962 -107 l 2965 -85 2973 -68 2988 -57 ct 3002 -45 3022 -39 3047 -39 ct -3073 -39 3092 -44 3104 -55 ct 3116 -65 3123 -77 3123 -91 ct 3123 -104 3117 -114 3106 -121 ct -3099 -126 3080 -132 3049 -140 ct 3008 -150 2980 -159 2964 -167 ct 2948 -174 2936 -185 2928 -198 ct -2920 -211 2916 -226 2916 -242 ct 2916 -257 2919 -270 2926 -283 ct 2933 -295 2942 -306 2953 -314 ct -2962 -320 2974 -326 2989 -330 ct 3004 -335 3020 -337 3037 -337 ct 3063 -337 3086 -333 3105 -326 ct -3125 -318 3139 -308 3148 -296 ct 3158 -283 3164 -266 3168 -245 ct 3113 -237 l -3111 -254 3103 -267 3091 -277 ct 3080 -286 3063 -291 3041 -291 ct 3015 -291 2997 -287 2986 -278 ct -2975 -270 2970 -260 2970 -249 ct 2970 -241 2972 -235 2977 -229 ct 2981 -223 2988 -218 2998 -214 ct -3004 -212 3020 -207 3047 -200 ct 3087 -189 3114 -181 3130 -174 ct 3146 -167 3158 -158 3167 -145 ct -3176 -132 3180 -116 3180 -97 ct 3180 -79 3175 -61 3164 -45 ct 3153 -28 3137 -15 3117 -6 ct -3096 3 3073 7 3047 7 ct 3005 7 2972 -2 2949 -20 ct 2927 -37 2913 -64 2907 -99 ct -p ef -3226 -165 m 3226 -226 3243 -271 3277 -301 ct 3305 -325 3340 -337 3381 -337 ct -3426 -337 3463 -322 3491 -293 ct 3520 -263 3535 -222 3535 -170 ct 3535 -127 3528 -94 3516 -70 ct -3503 -45 3484 -27 3460 -13 ct 3436 0 3409 7 3381 7 ct 3334 7 3297 -8 3269 -37 ct -3240 -67 3226 -110 3226 -165 ct p -3283 -165 m 3283 -123 3293 -91 3311 -70 ct 3329 -49 3353 -39 3381 -39 ct 3408 -39 3431 -49 3450 -71 ct -3468 -92 3477 -124 3477 -167 ct 3477 -208 3468 -239 3449 -260 ct 3431 -281 3408 -291 3381 -291 ct -3353 -291 3329 -281 3311 -260 ct 3293 -239 3283 -207 3283 -165 ct p ef -3597 0 m 3597 -330 l 3647 -330 l 3647 -280 l 3660 -303 3672 -318 3683 -326 ct -3694 -333 3706 -337 3719 -337 ct 3738 -337 3757 -331 3776 -319 ct 3757 -267 l -3743 -275 3730 -279 3716 -279 ct 3704 -279 3693 -276 3683 -268 ct 3673 -261 3666 -251 3662 -238 ct -3656 -218 3653 -196 3653 -173 ct 3653 0 l 3597 0 l p ef -pom -gr -gr -4400 13500 m 2900 13500 l 2900 12000 l 5900 12000 l 5900 13500 l 4400 13500 l -pc -gs -gs -pum -3122 12970 t -49 0 m 49 -455 l 220 -455 l 251 -455 274 -454 290 -451 ct 312 -447 331 -440 346 -429 ct -361 -419 373 -404 382 -385 ct 391 -367 396 -346 396 -323 ct 396 -285 384 -252 359 -225 ct -334 -198 290 -185 226 -185 ct 109 -185 l 109 0 l 49 0 l p -109 -239 m 227 -239 l 266 -239 293 -246 309 -260 ct 326 -275 334 -295 334 -322 ct -334 -341 329 -357 320 -370 ct 310 -384 297 -393 282 -397 ct 271 -400 253 -401 225 -401 ct -109 -401 l 109 -239 l p ef -464 0 m 464 -455 l 519 -455 l 519 0 l 464 0 l p ef -820 -41 m 799 -24 779 -11 760 -4 ct 741 3 720 7 699 7 ct 662 7 635 -2 615 -20 ct -596 -37 586 -60 586 -87 ct 586 -103 590 -118 597 -131 ct 604 -145 614 -156 626 -164 ct -638 -172 651 -178 666 -182 ct 677 -185 693 -188 716 -190 ct 761 -196 794 -202 815 -209 ct -815 -217 815 -222 815 -224 ct 815 -247 810 -263 800 -272 ct 785 -285 764 -291 736 -291 ct -710 -291 690 -286 678 -277 ct 665 -268 656 -252 650 -228 ct 596 -236 l 601 -259 609 -278 620 -292 ct -631 -307 648 -318 669 -326 ct 691 -333 716 -337 744 -337 ct 772 -337 795 -334 813 -327 ct -830 -321 843 -312 851 -302 ct 860 -292 865 -280 869 -264 ct 871 -255 872 -238 872 -213 ct -872 -138 l 872 -87 873 -54 875 -40 ct 877 -26 882 -13 889 0 ct 831 0 l 825 -12 821 -26 820 -41 ct -p -815 -166 m 795 -157 764 -150 724 -145 ct 701 -141 685 -138 675 -133 ct 666 -129 658 -123 653 -115 ct -648 -107 645 -99 645 -89 ct 645 -74 651 -62 662 -52 ct 674 -42 690 -37 712 -37 ct -733 -37 752 -41 769 -51 ct 786 -60 798 -73 806 -89 ct 812 -102 815 -121 815 -145 ct -815 -166 l p ef -953 127 m 947 75 l 959 78 970 80 979 80 ct 992 80 1001 78 1009 73 ct 1016 69 1022 64 1027 56 ct -1031 51 1036 37 1044 15 ct 1045 11 1047 7 1049 1 ct 924 -330 l 984 -330 l 1053 -139 l -1062 -114 1070 -89 1077 -62 ct 1083 -88 1091 -113 1100 -137 ct 1170 -330 l 1226 -330 l -1101 6 l 1087 42 1077 67 1069 81 ct 1059 99 1048 113 1035 121 ct 1022 130 1007 134 989 134 ct -979 134 967 132 953 127 ct p ef -1316 0 m 1265 0 l 1265 -455 l 1320 -455 l 1320 -293 l 1344 -322 1374 -337 1411 -337 ct -1431 -337 1450 -333 1468 -325 ct 1486 -317 1501 -305 1513 -290 ct 1524 -276 1534 -258 1540 -237 ct -1547 -216 1550 -194 1550 -170 ct 1550 -114 1536 -70 1508 -39 ct 1480 -8 1447 7 1408 7 ct -1369 7 1338 -9 1316 -42 ct 1316 0 l p -1316 -167 m 1316 -128 1321 -100 1332 -82 ct 1349 -53 1373 -39 1403 -39 ct 1428 -39 1449 -50 1466 -71 ct -1484 -92 1493 -123 1493 -165 ct 1493 -208 1485 -240 1467 -260 ct 1450 -281 1430 -291 1406 -291 ct -1381 -291 1360 -281 1342 -259 ct 1325 -238 1316 -208 1316 -167 ct p ef -1832 -41 m 1811 -24 1791 -11 1772 -4 ct 1753 3 1732 7 1711 7 ct 1674 7 1647 -2 1627 -20 ct -1608 -37 1598 -60 1598 -87 ct 1598 -103 1602 -118 1609 -131 ct 1616 -145 1626 -156 1638 -164 ct -1650 -172 1663 -178 1678 -182 ct 1689 -185 1705 -188 1728 -190 ct 1773 -196 1806 -202 1827 -209 ct -1827 -217 1827 -222 1827 -224 ct 1827 -247 1822 -263 1812 -272 ct 1797 -285 1776 -291 1748 -291 ct -1722 -291 1702 -286 1690 -277 ct 1677 -268 1668 -252 1662 -228 ct 1608 -236 l -1613 -259 1621 -278 1632 -292 ct 1643 -307 1660 -318 1681 -326 ct 1703 -333 1728 -337 1756 -337 ct -1784 -337 1807 -334 1825 -327 ct 1842 -321 1855 -312 1863 -302 ct 1872 -292 1877 -280 1881 -264 ct -1883 -255 1884 -238 1884 -213 ct 1884 -138 l 1884 -87 1885 -54 1887 -40 ct -1889 -26 1894 -13 1901 0 ct 1843 0 l 1837 -12 1833 -26 1832 -41 ct p -1827 -166 m 1807 -157 1776 -150 1736 -145 ct 1713 -141 1697 -138 1687 -133 ct -1678 -129 1670 -123 1665 -115 ct 1660 -107 1657 -99 1657 -89 ct 1657 -74 1663 -62 1674 -52 ct -1686 -42 1702 -37 1724 -37 ct 1745 -37 1764 -41 1781 -51 ct 1798 -60 1810 -73 1818 -89 ct -1824 -102 1827 -121 1827 -145 ct 1827 -166 l p ef -2183 -121 m 2238 -114 l 2232 -76 2216 -46 2192 -25 ct 2167 -4 2137 7 2101 7 ct -2056 7 2019 -8 1992 -37 ct 1965 -67 1951 -109 1951 -164 ct 1951 -199 1957 -230 1968 -257 ct -1980 -284 1998 -304 2022 -317 ct 2046 -330 2073 -337 2101 -337 ct 2137 -337 2166 -328 2189 -310 ct -2211 -292 2226 -266 2232 -233 ct 2178 -224 l 2173 -247 2164 -263 2151 -274 ct -2138 -286 2122 -291 2103 -291 ct 2075 -291 2052 -281 2035 -261 ct 2017 -241 2008 -209 2008 -165 ct -2008 -121 2017 -89 2034 -69 ct 2051 -49 2073 -39 2100 -39 ct 2122 -39 2140 -46 2155 -59 ct -2170 -72 2179 -93 2183 -121 ct p ef -2286 0 m 2286 -455 l 2342 -455 l 2342 -196 l 2474 -330 l 2546 -330 l -2420 -207 l 2559 0 l 2490 0 l 2381 -169 l 2342 -131 l 2342 0 l 2286 0 l -p ef -pom -gr -gr -22600 9500 m 21100 9500 l 21100 8000 l 24100 8000 l 24100 9500 l 22600 9500 l -pc -gs -gs -pum -21425 8974 t -50 0 m 50 -455 l 379 -455 l 379 -401 l 110 -401 l 110 -262 l 362 -262 l -362 -209 l 110 -209 l 110 -54 l 389 -54 l 389 0 l 50 0 l p ef -465 0 m 465 -330 l 515 -330 l 515 -283 l 539 -319 574 -337 620 -337 ct -640 -337 658 -333 675 -326 ct 691 -319 704 -310 712 -298 ct 720 -287 726 -273 729 -257 ct -731 -247 732 -229 732 -203 ct 732 0 l 677 0 l 677 -200 l 677 -223 674 -240 670 -252 ct -666 -263 658 -272 647 -279 ct 636 -285 623 -289 608 -289 ct 584 -289 564 -281 547 -266 ct -529 -251 521 -222 521 -180 ct 521 0 l 465 0 l p ef -1032 -121 m 1087 -114 l 1081 -76 1065 -46 1041 -25 ct 1016 -4 986 7 950 7 ct -905 7 868 -8 841 -37 ct 814 -67 800 -109 800 -164 ct 800 -199 806 -230 817 -257 ct -829 -284 847 -304 871 -317 ct 895 -330 922 -337 950 -337 ct 986 -337 1015 -328 1038 -310 ct -1060 -292 1075 -266 1081 -233 ct 1027 -224 l 1022 -247 1013 -263 1000 -274 ct -987 -286 971 -291 952 -291 ct 924 -291 901 -281 884 -261 ct 866 -241 857 -209 857 -165 ct -857 -121 866 -89 883 -69 ct 900 -49 922 -39 949 -39 ct 971 -39 989 -46 1004 -59 ct -1019 -72 1028 -93 1032 -121 ct p ef -1113 -165 m 1113 -226 1130 -271 1164 -301 ct 1192 -325 1227 -337 1268 -337 ct -1313 -337 1350 -322 1378 -293 ct 1407 -263 1422 -222 1422 -170 ct 1422 -127 1415 -94 1403 -70 ct -1390 -45 1371 -27 1347 -13 ct 1323 0 1296 7 1268 7 ct 1221 7 1184 -8 1156 -37 ct -1127 -67 1113 -110 1113 -165 ct p -1170 -165 m 1170 -123 1180 -91 1198 -70 ct 1216 -49 1240 -39 1268 -39 ct 1295 -39 1318 -49 1337 -71 ct -1355 -92 1364 -124 1364 -167 ct 1364 -208 1355 -239 1336 -260 ct 1318 -281 1295 -291 1268 -291 ct -1240 -291 1216 -281 1198 -260 ct 1180 -239 1170 -207 1170 -165 ct p ef -1699 0 m 1699 -42 l 1679 -9 1648 7 1607 7 ct 1581 7 1557 0 1535 -15 ct 1513 -29 1496 -49 1484 -75 ct -1472 -101 1466 -131 1466 -165 ct 1466 -198 1471 -228 1482 -254 ct 1493 -281 1510 -302 1531 -316 ct -1553 -330 1578 -337 1605 -337 ct 1625 -337 1642 -333 1658 -325 ct 1673 -316 1686 -305 1696 -292 ct -1696 -455 l 1751 -455 l 1751 0 l 1699 0 l p -1523 -165 m 1523 -123 1532 -91 1550 -70 ct 1568 -49 1588 -39 1613 -39 ct 1637 -39 1658 -49 1675 -69 ct -1692 -89 1700 -119 1700 -160 ct 1700 -205 1692 -238 1674 -259 ct 1657 -280 1636 -291 1610 -291 ct -1585 -291 1565 -281 1548 -261 ct 1531 -240 1523 -208 1523 -165 ct p ef -2062 -107 m 2120 -99 l 2111 -66 2094 -40 2069 -21 ct 2045 -2 2013 7 1975 7 ct -1927 7 1889 -8 1861 -37 ct 1832 -67 1818 -109 1818 -162 ct 1818 -218 1833 -261 1861 -291 ct -1890 -322 1927 -337 1972 -337 ct 2016 -337 2052 -322 2080 -292 ct 2108 -262 2122 -220 2122 -166 ct -2122 -163 2122 -158 2121 -151 ct 1876 -151 l 1878 -115 1888 -87 1907 -68 ct -1925 -49 1948 -39 1975 -39 ct 1996 -39 2013 -44 2028 -55 ct 2042 -66 2054 -83 2062 -107 ct -p -1879 -197 m 2063 -197 l 2060 -225 2053 -245 2042 -259 ct 2024 -280 2001 -291 1973 -291 ct -1947 -291 1925 -283 1908 -265 ct 1891 -248 1881 -226 1879 -197 ct p ef -2187 0 m 2187 -330 l 2237 -330 l 2237 -280 l 2250 -303 2262 -318 2273 -326 ct -2284 -333 2296 -337 2309 -337 ct 2328 -337 2347 -331 2366 -319 ct 2347 -267 l -2333 -275 2320 -279 2306 -279 ct 2294 -279 2283 -276 2273 -268 ct 2263 -261 2256 -251 2252 -238 ct -2246 -218 2243 -196 2243 -173 ct 2243 0 l 2187 0 l p ef -pom -gr -gr -17400 13500 m 15900 13500 l 15900 12000 l 18900 12000 l 18900 13500 l -17400 13500 l pc -gs -gs -pum -16195 12970 t -49 0 m 49 -455 l 206 -455 l 241 -455 268 -453 287 -448 ct 313 -442 335 -432 353 -416 ct -377 -396 395 -370 407 -338 ct 419 -307 425 -271 425 -230 ct 425 -195 421 -165 413 -138 ct -405 -111 394 -89 382 -72 ct 369 -54 355 -41 340 -31 ct 325 -21 307 -13 286 -8 ct -265 -3 241 0 213 0 ct 49 0 l p -109 -54 m 206 -54 l 236 -54 260 -56 277 -62 ct 294 -68 307 -76 318 -86 ct -332 -100 343 -119 351 -143 ct 359 -167 363 -197 363 -231 ct 363 -279 355 -315 339 -341 ct -324 -366 305 -383 282 -392 ct 266 -398 240 -401 205 -401 ct 109 -401 l 109 -54 l -p ef -724 -107 m 782 -99 l 773 -66 756 -40 731 -21 ct 707 -2 675 7 637 7 ct 589 7 551 -8 523 -37 ct -494 -67 480 -109 480 -162 ct 480 -218 495 -261 523 -291 ct 552 -322 589 -337 634 -337 ct -678 -337 714 -322 742 -292 ct 770 -262 784 -220 784 -166 ct 784 -163 784 -158 783 -151 ct -538 -151 l 540 -115 550 -87 569 -68 ct 587 -49 610 -39 637 -39 ct 658 -39 675 -44 690 -55 ct -704 -66 716 -83 724 -107 ct p -541 -197 m 725 -197 l 722 -225 715 -245 704 -259 ct 686 -280 663 -291 635 -291 ct -609 -291 587 -283 570 -265 ct 553 -248 543 -226 541 -197 ct p ef -1066 -121 m 1121 -114 l 1115 -76 1099 -46 1075 -25 ct 1050 -4 1020 7 984 7 ct -939 7 902 -8 875 -37 ct 848 -67 834 -109 834 -164 ct 834 -199 840 -230 851 -257 ct -863 -284 881 -304 905 -317 ct 929 -330 956 -337 984 -337 ct 1020 -337 1049 -328 1072 -310 ct -1094 -292 1109 -266 1115 -233 ct 1061 -224 l 1056 -247 1047 -263 1034 -274 ct -1021 -286 1005 -291 986 -291 ct 958 -291 935 -281 918 -261 ct 900 -241 891 -209 891 -165 ct -891 -121 900 -89 917 -69 ct 934 -49 956 -39 983 -39 ct 1005 -39 1023 -46 1038 -59 ct -1053 -72 1062 -93 1066 -121 ct p ef -1147 -165 m 1147 -226 1164 -271 1198 -301 ct 1226 -325 1261 -337 1302 -337 ct -1347 -337 1384 -322 1412 -293 ct 1441 -263 1456 -222 1456 -170 ct 1456 -127 1449 -94 1437 -70 ct -1424 -45 1405 -27 1381 -13 ct 1357 0 1330 7 1302 7 ct 1255 7 1218 -8 1190 -37 ct -1161 -67 1147 -110 1147 -165 ct p -1204 -165 m 1204 -123 1214 -91 1232 -70 ct 1250 -49 1274 -39 1302 -39 ct 1329 -39 1352 -49 1371 -71 ct -1389 -92 1398 -124 1398 -167 ct 1398 -208 1389 -239 1370 -260 ct 1352 -281 1329 -291 1302 -291 ct -1274 -291 1250 -281 1232 -260 ct 1214 -239 1204 -207 1204 -165 ct p ef -1732 0 m 1732 -42 l 1712 -9 1681 7 1640 7 ct 1614 7 1590 0 1568 -15 ct 1546 -29 1529 -49 1517 -75 ct -1505 -101 1499 -131 1499 -165 ct 1499 -198 1504 -228 1515 -254 ct 1526 -281 1543 -302 1564 -316 ct -1586 -330 1611 -337 1638 -337 ct 1658 -337 1675 -333 1691 -325 ct 1706 -316 1719 -305 1729 -292 ct -1729 -455 l 1784 -455 l 1784 0 l 1732 0 l p -1556 -165 m 1556 -123 1565 -91 1583 -70 ct 1601 -49 1621 -39 1646 -39 ct 1670 -39 1691 -49 1708 -69 ct -1725 -89 1733 -119 1733 -160 ct 1733 -205 1725 -238 1707 -259 ct 1690 -280 1669 -291 1643 -291 ct -1618 -291 1598 -281 1581 -261 ct 1564 -240 1556 -208 1556 -165 ct p ef -2096 -107 m 2154 -99 l 2145 -66 2128 -40 2103 -21 ct 2079 -2 2047 7 2009 7 ct -1961 7 1923 -8 1895 -37 ct 1866 -67 1852 -109 1852 -162 ct 1852 -218 1867 -261 1895 -291 ct -1924 -322 1961 -337 2006 -337 ct 2050 -337 2086 -322 2114 -292 ct 2142 -262 2156 -220 2156 -166 ct -2156 -163 2156 -158 2155 -151 ct 1910 -151 l 1912 -115 1922 -87 1941 -68 ct -1959 -49 1982 -39 2009 -39 ct 2030 -39 2047 -44 2062 -55 ct 2076 -66 2088 -83 2096 -107 ct -p -1913 -197 m 2097 -197 l 2094 -225 2087 -245 2076 -259 ct 2058 -280 2035 -291 2007 -291 ct -1981 -291 1959 -283 1942 -265 ct 1925 -248 1915 -226 1913 -197 ct p ef -2221 0 m 2221 -330 l 2271 -330 l 2271 -280 l 2284 -303 2296 -318 2307 -326 ct -2318 -333 2330 -337 2343 -337 ct 2362 -337 2381 -331 2400 -319 ct 2381 -267 l -2367 -275 2354 -279 2340 -279 ct 2328 -279 2317 -276 2307 -268 ct 2297 -261 2290 -251 2286 -238 ct -2280 -218 2277 -196 2277 -173 ct 2277 0 l 2221 0 l p ef -pom -gr -gr -22600 13500 m 21100 13500 l 21100 12000 l 24100 12000 l 24100 13500 l -22600 13500 l pc -gs -gs -pum -21916 12626 t -18 -129 m 73 -136 l 74 -102 81 -78 92 -65 ct 104 -52 120 -46 140 -46 ct 155 -46 168 -49 179 -56 ct -190 -63 198 -72 202 -84 ct 206 -96 208 -115 208 -141 ct 208 -455 l 268 -455 l -268 -145 l 268 -107 264 -77 254 -56 ct 245 -35 231 -19 211 -8 ct 191 3 167 8 140 8 ct -101 8 70 -3 49 -26 ct 28 -49 17 -84 18 -129 ct p ef -360 -391 m 360 -455 l 416 -455 l 416 -391 l 360 -391 l p -360 0 m 360 -330 l 416 -330 l 416 0 l 360 0 l p ef -621 -50 m 629 -1 l 613 2 599 4 587 4 ct 566 4 551 1 539 -6 ct 528 -12 520 -20 516 -31 ct -511 -41 509 -63 509 -97 ct 509 -287 l 468 -287 l 468 -330 l 509 -330 l -509 -412 l 565 -445 l 565 -330 l 621 -330 l 621 -287 l 565 -287 l -565 -94 l 565 -78 566 -68 568 -63 ct 570 -58 573 -55 577 -52 ct 582 -49 588 -48 596 -48 ct -602 -48 611 -49 621 -50 ct p ef -799 -50 m 807 -1 l 791 2 777 4 765 4 ct 744 4 729 1 717 -6 ct 706 -12 698 -20 694 -31 ct -689 -41 687 -63 687 -97 ct 687 -287 l 646 -287 l 646 -330 l 687 -330 l -687 -412 l 743 -445 l 743 -330 l 799 -330 l 799 -287 l 743 -287 l -743 -94 l 743 -78 744 -68 746 -63 ct 748 -58 751 -55 755 -52 ct 760 -49 766 -48 774 -48 ct -780 -48 789 -49 799 -50 ct p ef -1080 -107 m 1138 -99 l 1129 -66 1112 -40 1087 -21 ct 1063 -2 1031 7 993 7 ct -945 7 907 -8 879 -37 ct 850 -67 836 -109 836 -162 ct 836 -218 851 -261 879 -291 ct -908 -322 945 -337 990 -337 ct 1034 -337 1070 -322 1098 -292 ct 1126 -262 1140 -220 1140 -166 ct -1140 -163 1140 -158 1139 -151 ct 894 -151 l 896 -115 906 -87 925 -68 ct 943 -49 966 -39 993 -39 ct -1014 -39 1031 -44 1046 -55 ct 1060 -66 1072 -83 1080 -107 ct p -897 -197 m 1081 -197 l 1078 -225 1071 -245 1060 -259 ct 1042 -280 1019 -291 991 -291 ct -965 -291 943 -283 926 -265 ct 909 -248 899 -226 897 -197 ct p ef -1205 0 m 1205 -330 l 1255 -330 l 1255 -280 l 1268 -303 1280 -318 1291 -326 ct -1302 -333 1314 -337 1327 -337 ct 1346 -337 1365 -331 1384 -319 ct 1365 -267 l -1351 -275 1338 -279 1324 -279 ct 1312 -279 1301 -276 1291 -268 ct 1281 -261 1274 -251 1270 -238 ct -1264 -218 1261 -196 1261 -173 ct 1261 0 l 1205 0 l p ef -pom -gr -gs -pum -21764 13337 t -47 0 m 47 -455 l 217 -455 l 252 -455 280 -450 301 -441 ct 322 -432 338 -418 350 -399 ct -362 -380 368 -359 368 -339 ct 368 -319 362 -301 352 -284 ct 341 -266 325 -253 304 -242 ct -332 -234 353 -220 368 -201 ct 382 -181 390 -158 390 -132 ct 390 -111 385 -91 376 -72 ct -367 -54 356 -40 343 -30 ct 330 -20 313 -13 293 -8 ct 273 -3 249 0 220 0 ct 47 0 l -p -107 -264 m 205 -264 l 232 -264 251 -265 262 -269 ct 278 -274 289 -281 297 -292 ct -305 -302 309 -315 309 -331 ct 309 -347 305 -360 298 -371 ct 290 -383 280 -391 267 -395 ct -253 -399 230 -401 198 -401 ct 107 -401 l 107 -264 l p -107 -54 m 220 -54 l 239 -54 253 -54 261 -56 ct 275 -58 286 -62 295 -68 ct -305 -74 312 -82 318 -94 ct 324 -105 327 -117 327 -132 ct 327 -149 323 -164 314 -176 ct -306 -189 294 -197 278 -202 ct 263 -207 241 -210 212 -210 ct 107 -210 l 107 -54 l -p ef -681 0 m 681 -49 l 655 -12 620 7 576 7 ct 557 7 539 3 522 -4 ct 505 -12 492 -21 484 -32 ct -476 -44 470 -57 467 -74 ct 465 -85 464 -102 464 -126 ct 464 -330 l 519 -330 l -519 -147 l 519 -118 521 -98 523 -88 ct 526 -74 534 -62 545 -54 ct 557 -45 571 -41 587 -41 ct -604 -41 620 -45 634 -54 ct 649 -63 660 -74 666 -89 ct 672 -104 675 -125 675 -153 ct -675 -330 l 731 -330 l 731 0 l 681 0 l p ef -830 0 m 830 -286 l 781 -286 l 781 -329 l 830 -329 l 830 -364 l 830 -387 832 -403 836 -414 ct -841 -428 851 -440 864 -449 ct 878 -458 897 -462 921 -462 ct 937 -462 954 -460 973 -457 ct -965 -408 l 953 -410 943 -411 932 -411 ct 915 -411 903 -407 896 -400 ct 889 -393 886 -379 886 -360 ct -886 -329 l 950 -329 l 950 -286 l 886 -286 l 886 0 l 830 0 l p ef -995 0 m 995 -286 l 946 -286 l 946 -329 l 995 -329 l 995 -364 l 995 -387 997 -403 1001 -414 ct -1006 -428 1016 -440 1029 -449 ct 1043 -458 1062 -462 1086 -462 ct 1102 -462 1119 -460 1138 -457 ct -1130 -408 l 1118 -410 1108 -411 1097 -411 ct 1080 -411 1068 -407 1061 -400 ct -1054 -393 1051 -379 1051 -360 ct 1051 -329 l 1115 -329 l 1115 -286 l 1051 -286 l -1051 0 l 995 0 l p ef -1385 -107 m 1443 -99 l 1434 -66 1417 -40 1392 -21 ct 1368 -2 1336 7 1298 7 ct -1250 7 1212 -8 1184 -37 ct 1155 -67 1141 -109 1141 -162 ct 1141 -218 1156 -261 1184 -291 ct -1213 -322 1250 -337 1295 -337 ct 1339 -337 1375 -322 1403 -292 ct 1431 -262 1445 -220 1445 -166 ct -1445 -163 1445 -158 1444 -151 ct 1199 -151 l 1201 -115 1211 -87 1230 -68 ct -1248 -49 1271 -39 1298 -39 ct 1319 -39 1336 -44 1351 -55 ct 1365 -66 1377 -83 1385 -107 ct -p -1202 -197 m 1386 -197 l 1383 -225 1376 -245 1365 -259 ct 1347 -280 1324 -291 1296 -291 ct -1270 -291 1248 -283 1231 -265 ct 1214 -248 1204 -226 1202 -197 ct p ef -1510 0 m 1510 -330 l 1560 -330 l 1560 -280 l 1573 -303 1585 -318 1596 -326 ct -1607 -333 1619 -337 1632 -337 ct 1651 -337 1670 -331 1689 -319 ct 1670 -267 l -1656 -275 1643 -279 1629 -279 ct 1617 -279 1606 -276 1596 -268 ct 1586 -261 1579 -251 1575 -238 ct -1569 -218 1566 -196 1566 -173 ct 1566 0 l 1510 0 l p ef -pom -gr -gr -7100 8750 m 6538 8938 l 6538 8563 l 7100 8750 l p ef -5900 8725 m 6650 8725 l 6650 8775 l 5900 8775 l 5900 8725 l p ef -15400 8750 m 14838 8938 l 14838 8563 l 15400 8750 l p ef -14300 8725 m 14950 8725 l 14950 8775 l 14300 8775 l 14300 8725 l p ef -21100 8750 m 20538 8938 l 20538 8563 l 21100 8750 l p ef -19800 8725 m 20650 8725 l 20650 8775 l 19800 8775 l 19800 8725 l p ef -10500 12750 m 11063 12563 l 11063 12938 l 10500 12750 l p ef -15900 12775 m 10950 12775 l 10950 12725 l 15900 12725 l 15900 12775 l -p ef -18900 12750 m 19463 12563 l 19463 12938 l 18900 12750 l p ef -21100 12775 m 19350 12775 l 19350 12725 l 21100 12725 l 21100 12775 l -p ef -12850 9500 m 13038 10063 l 12663 10063 l 12850 9500 l p ef -15900 12775 m 12850 12775 l 12850 12750 l 12850 12725 l 15900 12725 l -15900 12750 l 15900 12775 l p ef -12850 12750 m 12850 12775 l 12846 12775 l 12841 12773 l 12838 12772 l -12834 12769 l 12831 12766 l 12828 12763 l 12827 12759 l 12825 12754 l -12825 12750 l 12825 12750 l 12850 12750 l p ef -12825 12750 m 12825 9950 l 12850 9950 l 12875 9950 l 12875 12750 l -12850 12750 l 12825 12750 l p ef -1225 13350 m 1000 13350 l 1000 12150 l 1450 12150 l 1450 13350 l 1225 13350 l -pc -500 14050 m 500 11549 l 1001 12175 l 1001 13425 l 500 14050 l pc -1450 12750 m 2013 12563 l 2013 12938 l 1450 12750 l p ef -2900 12775 m 1900 12775 l 1900 12725 l 2900 12725 l 2900 12775 l p ef -24100 12750 m 24663 12563 l 24663 12938 l 24100 12750 l p ef -25100 12775 m 24550 12775 l 24550 12725 l 25100 12725 l 25100 12775 l -p ef -25100 8750 m 24538 8938 l 24538 8563 l 25100 8750 l p ef -24100 8725 m 24650 8725 l 24650 8775 l 24100 8775 l 24100 8725 l p ef -1000 9250 m 724 9250 500 9026 500 8750 ct 500 8474 724 8250 1000 8250 ct 1276 8250 1500 8474 1500 8750 ct -1500 9026 1276 9250 1000 9250 ct pc -500 8250 m 500 9250 l ps -2900 8750 m 2338 8938 l 2338 8563 l 2900 8750 l p ef -1500 8724 m 2200 8724 l 2200 8749 l 2200 8774 l 1500 8774 l 1500 8749 l -1500 8724 l p ef -2200 8749 m 2200 8724 l 2204 8724 l 2209 8726 l 2212 8727 l 2216 8730 l -2219 8733 l 2222 8736 l 2223 8740 l 2225 8745 l 2225 8749 l 2225 8749 l -2200 8749 l p ef -2225 8749 m 2225 8750 l 2200 8750 l 2175 8750 l 2175 8749 l 2200 8749 l -2225 8749 l p ef -2200 8750 m 2200 8775 l 2196 8775 l 2191 8773 l 2188 8772 l 2184 8769 l -2181 8766 l 2178 8763 l 2177 8759 l 2175 8754 l 2175 8750 l 2175 8750 l -2200 8750 l p ef -2200 8725 m 2450 8725 l 2450 8750 l 2450 8775 l 2200 8775 l 2200 8750 l -2200 8725 l p ef -4400 9500 m 4588 10063 l 4213 10063 l 4400 9500 l p ef -4400 12000 m 4213 11438 l 4588 11438 l 4400 12000 l p ef -4425 9950 m 4425 11550 l 4375 11550 l 4375 9950 l 4425 9950 l p ef -8698 9525 m 8647 9525 l 8647 9475 l 8698 9475 l 8698 9525 l p ef -8596 9525 m 8545 9525 l 8545 9475 l 8596 9475 l 8596 9525 l p ef -8494 9525 m 8443 9525 l 8443 9475 l 8494 9475 l 8494 9525 l p ef -8392 9525 m 8341 9525 l 8341 9475 l 8392 9475 l 8392 9525 l p ef -8290 9525 m 8239 9525 l 8239 9475 l 8290 9475 l 8290 9525 l p ef -8188 9525 m 8137 9525 l 8137 9475 l 8188 9475 l 8188 9525 l p ef -8086 9525 m 8035 9525 l 8035 9475 l 8086 9475 l 8086 9525 l p ef -7984 9525 m 7933 9525 l 7933 9475 l 7984 9475 l 7984 9525 l p ef -7882 9525 m 7831 9525 l 7831 9475 l 7882 9475 l 7882 9525 l p ef -7780 9525 m 7729 9525 l 7729 9475 l 7780 9475 l 7780 9525 l p ef -7678 9525 m 7627 9525 l 7627 9475 l 7678 9475 l 7678 9525 l p ef -7576 9525 m 7525 9525 l 7525 9475 l 7576 9475 l 7576 9525 l p ef -7474 9525 m 7423 9525 l 7423 9475 l 7474 9475 l 7474 9525 l p ef -7372 9525 m 7321 9525 l 7321 9475 l 7372 9475 l 7372 9525 l p ef -7270 9525 m 7219 9525 l 7219 9475 l 7270 9475 l 7270 9525 l p ef -7168 9525 m 7117 9525 l 7117 9475 l 7168 9475 l 7168 9525 l p ef -7075 9466 m 7075 9415 l 7125 9415 l 7125 9466 l 7075 9466 l p ef -7075 9364 m 7075 9313 l 7125 9313 l 7125 9364 l 7075 9364 l p ef -7075 9262 m 7075 9211 l 7125 9211 l 7125 9262 l 7075 9262 l p ef -7075 9160 m 7075 9109 l 7125 9109 l 7125 9160 l 7075 9160 l p ef -7075 9058 m 7075 9007 l 7125 9007 l 7125 9058 l 7075 9058 l p ef -7075 8956 m 7075 8905 l 7125 8905 l 7125 8956 l 7075 8956 l p ef -7075 8854 m 7075 8803 l 7125 8803 l 7125 8854 l 7075 8854 l p ef -7075 8752 m 7075 8701 l 7125 8701 l 7125 8752 l 7075 8752 l p ef -7075 8650 m 7075 8599 l 7125 8599 l 7125 8650 l 7075 8650 l p ef -7075 8548 m 7075 8497 l 7125 8497 l 7125 8548 l 7075 8548 l p ef -7075 8446 m 7075 8395 l 7125 8395 l 7125 8446 l 7075 8446 l p ef -7075 8344 m 7075 8293 l 7125 8293 l 7125 8344 l 7075 8344 l p ef -7075 8242 m 7075 8191 l 7125 8191 l 7125 8242 l 7075 8242 l p ef -7075 8140 m 7075 8089 l 7125 8089 l 7125 8140 l 7075 8140 l p ef -7075 8038 m 7075 8000 l 7100 8000 l 7125 8000 l 7125 8038 l 7100 8038 l -7075 8038 l p ef -7100 8000 m 7075 8000 l 7075 7996 l 7077 7991 l 7078 7988 l 7081 7984 l -7084 7981 l 7087 7978 l 7091 7977 l 7096 7975 l 7100 7975 l 7100 7975 l -7100 8000 l p ef -7100 7975 m 7113 7975 l 7113 8000 l 7113 8025 l 7100 8025 l 7100 8000 l -7100 7975 l p ef -7164 7975 m 7215 7975 l 7215 8025 l 7164 8025 l 7164 7975 l p ef -7266 7975 m 7317 7975 l 7317 8025 l 7266 8025 l 7266 7975 l p ef -7368 7975 m 7419 7975 l 7419 8025 l 7368 8025 l 7368 7975 l p ef -7470 7975 m 7521 7975 l 7521 8025 l 7470 8025 l 7470 7975 l p ef -7572 7975 m 7623 7975 l 7623 8025 l 7572 8025 l 7572 7975 l p ef -7674 7975 m 7725 7975 l 7725 8025 l 7674 8025 l 7674 7975 l p ef -7776 7975 m 7827 7975 l 7827 8025 l 7776 8025 l 7776 7975 l p ef -7878 7975 m 7929 7975 l 7929 8025 l 7878 8025 l 7878 7975 l p ef -7980 7975 m 8031 7975 l 8031 8025 l 7980 8025 l 7980 7975 l p ef -8082 7975 m 8133 7975 l 8133 8025 l 8082 8025 l 8082 7975 l p ef -8184 7975 m 8235 7975 l 8235 8025 l 8184 8025 l 8184 7975 l p ef -8286 7975 m 8337 7975 l 8337 8025 l 8286 8025 l 8286 7975 l p ef -8388 7975 m 8439 7975 l 8439 8025 l 8388 8025 l 8388 7975 l p ef -8490 7975 m 8541 7975 l 8541 8025 l 8490 8025 l 8490 7975 l p ef -8592 7975 m 8643 7975 l 8643 8025 l 8592 8025 l 8592 7975 l p ef -8694 7975 m 8745 7975 l 8745 8025 l 8694 8025 l 8694 7975 l p ef -8796 7975 m 8847 7975 l 8847 8025 l 8796 8025 l 8796 7975 l p ef -8898 7975 m 8949 7975 l 8949 8025 l 8898 8025 l 8898 7975 l p ef -9000 7975 m 9051 7975 l 9051 8025 l 9000 8025 l 9000 7975 l p ef -9102 7975 m 9153 7975 l 9153 8025 l 9102 8025 l 9102 7975 l p ef -9204 7975 m 9255 7975 l 9255 8025 l 9204 8025 l 9204 7975 l p ef -9306 7975 m 9357 7975 l 9357 8025 l 9306 8025 l 9306 7975 l p ef -9408 7975 m 9459 7975 l 9459 8025 l 9408 8025 l 9408 7975 l p ef -9510 7975 m 9561 7975 l 9561 8025 l 9510 8025 l 9510 7975 l p ef -9612 7975 m 9663 7975 l 9663 8025 l 9612 8025 l 9612 7975 l p ef -9714 7975 m 9765 7975 l 9765 8025 l 9714 8025 l 9714 7975 l p ef -9816 7975 m 9867 7975 l 9867 8025 l 9816 8025 l 9816 7975 l p ef -9918 7975 m 9969 7975 l 9969 8025 l 9918 8025 l 9918 7975 l p ef -10020 7975 m 10071 7975 l 10071 8025 l 10020 8025 l 10020 7975 l p ef -10122 7975 m 10173 7975 l 10173 8025 l 10122 8025 l 10122 7975 l p ef -10224 7975 m 10275 7975 l 10275 8025 l 10224 8025 l 10224 7975 l p ef -10326 7975 m 10377 7975 l 10377 8025 l 10326 8025 l 10326 7975 l p ef -10428 7975 m 10479 7975 l 10479 8025 l 10428 8025 l 10428 7975 l p ef -10525 8030 m 10525 8081 l 10475 8081 l 10475 8030 l 10525 8030 l p ef -10525 8132 m 10525 8183 l 10475 8183 l 10475 8132 l 10525 8132 l p ef -10525 8234 m 10525 8285 l 10475 8285 l 10475 8234 l 10525 8234 l p ef -10525 8336 m 10525 8387 l 10475 8387 l 10475 8336 l 10525 8336 l p ef -10525 8438 m 10525 8489 l 10475 8489 l 10475 8438 l 10525 8438 l p ef -10525 8540 m 10525 8591 l 10475 8591 l 10475 8540 l 10525 8540 l p ef -10525 8642 m 10525 8693 l 10475 8693 l 10475 8642 l 10525 8642 l p ef -10525 8744 m 10525 8795 l 10475 8795 l 10475 8744 l 10525 8744 l p ef -10525 8846 m 10525 8897 l 10475 8897 l 10475 8846 l 10525 8846 l p ef -10525 8948 m 10525 8999 l 10475 8999 l 10475 8948 l 10525 8948 l p ef -10525 9050 m 10525 9101 l 10475 9101 l 10475 9050 l 10525 9050 l p ef -10525 9152 m 10525 9203 l 10475 9203 l 10475 9152 l 10525 9152 l p ef -10525 9254 m 10525 9305 l 10475 9305 l 10475 9254 l 10525 9254 l p ef -10525 9356 m 10525 9407 l 10475 9407 l 10475 9356 l 10525 9356 l p ef -10525 9458 m 10525 9500 l 10500 9500 l 10475 9500 l 10475 9458 l 10500 9458 l -10525 9458 l p ef -10500 9500 m 10525 9500 l 10525 9504 l 10523 9509 l 10522 9512 l 10519 9516 l -10516 9519 l 10513 9522 l 10509 9523 l 10504 9525 l 10500 9525 l 10500 9525 l -10500 9500 l p ef -10500 9525 m 10491 9525 l 10491 9500 l 10491 9475 l 10500 9475 l 10500 9500 l -10500 9525 l p ef -10440 9525 m 10389 9525 l 10389 9475 l 10440 9475 l 10440 9525 l p ef -10338 9525 m 10287 9525 l 10287 9475 l 10338 9475 l 10338 9525 l p ef -10236 9525 m 10185 9525 l 10185 9475 l 10236 9475 l 10236 9525 l p ef -10134 9525 m 10083 9525 l 10083 9475 l 10134 9475 l 10134 9525 l p ef -10032 9525 m 9981 9525 l 9981 9475 l 10032 9475 l 10032 9525 l p ef -9930 9525 m 9879 9525 l 9879 9475 l 9930 9475 l 9930 9525 l p ef -9828 9525 m 9777 9525 l 9777 9475 l 9828 9475 l 9828 9525 l p ef -9726 9525 m 9675 9525 l 9675 9475 l 9726 9475 l 9726 9525 l p ef -9624 9525 m 9573 9525 l 9573 9475 l 9624 9475 l 9624 9525 l p ef -9522 9525 m 9471 9525 l 9471 9475 l 9522 9475 l 9522 9525 l p ef -9420 9525 m 9369 9525 l 9369 9475 l 9420 9475 l 9420 9525 l p ef -9318 9525 m 9267 9525 l 9267 9475 l 9318 9475 l 9318 9525 l p ef -9216 9525 m 9165 9525 l 9165 9475 l 9216 9475 l 9216 9525 l p ef -9114 9525 m 9063 9525 l 9063 9475 l 9114 9475 l 9114 9525 l p ef -9012 9525 m 8961 9525 l 8961 9475 l 9012 9475 l 9012 9525 l p ef -8910 9525 m 8859 9525 l 8859 9475 l 8910 9475 l 8910 9525 l p ef -8808 9525 m 8800 9525 l 8800 9500 l 8800 9475 l 8808 9475 l 8808 9500 l -8808 9525 l p ef -8800 9525 m 8749 9525 l 8749 9500 l 8749 9475 l 8800 9475 l 8800 9500 l -8800 9525 l p ef -gs -gs -pum -7276 8974 t -50 0 m 50 -455 l 251 -455 l 292 -455 323 -451 344 -443 ct 365 -435 382 -420 394 -399 ct -407 -379 413 -356 413 -331 ct 413 -299 403 -271 382 -249 ct 361 -227 329 -213 285 -207 ct -301 -199 313 -192 322 -184 ct 339 -168 356 -148 371 -124 ct 451 0 l 375 0 l -315 -95 l 297 -122 283 -143 271 -157 ct 260 -172 250 -182 241 -188 ct 232 -194 223 -198 213 -200 ct -207 -201 195 -202 180 -202 ct 110 -202 l 110 0 l 50 0 l p -110 -254 m 239 -254 l 267 -254 288 -257 304 -263 ct 319 -268 331 -277 339 -290 ct -347 -303 351 -316 351 -331 ct 351 -352 344 -370 328 -384 ct 312 -398 288 -405 254 -405 ct -110 -405 l 110 -254 l p ef -724 -107 m 782 -99 l 773 -66 756 -40 731 -21 ct 707 -2 675 7 637 7 ct 589 7 551 -8 523 -37 ct -494 -67 480 -109 480 -162 ct 480 -218 495 -261 523 -291 ct 552 -322 589 -337 634 -337 ct -678 -337 714 -322 742 -292 ct 770 -262 784 -220 784 -166 ct 784 -163 784 -158 783 -151 ct -538 -151 l 540 -115 550 -87 569 -68 ct 587 -49 610 -39 637 -39 ct 658 -39 675 -44 690 -55 ct -704 -66 716 -83 724 -107 ct p -541 -197 m 725 -197 l 722 -225 715 -245 704 -259 ct 686 -280 663 -291 635 -291 ct -609 -291 587 -283 570 -265 ct 553 -248 543 -226 541 -197 ct p ef -829 -99 m 884 -107 l 887 -85 895 -68 910 -57 ct 924 -45 944 -39 969 -39 ct -995 -39 1014 -44 1026 -55 ct 1038 -65 1045 -77 1045 -91 ct 1045 -104 1039 -114 1028 -121 ct -1021 -126 1002 -132 971 -140 ct 930 -150 902 -159 886 -167 ct 870 -174 858 -185 850 -198 ct -842 -211 838 -226 838 -242 ct 838 -257 841 -270 848 -283 ct 855 -295 864 -306 875 -314 ct -884 -320 896 -326 911 -330 ct 926 -335 942 -337 959 -337 ct 985 -337 1008 -333 1027 -326 ct -1047 -318 1061 -308 1070 -296 ct 1080 -283 1086 -266 1090 -245 ct 1035 -237 l -1033 -254 1025 -267 1013 -277 ct 1002 -286 985 -291 963 -291 ct 937 -291 919 -287 908 -278 ct -897 -270 892 -260 892 -249 ct 892 -241 894 -235 899 -229 ct 903 -223 910 -218 920 -214 ct -926 -212 942 -207 969 -200 ct 1009 -189 1036 -181 1052 -174 ct 1068 -167 1080 -158 1089 -145 ct -1098 -132 1102 -116 1102 -97 ct 1102 -79 1097 -61 1086 -45 ct 1075 -28 1059 -15 1039 -6 ct -1018 3 995 7 969 7 ct 927 7 894 -2 871 -20 ct 849 -37 835 -64 829 -99 ct p ef -1383 -41 m 1362 -24 1342 -11 1323 -4 ct 1304 3 1283 7 1262 7 ct 1225 7 1198 -2 1178 -20 ct -1159 -37 1149 -60 1149 -87 ct 1149 -103 1153 -118 1160 -131 ct 1167 -145 1177 -156 1189 -164 ct -1201 -172 1214 -178 1229 -182 ct 1240 -185 1256 -188 1279 -190 ct 1324 -196 1357 -202 1378 -209 ct -1378 -217 1378 -222 1378 -224 ct 1378 -247 1373 -263 1363 -272 ct 1348 -285 1327 -291 1299 -291 ct -1273 -291 1253 -286 1241 -277 ct 1228 -268 1219 -252 1213 -228 ct 1159 -236 l -1164 -259 1172 -278 1183 -292 ct 1194 -307 1211 -318 1232 -326 ct 1254 -333 1279 -337 1307 -337 ct -1335 -337 1358 -334 1376 -327 ct 1393 -321 1406 -312 1414 -302 ct 1423 -292 1428 -280 1432 -264 ct -1434 -255 1435 -238 1435 -213 ct 1435 -138 l 1435 -87 1436 -54 1438 -40 ct -1440 -26 1445 -13 1452 0 ct 1394 0 l 1388 -12 1384 -26 1383 -41 ct p -1378 -166 m 1358 -157 1327 -150 1287 -145 ct 1264 -141 1248 -138 1238 -133 ct -1229 -129 1221 -123 1216 -115 ct 1211 -107 1208 -99 1208 -89 ct 1208 -74 1214 -62 1225 -52 ct -1237 -42 1253 -37 1275 -37 ct 1296 -37 1315 -41 1332 -51 ct 1349 -60 1361 -73 1369 -89 ct -1375 -102 1378 -121 1378 -145 ct 1378 -166 l p ef -1519 0 m 1519 -330 l 1569 -330 l 1569 -283 l 1579 -299 1593 -312 1610 -322 ct -1627 -332 1647 -337 1669 -337 ct 1693 -337 1713 -332 1729 -322 ct 1744 -312 1755 -297 1762 -279 ct -1788 -318 1822 -337 1863 -337 ct 1896 -337 1921 -328 1939 -310 ct 1956 -292 1965 -264 1965 -226 ct -1965 0 l 1910 0 l 1910 -208 l 1910 -230 1908 -246 1904 -256 ct 1901 -266 1894 -274 1884 -280 ct -1875 -286 1864 -289 1851 -289 ct 1828 -289 1809 -281 1793 -265 ct 1778 -250 1770 -225 1770 -191 ct -1770 0 l 1715 0 l 1715 -214 l 1715 -239 1710 -258 1701 -270 ct 1692 -282 1677 -289 1656 -289 ct -1641 -289 1626 -284 1613 -276 ct 1599 -268 1590 -256 1584 -240 ct 1578 -224 1575 -201 1575 -171 ct -1575 0 l 1519 0 l p ef -2049 126 m 2049 -330 l 2100 -330 l 2100 -287 l 2112 -304 2125 -316 2140 -324 ct -2155 -333 2174 -337 2195 -337 ct 2223 -337 2248 -330 2270 -315 ct 2291 -301 2307 -280 2318 -254 ct -2329 -228 2335 -199 2335 -167 ct 2335 -134 2329 -103 2317 -77 ct 2305 -50 2287 -29 2264 -15 ct -2241 0 2217 7 2191 7 ct 2173 7 2156 3 2141 -5 ct 2126 -13 2114 -23 2105 -35 ct -2105 126 l 2049 126 l p -2099 -163 m 2099 -121 2108 -90 2125 -69 ct 2142 -49 2163 -39 2187 -39 ct 2212 -39 2234 -49 2251 -70 ct -2269 -91 2278 -124 2278 -168 ct 2278 -210 2269 -241 2252 -262 ct 2235 -283 2214 -293 2190 -293 ct -2166 -293 2145 -282 2127 -260 ct 2109 -238 2099 -205 2099 -163 ct p ef -2399 0 m 2399 -455 l 2454 -455 l 2454 0 l 2399 0 l p ef -2765 -107 m 2823 -99 l 2814 -66 2797 -40 2772 -21 ct 2748 -2 2716 7 2678 7 ct -2630 7 2592 -8 2564 -37 ct 2535 -67 2521 -109 2521 -162 ct 2521 -218 2536 -261 2564 -291 ct -2593 -322 2630 -337 2675 -337 ct 2719 -337 2755 -322 2783 -292 ct 2811 -262 2825 -220 2825 -166 ct -2825 -163 2825 -158 2824 -151 ct 2579 -151 l 2581 -115 2591 -87 2610 -68 ct -2628 -49 2651 -39 2678 -39 ct 2699 -39 2716 -44 2731 -55 ct 2745 -66 2757 -83 2765 -107 ct -p -2582 -197 m 2766 -197 l 2763 -225 2756 -245 2745 -259 ct 2727 -280 2704 -291 2676 -291 ct -2650 -291 2628 -283 2611 -265 ct 2594 -248 2584 -226 2582 -197 ct p ef -2890 0 m 2890 -330 l 2940 -330 l 2940 -280 l 2953 -303 2965 -318 2976 -326 ct -2987 -333 2999 -337 3012 -337 ct 3031 -337 3050 -331 3069 -319 ct 3050 -267 l -3036 -275 3023 -279 3009 -279 ct 2997 -279 2986 -276 2976 -268 ct 2966 -261 2959 -251 2955 -238 ct -2949 -218 2946 -196 2946 -173 ct 2946 0 l 2890 0 l p ef -pom -gr -gr -11400 8750 m 10838 8938 l 10838 8563 l 11400 8750 l p ef -10500 8725 m 10950 8725 l 10950 8775 l 10500 8775 l 10500 8725 l p ef -8698 13525 m 8647 13525 l 8647 13475 l 8698 13475 l 8698 13525 l p ef -8596 13525 m 8545 13525 l 8545 13475 l 8596 13475 l 8596 13525 l p ef -8494 13525 m 8443 13525 l 8443 13475 l 8494 13475 l 8494 13525 l p ef -8392 13525 m 8341 13525 l 8341 13475 l 8392 13475 l 8392 13525 l p ef -8290 13525 m 8239 13525 l 8239 13475 l 8290 13475 l 8290 13525 l p ef -8188 13525 m 8137 13525 l 8137 13475 l 8188 13475 l 8188 13525 l p ef -8086 13525 m 8035 13525 l 8035 13475 l 8086 13475 l 8086 13525 l p ef -7984 13525 m 7933 13525 l 7933 13475 l 7984 13475 l 7984 13525 l p ef -7882 13525 m 7831 13525 l 7831 13475 l 7882 13475 l 7882 13525 l p ef -7780 13525 m 7729 13525 l 7729 13475 l 7780 13475 l 7780 13525 l p ef -7678 13525 m 7627 13525 l 7627 13475 l 7678 13475 l 7678 13525 l p ef -7576 13525 m 7525 13525 l 7525 13475 l 7576 13475 l 7576 13525 l p ef -7474 13525 m 7423 13525 l 7423 13475 l 7474 13475 l 7474 13525 l p ef -7372 13525 m 7321 13525 l 7321 13475 l 7372 13475 l 7372 13525 l p ef -7270 13525 m 7219 13525 l 7219 13475 l 7270 13475 l 7270 13525 l p ef -7168 13525 m 7117 13525 l 7117 13475 l 7168 13475 l 7168 13525 l p ef -7075 13466 m 7075 13415 l 7125 13415 l 7125 13466 l 7075 13466 l p ef -7075 13364 m 7075 13313 l 7125 13313 l 7125 13364 l 7075 13364 l p ef -7075 13262 m 7075 13211 l 7125 13211 l 7125 13262 l 7075 13262 l p ef -7075 13160 m 7075 13109 l 7125 13109 l 7125 13160 l 7075 13160 l p ef -7075 13058 m 7075 13007 l 7125 13007 l 7125 13058 l 7075 13058 l p ef -7075 12956 m 7075 12905 l 7125 12905 l 7125 12956 l 7075 12956 l p ef -7075 12854 m 7075 12803 l 7125 12803 l 7125 12854 l 7075 12854 l p ef -7075 12752 m 7075 12701 l 7125 12701 l 7125 12752 l 7075 12752 l p ef -7075 12650 m 7075 12599 l 7125 12599 l 7125 12650 l 7075 12650 l p ef -7075 12548 m 7075 12497 l 7125 12497 l 7125 12548 l 7075 12548 l p ef -7075 12446 m 7075 12395 l 7125 12395 l 7125 12446 l 7075 12446 l p ef -7075 12344 m 7075 12293 l 7125 12293 l 7125 12344 l 7075 12344 l p ef -7075 12242 m 7075 12191 l 7125 12191 l 7125 12242 l 7075 12242 l p ef -7075 12140 m 7075 12089 l 7125 12089 l 7125 12140 l 7075 12140 l p ef -7075 12038 m 7075 12000 l 7100 12000 l 7125 12000 l 7125 12038 l 7100 12038 l -7075 12038 l p ef -7100 12000 m 7075 12000 l 7075 11996 l 7077 11991 l 7078 11988 l 7081 11984 l -7084 11981 l 7087 11978 l 7091 11977 l 7096 11975 l 7100 11975 l 7100 11975 l -7100 12000 l p ef -7100 11975 m 7113 11975 l 7113 12000 l 7113 12025 l 7100 12025 l 7100 12000 l -7100 11975 l p ef -7164 11975 m 7215 11975 l 7215 12025 l 7164 12025 l 7164 11975 l p ef -7266 11975 m 7317 11975 l 7317 12025 l 7266 12025 l 7266 11975 l p ef -7368 11975 m 7419 11975 l 7419 12025 l 7368 12025 l 7368 11975 l p ef -7470 11975 m 7521 11975 l 7521 12025 l 7470 12025 l 7470 11975 l p ef -7572 11975 m 7623 11975 l 7623 12025 l 7572 12025 l 7572 11975 l p ef -7674 11975 m 7725 11975 l 7725 12025 l 7674 12025 l 7674 11975 l p ef -7776 11975 m 7827 11975 l 7827 12025 l 7776 12025 l 7776 11975 l p ef -7878 11975 m 7929 11975 l 7929 12025 l 7878 12025 l 7878 11975 l p ef -7980 11975 m 8031 11975 l 8031 12025 l 7980 12025 l 7980 11975 l p ef -8082 11975 m 8133 11975 l 8133 12025 l 8082 12025 l 8082 11975 l p ef -8184 11975 m 8235 11975 l 8235 12025 l 8184 12025 l 8184 11975 l p ef -8286 11975 m 8337 11975 l 8337 12025 l 8286 12025 l 8286 11975 l p ef -8388 11975 m 8439 11975 l 8439 12025 l 8388 12025 l 8388 11975 l p ef -8490 11975 m 8541 11975 l 8541 12025 l 8490 12025 l 8490 11975 l p ef -8592 11975 m 8643 11975 l 8643 12025 l 8592 12025 l 8592 11975 l p ef -8694 11975 m 8745 11975 l 8745 12025 l 8694 12025 l 8694 11975 l p ef -8796 11975 m 8847 11975 l 8847 12025 l 8796 12025 l 8796 11975 l p ef -8898 11975 m 8949 11975 l 8949 12025 l 8898 12025 l 8898 11975 l p ef -9000 11975 m 9051 11975 l 9051 12025 l 9000 12025 l 9000 11975 l p ef -9102 11975 m 9153 11975 l 9153 12025 l 9102 12025 l 9102 11975 l p ef -9204 11975 m 9255 11975 l 9255 12025 l 9204 12025 l 9204 11975 l p ef -9306 11975 m 9357 11975 l 9357 12025 l 9306 12025 l 9306 11975 l p ef -9408 11975 m 9459 11975 l 9459 12025 l 9408 12025 l 9408 11975 l p ef -9510 11975 m 9561 11975 l 9561 12025 l 9510 12025 l 9510 11975 l p ef -9612 11975 m 9663 11975 l 9663 12025 l 9612 12025 l 9612 11975 l p ef -9714 11975 m 9765 11975 l 9765 12025 l 9714 12025 l 9714 11975 l p ef -9816 11975 m 9867 11975 l 9867 12025 l 9816 12025 l 9816 11975 l p ef -9918 11975 m 9969 11975 l 9969 12025 l 9918 12025 l 9918 11975 l p ef -10020 11975 m 10071 11975 l 10071 12025 l 10020 12025 l 10020 11975 l -p ef -10122 11975 m 10173 11975 l 10173 12025 l 10122 12025 l 10122 11975 l -p ef -10224 11975 m 10275 11975 l 10275 12025 l 10224 12025 l 10224 11975 l -p ef -10326 11975 m 10377 11975 l 10377 12025 l 10326 12025 l 10326 11975 l -p ef -10428 11975 m 10479 11975 l 10479 12025 l 10428 12025 l 10428 11975 l -p ef -10525 12030 m 10525 12081 l 10475 12081 l 10475 12030 l 10525 12030 l -p ef -10525 12132 m 10525 12183 l 10475 12183 l 10475 12132 l 10525 12132 l -p ef -10525 12234 m 10525 12285 l 10475 12285 l 10475 12234 l 10525 12234 l -p ef -10525 12336 m 10525 12387 l 10475 12387 l 10475 12336 l 10525 12336 l -p ef -10525 12438 m 10525 12489 l 10475 12489 l 10475 12438 l 10525 12438 l -p ef -10525 12540 m 10525 12591 l 10475 12591 l 10475 12540 l 10525 12540 l -p ef -10525 12642 m 10525 12693 l 10475 12693 l 10475 12642 l 10525 12642 l -p ef -10525 12744 m 10525 12795 l 10475 12795 l 10475 12744 l 10525 12744 l -p ef -10525 12846 m 10525 12897 l 10475 12897 l 10475 12846 l 10525 12846 l -p ef -10525 12948 m 10525 12999 l 10475 12999 l 10475 12948 l 10525 12948 l -p ef -10525 13050 m 10525 13101 l 10475 13101 l 10475 13050 l 10525 13050 l -p ef -10525 13152 m 10525 13203 l 10475 13203 l 10475 13152 l 10525 13152 l -p ef -10525 13254 m 10525 13305 l 10475 13305 l 10475 13254 l 10525 13254 l -p ef -10525 13356 m 10525 13407 l 10475 13407 l 10475 13356 l 10525 13356 l -p ef -10525 13458 m 10525 13500 l 10500 13500 l 10475 13500 l 10475 13458 l -10500 13458 l 10525 13458 l p ef -10500 13500 m 10525 13500 l 10525 13504 l 10523 13509 l 10522 13512 l -10519 13516 l 10516 13519 l 10513 13522 l 10509 13523 l 10504 13525 l -10500 13525 l 10500 13525 l 10500 13500 l p ef -10500 13525 m 10491 13525 l 10491 13500 l 10491 13475 l 10500 13475 l -10500 13500 l 10500 13525 l p ef -10440 13525 m 10389 13525 l 10389 13475 l 10440 13475 l 10440 13525 l -p ef -10338 13525 m 10287 13525 l 10287 13475 l 10338 13475 l 10338 13525 l -p ef -10236 13525 m 10185 13525 l 10185 13475 l 10236 13475 l 10236 13525 l -p ef -10134 13525 m 10083 13525 l 10083 13475 l 10134 13475 l 10134 13525 l -p ef -10032 13525 m 9981 13525 l 9981 13475 l 10032 13475 l 10032 13525 l -p ef -9930 13525 m 9879 13525 l 9879 13475 l 9930 13475 l 9930 13525 l p ef -9828 13525 m 9777 13525 l 9777 13475 l 9828 13475 l 9828 13525 l p ef -9726 13525 m 9675 13525 l 9675 13475 l 9726 13475 l 9726 13525 l p ef -9624 13525 m 9573 13525 l 9573 13475 l 9624 13475 l 9624 13525 l p ef -9522 13525 m 9471 13525 l 9471 13475 l 9522 13475 l 9522 13525 l p ef -9420 13525 m 9369 13525 l 9369 13475 l 9420 13475 l 9420 13525 l p ef -9318 13525 m 9267 13525 l 9267 13475 l 9318 13475 l 9318 13525 l p ef -9216 13525 m 9165 13525 l 9165 13475 l 9216 13475 l 9216 13525 l p ef -9114 13525 m 9063 13525 l 9063 13475 l 9114 13475 l 9114 13525 l p ef -9012 13525 m 8961 13525 l 8961 13475 l 9012 13475 l 9012 13525 l p ef -8910 13525 m 8859 13525 l 8859 13475 l 8910 13475 l 8910 13525 l p ef -8808 13525 m 8800 13525 l 8800 13500 l 8800 13475 l 8808 13475 l 8808 13500 l -8808 13525 l p ef -8800 13525 m 8749 13525 l 8749 13500 l 8749 13475 l 8800 13475 l 8800 13500 l -8800 13525 l p ef -gs -gs -pum -7276 12970 t -50 0 m 50 -455 l 251 -455 l 292 -455 323 -451 344 -443 ct 365 -435 382 -420 394 -399 ct -407 -379 413 -356 413 -331 ct 413 -299 403 -271 382 -249 ct 361 -227 329 -213 285 -207 ct -301 -199 313 -192 322 -184 ct 339 -168 356 -148 371 -124 ct 451 0 l 375 0 l -315 -95 l 297 -122 283 -143 271 -157 ct 260 -172 250 -182 241 -188 ct 232 -194 223 -198 213 -200 ct -207 -201 195 -202 180 -202 ct 110 -202 l 110 0 l 50 0 l p -110 -254 m 239 -254 l 267 -254 288 -257 304 -263 ct 319 -268 331 -277 339 -290 ct -347 -303 351 -316 351 -331 ct 351 -352 344 -370 328 -384 ct 312 -398 288 -405 254 -405 ct -110 -405 l 110 -254 l p ef -724 -107 m 782 -99 l 773 -66 756 -40 731 -21 ct 707 -2 675 7 637 7 ct 589 7 551 -8 523 -37 ct -494 -67 480 -109 480 -162 ct 480 -218 495 -261 523 -291 ct 552 -322 589 -337 634 -337 ct -678 -337 714 -322 742 -292 ct 770 -262 784 -220 784 -166 ct 784 -163 784 -158 783 -151 ct -538 -151 l 540 -115 550 -87 569 -68 ct 587 -49 610 -39 637 -39 ct 658 -39 675 -44 690 -55 ct -704 -66 716 -83 724 -107 ct p -541 -197 m 725 -197 l 722 -225 715 -245 704 -259 ct 686 -280 663 -291 635 -291 ct -609 -291 587 -283 570 -265 ct 553 -248 543 -226 541 -197 ct p ef -829 -99 m 884 -107 l 887 -85 895 -68 910 -57 ct 924 -45 944 -39 969 -39 ct -995 -39 1014 -44 1026 -55 ct 1038 -65 1045 -77 1045 -91 ct 1045 -104 1039 -114 1028 -121 ct -1021 -126 1002 -132 971 -140 ct 930 -150 902 -159 886 -167 ct 870 -174 858 -185 850 -198 ct -842 -211 838 -226 838 -242 ct 838 -257 841 -270 848 -283 ct 855 -295 864 -306 875 -314 ct -884 -320 896 -326 911 -330 ct 926 -335 942 -337 959 -337 ct 985 -337 1008 -333 1027 -326 ct -1047 -318 1061 -308 1070 -296 ct 1080 -283 1086 -266 1090 -245 ct 1035 -237 l -1033 -254 1025 -267 1013 -277 ct 1002 -286 985 -291 963 -291 ct 937 -291 919 -287 908 -278 ct -897 -270 892 -260 892 -249 ct 892 -241 894 -235 899 -229 ct 903 -223 910 -218 920 -214 ct -926 -212 942 -207 969 -200 ct 1009 -189 1036 -181 1052 -174 ct 1068 -167 1080 -158 1089 -145 ct -1098 -132 1102 -116 1102 -97 ct 1102 -79 1097 -61 1086 -45 ct 1075 -28 1059 -15 1039 -6 ct -1018 3 995 7 969 7 ct 927 7 894 -2 871 -20 ct 849 -37 835 -64 829 -99 ct p ef -1383 -41 m 1362 -24 1342 -11 1323 -4 ct 1304 3 1283 7 1262 7 ct 1225 7 1198 -2 1178 -20 ct -1159 -37 1149 -60 1149 -87 ct 1149 -103 1153 -118 1160 -131 ct 1167 -145 1177 -156 1189 -164 ct -1201 -172 1214 -178 1229 -182 ct 1240 -185 1256 -188 1279 -190 ct 1324 -196 1357 -202 1378 -209 ct -1378 -217 1378 -222 1378 -224 ct 1378 -247 1373 -263 1363 -272 ct 1348 -285 1327 -291 1299 -291 ct -1273 -291 1253 -286 1241 -277 ct 1228 -268 1219 -252 1213 -228 ct 1159 -236 l -1164 -259 1172 -278 1183 -292 ct 1194 -307 1211 -318 1232 -326 ct 1254 -333 1279 -337 1307 -337 ct -1335 -337 1358 -334 1376 -327 ct 1393 -321 1406 -312 1414 -302 ct 1423 -292 1428 -280 1432 -264 ct -1434 -255 1435 -238 1435 -213 ct 1435 -138 l 1435 -87 1436 -54 1438 -40 ct -1440 -26 1445 -13 1452 0 ct 1394 0 l 1388 -12 1384 -26 1383 -41 ct p -1378 -166 m 1358 -157 1327 -150 1287 -145 ct 1264 -141 1248 -138 1238 -133 ct -1229 -129 1221 -123 1216 -115 ct 1211 -107 1208 -99 1208 -89 ct 1208 -74 1214 -62 1225 -52 ct -1237 -42 1253 -37 1275 -37 ct 1296 -37 1315 -41 1332 -51 ct 1349 -60 1361 -73 1369 -89 ct -1375 -102 1378 -121 1378 -145 ct 1378 -166 l p ef -1519 0 m 1519 -330 l 1569 -330 l 1569 -283 l 1579 -299 1593 -312 1610 -322 ct -1627 -332 1647 -337 1669 -337 ct 1693 -337 1713 -332 1729 -322 ct 1744 -312 1755 -297 1762 -279 ct -1788 -318 1822 -337 1863 -337 ct 1896 -337 1921 -328 1939 -310 ct 1956 -292 1965 -264 1965 -226 ct -1965 0 l 1910 0 l 1910 -208 l 1910 -230 1908 -246 1904 -256 ct 1901 -266 1894 -274 1884 -280 ct -1875 -286 1864 -289 1851 -289 ct 1828 -289 1809 -281 1793 -265 ct 1778 -250 1770 -225 1770 -191 ct -1770 0 l 1715 0 l 1715 -214 l 1715 -239 1710 -258 1701 -270 ct 1692 -282 1677 -289 1656 -289 ct -1641 -289 1626 -284 1613 -276 ct 1599 -268 1590 -256 1584 -240 ct 1578 -224 1575 -201 1575 -171 ct -1575 0 l 1519 0 l p ef -2049 126 m 2049 -330 l 2100 -330 l 2100 -287 l 2112 -304 2125 -316 2140 -324 ct -2155 -333 2174 -337 2195 -337 ct 2223 -337 2248 -330 2270 -315 ct 2291 -301 2307 -280 2318 -254 ct -2329 -228 2335 -199 2335 -167 ct 2335 -134 2329 -103 2317 -77 ct 2305 -50 2287 -29 2264 -15 ct -2241 0 2217 7 2191 7 ct 2173 7 2156 3 2141 -5 ct 2126 -13 2114 -23 2105 -35 ct -2105 126 l 2049 126 l p -2099 -163 m 2099 -121 2108 -90 2125 -69 ct 2142 -49 2163 -39 2187 -39 ct 2212 -39 2234 -49 2251 -70 ct -2269 -91 2278 -124 2278 -168 ct 2278 -210 2269 -241 2252 -262 ct 2235 -283 2214 -293 2190 -293 ct -2166 -293 2145 -282 2127 -260 ct 2109 -238 2099 -205 2099 -163 ct p ef -2399 0 m 2399 -455 l 2454 -455 l 2454 0 l 2399 0 l p ef -2765 -107 m 2823 -99 l 2814 -66 2797 -40 2772 -21 ct 2748 -2 2716 7 2678 7 ct -2630 7 2592 -8 2564 -37 ct 2535 -67 2521 -109 2521 -162 ct 2521 -218 2536 -261 2564 -291 ct -2593 -322 2630 -337 2675 -337 ct 2719 -337 2755 -322 2783 -292 ct 2811 -262 2825 -220 2825 -166 ct -2825 -163 2825 -158 2824 -151 ct 2579 -151 l 2581 -115 2591 -87 2610 -68 ct -2628 -49 2651 -39 2678 -39 ct 2699 -39 2716 -44 2731 -55 ct 2745 -66 2757 -83 2765 -107 ct -p -2582 -197 m 2766 -197 l 2763 -225 2756 -245 2745 -259 ct 2727 -280 2704 -291 2676 -291 ct -2650 -291 2628 -283 2611 -265 ct 2594 -248 2584 -226 2582 -197 ct p ef -2890 0 m 2890 -330 l 2940 -330 l 2940 -280 l 2953 -303 2965 -318 2976 -326 ct -2987 -333 2999 -337 3012 -337 ct 3031 -337 3050 -331 3069 -319 ct 3050 -267 l -3036 -275 3023 -279 3009 -279 ct 2997 -279 2986 -276 2976 -268 ct 2966 -261 2959 -251 2955 -238 ct -2949 -218 2946 -196 2946 -173 ct 2946 0 l 2890 0 l p ef -pom -gr -gr -5900 12750 m 6463 12563 l 6463 12938 l 5900 12750 l p ef -7100 12775 m 6350 12775 l 6350 12725 l 7100 12725 l 7100 12775 l p ef -gs -gs -pum -25603 12626 t -52 -1 m 52 -455 l 359 -455 l 359 -401 l 112 -401 l 112 -261 l 326 -261 l -326 -207 l 112 -207 l 112 -1 l 52 -1 l p ef -430 0 m 430 -330 l 480 -330 l 480 -280 l 493 -303 505 -318 516 -326 ct -527 -333 539 -337 552 -337 ct 571 -337 590 -331 609 -319 ct 590 -267 l 576 -275 563 -279 549 -279 ct -537 -279 526 -276 516 -268 ct 506 -261 499 -251 495 -238 ct 489 -218 486 -196 486 -173 ct -486 0 l 430 0 l p ef -622 -165 m 622 -226 639 -271 673 -301 ct 701 -325 736 -337 777 -337 ct 822 -337 859 -322 887 -293 ct -916 -263 931 -222 931 -170 ct 931 -127 924 -94 912 -70 ct 899 -45 880 -27 856 -13 ct -832 0 805 7 777 7 ct 730 7 693 -8 665 -37 ct 636 -67 622 -110 622 -165 ct p -679 -165 m 679 -123 689 -91 707 -70 ct 725 -49 749 -39 777 -39 ct 804 -39 827 -49 846 -71 ct -864 -92 873 -124 873 -167 ct 873 -208 864 -239 845 -260 ct 827 -281 804 -291 777 -291 ct -749 -291 725 -281 707 -260 ct 689 -239 679 -207 679 -165 ct p ef -995 0 m 995 -330 l 1045 -330 l 1045 -283 l 1055 -299 1069 -312 1086 -322 ct -1103 -332 1123 -337 1145 -337 ct 1169 -337 1189 -332 1205 -322 ct 1220 -312 1231 -297 1238 -279 ct -1264 -318 1298 -337 1339 -337 ct 1372 -337 1397 -328 1415 -310 ct 1432 -292 1441 -264 1441 -226 ct -1441 0 l 1386 0 l 1386 -208 l 1386 -230 1384 -246 1380 -256 ct 1377 -266 1370 -274 1360 -280 ct -1351 -286 1340 -289 1327 -289 ct 1304 -289 1285 -281 1269 -265 ct 1254 -250 1246 -225 1246 -191 ct -1246 0 l 1191 0 l 1191 -214 l 1191 -239 1186 -258 1177 -270 ct 1168 -282 1153 -289 1132 -289 ct -1117 -289 1102 -284 1089 -276 ct 1075 -268 1066 -256 1060 -240 ct 1054 -224 1051 -201 1051 -171 ct -1051 0 l 995 0 l p ef -pom -gr -gs -pum -25241 13337 t -42 0 m 42 -330 l 92 -330 l 92 -283 l 116 -319 151 -337 197 -337 ct 217 -337 235 -333 252 -326 ct -268 -319 281 -310 289 -298 ct 297 -287 303 -273 306 -257 ct 308 -247 309 -229 309 -203 ct -309 0 l 254 0 l 254 -200 l 254 -223 251 -240 247 -252 ct 243 -263 235 -272 224 -279 ct -213 -285 200 -289 185 -289 ct 161 -289 141 -281 124 -266 ct 106 -251 98 -222 98 -180 ct -98 0 l 42 0 l p ef -618 -107 m 676 -99 l 667 -66 650 -40 625 -21 ct 601 -2 569 7 531 7 ct 483 7 445 -8 417 -37 ct -388 -67 374 -109 374 -162 ct 374 -218 389 -261 417 -291 ct 446 -322 483 -337 528 -337 ct -572 -337 608 -322 636 -292 ct 664 -262 678 -220 678 -166 ct 678 -163 678 -158 677 -151 ct -432 -151 l 434 -115 444 -87 463 -68 ct 481 -49 504 -39 531 -39 ct 552 -39 569 -44 584 -55 ct -598 -66 610 -83 618 -107 ct p -435 -197 m 619 -197 l 616 -225 609 -245 598 -259 ct 580 -280 557 -291 529 -291 ct -503 -291 481 -283 464 -265 ct 447 -248 437 -226 435 -197 ct p ef -867 -50 m 875 -1 l 859 2 845 4 833 4 ct 812 4 797 1 785 -6 ct 774 -12 766 -20 762 -31 ct -757 -41 755 -63 755 -97 ct 755 -287 l 714 -287 l 714 -330 l 755 -330 l -755 -412 l 811 -445 l 811 -330 l 867 -330 l 867 -287 l 811 -287 l -811 -94 l 811 -78 812 -68 814 -63 ct 816 -58 819 -55 823 -52 ct 828 -49 834 -48 842 -48 ct -848 -48 857 -49 867 -50 ct p ef -984 0 m 883 -330 l 941 -330 l 993 -139 l 1012 -69 l 1013 -72 1019 -95 1030 -137 ct -1082 -330 l 1139 -330 l 1189 -138 l 1205 -75 l 1224 -139 l 1280 -330 l -1335 -330 l 1232 0 l 1174 0 l 1121 -197 l 1109 -253 l 1042 0 l 984 0 l -p ef -1346 -165 m 1346 -226 1363 -271 1397 -301 ct 1425 -325 1460 -337 1501 -337 ct -1546 -337 1583 -322 1611 -293 ct 1640 -263 1655 -222 1655 -170 ct 1655 -127 1648 -94 1636 -70 ct -1623 -45 1604 -27 1580 -13 ct 1556 0 1529 7 1501 7 ct 1454 7 1417 -8 1389 -37 ct -1360 -67 1346 -110 1346 -165 ct p -1403 -165 m 1403 -123 1413 -91 1431 -70 ct 1449 -49 1473 -39 1501 -39 ct 1528 -39 1551 -49 1570 -71 ct -1588 -92 1597 -124 1597 -167 ct 1597 -208 1588 -239 1569 -260 ct 1551 -281 1528 -291 1501 -291 ct -1473 -291 1449 -281 1431 -260 ct 1413 -239 1403 -207 1403 -165 ct p ef -1717 0 m 1717 -330 l 1767 -330 l 1767 -280 l 1780 -303 1792 -318 1803 -326 ct -1814 -333 1826 -337 1839 -337 ct 1858 -337 1877 -331 1896 -319 ct 1877 -267 l -1863 -275 1850 -279 1836 -279 ct 1824 -279 1813 -276 1803 -268 ct 1793 -261 1786 -251 1782 -238 ct -1776 -218 1773 -196 1773 -173 ct 1773 0 l 1717 0 l p ef -1930 0 m 1930 -455 l 1986 -455 l 1986 -196 l 2118 -330 l 2190 -330 l -2064 -207 l 2203 0 l 2134 0 l 2025 -169 l 1986 -131 l 1986 0 l 1930 0 l -p ef -pom -gr -gr -gs -gs -pum -26008 8604 t -165 0 m 165 -401 l 15 -401 l 15 -455 l 375 -455 l 375 -401 l 225 -401 l -225 0 l 165 0 l p ef -343 -165 m 343 -226 360 -271 394 -301 ct 422 -325 457 -337 498 -337 ct 543 -337 580 -322 608 -293 ct -637 -263 652 -222 652 -170 ct 652 -127 645 -94 633 -70 ct 620 -45 601 -27 577 -13 ct -553 0 526 7 498 7 ct 451 7 414 -8 386 -37 ct 357 -67 343 -110 343 -165 ct p -400 -165 m 400 -123 410 -91 428 -70 ct 446 -49 470 -39 498 -39 ct 525 -39 548 -49 567 -71 ct -585 -92 594 -124 594 -167 ct 594 -208 585 -239 566 -260 ct 548 -281 525 -291 498 -291 ct -470 -291 446 -281 428 -260 ct 410 -239 400 -207 400 -165 ct p ef -pom -gr -gs -pum -25241 9315 t -42 0 m 42 -330 l 92 -330 l 92 -283 l 116 -319 151 -337 197 -337 ct 217 -337 235 -333 252 -326 ct -268 -319 281 -310 289 -298 ct 297 -287 303 -273 306 -257 ct 308 -247 309 -229 309 -203 ct -309 0 l 254 0 l 254 -200 l 254 -223 251 -240 247 -252 ct 243 -263 235 -272 224 -279 ct -213 -285 200 -289 185 -289 ct 161 -289 141 -281 124 -266 ct 106 -251 98 -222 98 -180 ct -98 0 l 42 0 l p ef -618 -107 m 676 -99 l 667 -66 650 -40 625 -21 ct 601 -2 569 7 531 7 ct 483 7 445 -8 417 -37 ct -388 -67 374 -109 374 -162 ct 374 -218 389 -261 417 -291 ct 446 -322 483 -337 528 -337 ct -572 -337 608 -322 636 -292 ct 664 -262 678 -220 678 -166 ct 678 -163 678 -158 677 -151 ct -432 -151 l 434 -115 444 -87 463 -68 ct 481 -49 504 -39 531 -39 ct 552 -39 569 -44 584 -55 ct -598 -66 610 -83 618 -107 ct p -435 -197 m 619 -197 l 616 -225 609 -245 598 -259 ct 580 -280 557 -291 529 -291 ct -503 -291 481 -283 464 -265 ct 447 -248 437 -226 435 -197 ct p ef -867 -50 m 875 -1 l 859 2 845 4 833 4 ct 812 4 797 1 785 -6 ct 774 -12 766 -20 762 -31 ct -757 -41 755 -63 755 -97 ct 755 -287 l 714 -287 l 714 -330 l 755 -330 l -755 -412 l 811 -445 l 811 -330 l 867 -330 l 867 -287 l 811 -287 l -811 -94 l 811 -78 812 -68 814 -63 ct 816 -58 819 -55 823 -52 ct 828 -49 834 -48 842 -48 ct -848 -48 857 -49 867 -50 ct p ef -984 0 m 883 -330 l 941 -330 l 993 -139 l 1012 -69 l 1013 -72 1019 -95 1030 -137 ct -1082 -330 l 1139 -330 l 1189 -138 l 1205 -75 l 1224 -139 l 1280 -330 l -1335 -330 l 1232 0 l 1174 0 l 1121 -197 l 1109 -253 l 1042 0 l 984 0 l -p ef -1346 -165 m 1346 -226 1363 -271 1397 -301 ct 1425 -325 1460 -337 1501 -337 ct -1546 -337 1583 -322 1611 -293 ct 1640 -263 1655 -222 1655 -170 ct 1655 -127 1648 -94 1636 -70 ct -1623 -45 1604 -27 1580 -13 ct 1556 0 1529 7 1501 7 ct 1454 7 1417 -8 1389 -37 ct -1360 -67 1346 -110 1346 -165 ct p -1403 -165 m 1403 -123 1413 -91 1431 -70 ct 1449 -49 1473 -39 1501 -39 ct 1528 -39 1551 -49 1570 -71 ct -1588 -92 1597 -124 1597 -167 ct 1597 -208 1588 -239 1569 -260 ct 1551 -281 1528 -291 1501 -291 ct -1473 -291 1449 -281 1431 -260 ct 1413 -239 1403 -207 1403 -165 ct p ef -1717 0 m 1717 -330 l 1767 -330 l 1767 -280 l 1780 -303 1792 -318 1803 -326 ct -1814 -333 1826 -337 1839 -337 ct 1858 -337 1877 -331 1896 -319 ct 1877 -267 l -1863 -275 1850 -279 1836 -279 ct 1824 -279 1813 -276 1803 -268 ct 1793 -261 1786 -251 1782 -238 ct -1776 -218 1773 -196 1773 -173 ct 1773 0 l 1717 0 l p ef -1930 0 m 1930 -455 l 1986 -455 l 1986 -196 l 2118 -330 l 2190 -330 l -2064 -207 l 2203 0 l 2134 0 l 2025 -169 l 1986 -131 l 1986 0 l 1930 0 l -p ef -pom -gr -gr -gs -gs -pum -4551 10959 t -29 -146 m 85 -151 l 88 -128 94 -109 104 -95 ct 114 -80 129 -68 150 -59 ct -170 -51 194 -46 220 -46 ct 242 -46 263 -49 280 -56 ct 298 -63 311 -72 320 -84 ct -328 -96 332 -109 332 -123 ct 332 -137 328 -150 320 -161 ct 312 -171 298 -180 279 -187 ct -267 -192 240 -200 198 -210 ct 156 -220 127 -229 110 -238 ct 89 -249 73 -263 62 -280 ct -51 -297 46 -316 46 -337 ct 46 -360 52 -381 65 -401 ct 78 -421 97 -436 122 -447 ct -147 -457 175 -462 206 -462 ct 240 -462 269 -457 295 -446 ct 321 -435 341 -419 354 -398 ct -368 -377 376 -353 377 -326 ct 319 -322 l 316 -351 305 -372 288 -387 ct 270 -402 243 -409 208 -409 ct -172 -409 145 -402 129 -389 ct 112 -376 104 -360 104 -341 ct 104 -324 110 -311 122 -301 ct -133 -290 163 -279 212 -268 ct 261 -257 295 -247 313 -239 ct 339 -227 359 -211 371 -193 ct -384 -174 390 -153 390 -128 ct 390 -104 383 -81 370 -60 ct 356 -38 336 -22 310 -10 ct -284 2 255 8 222 8 ct 181 8 147 2 119 -10 ct 91 -22 69 -40 53 -64 ct 38 -88 29 -115 29 -146 ct -p ef -680 -41 m 659 -24 639 -11 620 -4 ct 601 3 580 7 559 7 ct 522 7 495 -2 475 -20 ct -456 -37 446 -60 446 -87 ct 446 -103 450 -118 457 -131 ct 464 -145 474 -156 486 -164 ct -498 -172 511 -178 526 -182 ct 537 -185 553 -188 576 -190 ct 621 -196 654 -202 675 -209 ct -675 -217 675 -222 675 -224 ct 675 -247 670 -263 660 -272 ct 645 -285 624 -291 596 -291 ct -570 -291 550 -286 538 -277 ct 525 -268 516 -252 510 -228 ct 456 -236 l 461 -259 469 -278 480 -292 ct -491 -307 508 -318 529 -326 ct 551 -333 576 -337 604 -337 ct 632 -337 655 -334 673 -327 ct -690 -321 703 -312 711 -302 ct 720 -292 725 -280 729 -264 ct 731 -255 732 -238 732 -213 ct -732 -138 l 732 -87 733 -54 735 -40 ct 737 -26 742 -13 749 0 ct 691 0 l 685 -12 681 -26 680 -41 ct -p -675 -166 m 655 -157 624 -150 584 -145 ct 561 -141 545 -138 535 -133 ct 526 -129 518 -123 513 -115 ct -508 -107 505 -99 505 -89 ct 505 -74 511 -62 522 -52 ct 534 -42 550 -37 572 -37 ct -593 -37 612 -41 629 -51 ct 646 -60 658 -73 666 -89 ct 672 -102 675 -121 675 -145 ct -675 -166 l p ef -817 0 m 817 -330 l 867 -330 l 867 -283 l 877 -299 891 -312 908 -322 ct -925 -332 945 -337 967 -337 ct 991 -337 1011 -332 1027 -322 ct 1042 -312 1053 -297 1060 -279 ct -1086 -318 1120 -337 1161 -337 ct 1194 -337 1219 -328 1237 -310 ct 1254 -292 1263 -264 1263 -226 ct -1263 0 l 1208 0 l 1208 -208 l 1208 -230 1206 -246 1202 -256 ct 1199 -266 1192 -274 1182 -280 ct -1173 -286 1162 -289 1149 -289 ct 1126 -289 1107 -281 1091 -265 ct 1076 -250 1068 -225 1068 -191 ct -1068 0 l 1013 0 l 1013 -214 l 1013 -239 1008 -258 999 -270 ct 990 -282 975 -289 954 -289 ct -939 -289 924 -284 911 -276 ct 897 -268 888 -256 882 -240 ct 876 -224 873 -201 873 -171 ct -873 0 l 817 0 l p ef -1571 -107 m 1629 -99 l 1620 -66 1603 -40 1578 -21 ct 1554 -2 1522 7 1484 7 ct -1436 7 1398 -8 1370 -37 ct 1341 -67 1327 -109 1327 -162 ct 1327 -218 1342 -261 1370 -291 ct -1399 -322 1436 -337 1481 -337 ct 1525 -337 1561 -322 1589 -292 ct 1617 -262 1631 -220 1631 -166 ct -1631 -163 1631 -158 1630 -151 ct 1385 -151 l 1387 -115 1397 -87 1416 -68 ct -1434 -49 1457 -39 1484 -39 ct 1505 -39 1522 -44 1537 -55 ct 1551 -66 1563 -83 1571 -107 ct -p -1388 -197 m 1572 -197 l 1569 -225 1562 -245 1551 -259 ct 1533 -280 1510 -291 1482 -291 ct -1456 -291 1434 -283 1417 -265 ct 1400 -248 1390 -226 1388 -197 ct p ef -2090 -121 m 2145 -114 l 2139 -76 2123 -46 2099 -25 ct 2074 -4 2044 7 2008 7 ct -1963 7 1926 -8 1899 -37 ct 1872 -67 1858 -109 1858 -164 ct 1858 -199 1864 -230 1875 -257 ct -1887 -284 1905 -304 1929 -317 ct 1953 -330 1980 -337 2008 -337 ct 2044 -337 2073 -328 2096 -310 ct -2118 -292 2133 -266 2139 -233 ct 2085 -224 l 2080 -247 2071 -263 2058 -274 ct -2045 -286 2029 -291 2010 -291 ct 1982 -291 1959 -281 1942 -261 ct 1924 -241 1915 -209 1915 -165 ct -1915 -121 1924 -89 1941 -69 ct 1958 -49 1980 -39 2007 -39 ct 2029 -39 2047 -46 2062 -59 ct -2077 -72 2086 -93 2090 -121 ct p ef -2192 0 m 2192 -455 l 2247 -455 l 2247 0 l 2192 0 l p ef -2311 -165 m 2311 -226 2328 -271 2362 -301 ct 2390 -325 2425 -337 2466 -337 ct -2511 -337 2548 -322 2576 -293 ct 2605 -263 2620 -222 2620 -170 ct 2620 -127 2613 -94 2601 -70 ct -2588 -45 2569 -27 2545 -13 ct 2521 0 2494 7 2466 7 ct 2419 7 2382 -8 2354 -37 ct -2325 -67 2311 -110 2311 -165 ct p -2368 -165 m 2368 -123 2378 -91 2396 -70 ct 2414 -49 2438 -39 2466 -39 ct 2493 -39 2516 -49 2535 -71 ct -2553 -92 2562 -124 2562 -167 ct 2562 -208 2553 -239 2534 -260 ct 2516 -281 2493 -291 2466 -291 ct -2438 -291 2414 -281 2396 -260 ct 2378 -239 2368 -207 2368 -165 ct p ef -2899 -121 m 2954 -114 l 2948 -76 2932 -46 2908 -25 ct 2883 -4 2853 7 2817 7 ct -2772 7 2735 -8 2708 -37 ct 2681 -67 2667 -109 2667 -164 ct 2667 -199 2673 -230 2684 -257 ct -2696 -284 2714 -304 2738 -317 ct 2762 -330 2789 -337 2817 -337 ct 2853 -337 2882 -328 2905 -310 ct -2927 -292 2942 -266 2948 -233 ct 2894 -224 l 2889 -247 2880 -263 2867 -274 ct -2854 -286 2838 -291 2819 -291 ct 2791 -291 2768 -281 2751 -261 ct 2733 -241 2724 -209 2724 -165 ct -2724 -121 2733 -89 2750 -69 ct 2767 -49 2789 -39 2816 -39 ct 2838 -39 2856 -46 2871 -59 ct -2886 -72 2895 -93 2899 -121 ct p ef -3001 0 m 3001 -455 l 3057 -455 l 3057 -196 l 3189 -330 l 3261 -330 l -3135 -207 l 3274 0 l 3205 0 l 3096 -169 l 3057 -131 l 3057 0 l 3001 0 l -p ef -pom -gr -gr -0 6126 t -pom -count op_count sub {pop} repeat countdictstack dict_count sub {end} repeat b4_inc_state restore -%%PageTrailer -%%Trailer -%%EOF diff --git a/Engine/lib/speex/doc/components.odg b/Engine/lib/speex/doc/components.odg deleted file mode 100644 index 28aa86c9d..000000000 Binary files a/Engine/lib/speex/doc/components.odg and /dev/null differ diff --git a/Engine/lib/speex/doc/draft-herlein-avt-rtp-speex-00.txt b/Engine/lib/speex/doc/draft-herlein-avt-rtp-speex-00.txt deleted file mode 100644 index 36733e952..000000000 --- a/Engine/lib/speex/doc/draft-herlein-avt-rtp-speex-00.txt +++ /dev/null @@ -1,699 +0,0 @@ - - - - -Internet Engineering Task Force Greg Herlein -Internet Draft Jean-Marc Valin -draft-herlein-avt-rtp-speex-00.txt Simon Morlat -March 3, 2004 Roger Hardiman -Expires: September 3, 2004 Phil Kerr - - - RTP Payload Format for the Speex Codec - -Status of this Memo - - This document is an Internet-Draft and is in full conformance with - all provisions of Section 10 of RFC 2026. - - Internet-Drafts are working documents of the Internet Engineering - Task Force (IETF), its areas, and its working groups. Note that - other groups may also distribute working documents as Internet- - Drafts. - - Internet-Drafts are draft documents valid for a maximum of six - months and may be updated, replaced, or obsoleted by other - documents at any time. It is inappropriate to use Internet-Drafts - as reference material or to cite them other than as "work in - progress". - - The list of current Internet-Drafts can be accessed at - http://www.ietf.org/ietf/1id-abstracts.txt - - To view the list Internet-Draft Shadow Directories, see - http://www.ietf.org/shadow.html. - - -Copyright Notice - - Copyright (C) The Internet Society (2003). All Rights Reserved. - - -Abstract - - Speex is an open-source voice codec suitable for use in Voice over - IP (VoIP) type applications. This document describes the payload - format for Speex generated bit streams within an RTP packet. Also - included here are the necessary details for the use of Speex with - the Session Description Protocol (SDP) and a preliminary method of - using Speex within H.323 applications. - - -1. Conventions used in this document - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", - "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this - document are to be interpreted as described in RFC 2119 [5]. - -Herlein, Valin, et. al. Expires September 3, 2004 [Page 1] -^L -Internet-Draft draft-herlein-avt-rtp-speex-00.txt March 3, 2004 - - -2. Overview of the Speex Codec - - Speex is based on the CELP [12] encoding technique with support for - either narrowband (nominal 8kHz), wideband (nominal 16kHz) or - ultra-wideband (nominal 32kHz), and (non-optimal) rates up to 48 kHz - sampling also available. The main characteristics can be summarized - as follows: - - o Free software/open-source - o Integration of wideband and narrowband in the same bit-stream - o Wide range of bit-rates available - o Dynamic bit-rate switching and variable bit-rate (VBR) - o Voice Activity Detection (VAD, integrated with VBR) - o Variable complexity - - -3. RTP payload format for Speex - - For RTP based transportation of Speex encoded audio the standard - RTP header [2] is followed by one or more payload data blocks. - An optional padding terminator may also be used. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | RTP Header | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | one or more frames of Speex .... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | one or more frames of Speex .... | padding | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -3.1 RTP Header - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |V=2|P|X| CC |M| PT | sequence number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | timestamp | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | synchronization source (SSRC) identifier | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | contributing source (CSRC) identifiers | - | ... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - - The RTP header begins with an octet of fields (V, P, X, and CC) to - support specialized RTP uses (see [8] and [9] for details). For - Speex the following values are used. - -Herlein, Valin, et. al. Expires September 3, 2004 [Page 2] -^L -Internet-Draft draft-herlein-avt-rtp-speex-00.txt March 3, 2004 - - - Version (V): 2 bits - This field identifies the version of RTP. The version - used by this specification is two (2). - - Padding (P): 1 bit - If the padding bit is set, the packet contains one or more - additional padding octets at the end which are not part of - the payload. P is set if the total packet size is less than - the MTU. - - Extension (X): 1 bit - If the extension, X, bit is set, the fixed header MUST be - followed by exactly one header extension, with a format defined - in Section 5.3.1. of [8], - - CSRC count (CC): 4 bits - The CSRC count contains the number of CSRC identifiers. - - Marker (M): 1 bit - The M bit indicates if the packet contains comfort noise. This - field is used in conjunction with the cng SDP attribute and is - detailed further in section 5 below. In normal usage this bit - is set if the packet contains comfort noise. - - Payload Type (PT): 7 bits - An RTP profile for a class of applications is expected to assign - a payload type for this format, or a dynamically allocated - payload type SHOULD be chosen which designates the payload as - Speex. - - Sequence number: 16 bits - The sequence number increments by one for each RTP data packet - sent, and may be used by the receiver to detect packet loss and - to restore packet sequence. This field is detailed further in - [2]. - - Timestamp: 32 bits - A timestamp representing the sampling time of the first sample of - the first Speex packet in the RTP packet. The clock frequency - MUST be set to the sample rate of the encoded audio data. - - Speex uses 20 msec frames and a variable sampling rate clock. - The RTP timestamp MUST be in units of 1/X of a second where X - is the sample rate used. Speex uses a nominal 8kHz sampling rate - for narrowband use, a nominal 16kHz sampling rate for wideband use, - and a nominal 32kHz sampling rate for ultra-wideband use. - - SSRC/CSRC identifiers: - These two fields, 32 bits each with one SSRC field and a maximum - of 16 CSRC fields, are as defined in [2]. - - - -Herlein, Valin, et. al. Expires September 3, 2004 [Page 3] -^L -Internet-Draft draft-herlein-avt-rtp-speex-00.txt March 3, 2004 - - -3.2 Speex payload - - For the purposes of packetizing the bit stream in RTP, it is only - necessary to consider the sequence of bits as output by the Speex - encoder [11], and present the same sequence to the decoder. The - payload format described here maintains this sequence. - - A typical Speex frame, encoded at the maximum bitrate, is approx. - 110 octets and the total number of Speex frames SHOULD be kept - less than the path MTU to prevent fragmentation. Speex frames MUST - NOT be fragmented across multiple RTP packets, - - An RTP packet MAY contain Speex frames of the same bit rate or of - varying bit rates, since the bit-rate for a frame is conveyed in - band with the signal. - - The encoding and decoding algorithm can change the bit rate at any - 20 msec frame boundary, with the bit rate change notification provided - in-band with the bit stream. Each frame contains both "mode" - (narrowband, wideband or ultra-wideband) and "sub-mode" (bit-rate) - information in the bit stream. No out-of-band notification is - required for the decoder to process changes in the bit rate sent - by the encoder. - - It is RECOMMENDED that values of 8000, 16000 and 32000 be used - for normal internet telephony applications, though the sample - rate is supported at rates as low as 6000 Hz and as high as - 48 kHz. - - The RTP payload MUST be padded to provide an integer number of - octets as the payload length. These padding bits are LSB aligned - in network byte order and consist of a 0 followed by all ones - (until the end of the octet). This padding is only required for - the last frame in the packet, and only to ensure the packet - contents ends on an octet boundary. - - -3.2.1 Example Speex packet - - In the example below we have a single Speex frame with 5 bits - of padding to ensure the packet size falls on an octet boundary. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |V=2|P|X| CC |M| PT | sequence number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | timestamp | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | synchronization source (SSRC) identifier | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - - -Herlein, Valin, et. al. Expires September 3, 2004 [Page 4] -^L -Internet-Draft draft-herlein-avt-rtp-speex-00.txt March 3, 2004 - - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | contributing source (CSRC) identifiers | - | ... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. |0 1 1 1 1| - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -3.4 Multiple Speex frames in a RTP packet - - Below is an example of two Speex frames contained within one RTP - packet. The Speex frame length in this example fall on an octet - boundary so there is no padding. - - Speex codecs [11] are able to detect the the bitrate from the - payload and are responsible for detecting the 20 msec boundaries - between each frame. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |V=2|P|X| CC |M| PT | sequence number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | timestamp | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | synchronization source (SSRC) identifier | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | contributing source (CSRC) identifiers | - | ... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -4. MIME registration of Speex - - Full definition of the MIME type for Speex will be part of the Ogg - Vorbis MIME type definition application [10]. - - MIME media type name: audio - - MIME subtype: speex - -Herlein, Valin, et. al. Expires September 3, 2004 [Page 5] -^L -Internet-Draft draft-herlein-avt-rtp-speex-00.txt March 3, 2004 - - - Optional parameters: - - Required parameters: to be included in the Ogg MIME specification. - - Encoding considerations: - - Security Considerations: - See Section 6 of RFC 3047. - - Interoperability considerations: none - - Published specification: - - Applications which use this media type: - - Additional information: none - - Person & email address to contact for further information: - Greg Herlein - Jean-Marc Valin - - Intended usage: COMMON - - Author/Change controller: - Author: Greg Herlein - Change controller: Greg Herlein - - This transport type signifies that the content is to be interpreted - according to this document if the contents are transmitted over RTP. - Should this transport type appear over a lossless streaming protocol - such as TCP, the content encapsulation should be interpreted as an - Ogg Stream in accordance with RFC 3534, with the exception that the - content of the Ogg Stream may be assumed to be Speex audio and - Speex audio only. - - -5. SDP usage of Speex - - When conveying information by SDP [4], the encoding name MUST be - set to "speex". An example of the media representation in SDP for - offering a single channel of Speex at 8000 samples per second might - be: - - m=audio 8088 RTP/AVP 97 - a=rtpmap:97 speex/8000 - - Note that the RTP payload type code of 97 is defined in this media - definition to be 'mapped' to the speex codec at an 8kHz sampling - frequency using the 'a=rtpmap' line. Any number from 96 to 127 - could have been chosen (the allowed range for dynamic types). - - - -Herlein, Valin, et. al. Expires September 3, 2004 [Page 6] -^L -Internet-Draft draft-herlein-avt-rtp-speex-00.txt March 3, 2004 - - - The value of the sampling frequency is typically 8000 for narrow band - operation, 16000 for wide band operation, and 32000 for ultra-wide - band operation. - - If for some reason the offerer has bandwidth limitations, the client - may use the "b=" header, as explained in SDP [4]. The following example - illustrates the case where the offerer cannot receive more than - 10 kbit/s. - - m=audio 8088 RTP/AVP 97 - b=AS:10 - a=rtmap:97 speex/8000 - - In this case, if the remote part agrees, it should configure its - Speex encoder so that it does not use modes that produce more than - 10 kbit/s. Note that the "b=" constraint also applies on all - payload types that may be proposed in the media line ("m="). - - An other way to make recommendations to the remote Speex encoder - is to use its specific parameters via the a=fmtp: directive. The - following parameters are defined for use in this way: - - ptime: duration of each packet in milliseconds. - - sr: actual sample rate in Hz. - - ebw: encoding bandwidth - either 'narrow' or 'wide' or - 'ultra' (corresponds to nominal 8000, 16000, and - 32000 Hz sampling rates). - - vbr: variable bit rate - either 'on' 'off' or 'vad' - (defaults to off). If on, variable bit rate is - enabled. If off, disabled. If set to 'vad' then - constant bit rate is used but silence will be encoded - with special short frames to indicate a lack of voice - for that period. - - cng: comfort noise generation - either 'on' or 'off'. If - off then silence frames will be silent; if 'on' then - those frames will be filled with comfort noise. - - mode: Speex encoding mode. Can be {1,2,3,4,5,6,any} - defaults to 3 in narrowband, 6 in wide and ultra-wide. - - penh: use of perceptual enhancement. 1 indicates - to the decoder that perceptual enhancement is recommended, - 0 indicates that it is not. Defaults to on (1). - - - - - - -Herlein, Valin, et. al. Expires September 3, 2004 [Page 7] -^L -Internet-Draft draft-herlein-avt-rtp-speex-00.txt March 3, 2004 - - - Examples: - - m=audio 8008 RTP/AVP 97 - a=rtpmap:97 speex/8000 - a=fmtp:97 mode=4 - - This examples illustrate an offerer that wishes to receive - a Speex stream at 8000Hz, but only using speex mode 3. - - The offerer may suggest to the remote decoder to activate - its perceptual enhancement filter like this: - - m=audio 8088 RTP/AVP 97 - a=rtmap:97 speex/8000 - a=fmtp:97 penh=1 - - Several Speex specific parameters can be given in a single - a=fmtp line provided that they are separated by a semi-colon: - - a=fmtp:97 mode=any;penh=1 - - The offerer may indicate that it wishes to send variable bit rate - frames with comfort noise: - - m=audio 8088 RTP/AVP 97 - a=rtmap:97 speex/8000 - a=fmtp:97 vbr=on;cng=on - - The "ptime" attribute is used to denote the packetization - interval (ie, how many milliseconds of audio is encoded in a - single RTP packet). Since Speex uses 20 msec frames, ptime values - of multiples of 20 denote multiple Speex frames per packet. - Values of ptime which are not multiples of 20 MUST be ignored - and clients MUST use the default value of 20 instead. - - In the example below the ptime value is set to 40, indicating that - there are 2 frames in each packet. - - m=audio 8008 RTP/AVP 97 - a=rtpmap:97 speex/8000 - a=ptime:40 - - Note that the ptime parameter applies to all payloads listed - in the media line and is not used as part of an a=fmtp directive. - - Values of ptime not multiple of 20 msec are meaningless, so the - receiver of such ptime values MUST ignore them. If during the - life of an RTP session the ptime value changes, when there are - multiple Speex frames for example, the SDP value must also reflect - the new value. - - - -Herlein, Valin, et. al. Expires September 3, 2004 [Page 8] -^L -Internet-Draft draft-herlein-avt-rtp-speex-00.txt March 3, 2004 - - - Care must be taken when setting the value of ptime so that the - RTP packet size does not exceed the path MTU. - - -6. ITU H.323/H.245 Use of Speex - - Application is underway to make Speex a standard ITU codec. - However, until that is finalized, Speex MAY be used in H.323 [6] by - using a non-standard codec block definition in the H.245 [7] codec - capability negotiations. - - -6.1 NonStandardMessage format - - For Speex use in H.245 [7] based systems, the fields in the - NonStandardMessage should be: - - t35CountryCode = Hex: B5 - t35Extension = Hex: 00 - manufacturerCode = Hex: 0026 - [Length of the Binary Sequence (8 bit number)] - [Binary Sequence consisting of an ASCII string, no NULL terminator] - - The binary sequence is an ascii string merely for ease of use. - The string is not null terminated. The format of this string is - - speex [optional variables] - - The optional variables are identical to those used for the SDP - a=fmtp strings discussed in section 5 above. The string is built - to be all on one line, each key-value pair separated by a - semi-colon. The optional variables MAY be omitted, which causes - the default values to be assumed. They are: - - ebw=narrow;mode=3;vbr=off;cng=off;ptime=20;sr=8000;penh=no; - - The fifth byte of the block is the length of the binary sequence. - - NOTE: this method can result in the advertising of a large number - of Speex 'codecs' based on the number of variables possible. For - most VoIP applications, use of the default binary sequence of - 'speex' is RECOMMENDED to be used in addition to all other options. - This maximizes the chances that two H.323 based applications that - support Speex can find a mutual codec. - - -6.2 RTP Payload Types - - Dynamic payload type codes MUST be negotiated 'out-of-band' - for the assignment of a dynamic payload type from the - range of 96-127. H.323 applications MUST use the H.245 - H2250LogicalChannelParameters encoding to accomplish this. - -Herlein, Valin, et. al. Expires September 3, 2004 [Page 9] -^L -Internet-Draft draft-herlein-avt-rtp-speex-00.txt March 3, 2004 - - -7. Security Considerations - - RTP packets using the payload format defined in this specification - are subject to the security considerations discussed in the RTP - specification [2], and any appropriate RTP profile. This implies - that confidentiality of the media streams is achieved by encryption. - Because the data compression used with this payload format is applied - end-to-end, encryption may be performed after compression so there is - no conflict between the two operations. - - A potential denial-of-service threat exists for data encodings using - compression techniques that have non-uniform receiver-end - computational load. The attacker can inject pathological datagrams - into the stream which are complex to decode and cause the receiver to - be overloaded. However, this encoding does not exhibit any - significant non-uniformity. - - As with any IP-based protocol, in some circumstances a receiver may - be overloaded simply by the receipt of too many packets, either - desired or undesired. Network-layer authentication may be used to - discard packets from undesired sources, but the processing cost of - the authentication itself may be too high. - - -8. Normative References - - 1. Bradner, S., "The Internet Standards Process -- Revision 3", BCP - 9, RFC 2026, October 1996. - - 2. Schulzrinne, H., Casner, S., Frederick, R. and V. Jacobson, "RTP: - A Transport Protocol for real-time applications", RFC 1889, - January 1996. - - 3. Freed, N. and N. Borenstein, "Multipurpose Internet Mail - Extensions (MIME) Part One: Format of Internet Message Bodies", - RFC 2045, November 1996. - - 4. Handley, M. and V. Jacobson, "SDP: Session Description - Protocol", RFC 2327, April 1998. - - 5. Bradner, S., "Key words for use in RFCs to Indicate Requirement - Levels", BCP 14, RFC 2119, March 1997. - - 6. ITU-T Recommendation H.323. "Packet-based Multimedia - Communications Systems," 1998. - - 7. ITU-T Recommendation H.245 (1998), "Control of communications - between Visual Telephone Systems and Terminal Equipment". - - 8. RTP: A transport protocol for real-time applications. Work - in progress, draft-ietf-avt-rtp-new-12.txt. - -Herlein, Valin, et. al. Expires September 3, 2004 [Page 10] -^L -Internet-Draft draft-herlein-avt-rtp-speex-00.txt March 3, 2004 - - - 9. RTP Profile for Audio and Video Conferences with Minimal - Control. Work in progress, draft-ietf-avt-profile-new-13.txt. - - 10. L. Walleij, "The application/ogg Media Type", RFC 3534, May - 2003. - - -8.1 Informative References - - 11. Speexenc/speexdec, reference command-line encoder/decoder, - Speex website, http://www.speex.org/ - - 12. CELP, U.S. Federal Standard 1016. National Technical - Information Service (NTIS) website, http://www.ntis.gov/ - - -9. Acknowledgments - - The authors would like to thank Equivalence Pty Ltd of Australia - for their assistance in attempting to standardize the use of Speex - in H.323 applications, and for implementing Speex in their open - source OpenH323 stack. The authors would also like to thank Brian - C. Wiles of StreamComm for his assistance in - developing the proposed standard for Speex use in H.323 - applications. - - The authors would also like to thank the following members of the - Speex and AVT communities for their input: Ross Finlayson, - Federico Montesino Pouzols, Henning Schulzrinne, Magnus Westerlund. - - -10. Author's Address - - Greg Herlein - 2034 Filbert Street - San Francisco, CA - United States 94123 - - - Jean-Marc Valin - Department of Electrical and Computer Engineering - University of Sherbrooke - 2500 blvd UniversitüÃü­üÃé - Sherbrooke, Quebec, Canada, J1K 2R1 - - - Simon MORLAT - 35, av de Vizille App 42 - 38000 GRENOBLE - FRANCE - - - - -Herlein, Valin, et. al. Expires September 3, 2004 [Page 11] -^L -Internet-Draft draft-herlein-avt-rtp-speex-00.txt March 3, 2004 - - - Roger Hardiman - 49 Nettleton Road - Cheltenham - Gloucestershire - GL51 6NR - England - - - Phil Kerr - Centre for Music Technology - University of Glasgow - Glasgow - G12 8LT - Scotland - - -10. Full Copyright Statement - - Copyright (C) The Internet Society (2003). All Rights Reserved. - - This document and translations of it may be copied and furnished to - others, and derivative works that comment on or otherwise explain it - or assist in its implementation may be prepared, copied, published - and distributed, in whole or in part, without restriction of any - kind, provided that the above copyright notice and this paragraph are - included on all such copies and derivative works. However, this - document itself may not be modified in any way, such as by removing - the copyright notice or references to the Internet Society or other - Internet organizations, except as needed for the purpose of - developing Internet standards in which case the procedures for - copyrights defined in the Internet Standards process must be - followed, or as required to translate it into languages other than - English. - - The limited permissions granted above are perpetual and will not be - revoked by the Internet Society or its successors or assigns. - - This document and the information contained herein is provided on an - "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING - TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION - HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF - MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - -Acknowledgement - - Funding for the RFC Editor function is currently provided by the - Internet Society. - - - - -Herlein, Valin, et. al. Expires September 3, 2004 [Page 12] -^L - - diff --git a/Engine/lib/speex/doc/draft-herlein-speex-rtp-profile-02.txt b/Engine/lib/speex/doc/draft-herlein-speex-rtp-profile-02.txt deleted file mode 100644 index 2b25ea64c..000000000 --- a/Engine/lib/speex/doc/draft-herlein-speex-rtp-profile-02.txt +++ /dev/null @@ -1,841 +0,0 @@ - - -AVT Working Group G. Herlein -Internet-Draft S. Morlat -Expires: October 3, 2005 J. Jean-Marc - R. Hardiman - P. Kerr - April 04, 2005 - - - draft-herlein-speex-rtp-profile-02 - RTP Payload Format for the Speex Codec - -Status of this Memo - - This document is an Internet-Draft and is subject to all provisions - of section 3 of RFC 3667. By submitting this Internet-Draft, each - author represents that any applicable patent or other IPR claims of - which he or she is aware have been or will be disclosed, and any of - which he or she become aware will be disclosed, in accordance with - RFC 3668. - - Internet-Drafts are working documents of the Internet Engineering - Task Force (IETF), its areas, and its working groups. Note that - other groups may also distribute working documents as - Internet-Drafts. - - Internet-Drafts are draft documents valid for a maximum of six months - and may be updated, replaced, or obsoleted by other documents at any - time. It is inappropriate to use Internet-Drafts as reference - material or to cite them other than as "work in progress." - - The list of current Internet-Drafts can be accessed at - http://www.ietf.org/ietf/1id-abstracts.txt. - - The list of Internet-Draft Shadow Directories can be accessed at - http://www.ietf.org/shadow.html. - - This Internet-Draft will expire on October 3, 2005. - -Copyright Notice - - Copyright (C) The Internet Society (2005). - -Abstract - - Speex is an open-source voice codec suitable for use in Voice over IP - (VoIP) type applications. This document describes the payload format - for Speex generated bit streams within an RTP packet. Also included - here are the necessary details for the use of Speex with the Session - Description Protocol (SDP) and a preliminary method of using Speex - - - -Herlein, et al. Expires October 3, 2005 [Page 1] - -Internet-Draft draft-herlein-speex-rtp-profile-02 April 2005 - - - within H.323 applications. - -Table of Contents - - 1. Conventions used in this document . . . . . . . . . . . . . 3 - 2. Overview of the Speex Codec . . . . . . . . . . . . . . . . 3 - 3. RTP payload format for Speex . . . . . . . . . . . . . . . . 3 - 4. RTP Header . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 5. Speex payload . . . . . . . . . . . . . . . . . . . . . . . 5 - 6. Example Speex packet . . . . . . . . . . . . . . . . . . . . 6 - 7. Multiple Speex frames in a RTP packet . . . . . . . . . . . 6 - 8. MIME registration of Speex . . . . . . . . . . . . . . . . . 7 - 9. SDP usage of Speex . . . . . . . . . . . . . . . . . . . . . 8 - 10. ITU H.323/H.245 Use of Speex . . . . . . . . . . . . . . . . 10 - 11. NonStandardMessage format . . . . . . . . . . . . . . . . . 10 - 12. RTP Payload Types . . . . . . . . . . . . . . . . . . . . . 11 - 13. Security Considerations . . . . . . . . . . . . . . . . . . 11 - 14. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . 12 - 15. References . . . . . . . . . . . . . . . . . . . . . . . . . 12 - 15.1 Normative References . . . . . . . . . . . . . . . . . . . 12 - 15.2 Informative References . . . . . . . . . . . . . . . . . . 13 - Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 13 - Intellectual Property and Copyright Statements . . . . . . . 15 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires October 3, 2005 [Page 2] - -Internet-Draft draft-herlein-speex-rtp-profile-02 April 2005 - - -1. Conventions used in this document - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", - "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this - document are to be interpreted as described in RFC 2119 [1]. - -2. Overview of the Speex Codec - - Speex is based on the CELP [10] encoding technique with support for - either narrowband (nominal 8kHz), wideband (nominal 16kHz) or - ultra-wideband (nominal 32kHz), and (non-optimal) rates up to 48 kHz - sampling also available. The main characteristics can be summarized - as follows: - - o Free software/open-source - o Integration of wideband and narrowband in the same bit-stream - o Wide range of bit-rates available - o Dynamic bit-rate switching and variable bit-rate (VBR) - o Voice Activity Detection (VAD, integrated with VBR) - o Variable complexity - -3. RTP payload format for Speex - - For RTP based transportation of Speex encoded audio the standard RTP - header [2] is followed by one or more payload data blocks. An - optional padding terminator may also be used. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | RTP Header | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | one or more frames of Speex .... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | one or more frames of Speex .... | padding | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -4. RTP Header - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |V=2|P|X| CC |M| PT | sequence number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | timestamp | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | synchronization source (SSRC) identifier | - - - -Herlein, et al. Expires October 3, 2005 [Page 3] - -Internet-Draft draft-herlein-speex-rtp-profile-02 April 2005 - - - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | contributing source (CSRC) identifiers | - | ... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - The RTP header begins with an octet of fields (V, P, X, and CC) to - support specialized RTP uses (see [2] and [7] for details). For - Speex the following values are used. - - Version (V): 2 bits - - This field identifies the version of RTP. The version used by this - specification is two [2]. - - Padding (P): 1 bit - - If the padding bit is set, the packet contains one or more additional - padding octets at the end which are not part of the payload. P is - set if the total packet size is less than the MTU. - - Extension (X): 1 bit - - If the extension, X, bit is set, the fixed header MUST be followed by - exactly one header extension, with a format defined in Section 5.3.1. - of [2]. - - CSRC count (CC): 4 bits - - The CSRC count contains the number of CSRC identifiers. - - Marker (M): 1 bit - - The M bit indicates if the packet contains comfort noise. This field - is used in conjunction with the cng SDP attribute and is detailed - further in section 5 below. In normal usage this bit is set if the - packet contains comfort noise. - - Payload Type (PT): 7 bits - - An RTP profile for a class of applications is expected to assign a - payload type for this format, or a dynamically allocated payload type - SHOULD be chosen which designates the payload as Speex. - - Sequence number: 16 bits - - The sequence number increments by one for each RTP data packet sent, - and may be used by the receiver to detect packet loss and to restore - packet sequence. This field is detailed further in [2]. - - - -Herlein, et al. Expires October 3, 2005 [Page 4] - -Internet-Draft draft-herlein-speex-rtp-profile-02 April 2005 - - - Timestamp: 32 bits - - A timestamp representing the sampling time of the first sample of the - first Speex packet in the RTP packet. The clock frequency MUST be - set to the sample rate of the encoded audio data. Speex uses 20 msec - frames and a variable sampling rate clock. The RTP timestamp MUST be - in units of 1/X of a second where X is the sample rate used. Speex - uses a nominal 8kHz sampling rate for narrowband use, a nominal 16kHz - sampling rate for wideband use, and a nominal 32kHz sampling rate for - ultra-wideband use. - - SSRC/CSRC identifiers: - - These two fields, 32 bits each with one SSRC field and a maximum of - 16 CSRC fields, are as defined in [2]. - -5. Speex payload - - For the purposes of packetizing the bit stream in RTP, it is only - necessary to consider the sequence of bits as output by the Speex - encoder [9], and present the same sequence to the decoder. The - payload format described here maintains this sequence. - - A typical Speex frame, encoded at the maximum bitrate, is approx. - 110 octets and the total number of Speex frames SHOULD be kept less - than the path MTU to prevent fragmentation. Speex frames MUST NOT be - fragmented across multiple RTP packets, - - An RTP packet MAY contain Speex frames of the same bit rate or of - varying bit rates, since the bit-rate for a frame is conveyed in band - with the signal. - - The encoding and decoding algorithm can change the bit rate at any 20 - msec frame boundary, with the bit rate change notification provided - in-band with the bit stream. Each frame contains both "mode" - (narrowband, wideband or ultra-wideband) and "sub-mode" (bit-rate) - information in the bit stream. No out-of-band notification is - required for the decoder to process changes in the bit rate sent by - the encoder. - - It is RECOMMENDED that values of 8000, 16000 and 32000 be used for - normal internet telephony applications, though the sample rate is - supported at rates as low as 6000 Hz and as high as 48 kHz. - - The RTP payload MUST be padded to provide an integer number of octets - as the payload length. These padding bits are LSB aligned in network - octet order and consist of a 0 followed by all ones (until the end of - the octet). This padding is only required for the last frame in the - - - -Herlein, et al. Expires October 3, 2005 [Page 5] - -Internet-Draft draft-herlein-speex-rtp-profile-02 April 2005 - - - packet, and only to ensure the packet contents ends on an octet - boundary. - -6. Example Speex packet - - In the example below we have a single Speex frame with 5 bits of - padding to ensure the packet size falls on an octet boundary. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |V=2|P|X| CC |M| PT | sequence number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | timestamp | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | synchronization source (SSRC) identifier | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | contributing source (CSRC) identifiers | - | ... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. |0 1 1 1 1| - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -7. Multiple Speex frames in a RTP packet - - Below is an example of two Speex frames contained within one RTP - packet. The Speex frame length in this example fall on an octet - boundary so there is no padding. - - Speex codecs [9] are able to detect the the bitrate from the payload - and are responsible for detecting the 20 msec boundaries between each - frame. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |V=2|P|X| CC |M| PT | sequence number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | timestamp | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - - -Herlein, et al. Expires October 3, 2005 [Page 6] - -Internet-Draft draft-herlein-speex-rtp-profile-02 April 2005 - - - | synchronization source (SSRC) identifier | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | contributing source (CSRC) identifiers | - | ... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -8. MIME registration of Speex - - Full definition of the MIME [3] type for Speex will be part of the - Ogg Vorbis MIME type definition application [8]. - - MIME media type name: audio - - MIME subtype: speex - - Optional parameters: - - Required parameters: to be included in the Ogg MIME specification. - - Encoding considerations: - - Security Considerations: - - See Section 6 of RFC 3047. - - Interoperability considerations: none - - Published specification: - - Applications which use this media type: - - Additional information: none - - Person & email address to contact for further information: - - Greg Herlein - Jean-Marc Valin - - Intended usage: COMMON - - - - -Herlein, et al. Expires October 3, 2005 [Page 7] - -Internet-Draft draft-herlein-speex-rtp-profile-02 April 2005 - - - Author/Change controller: - - Author: Greg Herlein - Change controller: Greg Herlein - Change controller: IETF AVT Working Group - - This transport type signifies that the content is to be interpreted - according to this document if the contents are transmitted over RTP. - Should this transport type appear over a lossless streaming protocol - such as TCP, the content encapsulation should be interpreted as an - Ogg Stream in accordance with [8], with the exception that the - content of the Ogg Stream may be assumed to be Speex audio and Speex - audio only. - -9. SDP usage of Speex - - When conveying information by SDP [4], the encoding name MUST be set - to "speex". An example of the media representation in SDP for - offering a single channel of Speex at 8000 samples per second might - be: - - m=audio 8088 RTP/AVP 97 - a=rtpmap:97 speex/8000 - - Note that the RTP payload type code of 97 is defined in this media - definition to be 'mapped' to the speex codec at an 8kHz sampling - frequency using the 'a=rtpmap' line. Any number from 96 to 127 could - have been chosen (the allowed range for dynamic types). - - The value of the sampling frequency is typically 8000 for narrow band - operation, 16000 for wide band operation, and 32000 for ultra-wide - band operation. - - If for some reason the offerer has bandwidth limitations, the client - may use the "b=" header, as explained in SDP [4]. The following - example illustrates the case where the offerer cannot receive more - than 10 kbit/s. - - m=audio 8088 RTP/AVP 97 - b=AS:10 - a=rtmap:97 speex/8000 - - In this case, if the remote part agrees, it should configure its - Speex encoder so that it does not use modes that produce more than 10 - kbit/s. Note that the "b=" constraint also applies on all payload - types that may be proposed in the media line ("m="). - - An other way to make recommendations to the remote Speex encoder is - - - -Herlein, et al. Expires October 3, 2005 [Page 8] - -Internet-Draft draft-herlein-speex-rtp-profile-02 April 2005 - - - to use its specific parameters via the a=fmtp: directive. The - following parameters are defined for use in this way: - - ptime: duration of each packet in milliseconds. - - sr: actual sample rate in Hz. - - ebw: encoding bandwidth - either 'narrow' or 'wide' or 'ultra' - (corresponds to nominal 8000, 16000, and 32000 Hz sampling rates). - - vbr: variable bit rate - either 'on' 'off' or 'vad' (defaults - to off). If on, variable bit rate is enabled. If off, disabled. - If set to 'vad' then constant bit rate is used but silence will be - encoded with special short frames to indicate a lack of voice for - that period. - - cng: comfort noise generation - either 'on' or 'off'. If off - then silence frames will be silent; if 'on' then those frames will - be filled with comfort noise. - - mode: Speex encoding mode. Can be {1,2,3,4,5,6,any} defaults to - 3 in narrowband, 6 in wide and ultra-wide. - - penh: use of perceptual enhancement. 1 indicates to the decoder - that perceptual enhancement is recommended, 0 indicates that it is - not. Defaults to on (1). - - - Examples: - - m=audio 8008 RTP/AVP 97 - a=rtpmap:97 speex/8000 - a=fmtp:97 mode=4 - - This examples illustrate an offerer that wishes to receive a Speex - stream at 8000Hz, but only using speex mode 3. - - The offerer may suggest to the remote decoder to activate its - perceptual enhancement filter like this: - - m=audio 8088 RTP/AVP 97 - a=rtmap:97 speex/8000 - a=fmtp:97 penh=1 - - Several Speex specific parameters can be given in a single a=fmtp - line provided that they are separated by a semi-colon: - - - - - -Herlein, et al. Expires October 3, 2005 [Page 9] - -Internet-Draft draft-herlein-speex-rtp-profile-02 April 2005 - - - a=fmtp:97 mode=any;penh=1 - - The offerer may indicate that it wishes to send variable bit rate - frames with comfort noise: - - m=audio 8088 RTP/AVP 97 - a=rtmap:97 speex/8000 - a=fmtp:97 vbr=on;cng=on - - The "ptime" attribute is used to denote the packetization interval - (ie, how many milliseconds of audio is encoded in a single RTP - packet). Since Speex uses 20 msec frames, ptime values of multiples - of 20 denote multiple Speex frames per packet. Values of ptime which - are not multiples of 20 MUST be ignored and clients MUST use the - default value of 20 instead. - - In the example below the ptime value is set to 40, indicating that - there are 2 frames in each packet. - - m=audio 8008 RTP/AVP 97 - a=rtpmap:97 speex/8000 - a=ptime:40 - - Note that the ptime parameter applies to all payloads listed in the - media line and is not used as part of an a=fmtp directive. - - Values of ptime not multiple of 20 msec are meaningless, so the - receiver of such ptime values MUST ignore them. If during the life - of an RTP session the ptime value changes, when there are multiple - Speex frames for example, the SDP value must also reflect the new - value. - - Care must be taken when setting the value of ptime so that the RTP - packet size does not exceed the path MTU. - -10. ITU H.323/H.245 Use of Speex - - Application is underway to make Speex a standard ITU codec. However, - until that is finalized, Speex MAY be used in H.323 [5] by using a - non-standard codec block definition in the H.245 [6] codec capability - negotiations. - -11. NonStandardMessage format - - For Speex use in H.245 [6] based systems, the fields in the - NonStandardMessage should be: - - - - - -Herlein, et al. Expires October 3, 2005 [Page 10] - -Internet-Draft draft-herlein-speex-rtp-profile-02 April 2005 - - - t35CountryCode = Hex: B5 - t35Extension = Hex: 00 - manufacturerCode = Hex: 0026 - [Length of the Binary Sequence (8 bit number)] - [Binary Sequence consisting of an ASCII string, no NULL - terminator] - - The binary sequence is an ascii string merely for ease of use. The - string is not null terminated. The format of this string is - - speex [optional variables] - - The optional variables are identical to those used for the SDP a=fmtp - strings discussed in section 5 above. The string is built to be all - on one line, each key-value pair separated by a semi-colon. The - optional variables MAY be omitted, which causes the default values to - be assumed. They are: - - ebw=narrow;mode=3;vbr=off;cng=off;ptime=20;sr=8000;penh=no; - - The fifth octet of the block is the length of the binary sequence. - - NOTE: this method can result in the advertising of a large number of - Speex 'codecs' based on the number of variables possible. For most - VoIP applications, use of the default binary sequence of 'speex' is - RECOMMENDED to be used in addition to all other options. This - maximizes the chances that two H.323 based applications that support - Speex can find a mutual codec. - -12. RTP Payload Types - - Dynamic payload type codes MUST be negotiated 'out-of-band' for the - assignment of a dynamic payload type from the range of 96-127. H.323 - applications MUST use the H.245 H2250LogicalChannelParameters - encoding to accomplish this. - -13. Security Considerations - - RTP packets using the payload format defined in this specification - are subject to the security considerations discussed in the RTP - specification [2], and any appropriate RTP profile. This implies - that confidentiality of the media streams is achieved by encryption. - Because the data compression used with this payload format is applied - end-to-end, encryption may be performed after compression so there is - no conflict between the two operations. - - A potential denial-of-service threat exists for data encodings using - compression techniques that have non-uniform receiver-end - - - -Herlein, et al. Expires October 3, 2005 [Page 11] - -Internet-Draft draft-herlein-speex-rtp-profile-02 April 2005 - - - computational load. The attacker can inject pathological datagrams - into the stream which are complex to decode and cause the receiver to - be overloaded. However, this encoding does not exhibit any - significant non-uniformity. - - As with any IP-based protocol, in some circumstances a receiver may - be overloaded simply by the receipt of too many packets, either - desired or undesired. Network-layer authentication may be used to - discard packets from undesired sources, but the processing cost of - the authentication itself may be too high. - -14. Acknowledgments - - The authors would like to thank Equivalence Pty Ltd of Australia for - their assistance in attempting to standardize the use of Speex in - H.323 applications, and for implementing Speex in their open source - OpenH323 stack. The authors would also like to thank Brian C. Wiles - of StreamComm for his assistance in developing - the proposed standard for Speex use in H.323 applications. - - The authors would also like to thank the following members of the - Speex and AVT communities for their input: Ross Finlayson, Federico - Montesino Pouzols, Henning Schulzrinne, Magnus Westerlund. - -15. References - -15.1 Normative References - - [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement - Levels", RFC 2119. - - [2] Schulzrinne, H., Casner, S., Frederick, R. and V. Jacobson, - "RTP: A Transport Protocol for real-time applications", RFC - 3550. - - [3] "Multipurpose Internet Mail Extensions (MIME) Part One: Format - of Internet Message Bodies", RFC 2045. - - [4] Jacobson, V. and M. Handley, "SDP: Session Description - Protocol", RFC 2327. - - [5] "Packet-based Multimedia Communications Systems", ITU-T - Recommendation H.323. - - [6] "Control of communications between Visual Telephone Systems and - Terminal Equipment", ITU-T Recommendation H.245. - - [7] Schulzrinne, H. and S. Casner, "RTP Profile for Audio and Video - - - -Herlein, et al. Expires October 3, 2005 [Page 12] - -Internet-Draft draft-herlein-speex-rtp-profile-02 April 2005 - - - Conferences with Minimal Control.", RFC 3551. - - [8] Walleij, L., "The application/ogg Media Type", RFC 3534. - -15.2 Informative References - - [9] "Speexenc/speexdec, reference command-line encoder/decoder", - Speex website http://www.speex.org/. - - [10] "CELP, U.S. Federal Standard 1016.", National Technical - Information Service (NTIS) website http://www.ntis.gov/. - - -Authors' Addresses - - Greg Herlein - 2034 Filbert Street - San Francisco, California 94123 - United States - - EMail: gherlein@herlein.com - - - Simon Morlat - 35, av de Vizille App 42 - Grenoble 38000 - France - - EMail: simon.morlat@linphone.org - - - Jean-Marc Valin - Department of Electrical and Computer Engineering - University of Sherbrooke - 2500 blvd Universite - Sherbrooke, Quebec J1K 2R1 - Canada - - EMail: jean-marc.valin@hermes.usherb.ca - - - Roger Hardiman - 49 Nettleton Road - Cheltenham, Gloucestershire GL51 6NR - England - - EMail: roger@freebsd.org - - - - -Herlein, et al. Expires October 3, 2005 [Page 13] - -Internet-Draft draft-herlein-speex-rtp-profile-02 April 2005 - - - Phil Kerr - England - - EMail: phil@plus24.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires October 3, 2005 [Page 14] - -Internet-Draft draft-herlein-speex-rtp-profile-02 April 2005 - - -Intellectual Property Statement - - The IETF takes no position regarding the validity or scope of any - Intellectual Property Rights or other rights that might be claimed to - pertain to the implementation or use of the technology described in - this document or the extent to which any license under such rights - might or might not be available; nor does it represent that it has - made any independent effort to identify any such rights. Information - on the procedures with respect to rights in RFC documents can be - found in BCP 78 and BCP 79. - - Copies of IPR disclosures made to the IETF Secretariat and any - assurances of licenses to be made available, or the result of an - attempt made to obtain a general license or permission for the use of - such proprietary rights by implementers or users of this - specification can be obtained from the IETF on-line IPR repository at - http://www.ietf.org/ipr. - - The IETF invites any interested party to bring to its attention any - copyrights, patents or patent applications, or other proprietary - rights that may cover technology that may be required to implement - this standard. Please address the information to the IETF at - ietf-ipr@ietf.org. - - -Disclaimer of Validity - - This document and the information contained herein are provided on an - "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS - OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET - ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, - INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE - INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED - WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - -Copyright Statement - - Copyright (C) The Internet Society (2005). This document is subject - to the rights, licenses and restrictions contained in BCP 78, and - except as set forth therein, the authors retain all their rights. - - -Acknowledgment - - Funding for the RFC Editor function is currently provided by the - Internet Society. - - - - -Herlein, et al. Expires October 3, 2005 [Page 15] - - diff --git a/Engine/lib/speex/doc/draft-herlein-speex-rtp-profile-03.txt b/Engine/lib/speex/doc/draft-herlein-speex-rtp-profile-03.txt deleted file mode 100644 index d1ad4b378..000000000 --- a/Engine/lib/speex/doc/draft-herlein-speex-rtp-profile-03.txt +++ /dev/null @@ -1,1232 +0,0 @@ - - -AVT Working Group G. Herlein -Internet-Draft S. Morlat -Expires: July 2, 2005 J. Jean-Marc - R. Hardiman - P. Kerr - January 01, 2005 - - - draft-herlein-speex-rtp-profile-03 - RTP Payload Format for the Speex Codec - -Status of this Memo - - This document is an Internet-Draft and is subject to all provisions - of section 3 of RFC 3667. By submitting this Internet-Draft, each - author represents that any applicable patent or other IPR claims of - which he or she is aware have been or will be disclosed, and any of - which he or she become aware will be disclosed, in accordance with - RFC 3668. - - Internet-Drafts are working documents of the Internet Engineering - Task Force (IETF), its areas, and its working groups. Note that - other groups may also distribute working documents as - Internet-Drafts. - - Internet-Drafts are draft documents valid for a maximum of six months - and may be updated, replaced, or obsoleted by other documents at any - time. It is inappropriate to use Internet-Drafts as reference - material or to cite them other than as "work in progress." - - The list of current Internet-Drafts can be accessed at - http://www.ietf.org/ietf/1id-abstracts.txt. - - The list of Internet-Draft Shadow Directories can be accessed at - http://www.ietf.org/shadow.html. - - This Internet-Draft will expire on July 2, 2005. - -Copyright Notice - - Copyright (C) The Internet Society (2005). - -Abstract - - Speex is an open-source voice codec suitable for use in Voice over IP - (VoIP) type applications. This document describes the payload format - for Speex generated bit streams within an RTP packet. Also included - here are the necessary details for the use of Speex with the Session - Description Protocol (SDP) and a preliminary method of using Speex - - - -Herlein, et al. Expires July 2, 2005 [Page 1] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - - within H.323 applications. - -Table of Contents - - 1. Conventions used in this document . . . . . . . . . . . . . 3 - 2. Overview of the Speex Codec . . . . . . . . . . . . . . . . 4 - 3. RTP payload format for Speex . . . . . . . . . . . . . . . . 5 - 4. RTP Header . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 5. Speex payload . . . . . . . . . . . . . . . . . . . . . . . 8 - 6. Example Speex packet . . . . . . . . . . . . . . . . . . . . 9 - 7. Multiple Speex frames in a RTP packet . . . . . . . . . . . 10 - 8. MIME registration of Speex . . . . . . . . . . . . . . . . . 11 - 9. SDP usage of Speex . . . . . . . . . . . . . . . . . . . . . 12 - 10. ITU H.323/H.245 Use of Speex . . . . . . . . . . . . . . . . 15 - 11. NonStandardMessage format . . . . . . . . . . . . . . . . . 16 - 12. RTP Payload Types . . . . . . . . . . . . . . . . . . . . . 17 - 13. Security Considerations . . . . . . . . . . . . . . . . . . 18 - 14. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . 19 - 15. References . . . . . . . . . . . . . . . . . . . . . . . . . 20 - 15.1 Normative References . . . . . . . . . . . . . . . . . . . 20 - 15.2 Informative References . . . . . . . . . . . . . . . . . . 20 - Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 20 - Intellectual Property and Copyright Statements . . . . . . . 22 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires July 2, 2005 [Page 2] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - -1. Conventions used in this document - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", - "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this - document are to be interpreted as described in RFC 2119 [1]. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires July 2, 2005 [Page 3] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - -2. Overview of the Speex Codec - - Speex is based on the CELP [10] encoding technique with support for - either narrowband (nominal 8kHz), wideband (nominal 16kHz) or - ultra-wideband (nominal 32kHz), and (non-optimal) rates up to 48 kHz - sampling also available. The main characteristics can be summarized - as follows: - - o Free software/open-source - o Integration of wideband and narrowband in the same bit-stream - o Wide range of bit-rates available - o Dynamic bit-rate switching and variable bit-rate (VBR) - o Voice Activity Detection (VAD, integrated with VBR) - o Variable complexity - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires July 2, 2005 [Page 4] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - -3. RTP payload format for Speex - - For RTP based transportation of Speex encoded audio the standard RTP - header [2] is followed by one or more payload data blocks. An - optional padding terminator may also be used. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | RTP Header | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | one or more frames of Speex .... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | one or more frames of Speex .... | padding | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires July 2, 2005 [Page 5] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - -4. RTP Header - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |V=2|P|X| CC |M| PT | sequence number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | timestamp | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | synchronization source (SSRC) identifier | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | contributing source (CSRC) identifiers | - | ... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - The RTP header begins with an octet of fields (V, P, X, and CC) to - support specialized RTP uses (see [2] and [7] for details). For - Speex the following values are used. - - Version (V): 2 bits - - This field identifies the version of RTP. The version used by this - specification is two [2]. - - Padding (P): 1 bit - - If the padding bit is set, the packet contains one or more additional - padding octets at the end which are not part of the payload. P is - set if the total packet size is less than the MTU. - - Extension (X): 1 bit - - If the extension, X, bit is set, the fixed header MUST be followed by - exactly one header extension, with a format defined in Section 5.3.1. - of [2]. - - CSRC count (CC): 4 bits - - The CSRC count contains the number of CSRC identifiers. - - Marker (M): 1 bit - - The M bit indicates if the packet contains comfort noise. This field - is used in conjunction with the cng SDP attribute and is detailed - further in section 5 below. In normal usage this bit is set if the - packet contains comfort noise. - - Payload Type (PT): 7 bits - - - -Herlein, et al. Expires July 2, 2005 [Page 6] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - - An RTP profile for a class of applications is expected to assign a - payload type for this format, or a dynamically allocated payload type - SHOULD be chosen which designates the payload as Speex. - - Sequence number: 16 bits - - The sequence number increments by one for each RTP data packet sent, - and may be used by the receiver to detect packet loss and to restore - packet sequence. This field is detailed further in [2]. - - Timestamp: 32 bits - - A timestamp representing the sampling time of the first sample of the - first Speex packet in the RTP packet. The clock frequency MUST be - set to the sample rate of the encoded audio data. Speex uses 20 msec - frames and a variable sampling rate clock. The RTP timestamp MUST be - in units of 1/X of a second where X is the sample rate used. Speex - uses a nominal 8kHz sampling rate for narrowband use, a nominal 16kHz - sampling rate for wideband use, and a nominal 32kHz sampling rate for - ultra-wideband use. - - SSRC/CSRC identifiers: - - These two fields, 32 bits each with one SSRC field and a maximum of - 16 CSRC fields, are as defined in [2]. - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires July 2, 2005 [Page 7] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - -5. Speex payload - - For the purposes of packetizing the bit stream in RTP, it is only - necessary to consider the sequence of bits as output by the Speex - encoder [9], and present the same sequence to the decoder. The - payload format described here maintains this sequence. - - A typical Speex frame, encoded at the maximum bitrate, is approx. - 110 octets and the total number of Speex frames SHOULD be kept less - than the path MTU to prevent fragmentation. Speex frames MUST NOT be - fragmented across multiple RTP packets, - - An RTP packet MAY contain Speex frames of the same bit rate or of - varying bit rates, since the bit-rate for a frame is conveyed in band - with the signal. - - The encoding and decoding algorithm can change the bit rate at any 20 - msec frame boundary, with the bit rate change notification provided - in-band with the bit stream. Each frame contains both "mode" - (narrowband, wideband or ultra-wideband) and "sub-mode" (bit-rate) - information in the bit stream. No out-of-band notification is - required for the decoder to process changes in the bit rate sent by - the encoder. - - It is RECOMMENDED that values of 8000, 16000 and 32000 be used for - normal internet telephony applications, though the sample rate is - supported at rates as low as 6000 Hz and as high as 48 kHz. - - The RTP payload MUST be padded to provide an integer number of octets - as the payload length. These padding bits are LSB aligned in network - octet order and consist of a 0 followed by all ones (until the end of - the octet). This padding is only required for the last frame in the - packet, and only to ensure the packet contents ends on an octet - boundary. - - - - - - - - - - - - - - - - - -Herlein, et al. Expires July 2, 2005 [Page 8] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - -6. Example Speex packet - - In the example below we have a single Speex frame with 5 bits of - padding to ensure the packet size falls on an octet boundary. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |V=2|P|X| CC |M| PT | sequence number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | timestamp | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | synchronization source (SSRC) identifier | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | contributing source (CSRC) identifiers | - | ... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. |0 1 1 1 1| - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires July 2, 2005 [Page 9] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - -7. Multiple Speex frames in a RTP packet - - Below is an example of two Speex frames contained within one RTP - packet. The Speex frame length in this example fall on an octet - boundary so there is no padding. - - Speex codecs [9] are able to detect the the bitrate from the payload - and are responsible for detecting the 20 msec boundaries between each - frame. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |V=2|P|X| CC |M| PT | sequence number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | timestamp | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | synchronization source (SSRC) identifier | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | contributing source (CSRC) identifiers | - | ... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires July 2, 2005 [Page 10] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - -8. MIME registration of Speex - - Full definition of the MIME [3] type for Speex will be part of the - Ogg Vorbis MIME type definition application [8]. - - MIME media type name: audio - - MIME subtype: speex - - Optional parameters: - - Required parameters: to be included in the Ogg MIME specification. - - Encoding considerations: - - Security Considerations: - - See Section 6 of RFC 3047. - - Interoperability considerations: none - - Published specification: - - Applications which use this media type: - - Additional information: none - - Person & email address to contact for further information: - - Greg Herlein - Jean-Marc Valin - - Intended usage: COMMON - - Author/Change controller: - - Author: Greg Herlein - Change controller: Greg Herlein - Change controller: IETF AVT Working Group - - This transport type signifies that the content is to be interpreted - according to this document if the contents are transmitted over RTP. - Should this transport type appear over a lossless streaming protocol - such as TCP, the content encapsulation should be interpreted as an - Ogg Stream in accordance with [8], with the exception that the - content of the Ogg Stream may be assumed to be Speex audio and Speex - audio only. - - - - -Herlein, et al. Expires July 2, 2005 [Page 11] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - -9. SDP usage of Speex - - When conveying information by SDP [4], the encoding name MUST be set - to "speex". An example of the media representation in SDP for - offering a single channel of Speex at 8000 samples per second might - be: - - m=audio 8088 RTP/AVP 97 - a=rtpmap:97 speex/8000 - - Note that the RTP payload type code of 97 is defined in this media - definition to be 'mapped' to the speex codec at an 8kHz sampling - frequency using the 'a=rtpmap' line. Any number from 96 to 127 could - have been chosen (the allowed range for dynamic types). - - The value of the sampling frequency is typically 8000 for narrow band - operation, 16000 for wide band operation, and 32000 for ultra-wide - band operation. - - If for some reason the offerer has bandwidth limitations, the client - may use the "b=" header, as explained in SDP [4]. The following - example illustrates the case where the offerer cannot receive more - than 10 kbit/s. - - m=audio 8088 RTP/AVP 97 - b=AS:10 - a=rtmap:97 speex/8000 - - In this case, if the remote part agrees, it should configure its - Speex encoder so that it does not use modes that produce more than 10 - kbit/s. Note that the "b=" constraint also applies on all payload - types that may be proposed in the media line ("m="). - - An other way to make recommendations to the remote Speex encoder is - to use its specific parameters via the a=fmtp: directive. The - following parameters are defined for use in this way: - - ptime: duration of each packet in milliseconds. - - sr: actual sample rate in Hz. - - ebw: encoding bandwidth - either 'narrow' or 'wide' or 'ultra' - (corresponds to nominal 8000, 16000, and 32000 Hz sampling rates). - - vbr: variable bit rate - either 'on' 'off' or 'vad' (defaults - to off). If on, variable bit rate is enabled. If off, disabled. - If set to 'vad' then constant bit rate is used but silence will be - encoded with special short frames to indicate a lack of voice for - - - -Herlein, et al. Expires July 2, 2005 [Page 12] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - - that period. - - cng: comfort noise generation - either 'on' or 'off'. If off - then silence frames will be silent; if 'on' then those frames will - be filled with comfort noise. - - mode: Speex encoding mode. Can be {1,2,3,4,5,6,any} defaults to - 3 in narrowband, 6 in wide and ultra-wide. - - penh: use of perceptual enhancement. 1 indicates to the decoder - that perceptual enhancement is recommended, 0 indicates that it is - not. Defaults to on (1). - - - Examples: - - m=audio 8008 RTP/AVP 97 - a=rtpmap:97 speex/8000 - a=fmtp:97 mode=4 - - This examples illustrate an offerer that wishes to receive a Speex - stream at 8000Hz, but only using speex mode 3. - - The offerer may suggest to the remote decoder to activate its - perceptual enhancement filter like this: - - m=audio 8088 RTP/AVP 97 - a=rtmap:97 speex/8000 - a=fmtp:97 penh=1 - - Several Speex specific parameters can be given in a single a=fmtp - line provided that they are separated by a semi-colon: - - a=fmtp:97 mode=any;penh=1 - - The offerer may indicate that it wishes to send variable bit rate - frames with comfort noise: - - m=audio 8088 RTP/AVP 97 - a=rtmap:97 speex/8000 - a=fmtp:97 vbr=on;cng=on - - The "ptime" attribute is used to denote the packetization interval - (ie, how many milliseconds of audio is encoded in a single RTP - packet). Since Speex uses 20 msec frames, ptime values of multiples - of 20 denote multiple Speex frames per packet. Values of ptime which - are not multiples of 20 MUST be ignored and clients MUST use the - default value of 20 instead. - - - -Herlein, et al. Expires July 2, 2005 [Page 13] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - - In the example below the ptime value is set to 40, indicating that - there are 2 frames in each packet. - - m=audio 8008 RTP/AVP 97 - a=rtpmap:97 speex/8000 - a=ptime:40 - - Note that the ptime parameter applies to all payloads listed in the - media line and is not used as part of an a=fmtp directive. - - Values of ptime not multiple of 20 msec are meaningless, so the - receiver of such ptime values MUST ignore them. If during the life - of an RTP session the ptime value changes, when there are multiple - Speex frames for example, the SDP value must also reflect the new - value. - - Care must be taken when setting the value of ptime so that the RTP - packet size does not exceed the path MTU. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires July 2, 2005 [Page 14] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - -10. ITU H.323/H.245 Use of Speex - - Application is underway to make Speex a standard ITU codec. However, - until that is finalized, Speex MAY be used in H.323 [5] by using a - non-standard codec block definition in the H.245 [6] codec capability - negotiations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires July 2, 2005 [Page 15] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - -11. NonStandardMessage format - - For Speex use in H.245 [6] based systems, the fields in the - NonStandardMessage should be: - - t35CountryCode = Hex: B5 - t35Extension = Hex: 00 - manufacturerCode = Hex: 0026 - [Length of the Binary Sequence (8 bit number)] - [Binary Sequence consisting of an ASCII string, no NULL - terminator] - - The binary sequence is an ascii string merely for ease of use. The - string is not null terminated. The format of this string is - - speex [optional variables] - - The optional variables are identical to those used for the SDP a=fmtp - strings discussed in section 5 above. The string is built to be all - on one line, each key-value pair separated by a semi-colon. The - optional variables MAY be omitted, which causes the default values to - be assumed. They are: - - ebw=narrow;mode=3;vbr=off;cng=off;ptime=20;sr=8000;penh=no; - - The fifth octet of the block is the length of the binary sequence. - - NOTE: this method can result in the advertising of a large number of - Speex 'codecs' based on the number of variables possible. For most - VoIP applications, use of the default binary sequence of 'speex' is - RECOMMENDED to be used in addition to all other options. This - maximizes the chances that two H.323 based applications that support - Speex can find a mutual codec. - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires July 2, 2005 [Page 16] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - -12. RTP Payload Types - - Dynamic payload type codes MUST be negotiated 'out-of-band' for the - assignment of a dynamic payload type from the range of 96-127. H.323 - applications MUST use the H.245 H2250LogicalChannelParameters - encoding to accomplish this. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires July 2, 2005 [Page 17] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - -13. Security Considerations - - RTP packets using the payload format defined in this specification - are subject to the security considerations discussed in the RTP - specification [2], and any appropriate RTP profile. This implies - that confidentiality of the media streams is achieved by encryption. - Because the data compression used with this payload format is applied - end-to-end, encryption may be performed after compression so there is - no conflict between the two operations. - - A potential denial-of-service threat exists for data encodings using - compression techniques that have non-uniform receiver-end - computational load. The attacker can inject pathological datagrams - into the stream which are complex to decode and cause the receiver to - be overloaded. However, this encoding does not exhibit any - significant non-uniformity. - - As with any IP-based protocol, in some circumstances a receiver may - be overloaded simply by the receipt of too many packets, either - desired or undesired. Network-layer authentication may be used to - discard packets from undesired sources, but the processing cost of - the authentication itself may be too high. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires July 2, 2005 [Page 18] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - -14. Acknowledgments - - The authors would like to thank Equivalence Pty Ltd of Australia for - their assistance in attempting to standardize the use of Speex in - H.323 applications, and for implementing Speex in their open source - OpenH323 stack. The authors would also like to thank Brian C. Wiles - of StreamComm for his assistance in developing - the proposed standard for Speex use in H.323 applications. - - The authors would also like to thank the following members of the - Speex and AVT communities for their input: Ross Finlayson, Federico - Montesino Pouzols, Henning Schulzrinne, Magnus Westerlund. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires July 2, 2005 [Page 19] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - -15. References - -15.1 Normative References - - [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement - Levels", RFC 2119. - - [2] Schulzrinne, H., Casner, S., Frederick, R. and V. Jacobson, - "RTP: A Transport Protocol for real-time applications", RFC - 3550. - - [3] "Multipurpose Internet Mail Extensions (MIME) Part One: Format - of Internet Message Bodies", RFC 2045. - - [4] Jacobson, V. and M. Handley, "SDP: Session Description - Protocol", RFC 2327. - - [5] "Packet-based Multimedia Communications Systems", ITU-T - Recommendation H.323. - - [6] "Control of communications between Visual Telephone Systems and - Terminal Equipment", ITU-T Recommendation H.245. - - [7] Schulzrinne, H. and S. Casner, "RTP Profile for Audio and Video - Conferences with Minimal Control.", RFC 3551. - - [8] Walleij, L., "The application/ogg Media Type", RFC 3534. - -15.2 Informative References - - [9] "Speexenc/speexdec, reference command-line encoder/decoder", - Speex website http://www.speex.org/. - - [10] "CELP, U.S. Federal Standard 1016.", National Technical - Information Service (NTIS) website http://www.ntis.gov/. - - -Authors' Addresses - - Greg Herlein - 2034 Filbert Street - San Francisco, California 94123 - United States - - EMail: gherlein@herlein.com - - - - - - -Herlein, et al. Expires July 2, 2005 [Page 20] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - - Simon Morlat - 35, av de Vizille App 42 - Grenoble 38000 - France - - EMail: simon.morlat@linphone.org - - - Jean-Marc Valin - Department of Electrical and Computer Engineering - University of Sherbrooke - 2500 blvd Universite - Sherbrooke, Quebec J1K 2R1 - Canada - - EMail: jean-marc.valin@hermes.usherb.ca - - - Roger Hardiman - 49 Nettleton Road - Cheltenham, Gloucestershire GL51 6NR - England - - EMail: roger@freebsd.org - - - Phil Kerr - England - - EMail: phil@plus24.com - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires July 2, 2005 [Page 21] - -Internet-Draft draft-herlein-speex-rtp-profile-03 January 2005 - - -Intellectual Property Statement - - The IETF takes no position regarding the validity or scope of any - Intellectual Property Rights or other rights that might be claimed to - pertain to the implementation or use of the technology described in - this document or the extent to which any license under such rights - might or might not be available; nor does it represent that it has - made any independent effort to identify any such rights. Information - on the procedures with respect to rights in RFC documents can be - found in BCP 78 and BCP 79. - - Copies of IPR disclosures made to the IETF Secretariat and any - assurances of licenses to be made available, or the result of an - attempt made to obtain a general license or permission for the use of - such proprietary rights by implementers or users of this - specification can be obtained from the IETF on-line IPR repository at - http://www.ietf.org/ipr. - - The IETF invites any interested party to bring to its attention any - copyrights, patents or patent applications, or other proprietary - rights that may cover technology that may be required to implement - this standard. Please address the information to the IETF at - ietf-ipr@ietf.org. - - -Disclaimer of Validity - - This document and the information contained herein are provided on an - "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS - OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET - ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, - INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE - INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED - WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - -Copyright Statement - - Copyright (C) The Internet Society (2005). This document is subject - to the rights, licenses and restrictions contained in BCP 78, and - except as set forth therein, the authors retain all their rights. - - -Acknowledgment - - Funding for the RFC Editor function is currently provided by the - Internet Society. - - - - -Herlein, et al. Expires July 2, 2005 [Page 22] - diff --git a/Engine/lib/speex/doc/draft-herlein-speex-rtp-profile-03.xml b/Engine/lib/speex/doc/draft-herlein-speex-rtp-profile-03.xml deleted file mode 100644 index 709efcdf4..000000000 --- a/Engine/lib/speex/doc/draft-herlein-speex-rtp-profile-03.xml +++ /dev/null @@ -1,815 +0,0 @@ - - - - - - - -draft-herlein-speex-rtp-profile-03 - - - -
-gherlein@herlein.com - -2034 Filbert Street -San Francisco -California -94123 -United States - -
-
- - -
-simon.morlat@linphone.org - -35, av de Vizille App 42 -Grenoble -38000 -France - -
-
- - -
-jean-marc.valin@hermes.usherb.ca - -Department of Electrical and Computer Engineering -University of Sherbrooke -2500 blvd Universite -Sherbrooke -Quebec -J1K 2R1 -Canada - -
-
- - -
-roger@freebsd.org - -49 Nettleton Road -Cheltenham -Gloucestershire -GL51 6NR -England - -
-
- - - -
-phil@plus24.com - -England - -
-
- - - -General -AVT Working Group -I-D - -Internet-Draft -Speex -RTP - - -Speex is an open-source voice codec suitable for use in Voice over -IP (VoIP) type applications. This document describes the payload -format for Speex generated bit streams within an RTP packet. Also -included here are the necessary details for the use of Speex with -the Session Description Protocol (SDP) and a preliminary method of -using Speex within H.323 applications. - - -
- - - -
- -The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", -"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this -document are to be interpreted as described in RFC 2119 . - -
- -
- - -Speex is based on the CELP encoding technique with support for -either narrowband (nominal 8kHz), wideband (nominal 16kHz) or -ultra-wideband (nominal 32kHz), and (non-optimal) rates up to 48 kHz -sampling also available. The main characteristics can be summarized -as follows: - - - - -Free software/open-source -Integration of wideband and narrowband in the same bit-stream -Wide range of bit-rates available -Dynamic bit-rate switching and variable bit-rate (VBR) -Voice Activity Detection (VAD, integrated with VBR) -Variable complexity - - - -
- -
- - -For RTP based transportation of Speex encoded audio the standard -RTP header [2] is followed by one or more payload data blocks. -An optional padding terminator may also be used. - - - -
- -
- - - - -The RTP header begins with an octet of fields (V, P, X, and CC) to -support specialized RTP uses (see and for details). For -Speex the following values are used. - - -Version (V): 2 bits - This field identifies the version of RTP. The version - used by this specification is two . - - -Padding (P): 1 bit - If the padding bit is set, the packet contains one or more - additional padding octets at the end which are not part of - the payload. P is set if the total packet size is less than - the MTU. - - -Extension (X): 1 bit - If the extension, X, bit is set, the fixed header MUST be - followed by exactly one header extension, with a format defined - in Section 5.3.1. of . - - -CSRC count (CC): 4 bits - The CSRC count contains the number of CSRC identifiers. - - -Marker (M): 1 bit - The M bit indicates if the packet contains comfort noise. This - field is used in conjunction with the cng SDP attribute and is - detailed further in section 5 below. In normal usage this bit - is set if the packet contains comfort noise. - - -Payload Type (PT): 7 bits - An RTP profile for a class of applications is expected to assign - a payload type for this format, or a dynamically allocated - payload type SHOULD be chosen which designates the payload as - Speex. - - -Sequence number: 16 bits - The sequence number increments by one for each RTP data packet - sent, and may be used by the receiver to detect packet loss and - to restore packet sequence. This field is detailed further in - . - - -Timestamp: 32 bits - A timestamp representing the sampling time of the first sample of - the first Speex packet in the RTP packet. The clock frequency - MUST be set to the sample rate of the encoded audio data. - - Speex uses 20 msec frames and a variable sampling rate clock. - The RTP timestamp MUST be in units of 1/X of a second where X - is the sample rate used. Speex uses a nominal 8kHz sampling rate - for narrowband use, a nominal 16kHz sampling rate for wideband use, - and a nominal 32kHz sampling rate for ultra-wideband use. - - -SSRC/CSRC identifiers: - These two fields, 32 bits each with one SSRC field and a maximum - of 16 CSRC fields, are as defined in . - - -
- -
- - -For the purposes of packetizing the bit stream in RTP, it is only -necessary to consider the sequence of bits as output by the Speex -encoder , and present the same sequence to the decoder. The -payload format described here maintains this sequence. - - - -A typical Speex frame, encoded at the maximum bitrate, is approx. -110 octets and the total number of Speex frames SHOULD be kept -less than the path MTU to prevent fragmentation. Speex frames MUST -NOT be fragmented across multiple RTP packets, - - - -An RTP packet MAY contain Speex frames of the same bit rate or of -varying bit rates, since the bit-rate for a frame is conveyed in -band with the signal. - - - -The encoding and decoding algorithm can change the bit rate at any -20 msec frame boundary, with the bit rate change notification provided -in-band with the bit stream. Each frame contains both "mode" -(narrowband, wideband or ultra-wideband) and "sub-mode" (bit-rate) -information in the bit stream. No out-of-band notification is -required for the decoder to process changes in the bit rate sent -by the encoder. - - - -It is RECOMMENDED that values of 8000, 16000 and 32000 be used -for normal internet telephony applications, though the sample -rate is supported at rates as low as 6000 Hz and as high as -48 kHz. - - - -The RTP payload MUST be padded to provide an integer number of -octets as the payload length. These padding bits are LSB aligned -in network octet order and consist of a 0 followed by all ones -(until the end of the octet). This padding is only required for -the last frame in the packet, and only to ensure the packet -contents ends on an octet boundary. - - -
- -
- - -In the example below we have a single Speex frame with 5 bits -of padding to ensure the packet size falls on an octet boundary. - - - - -
- -
- - -Below is an example of two Speex frames contained within one RTP -packet. The Speex frame length in this example fall on an octet -boundary so there is no padding. - - - -Speex codecs are able to detect the the bitrate from the -payload and are responsible for detecting the 20 msec boundaries -between each frame. - - - - -
- -
- - -Full definition of the MIME type for Speex will be part of the Ogg -Vorbis MIME type definition application . - - -MIME media type name: audio - -MIME subtype: speex - -Optional parameters: - -Required parameters: to be included in the Ogg MIME specification. - -Encoding considerations: - -Security Considerations: -See Section 6 of RFC 3047. - -Interoperability considerations: none - -Published specification: - -Applications which use this media type: - -Additional information: none - -Person & email address to contact for further information: - -Greg Herlein <gherlein@herlein.com> -Jean-Marc Valin <jean-marc.valin@hermes.usherb.ca> - - - -Intended usage: COMMON - -Author/Change controller: - - - -Author: Greg Herlein <gherlein@herlein.com> -Change controller: Greg Herlein <gherlein@herlein.com> -Change controller: IETF AVT Working Group - - - - -This transport type signifies that the content is to be interpreted -according to this document if the contents are transmitted over RTP. -Should this transport type appear over a lossless streaming protocol -such as TCP, the content encapsulation should be interpreted as an -Ogg Stream in accordance with , with the exception that the -content of the Ogg Stream may be assumed to be Speex audio and -Speex audio only. - - -
- -
- - -When conveying information by SDP , the encoding name MUST be -set to "speex". An example of the media representation in SDP for -offering a single channel of Speex at 8000 samples per second might -be: - - - - -m=audio 8088 RTP/AVP 97 -a=rtpmap:97 speex/8000 - - - -Note that the RTP payload type code of 97 is defined in this media -definition to be 'mapped' to the speex codec at an 8kHz sampling -frequency using the 'a=rtpmap' line. Any number from 96 to 127 -could have been chosen (the allowed range for dynamic types). - - - -The value of the sampling frequency is typically 8000 for narrow band -operation, 16000 for wide band operation, and 32000 for ultra-wide -band operation. - - - -If for some reason the offerer has bandwidth limitations, the client -may use the "b=" header, as explained in SDP . The following example -illustrates the case where the offerer cannot receive more than -10 kbit/s. - - - - -m=audio 8088 RTP/AVP 97 -b=AS:10 -a=rtmap:97 speex/8000 - - - -In this case, if the remote part agrees, it should configure its -Speex encoder so that it does not use modes that produce more than -10 kbit/s. Note that the "b=" constraint also applies on all -payload types that may be proposed in the media line ("m="). - - - -An other way to make recommendations to the remote Speex encoder -is to use its specific parameters via the a=fmtp: directive. The -following parameters are defined for use in this way: - - - - -ptime: duration of each packet in milliseconds. - -sr: actual sample rate in Hz. - -ebw: encoding bandwidth - either 'narrow' or 'wide' or - 'ultra' (corresponds to nominal 8000, 16000, and - 32000 Hz sampling rates). - -vbr: variable bit rate - either 'on' 'off' or 'vad' - (defaults to off). If on, variable bit rate is - enabled. If off, disabled. If set to 'vad' then - constant bit rate is used but silence will be encoded - with special short frames to indicate a lack of voice - for that period. - -cng: comfort noise generation - either 'on' or 'off'. If - off then silence frames will be silent; if 'on' then - those frames will be filled with comfort noise. - -mode: Speex encoding mode. Can be {1,2,3,4,5,6,any} - defaults to 3 in narrowband, 6 in wide and ultra-wide. - -penh: use of perceptual enhancement. 1 indicates - to the decoder that perceptual enhancement is recommended, - 0 indicates that it is not. Defaults to on (1). - - -Examples: - - - - m=audio 8008 RTP/AVP 97 - a=rtpmap:97 speex/8000 - a=fmtp:97 mode=4 - - - -This examples illustrate an offerer that wishes to receive -a Speex stream at 8000Hz, but only using speex mode 3. - - - -The offerer may suggest to the remote decoder to activate -its perceptual enhancement filter like this: - - - - - m=audio 8088 RTP/AVP 97 - a=rtmap:97 speex/8000 - a=fmtp:97 penh=1 - - - -Several Speex specific parameters can be given in a single -a=fmtp line provided that they are separated by a semi-colon: - - - - - a=fmtp:97 mode=any;penh=1 - - - -The offerer may indicate that it wishes to send variable bit rate -frames with comfort noise: - - - - - m=audio 8088 RTP/AVP 97 - a=rtmap:97 speex/8000 - a=fmtp:97 vbr=on;cng=on - - - -The "ptime" attribute is used to denote the packetization -interval (ie, how many milliseconds of audio is encoded in a -single RTP packet). Since Speex uses 20 msec frames, ptime values -of multiples of 20 denote multiple Speex frames per packet. -Values of ptime which are not multiples of 20 MUST be ignored -and clients MUST use the default value of 20 instead. - - - -In the example below the ptime value is set to 40, indicating that -there are 2 frames in each packet. - - - - - m=audio 8008 RTP/AVP 97 - a=rtpmap:97 speex/8000 - a=ptime:40 - - - -Note that the ptime parameter applies to all payloads listed -in the media line and is not used as part of an a=fmtp directive. - - - -Values of ptime not multiple of 20 msec are meaningless, so the -receiver of such ptime values MUST ignore them. If during the -life of an RTP session the ptime value changes, when there are -multiple Speex frames for example, the SDP value must also reflect -the new value. - - - -Care must be taken when setting the value of ptime so that the -RTP packet size does not exceed the path MTU. - - -
-
- - -Application is underway to make Speex a standard ITU codec. -However, until that is finalized, Speex MAY be used in H.323 by -using a non-standard codec block definition in the H.245 codec -capability negotiations. - - -
- -
- - -For Speex use in H.245 based systems, the fields in the -NonStandardMessage should be: - - - - -t35CountryCode = Hex: B5 -t35Extension = Hex: 00 -manufacturerCode = Hex: 0026 -[Length of the Binary Sequence (8 bit number)] -[Binary Sequence consisting of an ASCII string, no NULL terminator] - - - -The binary sequence is an ascii string merely for ease of use. -The string is not null terminated. The format of this string is - - - - -speex [optional variables] - - - -The optional variables are identical to those used for the SDP -a=fmtp strings discussed in section 5 above. The string is built -to be all on one line, each key-value pair separated by a -semi-colon. The optional variables MAY be omitted, which causes -the default values to be assumed. They are: - - - - -ebw=narrow;mode=3;vbr=off;cng=off;ptime=20;sr=8000;penh=no; - - - -The fifth octet of the block is the length of the binary sequence. - - - -NOTE: this method can result in the advertising of a large number -of Speex 'codecs' based on the number of variables possible. For -most VoIP applications, use of the default binary sequence of -'speex' is RECOMMENDED to be used in addition to all other options. -This maximizes the chances that two H.323 based applications that -support Speex can find a mutual codec. - - -
- -
- - -Dynamic payload type codes MUST be negotiated 'out-of-band' -for the assignment of a dynamic payload type from the -range of 96-127. H.323 applications MUST use the H.245 -H2250LogicalChannelParameters encoding to accomplish this. - - -
- -
- - -RTP packets using the payload format defined in this specification -are subject to the security considerations discussed in the RTP -specification , and any appropriate RTP profile. This implies -that confidentiality of the media streams is achieved by encryption. -Because the data compression used with this payload format is applied -end-to-end, encryption may be performed after compression so there is -no conflict between the two operations. - - - -A potential denial-of-service threat exists for data encodings using -compression techniques that have non-uniform receiver-end -computational load. The attacker can inject pathological datagrams -into the stream which are complex to decode and cause the receiver to -be overloaded. However, this encoding does not exhibit any -significant non-uniformity. - - - -As with any IP-based protocol, in some circumstances a receiver may -be overloaded simply by the receipt of too many packets, either -desired or undesired. Network-layer authentication may be used to -discard packets from undesired sources, but the processing cost of -the authentication itself may be too high. - - -
- -
- - -The authors would like to thank Equivalence Pty Ltd of Australia -for their assistance in attempting to standardize the use of Speex -in H.323 applications, and for implementing Speex in their open -source OpenH323 stack. The authors would also like to thank Brian -C. Wiles <brian@streamcomm.com> of StreamComm for his assistance in -developing the proposed standard for Speex use in H.323 -applications. - - - -The authors would also like to thank the following members of the -Speex and AVT communities for their input: Ross Finlayson, -Federico Montesino Pouzols, Henning Schulzrinne, Magnus Westerlund. - -
- -
- - - - - - - -Key words for use in RFCs to Indicate Requirement Levels - - - - - - - -RTP: A Transport Protocol for real-time applications - - - - - - - - - - -Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies - - - - - - - - -SDP: Session Description Protocol - - - - - - - - - -Packet-based Multimedia Communications Systems - - - - - - - - -Control of communications between Visual Telephone Systems and Terminal Equipment - - - - - - - - -RTP Profile for Audio and Video Conferences with Minimal Control. - - - - - - - - - -The application/ogg Media Type - - - - - - - - - - - - -Speexenc/speexdec, reference command-line encoder/decoder - - - - - - -CELP, U.S. Federal Standard 1016. - - - - - - - - -
diff --git a/Engine/lib/speex/doc/draft-ietf-avt-rtp-speex-00.txt b/Engine/lib/speex/doc/draft-ietf-avt-rtp-speex-00.txt deleted file mode 100644 index 53facab4b..000000000 --- a/Engine/lib/speex/doc/draft-ietf-avt-rtp-speex-00.txt +++ /dev/null @@ -1,784 +0,0 @@ - - - -AVT Working Group G. Herlein -Internet-Draft S. Morlat -Expires: April 15, 2006 J. Jean-Marc - R. Hardiman - P. Kerr - October 12, 2005 - - - draft-ietf-avt-rtp-speex-00 - RTP Payload Format for the Speex Codec - -Status of this Memo - - By submitting this Internet-Draft, each author represents that any - applicable patent or other IPR claims of which he or she is aware - have been or will be disclosed, and any of which he or she becomes - aware will be disclosed, in accordance with Section 6 of BCP 79. - - Internet-Drafts are working documents of the Internet Engineering - Task Force (IETF), its areas, and its working groups. Note that - other groups may also distribute working documents as Internet- - Drafts. - - Internet-Drafts are draft documents valid for a maximum of six months - and may be updated, replaced, or obsoleted by other documents at any - time. It is inappropriate to use Internet-Drafts as reference - material or to cite them other than as "work in progress." - - The list of current Internet-Drafts can be accessed at - http://www.ietf.org/ietf/1id-abstracts.txt. - - The list of Internet-Draft Shadow Directories can be accessed at - http://www.ietf.org/shadow.html. - - This Internet-Draft will expire on April 15, 2006. - -Copyright Notice - - Copyright (C) The Internet Society (2005). - -Abstract - - Speex is an open-source voice codec suitable for use in Voice over IP - (VoIP) type applications. This document describes the payload format - for Speex generated bit streams within an RTP packet. Also included - here are the necessary details for the use of Speex with the Session - Description Protocol (SDP). - - - - -Herlein, et al. Expires April 15, 2006 [Page 1] - -Internet-Draft draft-ietf-avt-rtp-speex-00 October 2005 - - -Editors Note - - All references to RFC XXXX are to be replaced by references to the - RFC number of this memo, when published. - -Table of Contents - - 1. Conventions used in this document . . . . . . . . . . . . . 3 - 2. Overview of the Speex Codec . . . . . . . . . . . . . . . . 3 - 3. RTP payload format for Speex . . . . . . . . . . . . . . . . 3 - 4. RTP Header . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 5. Speex payload . . . . . . . . . . . . . . . . . . . . . . . 5 - 6. Example Speex packet . . . . . . . . . . . . . . . . . . . . 6 - 7. Multiple Speex frames in a RTP packet . . . . . . . . . . . 6 - 8. MIME registration of Speex . . . . . . . . . . . . . . . . . 7 - 9. SDP usage of Speex . . . . . . . . . . . . . . . . . . . . . 8 - 10. ITU H.323 Use of Speex . . . . . . . . . . . . . . . . . . . 10 - 11. Security Considerations . . . . . . . . . . . . . . . . . . 10 - 12. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . 11 - 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 11 - 13.1 Normative References . . . . . . . . . . . . . . . . . . 11 - 13.2 Informative References . . . . . . . . . . . . . . . . . 12 - Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 12 - Intellectual Property and Copyright Statements . . . . . . . 14 - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires April 15, 2006 [Page 2] - -Internet-Draft draft-ietf-avt-rtp-speex-00 October 2005 - - -1. Conventions used in this document - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", - "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this - document are to be interpreted as described in RFC 2119 [1]. - -2. Overview of the Speex Codec - - Speex is based on the CELP [8] encoding technique with support for - either narrowband (nominal 8kHz), wideband (nominal 16kHz) or ultra- - wideband (nominal 32kHz), and (non-optimal) rates up to 48 kHz - sampling also available. The main characteristics can be summarized - as follows: - - o Free software/open-source - o Integration of wideband and narrowband in the same bit-stream - o Wide range of bit-rates available - o Dynamic bit-rate switching and variable bit-rate (VBR) - o Voice Activity Detection (VAD, integrated with VBR) - o Variable complexity - -3. RTP payload format for Speex - - For RTP based transportation of Speex encoded audio the standard RTP - header [2] is followed by one or more payload data blocks. An - optional padding terminator may also be used. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | RTP Header | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | one or more frames of Speex .... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | one or more frames of Speex .... | padding | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -4. RTP Header - - - - - - - - - - - - -Herlein, et al. Expires April 15, 2006 [Page 3] - -Internet-Draft draft-ietf-avt-rtp-speex-00 October 2005 - - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |V=2|P|X| CC |M| PT | sequence number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | timestamp | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | synchronization source (SSRC) identifier | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | contributing source (CSRC) identifiers | - | ... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - The RTP header begins with an octet of fields (V, P, X, and CC) to - support specialized RTP uses (see [2] and [5] for details). For - Speex the following values are used. - - Version (V): 2 bits - - This field identifies the version of RTP. The version used by this - specification is two [2]. - - Padding (P): 1 bit - - If the padding bit is set, the packet contains one or more additional - padding octets at the end which are not part of the payload. - - Extension (X): 1 bit - - If the extension, X, bit is set, the fixed header MUST be followed by - exactly one header extension, with a format defined in Section 5.3.1. - of [2]. - - CSRC count (CC): 4 bits - - The CSRC count contains the number of CSRC identifiers. - - Marker (M): 1 bit - - The M bit indicates if the packet contains comfort noise. This field - is used in conjunction with the cng SDP attribute and conforms to - Section 4.1. of [5]. - - Payload Type (PT): 7 bits - - An RTP profile for a class of applications is expected to assign a - payload type for this format, or a dynamically allocated payload type - SHOULD be chosen which designates the payload as Speex. - - - -Herlein, et al. Expires April 15, 2006 [Page 4] - -Internet-Draft draft-ietf-avt-rtp-speex-00 October 2005 - - - Sequence number: 16 bits - - The sequence number increments by one for each RTP data packet sent, - and may be used by the receiver to detect packet loss and to restore - packet sequence. This field is detailed further in [2]. - - Timestamp: 32 bits - - A timestamp representing the sampling time of the first sample of the - first Speex packet in the RTP packet. The clock frequency MUST be - set to the sample rate of the encoded audio data. Speex uses 20 msec - frames and a variable sampling rate clock. The RTP timestamp MUST be - in units of 1/X of a second where X is the sample rate used. Speex - uses a nominal 8kHz sampling rate for narrowband use, a nominal 16kHz - sampling rate for wideband use, and a nominal 32kHz sampling rate for - ultra-wideband use. - - SSRC/CSRC identifiers: - - These two fields, 32 bits each with one SSRC field and a maximum of - 16 CSRC fields, are as defined in [2]. - -5. Speex payload - - For the purposes of packetizing the bit stream in RTP, it is only - necessary to consider the sequence of bits as output by the Speex - encoder [7], and present the same sequence to the decoder. The - payload format described here maintains this sequence. - - A typical Speex frame, encoded at the maximum bitrate, is approx. 110 - octets and the total number of Speex frames SHOULD be kept less than - the path MTU to prevent fragmentation. Speex frames MUST NOT be - fragmented across multiple RTP packets, - - An RTP packet MAY contain Speex frames of the same bit rate or of - varying bit rates, since the bit-rate for a frame is conveyed in band - with the signal. - - The encoding and decoding algorithm can change the bit rate at any 20 - msec frame boundary, with the bit rate change notification provided - in-band with the bit stream. Each frame contains both "mode" - (narrowband, wideband or ultra-wideband) and "sub-mode" (bit-rate) - information in the bit stream. No out-of-band notification is - required for the decoder to process changes in the bit rate sent by - the encoder. - - It is RECOMMENDED that values of 8000, 16000 and 32000 be used for - normal internet telephony applications, though the sample rate is - - - -Herlein, et al. Expires April 15, 2006 [Page 5] - -Internet-Draft draft-ietf-avt-rtp-speex-00 October 2005 - - - supported at rates as low as 6000 Hz and as high as 48 kHz. - - The RTP payload MUST be padded to provide an integer number of octets - as the payload length. These padding bits are LSB aligned in network - octet order and consist of a 0 followed by all ones (until the end of - the octet). This padding is only required for the last frame in the - packet, and only to ensure the packet contents ends on an octet - boundary. - -6. Example Speex packet - - In the example below we have a single Speex frame with 5 bits of - padding to ensure the packet size falls on an octet boundary. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |V=2|P|X| CC |M| PT | sequence number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | timestamp | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | synchronization source (SSRC) identifier | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | contributing source (CSRC) identifiers | - | ... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. |0 1 1 1 1| - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -7. Multiple Speex frames in a RTP packet - - Below is an example of two Speex frames contained within one RTP - packet. The Speex frame length in this example fall on an octet - boundary so there is no padding. - - Speex codecs [7] are able to detect the bitrate from the payload and - are responsible for detecting the 20 msec boundaries between each - frame. - - - - - -Herlein, et al. Expires April 15, 2006 [Page 6] - -Internet-Draft draft-ietf-avt-rtp-speex-00 October 2005 - - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |V=2|P|X| CC |M| PT | sequence number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | timestamp | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | synchronization source (SSRC) identifier | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | contributing source (CSRC) identifiers | - | ... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -8. MIME registration of Speex - - Full definition of the MIME [3] type for Speex will be part of the - Ogg Vorbis MIME type definition application [6]. - - MIME media type name: audio - - MIME subtype: speex - - Optional parameters: - - Required parameters: to be included in the Ogg MIME specification. - - Encoding considerations: - - This type is only defined for transfer via HTTP as specified in RFC - XXXX. - - Security Considerations: - - See Section 6 of RFC 3047. - - Interoperability considerations: none - - Published specification: - - Applications which use this media type: - - - -Herlein, et al. Expires April 15, 2006 [Page 7] - -Internet-Draft draft-ietf-avt-rtp-speex-00 October 2005 - - - Additional information: none - - Person & email address to contact for further information: - - Greg Herlein - Jean-Marc Valin - - Intended usage: COMMON - - Author/Change controller: - - Author: Greg Herlein - Change controller: Greg Herlein - Change controller: IETF AVT Working Group - - This transport type signifies that the content is to be interpreted - according to this document if the contents are transmitted over RTP. - Should this transport type appear over a lossless streaming protocol - such as TCP, the content encapsulation should be interpreted as an - Ogg Stream in accordance with [6], with the exception that the - content of the Ogg Stream may be assumed to be Speex audio and Speex - audio only. - -9. SDP usage of Speex - - When conveying information by SDP [4], the encoding name MUST be set - to "speex". An example of the media representation in SDP for - offering a single channel of Speex at 8000 samples per second might - be: - - m=audio 8088 RTP/AVP 97 - a=rtpmap:97 speex/8000 - - Note that the RTP payload type code of 97 is defined in this media - definition to be 'mapped' to the speex codec at an 8kHz sampling - frequency using the 'a=rtpmap' line. Any number from 96 to 127 could - have been chosen (the allowed range for dynamic types). - - The value of the sampling frequency is typically 8000 for narrow band - operation, 16000 for wide band operation, and 32000 for ultra-wide - band operation. - - If for some reason the offerer has bandwidth limitations, the client - may use the "b=" header, as explained in SDP [4]. The following - example illustrates the case where the offerer cannot receive more - than 10 kbit/s. - - - - - -Herlein, et al. Expires April 15, 2006 [Page 8] - -Internet-Draft draft-ietf-avt-rtp-speex-00 October 2005 - - - m=audio 8088 RTP/AVP 97 - b=AS:10 - a=rtmap:97 speex/8000 - - In this case, if the remote part agrees, it should configure its - Speex encoder so that it does not use modes that produce more than 10 - kbit/s. Note that the "b=" constraint also applies on all payload - types that may be proposed in the media line ("m="). - - An other way to make recommendations to the remote Speex encoder is - to use its specific parameters via the a=fmtp: directive. The - following parameters are defined for use in this way: - - ptime: duration of each packet in milliseconds. - - sr: actual sample rate in Hz. - - ebw: encoding bandwidth - either 'narrow' or 'wide' or 'ultra' - (corresponds to nominal 8000, 16000, and 32000 Hz sampling rates). - - vbr: variable bit rate - either 'on' 'off' or 'vad' (defaults - to off). If on, variable bit rate is enabled. If off, disabled. - If set to 'vad' then constant bit rate is used but silence will be - encoded with special short frames to indicate a lack of voice for - that period. - - cng: comfort noise generation - either 'on' or 'off'. If off - then silence frames will be silent; if 'on' then those frames will - be filled with comfort noise. - - mode: Speex encoding mode. Can be {1,2,3,4,5,6,any} defaults to - 3 in narrowband, 6 in wide and ultra-wide. - - - Examples: - - m=audio 8008 RTP/AVP 97 - a=rtpmap:97 speex/8000 - a=fmtp:97 mode=4 - - This examples illustrate an offerer that wishes to receive a Speex - stream at 8000Hz, but only using speex mode 4. - - Several Speex specific parameters can be given in a single a=fmtp - line provided that they are separated by a semi-colon: - - - - - - -Herlein, et al. Expires April 15, 2006 [Page 9] - -Internet-Draft draft-ietf-avt-rtp-speex-00 October 2005 - - - a=fmtp:97 mode=any;mode=1 - - The offerer may indicate that it wishes to send variable bit rate - frames with comfort noise: - - m=audio 8088 RTP/AVP 97 - a=rtmap:97 speex/8000 - a=fmtp:97 vbr=on;cng=on - - The "ptime" attribute is used to denote the packetization interval - (ie, how many milliseconds of audio is encoded in a single RTP - packet). Since Speex uses 20 msec frames, ptime values of multiples - of 20 denote multiple Speex frames per packet. Values of ptime which - are not multiples of 20 MUST be ignored and clients MUST use the - default value of 20 instead. - - In the example below the ptime value is set to 40, indicating that - there are 2 frames in each packet. - - m=audio 8008 RTP/AVP 97 - a=rtpmap:97 speex/8000 - a=ptime:40 - - Note that the ptime parameter applies to all payloads listed in the - media line and is not used as part of an a=fmtp directive. - - Values of ptime not multiple of 20 msec are meaningless, so the - receiver of such ptime values MUST ignore them. If during the life - of an RTP session the ptime value changes, when there are multiple - Speex frames for example, the SDP value must also reflect the new - value. - - Care must be taken when setting the value of ptime so that the RTP - packet size does not exceed the path MTU. - -10. ITU H.323 Use of Speex - - It is outside the scope of this document to cover the use of Speex - and H.323, more details may be found on the Speex website [9]. - -11. Security Considerations - - RTP packets using the payload format defined in this specification - are subject to the security considerations discussed in the RTP - specification [2], and any appropriate RTP profile. This implies - that confidentiality of the media streams is achieved by encryption. - Because the data compression used with this payload format is applied - end-to-end, encryption may be performed after compression so there is - - - -Herlein, et al. Expires April 15, 2006 [Page 10] - -Internet-Draft draft-ietf-avt-rtp-speex-00 October 2005 - - - no conflict between the two operations. - - A potential denial-of-service threat exists for data encodings using - compression techniques that have non-uniform receiver-end - computational load. The attacker can inject pathological datagrams - into the stream which are complex to decode and cause the receiver to - be overloaded. However, this encoding does not exhibit any - significant non-uniformity. - - As with any IP-based protocol, in some circumstances a receiver may - be overloaded simply by the receipt of too many packets, either - desired or undesired. Network-layer authentication may be used to - discard packets from undesired sources, but the processing cost of - the authentication itself may be too high. - -12. Acknowledgments - - The authors would like to thank Equivalence Pty Ltd of Australia for - their assistance in attempting to standardize the use of Speex in - H.323 applications, and for implementing Speex in their open source - OpenH323 stack. The authors would also like to thank Brian C. Wiles - of StreamComm for his assistance in developing - the proposed standard for Speex use in H.323 applications. - - The authors would also like to thank the following members of the - Speex and AVT communities for their input: Ross Finlayson, Federico - Montesino Pouzols, Henning Schulzrinne, Magnus Westerlund. - -13. References - -13.1 Normative References - - [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement - Levels", RFC 2119. - - [2] Schulzrinne, H., Casner, S., Frederick, R., and V. Jacobson, - "RTP: A Transport Protocol for real-time applications", - RFC 3550. - - [3] "Multipurpose Internet Mail Extensions (MIME) Part One: Format - of Internet Message Bodies", RFC 2045. - - [4] Jacobson, V. and M. Handley, "SDP: Session Description - Protocol", RFC 2327. - - [5] Schulzrinne, H. and S. Casner, "RTP Profile for Audio and Video - Conferences with Minimal Control.", RFC 3551. - - - - -Herlein, et al. Expires April 15, 2006 [Page 11] - -Internet-Draft draft-ietf-avt-rtp-speex-00 October 2005 - - - [6] Walleij, L., "The application/ogg Media Type", RFC 3534. - -13.2 Informative References - - [7] "Speexenc/speexdec, reference command-line encoder/decoder", - Speex website http://www.speex.org/. - - [8] "CELP, U.S. Federal Standard 1016.", National Technical - Information Service (NTIS) website http://www.ntis.gov/. - - [9] "ITU H.323/H.245 Use of Speex", Speex - website http://www.speex.org/itu/. - - -Authors' Addresses - - Greg Herlein - 2034 Filbert Street - San Francisco, California 94123 - United States - - Email: gherlein@herlein.com - - - Simon Morlat - 35, av de Vizille App 42 - Grenoble 38000 - France - - Email: simon.morlat@linphone.org - - - Jean-Marc Valin - Department of Electrical and Computer Engineering - University of Sherbrooke - 2500 blvd Universite - Sherbrooke, Quebec J1K 2R1 - Canada - - Email: jean-marc.valin@usherbrooke.ca - - - - - - - - - - - -Herlein, et al. Expires April 15, 2006 [Page 12] - -Internet-Draft draft-ietf-avt-rtp-speex-00 October 2005 - - - Roger Hardiman - 49 Nettleton Road - Cheltenham, Gloucestershire GL51 6NR - England - - Email: roger@freebsd.org - - - Phil Kerr - England - - Email: phil@plus24.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires April 15, 2006 [Page 13] - -Internet-Draft draft-ietf-avt-rtp-speex-00 October 2005 - - -Intellectual Property Statement - - The IETF takes no position regarding the validity or scope of any - Intellectual Property Rights or other rights that might be claimed to - pertain to the implementation or use of the technology described in - this document or the extent to which any license under such rights - might or might not be available; nor does it represent that it has - made any independent effort to identify any such rights. Information - on the procedures with respect to rights in RFC documents can be - found in BCP 78 and BCP 79. - - Copies of IPR disclosures made to the IETF Secretariat and any - assurances of licenses to be made available, or the result of an - attempt made to obtain a general license or permission for the use of - such proprietary rights by implementers or users of this - specification can be obtained from the IETF on-line IPR repository at - http://www.ietf.org/ipr. - - The IETF invites any interested party to bring to its attention any - copyrights, patents or patent applications, or other proprietary - rights that may cover technology that may be required to implement - this standard. Please address the information to the IETF at - ietf-ipr@ietf.org. - - -Disclaimer of Validity - - This document and the information contained herein are provided on an - "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS - OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET - ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, - INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE - INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED - WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - -Copyright Statement - - Copyright (C) The Internet Society (2005). This document is subject - to the rights, licenses and restrictions contained in BCP 78, and - except as set forth therein, the authors retain all their rights. - - -Acknowledgment - - Funding for the RFC Editor function is currently provided by the - Internet Society. - - - - -Herlein, et al. Expires April 15, 2006 [Page 14] - diff --git a/Engine/lib/speex/doc/draft-ietf-avt-rtp-speex-01-tmp.txt b/Engine/lib/speex/doc/draft-ietf-avt-rtp-speex-01-tmp.txt deleted file mode 100644 index 1410b8580..000000000 --- a/Engine/lib/speex/doc/draft-ietf-avt-rtp-speex-01-tmp.txt +++ /dev/null @@ -1,1008 +0,0 @@ - - - -AVT G. Herlein -Internet-Draft -Intended status: Standards Track J. Valin -Expires: October 24, 2007 University of Sherbrooke - A. Heggestad - April 22, 2007 - - - RTP Payload Format for the Speex Codec - draft-ietf-avt-rtp-speex-01 (non-final) - -Status of this Memo - - By submitting this Internet-Draft, each author represents that any - applicable patent or other IPR claims of which he or she is aware - have been or will be disclosed, and any of which he or she becomes - aware will be disclosed, in accordance with Section 6 of BCP 79. - - Internet-Drafts are working documents of the Internet Engineering - Task Force (IETF), its areas, and its working groups. Note that - other groups may also distribute working documents as Internet- - Drafts. - - Internet-Drafts are draft documents valid for a maximum of six months - and may be updated, replaced, or obsoleted by other documents at any - time. It is inappropriate to use Internet-Drafts as reference - material or to cite them other than as "work in progress." - - The list of current Internet-Drafts can be accessed at - http://www.ietf.org/ietf/1id-abstracts.txt. - - The list of Internet-Draft Shadow Directories can be accessed at - http://www.ietf.org/shadow.html. - - This Internet-Draft will expire on October 24, 2007. - -Copyright Notice - - Copyright (C) The Internet Society (2007). - - - - - - - - - - - - -Herlein, et al. Expires October 24, 2007 [Page 1] - -Internet-Draft Speex April 2007 - - -Abstract - - Speex is an open-source voice codec suitable for use in Voice over IP - (VoIP) type applications. This document describes the payload format - for Speex generated bit streams within an RTP packet. Also included - here are the necessary details for the use of Speex with the Session - Description Protocol (SDP). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires October 24, 2007 [Page 2] - -Internet-Draft Speex April 2007 - - -Editors Note - - All references to RFC XXXX are to be replaced by references to the - RFC number of this memo, when published. - - -Table of Contents - - 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 3. RTP usage for Speex . . . . . . . . . . . . . . . . . . . . . 6 - 3.1. RTP Speex Header Fields . . . . . . . . . . . . . . . . . 6 - 3.2. RTP payload format for Speex . . . . . . . . . . . . . . . 6 - 3.3. Speex payload . . . . . . . . . . . . . . . . . . . . . . 6 - 3.4. Example Speex packet . . . . . . . . . . . . . . . . . . . 7 - 3.5. Multiple Speex frames in a RTP packet . . . . . . . . . . 7 - 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 - 4.1. Media Type Registration . . . . . . . . . . . . . . . . . 9 - 4.1.1. Registration of media type audio/speex . . . . . . . . 9 - 5. SDP usage of Speex . . . . . . . . . . . . . . . . . . . . . . 11 - 6. Security Considerations . . . . . . . . . . . . . . . . . . . 14 - 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 15 - 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 16 - 8.1. Normative References . . . . . . . . . . . . . . . . . . . 16 - 8.2. Informative References . . . . . . . . . . . . . . . . . . 16 - Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 17 - Intellectual Property and Copyright Statements . . . . . . . . . . 18 - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires October 24, 2007 [Page 3] - -Internet-Draft Speex April 2007 - - -1. Introduction - - Speex is based on the CELP [CELP] encoding technique with support for - either narrowband (nominal 8kHz), wideband (nominal 16kHz) or ultra- - wideband (nominal 32kHz). The main characteristics can be summarized - as follows: - - o Free software/open-source - - o Integration of wideband and narrowband in the same bit-stream - - o Wide range of bit-rates available - - o Dynamic bit-rate switching and variable bit-rate (VBR) - - o Voice Activity Detection (VAD, integrated with VBR) - - o Variable complexity - - To be compliant with this specification, implementations MUST support - 8 kHz sampling rate (narrowband)" and SHOULD support 8 kbps bitrate. - The sampling rate MUST be 8, 16 or 32 kHz. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires October 24, 2007 [Page 4] - -Internet-Draft Speex April 2007 - - -2. Terminology - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", - "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this - document are to be interpreted as described in RFC2119 [RFC2119] and - indicate requirement levels for compliant RTP implementations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires October 24, 2007 [Page 5] - -Internet-Draft Speex April 2007 - - -3. RTP usage for Speex - -3.1. RTP Speex Header Fields - - The RTP header is defined in the RTP specification [RFC3550]. This - section defines how fields in the RTP header are used. - - Payload Type (PT): The assignment of an RTP payload type for this - packet format is outside the scope of this document; it is - specified by the RTP profile under which this payload format is - used, or signaled dynamically out-of-band (e.g., using SDP). - - Marker (M) bit: The M bit is set to one to indicate that the RTP - packet payload contains at least one complete frame - - Extension (X) bit: Defined by the RTP profile used. - - Timestamp: A 32-bit word that corresponds to the sampling instant - for the first frame in the RTP packet. - -3.2. RTP payload format for Speex - - The RTP payload for Speex has the format shown in Figure 1. No - additional header fields specific to this payload format are - required. For RTP based transportation of Speex encoded audio the - standard RTP header [RFC3550] is followed by one or more payload data - blocks. An optional padding terminator may also be used. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | RTP Header | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | one or more frames of Speex .... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | one or more frames of Speex .... | padding | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - Figure 1: RTP payload for Speex - -3.3. Speex payload - - For the purposes of packetizing the bit stream in RTP, it is only - necessary to consider the sequence of bits as output by the Speex - encoder [speexenc], and present the same sequence to the decoder. - The payload format described here maintains this sequence. - - A typical Speex frame, encoded at the maximum bitrate, is approx. 110 - - - -Herlein, et al. Expires October 24, 2007 [Page 6] - -Internet-Draft Speex April 2007 - - - octets and the total number of Speex frames SHOULD be kept less than - the path MTU to prevent fragmentation. Speex frames MUST NOT be - fragmented across multiple RTP packets, - - An RTP packet MAY contain Speex frames of the same bit rate or of - varying bit rates, since the bit-rate for a frame is conveyed in band - with the signal. - - The encoding and decoding algorithm can change the bit rate at any 20 - msec frame boundary, with the bit rate change notification provided - in-band with the bit stream. Each frame contains both "mode" - (narrowband, wideband or ultra-wideband) and "sub-mode" (bit-rate) - information in the bit stream. No out-of-band notification is - required for the decoder to process changes in the bit rate sent by - the encoder. - - Sampling rate values of 8000, 16000 or 32000 Hz MUST be used. Any - other sampling rates MUST NOT be used. - - The RTP payload MUST be padded to provide an integer number of octets - as the payload length. These padding bits are LSB aligned in network - octet order and consist of a 0 followed by all ones (until the end of - the octet). This padding is only required for the last frame in the - packet, and only to ensure the packet contents ends on an octet - boundary. - -3.4. Example Speex packet - - In the example below we have a single Speex frame with 5 bits of - padding to ensure the packet size falls on an octet boundary. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | RTP Header | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. |0 1 1 1 1| - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - -3.5. Multiple Speex frames in a RTP packet - - Below is an example of two Speex frames contained within one RTP - packet. The Speex frame length in this example fall on an octet - boundary so there is no padding. - - Speex codecs [speexenc] are able to detect the bitrate from the - - - -Herlein, et al. Expires October 24, 2007 [Page 7] - -Internet-Draft Speex April 2007 - - - payload and are responsible for detecting the 20 msec boundaries - between each frame. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | RTP Header | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | ..speex frame 1.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex frame 1.. | ..speex frame 2.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex frame 2.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires October 24, 2007 [Page 8] - -Internet-Draft Speex April 2007 - - -4. IANA Considerations - - This document defines the Speex media type. - -4.1. Media Type Registration - - This section describes the media types and names associated with this - payload format. The section registers the media types, as per - RFC4288 [RFC4288] - -4.1.1. Registration of media type audio/speex - - Media type name: audio - - Media subtype name: speex - - Required parameters: - - None - - Optional parameters: - - ptime: see RFC 4566. SHOULD be a multiple of 20 msec. - - maxptime: see RFC 4566. SHOULD be a multiple of 20 msec. - - Encoding considerations: - - This media type is framed and binary, see section 4.8 in - [RFC4288]. - - Security considerations: See Section 6 - - Interoperability considerations: - - None. - - Published specification: RFC XXXX [This RFC]. - - Applications which use this media type: - - Audio streaming and conferencing applications. - - Additional information: none - - Person and email address to contact for further information : - - - - - -Herlein, et al. Expires October 24, 2007 [Page 9] - -Internet-Draft Speex April 2007 - - - Alfred E. Heggestad: aeh@db.org - - Intended usage: COMMON - - Restrictions on usage: - - This media type depends on RTP framing, and hence is only defined - for transfer via RTP [RFC3550]. Transport within other framing - protocols is not defined at this time. - - Author: Alfred E. Heggestad - - Change controller: - - IETF Audio/Video Transport working group delegated from the IESG. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires October 24, 2007 [Page 10] - -Internet-Draft Speex April 2007 - - -5. SDP usage of Speex - - When conveying information by SDP [RFC4566], the encoding name MUST - be set to "speex". An example of the media representation in SDP for - offering a single channel of Speex at 8000 samples per second might - be: - - m=audio 8088 RTP/AVP 97 - a=rtpmap:97 speex/8000 - - Note that the RTP payload type code of 97 is defined in this media - definition to be 'mapped' to the speex codec at an 8kHz sampling - frequency using the 'a=rtpmap' line. Any number from 96 to 127 could - have been chosen (the allowed range for dynamic types). - - The value of the sampling frequency is typically 8000 for narrow band - operation, 16000 for wide band operation, and 32000 for ultra-wide - band operation. - - If for some reason the offerer has bandwidth limitations, the client - may use the "b=" header, as explained in SDP [RFC4566]. The - following example illustrates the case where the offerer cannot - receive more than 10 kbit/s. - - m=audio 8088 RTP/AVP 97 - b=AS:10 - a=rtmap:97 speex/8000 - - In this case, if the remote part agrees, it should configure its - Speex encoder so that it does not use modes that produce more than 10 - kbit/s. Note that the "b=" constraint also applies on all payload - types that may be proposed in the media line ("m="). - - An other way to make recommendations to the remote Speex encoder is - to use its specific parameters via the a=fmtp: directive. The - following parameters are defined for use in this way: - - ptime: duration of each packet in milliseconds. - - - sr: actual sample rate in Hz. - - - ebw: encoding bandwidth - either 'narrow' or 'wide' or 'ultra' - (corresponds to nominal 8000, 16000, and 32000 Hz sampling rates). - - - - - - -Herlein, et al. Expires October 24, 2007 [Page 11] - -Internet-Draft Speex April 2007 - - - vbr: variable bit rate - either 'on' 'off' or 'vad' (defaults to - off). If on, variable bit rate is enabled. If off, disabled. If - set to 'vad' then constant bit rate is used but silence will be - encoded with special short frames to indicate a lack of voice for - that period. - - - cng: comfort noise generation - either 'on' or 'off'. If off then - silence frames will be silent; if 'on' then those frames will be - filled with comfort noise. - - - mode: Speex encoding mode. Can be {1,2,3,4,5,6,any} defaults to 3 - in narrowband, 6 in wide and ultra-wide. - - - Examples: - - m=audio 8008 RTP/AVP 97 - a=rtpmap:97 speex/8000 - a=fmtp:97 mode=4 - - This examples illustrate an offerer that wishes to receive a Speex - stream at 8000Hz, but only using speex mode 4. - - Several Speex specific parameters can be given in a single a=fmtp - line provided that they are separated by a semi-colon: - - a=fmtp:97 mode=any;mode=1 - - The offerer may indicate that it wishes to send variable bit rate - frames with comfort noise: - - m=audio 8088 RTP/AVP 97 - a=rtmap:97 speex/8000 - a=fmtp:97 vbr=on;cng=on - - The "ptime" attribute is used to denote the packetization interval - (ie, how many milliseconds of audio is encoded in a single RTP - packet). Since Speex uses 20 msec frames, ptime values of multiples - of 20 denote multiple Speex frames per packet. Values of ptime which - are not multiples of 20 MUST be ignored and clients MUST use the - default value of 20 instead. - - Implementations SHOULD support ptime of 20 msec (i.e. one frame per - packet) - - In the example below the ptime value is set to 40, indicating that - - - -Herlein, et al. Expires October 24, 2007 [Page 12] - -Internet-Draft Speex April 2007 - - - there are 2 frames in each packet. - - m=audio 8008 RTP/AVP 97 - a=rtpmap:97 speex/8000 - a=ptime:40 - - Note that the ptime parameter applies to all payloads listed in the - media line and is not used as part of an a=fmtp directive. - - Values of ptime not multiple of 20 msec are meaningless, so the - receiver of such ptime values MUST ignore them. If during the life - of an RTP session the ptime value changes, when there are multiple - Speex frames for example, the SDP value must also reflect the new - value. - - Care must be taken when setting the value of ptime so that the RTP - packet size does not exceed the path MTU. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires October 24, 2007 [Page 13] - -Internet-Draft Speex April 2007 - - -6. Security Considerations - - RTP packets using the payload format defined in this specification - are subject to the security considerations discussed in the RTP - specification [RFC3550], and any appropriate RTP profile. This - implies that confidentiality of the media streams is achieved by - encryption. Because the data compression used with this payload - format is applied end-to-end, encryption may be performed after - compression so there is no conflict between the two operations. - - A potential denial-of-service threat exists for data encodings using - compression techniques that have non-uniform receiver-end - computational load. The attacker can inject pathological datagrams - into the stream which are complex to decode and cause the receiver to - be overloaded. However, this encoding does not exhibit any - significant non-uniformity. - - As with any IP-based protocol, in some circumstances a receiver may - be overloaded simply by the receipt of too many packets, either - desired or undesired. Network-layer authentication may be used to - discard packets from undesired sources, but the processing cost of - the authentication itself may be too high. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires October 24, 2007 [Page 14] - -Internet-Draft Speex April 2007 - - -7. Acknowledgements - - The authors would like to thank Equivalence Pty Ltd of Australia for - their assistance in attempting to standardize the use of Speex in - H.323 applications, and for implementing Speex in their open source - OpenH323 stack. The authors would also like to thank Brian C. Wiles - of StreamComm for his assistance in developing - the proposed standard for Speex use in H.323 applications. - - The authors would also like to thank the following members of the - Speex and AVT communities for their input: Ross Finlayson, Federico - Montesino Pouzols, Henning Schulzrinne, Magnus Westerlund. - - Thanks to former authors of this document; Simon Morlat, Roger - Hardiman, Phil Kerr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires October 24, 2007 [Page 15] - -Internet-Draft Speex April 2007 - - -8. References - -8.1. Normative References - - [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate - Requirement Levels", BCP 14, RFC 2119, March 1997. - - [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. - Jacobson, "RTP: A Transport Protocol for Real-Time - Applications", STD 64, RFC 3550, July 2003. - - [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session - Description Protocol", RFC 4566, July 2006. - -8.2. Informative References - - [CELP] "CELP, U.S. Federal Standard 1016.", National Technical - Information Service (NTIS) website http://www.ntis.gov/. - - [RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and - Registration Procedures", BCP 13, RFC 4288, December 2005. - - [speexenc] - Valin, J., "Speexenc/speexdec, reference command-line - encoder/decoder", Speex website http://www.speex.org/. - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires October 24, 2007 [Page 16] - -Internet-Draft Speex April 2007 - - -Authors' Addresses - - Greg Herlein - 2034 Filbert Street - San Francisco, California 94123 - United States - - Email: gherlein@herlein.com - - - Jean-Marc Valin - University of Sherbrooke - Department of Electrical and Computer Engineering - University of Sherbrooke - 2500 blvd Universite - Sherbrooke, Quebec J1K 2R1 - Canada - - Email: jean-marc.valin@usherbrooke.ca - - - Alfred E. Heggestad - Biskop J. Nilssonsgt. 20a - Oslo 0659 - Norway - - Email: aeh@db.org - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires October 24, 2007 [Page 17] - -Internet-Draft Speex April 2007 - - -Full Copyright Statement - - Copyright (C) The Internet Society (2007). - - This document is subject to the rights, licenses and restrictions - contained in BCP 78, and except as set forth therein, the authors - retain all their rights. - - This document and the information contained herein are provided on an - "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS - OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET - ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, - INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE - INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED - WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - -Intellectual Property - - The IETF takes no position regarding the validity or scope of any - Intellectual Property Rights or other rights that might be claimed to - pertain to the implementation or use of the technology described in - this document or the extent to which any license under such rights - might or might not be available; nor does it represent that it has - made any independent effort to identify any such rights. Information - on the procedures with respect to rights in RFC documents can be - found in BCP 78 and BCP 79. - - Copies of IPR disclosures made to the IETF Secretariat and any - assurances of licenses to be made available, or the result of an - attempt made to obtain a general license or permission for the use of - such proprietary rights by implementers or users of this - specification can be obtained from the IETF on-line IPR repository at - http://www.ietf.org/ipr. - - The IETF invites any interested party to bring to its attention any - copyrights, patents or patent applications, or other proprietary - rights that may cover technology that may be required to implement - this standard. Please address the information to the IETF at - ietf-ipr@ietf.org. - - -Acknowledgment - - Funding for the RFC Editor function is provided by the IETF - Administrative Support Activity (IASA). - - - - - -Herlein, et al. Expires October 24, 2007 [Page 18] - diff --git a/Engine/lib/speex/doc/draft-ietf-avt-rtp-speex-05-tmp.txt b/Engine/lib/speex/doc/draft-ietf-avt-rtp-speex-05-tmp.txt deleted file mode 100644 index 70c8007ae..000000000 --- a/Engine/lib/speex/doc/draft-ietf-avt-rtp-speex-05-tmp.txt +++ /dev/null @@ -1,1288 +0,0 @@ - - - -AVT G. Herlein -Internet-Draft -Intended status: Standards Track J. Valin -Expires: August 19, 2008 CSIRO - A. Heggestad - Creytiv.com - A. Moizard - Antisip - February 16, 2008 - - - RTP Payload Format for the Speex Codec - draft-ietf-avt-rtp-speex-05 - -Status of this Memo - - By submitting this Internet-Draft, each author represents that any - applicable patent or other IPR claims of which he or she is aware - have been or will be disclosed, and any of which he or she becomes - aware will be disclosed, in accordance with Section 6 of BCP 79. - - Internet-Drafts are working documents of the Internet Engineering - Task Force (IETF), its areas, and its working groups. Note that - other groups may also distribute working documents as Internet- - Drafts. - - Internet-Drafts are draft documents valid for a maximum of six months - and may be updated, replaced, or obsoleted by other documents at any - time. It is inappropriate to use Internet-Drafts as reference - material or to cite them other than as "work in progress." - - The list of current Internet-Drafts can be accessed at - http://www.ietf.org/ietf/1id-abstracts.txt. - - The list of Internet-Draft Shadow Directories can be accessed at - http://www.ietf.org/shadow.html. - - This Internet-Draft will expire on August 19, 2008. - -Copyright Notice - - Copyright (C) The IETF Trust (2008). - - - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 1] - -Internet-Draft Speex February 2008 - - -Abstract - - Speex is an open-source voice codec suitable for use in Voice over IP - (VoIP) type applications. This document describes the payload format - for Speex generated bit streams within an RTP packet. Also included - here are the necessary details for the use of Speex with the Session - Description Protocol (SDP). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 2] - -Internet-Draft Speex February 2008 - - -Editors Note - - All references to RFC XXXX are to be replaced by references to the - RFC number of this memo, when published. - - -Table of Contents - - 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 3. RTP usage for Speex . . . . . . . . . . . . . . . . . . . . . 6 - 3.1. RTP Speex Header Fields . . . . . . . . . . . . . . . . . 6 - 3.2. RTP payload format for Speex . . . . . . . . . . . . . . . 6 - 3.3. Speex payload . . . . . . . . . . . . . . . . . . . . . . 6 - 3.4. Example Speex packet . . . . . . . . . . . . . . . . . . . 7 - 3.5. Multiple Speex frames in a RTP packet . . . . . . . . . . 7 - 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 - 4.1. Media Type Registration . . . . . . . . . . . . . . . . . 9 - 4.1.1. Registration of media type audio/speex . . . . . . . . 9 - 5. SDP usage of Speex . . . . . . . . . . . . . . . . . . . . . . 12 - 5.1. Example supporting all modes, prefer mode 4 . . . . . . . 15 - 5.2. Example supporting only mode 3 and 5 . . . . . . . . . . . 15 - 5.3. Example with Variable Bit Rate and Comfort Noise . . . . . 15 - 5.4. Example with Voice Activity Detection . . . . . . . . . . 15 - 5.5. Example with Multiple sampling rates . . . . . . . . . . . 15 - 5.6. Example with ptime and Multiple Speex frames . . . . . . . 16 - 5.7. Example with Complete Offer/Answer exchange . . . . . . . 16 - 6. Implementation Guidelines . . . . . . . . . . . . . . . . . . 17 - 7. Security Considerations . . . . . . . . . . . . . . . . . . . 18 - 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 19 - 9. Copying conditions . . . . . . . . . . . . . . . . . . . . . . 20 - 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 21 - 10.1. Normative References . . . . . . . . . . . . . . . . . . . 21 - 10.2. Informative References . . . . . . . . . . . . . . . . . . 21 - Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 22 - Intellectual Property and Copyright Statements . . . . . . . . . . 23 - - - - - - - - - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 3] - -Internet-Draft Speex February 2008 - - -1. Introduction - - Speex is based on the CELP [CELP] encoding technique with support for - either narrowband (nominal 8kHz), wideband (nominal 16kHz) or ultra- - wideband (nominal 32kHz). The main characteristics can be summarized - as follows: - - o Free software/open-source - - o Integration of wideband and narrowband in the same bit-stream - - o Wide range of bit-rates available - - o Dynamic bit-rate switching and variable bit-rate (VBR) - - o Voice Activity Detection (VAD, integrated with VBR) - - o Variable complexity - - The Speex codec supports a wide range of bit-rates from 2.15 kbit/s - to 44 kbit/s. In some cases however, it may not be possible for an - implementation to include support for all rates (e.g. because of - bandwidth, RAM or CPU constraints). In those cases, to be compliant - with this specification, implementations MUST support at least - narrowband (8 kHz) encoding and decoding at 8 kbit/s bit-rate - (narrowband mode 3). Support for narrowband at 15 kbit/s (narrowband - mode 5) is RECOMMENDED and support for wideband at 27.8 kbit/s - (wideband mode 8) is also RECOMMENDED. The sampling rate MUST be 8, - 16 or 32 kHz. - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 4] - -Internet-Draft Speex February 2008 - - -2. Terminology - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", - "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this - document are to be interpreted as described in RFC2119 [RFC2119] and - indicate requirement levels for compliant RTP implementations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 5] - -Internet-Draft Speex February 2008 - - -3. RTP usage for Speex - -3.1. RTP Speex Header Fields - - The RTP header is defined in the RTP specification [RFC3550]. This - section defines how fields in the RTP header are used. - - Payload Type (PT): The assignment of an RTP payload type for this - packet format is outside the scope of this document; it is - specified by the RTP profile under which this payload format is - used, or signaled dynamically out-of-band (e.g., using SDP). - - Marker (M) bit: The M bit is set to one on the first packet sent - after a silence period, during which packets have not been - transmitted contiguously. - - Extension (X) bit: Defined by the RTP profile used. - - Timestamp: A 32-bit word that corresponds to the sampling instant - for the first frame in the RTP packet. - -3.2. RTP payload format for Speex - - The RTP payload for Speex has the format shown in Figure 1. No - additional header fields specific to this payload format are - required. For RTP based transportation of Speex encoded audio the - standard RTP header [RFC3550] is followed by one or more payload data - blocks. An optional padding terminator may also be used. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | RTP Header | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | one or more frames of Speex .... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | one or more frames of Speex .... | padding | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - Figure 1: RTP payload for Speex - -3.3. Speex payload - - For the purposes of packetizing the bit stream in RTP, it is only - necessary to consider the sequence of bits as output by the Speex - encoder [speex_manual], and present the same sequence to the decoder. - The payload format described here maintains this sequence. - - - - -Herlein, et al. Expires August 19, 2008 [Page 6] - -Internet-Draft Speex February 2008 - - - A typical Speex frame, encoded at the maximum bitrate, is approx. 110 - octets and the total number of Speex frames SHOULD be kept less than - the path MTU to prevent fragmentation. Speex frames MUST NOT be - fragmented across multiple RTP packets, - - An RTP packet MAY contain Speex frames of the same bit rate or of - varying bit rates, since the bit-rate for a frame is conveyed in band - with the signal. - - The encoding and decoding algorithm can change the bit rate at any 20 - msec frame boundary, with the bit rate change notification provided - in-band with the bit stream. Each frame contains both sampling rate - (narrowband, wideband or ultra-wideband) and "mode" (bit-rate) - information in the bit stream. No out-of-band notification is - required for the decoder to process changes in the bit rate sent by - the encoder. - - The sampling rate MUST be either 8000 Hz, 16000 Hz, or 32000 Hz. - - The RTP payload MUST be padded to provide an integer number of octets - as the payload length. These padding bits are LSB aligned in network - octet order and consist of a 0 followed by all ones (until the end of - the octet). This padding is only required for the last frame in the - packet, and only to ensure the packet contents ends on an octet - boundary. - -3.4. Example Speex packet - - In the example below we have a single Speex frame with 5 bits of - padding to ensure the packet size falls on an octet boundary. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | RTP Header | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | ..speex data.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex data.. |0 1 1 1 1| - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - -3.5. Multiple Speex frames in a RTP packet - - Below is an example of two Speex frames contained within one RTP - packet. The Speex frame length in this example fall on an octet - boundary so there is no padding. - - The Speex decoder [speex_manual] can detect the bitrate from the - - - -Herlein, et al. Expires August 19, 2008 [Page 7] - -Internet-Draft Speex February 2008 - - - payload and is responsible for detecting the 20 msec boundaries - between each frame. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | RTP Header | - +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ - | ..speex frame 1.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex frame 1.. | ..speex frame 2.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ..speex frame 2.. | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 8] - -Internet-Draft Speex February 2008 - - -4. IANA Considerations - - This document defines the Speex media type. - -4.1. Media Type Registration - - This section describes the media types and names associated with this - payload format. The section registers the media types, as per - RFC4288 [RFC4288] - -4.1.1. Registration of media type audio/speex - - Media type name: audio - - Media subtype name: speex - - Required parameters: - - rate: RTP timestamp clock rate, which is equal to the sampling - rate in Hz. The sampling rate MUST be either 8000, 16000, or - 32000. - - Optional parameters: - - ptime: SHOULD be a multiple of 20 msec [RFC4566] - - maxptime: SHOULD be a multiple of 20 msec [RFC4566] - - vbr: variable bit rate - either 'on' 'off' or 'vad' (defaults to - off). If on, variable bit rate is enabled. If off, disabled. If - set to 'vad' then constant bit rate is used but silence will be - encoded with special short frames to indicate a lack of voice for - that period. - - - cng: comfort noise generation - either 'on' or 'off'. If off then - silence frames will be silent; if 'on' then those frames will be - filled with comfort noise. - - - mode: List supported Speex decoding modes. The valid modes are - different for narrowband and wideband, and are defined as follows: - - * {1,2,3,4,5,6,7,8,any} for narrowband - - * {0,1,2,3,4,5,6,7,8,9,10,any} for wideband and ultra-wideband - - Several 'mode' parameters can be provided. In this case, the - - - -Herlein, et al. Expires August 19, 2008 [Page 9] - -Internet-Draft Speex February 2008 - - - remote party SHOULD configure its encoder using the first - supported mode provided. When 'any' is used, the offerer - indicates that it supports all decoding modes. If the 'mode' - parameter is not provided, the mode value is considered to be - equivalent to 'mode=3;mode=any' in narrowband and - 'mode=8;mode=any' in wideband and ultra-wideband. Note that each - Speex frame does contains the mode (or bit-rate) that should be - used to decode it. Thus application MUST be able to decode any - Speex frame unless the SDP clearly specify that some modes are not - supported. (e.g., by not including 'mode=any') - - Encoding considerations: - - This media type is framed and binary, see section 4.8 in - [RFC4288]. - - Security considerations: See Section 6 - - Interoperability considerations: - - None. - - Published specification: - - RFC XXXX [RFC Editor: please replace by the RFC number of this - memo, when published] - - Applications which use this media type: - - Audio streaming and conferencing applications. - - Additional information: none - - Person and email address to contact for further information : - - Alfred E. Heggestad: aeh@db.org - - Intended usage: COMMON - - Restrictions on usage: - - This media type depends on RTP framing, and hence is only defined - for transfer via RTP [RFC3550]. Transport within other framing - protocols is not defined at this time. - - Author: Alfred E. Heggestad - - Change controller: - - - -Herlein, et al. Expires August 19, 2008 [Page 10] - -Internet-Draft Speex February 2008 - - - IETF Audio/Video Transport working group delegated from the IESG. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 11] - -Internet-Draft Speex February 2008 - - -5. SDP usage of Speex - - The information carried in the media type specification has a - specific mapping to fields in the Session Description Protocol (SDP) - [RFC4566], which is commonly used to describe RTP sessions. When SDP - is used to specify sessions employing the Speex codec, the mapping is - as follows: - - o The media type ("audio") goes in SDP "m=" as the media name. - - o The media subtype ("speex") goes in SDP "a=rtpmap" as the encoding - name. The required parameter "rate" also goes in "a=rtpmap" as - the clock rate. - - o The parameters "ptime" and "maxptime" go in the SDP "a=ptime" and - "a=maxptime" attributes, respectively. - - o Any remaining parameters go in the SDP "a=fmtp" attribute by - copying them directly from the media type string as a semicolon - separated list of parameter=value pairs. - - The tables below include the equivalence between modes and bitrates - for narrowband, wideband and ultra-wideband. Also, the corresponding - "Speex quality" setting (see SPEEX_SET_QUALITY in The Speex Codec - Manual [speex_manual]) is included as an indication. - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 12] - -Internet-Draft Speex February 2008 - - - +------+---------------+-------------+ - | mode | Speex quality | bitrate | - +------+---------------+-------------+ - | 1 | 0 | 2.15 kbit/s | - | | | | - | 2 | 2 | 5.95 kbit/s | - | | | | - | 3 | 3 or 4 | 8.00 kbit/s | - | | | | - | 4 | 5 or 6 | 11.0 kbit/s | - | | | | - | 5 | 7 or 8 | 15.0 kbit/s | - | | | | - | 6 | 9 | 18.2 kbit/s | - | | | | - | 7 | 10 | 24.6 kbit/s | - | | | | - | 8 | 1 | 3.95 kbit/s | - +------+---------------+-------------+ - - Mode vs Bitrate table for narrowband - - Table 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 13] - -Internet-Draft Speex February 2008 - - - +------+---------------+------------------+------------------------+ - | mode | Speex quality | wideband bitrate | ultra wideband bitrate | - +------+---------------+------------------+------------------------+ - | 0 | 0 | 3.95 kbit/s | 5.75 kbit/s | - | | | | | - | 1 | 1 | 5.75 kbit/s | 7.55 kbit/s | - | | | | | - | 2 | 2 | 7.75 kbit/s | 9.55 kbit/s | - | | | | | - | 3 | 3 | 9.80 kbit/s | 11.6 kbit/s | - | | | | | - | 4 | 4 | 12.8 kbit/s | 14.6 kbit/s | - | | | | | - | 5 | 5 | 16.8 kbit/s | 18.6 kbit/s | - | | | | | - | 6 | 6 | 20.6 kbit/s | 22.4 kbit/s | - | | | | | - | 7 | 7 | 23.8 kbit/s | 25.6 kbit/s | - | | | | | - | 8 | 8 | 27.8 kbit/s | 29.6 kbit/s | - | | | | | - | 9 | 9 | 34.2 kbit/s | 36.0 kbit/s | - | | | | | - | 10 | 10 | 42.2 kbit/s | 44.0 kbit/s | - +------+---------------+------------------+------------------------+ - - Mode vs Bitrate table for wideband and ultra-wideband - - Table 2 - - The Speex parameters indicate the decoding capabilities of the agent, - and what the agent prefers to receive. - - The Speex parameters in an SDP Offer/Answer exchange are completely - orthogonal, and there is no relationship between the SDP Offer and - the Answer. - - Several Speex specific parameters can be given in a single a=fmtp - line provided that they are separated by a semi-colon: - - a=fmtp:97 mode=1;mode=any;vbr=on - - Some example SDP session descriptions utilizing Speex encodings - follow. - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 14] - -Internet-Draft Speex February 2008 - - -5.1. Example supporting all modes, prefer mode 4 - - The offerer indicates that it wishes to receive a Speex stream at - 8000Hz, and wishes to receive Speex 'mode 4'. It is important to - understand that any other mode might still be sent by remote party: - the device might have bandwidth limitation or might only be able to - send 'mode=3'. Thus, application that support all decoding modes - SHOULD include 'mode=any' as shown in the example below: - - m=audio 8088 RTP/AVP 97 - a=rtpmap:97 speex/8000 - a=fmtp:97 mode=4;mode=any - -5.2. Example supporting only mode 3 and 5 - - The offerer indicates the mode he wishes to receive (Speex 'mode 3'). - This offer indicates mode 3 and mode 5 are supported and that no - other modes are supported. The remote party MUST NOT configure its - encoder using another Speex mode. - - m=audio 8088 RTP/AVP 97 - a=rtmap:97 speex/8000 - a=fmtp:97 mode=3;mode=5 - -5.3. Example with Variable Bit Rate and Comfort Noise - - The offerer indicates that it wishes to receive variable bit rate - frames with comfort noise: - - m=audio 8088 RTP/AVP 97 - a=rtmap:97 speex/8000 - a=fmtp:97 vbr=on;cng=on - -5.4. Example with Voice Activity Detection - - The offerer indicates that it wishes to use silence suppression. In - this case vbr=vad parameter will be used: - - m=audio 8088 RTP/AVP 97 - a=rtmap:97 speex/8000 - a=fmtp:97 vbr=vad - -5.5. Example with Multiple sampling rates - - The offerer indicates that it wishes to receive Speex audio at 16000 - Hz with mode 10 (42.2 kbit/s), alternatively Speex audio at 8000 Hz - with mode 7 (24.6 kbit/s). The offerer supports decoding all modes. - - - - -Herlein, et al. Expires August 19, 2008 [Page 15] - -Internet-Draft Speex February 2008 - - - m=audio 8088 RTP/AVP 97 98 - a=rtmap:97 speex/16000 - a=fmtp:97 mode=10;mode=any - a=rtmap:98 speex/8000 - a=fmtp:98 mode=7;mode=any - -5.6. Example with ptime and Multiple Speex frames - - The "ptime" attribute is used to denote the packetization interval - (ie, how many milliseconds of audio is encoded in a single RTP - packet). Since Speex uses 20 msec frames, ptime values of multiples - of 20 denote multiple Speex frames per packet. Values of ptime which - are not multiples of 20 MUST be rounded up to the first multiple of - 20 above the ptime value. - - In the example below the ptime value is set to 40, indicating that - there are 2 frames in each packet. - - m=audio 8088 RTP/AVP 97 - a=rtpmap:97 speex/8000 - a=ptime:40 - - Note that the ptime parameter applies to all payloads listed in the - media line and is not used as part of an a=fmtp directive. - - Care must be taken when setting the value of ptime so that the RTP - packet size does not exceed the path MTU. - -5.7. Example with Complete Offer/Answer exchange - - The offerer indicates that it wishes to receive Speex audio at 16000 - Hz, alternatively Speex audio at 8000 Hz. The offerer does support - ALL modes because no mode is specified. - - m=audio 8088 RTP/AVP 97 98 - a=rtmap:97 speex/16000 - a=rtmap:98 speex/8000 - - The answerer indicates that it wishes to receive Speex audio at 8000 - Hz, which is the only sampling rate it supports. The answerer does - support ALL modes because no mode is specified. - - m=audio 8088 RTP/AVP 99 - a=rtmap:99 speex/8000 - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 16] - -Internet-Draft Speex February 2008 - - -6. Implementation Guidelines - - Implementations that supports Speex are responsible for correctly - decoding incoming Speex frames. - - Each Speex frame does contains all needed informations to decode - itself. In particular, the 'mode' and 'ptime' values proposed in the - SDP contents MUST NOT be used for decoding: those values are not - needed to properly decode a RTP Speex stream. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 17] - -Internet-Draft Speex February 2008 - - -7. Security Considerations - - RTP packets using the payload format defined in this specification - are subject to the security considerations discussed in the RTP - specification [RFC3550], and any appropriate RTP profile. This - implies that confidentiality of the media streams is achieved by - encryption. Because the data compression used with this payload - format is applied end-to-end, encryption may be performed after - compression so there is no conflict between the two operations. - - A potential denial-of-service threat exists for data encodings using - compression techniques that have non-uniform receiver-end - computational load. The attacker can inject pathological datagrams - into the stream which are complex to decode and cause the receiver to - be overloaded. However, this encoding does not exhibit any - significant non-uniformity. - - As with any IP-based protocol, in some circumstances a receiver may - be overloaded simply by the receipt of too many packets, either - desired or undesired. Network-layer authentication may be used to - discard packets from undesired sources, but the processing cost of - the authentication itself may be too high. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 18] - -Internet-Draft Speex February 2008 - - -8. Acknowledgements - - The authors would like to thank Equivalence Pty Ltd of Australia for - their assistance in attempting to standardize the use of Speex in - H.323 applications, and for implementing Speex in their open source - OpenH323 stack. The authors would also like to thank Brian C. Wiles - of StreamComm for his assistance in developing - the proposed standard for Speex use in H.323 applications. - - The authors would also like to thank the following members of the - Speex and AVT communities for their input: Ross Finlayson, Federico - Montesino Pouzols, Henning Schulzrinne, Magnus Westerlund, Colin - Perkins, Ivo Emanuel Goncalves. - - Thanks to former authors of this document; Simon Morlat, Roger - Hardiman, Phil Kerr. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 19] - -Internet-Draft Speex February 2008 - - -9. Copying conditions - - The authors agree to grant third parties the irrevocable right to - copy, use and distribute the work, with or without modification, in - any medium, without royalty, provided that, unless separate - permission is granted, redistributed modified works do not contain - misleading author, version, name of work, or endorsement information. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 20] - -Internet-Draft Speex February 2008 - - -10. References - -10.1. Normative References - - [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate - Requirement Levels", BCP 14, RFC 2119, March 1997. - - [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. - Jacobson, "RTP: A Transport Protocol for Real-Time - Applications", STD 64, RFC 3550, July 2003. - - [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session - Description Protocol", RFC 4566, July 2006. - -10.2. Informative References - - [CELP] "CELP, U.S. Federal Standard 1016.", National Technical - Information Service (NTIS) website http://www.ntis.gov/. - - [RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and - Registration Procedures", BCP 13, RFC 4288, December 2005. - - [speex_manual] - Valin, J., "The Speex Codec Manual", Speex - website http://www.speex.org/docs/. - - - - - - - - - - - - - - - - - - - - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 21] - -Internet-Draft Speex February 2008 - - -Authors' Addresses - - Greg Herlein - 2034 Filbert Street - San Francisco, California 94123 - United States - - Email: gherlein@herlein.com - - - Jean-Marc Valin - CSIRO - PO Box 76 - Epping, NSW 1710 - Australia - - Email: jean-marc.valin@usherbrooke.ca - - - Alfred E. Heggestad - Creytiv.com - Biskop J. Nilssonsgt. 20a - Oslo 0659 - Norway - - Email: aeh@db.org - - - Aymeric Moizard - Antisip - 4 Quai Perrache - Lyon 69002 - France - - Email: jack@atosc.org - - - - - - - - - - - - - - - - -Herlein, et al. Expires August 19, 2008 [Page 22] - -Internet-Draft Speex February 2008 - - -Full Copyright Statement - - Copyright (C) The IETF Trust (2008). - - This document is subject to the rights, licenses and restrictions - contained in BCP 78, and except as set forth therein, the authors - retain all their rights. - - This document and the information contained herein are provided on an - "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS - OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND - THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF - THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED - WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - -Intellectual Property - - The IETF takes no position regarding the validity or scope of any - Intellectual Property Rights or other rights that might be claimed to - pertain to the implementation or use of the technology described in - this document or the extent to which any license under such rights - might or might not be available; nor does it represent that it has - made any independent effort to identify any such rights. Information - on the procedures with respect to rights in RFC documents can be - found in BCP 78 and BCP 79. - - Copies of IPR disclosures made to the IETF Secretariat and any - assurances of licenses to be made available, or the result of an - attempt made to obtain a general license or permission for the use of - such proprietary rights by implementers or users of this - specification can be obtained from the IETF on-line IPR repository at - http://www.ietf.org/ipr. - - The IETF invites any interested party to bring to its attention any - copyrights, patents or patent applications, or other proprietary - rights that may cover technology that may be required to implement - this standard. Please address the information to the IETF at - ietf-ipr@ietf.org. - - -Acknowledgment - - Funding for the RFC Editor function is provided by the IETF - Administrative Support Activity (IASA). - - - - - -Herlein, et al. Expires August 19, 2008 [Page 23] - diff --git a/Engine/lib/speex/doc/echo_path.eps b/Engine/lib/speex/doc/echo_path.eps deleted file mode 100644 index c5a458c53..000000000 --- a/Engine/lib/speex/doc/echo_path.eps +++ /dev/null @@ -1,1298 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%BoundingBox: 0 0 415 235 -%%Pages: 0 -%%Creator: Sun Microsystems, Inc. -%%Title: none -%%CreationDate: none -%%LanguageLevel: 2 -%%EndComments -%%BeginProlog -%%BeginResource: procset SDRes-Prolog 1.0 0 -/b4_inc_state save def -/dict_count countdictstack def -/op_count count 1 sub def -userdict begin -0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit[] 0 setdash newpath -/languagelevel where {pop languagelevel 1 ne {false setstrokeadjust false setoverprint} if} if -/bdef {bind def} bind def -/c {setgray} bdef -/l {neg lineto} bdef -/rl {neg rlineto} bdef -/lc {setlinecap} bdef -/lj {setlinejoin} bdef -/lw {setlinewidth} bdef -/ml {setmiterlimit} bdef -/ld {setdash} bdef -/m {neg moveto} bdef -/ct {6 2 roll neg 6 2 roll neg 6 2 roll neg curveto} bdef -/r {rotate} bdef -/t {neg translate} bdef -/s {scale} bdef -/sw {show} bdef -/gs {gsave} bdef -/gr {grestore} bdef -/f {findfont dup length dict begin -{1 index /FID ne {def} {pop pop} ifelse} forall /Encoding ISOLatin1Encoding def -currentdict end /NFont exch definefont pop /NFont findfont} bdef -/p {closepath} bdef -/sf {scalefont setfont} bdef -/ef {eofill}bdef -/pc {closepath stroke}bdef -/ps {stroke}bdef -/pum {matrix currentmatrix}bdef -/pom {setmatrix}bdef -/bs {/aString exch def /nXOfs exch def /nWidth exch def currentpoint nXOfs 0 rmoveto pum nWidth aString stringwidth pop div 1 scale aString show pom moveto} bdef -%%EndResource -%%EndProlog -%%BeginSetup -%%EndSetup -%%Page: 1 1 -%%BeginPageSetup -%%EndPageSetup -pum -0.02836 0.02836 s -0 -8286 t -/tm matrix currentmatrix def -tm setmatrix --3900 -8857 t -1 1 s -0.000 c 10000 12000 m 9581 12419 l 9413 12084 l 10000 12000 l p ef -6989 13478 m 9586 12179 l 9609 12224 l 7011 13522 l 6989 13478 l p ef -0.996 c 8500 13800 m 7500 13800 l 7500 11800 l 9500 11800 l 9500 13800 l -8500 13800 l p ef -50 lw 1 lj 0.000 c 8500 13800 m 7500 13800 l 7500 11800 l 9500 11800 l -9500 13800 l 8500 13800 l pc -gs -gs -pum -8080 12960 t -103 -334 m 103 -334 103 -334 8 -334 ct 8 -334 8 -334 8 -323 ct 31 -318 34 -314 34 -294 ct -34 -294 34 -294 34 -42 ct 34 -21 30 -16 8 -12 ct 8 -12 8 -12 8 0 ct 8 0 8 0 127 0 ct -127 0 127 0 127 -12 ct 109 -14 103 -22 103 -40 ct 103 -40 103 -40 103 -172 ct 103 -174 106 -179 111 -184 ct -122 -195 134 -201 145 -201 ct 163 -201 171 -188 171 -160 ct 171 -160 171 -160 171 -40 ct -171 -22 165 -14 148 -12 ct 148 -12 148 -12 148 0 ct 148 0 148 0 264 0 ct 264 0 264 0 264 -12 ct -246 -13 240 -21 240 -42 ct 240 -42 240 -42 240 -164 ct 240 -207 213 -234 173 -234 ct -147 -234 128 -224 103 -195 ct 103 -195 103 -195 103 -334 ct p ef -pom -gr -gs -pum -8351 12960 t -143 -334 m 107 -310 92 -297 75 -274 ct 40 -231 23 -182 23 -124 ct 23 -62 41 -13 84 37 ct -104 61 116 72 141 87 ct 141 87 141 87 147 79 ct 108 48 95 31 82 -6 ct 70 -39 65 -76 65 -126 ct -65 -178 71 -218 84 -249 ct 98 -279 112 -297 147 -326 ct 147 -326 147 -326 143 -334 ct -p ef -pom -gr -gs -pum -8516 12960 t -227 -58 m 227 -58 227 -58 217 -45 ct 203 -27 194 -19 187 -19 ct 183 -19 179 -23 179 -27 ct -179 -31 179 -31 186 -58 ct 186 -58 186 -58 214 -160 ct 216 -170 218 -181 218 -188 ct -218 -206 205 -218 186 -218 ct 154 -218 123 -189 72 -110 ct 72 -110 72 -110 105 -217 ct -105 -217 105 -217 104 -218 ct 77 -213 67 -211 24 -203 ct 24 -203 24 -203 24 -195 ct -49 -195 55 -192 55 -182 ct 55 -179 55 -176 54 -173 ct 54 -173 54 -173 7 0 ct 7 0 7 0 44 0 ct -67 -78 72 -89 93 -123 ct 123 -168 148 -193 166 -193 ct 174 -193 178 -188 178 -179 ct -178 -173 175 -156 171 -141 ct 171 -141 171 -141 150 -60 ct 143 -35 142 -28 142 -23 ct -142 -4 149 4 165 4 ct 187 4 200 -6 234 -52 ct 234 -52 234 -52 227 -58 ct p ef -pom -gr -gs -pum -8766 12960 t -18 87 m 54 64 69 51 87 28 ct 121 -15 138 -64 138 -122 ct 138 -185 120 -233 77 -283 ct -58 -307 45 -318 20 -334 ct 20 -334 20 -334 14 -326 ct 53 -295 66 -277 79 -240 ct -91 -207 96 -170 96 -120 ct 96 -69 90 -28 77 2 ct 63 33 49 51 14 79 ct 14 79 14 79 18 87 ct -p ef -pom -gr -gr -14100 16000 m 13824 16000 13600 15776 13600 15500 ct 13600 15224 13824 15000 14100 15000 ct -14376 15000 14600 15224 14600 15500 ct 14600 15776 14376 16000 14100 16000 ct -pc -gs -gs -pum -13954 15668 t -121 -141 m 15 -141 l 15 -108 l 121 -108 l 121 0 l 153 0 l 153 -108 l -259 -108 l 259 -141 l 153 -141 l 153 -250 l 121 -250 l 121 -141 l -p ef -pom -gr -gr -8500 16000 m 8224 16000 8000 15776 8000 15500 ct 8000 15224 8224 15000 8500 15000 ct -8776 15000 9000 15224 9000 15500 ct 9000 15776 8776 16000 8500 16000 ct pc -8500 15000 m 8313 14438 l 8688 14438 l 8500 15000 l p ef -8525 13800 m 8525 14550 l 8475 14550 l 8475 13800 l 8525 13800 l p ef -9000 15500 m 9563 15313 l 9563 15688 l 9000 15500 l p ef -13600 15525 m 9450 15525 l 9450 15475 l 13600 15475 l 13600 15525 l -p ef -14100 13800 m 13100 13800 l 13100 11800 l 15100 11800 l 15100 13800 l -14100 13800 l pc -gs -gs -pum -13663 12960 t -103 -334 m 103 -334 103 -334 8 -334 ct 8 -334 8 -334 8 -323 ct 31 -318 34 -314 34 -294 ct -34 -294 34 -294 34 -42 ct 34 -21 30 -16 8 -12 ct 8 -12 8 -12 8 0 ct 8 0 8 0 127 0 ct -127 0 127 0 127 -12 ct 109 -14 103 -22 103 -40 ct 103 -40 103 -40 103 -172 ct 103 -174 106 -179 111 -184 ct -122 -195 134 -201 145 -201 ct 163 -201 171 -188 171 -160 ct 171 -160 171 -160 171 -40 ct -171 -22 165 -14 148 -12 ct 148 -12 148 -12 148 0 ct 148 0 148 0 264 0 ct 264 0 264 0 264 -12 ct -246 -13 240 -21 240 -42 ct 240 -42 240 -42 240 -164 ct 240 -207 213 -234 173 -234 ct -147 -234 128 -224 103 -195 ct 103 -195 103 -195 103 -334 ct p ef -pom -gr -gs -pum -13934 12960 t -143 -334 m 107 -310 92 -297 75 -274 ct 40 -231 23 -182 23 -124 ct 23 -62 41 -13 84 37 ct -104 61 116 72 141 87 ct 141 87 141 87 147 79 ct 108 48 95 31 82 -6 ct 70 -39 65 -76 65 -126 ct -65 -178 71 -218 84 -249 ct 98 -279 112 -297 147 -326 ct 147 -326 147 -326 143 -334 ct -p ef -pom -gr -gs -pum -14099 12960 t -227 -58 m 227 -58 227 -58 217 -45 ct 203 -27 194 -19 187 -19 ct 183 -19 179 -23 179 -27 ct -179 -31 179 -31 186 -58 ct 186 -58 186 -58 214 -160 ct 216 -170 218 -181 218 -188 ct -218 -206 205 -218 186 -218 ct 154 -218 123 -189 72 -110 ct 72 -110 72 -110 105 -217 ct -105 -217 105 -217 104 -218 ct 77 -213 67 -211 24 -203 ct 24 -203 24 -203 24 -195 ct -49 -195 55 -192 55 -182 ct 55 -179 55 -176 54 -173 ct 54 -173 54 -173 7 0 ct 7 0 7 0 44 0 ct -67 -78 72 -89 93 -123 ct 123 -168 148 -193 166 -193 ct 174 -193 178 -188 178 -179 ct -178 -173 175 -156 171 -141 ct 171 -141 171 -141 150 -60 ct 143 -35 142 -28 142 -23 ct -142 -4 149 4 165 4 ct 187 4 200 -6 234 -52 ct 234 -52 234 -52 227 -58 ct p ef -pom -gr -gs -pum -14349 12960 t -18 87 m 54 64 69 51 87 28 ct 121 -15 138 -64 138 -122 ct 138 -185 120 -233 77 -283 ct -58 -307 45 -318 20 -334 ct 20 -334 20 -334 14 -326 ct 53 -295 66 -277 79 -240 ct -91 -207 96 -170 96 -120 ct 96 -69 90 -28 77 2 ct 63 33 49 51 14 79 ct 14 79 14 79 18 87 ct -p ef -pom -gr -gr -14100 15000 m 13913 14438 l 14288 14438 l 14100 15000 l p ef -14125 13800 m 14125 14550 l 14075 14550 l 14075 13800 l 14125 13800 l -p ef -5900 15500 m 6463 15313 l 6463 15688 l 5900 15500 l p ef -8000 15525 m 6350 15525 l 6350 15475 l 8000 15475 l 8000 15525 l p ef -8500 11800 m 8313 11238 l 8688 11238 l 8500 11800 l p ef -5600 10575 m 8500 10575 l 8500 10600 l 8500 10625 l 5600 10625 l 5600 10600 l -5600 10575 l p ef -8500 10600 m 8500 10575 l 8504 10575 l 8509 10577 l 8512 10578 l 8516 10581 l -8519 10584 l 8522 10587 l 8523 10591 l 8525 10596 l 8525 10600 l 8525 10600 l -8500 10600 l p ef -8525 10600 m 8525 11350 l 8500 11350 l 8475 11350 l 8475 10600 l 8500 10600 l -8525 10600 l p ef -14600 15500 m 15163 15313 l 15163 15688 l 14600 15500 l p ef -15900 15525 m 15050 15525 l 15050 15475 l 15900 15475 l 15900 15525 l -p ef -14100 11800 m 13913 11238 l 14288 11238 l 14100 11800 l p ef -5600 10575 m 14100 10575 l 14100 10600 l 14100 10625 l 5600 10625 l -5600 10600 l 5600 10575 l p ef -14100 10600 m 14100 10575 l 14104 10575 l 14109 10577 l 14112 10578 l -14116 10581 l 14119 10584 l 14122 10587 l 14123 10591 l 14125 10596 l -14125 10600 l 14125 10600 l 14100 10600 l p ef -14125 10600 m 14125 11350 l 14100 11350 l 14075 11350 l 14075 10600 l -14100 10600 l 14125 10600 l p ef -7000 15500 m 7000 13500 l ps -gs -gs -pum -16150 15536 t -10 -200 m 16 -200 20 -200 25 -200 ct 44 -200 49 -192 56 -146 ct 61 -112 67 -37 67 -8 ct -67 6 68 9 72 9 ct 84 9 130 -43 180 -114 ct 198 -138 210 -170 210 -189 ct 210 -205 198 -218 183 -218 ct -172 -218 165 -212 165 -201 ct 165 -193 167 -188 176 -180 ct 183 -174 185 -170 185 -165 ct -185 -142 153 -87 118 -50 ct 118 -50 118 -50 102 -35 ct 99 -104 96 -130 89 -167 ct -80 -217 80 -218 75 -218 ct 73 -218 69 -217 65 -216 ct 56 -214 29 -209 10 -206 ct -10 -206 10 -206 10 -200 ct p ef -pom -gr -gs -pum -16370 15536 t -143 -334 m 107 -310 92 -297 75 -274 ct 40 -231 23 -182 23 -124 ct 23 -62 41 -13 84 37 ct -104 61 116 72 141 87 ct 141 87 141 87 147 79 ct 108 48 95 31 82 -6 ct 70 -39 65 -76 65 -126 ct -65 -178 71 -218 84 -249 ct 98 -279 112 -297 147 -326 ct 147 -326 147 -326 143 -334 ct -p ef -pom -gr -gs -pum -16535 15536 t -227 -58 m 227 -58 227 -58 217 -45 ct 203 -27 194 -19 187 -19 ct 183 -19 179 -23 179 -27 ct -179 -31 179 -31 186 -58 ct 186 -58 186 -58 214 -160 ct 216 -170 218 -181 218 -188 ct -218 -206 205 -218 186 -218 ct 154 -218 123 -189 72 -110 ct 72 -110 72 -110 105 -217 ct -105 -217 105 -217 104 -218 ct 77 -213 67 -211 24 -203 ct 24 -203 24 -203 24 -195 ct -49 -195 55 -192 55 -182 ct 55 -179 55 -176 54 -173 ct 54 -173 54 -173 7 0 ct 7 0 7 0 44 0 ct -67 -78 72 -89 93 -123 ct 123 -168 148 -193 166 -193 ct 174 -193 178 -188 178 -179 ct -178 -173 175 -156 171 -141 ct 171 -141 171 -141 150 -60 ct 143 -35 142 -28 142 -23 ct -142 -4 149 4 165 4 ct 187 4 200 -6 234 -52 ct 234 -52 234 -52 227 -58 ct p ef -pom -gr -gs -pum -16785 15536 t -18 87 m 54 64 69 51 87 28 ct 121 -15 138 -64 138 -122 ct 138 -185 120 -233 77 -283 ct -58 -307 45 -318 20 -334 ct 20 -334 20 -334 14 -326 ct 53 -295 66 -277 79 -240 ct -91 -207 96 -170 96 -120 ct 96 -69 90 -28 77 2 ct 63 33 49 51 14 79 ct 14 79 14 79 18 87 ct -p ef -pom -gr -gr -gs -gs -pum -9747 15298 t -229 -55 m 202 -24 197 -20 188 -20 ct 183 -20 179 -24 179 -30 ct 179 -37 195 -97 211 -152 ct -225 -197 235 -237 260 -336 ct 260 -336 260 -336 258 -338 ct 232 -333 214 -330 182 -327 ct -182 -327 182 -327 182 -318 ct 209 -318 213 -316 213 -306 ct 213 -299 212 -296 206 -271 ct -206 -271 206 -271 184 -190 ct 180 -210 171 -218 152 -218 ct 87 -218 7 -125 7 -51 ct -7 -16 27 5 59 5 ct 93 5 115 -11 148 -60 ct 143 -35 142 -27 142 -16 ct 142 -3 150 6 163 6 ct -183 6 209 -14 235 -50 ct 235 -50 235 -50 229 -55 ct p -154 -207 m 168 -207 176 -198 176 -180 ct 176 -104 124 -19 79 -19 ct 62 -19 50 -32 50 -51 ct -50 -92 75 -149 108 -183 ct 122 -198 140 -207 154 -207 ct p ef -pom -gr -gs -pum -9997 15298 t -143 -334 m 107 -310 92 -297 75 -274 ct 40 -231 23 -182 23 -124 ct 23 -62 41 -13 84 37 ct -104 61 116 72 141 87 ct 141 87 141 87 147 79 ct 108 48 95 31 82 -6 ct 70 -39 65 -76 65 -126 ct -65 -178 71 -218 84 -249 ct 98 -279 112 -297 147 -326 ct 147 -326 147 -326 143 -334 ct -p ef -pom -gr -gs -pum -10162 15298 t -227 -58 m 227 -58 227 -58 217 -45 ct 203 -27 194 -19 187 -19 ct 183 -19 179 -23 179 -27 ct -179 -31 179 -31 186 -58 ct 186 -58 186 -58 214 -160 ct 216 -170 218 -181 218 -188 ct -218 -206 205 -218 186 -218 ct 154 -218 123 -189 72 -110 ct 72 -110 72 -110 105 -217 ct -105 -217 105 -217 104 -218 ct 77 -213 67 -211 24 -203 ct 24 -203 24 -203 24 -195 ct -49 -195 55 -192 55 -182 ct 55 -179 55 -176 54 -173 ct 54 -173 54 -173 7 0 ct 7 0 7 0 44 0 ct -67 -78 72 -89 93 -123 ct 123 -168 148 -193 166 -193 ct 174 -193 178 -188 178 -179 ct -178 -173 175 -156 171 -141 ct 171 -141 171 -141 150 -60 ct 143 -35 142 -28 142 -23 ct -142 -4 149 4 165 4 ct 187 4 200 -6 234 -52 ct 234 -52 234 -52 227 -58 ct p ef -pom -gr -gs -pum -10412 15298 t -18 87 m 54 64 69 51 87 28 ct 121 -15 138 -64 138 -122 ct 138 -185 120 -233 77 -283 ct -58 -307 45 -318 20 -334 ct 20 -334 20 -334 14 -326 ct 53 -295 66 -277 79 -240 ct -91 -207 96 -170 96 -120 ct 96 -69 90 -28 77 2 ct 63 33 49 51 14 79 ct 14 79 14 79 18 87 ct -p ef -pom -gr -gr -gs -gs -pum -4561 10747 t -199 -55 m 195 -51 192 -48 188 -42 ct 176 -27 170 -22 165 -22 ct 158 -22 153 -29 150 -42 ct -149 -46 148 -49 148 -51 ct 135 -101 130 -123 130 -131 ct 152 -169 169 -190 178 -190 ct -181 -190 185 -189 190 -186 ct 196 -183 200 -182 204 -182 ct 214 -182 221 -189 221 -200 ct -221 -210 212 -218 201 -218 ct 179 -218 160 -200 126 -147 ct 126 -147 126 -147 121 -175 ct -114 -208 108 -218 95 -218 ct 84 -218 67 -214 37 -204 ct 37 -204 37 -204 32 -202 ct -32 -202 32 -202 34 -194 ct 52 -199 57 -200 61 -200 ct 74 -200 77 -195 83 -166 ct -83 -166 83 -166 98 -105 ct 98 -105 98 -105 57 -47 ct 47 -33 38 -24 32 -24 ct 29 -24 24 -25 19 -28 ct -13 -32 7 -33 3 -33 ct -6 -33 -13 -26 -13 -16 ct -13 -3 -3 5 11 5 ct 27 5 33 1 57 -30 ct -71 -45 81 -59 102 -87 ct 102 -87 102 -87 117 -28 ct 123 -3 129 5 145 5 ct 164 5 177 -7 206 -51 ct -206 -51 206 -51 199 -55 ct p ef -pom -gr -gs -pum -4781 10747 t -143 -334 m 107 -310 92 -297 75 -274 ct 40 -231 23 -182 23 -124 ct 23 -62 41 -13 84 37 ct -104 61 116 72 141 87 ct 141 87 141 87 147 79 ct 108 48 95 31 82 -6 ct 70 -39 65 -76 65 -126 ct -65 -178 71 -218 84 -249 ct 98 -279 112 -297 147 -326 ct 147 -326 147 -326 143 -334 ct -p ef -pom -gr -gs -pum -4946 10747 t -227 -58 m 227 -58 227 -58 217 -45 ct 203 -27 194 -19 187 -19 ct 183 -19 179 -23 179 -27 ct -179 -31 179 -31 186 -58 ct 186 -58 186 -58 214 -160 ct 216 -170 218 -181 218 -188 ct -218 -206 205 -218 186 -218 ct 154 -218 123 -189 72 -110 ct 72 -110 72 -110 105 -217 ct -105 -217 105 -217 104 -218 ct 77 -213 67 -211 24 -203 ct 24 -203 24 -203 24 -195 ct -49 -195 55 -192 55 -182 ct 55 -179 55 -176 54 -173 ct 54 -173 54 -173 7 0 ct 7 0 7 0 44 0 ct -67 -78 72 -89 93 -123 ct 123 -168 148 -193 166 -193 ct 174 -193 178 -188 178 -179 ct -178 -173 175 -156 171 -141 ct 171 -141 171 -141 150 -60 ct 143 -35 142 -28 142 -23 ct -142 -4 149 4 165 4 ct 187 4 200 -6 234 -52 ct 234 -52 234 -52 227 -58 ct p ef -pom -gr -gs -pum -5196 10747 t -18 87 m 54 64 69 51 87 28 ct 121 -15 138 -64 138 -122 ct 138 -185 120 -233 77 -283 ct -58 -307 45 -318 20 -334 ct 20 -334 20 -334 14 -326 ct 53 -295 66 -277 79 -240 ct -91 -207 96 -170 96 -120 ct 96 -69 90 -28 77 2 ct 63 33 49 51 14 79 ct 14 79 14 79 18 87 ct -p ef -pom -gr -gr -gs -gs -pum -4932 15694 t -177 -54 m 141 -25 126 -17 105 -17 ct 77 -17 58 -35 58 -62 ct 58 -69 59 -77 63 -92 ct -63 -92 63 -92 77 -94 ct 151 -105 204 -142 204 -185 ct 204 -206 189 -218 164 -218 ct -93 -218 15 -137 15 -63 ct 15 -23 42 5 81 5 ct 116 5 154 -15 183 -48 ct 183 -48 183 -48 177 -54 ct -p -75 -125 m 92 -169 128 -207 154 -207 ct 164 -207 171 -199 171 -188 ct 171 -172 162 -155 146 -140 ct -128 -123 109 -114 67 -103 ct 67 -103 67 -103 75 -125 ct p ef -pom -gr -gs -pum -5152 15694 t -143 -334 m 107 -310 92 -297 75 -274 ct 40 -231 23 -182 23 -124 ct 23 -62 41 -13 84 37 ct -104 61 116 72 141 87 ct 141 87 141 87 147 79 ct 108 48 95 31 82 -6 ct 70 -39 65 -76 65 -126 ct -65 -178 71 -218 84 -249 ct 98 -279 112 -297 147 -326 ct 147 -326 147 -326 143 -334 ct -p ef -pom -gr -gs -pum -5317 15694 t -227 -58 m 227 -58 227 -58 217 -45 ct 203 -27 194 -19 187 -19 ct 183 -19 179 -23 179 -27 ct -179 -31 179 -31 186 -58 ct 186 -58 186 -58 214 -160 ct 216 -170 218 -181 218 -188 ct -218 -206 205 -218 186 -218 ct 154 -218 123 -189 72 -110 ct 72 -110 72 -110 105 -217 ct -105 -217 105 -217 104 -218 ct 77 -213 67 -211 24 -203 ct 24 -203 24 -203 24 -195 ct -49 -195 55 -192 55 -182 ct 55 -179 55 -176 54 -173 ct 54 -173 54 -173 7 0 ct 7 0 7 0 44 0 ct -67 -78 72 -89 93 -123 ct 123 -168 148 -193 166 -193 ct 174 -193 178 -188 178 -179 ct -178 -173 175 -156 171 -141 ct 171 -141 171 -141 150 -60 ct 143 -35 142 -28 142 -23 ct -142 -4 149 4 165 4 ct 187 4 200 -6 234 -52 ct 234 -52 234 -52 227 -58 ct p ef -pom -gr -gs -pum -5567 15694 t -18 87 m 54 64 69 51 87 28 ct 121 -15 138 -64 138 -122 ct 138 -185 120 -233 77 -283 ct -58 -307 45 -318 20 -334 ct 20 -334 20 -334 14 -326 ct 53 -295 66 -277 79 -240 ct -91 -207 96 -170 96 -120 ct 96 -69 90 -28 77 2 ct 63 33 49 51 14 79 ct 14 79 14 79 18 87 ct -p ef -pom -gr -gr -gs -gs -pum -8954 15959 t -121 -141 m 15 -141 l 15 -108 l 121 -108 l 121 0 l 153 0 l 153 -108 l -259 -108 l 259 -141 l 153 -141 l 153 -250 l 121 -250 l 121 -141 l -p ef -pom -gr -gr -gs -gs -pum -8848 15033 t -19 -127 m 19 -96 l 138 -96 l 138 -127 l 19 -127 l p ef -pom -gr -gr -gs -gs -pum -8080 12705 t -45 -147 m 114 -290 l 183 -147 l 216 -147 l 128 -327 l 99 -327 l 12 -147 l -45 -147 l p ef -pom -gr -gr -0.996 c 12400 9601 m 12394 11602 l 11895 11099 l 11897 10099 l 12400 9601 l -p ef -0.000 c 12400 9601 m 12394 11602 l 11895 11099 l 11897 10099 l 12400 9601 l -pc -0.996 c 11397 10599 m 11398 10099 l 11898 10100 l 11895 11100 l 11395 11099 l -11397 10599 l p ef -0.000 c 11397 10599 m 11398 10099 l 11898 10100 l 11895 11100 l 11395 11099 l -11397 10599 l pc -0.996 c 11900 16000 m 11624 16000 11400 15776 11400 15500 ct 11400 15224 11624 15000 11900 15000 ct -12176 15000 12400 15224 12400 15500 ct 12400 15776 12176 16000 11900 16000 ct -p ef -0.000 c 11900 16000 m 11624 16000 11400 15776 11400 15500 ct 11400 15224 11624 15000 11900 15000 ct -12176 15000 12400 15224 12400 15500 ct 12400 15776 12176 16000 11900 16000 ct -pc -12400 15000 m 12400 16000 l ps -gs -gs -pum -14880 16144 t -8 -196 m 11 -198 15 -198 21 -198 ct 34 -198 39 -191 39 -166 ct 39 -166 39 -166 39 -44 ct -39 -15 33 -8 9 -8 ct 9 -8 9 -8 9 0 ct 9 0 9 0 111 0 ct 111 0 111 0 111 -8 ct 87 -8 79 -14 79 -32 ct -79 -32 79 -32 79 -171 ct 103 -194 113 -200 129 -200 ct 153 -200 165 -184 165 -152 ct -165 -152 165 -152 165 -48 ct 165 -17 158 -8 134 -8 ct 134 -8 134 -8 134 0 ct 134 0 134 0 235 0 ct -235 0 235 0 235 -7 ct 211 -10 205 -16 205 -40 ct 205 -40 205 -40 205 -153 ct 205 -199 184 -227 148 -227 ct -126 -227 111 -219 78 -187 ct 78 -187 78 -187 78 -226 ct 78 -226 78 -226 75 -227 ct -51 -218 34 -213 8 -205 ct 8 -205 8 -205 8 -196 ct p ef -448 -81 m 424 -43 403 -29 372 -29 ct 345 -29 324 -43 310 -72 ct 301 -90 298 -107 297 -137 ct -297 -137 297 -137 446 -137 ct 442 -169 437 -183 425 -199 ct 411 -217 388 -227 363 -227 ct -339 -227 316 -218 298 -201 ct 275 -181 262 -146 262 -106 ct 262 -37 297 5 353 5 ct -399 5 435 -24 455 -78 ct 455 -78 455 -78 448 -81 ct p -298 -153 m 303 -191 320 -209 349 -209 ct 379 -209 390 -196 397 -153 ct 397 -153 397 -153 298 -153 ct -p ef -684 -32 m 676 -26 670 -23 663 -23 ct 652 -23 648 -30 648 -52 ct 648 -52 648 -52 648 -148 ct -648 -173 646 -188 638 -200 ct 628 -218 607 -227 578 -227 ct 533 -227 497 -203 497 -171 ct -497 -160 507 -150 518 -150 ct 530 -150 540 -160 540 -171 ct 540 -173 539 -175 539 -179 ct -538 -183 537 -187 537 -191 ct 537 -204 553 -215 572 -215 ct 596 -215 609 -201 609 -174 ct -609 -174 609 -174 609 -144 ct 534 -113 526 -109 505 -90 ct 495 -81 488 -64 488 -48 ct -488 -17 509 5 539 5 ct 560 5 580 -5 609 -31 ct 612 -5 621 5 640 5 ct 657 5 667 -1 684 -20 ct -684 -20 684 -20 684 -32 ct p -609 -61 m 609 -45 607 -41 596 -35 ct 585 -28 571 -24 561 -24 ct 544 -24 531 -40 531 -62 ct -531 -62 531 -62 531 -63 ct 531 -92 550 -110 609 -132 ct 609 -132 609 -132 609 -61 ct -p ef -693 -192 m 700 -194 705 -194 710 -194 ct 722 -194 727 -186 727 -164 ct 727 -164 727 -164 727 -41 ct -727 -17 723 -13 692 -7 ct 692 -7 692 -7 692 0 ct 692 0 692 0 809 0 ct 809 0 809 0 809 -8 ct -776 -8 767 -15 767 -44 ct 767 -44 767 -44 767 -155 ct 767 -171 788 -196 801 -196 ct -804 -196 809 -193 814 -188 ct 822 -182 827 -179 833 -179 ct 845 -179 852 -187 852 -201 ct -852 -217 842 -227 826 -227 ct 805 -227 791 -216 767 -181 ct 767 -181 767 -181 767 -226 ct -767 -226 767 -226 765 -227 ct 739 -216 722 -210 693 -200 ct 693 -200 693 -200 693 -192 ct -p ef -1176 -81 m 1152 -43 1131 -29 1100 -29 ct 1073 -29 1052 -43 1038 -72 ct 1029 -90 1026 -107 1025 -137 ct -1025 -137 1025 -137 1174 -137 ct 1170 -169 1165 -183 1153 -199 ct 1139 -217 1116 -227 1091 -227 ct -1067 -227 1044 -218 1026 -201 ct 1003 -181 990 -146 990 -106 ct 990 -37 1025 5 1081 5 ct -1127 5 1163 -24 1183 -78 ct 1183 -78 1183 -78 1176 -81 ct p -1026 -153 m 1031 -191 1048 -209 1077 -209 ct 1107 -209 1118 -196 1125 -153 ct -1125 -153 1125 -153 1026 -153 ct p ef -1206 -196 m 1209 -198 1213 -198 1219 -198 ct 1232 -198 1237 -191 1237 -166 ct -1237 -166 1237 -166 1237 -44 ct 1237 -15 1231 -8 1207 -8 ct 1207 -8 1207 -8 1207 0 ct -1207 0 1207 0 1309 0 ct 1309 0 1309 0 1309 -8 ct 1285 -8 1277 -14 1277 -32 ct 1277 -32 1277 -32 1277 -171 ct -1301 -194 1311 -200 1327 -200 ct 1351 -200 1363 -184 1363 -152 ct 1363 -152 1363 -152 1363 -48 ct -1363 -17 1356 -8 1332 -8 ct 1332 -8 1332 -8 1332 0 ct 1332 0 1332 0 1433 0 ct 1433 0 1433 0 1433 -7 ct -1409 -10 1403 -16 1403 -40 ct 1403 -40 1403 -40 1403 -153 ct 1403 -199 1382 -227 1346 -227 ct -1324 -227 1309 -219 1276 -187 ct 1276 -187 1276 -187 1276 -226 ct 1276 -226 1276 -226 1273 -227 ct -1249 -218 1232 -213 1206 -205 ct 1206 -205 1206 -205 1206 -196 ct p ef -1615 5 m 1615 5 1615 5 1686 -21 ct 1686 -21 1686 -21 1686 -28 ct 1677 -28 1676 -28 1675 -28 ct -1657 -28 1653 -33 1653 -56 ct 1653 -56 1653 -56 1653 -336 ct 1653 -336 1653 -336 1651 -337 ct -1628 -329 1611 -324 1580 -315 ct 1580 -315 1580 -315 1580 -308 ct 1584 -308 1586 -308 1590 -308 ct -1608 -308 1613 -303 1613 -283 ct 1613 -283 1613 -283 1613 -206 ct 1594 -222 1581 -227 1562 -227 ct -1506 -227 1461 -171 1461 -101 ct 1461 -38 1497 5 1551 5 ct 1578 5 1596 -5 1613 -28 ct -1613 -28 1613 -28 1613 4 ct 1613 4 1613 4 1615 5 ct p -1613 -50 m 1613 -47 1609 -41 1604 -35 ct 1596 -26 1584 -21 1570 -21 ct 1529 -21 1503 -60 1503 -121 ct -1503 -177 1526 -213 1563 -213 ct 1589 -213 1613 -190 1613 -164 ct 1613 -164 1613 -164 1613 -50 ct -p ef -1973 -155 m 1973 -155 1973 -155 1971 -222 ct 1971 -222 1971 -222 1965 -222 ct -1965 -222 1965 -222 1964 -221 ct 1960 -218 1959 -217 1957 -217 ct 1955 -217 1950 -218 1944 -221 ct -1934 -225 1923 -227 1911 -227 ct 1872 -227 1845 -202 1845 -166 ct 1845 -138 1860 -118 1901 -95 ct -1901 -95 1901 -95 1929 -78 ct 1946 -69 1955 -57 1955 -41 ct 1955 -20 1939 -6 1914 -6 ct -1898 -6 1883 -12 1874 -23 ct 1864 -35 1859 -47 1853 -75 ct 1853 -75 1853 -75 1845 -75 ct -1845 -75 1845 -75 1845 2 ct 1845 2 1845 2 1851 2 ct 1855 -3 1857 -4 1863 -4 ct -1867 -4 1874 -3 1885 0 ct 1898 3 1912 5 1920 5 ct 1957 5 1988 -24 1988 -58 ct 1988 -83 1977 -99 1948 -117 ct -1948 -117 1948 -117 1896 -148 ct 1882 -156 1875 -169 1875 -182 ct 1875 -202 1890 -216 1912 -216 ct -1940 -216 1954 -199 1965 -155 ct 1965 -155 1965 -155 1973 -155 ct p ef -2019 -195 m 2024 -195 2027 -195 2031 -195 ct 2048 -195 2051 -190 2051 -167 ct -2051 -167 2051 -167 2051 65 ct 2051 90 2046 96 2017 99 ct 2017 99 2017 99 2017 107 ct -2017 107 2017 107 2135 107 ct 2135 107 2135 107 2135 98 ct 2098 98 2092 93 2092 61 ct -2092 61 2092 61 2092 -16 ct 2109 0 2121 5 2141 5 ct 2198 5 2243 -50 2243 -122 ct -2243 -183 2209 -227 2162 -227 ct 2135 -227 2113 -215 2092 -189 ct 2092 -189 2092 -189 2092 -226 ct -2092 -226 2092 -226 2089 -227 ct 2063 -217 2046 -210 2019 -202 ct 2019 -202 2019 -202 2019 -195 ct -p -2092 -165 m 2092 -180 2119 -197 2141 -197 ct 2177 -197 2201 -160 2201 -103 ct -2201 -48 2177 -11 2142 -11 ct 2120 -11 2092 -29 2092 -44 ct 2092 -44 2092 -44 2092 -165 ct -p ef -2463 -81 m 2439 -43 2418 -29 2387 -29 ct 2360 -29 2339 -43 2325 -72 ct 2316 -90 2313 -107 2312 -137 ct -2312 -137 2312 -137 2461 -137 ct 2457 -169 2452 -183 2440 -199 ct 2426 -217 2403 -227 2378 -227 ct -2354 -227 2331 -218 2313 -201 ct 2290 -181 2277 -146 2277 -106 ct 2277 -37 2312 5 2368 5 ct -2414 5 2450 -24 2470 -78 ct 2470 -78 2470 -78 2463 -81 ct p -2313 -153 m 2318 -191 2335 -209 2364 -209 ct 2394 -209 2405 -196 2412 -153 ct -2412 -153 2412 -153 2313 -153 ct p ef -2683 -81 m 2659 -43 2638 -29 2607 -29 ct 2580 -29 2559 -43 2545 -72 ct 2536 -90 2533 -107 2532 -137 ct -2532 -137 2532 -137 2681 -137 ct 2677 -169 2672 -183 2660 -199 ct 2646 -217 2623 -227 2598 -227 ct -2574 -227 2551 -218 2533 -201 ct 2510 -181 2497 -146 2497 -106 ct 2497 -37 2532 5 2588 5 ct -2634 5 2670 -24 2690 -78 ct 2690 -78 2690 -78 2683 -81 ct p -2533 -153 m 2538 -191 2555 -209 2584 -209 ct 2614 -209 2625 -196 2632 -153 ct -2632 -153 2632 -153 2533 -153 ct p ef -2898 -77 m 2874 -42 2857 -31 2829 -31 ct 2785 -31 2754 -70 2754 -127 ct 2754 -178 2781 -213 2820 -213 ct -2838 -213 2844 -207 2849 -189 ct 2849 -189 2849 -189 2852 -178 ct 2856 -164 2864 -155 2874 -155 ct -2887 -155 2898 -164 2898 -176 ct 2898 -204 2864 -227 2823 -227 ct 2799 -227 2775 -217 2755 -199 ct -2731 -178 2717 -144 2717 -105 ct 2717 -41 2755 5 2809 5 ct 2831 5 2850 -3 2868 -18 ct -2881 -30 2890 -43 2904 -72 ct 2904 -72 2904 -72 2898 -77 ct p ef -3001 -169 m 3021 -192 3036 -200 3055 -200 ct 3079 -200 3091 -182 3091 -148 ct -3091 -148 3091 -148 3091 -50 ct 3091 -16 3086 -10 3058 -7 ct 3058 -7 3058 -7 3058 0 ct -3058 0 3058 0 3161 0 ct 3161 0 3161 0 3161 -7 ct 3135 -12 3132 -16 3132 -50 ct -3132 -50 3132 -50 3132 -148 ct 3132 -200 3111 -227 3072 -227 ct 3044 -227 3023 -215 3001 -185 ct -3001 -185 3001 -185 3001 -336 ct 3001 -336 3001 -336 2999 -337 ct 2982 -331 2970 -327 2943 -319 ct -2943 -319 2943 -319 2930 -315 ct 2930 -315 2930 -315 2930 -308 ct 2932 -308 2933 -308 2936 -308 ct -2956 -308 2960 -304 2960 -283 ct 2960 -283 2960 -283 2960 -50 ct 2960 -15 2957 -11 2929 -7 ct -2929 -7 2929 -7 2929 0 ct 2929 0 2929 0 3034 0 ct 3034 0 3034 0 3034 -7 ct 3006 -10 3001 -16 3001 -50 ct -3001 -50 3001 -50 3001 -169 ct p ef -pom -gr -gs -pum -15519 16745 t -214 -32 m 206 -26 200 -23 193 -23 ct 182 -23 178 -30 178 -52 ct 178 -52 178 -52 178 -148 ct -178 -173 176 -188 168 -200 ct 158 -218 137 -227 108 -227 ct 63 -227 27 -203 27 -171 ct -27 -160 37 -150 48 -150 ct 60 -150 70 -160 70 -171 ct 70 -173 69 -175 69 -179 ct -68 -183 67 -187 67 -191 ct 67 -204 83 -215 102 -215 ct 126 -215 139 -201 139 -174 ct -139 -174 139 -174 139 -144 ct 64 -113 56 -109 35 -90 ct 25 -81 18 -64 18 -48 ct -18 -17 39 5 69 5 ct 90 5 110 -5 139 -31 ct 142 -5 151 5 170 5 ct 187 5 197 -1 214 -20 ct -214 -20 214 -20 214 -32 ct p -139 -61 m 139 -45 137 -41 126 -35 ct 115 -28 101 -24 91 -24 ct 74 -24 61 -40 61 -62 ct -61 -62 61 -62 61 -63 ct 61 -92 80 -110 139 -132 ct 139 -132 139 -132 139 -61 ct -p ef -228 -196 m 231 -198 235 -198 241 -198 ct 254 -198 259 -191 259 -166 ct 259 -166 259 -166 259 -44 ct -259 -15 253 -8 229 -8 ct 229 -8 229 -8 229 0 ct 229 0 229 0 331 0 ct 331 0 331 0 331 -8 ct -307 -8 299 -14 299 -32 ct 299 -32 299 -32 299 -171 ct 323 -194 333 -200 349 -200 ct -373 -200 385 -184 385 -152 ct 385 -152 385 -152 385 -48 ct 385 -17 378 -8 354 -8 ct -354 -8 354 -8 354 0 ct 354 0 354 0 455 0 ct 455 0 455 0 455 -7 ct 431 -10 425 -16 425 -40 ct -425 -40 425 -40 425 -153 ct 425 -199 404 -227 368 -227 ct 346 -227 331 -219 298 -187 ct -298 -187 298 -187 298 -226 ct 298 -226 298 -226 295 -227 ct 271 -218 254 -213 228 -205 ct -228 -205 228 -205 228 -196 ct p ef -637 5 m 637 5 637 5 708 -21 ct 708 -21 708 -21 708 -28 ct 699 -28 698 -28 697 -28 ct -679 -28 675 -33 675 -56 ct 675 -56 675 -56 675 -336 ct 675 -336 675 -336 673 -337 ct -650 -329 633 -324 602 -315 ct 602 -315 602 -315 602 -308 ct 606 -308 608 -308 612 -308 ct -630 -308 635 -303 635 -283 ct 635 -283 635 -283 635 -206 ct 616 -222 603 -227 584 -227 ct -528 -227 483 -171 483 -101 ct 483 -38 519 5 573 5 ct 600 5 618 -5 635 -28 ct 635 -28 635 -28 635 4 ct -635 4 635 4 637 5 ct p -635 -50 m 635 -47 631 -41 626 -35 ct 618 -26 606 -21 592 -21 ct 551 -21 525 -60 525 -121 ct -525 -177 548 -213 585 -213 ct 611 -213 635 -190 635 -164 ct 635 -164 635 -164 635 -50 ct -p ef -850 -196 m 853 -198 857 -198 863 -198 ct 876 -198 881 -191 881 -166 ct 881 -166 881 -166 881 -44 ct -881 -15 875 -8 851 -8 ct 851 -8 851 -8 851 0 ct 851 0 851 0 953 0 ct 953 0 953 0 953 -8 ct -929 -8 921 -14 921 -32 ct 921 -32 921 -32 921 -171 ct 945 -194 955 -200 971 -200 ct -995 -200 1007 -184 1007 -152 ct 1007 -152 1007 -152 1007 -48 ct 1007 -17 1000 -8 976 -8 ct -976 -8 976 -8 976 0 ct 976 0 976 0 1077 0 ct 1077 0 1077 0 1077 -7 ct 1053 -10 1047 -16 1047 -40 ct -1047 -40 1047 -40 1047 -153 ct 1047 -199 1026 -227 990 -227 ct 968 -227 953 -219 920 -187 ct -920 -187 920 -187 920 -226 ct 920 -226 920 -226 917 -227 ct 893 -218 876 -213 850 -205 ct -850 -205 850 -205 850 -196 ct p ef -1213 -227 m 1150 -227 1106 -180 1106 -112 ct 1106 -45 1151 5 1212 5 ct 1273 5 1320 -47 1320 -115 ct -1320 -180 1275 -227 1213 -227 ct p -1207 -213 m 1247 -213 1276 -166 1276 -98 ct 1276 -42 1254 -9 1218 -9 ct 1199 -9 1181 -21 1171 -40 ct -1157 -66 1150 -101 1150 -136 ct 1150 -183 1172 -213 1207 -213 ct p ef -1427 -227 m 1427 -227 1427 -227 1352 -200 ct 1352 -200 1352 -200 1352 -192 ct -1352 -192 1352 -192 1356 -193 ct 1361 -194 1368 -194 1372 -194 ct 1384 -194 1388 -186 1388 -164 ct -1388 -164 1388 -164 1388 -49 ct 1388 -14 1383 -8 1350 -8 ct 1350 -8 1350 -8 1350 0 ct -1350 0 1350 0 1464 0 ct 1464 0 1464 0 1464 -8 ct 1433 -8 1429 -15 1429 -50 ct 1429 -50 1429 -50 1429 -225 ct -1429 -225 1429 -225 1427 -227 ct p -1404 -337 m 1391 -337 1380 -326 1380 -312 ct 1380 -298 1390 -287 1404 -287 ct -1418 -287 1429 -298 1429 -312 ct 1429 -326 1418 -337 1404 -337 ct p ef -1635 -155 m 1635 -155 1635 -155 1633 -222 ct 1633 -222 1633 -222 1627 -222 ct -1627 -222 1627 -222 1626 -221 ct 1622 -218 1621 -217 1619 -217 ct 1617 -217 1612 -218 1606 -221 ct -1596 -225 1585 -227 1573 -227 ct 1534 -227 1507 -202 1507 -166 ct 1507 -138 1522 -118 1563 -95 ct -1563 -95 1563 -95 1591 -78 ct 1608 -69 1617 -57 1617 -41 ct 1617 -20 1601 -6 1576 -6 ct -1560 -6 1545 -12 1536 -23 ct 1526 -35 1521 -47 1515 -75 ct 1515 -75 1515 -75 1507 -75 ct -1507 -75 1507 -75 1507 2 ct 1507 2 1507 2 1513 2 ct 1517 -3 1519 -4 1525 -4 ct -1529 -4 1536 -3 1547 0 ct 1560 3 1574 5 1582 5 ct 1619 5 1650 -24 1650 -58 ct 1650 -83 1639 -99 1610 -117 ct -1610 -117 1610 -117 1558 -148 ct 1544 -156 1537 -169 1537 -182 ct 1537 -202 1552 -216 1574 -216 ct -1602 -216 1616 -199 1627 -155 ct 1627 -155 1627 -155 1635 -155 ct p ef -1874 -81 m 1850 -43 1829 -29 1798 -29 ct 1771 -29 1750 -43 1736 -72 ct 1727 -90 1724 -107 1723 -137 ct -1723 -137 1723 -137 1872 -137 ct 1868 -169 1863 -183 1851 -199 ct 1837 -217 1814 -227 1789 -227 ct -1765 -227 1742 -218 1724 -201 ct 1701 -181 1688 -146 1688 -106 ct 1688 -37 1723 5 1779 5 ct -1825 5 1861 -24 1881 -78 ct 1881 -78 1881 -78 1874 -81 ct p -1724 -153 m 1729 -191 1746 -209 1775 -209 ct 1805 -209 1816 -196 1823 -153 ct -1823 -153 1823 -153 1724 -153 ct p ef -pom -gr -gr -gs -gs -pum -5435 10350 t -150 -222 m 150 -222 150 -222 90 -222 ct 90 -222 90 -222 90 -279 ct 90 -308 99 -323 118 -323 ct -128 -323 135 -318 143 -304 ct 151 -291 157 -286 165 -286 ct 176 -286 185 -295 185 -306 ct -185 -324 164 -337 135 -337 ct 105 -337 79 -324 67 -301 ct 54 -279 50 -261 50 -222 ct -50 -222 50 -222 10 -222 ct 10 -222 10 -222 10 -206 ct 10 -206 10 -206 50 -206 ct -50 -206 50 -206 50 -51 ct 50 -14 45 -8 10 -8 ct 10 -8 10 -8 10 0 ct 10 0 10 0 136 0 ct -136 0 136 0 136 -8 ct 96 -8 91 -13 91 -51 ct 91 -51 91 -51 91 -206 ct 91 -206 91 -206 150 -206 ct -150 -206 150 -206 150 -222 ct p ef -375 -32 m 367 -26 361 -23 354 -23 ct 343 -23 339 -30 339 -52 ct 339 -52 339 -52 339 -148 ct -339 -173 337 -188 329 -200 ct 319 -218 298 -227 269 -227 ct 224 -227 188 -203 188 -171 ct -188 -160 198 -150 209 -150 ct 221 -150 231 -160 231 -171 ct 231 -173 230 -175 230 -179 ct -229 -183 228 -187 228 -191 ct 228 -204 244 -215 263 -215 ct 287 -215 300 -201 300 -174 ct -300 -174 300 -174 300 -144 ct 225 -113 217 -109 196 -90 ct 186 -81 179 -64 179 -48 ct -179 -17 200 5 230 5 ct 251 5 271 -5 300 -31 ct 303 -5 312 5 331 5 ct 348 5 358 -1 375 -20 ct -375 -20 375 -20 375 -32 ct p -300 -61 m 300 -45 298 -41 287 -35 ct 276 -28 262 -24 252 -24 ct 235 -24 222 -40 222 -62 ct -222 -62 222 -62 222 -63 ct 222 -92 241 -110 300 -132 ct 300 -132 300 -132 300 -61 ct -p ef -384 -192 m 391 -194 396 -194 401 -194 ct 413 -194 418 -186 418 -164 ct 418 -164 418 -164 418 -41 ct -418 -17 414 -13 383 -7 ct 383 -7 383 -7 383 0 ct 383 0 383 0 500 0 ct 500 0 500 0 500 -8 ct -467 -8 458 -15 458 -44 ct 458 -44 458 -44 458 -155 ct 458 -171 479 -196 492 -196 ct -495 -196 500 -193 505 -188 ct 513 -182 518 -179 524 -179 ct 536 -179 543 -187 543 -201 ct -543 -217 533 -227 517 -227 ct 496 -227 482 -216 458 -181 ct 458 -181 458 -181 458 -226 ct -458 -226 458 -226 456 -227 ct 430 -216 413 -210 384 -200 ct 384 -200 384 -200 384 -192 ct -p ef -867 -81 m 843 -43 822 -29 791 -29 ct 764 -29 743 -43 729 -72 ct 720 -90 717 -107 716 -137 ct -716 -137 716 -137 865 -137 ct 861 -169 856 -183 844 -199 ct 830 -217 807 -227 782 -227 ct -758 -227 735 -218 717 -201 ct 694 -181 681 -146 681 -106 ct 681 -37 716 5 772 5 ct -818 5 854 -24 874 -78 ct 874 -78 874 -78 867 -81 ct p -717 -153 m 722 -191 739 -209 768 -209 ct 798 -209 809 -196 816 -153 ct 816 -153 816 -153 717 -153 ct -p ef -897 -196 m 900 -198 904 -198 910 -198 ct 923 -198 928 -191 928 -166 ct 928 -166 928 -166 928 -44 ct -928 -15 922 -8 898 -8 ct 898 -8 898 -8 898 0 ct 898 0 898 0 1000 0 ct 1000 0 1000 0 1000 -8 ct -976 -8 968 -14 968 -32 ct 968 -32 968 -32 968 -171 ct 992 -194 1002 -200 1018 -200 ct -1042 -200 1054 -184 1054 -152 ct 1054 -152 1054 -152 1054 -48 ct 1054 -17 1047 -8 1023 -8 ct -1023 -8 1023 -8 1023 0 ct 1023 0 1023 0 1124 0 ct 1124 0 1124 0 1124 -7 ct 1100 -10 1094 -16 1094 -40 ct -1094 -40 1094 -40 1094 -153 ct 1094 -199 1073 -227 1037 -227 ct 1015 -227 1000 -219 967 -187 ct -967 -187 967 -187 967 -226 ct 967 -226 967 -226 964 -227 ct 940 -218 923 -213 897 -205 ct -897 -205 897 -205 897 -196 ct p ef -1306 5 m 1306 5 1306 5 1377 -21 ct 1377 -21 1377 -21 1377 -28 ct 1368 -28 1367 -28 1366 -28 ct -1348 -28 1344 -33 1344 -56 ct 1344 -56 1344 -56 1344 -336 ct 1344 -336 1344 -336 1342 -337 ct -1319 -329 1302 -324 1271 -315 ct 1271 -315 1271 -315 1271 -308 ct 1275 -308 1277 -308 1281 -308 ct -1299 -308 1304 -303 1304 -283 ct 1304 -283 1304 -283 1304 -206 ct 1285 -222 1272 -227 1253 -227 ct -1197 -227 1152 -171 1152 -101 ct 1152 -38 1188 5 1242 5 ct 1269 5 1287 -5 1304 -28 ct -1304 -28 1304 -28 1304 4 ct 1304 4 1304 4 1306 5 ct p -1304 -50 m 1304 -47 1300 -41 1295 -35 ct 1287 -26 1275 -21 1261 -21 ct 1220 -21 1194 -60 1194 -121 ct -1194 -177 1217 -213 1254 -213 ct 1280 -213 1304 -190 1304 -164 ct 1304 -164 1304 -164 1304 -50 ct -p ef -1664 -155 m 1664 -155 1664 -155 1662 -222 ct 1662 -222 1662 -222 1656 -222 ct -1656 -222 1656 -222 1655 -221 ct 1651 -218 1650 -217 1648 -217 ct 1646 -217 1641 -218 1635 -221 ct -1625 -225 1614 -227 1602 -227 ct 1563 -227 1536 -202 1536 -166 ct 1536 -138 1551 -118 1592 -95 ct -1592 -95 1592 -95 1620 -78 ct 1637 -69 1646 -57 1646 -41 ct 1646 -20 1630 -6 1605 -6 ct -1589 -6 1574 -12 1565 -23 ct 1555 -35 1550 -47 1544 -75 ct 1544 -75 1544 -75 1536 -75 ct -1536 -75 1536 -75 1536 2 ct 1536 2 1536 2 1542 2 ct 1546 -3 1548 -4 1554 -4 ct -1558 -4 1565 -3 1576 0 ct 1589 3 1603 5 1611 5 ct 1648 5 1679 -24 1679 -58 ct 1679 -83 1668 -99 1639 -117 ct -1639 -117 1639 -117 1587 -148 ct 1573 -156 1566 -169 1566 -182 ct 1566 -202 1581 -216 1603 -216 ct -1631 -216 1645 -199 1656 -155 ct 1656 -155 1656 -155 1664 -155 ct p ef -1710 -195 m 1715 -195 1718 -195 1722 -195 ct 1739 -195 1742 -190 1742 -167 ct -1742 -167 1742 -167 1742 65 ct 1742 90 1737 96 1708 99 ct 1708 99 1708 99 1708 107 ct -1708 107 1708 107 1826 107 ct 1826 107 1826 107 1826 98 ct 1789 98 1783 93 1783 61 ct -1783 61 1783 61 1783 -16 ct 1800 0 1812 5 1832 5 ct 1889 5 1934 -50 1934 -122 ct -1934 -183 1900 -227 1853 -227 ct 1826 -227 1804 -215 1783 -189 ct 1783 -189 1783 -189 1783 -226 ct -1783 -226 1783 -226 1780 -227 ct 1754 -217 1737 -210 1710 -202 ct 1710 -202 1710 -202 1710 -195 ct -p -1783 -165 m 1783 -180 1810 -197 1832 -197 ct 1868 -197 1892 -160 1892 -103 ct -1892 -48 1868 -11 1833 -11 ct 1811 -11 1783 -29 1783 -44 ct 1783 -44 1783 -44 1783 -165 ct -p ef -2154 -81 m 2130 -43 2109 -29 2078 -29 ct 2051 -29 2030 -43 2016 -72 ct 2007 -90 2004 -107 2003 -137 ct -2003 -137 2003 -137 2152 -137 ct 2148 -169 2143 -183 2131 -199 ct 2117 -217 2094 -227 2069 -227 ct -2045 -227 2022 -218 2004 -201 ct 1981 -181 1968 -146 1968 -106 ct 1968 -37 2003 5 2059 5 ct -2105 5 2141 -24 2161 -78 ct 2161 -78 2161 -78 2154 -81 ct p -2004 -153 m 2009 -191 2026 -209 2055 -209 ct 2085 -209 2096 -196 2103 -153 ct -2103 -153 2103 -153 2004 -153 ct p ef -2374 -81 m 2350 -43 2329 -29 2298 -29 ct 2271 -29 2250 -43 2236 -72 ct 2227 -90 2224 -107 2223 -137 ct -2223 -137 2223 -137 2372 -137 ct 2368 -169 2363 -183 2351 -199 ct 2337 -217 2314 -227 2289 -227 ct -2265 -227 2242 -218 2224 -201 ct 2201 -181 2188 -146 2188 -106 ct 2188 -37 2223 5 2279 5 ct -2325 5 2361 -24 2381 -78 ct 2381 -78 2381 -78 2374 -81 ct p -2224 -153 m 2229 -191 2246 -209 2275 -209 ct 2305 -209 2316 -196 2323 -153 ct -2323 -153 2323 -153 2224 -153 ct p ef -2589 -77 m 2565 -42 2548 -31 2520 -31 ct 2476 -31 2445 -70 2445 -127 ct 2445 -178 2472 -213 2511 -213 ct -2529 -213 2535 -207 2540 -189 ct 2540 -189 2540 -189 2543 -178 ct 2547 -164 2555 -155 2565 -155 ct -2578 -155 2589 -164 2589 -176 ct 2589 -204 2555 -227 2514 -227 ct 2490 -227 2466 -217 2446 -199 ct -2422 -178 2408 -144 2408 -105 ct 2408 -41 2446 5 2500 5 ct 2522 5 2541 -3 2559 -18 ct -2572 -30 2581 -43 2595 -72 ct 2595 -72 2595 -72 2589 -77 ct p ef -2692 -169 m 2712 -192 2727 -200 2746 -200 ct 2770 -200 2782 -182 2782 -148 ct -2782 -148 2782 -148 2782 -50 ct 2782 -16 2777 -10 2749 -7 ct 2749 -7 2749 -7 2749 0 ct -2749 0 2749 0 2852 0 ct 2852 0 2852 0 2852 -7 ct 2826 -12 2823 -16 2823 -50 ct -2823 -50 2823 -50 2823 -148 ct 2823 -200 2802 -227 2763 -227 ct 2735 -227 2714 -215 2692 -185 ct -2692 -185 2692 -185 2692 -336 ct 2692 -336 2692 -336 2690 -337 ct 2673 -331 2661 -327 2634 -319 ct -2634 -319 2634 -319 2621 -315 ct 2621 -315 2621 -315 2621 -308 ct 2623 -308 2624 -308 2627 -308 ct -2647 -308 2651 -304 2651 -283 ct 2651 -283 2651 -283 2651 -50 ct 2651 -15 2648 -11 2620 -7 ct -2620 -7 2620 -7 2620 0 ct 2620 0 2620 0 2725 0 ct 2725 0 2725 0 2725 -7 ct 2697 -10 2692 -16 2692 -50 ct -2692 -50 2692 -50 2692 -169 ct p ef -pom -gr -gr -gs -gs -pum -10779 16488 t -9 -196 m 15 -198 19 -198 25 -198 ct 37 -198 42 -190 42 -166 ct 42 -166 42 -166 42 -41 ct -42 -15 35 -7 8 -7 ct 8 -7 8 -7 8 0 ct 8 0 8 0 115 0 ct 115 0 115 0 115 -8 ct 90 -8 82 -13 82 -33 ct -82 -33 82 -33 82 -172 ct 82 -173 86 -178 90 -181 ct 102 -193 122 -201 139 -201 ct -161 -201 171 -184 171 -149 ct 171 -149 171 -149 171 -42 ct 171 -14 166 -8 138 -8 ct -138 -8 138 -8 138 0 ct 138 0 138 0 247 0 ct 247 0 247 0 247 -7 ct 219 -7 212 -16 212 -46 ct -212 -46 212 -46 212 -171 ct 227 -192 243 -201 265 -201 ct 292 -201 301 -188 301 -147 ct -301 -147 301 -147 301 -43 ct 301 -15 297 -11 269 -7 ct 269 -7 269 -7 269 0 ct 269 0 269 0 375 0 ct -375 0 375 0 375 -8 ct 375 -8 375 -8 363 -8 ct 348 -8 342 -18 342 -37 ct 342 -37 342 -37 342 -139 ct -342 -197 323 -227 286 -227 ct 258 -227 233 -214 207 -185 ct 198 -214 182 -227 155 -227 ct -134 -227 121 -220 80 -189 ct 80 -189 80 -189 80 -226 ct 80 -226 80 -226 77 -227 ct -52 -218 36 -212 9 -205 ct 9 -205 9 -205 9 -196 ct p ef -470 -227 m 470 -227 470 -227 395 -200 ct 395 -200 395 -200 395 -192 ct 395 -192 395 -192 399 -193 ct -404 -194 411 -194 415 -194 ct 427 -194 431 -186 431 -164 ct 431 -164 431 -164 431 -49 ct -431 -14 426 -8 393 -8 ct 393 -8 393 -8 393 0 ct 393 0 393 0 507 0 ct 507 0 507 0 507 -8 ct -476 -8 472 -15 472 -50 ct 472 -50 472 -50 472 -225 ct 472 -225 472 -225 470 -227 ct -p -447 -337 m 434 -337 423 -326 423 -312 ct 423 -298 433 -287 447 -287 ct 461 -287 472 -298 472 -312 ct -472 -326 461 -337 447 -337 ct p ef -718 -77 m 694 -42 677 -31 649 -31 ct 605 -31 574 -70 574 -127 ct 574 -178 601 -213 640 -213 ct -658 -213 664 -207 669 -189 ct 669 -189 669 -189 672 -178 ct 676 -164 684 -155 694 -155 ct -707 -155 718 -164 718 -176 ct 718 -204 684 -227 643 -227 ct 619 -227 595 -217 575 -199 ct -551 -178 537 -144 537 -105 ct 537 -41 575 5 629 5 ct 651 5 670 -3 688 -18 ct 701 -30 710 -43 724 -72 ct -724 -72 724 -72 718 -77 ct p ef -748 -192 m 755 -194 760 -194 765 -194 ct 777 -194 782 -186 782 -164 ct 782 -164 782 -164 782 -41 ct -782 -17 778 -13 747 -7 ct 747 -7 747 -7 747 0 ct 747 0 747 0 864 0 ct 864 0 864 0 864 -8 ct -831 -8 822 -15 822 -44 ct 822 -44 822 -44 822 -155 ct 822 -171 843 -196 856 -196 ct -859 -196 864 -193 869 -188 ct 877 -182 882 -179 888 -179 ct 900 -179 907 -187 907 -201 ct -907 -217 897 -227 881 -227 ct 860 -227 846 -216 822 -181 ct 822 -181 822 -181 822 -226 ct -822 -226 822 -226 820 -227 ct 794 -216 777 -210 748 -200 ct 748 -200 748 -200 748 -192 ct -p ef -1031 -227 m 968 -227 924 -180 924 -112 ct 924 -45 969 5 1030 5 ct 1091 5 1138 -47 1138 -115 ct -1138 -180 1093 -227 1031 -227 ct p -1025 -213 m 1065 -213 1094 -166 1094 -98 ct 1094 -42 1072 -9 1036 -9 ct 1017 -9 999 -21 989 -40 ct -975 -66 968 -101 968 -136 ct 968 -183 990 -213 1025 -213 ct p ef -1164 -195 m 1169 -195 1172 -195 1176 -195 ct 1193 -195 1196 -190 1196 -167 ct -1196 -167 1196 -167 1196 65 ct 1196 90 1191 96 1162 99 ct 1162 99 1162 99 1162 107 ct -1162 107 1162 107 1280 107 ct 1280 107 1280 107 1280 98 ct 1243 98 1237 93 1237 61 ct -1237 61 1237 61 1237 -16 ct 1254 0 1266 5 1286 5 ct 1343 5 1388 -50 1388 -122 ct -1388 -183 1354 -227 1307 -227 ct 1280 -227 1258 -215 1237 -189 ct 1237 -189 1237 -189 1237 -226 ct -1237 -226 1237 -226 1234 -227 ct 1208 -217 1191 -210 1164 -202 ct 1164 -202 1164 -202 1164 -195 ct -p -1237 -165 m 1237 -180 1264 -197 1286 -197 ct 1322 -197 1346 -160 1346 -103 ct -1346 -48 1322 -11 1287 -11 ct 1265 -11 1237 -29 1237 -44 ct 1237 -44 1237 -44 1237 -165 ct -p ef -1486 -169 m 1506 -192 1521 -200 1540 -200 ct 1564 -200 1576 -182 1576 -148 ct -1576 -148 1576 -148 1576 -50 ct 1576 -16 1571 -10 1543 -7 ct 1543 -7 1543 -7 1543 0 ct -1543 0 1543 0 1646 0 ct 1646 0 1646 0 1646 -7 ct 1620 -12 1617 -16 1617 -50 ct -1617 -50 1617 -50 1617 -148 ct 1617 -200 1596 -227 1557 -227 ct 1529 -227 1508 -215 1486 -185 ct -1486 -185 1486 -185 1486 -336 ct 1486 -336 1486 -336 1484 -337 ct 1467 -331 1455 -327 1428 -319 ct -1428 -319 1428 -319 1415 -315 ct 1415 -315 1415 -315 1415 -308 ct 1417 -308 1418 -308 1421 -308 ct -1441 -308 1445 -304 1445 -283 ct 1445 -283 1445 -283 1445 -50 ct 1445 -15 1442 -11 1414 -7 ct -1414 -7 1414 -7 1414 0 ct 1414 0 1414 0 1519 0 ct 1519 0 1519 0 1519 -7 ct 1491 -10 1486 -16 1486 -50 ct -1486 -50 1486 -50 1486 -169 ct p ef -1780 -227 m 1717 -227 1673 -180 1673 -112 ct 1673 -45 1718 5 1779 5 ct 1840 5 1887 -47 1887 -115 ct -1887 -180 1842 -227 1780 -227 ct p -1774 -213 m 1814 -213 1843 -166 1843 -98 ct 1843 -42 1821 -9 1785 -9 ct 1766 -9 1748 -21 1738 -40 ct -1724 -66 1717 -101 1717 -136 ct 1717 -183 1739 -213 1774 -213 ct p ef -1917 -196 m 1920 -198 1924 -198 1930 -198 ct 1943 -198 1948 -191 1948 -166 ct -1948 -166 1948 -166 1948 -44 ct 1948 -15 1942 -8 1918 -8 ct 1918 -8 1918 -8 1918 0 ct -1918 0 1918 0 2020 0 ct 2020 0 2020 0 2020 -8 ct 1996 -8 1988 -14 1988 -32 ct 1988 -32 1988 -32 1988 -171 ct -2012 -194 2022 -200 2038 -200 ct 2062 -200 2074 -184 2074 -152 ct 2074 -152 2074 -152 2074 -48 ct -2074 -17 2067 -8 2043 -8 ct 2043 -8 2043 -8 2043 0 ct 2043 0 2043 0 2144 0 ct 2144 0 2144 0 2144 -7 ct -2120 -10 2114 -16 2114 -40 ct 2114 -40 2114 -40 2114 -153 ct 2114 -199 2093 -227 2057 -227 ct -2035 -227 2020 -219 1987 -187 ct 1987 -187 1987 -187 1987 -226 ct 1987 -226 1987 -226 1984 -227 ct -1960 -218 1943 -213 1917 -205 ct 1917 -205 1917 -205 1917 -196 ct p ef -2357 -81 m 2333 -43 2312 -29 2281 -29 ct 2254 -29 2233 -43 2219 -72 ct 2210 -90 2207 -107 2206 -137 ct -2206 -137 2206 -137 2355 -137 ct 2351 -169 2346 -183 2334 -199 ct 2320 -217 2297 -227 2272 -227 ct -2248 -227 2225 -218 2207 -201 ct 2184 -181 2171 -146 2171 -106 ct 2171 -37 2206 5 2262 5 ct -2308 5 2344 -24 2364 -78 ct 2364 -78 2364 -78 2357 -81 ct p -2207 -153 m 2212 -191 2229 -209 2258 -209 ct 2288 -209 2299 -196 2306 -153 ct -2306 -153 2306 -153 2207 -153 ct p ef -pom -gr -gr -gs -gs -pum -15356 12996 t -3 -192 m 10 -194 15 -194 20 -194 ct 32 -194 37 -186 37 -164 ct 37 -164 37 -164 37 -41 ct -37 -17 33 -13 2 -7 ct 2 -7 2 -7 2 0 ct 2 0 2 0 119 0 ct 119 0 119 0 119 -8 ct 86 -8 77 -15 77 -44 ct -77 -44 77 -44 77 -155 ct 77 -171 98 -196 111 -196 ct 114 -196 119 -193 124 -188 ct -132 -182 137 -179 143 -179 ct 155 -179 162 -187 162 -201 ct 162 -217 152 -227 136 -227 ct -115 -227 101 -216 77 -181 ct 77 -181 77 -181 77 -226 ct 77 -226 77 -226 75 -227 ct -49 -216 32 -210 3 -200 ct 3 -200 3 -200 3 -192 ct p ef -363 -81 m 339 -43 318 -29 287 -29 ct 260 -29 239 -43 225 -72 ct 216 -90 213 -107 212 -137 ct -212 -137 212 -137 361 -137 ct 357 -169 352 -183 340 -199 ct 326 -217 303 -227 278 -227 ct -254 -227 231 -218 213 -201 ct 190 -181 177 -146 177 -106 ct 177 -37 212 5 268 5 ct -314 5 350 -24 370 -78 ct 370 -78 370 -78 363 -81 ct p -213 -153 m 218 -191 235 -209 264 -209 ct 294 -209 305 -196 312 -153 ct 312 -153 312 -153 213 -153 ct -p ef -616 -222 m 616 -222 616 -222 549 -222 ct 549 -222 549 -222 549 -215 ct 564 -213 571 -208 571 -199 ct -571 -194 570 -189 568 -184 ct 568 -184 568 -184 521 -56 ct 521 -56 521 -56 471 -182 ct -468 -189 467 -196 467 -201 ct 467 -210 472 -213 489 -215 ct 489 -215 489 -215 489 -222 ct -489 -222 489 -222 394 -222 ct 394 -222 394 -222 394 -214 ct 413 -214 416 -209 438 -158 ct -438 -158 438 -158 496 -16 ct 497 -13 499 -10 500 -6 ct 503 3 506 7 509 7 ct 512 7 515 1 522 -18 ct -522 -18 522 -18 584 -176 ct 599 -210 601 -213 616 -215 ct 616 -215 616 -215 616 -222 ct -p ef -829 -81 m 805 -43 784 -29 753 -29 ct 726 -29 705 -43 691 -72 ct 682 -90 679 -107 678 -137 ct -678 -137 678 -137 827 -137 ct 823 -169 818 -183 806 -199 ct 792 -217 769 -227 744 -227 ct -720 -227 697 -218 679 -201 ct 656 -181 643 -146 643 -106 ct 643 -37 678 5 734 5 ct -780 5 816 -24 836 -78 ct 836 -78 836 -78 829 -81 ct p -679 -153 m 684 -191 701 -209 730 -209 ct 760 -209 771 -196 778 -153 ct 778 -153 778 -153 679 -153 ct -p ef -854 -192 m 861 -194 866 -194 871 -194 ct 883 -194 888 -186 888 -164 ct 888 -164 888 -164 888 -41 ct -888 -17 884 -13 853 -7 ct 853 -7 853 -7 853 0 ct 853 0 853 0 970 0 ct 970 0 970 0 970 -8 ct -937 -8 928 -15 928 -44 ct 928 -44 928 -44 928 -155 ct 928 -171 949 -196 962 -196 ct -965 -196 970 -193 975 -188 ct 983 -182 988 -179 994 -179 ct 1006 -179 1013 -187 1013 -201 ct -1013 -217 1003 -227 987 -227 ct 966 -227 952 -216 928 -181 ct 928 -181 928 -181 928 -226 ct -928 -226 928 -226 926 -227 ct 900 -216 883 -210 854 -200 ct 854 -200 854 -200 854 -192 ct -p ef -1090 -336 m 1090 -336 1090 -336 1088 -337 ct 1067 -330 1054 -326 1031 -319 ct -1031 -319 1031 -319 1017 -315 ct 1017 -315 1017 -315 1017 -308 ct 1020 -308 1022 -308 1026 -308 ct -1045 -308 1049 -304 1049 -283 ct 1049 -283 1049 -283 1049 -27 ct 1049 -11 1091 5 1129 5 ct -1193 5 1243 -49 1243 -120 ct 1243 -181 1206 -227 1157 -227 ct 1128 -227 1100 -209 1090 -185 ct -1090 -185 1090 -185 1090 -336 ct p -1090 -159 m 1090 -178 1113 -196 1138 -196 ct 1176 -196 1200 -157 1200 -97 ct -1200 -42 1177 -11 1137 -11 ct 1112 -11 1090 -22 1090 -35 ct 1090 -35 1090 -35 1090 -159 ct -p ef -1464 -81 m 1440 -43 1419 -29 1388 -29 ct 1361 -29 1340 -43 1326 -72 ct 1317 -90 1314 -107 1313 -137 ct -1313 -137 1313 -137 1462 -137 ct 1458 -169 1453 -183 1441 -199 ct 1427 -217 1404 -227 1379 -227 ct -1355 -227 1332 -218 1314 -201 ct 1291 -181 1278 -146 1278 -106 ct 1278 -37 1313 5 1369 5 ct -1415 5 1451 -24 1471 -78 ct 1471 -78 1471 -78 1464 -81 ct p -1314 -153 m 1319 -191 1336 -209 1365 -209 ct 1395 -209 1406 -196 1413 -153 ct -1413 -153 1413 -153 1314 -153 ct p ef -1489 -192 m 1496 -194 1501 -194 1506 -194 ct 1518 -194 1523 -186 1523 -164 ct -1523 -164 1523 -164 1523 -41 ct 1523 -17 1519 -13 1488 -7 ct 1488 -7 1488 -7 1488 0 ct -1488 0 1488 0 1605 0 ct 1605 0 1605 0 1605 -8 ct 1572 -8 1563 -15 1563 -44 ct 1563 -44 1563 -44 1563 -155 ct -1563 -171 1584 -196 1597 -196 ct 1600 -196 1605 -193 1610 -188 ct 1618 -182 1623 -179 1629 -179 ct -1641 -179 1648 -187 1648 -201 ct 1648 -217 1638 -227 1622 -227 ct 1601 -227 1587 -216 1563 -181 ct -1563 -181 1563 -181 1563 -226 ct 1563 -226 1563 -226 1561 -227 ct 1535 -216 1518 -210 1489 -200 ct -1489 -200 1489 -200 1489 -192 ct p ef -1865 -32 m 1857 -26 1851 -23 1844 -23 ct 1833 -23 1829 -30 1829 -52 ct 1829 -52 1829 -52 1829 -148 ct -1829 -173 1827 -188 1819 -200 ct 1809 -218 1788 -227 1759 -227 ct 1714 -227 1678 -203 1678 -171 ct -1678 -160 1688 -150 1699 -150 ct 1711 -150 1721 -160 1721 -171 ct 1721 -173 1720 -175 1720 -179 ct -1719 -183 1718 -187 1718 -191 ct 1718 -204 1734 -215 1753 -215 ct 1777 -215 1790 -201 1790 -174 ct -1790 -174 1790 -174 1790 -144 ct 1715 -113 1707 -109 1686 -90 ct 1676 -81 1669 -64 1669 -48 ct -1669 -17 1690 5 1720 5 ct 1741 5 1761 -5 1790 -31 ct 1793 -5 1802 5 1821 5 ct 1838 5 1848 -1 1865 -20 ct -1865 -20 1865 -20 1865 -32 ct p -1790 -61 m 1790 -45 1788 -41 1777 -35 ct 1766 -28 1752 -24 1742 -24 ct 1725 -24 1712 -40 1712 -62 ct -1712 -62 1712 -62 1712 -63 ct 1712 -92 1731 -110 1790 -132 ct 1790 -132 1790 -132 1790 -61 ct -p ef -1994 -222 m 1994 -222 1994 -222 1946 -222 ct 1946 -222 1946 -222 1946 -279 ct -1946 -284 1945 -286 1942 -286 ct 1939 -281 1936 -277 1932 -272 ct 1914 -245 1893 -221 1886 -219 ct -1880 -216 1877 -212 1877 -210 ct 1877 -208 1878 -207 1879 -206 ct 1879 -206 1879 -206 1905 -206 ct -1905 -206 1905 -206 1905 -58 ct 1905 -16 1919 5 1948 5 ct 1972 5 1990 -7 2006 -33 ct -2006 -33 2006 -33 2000 -38 ct 1990 -26 1981 -21 1971 -21 ct 1953 -21 1946 -34 1946 -65 ct -1946 -65 1946 -65 1946 -206 ct 1946 -206 1946 -206 1994 -206 ct 1994 -206 1994 -206 1994 -222 ct -p ef -2096 -227 m 2096 -227 2096 -227 2021 -200 ct 2021 -200 2021 -200 2021 -192 ct -2021 -192 2021 -192 2025 -193 ct 2030 -194 2037 -194 2041 -194 ct 2053 -194 2057 -186 2057 -164 ct -2057 -164 2057 -164 2057 -49 ct 2057 -14 2052 -8 2019 -8 ct 2019 -8 2019 -8 2019 0 ct -2019 0 2019 0 2133 0 ct 2133 0 2133 0 2133 -8 ct 2102 -8 2098 -15 2098 -50 ct 2098 -50 2098 -50 2098 -225 ct -2098 -225 2098 -225 2096 -227 ct p -2073 -337 m 2060 -337 2049 -326 2049 -312 ct 2049 -298 2059 -287 2073 -287 ct -2087 -287 2098 -298 2098 -312 ct 2098 -326 2087 -337 2073 -337 ct p ef -2272 -227 m 2209 -227 2165 -180 2165 -112 ct 2165 -45 2210 5 2271 5 ct 2332 5 2379 -47 2379 -115 ct -2379 -180 2334 -227 2272 -227 ct p -2266 -213 m 2306 -213 2335 -166 2335 -98 ct 2335 -42 2313 -9 2277 -9 ct 2258 -9 2240 -21 2230 -40 ct -2216 -66 2209 -101 2209 -136 ct 2209 -183 2231 -213 2266 -213 ct p ef -2408 -196 m 2411 -198 2415 -198 2421 -198 ct 2434 -198 2439 -191 2439 -166 ct -2439 -166 2439 -166 2439 -44 ct 2439 -15 2433 -8 2409 -8 ct 2409 -8 2409 -8 2409 0 ct -2409 0 2409 0 2511 0 ct 2511 0 2511 0 2511 -8 ct 2487 -8 2479 -14 2479 -32 ct 2479 -32 2479 -32 2479 -171 ct -2503 -194 2513 -200 2529 -200 ct 2553 -200 2565 -184 2565 -152 ct 2565 -152 2565 -152 2565 -48 ct -2565 -17 2558 -8 2534 -8 ct 2534 -8 2534 -8 2534 0 ct 2534 0 2534 0 2635 0 ct 2635 0 2635 0 2635 -7 ct -2611 -10 2605 -16 2605 -40 ct 2605 -40 2605 -40 2605 -153 ct 2605 -199 2584 -227 2548 -227 ct -2526 -227 2511 -219 2478 -187 ct 2478 -187 2478 -187 2478 -226 ct 2478 -226 2478 -226 2475 -227 ct -2451 -218 2434 -213 2408 -205 ct 2408 -205 2408 -205 2408 -196 ct p ef -pom -gr -gr -gs -gs -pum -4561 12996 t -214 -32 m 206 -26 200 -23 193 -23 ct 182 -23 178 -30 178 -52 ct 178 -52 178 -52 178 -148 ct -178 -173 176 -188 168 -200 ct 158 -218 137 -227 108 -227 ct 63 -227 27 -203 27 -171 ct -27 -160 37 -150 48 -150 ct 60 -150 70 -160 70 -171 ct 70 -173 69 -175 69 -179 ct -68 -183 67 -187 67 -191 ct 67 -204 83 -215 102 -215 ct 126 -215 139 -201 139 -174 ct -139 -174 139 -174 139 -144 ct 64 -113 56 -109 35 -90 ct 25 -81 18 -64 18 -48 ct -18 -17 39 5 69 5 ct 90 5 110 -5 139 -31 ct 142 -5 151 5 170 5 ct 187 5 197 -1 214 -20 ct -214 -20 214 -20 214 -32 ct p -139 -61 m 139 -45 137 -41 126 -35 ct 115 -28 101 -24 91 -24 ct 74 -24 61 -40 61 -62 ct -61 -62 61 -62 61 -63 ct 61 -92 80 -110 139 -132 ct 139 -132 139 -132 139 -61 ct -p ef -387 5 m 387 5 387 5 458 -21 ct 458 -21 458 -21 458 -28 ct 449 -28 448 -28 447 -28 ct -429 -28 425 -33 425 -56 ct 425 -56 425 -56 425 -336 ct 425 -336 425 -336 423 -337 ct -400 -329 383 -324 352 -315 ct 352 -315 352 -315 352 -308 ct 356 -308 358 -308 362 -308 ct -380 -308 385 -303 385 -283 ct 385 -283 385 -283 385 -206 ct 366 -222 353 -227 334 -227 ct -278 -227 233 -171 233 -101 ct 233 -38 269 5 323 5 ct 350 5 368 -5 385 -28 ct 385 -28 385 -28 385 4 ct -385 4 385 4 387 5 ct p -385 -50 m 385 -47 381 -41 376 -35 ct 368 -26 356 -21 342 -21 ct 301 -21 275 -60 275 -121 ct -275 -177 298 -213 335 -213 ct 361 -213 385 -190 385 -164 ct 385 -164 385 -164 385 -50 ct -p ef -684 -32 m 676 -26 670 -23 663 -23 ct 652 -23 648 -30 648 -52 ct 648 -52 648 -52 648 -148 ct -648 -173 646 -188 638 -200 ct 628 -218 607 -227 578 -227 ct 533 -227 497 -203 497 -171 ct -497 -160 507 -150 518 -150 ct 530 -150 540 -160 540 -171 ct 540 -173 539 -175 539 -179 ct -538 -183 537 -187 537 -191 ct 537 -204 553 -215 572 -215 ct 596 -215 609 -201 609 -174 ct -609 -174 609 -174 609 -144 ct 534 -113 526 -109 505 -90 ct 495 -81 488 -64 488 -48 ct -488 -17 509 5 539 5 ct 560 5 580 -5 609 -31 ct 612 -5 621 5 640 5 ct 657 5 667 -1 684 -20 ct -684 -20 684 -20 684 -32 ct p -609 -61 m 609 -45 607 -41 596 -35 ct 585 -28 571 -24 561 -24 ct 544 -24 531 -40 531 -62 ct -531 -62 531 -62 531 -63 ct 531 -92 550 -110 609 -132 ct 609 -132 609 -132 609 -61 ct -p ef -694 -195 m 699 -195 702 -195 706 -195 ct 723 -195 726 -190 726 -167 ct 726 -167 726 -167 726 65 ct -726 90 721 96 692 99 ct 692 99 692 99 692 107 ct 692 107 692 107 810 107 ct 810 107 810 107 810 98 ct -773 98 767 93 767 61 ct 767 61 767 61 767 -16 ct 784 0 796 5 816 5 ct 873 5 918 -50 918 -122 ct -918 -183 884 -227 837 -227 ct 810 -227 788 -215 767 -189 ct 767 -189 767 -189 767 -226 ct -767 -226 767 -226 764 -227 ct 738 -217 721 -210 694 -202 ct 694 -202 694 -202 694 -195 ct -p -767 -165 m 767 -180 794 -197 816 -197 ct 852 -197 876 -160 876 -103 ct 876 -48 852 -11 817 -11 ct -795 -11 767 -29 767 -44 ct 767 -44 767 -44 767 -165 ct p ef -1063 -222 m 1063 -222 1063 -222 1015 -222 ct 1015 -222 1015 -222 1015 -279 ct -1015 -284 1014 -286 1011 -286 ct 1008 -281 1005 -277 1001 -272 ct 983 -245 962 -221 955 -219 ct -949 -216 946 -212 946 -210 ct 946 -208 947 -207 948 -206 ct 948 -206 948 -206 974 -206 ct -974 -206 974 -206 974 -58 ct 974 -16 988 5 1017 5 ct 1041 5 1059 -7 1075 -33 ct -1075 -33 1075 -33 1069 -38 ct 1059 -26 1050 -21 1040 -21 ct 1022 -21 1015 -34 1015 -65 ct -1015 -65 1015 -65 1015 -206 ct 1015 -206 1015 -206 1063 -206 ct 1063 -206 1063 -206 1063 -222 ct -p ef -1165 -227 m 1165 -227 1165 -227 1090 -200 ct 1090 -200 1090 -200 1090 -192 ct -1090 -192 1090 -192 1094 -193 ct 1099 -194 1106 -194 1110 -194 ct 1122 -194 1126 -186 1126 -164 ct -1126 -164 1126 -164 1126 -49 ct 1126 -14 1121 -8 1088 -8 ct 1088 -8 1088 -8 1088 0 ct -1088 0 1088 0 1202 0 ct 1202 0 1202 0 1202 -8 ct 1171 -8 1167 -15 1167 -50 ct 1167 -50 1167 -50 1167 -225 ct -1167 -225 1167 -225 1165 -227 ct p -1142 -337 m 1129 -337 1118 -326 1118 -312 ct 1118 -298 1128 -287 1142 -287 ct -1156 -287 1167 -298 1167 -312 ct 1167 -326 1156 -337 1142 -337 ct p ef -1450 -222 m 1450 -222 1450 -222 1383 -222 ct 1383 -222 1383 -222 1383 -215 ct -1398 -213 1405 -208 1405 -199 ct 1405 -194 1404 -189 1402 -184 ct 1402 -184 1402 -184 1355 -56 ct -1355 -56 1355 -56 1305 -182 ct 1302 -189 1301 -196 1301 -201 ct 1301 -210 1306 -213 1323 -215 ct -1323 -215 1323 -215 1323 -222 ct 1323 -222 1323 -222 1228 -222 ct 1228 -222 1228 -222 1228 -214 ct -1247 -214 1250 -209 1272 -158 ct 1272 -158 1272 -158 1330 -16 ct 1331 -13 1333 -10 1334 -6 ct -1337 3 1340 7 1343 7 ct 1346 7 1349 1 1356 -18 ct 1356 -18 1356 -18 1418 -176 ct -1433 -210 1435 -213 1450 -215 ct 1450 -215 1450 -215 1450 -222 ct p ef -1663 -81 m 1639 -43 1618 -29 1587 -29 ct 1560 -29 1539 -43 1525 -72 ct 1516 -90 1513 -107 1512 -137 ct -1512 -137 1512 -137 1661 -137 ct 1657 -169 1652 -183 1640 -199 ct 1626 -217 1603 -227 1578 -227 ct -1554 -227 1531 -218 1513 -201 ct 1490 -181 1477 -146 1477 -106 ct 1477 -37 1512 5 1568 5 ct -1614 5 1650 -24 1670 -78 ct 1670 -78 1670 -78 1663 -81 ct p -1513 -153 m 1518 -191 1535 -209 1564 -209 ct 1594 -209 1605 -196 1612 -153 ct -1612 -153 1612 -153 1513 -153 ct p ef -1958 -222 m 1958 -222 1958 -222 1898 -222 ct 1898 -222 1898 -222 1898 -279 ct -1898 -308 1907 -323 1926 -323 ct 1936 -323 1943 -318 1951 -304 ct 1959 -291 1965 -286 1973 -286 ct -1984 -286 1993 -295 1993 -306 ct 1993 -324 1972 -337 1943 -337 ct 1913 -337 1887 -324 1875 -301 ct -1862 -279 1858 -261 1858 -222 ct 1858 -222 1858 -222 1818 -222 ct 1818 -222 1818 -222 1818 -206 ct -1818 -206 1818 -206 1858 -206 ct 1858 -206 1858 -206 1858 -51 ct 1858 -14 1853 -8 1818 -8 ct -1818 -8 1818 -8 1818 0 ct 1818 0 1818 0 1944 0 ct 1944 0 1944 0 1944 -8 ct 1904 -8 1899 -13 1899 -51 ct -1899 -51 1899 -51 1899 -206 ct 1899 -206 1899 -206 1958 -206 ct 1958 -206 1958 -206 1958 -222 ct -p ef -2054 -227 m 2054 -227 2054 -227 1979 -200 ct 1979 -200 1979 -200 1979 -192 ct -1979 -192 1979 -192 1983 -193 ct 1988 -194 1995 -194 1999 -194 ct 2011 -194 2015 -186 2015 -164 ct -2015 -164 2015 -164 2015 -49 ct 2015 -14 2010 -8 1977 -8 ct 1977 -8 1977 -8 1977 0 ct -1977 0 1977 0 2091 0 ct 2091 0 2091 0 2091 -8 ct 2060 -8 2056 -15 2056 -50 ct 2056 -50 2056 -50 2056 -225 ct -2056 -225 2056 -225 2054 -227 ct p -2031 -337 m 2018 -337 2007 -326 2007 -312 ct 2007 -298 2017 -287 2031 -287 ct -2045 -287 2056 -298 2056 -312 ct 2056 -326 2045 -337 2031 -337 ct p ef -2117 -307 m 2117 -307 2117 -307 2120 -307 ct 2125 -308 2131 -308 2135 -308 ct -2151 -308 2155 -301 2155 -278 ct 2155 -278 2155 -278 2155 -42 ct 2155 -15 2149 -8 2118 -8 ct -2118 -8 2118 -8 2118 0 ct 2118 0 2118 0 2232 0 ct 2232 0 2232 0 2232 -8 ct 2202 -8 2196 -14 2196 -41 ct -2196 -41 2196 -41 2196 -336 ct 2196 -336 2196 -336 2194 -337 ct 2169 -328 2151 -323 2117 -315 ct -2117 -315 2117 -315 2117 -307 ct p ef -2367 -222 m 2367 -222 2367 -222 2319 -222 ct 2319 -222 2319 -222 2319 -279 ct -2319 -284 2318 -286 2315 -286 ct 2312 -281 2309 -277 2305 -272 ct 2287 -245 2266 -221 2259 -219 ct -2253 -216 2250 -212 2250 -210 ct 2250 -208 2251 -207 2252 -206 ct 2252 -206 2252 -206 2278 -206 ct -2278 -206 2278 -206 2278 -58 ct 2278 -16 2292 5 2321 5 ct 2345 5 2363 -7 2379 -33 ct -2379 -33 2379 -33 2373 -38 ct 2363 -26 2354 -21 2344 -21 ct 2326 -21 2319 -34 2319 -65 ct -2319 -65 2319 -65 2319 -206 ct 2319 -206 2319 -206 2367 -206 ct 2367 -206 2367 -206 2367 -222 ct -p ef -2581 -81 m 2557 -43 2536 -29 2505 -29 ct 2478 -29 2457 -43 2443 -72 ct 2434 -90 2431 -107 2430 -137 ct -2430 -137 2430 -137 2579 -137 ct 2575 -169 2570 -183 2558 -199 ct 2544 -217 2521 -227 2496 -227 ct -2472 -227 2449 -218 2431 -201 ct 2408 -181 2395 -146 2395 -106 ct 2395 -37 2430 5 2486 5 ct -2532 5 2568 -24 2588 -78 ct 2588 -78 2588 -78 2581 -81 ct p -2431 -153 m 2436 -191 2453 -209 2482 -209 ct 2512 -209 2523 -196 2530 -153 ct -2530 -153 2530 -153 2431 -153 ct p ef -2607 -192 m 2614 -194 2619 -194 2624 -194 ct 2636 -194 2641 -186 2641 -164 ct -2641 -164 2641 -164 2641 -41 ct 2641 -17 2637 -13 2606 -7 ct 2606 -7 2606 -7 2606 0 ct -2606 0 2606 0 2723 0 ct 2723 0 2723 0 2723 -8 ct 2690 -8 2681 -15 2681 -44 ct 2681 -44 2681 -44 2681 -155 ct -2681 -171 2702 -196 2715 -196 ct 2718 -196 2723 -193 2728 -188 ct 2736 -182 2741 -179 2747 -179 ct -2759 -179 2766 -187 2766 -201 ct 2766 -217 2756 -227 2740 -227 ct 2719 -227 2705 -216 2681 -181 ct -2681 -181 2681 -181 2681 -226 ct 2681 -226 2681 -226 2679 -227 ct 2653 -216 2636 -210 2607 -200 ct -2607 -200 2607 -200 2607 -192 ct p ef -pom -gr -gr -gs -gs -pum -10753 9450 t -9 -307 m 9 -307 9 -307 12 -307 ct 17 -308 23 -308 27 -308 ct 43 -308 47 -301 47 -278 ct -47 -278 47 -278 47 -42 ct 47 -15 41 -8 10 -8 ct 10 -8 10 -8 10 0 ct 10 0 10 0 124 0 ct -124 0 124 0 124 -8 ct 94 -8 88 -14 88 -41 ct 88 -41 88 -41 88 -336 ct 88 -336 88 -336 86 -337 ct -61 -328 43 -323 9 -315 ct 9 -315 9 -315 9 -307 ct p ef -256 -227 m 193 -227 149 -180 149 -112 ct 149 -45 194 5 255 5 ct 316 5 363 -47 363 -115 ct -363 -180 318 -227 256 -227 ct p -250 -213 m 290 -213 319 -166 319 -98 ct 319 -42 297 -9 261 -9 ct 242 -9 224 -21 214 -40 ct -200 -66 193 -101 193 -136 ct 193 -183 215 -213 250 -213 ct p ef -617 -25 m 617 -25 617 -25 614 -25 ct 592 -25 587 -30 587 -53 ct 587 -53 587 -53 587 -222 ct -587 -222 587 -222 510 -222 ct 510 -222 510 -222 510 -213 ct 540 -213 546 -208 546 -183 ct -546 -183 546 -183 546 -67 ct 546 -53 544 -46 537 -41 ct 524 -30 509 -24 494 -24 ct -476 -24 460 -41 460 -61 ct 460 -61 460 -61 460 -222 ct 460 -222 460 -222 389 -222 ct -389 -222 389 -222 389 -214 ct 413 -214 419 -206 419 -184 ct 419 -184 419 -184 419 -59 ct -419 -20 443 5 478 5 ct 496 5 515 -3 528 -16 ct 528 -16 528 -16 549 -38 ct 549 -38 549 -38 549 4 ct -549 4 549 4 551 5 ct 575 -5 592 -11 617 -18 ct 617 -18 617 -18 617 -25 ct p ef -798 5 m 798 5 798 5 869 -21 ct 869 -21 869 -21 869 -28 ct 860 -28 859 -28 858 -28 ct -840 -28 836 -33 836 -56 ct 836 -56 836 -56 836 -336 ct 836 -336 836 -336 834 -337 ct -811 -329 794 -324 763 -315 ct 763 -315 763 -315 763 -308 ct 767 -308 769 -308 773 -308 ct -791 -308 796 -303 796 -283 ct 796 -283 796 -283 796 -206 ct 777 -222 764 -227 745 -227 ct -689 -227 644 -171 644 -101 ct 644 -38 680 5 734 5 ct 761 5 779 -5 796 -28 ct 796 -28 796 -28 796 4 ct -796 4 796 4 798 5 ct p -796 -50 m 796 -47 792 -41 787 -35 ct 779 -26 767 -21 753 -21 ct 712 -21 686 -60 686 -121 ct -686 -177 709 -213 746 -213 ct 772 -213 796 -190 796 -164 ct 796 -164 796 -164 796 -50 ct -p ef -1034 -155 m 1034 -155 1034 -155 1032 -222 ct 1032 -222 1032 -222 1026 -222 ct -1026 -222 1026 -222 1025 -221 ct 1021 -218 1020 -217 1018 -217 ct 1016 -217 1011 -218 1005 -221 ct -995 -225 984 -227 972 -227 ct 933 -227 906 -202 906 -166 ct 906 -138 921 -118 962 -95 ct -962 -95 962 -95 990 -78 ct 1007 -69 1016 -57 1016 -41 ct 1016 -20 1000 -6 975 -6 ct -959 -6 944 -12 935 -23 ct 925 -35 920 -47 914 -75 ct 914 -75 914 -75 906 -75 ct -906 -75 906 -75 906 2 ct 906 2 906 2 912 2 ct 916 -3 918 -4 924 -4 ct 928 -4 935 -3 946 0 ct -959 3 973 5 981 5 ct 1018 5 1049 -24 1049 -58 ct 1049 -83 1038 -99 1009 -117 ct -1009 -117 1009 -117 957 -148 ct 943 -156 936 -169 936 -182 ct 936 -202 951 -216 973 -216 ct -1001 -216 1015 -199 1026 -155 ct 1026 -155 1026 -155 1034 -155 ct p ef -1079 -195 m 1084 -195 1087 -195 1091 -195 ct 1108 -195 1111 -190 1111 -167 ct -1111 -167 1111 -167 1111 65 ct 1111 90 1106 96 1077 99 ct 1077 99 1077 99 1077 107 ct -1077 107 1077 107 1195 107 ct 1195 107 1195 107 1195 98 ct 1158 98 1152 93 1152 61 ct -1152 61 1152 61 1152 -16 ct 1169 0 1181 5 1201 5 ct 1258 5 1303 -50 1303 -122 ct -1303 -183 1269 -227 1222 -227 ct 1195 -227 1173 -215 1152 -189 ct 1152 -189 1152 -189 1152 -226 ct -1152 -226 1152 -226 1149 -227 ct 1123 -217 1106 -210 1079 -202 ct 1079 -202 1079 -202 1079 -195 ct -p -1152 -165 m 1152 -180 1179 -197 1201 -197 ct 1237 -197 1261 -160 1261 -103 ct -1261 -48 1237 -11 1202 -11 ct 1180 -11 1152 -29 1152 -44 ct 1152 -44 1152 -44 1152 -165 ct -p ef -1523 -81 m 1499 -43 1478 -29 1447 -29 ct 1420 -29 1399 -43 1385 -72 ct 1376 -90 1373 -107 1372 -137 ct -1372 -137 1372 -137 1521 -137 ct 1517 -169 1512 -183 1500 -199 ct 1486 -217 1463 -227 1438 -227 ct -1414 -227 1391 -218 1373 -201 ct 1350 -181 1337 -146 1337 -106 ct 1337 -37 1372 5 1428 5 ct -1474 5 1510 -24 1530 -78 ct 1530 -78 1530 -78 1523 -81 ct p -1373 -153 m 1378 -191 1395 -209 1424 -209 ct 1454 -209 1465 -196 1472 -153 ct -1472 -153 1472 -153 1373 -153 ct p ef -1759 -32 m 1751 -26 1745 -23 1738 -23 ct 1727 -23 1723 -30 1723 -52 ct 1723 -52 1723 -52 1723 -148 ct -1723 -173 1721 -188 1713 -200 ct 1703 -218 1682 -227 1653 -227 ct 1608 -227 1572 -203 1572 -171 ct -1572 -160 1582 -150 1593 -150 ct 1605 -150 1615 -160 1615 -171 ct 1615 -173 1614 -175 1614 -179 ct -1613 -183 1612 -187 1612 -191 ct 1612 -204 1628 -215 1647 -215 ct 1671 -215 1684 -201 1684 -174 ct -1684 -174 1684 -174 1684 -144 ct 1609 -113 1601 -109 1580 -90 ct 1570 -81 1563 -64 1563 -48 ct -1563 -17 1584 5 1614 5 ct 1635 5 1655 -5 1684 -31 ct 1687 -5 1696 5 1715 5 ct 1732 5 1742 -1 1759 -20 ct -1759 -20 1759 -20 1759 -32 ct p -1684 -61 m 1684 -45 1682 -41 1671 -35 ct 1660 -28 1646 -24 1636 -24 ct 1619 -24 1606 -40 1606 -62 ct -1606 -62 1606 -62 1606 -63 ct 1606 -92 1625 -110 1684 -132 ct 1684 -132 1684 -132 1684 -61 ct -p ef -1768 -307 m 1775 -307 1779 -308 1784 -308 ct 1800 -308 1805 -302 1805 -278 ct -1805 -278 1805 -278 1805 -40 ct 1805 -15 1803 -13 1768 -7 ct 1768 -7 1768 -7 1768 0 ct -1768 0 1768 0 1882 0 ct 1882 0 1882 0 1882 -8 ct 1882 -8 1882 -8 1872 -8 ct 1853 -8 1845 -15 1845 -32 ct -1845 -32 1845 -32 1845 -124 ct 1845 -124 1845 -124 1913 -32 ct 1913 -32 1913 -32 1915 -30 ct -1916 -28 1917 -27 1918 -25 ct 1922 -20 1923 -17 1923 -15 ct 1923 -10 1919 -7 1913 -7 ct -1913 -7 1913 -7 1904 -7 ct 1904 -7 1904 -7 1904 0 ct 1904 0 1904 0 2009 0 ct 2009 0 2009 0 2009 -8 ct -1988 -8 1973 -18 1953 -43 ct 1953 -43 1953 -43 1879 -139 ct 1879 -139 1879 -139 1893 -152 ct -1927 -185 1957 -208 1971 -212 ct 1979 -214 1985 -215 1994 -215 ct 1994 -215 1994 -215 1997 -215 ct -1997 -215 1997 -215 1997 -222 ct 1997 -222 1997 -222 1899 -222 ct 1899 -222 1899 -222 1899 -215 ct -1918 -215 1923 -213 1923 -206 ct 1923 -202 1918 -195 1912 -189 ct 1912 -189 1912 -189 1845 -129 ct -1845 -129 1845 -129 1845 -336 ct 1845 -336 1845 -336 1843 -337 ct 1825 -331 1811 -327 1783 -319 ct -1783 -319 1783 -319 1768 -315 ct 1768 -315 1768 -315 1768 -307 ct p ef -2217 -81 m 2193 -43 2172 -29 2141 -29 ct 2114 -29 2093 -43 2079 -72 ct 2070 -90 2067 -107 2066 -137 ct -2066 -137 2066 -137 2215 -137 ct 2211 -169 2206 -183 2194 -199 ct 2180 -217 2157 -227 2132 -227 ct -2108 -227 2085 -218 2067 -201 ct 2044 -181 2031 -146 2031 -106 ct 2031 -37 2066 5 2122 5 ct -2168 5 2204 -24 2224 -78 ct 2224 -78 2224 -78 2217 -81 ct p -2067 -153 m 2072 -191 2089 -209 2118 -209 ct 2148 -209 2159 -196 2166 -153 ct -2166 -153 2166 -153 2067 -153 ct p ef -2242 -192 m 2249 -194 2254 -194 2259 -194 ct 2271 -194 2276 -186 2276 -164 ct -2276 -164 2276 -164 2276 -41 ct 2276 -17 2272 -13 2241 -7 ct 2241 -7 2241 -7 2241 0 ct -2241 0 2241 0 2358 0 ct 2358 0 2358 0 2358 -8 ct 2325 -8 2316 -15 2316 -44 ct 2316 -44 2316 -44 2316 -155 ct -2316 -171 2337 -196 2350 -196 ct 2353 -196 2358 -193 2363 -188 ct 2371 -182 2376 -179 2382 -179 ct -2394 -179 2401 -187 2401 -201 ct 2401 -217 2391 -227 2375 -227 ct 2354 -227 2340 -216 2316 -181 ct -2316 -181 2316 -181 2316 -226 ct 2316 -226 2316 -226 2314 -227 ct 2288 -216 2271 -210 2242 -200 ct -2242 -200 2242 -200 2242 -192 ct p ef -pom -gr -gr -gs -gs -pum -4619 16250 t -121 -227 m 58 -227 14 -180 14 -112 ct 14 -45 59 5 120 5 ct 181 5 228 -47 228 -115 ct -228 -180 183 -227 121 -227 ct p -115 -213 m 155 -213 184 -166 184 -98 ct 184 -42 162 -9 126 -9 ct 107 -9 89 -21 79 -40 ct -65 -66 58 -101 58 -136 ct 58 -183 80 -213 115 -213 ct p ef -482 -25 m 482 -25 482 -25 479 -25 ct 457 -25 452 -30 452 -53 ct 452 -53 452 -53 452 -222 ct -452 -222 452 -222 375 -222 ct 375 -222 375 -222 375 -213 ct 405 -213 411 -208 411 -183 ct -411 -183 411 -183 411 -67 ct 411 -53 409 -46 402 -41 ct 389 -30 374 -24 359 -24 ct -341 -24 325 -41 325 -61 ct 325 -61 325 -61 325 -222 ct 325 -222 325 -222 254 -222 ct -254 -222 254 -222 254 -214 ct 278 -214 284 -206 284 -184 ct 284 -184 284 -184 284 -59 ct -284 -20 308 5 343 5 ct 361 5 380 -3 393 -16 ct 393 -16 393 -16 414 -38 ct 414 -38 414 -38 414 4 ct -414 4 414 4 416 5 ct 440 -5 457 -11 482 -18 ct 482 -18 482 -18 482 -25 ct p ef -618 -222 m 618 -222 618 -222 570 -222 ct 570 -222 570 -222 570 -279 ct 570 -284 569 -286 566 -286 ct -563 -281 560 -277 556 -272 ct 538 -245 517 -221 510 -219 ct 504 -216 501 -212 501 -210 ct -501 -208 502 -207 503 -206 ct 503 -206 503 -206 529 -206 ct 529 -206 529 -206 529 -58 ct -529 -16 543 5 572 5 ct 596 5 614 -7 630 -33 ct 630 -33 630 -33 624 -38 ct 614 -26 605 -21 595 -21 ct -577 -21 570 -34 570 -65 ct 570 -65 570 -65 570 -206 ct 570 -206 570 -206 618 -206 ct -618 -206 618 -206 618 -222 ct p ef -639 -195 m 644 -195 647 -195 651 -195 ct 668 -195 671 -190 671 -167 ct 671 -167 671 -167 671 65 ct -671 90 666 96 637 99 ct 637 99 637 99 637 107 ct 637 107 637 107 755 107 ct 755 107 755 107 755 98 ct -718 98 712 93 712 61 ct 712 61 712 61 712 -16 ct 729 0 741 5 761 5 ct 818 5 863 -50 863 -122 ct -863 -183 829 -227 782 -227 ct 755 -227 733 -215 712 -189 ct 712 -189 712 -189 712 -226 ct -712 -226 712 -226 709 -227 ct 683 -217 666 -210 639 -202 ct 639 -202 639 -202 639 -195 ct -p -712 -165 m 712 -180 739 -197 761 -197 ct 797 -197 821 -160 821 -103 ct 821 -48 797 -11 762 -11 ct -740 -11 712 -29 712 -44 ct 712 -44 712 -44 712 -165 ct p ef -1117 -25 m 1117 -25 1117 -25 1114 -25 ct 1092 -25 1087 -30 1087 -53 ct 1087 -53 1087 -53 1087 -222 ct -1087 -222 1087 -222 1010 -222 ct 1010 -222 1010 -222 1010 -213 ct 1040 -213 1046 -208 1046 -183 ct -1046 -183 1046 -183 1046 -67 ct 1046 -53 1044 -46 1037 -41 ct 1024 -30 1009 -24 994 -24 ct -976 -24 960 -41 960 -61 ct 960 -61 960 -61 960 -222 ct 960 -222 960 -222 889 -222 ct -889 -222 889 -222 889 -214 ct 913 -214 919 -206 919 -184 ct 919 -184 919 -184 919 -59 ct -919 -20 943 5 978 5 ct 996 5 1015 -3 1028 -16 ct 1028 -16 1028 -16 1049 -38 ct -1049 -38 1049 -38 1049 4 ct 1049 4 1049 4 1051 5 ct 1075 -5 1092 -11 1117 -18 ct -1117 -18 1117 -18 1117 -25 ct p ef -1253 -222 m 1253 -222 1253 -222 1205 -222 ct 1205 -222 1205 -222 1205 -279 ct -1205 -284 1204 -286 1201 -286 ct 1198 -281 1195 -277 1191 -272 ct 1173 -245 1152 -221 1145 -219 ct -1139 -216 1136 -212 1136 -210 ct 1136 -208 1137 -207 1138 -206 ct 1138 -206 1138 -206 1164 -206 ct -1164 -206 1164 -206 1164 -58 ct 1164 -16 1178 5 1207 5 ct 1231 5 1249 -7 1265 -33 ct -1265 -33 1265 -33 1259 -38 ct 1249 -26 1240 -21 1230 -21 ct 1212 -21 1205 -34 1205 -65 ct -1205 -65 1205 -65 1205 -206 ct 1205 -206 1205 -206 1253 -206 ct 1253 -206 1253 -206 1253 -222 ct -p ef -pom -gr -gs -pum -4138 16851 t -143 -334 m 107 -310 92 -297 75 -274 ct 40 -231 23 -182 23 -124 ct 23 -62 41 -13 84 37 ct -104 61 116 72 141 87 ct 141 87 141 87 147 79 ct 108 48 95 31 82 -6 ct 70 -39 65 -76 65 -126 ct -65 -178 71 -218 84 -249 ct 98 -279 112 -297 147 -326 ct 147 -326 147 -326 143 -334 ct -p ef -288 -222 m 288 -222 288 -222 240 -222 ct 240 -222 240 -222 240 -279 ct 240 -284 239 -286 236 -286 ct -233 -281 230 -277 226 -272 ct 208 -245 187 -221 180 -219 ct 174 -216 171 -212 171 -210 ct -171 -208 172 -207 173 -206 ct 173 -206 173 -206 199 -206 ct 199 -206 199 -206 199 -58 ct -199 -16 213 5 242 5 ct 266 5 284 -7 300 -33 ct 300 -33 300 -33 294 -38 ct 284 -26 275 -21 265 -21 ct -247 -21 240 -34 240 -65 ct 240 -65 240 -65 240 -206 ct 240 -206 240 -206 288 -206 ct -288 -206 288 -206 288 -222 ct p ef -426 -227 m 363 -227 319 -180 319 -112 ct 319 -45 364 5 425 5 ct 486 5 533 -47 533 -115 ct -533 -180 488 -227 426 -227 ct p -420 -213 m 460 -213 489 -166 489 -98 ct 489 -42 467 -9 431 -9 ct 412 -9 394 -21 384 -40 ct -370 -66 363 -101 363 -136 ct 363 -183 385 -213 420 -213 ct p ef -827 -222 m 827 -222 827 -222 767 -222 ct 767 -222 767 -222 767 -279 ct 767 -308 776 -323 795 -323 ct -805 -323 812 -318 820 -304 ct 828 -291 834 -286 842 -286 ct 853 -286 862 -295 862 -306 ct -862 -324 841 -337 812 -337 ct 782 -337 756 -324 744 -301 ct 731 -279 727 -261 727 -222 ct -727 -222 727 -222 687 -222 ct 687 -222 687 -222 687 -206 ct 687 -206 687 -206 727 -206 ct -727 -206 727 -206 727 -51 ct 727 -14 722 -8 687 -8 ct 687 -8 687 -8 687 0 ct 687 0 687 0 813 0 ct -813 0 813 0 813 -8 ct 773 -8 768 -13 768 -51 ct 768 -51 768 -51 768 -206 ct 768 -206 768 -206 827 -206 ct -827 -206 827 -206 827 -222 ct p ef -1052 -32 m 1044 -26 1038 -23 1031 -23 ct 1020 -23 1016 -30 1016 -52 ct 1016 -52 1016 -52 1016 -148 ct -1016 -173 1014 -188 1006 -200 ct 996 -218 975 -227 946 -227 ct 901 -227 865 -203 865 -171 ct -865 -160 875 -150 886 -150 ct 898 -150 908 -160 908 -171 ct 908 -173 907 -175 907 -179 ct -906 -183 905 -187 905 -191 ct 905 -204 921 -215 940 -215 ct 964 -215 977 -201 977 -174 ct -977 -174 977 -174 977 -144 ct 902 -113 894 -109 873 -90 ct 863 -81 856 -64 856 -48 ct -856 -17 877 5 907 5 ct 928 5 948 -5 977 -31 ct 980 -5 989 5 1008 5 ct 1025 5 1035 -1 1052 -20 ct -1052 -20 1052 -20 1052 -32 ct p -977 -61 m 977 -45 975 -41 964 -35 ct 953 -28 939 -24 929 -24 ct 912 -24 899 -40 899 -62 ct -899 -62 899 -62 899 -63 ct 899 -92 918 -110 977 -132 ct 977 -132 977 -132 977 -61 ct -p ef -1061 -192 m 1068 -194 1073 -194 1078 -194 ct 1090 -194 1095 -186 1095 -164 ct -1095 -164 1095 -164 1095 -41 ct 1095 -17 1091 -13 1060 -7 ct 1060 -7 1060 -7 1060 0 ct -1060 0 1060 0 1177 0 ct 1177 0 1177 0 1177 -8 ct 1144 -8 1135 -15 1135 -44 ct 1135 -44 1135 -44 1135 -155 ct -1135 -171 1156 -196 1169 -196 ct 1172 -196 1177 -193 1182 -188 ct 1190 -182 1195 -179 1201 -179 ct -1213 -179 1220 -187 1220 -201 ct 1220 -217 1210 -227 1194 -227 ct 1173 -227 1159 -216 1135 -181 ct -1135 -181 1135 -181 1135 -226 ct 1135 -226 1135 -226 1133 -227 ct 1107 -216 1090 -210 1061 -200 ct -1061 -200 1061 -200 1061 -192 ct p ef -1544 -81 m 1520 -43 1499 -29 1468 -29 ct 1441 -29 1420 -43 1406 -72 ct 1397 -90 1394 -107 1393 -137 ct -1393 -137 1393 -137 1542 -137 ct 1538 -169 1533 -183 1521 -199 ct 1507 -217 1484 -227 1459 -227 ct -1435 -227 1412 -218 1394 -201 ct 1371 -181 1358 -146 1358 -106 ct 1358 -37 1393 5 1449 5 ct -1495 5 1531 -24 1551 -78 ct 1551 -78 1551 -78 1544 -81 ct p -1394 -153 m 1399 -191 1416 -209 1445 -209 ct 1475 -209 1486 -196 1493 -153 ct -1493 -153 1493 -153 1394 -153 ct p ef -1574 -196 m 1577 -198 1581 -198 1587 -198 ct 1600 -198 1605 -191 1605 -166 ct -1605 -166 1605 -166 1605 -44 ct 1605 -15 1599 -8 1575 -8 ct 1575 -8 1575 -8 1575 0 ct -1575 0 1575 0 1677 0 ct 1677 0 1677 0 1677 -8 ct 1653 -8 1645 -14 1645 -32 ct 1645 -32 1645 -32 1645 -171 ct -1669 -194 1679 -200 1695 -200 ct 1719 -200 1731 -184 1731 -152 ct 1731 -152 1731 -152 1731 -48 ct -1731 -17 1724 -8 1700 -8 ct 1700 -8 1700 -8 1700 0 ct 1700 0 1700 0 1801 0 ct 1801 0 1801 0 1801 -7 ct -1777 -10 1771 -16 1771 -40 ct 1771 -40 1771 -40 1771 -153 ct 1771 -199 1750 -227 1714 -227 ct -1692 -227 1677 -219 1644 -187 ct 1644 -187 1644 -187 1644 -226 ct 1644 -226 1644 -226 1641 -227 ct -1617 -218 1600 -213 1574 -205 ct 1574 -205 1574 -205 1574 -196 ct p ef -1983 5 m 1983 5 1983 5 2054 -21 ct 2054 -21 2054 -21 2054 -28 ct 2045 -28 2044 -28 2043 -28 ct -2025 -28 2021 -33 2021 -56 ct 2021 -56 2021 -56 2021 -336 ct 2021 -336 2021 -336 2019 -337 ct -1996 -329 1979 -324 1948 -315 ct 1948 -315 1948 -315 1948 -308 ct 1952 -308 1954 -308 1958 -308 ct -1976 -308 1981 -303 1981 -283 ct 1981 -283 1981 -283 1981 -206 ct 1962 -222 1949 -227 1930 -227 ct -1874 -227 1829 -171 1829 -101 ct 1829 -38 1865 5 1919 5 ct 1946 5 1964 -5 1981 -28 ct -1981 -28 1981 -28 1981 4 ct 1981 4 1981 4 1983 5 ct p -1981 -50 m 1981 -47 1977 -41 1972 -35 ct 1964 -26 1952 -21 1938 -21 ct 1897 -21 1871 -60 1871 -121 ct -1871 -177 1894 -213 1931 -213 ct 1957 -213 1981 -190 1981 -164 ct 1981 -164 1981 -164 1981 -50 ct -p ef -2084 87 m 2120 64 2135 51 2153 28 ct 2187 -15 2204 -64 2204 -122 ct 2204 -185 2186 -233 2143 -283 ct -2124 -307 2111 -318 2086 -334 ct 2086 -334 2086 -334 2080 -326 ct 2119 -295 2132 -277 2145 -240 ct -2157 -207 2162 -170 2162 -120 ct 2162 -69 2156 -28 2143 2 ct 2129 33 2115 51 2080 79 ct -2080 79 2080 79 2084 87 ct p ef -pom -gr -gr -gs -gs -pum -8742 14319 t -7 -199 m 14 -200 17 -201 23 -201 ct 51 -201 58 -188 81 -103 ct 89 -71 101 -13 101 -4 ct -101 4 98 11 91 20 ct 76 41 66 54 60 59 ct 50 70 44 74 38 74 ct 35 74 31 73 26 69 ct -18 63 13 60 7 60 ct -3 60 -12 69 -12 80 ct -12 92 -1 102 13 102 ct 45 102 110 27 163 -71 ct -197 -131 210 -167 210 -191 ct 210 -206 198 -219 183 -219 ct 172 -219 164 -211 164 -200 ct -164 -193 168 -188 178 -181 ct 187 -176 191 -171 191 -164 ct 191 -145 172 -106 130 -36 ct -130 -36 130 -36 121 -94 ct 113 -137 85 -219 78 -219 ct 78 -219 78 -219 76 -219 ct -76 -218 74 -218 72 -218 ct 67 -217 49 -214 23 -209 ct 21 -209 14 -208 7 -207 ct -7 -207 7 -207 7 -199 ct p ef -pom -gr -gs -pum -8962 14319 t -143 -334 m 107 -310 92 -297 75 -274 ct 40 -231 23 -182 23 -124 ct 23 -62 41 -13 84 37 ct -104 61 116 72 141 87 ct 141 87 141 87 147 79 ct 108 48 95 31 82 -6 ct 70 -39 65 -76 65 -126 ct -65 -178 71 -218 84 -249 ct 98 -279 112 -297 147 -326 ct 147 -326 147 -326 143 -334 ct -p ef -pom -gr -gs -pum -9127 14319 t -227 -58 m 227 -58 227 -58 217 -45 ct 203 -27 194 -19 187 -19 ct 183 -19 179 -23 179 -27 ct -179 -31 179 -31 186 -58 ct 186 -58 186 -58 214 -160 ct 216 -170 218 -181 218 -188 ct -218 -206 205 -218 186 -218 ct 154 -218 123 -189 72 -110 ct 72 -110 72 -110 105 -217 ct -105 -217 105 -217 104 -218 ct 77 -213 67 -211 24 -203 ct 24 -203 24 -203 24 -195 ct -49 -195 55 -192 55 -182 ct 55 -179 55 -176 54 -173 ct 54 -173 54 -173 7 0 ct 7 0 7 0 44 0 ct -67 -78 72 -89 93 -123 ct 123 -168 148 -193 166 -193 ct 174 -193 178 -188 178 -179 ct -178 -173 175 -156 171 -141 ct 171 -141 171 -141 150 -60 ct 143 -35 142 -28 142 -23 ct -142 -4 149 4 165 4 ct 187 4 200 -6 234 -52 ct 234 -52 234 -52 227 -58 ct p ef -pom -gr -gs -pum -9377 14319 t -18 87 m 54 64 69 51 87 28 ct 121 -15 138 -64 138 -122 ct 138 -185 120 -233 77 -283 ct -58 -307 45 -318 20 -334 ct 20 -334 20 -334 14 -326 ct 53 -295 66 -277 79 -240 ct -91 -207 96 -170 96 -120 ct 96 -69 90 -28 77 2 ct 63 33 49 51 14 79 ct 14 79 14 79 18 87 ct -p ef -pom -gr -gr -gs -gs -pum -8742 14186 t -45 -147 m 114 -290 l 183 -147 l 216 -147 l 128 -327 l 99 -327 l 12 -147 l -45 -147 l p ef -pom -gr -gr -gs -gs -pum -14351 14292 t -7 -199 m 14 -200 17 -201 23 -201 ct 51 -201 58 -188 81 -103 ct 89 -71 101 -13 101 -4 ct -101 4 98 11 91 20 ct 76 41 66 54 60 59 ct 50 70 44 74 38 74 ct 35 74 31 73 26 69 ct -18 63 13 60 7 60 ct -3 60 -12 69 -12 80 ct -12 92 -1 102 13 102 ct 45 102 110 27 163 -71 ct -197 -131 210 -167 210 -191 ct 210 -206 198 -219 183 -219 ct 172 -219 164 -211 164 -200 ct -164 -193 168 -188 178 -181 ct 187 -176 191 -171 191 -164 ct 191 -145 172 -106 130 -36 ct -130 -36 130 -36 121 -94 ct 113 -137 85 -219 78 -219 ct 78 -219 78 -219 76 -219 ct -76 -218 74 -218 72 -218 ct 67 -217 49 -214 23 -209 ct 21 -209 14 -208 7 -207 ct -7 -207 7 -207 7 -199 ct p ef -pom -gr -gs -pum -14571 14292 t -143 -334 m 107 -310 92 -297 75 -274 ct 40 -231 23 -182 23 -124 ct 23 -62 41 -13 84 37 ct -104 61 116 72 141 87 ct 141 87 141 87 147 79 ct 108 48 95 31 82 -6 ct 70 -39 65 -76 65 -126 ct -65 -178 71 -218 84 -249 ct 98 -279 112 -297 147 -326 ct 147 -326 147 -326 143 -334 ct -p ef -pom -gr -gs -pum -14736 14292 t -227 -58 m 227 -58 227 -58 217 -45 ct 203 -27 194 -19 187 -19 ct 183 -19 179 -23 179 -27 ct -179 -31 179 -31 186 -58 ct 186 -58 186 -58 214 -160 ct 216 -170 218 -181 218 -188 ct -218 -206 205 -218 186 -218 ct 154 -218 123 -189 72 -110 ct 72 -110 72 -110 105 -217 ct -105 -217 105 -217 104 -218 ct 77 -213 67 -211 24 -203 ct 24 -203 24 -203 24 -195 ct -49 -195 55 -192 55 -182 ct 55 -179 55 -176 54 -173 ct 54 -173 54 -173 7 0 ct 7 0 7 0 44 0 ct -67 -78 72 -89 93 -123 ct 123 -168 148 -193 166 -193 ct 174 -193 178 -188 178 -179 ct -178 -173 175 -156 171 -141 ct 171 -141 171 -141 150 -60 ct 143 -35 142 -28 142 -23 ct -142 -4 149 4 165 4 ct 187 4 200 -6 234 -52 ct 234 -52 234 -52 227 -58 ct p ef -pom -gr -gs -pum -14986 14292 t -18 87 m 54 64 69 51 87 28 ct 121 -15 138 -64 138 -122 ct 138 -185 120 -233 77 -283 ct -58 -307 45 -318 20 -334 ct 20 -334 20 -334 14 -326 ct 53 -295 66 -277 79 -240 ct -91 -207 96 -170 96 -120 ct 96 -69 90 -28 77 2 ct 63 33 49 51 14 79 ct 14 79 14 79 18 87 ct -p ef -pom -gr -gr -tm setmatrix -0 0 t -1 1 s -0 8286 t -pom -count op_count sub {pop} repeat countdictstack dict_count sub {end} repeat b4_inc_state restore -%%PageTrailer -%%Trailer -%%EOF diff --git a/Engine/lib/speex/doc/echo_path.odg b/Engine/lib/speex/doc/echo_path.odg deleted file mode 100644 index 460af845f..000000000 Binary files a/Engine/lib/speex/doc/echo_path.odg and /dev/null differ diff --git a/Engine/lib/speex/doc/manual.lyx b/Engine/lib/speex/doc/manual.lyx deleted file mode 100644 index fa980a485..000000000 --- a/Engine/lib/speex/doc/manual.lyx +++ /dev/null @@ -1,12085 +0,0 @@ -#LyX 1.6.1 created this file. For more info see http://www.lyx.org/ -\lyxformat 345 -\begin_document -\begin_header -\textclass scrbook -\use_default_options true -\language english -\inputencoding auto -\font_roman default -\font_sans default -\font_typewriter default -\font_default_family default -\font_sc false -\font_osf false -\font_sf_scale 100 -\font_tt_scale 100 - -\graphics default -\paperfontsize 10 -\spacing single -\use_hyperref false -\papersize letterpaper -\use_geometry true -\use_amsmath 2 -\use_esint 2 -\cite_engine basic -\use_bibtopic false -\paperorientation portrait -\leftmargin 2cm -\topmargin 2cm -\rightmargin 2cm -\bottommargin 2cm -\secnumdepth 3 -\tocdepth 3 -\paragraph_separation indent -\defskip medskip -\quotes_language english -\papercolumns 1 -\papersides 1 -\paperpagestyle headings -\tracking_changes false -\output_changes false -\author "" -\author "" -\end_header - -\begin_body - -\begin_layout Title -The Speex Manual -\begin_inset Newline newline -\end_inset - -Version 1.2 -\end_layout - -\begin_layout Author -Jean-Marc Valin -\end_layout - -\begin_layout Standard -\begin_inset Newpage newpage -\end_inset - - -\end_layout - -\begin_layout Standard -Copyright -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -copyright -\end_layout - -\end_inset - - 2002-2008 Jean-Marc Valin/Xiph.org Foundation -\end_layout - -\begin_layout Standard -Permission is granted to copy, distribute and/or modify this document under - the terms of the GNU Free Documentation License, Version 1.1 or any later - version published by the Free Software Foundation; with no Invariant Section, - with no Front-Cover Texts, and with no Back-Cover. - A copy of the license is included in the section entitled "GNU Free Documentati -on License". - -\end_layout - -\begin_layout Standard -\begin_inset Newpage newpage -\end_inset - - -\begin_inset CommandInset toc -LatexCommand tableofcontents - -\end_inset - - -\begin_inset Newpage newpage -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset FloatList table - -\end_inset - - -\begin_inset Newpage newpage -\end_inset - - -\end_layout - -\begin_layout Chapter -Introduction to Speex -\end_layout - -\begin_layout Standard -The Speex codec ( -\family typewriter -http://www.speex.org/ -\family default -) exists because there is a need for a speech codec that is open-source - and free from software patent royalties. - These are essential conditions for being usable in any open-source software. - In essence, Speex is to speech what Vorbis is to audio/music. - Unlike many other speech codecs, Speex is not designed for mobile phones - but rather for packet networks and voice over IP (VoIP) applications. - File-based compression is of course also supported. - -\end_layout - -\begin_layout Standard -The Speex codec is designed to be very flexible and support a wide range - of speech quality and bit-rate. - Support for very good quality speech also means that Speex can encode wideband - speech (16 kHz sampling rate) in addition to narrowband speech (telephone - quality, 8 kHz sampling rate). -\end_layout - -\begin_layout Standard -Designing for VoIP instead of mobile phones means that Speex is robust to - lost packets, but not to corrupted ones. - This is based on the assumption that in VoIP, packets either arrive unaltered - or don't arrive at all. - Because Speex is targeted at a wide range of devices, it has modest (adjustable -) complexity and a small memory footprint. -\end_layout - -\begin_layout Standard -All the design goals led to the choice of CELP -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -CELP -\end_layout - -\end_inset - - as the encoding technique. - One of the main reasons is that CELP has long proved that it could work - reliably and scale well to both low bit-rates (e.g. - DoD CELP @ 4.8 kbps) and high bit-rates (e.g. - G.728 @ 16 kbps). - -\end_layout - -\begin_layout Section -Getting help -\begin_inset CommandInset label -LatexCommand label -name "sec:Getting-help" - -\end_inset - - -\end_layout - -\begin_layout Standard -As for many open source projects, there are many ways to get help with Speex. - These include: -\end_layout - -\begin_layout Itemize -This manual -\end_layout - -\begin_layout Itemize -Other documentation on the Speex website (http://www.speex.org/) -\end_layout - -\begin_layout Itemize -Mailing list: Discuss any Speex-related topic on speex-dev@xiph.org (not - just for developers) -\end_layout - -\begin_layout Itemize -IRC: The main channel is #speex on irc.freenode.net. - Note that due to time differences, it may take a while to get someone, - so please be patient. -\end_layout - -\begin_layout Itemize -Email the author privately at jean-marc.valin@usherbrooke.ca -\series bold -only -\series default - for private/delicate topics you do not wish to discuss publicly. -\end_layout - -\begin_layout Standard -Before asking for help (mailing list or IRC), -\series bold -it is important to first read this manual -\series default - (OK, so if you made it here it's already a good sign). - It is generally considered rude to ask on a mailing list about topics that - are clearly detailed in the documentation. - On the other hand, it's perfectly OK (and encouraged) to ask for clarifications - about something covered in the manual. - This manual does not (yet) cover everything about Speex, so everyone is - encouraged to ask questions, send comments, feature requests, or just let - us know how Speex is being used. - -\end_layout - -\begin_layout Standard -Here are some additional guidelines related to the mailing list. - Before reporting bugs in Speex to the list, it is strongly recommended - (if possible) to first test whether these bugs can be reproduced using - the speexenc and speexdec (see Section -\begin_inset CommandInset ref -LatexCommand ref -reference "sec:Command-line-encoder/decoder" - -\end_inset - -) command-line utilities. - Bugs reported based on 3rd party code are both harder to find and far too - often caused by errors that have nothing to do with Speex. - -\end_layout - -\begin_layout Section -About this document -\end_layout - -\begin_layout Standard -This document is divided in the following way. - Section -\begin_inset CommandInset ref -LatexCommand ref -reference "sec:Feature-description" - -\end_inset - - describes the different Speex features and defines many basic terms that - are used throughout this manual. - Section -\begin_inset CommandInset ref -LatexCommand ref -reference "sec:Command-line-encoder/decoder" - -\end_inset - - documents the standard command-line tools provided in the Speex distribution. - Section -\begin_inset CommandInset ref -LatexCommand ref -reference "sec:Programming-with-Speex" - -\end_inset - - includes detailed instructions about programming using the libspeex -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -libspeex -\end_layout - -\end_inset - - API. - Section -\begin_inset CommandInset ref -LatexCommand ref -reference "sec:Formats-and-standards" - -\end_inset - - has some information related to Speex and standards. - -\end_layout - -\begin_layout Standard -The three last sections describe the algorithms used in Speex. - These sections require signal processing knowledge, but are not required - for merely using Speex. - They are intended for people who want to understand how Speex really works - and/or want to do research based on Speex. - Section -\begin_inset CommandInset ref -LatexCommand ref -reference "sec:Introduction-to-CELP" - -\end_inset - - explains the general idea behind CELP, while sections -\begin_inset CommandInset ref -LatexCommand ref -reference "sec:Speex-narrowband-mode" - -\end_inset - - and -\begin_inset CommandInset ref -LatexCommand ref -reference "sec:Speex-wideband-mode" - -\end_inset - - are specific to Speex. -\end_layout - -\begin_layout Standard -\begin_inset Newpage newpage -\end_inset - - -\end_layout - -\begin_layout Chapter -Codec description -\begin_inset CommandInset label -LatexCommand label -name "sec:Feature-description" - -\end_inset - - -\end_layout - -\begin_layout Standard -This section describes Speex and its features into more details. -\end_layout - -\begin_layout Section -Concepts -\end_layout - -\begin_layout Standard -Before introducing all the Speex features, here are some concepts in speech - coding that help better understand the rest of the manual. - Although some are general concepts in speech/audio processing, others are - specific to Speex. -\end_layout - -\begin_layout Subsection* -Sampling rate -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -sampling rate -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -The sampling rate expressed in Hertz (Hz) is the number of samples taken - from a signal per second. - For a sampling rate of -\begin_inset Formula $F_{s}$ -\end_inset - - kHz, the highest frequency that can be represented is equal to -\begin_inset Formula $F_{s}/2$ -\end_inset - - kHz ( -\begin_inset Formula $F_{s}/2$ -\end_inset - - is known as the Nyquist frequency). - This is a fundamental property in signal processing and is described by - the sampling theorem. - Speex is mainly designed for three different sampling rates: 8 kHz, 16 - kHz, and 32 kHz. - These are respectively referred to as narrowband -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -narrowband -\end_layout - -\end_inset - -, wideband -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -wideband -\end_layout - -\end_inset - - and ultra-wideband -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -ultra-wideband -\end_layout - -\end_inset - -. - -\end_layout - -\begin_layout Subsection* -Bit-rate -\end_layout - -\begin_layout Standard -When encoding a speech signal, the bit-rate is defined as the number of - bits per unit of time required to encode the speech. - It is measured in -\emph on -bits per second -\emph default - (bps), or generally -\emph on -kilobits per second -\emph default -. - It is important to make the distinction between -\emph on -kilo -\series bold -bits -\series default -\emph default - -\emph on -per second -\emph default - (k -\series bold -b -\series default -ps) and -\emph on -kilo -\series bold -bytes -\series default -\emph default - -\emph on -per second -\emph default - (k -\series bold -B -\series default -ps). -\end_layout - -\begin_layout Subsection* -Quality -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -quality -\end_layout - -\end_inset - - (variable) -\end_layout - -\begin_layout Standard -Speex is a lossy codec, which means that it achieves compression at the - expense of fidelity of the input speech signal. - Unlike some other speech codecs, it is possible to control the trade-off - made between quality and bit-rate. - The Speex encoding process is controlled most of the time by a quality - parameter that ranges from 0 to 10. - In constant bit-rate -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -constant bit-rate -\end_layout - -\end_inset - - (CBR) operation, the quality parameter is an integer, while for variable - bit-rate (VBR), the parameter is a float. - -\end_layout - -\begin_layout Subsection* -Complexity -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -complexity -\end_layout - -\end_inset - - (variable) -\end_layout - -\begin_layout Standard -With Speex, it is possible to vary the complexity allowed for the encoder. - This is done by controlling how the search is performed with an integer - ranging from 1 to 10 in a way that's similar to the -1 to -9 options to - -\emph on -gzip -\emph default - and -\emph on -bzip2 -\emph default - compression utilities. - For normal use, the noise level at complexity 1 is between 1 and 2 dB higher - than at complexity 10, but the CPU requirements for complexity 10 is about - 5 times higher than for complexity 1. - In practice, the best trade-off is between complexity 2 and 4, though higher - settings are often useful when encoding non-speech sounds like DTMF -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -DTMF -\end_layout - -\end_inset - - tones. -\end_layout - -\begin_layout Subsection* -Variable Bit-Rate -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -variable bit-rate -\end_layout - -\end_inset - - (VBR) -\end_layout - -\begin_layout Standard -Variable bit-rate (VBR) allows a codec to change its bit-rate dynamically - to adapt to the -\begin_inset Quotes eld -\end_inset - -difficulty -\begin_inset Quotes erd -\end_inset - - of the audio being encoded. - In the example of Speex, sounds like vowels and high-energy transients - require a higher bit-rate to achieve good quality, while fricatives (e.g. - s,f sounds) can be coded adequately with less bits. - For this reason, VBR can achieve lower bit-rate for the same quality, or - a better quality for a certain bit-rate. - Despite its advantages, VBR has two main drawbacks: first, by only specifying - quality, there's no guaranty about the final average bit-rate. - Second, for some real-time applications like voice over IP (VoIP), what - counts is the maximum bit-rate, which must be low enough for the communication - channel. -\end_layout - -\begin_layout Subsection* -Average Bit-Rate -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -average bit-rate -\end_layout - -\end_inset - - (ABR) -\end_layout - -\begin_layout Standard -Average bit-rate solves one of the problems of VBR, as it dynamically adjusts - VBR quality in order to meet a specific target bit-rate. - Because the quality/bit-rate is adjusted in real-time (open-loop), the - global quality will be slightly lower than that obtained by encoding in - VBR with exactly the right quality setting to meet the target average bit-rate. -\end_layout - -\begin_layout Subsection* -Voice Activity Detection -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -voice activity detection -\end_layout - -\end_inset - - (VAD) -\end_layout - -\begin_layout Standard -When enabled, voice activity detection detects whether the audio being encoded - is speech or silence/background noise. - VAD is always implicitly activated when encoding in VBR, so the option - is only useful in non-VBR operation. - In this case, Speex detects non-speech periods and encode them with just - enough bits to reproduce the background noise. - This is called -\begin_inset Quotes eld -\end_inset - -comfort noise generation -\begin_inset Quotes erd -\end_inset - - (CNG). -\end_layout - -\begin_layout Subsection* -Discontinuous Transmission -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -discontinuous transmission -\end_layout - -\end_inset - - (DTX) -\end_layout - -\begin_layout Standard -Discontinuous transmission is an addition to VAD/VBR operation, that allows - to stop transmitting completely when the background noise is stationary. - In file-based operation, since we cannot just stop writing to the file, - only 5 bits are used for such frames (corresponding to 250 bps). -\end_layout - -\begin_layout Subsection* -Perceptual enhancement -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -perceptual enhancement -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -Perceptual enhancement is a part of the decoder which, when turned on, attempts - to reduce the perception of the noise/distortion produced by the encoding/decod -ing process. - In most cases, perceptual enhancement brings the sound further from the - original -\emph on -objectively -\emph default - (e.g. - considering only SNR), but in the end it still -\emph on -sounds -\emph default - better (subjective improvement). -\end_layout - -\begin_layout Subsection* -Latency and algorithmic delay -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -algorithmic delay -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -Every speech codec introduces a delay in the transmission. - For Speex, this delay is equal to the frame size, plus some amount of -\begin_inset Quotes eld -\end_inset - -look-ahead -\begin_inset Quotes erd -\end_inset - - required to process each frame. - In narrowband operation (8 kHz), the look-ahead is 10 ms, in wideband operation - (16 kHz), the look-ahead is 13.9 ms and in ultra-wideband operation (32 - kHz) look-ahead is 15.9 ms, resulting in the algorithic delays of 30 ms, - 33.9 ms and 35.9 ms accordingly. - These values don't account for the CPU time it takes to encode or decode - the frames. -\end_layout - -\begin_layout Section -Codec -\end_layout - -\begin_layout Standard -The main characteristics of Speex can be summarized as follows: -\end_layout - -\begin_layout Itemize -Free software/open-source -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -open-source -\end_layout - -\end_inset - -, patent -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -patent -\end_layout - -\end_inset - - and royalty-free -\end_layout - -\begin_layout Itemize -Integration of narrowband -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -narrowband -\end_layout - -\end_inset - - and wideband -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -wideband -\end_layout - -\end_inset - - using an embedded bit-stream -\end_layout - -\begin_layout Itemize -Wide range of bit-rates available (from 2.15 kbps to 44 kbps) -\end_layout - -\begin_layout Itemize -Dynamic bit-rate switching (AMR) and Variable Bit-Rate -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -variable bit-rate -\end_layout - -\end_inset - - (VBR) operation -\end_layout - -\begin_layout Itemize -Voice Activity Detection -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -voice activity detection -\end_layout - -\end_inset - - (VAD, integrated with VBR) and discontinuous transmission (DTX) -\end_layout - -\begin_layout Itemize -Variable complexity -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -complexity -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Itemize -Embedded wideband structure (scalable sampling rate) -\end_layout - -\begin_layout Itemize -Ultra-wideband sampling rate at 32 kHz -\end_layout - -\begin_layout Itemize -Intensity stereo encoding option -\end_layout - -\begin_layout Itemize -Fixed-point implementation -\end_layout - -\begin_layout Section -Preprocessor -\end_layout - -\begin_layout Standard -This part refers to the preprocessor module introduced in the 1.1.x branch. - The preprocessor is designed to be used on the audio -\emph on -before -\emph default - running the encoder. - The preprocessor provides three main functionalities: -\end_layout - -\begin_layout Itemize -noise suppression -\end_layout - -\begin_layout Itemize -automatic gain control (AGC) -\end_layout - -\begin_layout Itemize -voice activity detection (VAD) -\end_layout - -\begin_layout Standard -The denoiser can be used to reduce the amount of background noise present - in the input signal. - This provides higher quality speech whether or not the denoised signal - is encoded with Speex (or at all). - However, when using the denoised signal with the codec, there is an additional - benefit. - Speech codecs in general (Speex included) tend to perform poorly on noisy - input, which tends to amplify the noise. - The denoiser greatly reduces this effect. -\end_layout - -\begin_layout Standard -Automatic gain control (AGC) is a feature that deals with the fact that - the recording volume may vary by a large amount between different setups. - The AGC provides a way to adjust a signal to a reference volume. - This is useful for voice over IP because it removes the need for manual - adjustment of the microphone gain. - A secondary advantage is that by setting the microphone gain to a conservative - (low) level, it is easier to avoid clipping. -\end_layout - -\begin_layout Standard -The voice activity detector (VAD) provided by the preprocessor is more advanced - than the one directly provided in the codec. - -\end_layout - -\begin_layout Section -Adaptive Jitter Buffer -\end_layout - -\begin_layout Standard -When transmitting voice (or any content for that matter) over UDP or RTP, - packet may be lost, arrive with different delay, or even out of order. - The purpose of a jitter buffer is to reorder packets and buffer them long - enough (but no longer than necessary) so they can be sent to be decoded. - -\end_layout - -\begin_layout Section -Acoustic Echo Canceller -\end_layout - -\begin_layout Standard -In any hands-free communication system (Fig. - -\begin_inset CommandInset ref -LatexCommand ref -reference "fig:Acoustic-echo-model" - -\end_inset - -), speech from the remote end is played in the local loudspeaker, propagates - in the room and is captured by the microphone. - If the audio captured from the microphone is sent directly to the remote - end, then the remote user hears an echo of his voice. - An acoustic echo canceller is designed to remove the acoustic echo before - it is sent to the remote end. - It is important to understand that the echo canceller is meant to improve - the quality on the -\series bold -remote -\series default - end. - For those who care a lot about mouth-to-ear delays it should be noted that - unlike Speex codec, resampler and preprocessor, this Acoustic Echo Canceller - does not introduce any latency. -\end_layout - -\begin_layout Standard -\begin_inset Float figure -wide false -sideways false -status open - -\begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -begin{center} -\end_layout - -\end_inset - - -\begin_inset Graphics - filename echo_path.eps - width 10cm - -\end_inset - - -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -end{center} -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Plain Layout -\begin_inset Caption - -\begin_layout Plain Layout -Acoustic echo model -\begin_inset CommandInset label -LatexCommand label -name "fig:Acoustic-echo-model" - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Section -Resampler -\end_layout - -\begin_layout Standard -In some cases, it may be useful to convert audio from one sampling rate - to another. - There are many reasons for that. - It can be for mixing streams that have different sampling rates, for supporting - sampling rates that the soundcard doesn't support, for transcoding, etc. - That's why there is now a resampler that is part of the Speex project. - This resampler can be used to convert between any two arbitrary rates (the - ratio must only be a rational number) and there is control over the quality/com -plexity tradeoff. - Keep in mind, that resampler introduce some delay in audio stream, which - size depends on resampler quality setting. - Refer to resampler API documentation to know how to get exact delay values. -\end_layout - -\begin_layout Section -Integration -\end_layout - -\begin_layout Standard -Knowing -\emph on -how -\emph default - to use each of the components is not that useful unless we know -\emph on -where -\emph default - to use them. - Figure -\begin_inset CommandInset ref -LatexCommand ref -reference "fig:Integration-VoIP" - -\end_inset - - shows where each of the components would be used in a typical VoIP client. - Components in dotted lines are optional, though they may be very useful - in some circumstances. - There are several important things to note from there. - The AEC must be placed as close as possible to the playback and capture. - Only the resampling may be closer. - Also, it is very important to use the same clock for both mic capture and - speaker/headphones playback. -\end_layout - -\begin_layout Standard -\begin_inset Float figure -wide false -sideways false -status open - -\begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -begin{center} -\end_layout - -\end_inset - - -\begin_inset Graphics - filename components.eps - width 80text% - -\end_inset - - -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -end{center} -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Plain Layout -\begin_inset Caption - -\begin_layout Plain Layout -Integration of all the components in a VoIP client. -\begin_inset CommandInset label -LatexCommand label -name "fig:Integration-VoIP" - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset Newpage newpage -\end_inset - - -\end_layout - -\begin_layout Chapter -Compiling and Porting -\end_layout - -\begin_layout Standard -Compiling Speex under UNIX/Linux or any other platform supported by autoconf - (e.g. - Win32/cygwin) is as easy as typing: -\end_layout - -\begin_layout LyX-Code -% ./configure [options] -\end_layout - -\begin_layout LyX-Code -% make -\end_layout - -\begin_layout LyX-Code -% make install -\end_layout - -\begin_layout Standard -The options supported by the Speex configure script are: -\end_layout - -\begin_layout Description ---prefix= Specifies the base path for installing Speex (e.g. - /usr) -\end_layout - -\begin_layout Description ---enable-shared/--disable-shared Whether to compile shared libraries -\end_layout - -\begin_layout Description ---enable-static/--disable-static Whether to compile static libraries -\end_layout - -\begin_layout Description ---disable-wideband Disable the wideband part of Speex (typically to save - space) -\end_layout - -\begin_layout Description ---enable-valgrind Enable extra hits for valgrind for debugging purposes - (do not use by default) -\end_layout - -\begin_layout Description ---enable-sse Enable use of SSE instructions (x86/float only) -\end_layout - -\begin_layout Description ---enable-fixed-point -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -fixed-point -\end_layout - -\end_inset - - Compile Speex for a processor that does not have a floating point unit - (FPU) -\end_layout - -\begin_layout Description ---enable-arm4-asm Enable assembly specific to the ARMv4 architecture (gcc - only) -\end_layout - -\begin_layout Description ---enable-arm5e-asm Enable assembly specific to the ARMv5E architecture (gcc - only) -\end_layout - -\begin_layout Description ---enable-fixed-point-debug Use only for debugging the fixed-point -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -fixed-point -\end_layout - -\end_inset - - code (very slow) -\end_layout - -\begin_layout Description ---enable-ti-c55x Enable support for the TI C5x family -\end_layout - -\begin_layout Description ---enable-blackfin-asm Enable assembly specific to the Blackfin DSP architecture - (gcc only) -\end_layout - -\begin_layout Section -Platforms -\end_layout - -\begin_layout Standard -Speex is known to compile and work on a large number of architectures, both - floating-point and fixed-point. - In general, any architecture that can natively compute the multiplication - of two signed 16-bit numbers (32-bit result) and runs at a sufficient clock - rate (architecture-dependent) is capable of running Speex. - Architectures on which Speex is -\series bold -known -\series default - to work (it probably works on many others) are: -\end_layout - -\begin_layout Itemize -x86 & x86-64 -\end_layout - -\begin_layout Itemize -Power -\end_layout - -\begin_layout Itemize -SPARC -\end_layout - -\begin_layout Itemize -ARM -\end_layout - -\begin_layout Itemize -Blackfin -\end_layout - -\begin_layout Itemize -Coldfire (68k family) -\end_layout - -\begin_layout Itemize -TI C54xx & C55xx -\end_layout - -\begin_layout Itemize -TI C6xxx -\end_layout - -\begin_layout Itemize -TriMedia (experimental) -\end_layout - -\begin_layout Standard -Operating systems on top of which Speex is known to work include (it probably - works on many others): -\end_layout - -\begin_layout Itemize -Linux -\end_layout - -\begin_layout Itemize -\begin_inset Formula $\mu$ -\end_inset - -Clinux -\end_layout - -\begin_layout Itemize -MacOS X -\end_layout - -\begin_layout Itemize -BSD -\end_layout - -\begin_layout Itemize -Other UNIX/POSIX variants -\end_layout - -\begin_layout Itemize -Symbian -\end_layout - -\begin_layout Standard -The source code directory include additional information for compiling on - certain architectures or operating systems in README.xxx files. -\end_layout - -\begin_layout Section -Porting and Optimising -\end_layout - -\begin_layout Standard -Here are a few things to consider when porting or optimising Speex for a - new platform or an existing one. -\end_layout - -\begin_layout Subsection -CPU optimisation -\end_layout - -\begin_layout Standard -The single factor that will affect the CPU usage of Speex the most is whether - it is compiled for floating point or fixed-point. - If your CPU/DSP does not have a floating-point unit FPU, then compiling - as fixed-point will be orders of magnitudes faster. - If there is an FPU present, then it is important to test which version - is faster. - On the x86 architecture, floating-point is -\series bold -generally -\series default - faster, but not always. - To compile Speex as fixed-point, you need to pass --fixed-point to the - configure script or define the FIXED_POINT macro for the compiler. - As of 1.2beta3, it is now possible to disable the floating-point compatibility - API, which means that your code can link without a float emulation library. - To do that configure with --disable-float-api or define the DISABLE_FLOAT_API - macro. - Until the VBR feature is ported to fixed-point, you will also need to configure - with --disable-vbr or define DISABLE_VBR. -\end_layout - -\begin_layout Standard -Other important things to check on some DSP architectures are: -\end_layout - -\begin_layout Itemize -Make sure the cache is set to write-back mode -\end_layout - -\begin_layout Itemize -If the chip has SRAM instead of cache, make sure as much code and data are - in SRAM, rather than in RAM -\end_layout - -\begin_layout Standard -If you are going to be writing assembly, then the following functions are - -\series bold -usually -\series default - the first ones you should consider optimising: -\end_layout - -\begin_layout Itemize -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -filter_mem16() -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Itemize -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -iir_mem16() -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Itemize -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -vq_nbest() -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Itemize -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -pitch_xcorr() -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Itemize -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -interp_pitch() -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -The filtering functions -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -filter_mem16() -\end_layout - -\end_inset - - and -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -iir_mem16() -\end_layout - -\end_inset - - are implemented in the direct form II transposed (DF2T). - However, for architectures based on multiply-accumulate (MAC), DF2T requires - frequent reload of the accumulator, which can make the code very slow. - For these architectures (e.g. - Blackfin and Coldfire), a better approach is to implement those functions - as direct form I (DF1), which is easier to express in terms of MAC. - When doing that however, -\series bold -it is important to make sure that the DF1 implementation still behaves like - the original DF2T behaviour when it comes to memory values -\series default -. - This is necessary because the filter is time-varying and must compute exactly - the same value (not counting machine rounding) on any encoder or decoder. -\end_layout - -\begin_layout Subsection -Memory optimisation -\end_layout - -\begin_layout Standard -Memory optimisation is mainly something that should be considered for small - embedded platforms. - For PCs, Speex is already so tiny that it's just not worth doing any of - the things suggested here. - There are several ways to reduce the memory usage of Speex, both in terms - of code size and data size. - For optimising code size, the trick is to first remove features you do - not need. - Some examples of things that can easily be disabled -\series bold -if you don't need them -\series default - are: -\end_layout - -\begin_layout Itemize -Wideband support (--disable-wideband) -\end_layout - -\begin_layout Itemize -Support for stereo (removing stereo.c) -\end_layout - -\begin_layout Itemize -VBR support (--disable-vbr or DISABLE_VBR) -\end_layout - -\begin_layout Itemize -Static codebooks that are not needed for the bit-rates you are using (*_table.c - files) -\end_layout - -\begin_layout Standard -Speex also has several methods for allocating temporary arrays. - When using a compiler that supports C99 properly (as of 2007, Microsoft - compilers don't, but gcc does), it is best to define VAR_ARRAYS. - That makes use of the variable-size array feature of C99. - The next best is to define USE_ALLOCA so that Speex can use alloca() to - allocate the temporary arrays. - Note that on many systems, alloca() is buggy so it may not work. - If none of VAR_ARRAYS and USE_ALLOCA are defined, then Speex falls back - to allocating a large -\begin_inset Quotes eld -\end_inset - -scratch space -\begin_inset Quotes erd -\end_inset - - and doing its own internal allocation. - The main disadvantage of this solution is that it is wasteful. - It needs to allocate enough stack for the worst case scenario (worst bit-rate, - highest complexity setting, ...) and by default, the memory isn't shared between - multiple encoder/decoder states. - Still, if the -\begin_inset Quotes eld -\end_inset - -manual -\begin_inset Quotes erd -\end_inset - - allocation is the only option left, there are a few things that can be - improved. - By overriding the speex_alloc_scratch() call in os_support.h, it is possible - to always return the same memory area for all states -\begin_inset Foot -status collapsed - -\begin_layout Plain Layout -In this case, one must be careful with threads -\end_layout - -\end_inset - -. - In addition to that, by redefining the NB_ENC_STACK and NB_DEC_STACK (or - similar for wideband), it is possible to only allocate memory for a scenario - that is known in advance. - In this case, it is important to measure the amount of memory required - for the specific sampling rate, bit-rate and complexity level being used. -\end_layout - -\begin_layout Standard -\begin_inset Newpage newpage -\end_inset - - -\end_layout - -\begin_layout Chapter -Command-line encoder/decoder -\begin_inset CommandInset label -LatexCommand label -name "sec:Command-line-encoder/decoder" - -\end_inset - - -\end_layout - -\begin_layout Standard -The base Speex distribution includes a command-line encoder ( -\emph on -speexenc -\emph default -) and decoder ( -\emph on -speexdec -\emph default -). - Those tools produce and read Speex files encapsulated in the Ogg container. - Although it is possible to encapsulate Speex in any container, Ogg is the - recommended container for files. - This section describes how to use the command line tools for Speex files - in Ogg. -\end_layout - -\begin_layout Section - -\emph on -speexenc -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -speexenc -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -The -\emph on -speexenc -\emph default - utility is used to create Speex files from raw PCM or wave files. - It can be used by calling: -\end_layout - -\begin_layout LyX-Code -speexenc [options] input_file output_file -\end_layout - -\begin_layout Standard -The value '-' for input_file or output_file corresponds respectively to - stdin and stdout. - The valid options are: -\end_layout - -\begin_layout Description ---narrowband -\begin_inset space ~ -\end_inset - -(-n) Tell Speex to treat the input as narrowband (8 kHz). - This is the default -\end_layout - -\begin_layout Description ---wideband -\begin_inset space ~ -\end_inset - -(-w) Tell Speex to treat the input as wideband (16 kHz) -\end_layout - -\begin_layout Description ---ultra-wideband -\begin_inset space ~ -\end_inset - -(-u) Tell Speex to treat the input as -\begin_inset Quotes eld -\end_inset - -ultra-wideband -\begin_inset Quotes erd -\end_inset - - (32 kHz) -\end_layout - -\begin_layout Description ---quality -\begin_inset space ~ -\end_inset - -n Set the encoding quality (0-10), default is 8 -\end_layout - -\begin_layout Description ---bitrate -\begin_inset space ~ -\end_inset - -n Encoding bit-rate (use bit-rate n or lower) -\end_layout - -\begin_layout Description ---vbr Enable VBR (Variable Bit-Rate), disabled by default -\end_layout - -\begin_layout Description ---abr -\begin_inset space ~ -\end_inset - -n Enable ABR (Average Bit-Rate) at n kbps, disabled by default -\end_layout - -\begin_layout Description ---vad Enable VAD (Voice Activity Detection), disabled by default -\end_layout - -\begin_layout Description ---dtx Enable DTX (Discontinuous Transmission), disabled by default -\end_layout - -\begin_layout Description ---nframes -\begin_inset space ~ -\end_inset - -n Pack n frames in each Ogg packet (this saves space at low bit-rates) -\end_layout - -\begin_layout Description ---comp -\begin_inset space ~ -\end_inset - -n Set encoding speed/quality tradeoff. - The higher the value of n, the slower the encoding (default is 3) -\end_layout - -\begin_layout Description --V Verbose operation, print bit-rate currently in use -\end_layout - -\begin_layout Description ---help -\begin_inset space ~ -\end_inset - -(-h) Print the help -\end_layout - -\begin_layout Description ---version -\begin_inset space ~ -\end_inset - -(-v) Print version information -\end_layout - -\begin_layout Subsection* -Speex comments -\end_layout - -\begin_layout Description ---comment Add the given string as an extra comment. - This may be used multiple times. - -\end_layout - -\begin_layout Description ---author Author of this track. - -\end_layout - -\begin_layout Description ---title Title for this track. - -\end_layout - -\begin_layout Subsection* -Raw input options -\end_layout - -\begin_layout Description ---rate -\begin_inset space ~ -\end_inset - -n Sampling rate for raw input -\end_layout - -\begin_layout Description ---stereo Consider raw input as stereo -\end_layout - -\begin_layout Description ---le Raw input is little-endian -\end_layout - -\begin_layout Description ---be Raw input is big-endian -\end_layout - -\begin_layout Description ---8bit Raw input is 8-bit unsigned -\end_layout - -\begin_layout Description ---16bit Raw input is 16-bit signed -\end_layout - -\begin_layout Section - -\emph on -speexdec -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -speexdec -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -The -\emph on -speexdec -\emph default - utility is used to decode Speex files and can be used by calling: -\end_layout - -\begin_layout LyX-Code -speexdec [options] speex_file [output_file] -\end_layout - -\begin_layout Standard -The value '-' for input_file or output_file corresponds respectively to - stdin and stdout. - Also, when no output_file is specified, the file is played to the soundcard. - The valid options are: -\end_layout - -\begin_layout Description ---enh enable post-filter (default) -\end_layout - -\begin_layout Description ---no-enh disable post-filter -\end_layout - -\begin_layout Description ---force-nb Force decoding in narrowband -\end_layout - -\begin_layout Description ---force-wb Force decoding in wideband -\end_layout - -\begin_layout Description ---force-uwb Force decoding in ultra-wideband -\end_layout - -\begin_layout Description ---mono Force decoding in mono -\end_layout - -\begin_layout Description ---stereo Force decoding in stereo -\end_layout - -\begin_layout Description ---rate -\begin_inset space ~ -\end_inset - -n Force decoding at n Hz sampling rate -\end_layout - -\begin_layout Description ---packet-loss -\begin_inset space ~ -\end_inset - -n Simulate n % random packet loss -\end_layout - -\begin_layout Description --V Verbose operation, print bit-rate currently in use -\end_layout - -\begin_layout Description ---help -\begin_inset space ~ -\end_inset - -(-h) Print the help -\end_layout - -\begin_layout Description ---version -\begin_inset space ~ -\end_inset - -(-v) Print version information -\end_layout - -\begin_layout Standard -\begin_inset Newpage newpage -\end_inset - - -\end_layout - -\begin_layout Chapter -Using the Speex Codec API ( -\emph on -libspeex -\emph default - -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -libspeex -\end_layout - -\end_inset - -) -\begin_inset CommandInset label -LatexCommand label -name "sec:Programming-with-Speex" - -\end_inset - - -\end_layout - -\begin_layout Standard -The -\emph on -libspeex -\emph default - library contains all the functions for encoding and decoding speech with - the Speex codec. - When linking on a UNIX system, one must add -\emph on --lspeex -lm -\emph default - to the compiler command line. - One important thing to know is that -\series bold -libspeex calls are reentrant, but not thread-safe -\series default -. - That means that it is fine to use calls from many threads, but -\series bold -calls using the same state from multiple threads must be protected by mutexes -\series default -. - Examples of code can also be found in Appendix -\begin_inset CommandInset ref -LatexCommand ref -reference "sec:Sample-code" - -\end_inset - - and the complete API documentation is included in the Documentation section - of the Speex website (http://www.speex.org/). -\end_layout - -\begin_layout Section -Encoding -\begin_inset CommandInset label -LatexCommand label -name "sub:Encoding" - -\end_inset - - -\end_layout - -\begin_layout Standard -In order to encode speech using Speex, one first needs to: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -#include -\end_layout - -\end_inset - -Then in the code, a Speex bit-packing struct must be declared, along with - a Speex encoder state: -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -SpeexBits bits; -\end_layout - -\begin_layout Plain Layout - -void *enc_state; -\end_layout - -\end_inset - -The two are initialized by: -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_bits_init(&bits); -\end_layout - -\begin_layout Plain Layout - -enc_state = speex_encoder_init(&speex_nb_mode); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -For wideband coding, -\emph on -speex_nb_mode -\emph default - will be replaced by -\emph on -speex_wb_mode -\emph default -. - In most cases, you will need to know the frame size used at the sampling - rate you are using. - You can get that value in the -\emph on -frame_size -\emph default - variable (expressed in -\series bold -samples -\series default -, not bytes) with: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_encoder_ctl(enc_state,SPEEX_GET_FRAME_SIZE,&frame_size); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -In practice, -\emph on -frame_size -\emph default - will correspond to 20 ms when using 8, 16, or 32 kHz sampling rate. - There are many parameters that can be set for the Speex encoder, but the - most useful one is the quality parameter that controls the quality vs bit-rate - tradeoff. - This is set by: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_encoder_ctl(enc_state,SPEEX_SET_QUALITY,&quality); -\end_layout - -\end_inset - -where -\emph on -quality -\emph default - is an integer value ranging from 0 to 10 (inclusively). - The mapping between quality and bit-rate is described in Fig. - -\begin_inset CommandInset ref -LatexCommand ref -reference "cap:quality_vs_bps" - -\end_inset - - for narrowband. -\end_layout - -\begin_layout Standard -Once the initialization is done, for every input frame: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_bits_reset(&bits); -\end_layout - -\begin_layout Plain Layout - -speex_encode_int(enc_state, input_frame, &bits); -\end_layout - -\begin_layout Plain Layout - -nbBytes = speex_bits_write(&bits, byte_ptr, MAX_NB_BYTES); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -where -\emph on -input_frame -\emph default - is a -\emph on -( -\emph default -short -\emph on -*) -\emph default - pointing to the beginning of a speech frame, -\emph on -byte_ptr -\emph default - is a -\emph on -(char *) -\emph default - where the encoded frame will be written, -\emph on -MAX_NB_BYTES -\emph default - is the maximum number of bytes that can be written to -\emph on -byte_ptr -\emph default - without causing an overflow and -\emph on -nbBytes -\emph default - is the number of bytes actually written to -\emph on -byte_ptr -\emph default - (the encoded size in bytes). - Before calling speex_bits_write, it is possible to find the number of bytes - that need to be written by calling -\family typewriter -speex_bits_nbytes(&bits) -\family default -, which returns a number of bytes. -\end_layout - -\begin_layout Standard -It is still possible to use the -\emph on -speex_encode() -\emph default - function, which takes a -\emph on -(float *) -\emph default - for the audio. - However, this would make an eventual port to an FPU-less platform (like - ARM) more complicated. - Internally, -\emph on -speex_encode() -\emph default - and -\emph on -speex_encode_int() -\emph default - are processed in the same way. - Whether the encoder uses the fixed-point version is only decided by the - compile-time flags, not at the API level. -\end_layout - -\begin_layout Standard -After you're done with the encoding, free all resources with: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_bits_destroy(&bits); -\end_layout - -\begin_layout Plain Layout - -speex_encoder_destroy(enc_state); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -That's about it for the encoder. - -\end_layout - -\begin_layout Section -Decoding -\begin_inset CommandInset label -LatexCommand label -name "sub:Decoding" - -\end_inset - - -\end_layout - -\begin_layout Standard -In order to decode speech using Speex, you first need to: -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -#include -\end_layout - -\end_inset - -You also need to declare a Speex bit-packing struct -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -SpeexBits bits; -\end_layout - -\end_inset - -and a Speex decoder state -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -void *dec_state; -\end_layout - -\end_inset - -The two are initialized by: -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_bits_init(&bits); -\end_layout - -\begin_layout Plain Layout - -dec_state = speex_decoder_init(&speex_nb_mode); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -For wideband decoding, -\emph on -speex_nb_mode -\emph default - will be replaced by -\emph on -speex_wb_mode -\emph default -. - If you need to obtain the size of the frames that will be used by the decoder, - you can get that value in the -\emph on -frame_size -\emph default - variable (expressed in -\series bold -samples -\series default -, not bytes) with: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_decoder_ctl(dec_state, SPEEX_GET_FRAME_SIZE, &frame_size); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -There is also a parameter that can be set for the decoder: whether or not - to use a perceptual enhancer. - This can be set by: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_decoder_ctl(dec_state, SPEEX_SET_ENH, &enh); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -where -\emph on -enh -\emph default - is an int with value 0 to have the enhancer disabled and 1 to have it enabled. - As of 1.2-beta1, the default is now to enable the enhancer. -\end_layout - -\begin_layout Standard -Again, once the decoder initialization is done, for every input frame: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_bits_read_from(&bits, input_bytes, nbBytes); -\end_layout - -\begin_layout Plain Layout - -speex_decode_int(dec_state, &bits, output_frame); -\end_layout - -\end_inset - -where input_bytes is a -\emph on -(char *) -\emph default - containing the bit-stream data received for a frame, -\emph on -nbBytes -\emph default - is the size (in bytes) of that bit-stream, and -\emph on -output_frame -\emph default - is a -\emph on -(short *) -\emph default - and points to the area where the decoded speech frame will be written. - A NULL value as the second argument indicates that we don't have the bits - for the current frame. - When a frame is lost, the Speex decoder will do its best to "guess" the - correct signal. -\end_layout - -\begin_layout Standard -As for the encoder, the -\emph on -speex_decode() -\emph default - function can still be used, with a -\emph on -(float *) -\emph default - as the output for the audio. - After you're done with the decoding, free all resources with: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_bits_destroy(&bits); -\end_layout - -\begin_layout Plain Layout - -speex_decoder_destroy(dec_state); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Section -Codec Options (speex_*_ctl) -\begin_inset CommandInset label -LatexCommand label -name "sub:Codec-Options" - -\end_inset - - -\end_layout - -\begin_layout Quote -\align center - -\emph on -Entities should not be multiplied beyond necessity -- William of Ockham. -\end_layout - -\begin_layout Quote -\align center - -\emph on -Just because there's an option for it doesn't mean you have to turn it on - -- me. -\end_layout - -\begin_layout Standard -The Speex encoder and decoder support many options and requests that can - be accessed through the -\emph on -speex_encoder_ctl -\emph default - and -\emph on -speex_decoder_ctl -\emph default - functions. - These functions are similar to the -\emph on -ioctl -\emph default - system call and their prototypes are: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -void speex_encoder_ctl(void *encoder, int request, void *ptr); -\end_layout - -\begin_layout Plain Layout - -void speex_decoder_ctl(void *encoder, int request, void *ptr); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -Despite those functions, the defaults are usually good for many applications - and -\series bold -optional settings should only be used when one understands them and knows - that they are needed -\series default -. - A common error is to attempt to set many unnecessary settings. - -\end_layout - -\begin_layout Standard -Here is a list of the values allowed for the requests. - Some only apply to the encoder or the decoder. - Because the last argument is of type -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -void * -\end_layout - -\end_inset - -, the -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -_ctl() -\end_layout - -\end_inset - - functions are -\series bold -not type safe -\series default -, and should thus be used with care. - The type -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - - is the same as the C99 -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -int32_t -\end_layout - -\end_inset - - type. -\end_layout - -\begin_layout Description -SPEEX_SET_ENH -\begin_inset Formula $\ddagger$ -\end_inset - - Set perceptual enhancer -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -perceptual enhancement -\end_layout - -\end_inset - - to on (1) or off (0) ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -, default is on) -\end_layout - -\begin_layout Description -SPEEX_GET_ENH -\begin_inset Formula $\ddagger$ -\end_inset - - Get perceptual enhancer status ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_GET_FRAME_SIZE Get the number of samples per frame for the current - mode ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_SET_QUALITY -\begin_inset Formula $\dagger$ -\end_inset - - Set the encoder speech quality ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - - from 0 to 10, default is 8) -\end_layout - -\begin_layout Description -SPEEX_GET_QUALITY -\begin_inset Formula $\dagger$ -\end_inset - - Get the current encoder speech quality ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - - from 0 to 10) -\end_layout - -\begin_layout Description -SPEEX_SET_MODE -\begin_inset Formula $\dagger$ -\end_inset - - Set the mode number, as specified in the RTP spec ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_GET_MODE -\begin_inset Formula $\dagger$ -\end_inset - - Get the current mode number, as specified in the RTP spec ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_SET_VBR -\begin_inset Formula $\dagger$ -\end_inset - - Set variable bit-rate (VBR) to on (1) or off (0) ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -, default is off) -\end_layout - -\begin_layout Description -SPEEX_GET_VBR -\begin_inset Formula $\dagger$ -\end_inset - - Get variable bit-rate -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -variable bit-rate -\end_layout - -\end_inset - - (VBR) status ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_SET_VBR_QUALITY -\begin_inset Formula $\dagger$ -\end_inset - - Set the encoder VBR speech quality (float 0.0 to 10.0, default is 8.0) -\end_layout - -\begin_layout Description -SPEEX_GET_VBR_QUALITY -\begin_inset Formula $\dagger$ -\end_inset - - Get the current encoder VBR speech quality (float 0 to 10) -\end_layout - -\begin_layout Description -SPEEX_SET_COMPLEXITY -\begin_inset Formula $\dagger$ -\end_inset - - Set the CPU resources allowed for the encoder ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - - from 1 to 10, default is 2) -\end_layout - -\begin_layout Description -SPEEX_GET_COMPLEXITY -\begin_inset Formula $\dagger$ -\end_inset - - Get the CPU resources allowed for the encoder ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - - from 1 to 10, default is 2) -\end_layout - -\begin_layout Description -SPEEX_SET_BITRATE -\begin_inset Formula $\dagger$ -\end_inset - - Set the bit-rate to use the closest value not exceeding the parameter ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - - in bits per second) -\end_layout - -\begin_layout Description -SPEEX_GET_BITRATE Get the current bit-rate in use ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - - in bits per second) -\end_layout - -\begin_layout Description -SPEEX_SET_SAMPLING_RATE Set real sampling rate ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - - in Hz) -\end_layout - -\begin_layout Description -SPEEX_GET_SAMPLING_RATE Get real sampling rate ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - - in Hz) -\end_layout - -\begin_layout Description -SPEEX_RESET_STATE Reset the encoder/decoder state to its original state, - clearing all memories (no argument) -\end_layout - -\begin_layout Description -SPEEX_SET_VAD -\begin_inset Formula $\dagger$ -\end_inset - - Set voice activity detection -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -voice activity detection -\end_layout - -\end_inset - - (VAD) to on (1) or off (0) ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -, default is off) -\end_layout - -\begin_layout Description -SPEEX_GET_VAD -\begin_inset Formula $\dagger$ -\end_inset - - Get voice activity detection (VAD) status ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_SET_DTX -\begin_inset Formula $\dagger$ -\end_inset - - Set discontinuous transmission -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -discontinuous transmission -\end_layout - -\end_inset - - (DTX) to on (1) or off (0) ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -, default is off) -\end_layout - -\begin_layout Description -SPEEX_GET_DTX -\begin_inset Formula $\dagger$ -\end_inset - - Get discontinuous transmission (DTX) status ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_SET_ABR -\begin_inset Formula $\dagger$ -\end_inset - - Set average bit-rate -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -average bit-rate -\end_layout - -\end_inset - - (ABR) to a value n in bits per second ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - - in bits per second) -\end_layout - -\begin_layout Description -SPEEX_GET_ABR -\begin_inset Formula $\dagger$ -\end_inset - - Get average bit-rate (ABR) setting ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - - in bits per second) -\end_layout - -\begin_layout Description -SPEEX_SET_PLC_TUNING -\begin_inset Formula $\dagger$ -\end_inset - - Tell the encoder to optimize encoding for a certain percentage of packet - loss ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - - in percent) -\end_layout - -\begin_layout Description -SPEEX_GET_PLC_TUNING -\begin_inset Formula $\dagger$ -\end_inset - - Get the current tuning of the encoder for PLC ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - - in percent) -\end_layout - -\begin_layout Description -SPEEX_GET_LOOKAHEAD Returns the lookahead used by Speex separately for an - encoder and a decoder. - Sum encoder and decoder lookahead values to get the total codec lookahead. -\end_layout - -\begin_layout Description -SPEEX_SET_VBR_MAX_BITRATE -\begin_inset Formula $\dagger$ -\end_inset - - Set the maximum bit-rate allowed in VBR operation ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - - in bits per second) -\end_layout - -\begin_layout Description -SPEEX_GET_VBR_MAX_BITRATE -\begin_inset Formula $\dagger$ -\end_inset - - Get the current maximum bit-rate allowed in VBR operation ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - - in bits per second) -\end_layout - -\begin_layout Description -SPEEX_SET_HIGHPASS Set the high-pass filter on (1) or off (0) ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -, default is on) -\end_layout - -\begin_layout Description -SPEEX_GET_HIGHPASS Get the current high-pass filter status ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -\begin_inset Formula $\dagger$ -\end_inset - - applies only to the encoder -\end_layout - -\begin_layout Description -\begin_inset Formula $\ddagger$ -\end_inset - - applies only to the decoder -\end_layout - -\begin_layout Section -Mode queries -\begin_inset CommandInset label -LatexCommand label -name "sub:Mode-queries" - -\end_inset - - -\end_layout - -\begin_layout Standard -Speex modes have a query system similar to the speex_encoder_ctl and speex_decod -er_ctl calls. - Since modes are read-only, it is only possible to get information about - a particular mode. - The function used to do that is: -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -void speex_mode_query(SpeexMode *mode, int request, void *ptr); -\end_layout - -\end_inset - -The admissible values for request are (unless otherwise note, the values - are returned through -\emph on -ptr -\emph default -): -\end_layout - -\begin_layout Description -SPEEX_MODE_FRAME_SIZE Get the frame size (in samples) for the mode -\end_layout - -\begin_layout Description -SPEEX_SUBMODE_BITRATE Get the bit-rate for a submode number specified through - -\emph on -ptr -\emph default - (integer in bps). - -\end_layout - -\begin_layout Section -Packing and in-band signalling -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -in-band signalling -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -Sometimes it is desirable to pack more than one frame per packet (or other - basic unit of storage). - The proper way to do it is to call speex_encode -\begin_inset Formula $N$ -\end_inset - - times before writing the stream with speex_bits_write. - In cases where the number of frames is not determined by an out-of-band - mechanism, it is possible to include a terminator code. - That terminator consists of the code 15 (decimal) encoded with 5 bits, - as shown in Table -\begin_inset CommandInset ref -LatexCommand ref -reference "cap:quality_vs_bps" - -\end_inset - -. - Note that as of version 1.0.2, calling speex_bits_write automatically inserts - the terminator so as to fill the last byte. - This doesn't involves any overhead and makes sure Speex can always detect - when there is no more frame in a packet. -\end_layout - -\begin_layout Standard -It is also possible to send in-band -\begin_inset Quotes eld -\end_inset - -messages -\begin_inset Quotes erd -\end_inset - - to the other side. - All these messages are encoded as -\begin_inset Quotes eld -\end_inset - -pseudo-frames -\begin_inset Quotes erd -\end_inset - - of mode 14 which contain a 4-bit message type code, followed by the message. - Table -\begin_inset CommandInset ref -LatexCommand ref -reference "cap:In-band-signalling-codes" - -\end_inset - - lists the available codes, their meaning and the size of the message that - follows. - Most of these messages are requests that are sent to the encoder or decoder - on the other end, which is free to comply or ignore them. - By default, all in-band messages are ignored. -\end_layout - -\begin_layout Standard -\begin_inset Float table -placement htbp -wide false -sideways false -status open - -\begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -begin{center} -\end_layout - -\end_inset - - -\begin_inset Tabular - - - - - - - -\begin_inset Text - -\begin_layout Plain Layout -Code -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Size (bits) -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Content -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Asks decoder to set perceptual enhancement off (0) or on(1) -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Asks (if 1) the encoder to be less -\begin_inset Quotes eld -\end_inset - -aggressive -\begin_inset Quotes erd -\end_inset - - due to high packet loss -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -2 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Asks encoder to switch to mode N -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -3 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Asks encoder to switch to mode N for low-band -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Asks encoder to switch to mode N for high-band -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Asks encoder to switch to quality N for VBR -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -6 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Request acknowledge (0=no, 1=all, 2=only for in-band data) -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -7 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Asks encoder to set CBR (0), VAD(1), DTX(3), VBR(5), VBR+DTX(7) -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -8 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -8 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Transmit (8-bit) character to the other end -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -9 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -8 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Intensity stereo information -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -10 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -16 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Announce maximum bit-rate acceptable (N in bytes/second) -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -11 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -16 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -reserved -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -12 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -32 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Acknowledge receiving packet N -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -13 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -32 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -reserved -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -14 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -64 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -reserved -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -15 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -64 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -reserved -\end_layout - -\end_inset - - - - -\end_inset - - -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -end{center} -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Plain Layout -\begin_inset Caption - -\begin_layout Plain Layout -In-band signalling codes -\begin_inset CommandInset label -LatexCommand label -name "cap:In-band-signalling-codes" - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -Finally, applications may define custom in-band messages using mode 13. - The size of the message in bytes is encoded with 5 bits, so that the decoder - can skip it if it doesn't know how to interpret it. -\begin_inset Newpage newpage -\end_inset - - -\end_layout - -\begin_layout Chapter -Speech Processing API ( -\emph on -libspeexdsp -\emph default -) -\end_layout - -\begin_layout Standard -As of version 1.2beta3, the non-codec parts of the Speex package are now - in a separate library called -\emph on -libspeexdsp -\emph default -. - This library includes the preprocessor, the acoustic echo canceller, the - jitter buffer, and the resampler. - In a UNIX environment, it can be linked into a program by adding -\emph on --lspeexdsp -lm -\emph default - to the compiler command line. - Just like for libspeex, -\series bold -libspeexdsp calls are reentrant, but not thread-safe -\series default -. - That means that it is fine to use calls from many threads, but -\series bold -calls using the same state from multiple threads must be protected by mutexes -\series default -. -\end_layout - -\begin_layout Section -Preprocessor -\begin_inset CommandInset label -LatexCommand label -name "sub:Preprocessor" - -\end_inset - - -\end_layout - -\begin_layout Standard -\noindent -In order to use the Speex preprocessor -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -preprocessor -\end_layout - -\end_inset - -, you first need to: -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -#include -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -\noindent -Then, a preprocessor state can be created as: -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -SpeexPreprocessState *preprocess_state = speex_preprocess_state_init(frame_size, - sampling_rate); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -\noindent -and it is recommended to use the same value for -\family typewriter -frame_size -\family default - as is used by the encoder (20 -\emph on -ms -\emph default -). -\end_layout - -\begin_layout Standard -For each input frame, you need to call: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_preprocess_run(preprocess_state, audio_frame); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -\noindent -where -\family typewriter -audio_frame -\family default - is used both as input and output. - In cases where the output audio is not useful for a certain frame, it is - possible to use instead: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_preprocess_estimate_update(preprocess_state, audio_frame); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -\noindent -This call will update all the preprocessor internal state variables without - computing the output audio, thus saving some CPU cycles. -\end_layout - -\begin_layout Standard -The behaviour of the preprocessor can be changed using: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_preprocess_ctl(preprocess_state, request, ptr); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -\noindent -which is used in the same way as the encoder and decoder equivalent. - Options are listed in Section -\begin_inset CommandInset ref -LatexCommand ref -reference "sub:Preprocessor-options" - -\end_inset - -. -\end_layout - -\begin_layout Standard -The preprocessor state can be destroyed using: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_preprocess_state_destroy(preprocess_state); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsection -Preprocessor options -\begin_inset CommandInset label -LatexCommand label -name "sub:Preprocessor-options" - -\end_inset - - -\end_layout - -\begin_layout Standard -As with the codec, the preprocessor also has options that can be controlled - using an ioctl()-like call. - The available options are: -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_SET_DENOISE Turns denoising on(1) or off(0) ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_GET_DENOISE Get denoising status ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_SET_AGC Turns automatic gain control (AGC) on(1) or off(0) - ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_GET_AGC Get AGC status ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_SET_VAD Turns voice activity detector (VAD) on(1) or off(0) - ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_GET_VAD Get VAD status ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_SET_AGC_LEVEL -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_GET_AGC_LEVEL -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_SET_DEREVERB Turns reverberation removal on(1) or off(0) - ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_GET_DEREVERB Get reverberation removal status ( -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_SET_DEREVERB_LEVEL Not working yet, do not use -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_GET_DEREVERB_LEVEL Not working yet, do not use -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_SET_DEREVERB_DECAY Not working yet, do not use -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_GET_DEREVERB_DECAY Not working yet, do not use -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_SET_PROB_START -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_GET_PROB_START -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_SET_PROB_CONTINUE -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_GET_PROB_CONTINUE -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_SET_NOISE_SUPPRESS Set maximum attenuation of the noise - in dB (negative -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_GET_NOISE_SUPPRESS Get maximum attenuation of the noise - in dB (negative -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_SET_ECHO_SUPPRESS Set maximum attenuation of the residual - echo in dB (negative -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_GET_ECHO_SUPPRESS Get maximum attenuation of the residual - echo in dB (negative -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_SET_ECHO_SUPPRESS_ACTIVE Set maximum attenuation of the - echo in dB when near end is active (negative -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE Get maximum attenuation of the - echo in dB when near end is active (negative -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -spx_int32_t -\end_layout - -\end_inset - -) -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_SET_ECHO_STATE Set the associated echo canceller for residual - echo suppression (pointer or NULL for no residual echo suppression) -\end_layout - -\begin_layout Description -SPEEX_PREPROCESS_GET_ECHO_STATE Get the associated echo canceller (pointer) -\end_layout - -\begin_layout Section -Echo Cancellation -\begin_inset CommandInset label -LatexCommand label -name "sub:Echo-Cancellation" - -\end_inset - - -\end_layout - -\begin_layout Standard -The Speex library now includes an echo cancellation -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -echo cancellation -\end_layout - -\end_inset - - algorithm suitable for Acoustic Echo Cancellation -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -acoustic echo cancellation -\end_layout - -\end_inset - - (AEC). - In order to use the echo canceller, you first need to -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -#include -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -Then, an echo canceller state can be created by: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -SpeexEchoState *echo_state = speex_echo_state_init(frame_size, filter_length); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -where -\family typewriter -frame_size -\family default - is the amount of data (in samples) you want to process at once and -\family typewriter -filter_length -\family default - is the length (in samples) of the echo cancelling filter you want to use - (also known as -\shape italic -tail length -\shape default - -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -tail length -\end_layout - -\end_inset - -). - It is recommended to use a frame size in the order of 20 ms (or equal to - the codec frame size) and make sure it is easy to perform an FFT of that - size (powers of two are better than prime sizes). - The recommended tail length is approximately the third of the room reverberatio -n time. - For example, in a small room, reverberation time is in the order of 300 - ms, so a tail length of 100 ms is a good choice (800 samples at 8000 Hz - sampling rate). -\end_layout - -\begin_layout Standard -Once the echo canceller state is created, audio can be processed by: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_echo_cancellation(echo_state, input_frame, echo_frame, output_frame); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -where -\family typewriter -input_frame -\family default - is the audio as captured by the microphone, -\family typewriter -echo_frame -\family default - is the signal that was played in the speaker (and needs to be removed) - and -\family typewriter -output_frame -\family default - is the signal with echo removed. - -\end_layout - -\begin_layout Standard -One important thing to keep in mind is the relationship between -\family typewriter -input_frame -\family default - and -\family typewriter -echo_frame -\family default -. - It is important that, at any time, any echo that is present in the input - has already been sent to the echo canceller as -\family typewriter -echo_frame -\family default -. - In other words, the echo canceller cannot remove a signal that it hasn't - yet received. - On the other hand, the delay between the input signal and the echo signal - must be small enough because otherwise part of the echo cancellation filter - is inefficient. - In the ideal case, you code would look like: -\begin_inset listings -lstparams "breaklines=true" -inline false -status open - -\begin_layout Plain Layout - -write_to_soundcard(echo_frame, frame_size); -\end_layout - -\begin_layout Plain Layout - -read_from_soundcard(input_frame, frame_size); -\end_layout - -\begin_layout Plain Layout - -speex_echo_cancellation(echo_state, input_frame, echo_frame, output_frame); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -If you wish to further reduce the echo present in the signal, you can do - so by associating the echo canceller to the preprocessor (see Section -\begin_inset CommandInset ref -LatexCommand ref -reference "sub:Preprocessor" - -\end_inset - -). - This is done by calling: -\begin_inset listings -lstparams "breaklines=true" -inline false -status open - -\begin_layout Plain Layout - -speex_preprocess_ctl(preprocess_state, SPEEX_PREPROCESS_SET_ECHO_STATE,echo_stat -e); -\end_layout - -\end_inset - -in the initialisation. -\end_layout - -\begin_layout Standard -As of version 1.2-beta2, there is an alternative, simpler API that can be - used instead of -\emph on -speex_echo_cancellation() -\emph default -. - When audio capture and playback are handled asynchronously (e.g. - in different threads or using the -\emph on -poll() -\emph default - or -\emph on -select() -\emph default - system call), it can be difficult to keep track of what input_frame comes - with what echo_frame. - Instead, the playback context/thread can simply call: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_echo_playback(echo_state, echo_frame); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -every time an audio frame is played. - Then, the capture context/thread calls: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_echo_capture(echo_state, input_frame, output_frame); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -for every frame captured. - Internally, -\emph on -speex_echo_playback() -\emph default - simply buffers the playback frame so it can be used by -\emph on -speex_echo_capture() -\emph default - to call -\emph on -speex_echo_cancel() -\emph default -. - A side effect of using this alternate API is that the playback audio is - delayed by two frames, which is the normal delay caused by the soundcard. - When capture and playback are already synchronised, -\emph on -speex_echo_cancellation() -\emph default - is preferable since it gives better control on the exact input/echo timing. -\end_layout - -\begin_layout Standard -The echo cancellation state can be destroyed with: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_echo_state_destroy(echo_state); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -It is also possible to reset the state of the echo canceller so it can be - reused without the need to create another state with: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -speex_echo_state_reset(echo_state); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsection -Troubleshooting -\end_layout - -\begin_layout Standard -There are several things that may prevent the echo canceller from working - properly. - One of them is a bug (or something suboptimal) in the code, but there are - many others you should consider first -\end_layout - -\begin_layout Itemize -Using a different soundcard to do the capture and plaback will -\series bold -not -\series default - work, regardless of what you may think. - The only exception to that is if the two cards can be made to have their - sampling clock -\begin_inset Quotes eld -\end_inset - -locked -\begin_inset Quotes erd -\end_inset - - on the same clock source. - If not, the clocks will always have a small amount of drift, which will - prevent the echo canceller from adapting. -\end_layout - -\begin_layout Itemize -The delay between the record and playback signals must be minimal. - Any signal played has to -\begin_inset Quotes eld -\end_inset - -appear -\begin_inset Quotes erd -\end_inset - - on the playback (far end) signal slightly before the echo canceller -\begin_inset Quotes eld -\end_inset - -sees -\begin_inset Quotes erd -\end_inset - - it in the near end signal, but excessive delay means that part of the filter - length is wasted. - In the worst situations, the delay is such that it is longer than the filter - length, in which case, no echo can be cancelled. -\end_layout - -\begin_layout Itemize -When it comes to echo tail length (filter length), longer is -\series bold -not -\series default - better. - Actually, the longer the tail length, the longer it takes for the filter - to adapt. - Of course, a tail length that is too short will not cancel enough echo, - but the most common problem seen is that people set a very long tail length - and then wonder why no echo is being cancelled. -\end_layout - -\begin_layout Itemize -Non-linear distortion cannot (by definition) be modeled by the linear adaptive - filter used in the echo canceller and thus cannot be cancelled. - Use good audio gear and avoid saturation/clipping. -\end_layout - -\begin_layout Standard -Also useful is reading -\emph on -Echo Cancellation Demystified -\emph default - by Alexey Frunze -\begin_inset Foot -status collapsed - -\begin_layout Plain Layout -http://www.embeddedstar.com/articles/2003/7/article20030720-1.html -\end_layout - -\end_inset - -, which explains the fundamental principles of echo cancellation. - The details of the algorithm described in the article are different, but - the general ideas of echo cancellation through adaptive filters are the - same. -\end_layout - -\begin_layout Standard -As of version 1.2beta2, a new -\family typewriter -echo_diagnostic.m -\family default - tool is included in the source distribution. - The first step is to define DUMP_ECHO_CANCEL_DATA during the build. - This causes the echo canceller to automatically save the near-end, far-end - and output signals to files (aec_rec.sw aec_play.sw and aec_out.sw). - These are exactly what the AEC receives and outputs. - From there, it is necessary to start Octave and type: -\end_layout - -\begin_layout Standard -\begin_inset listings -lstparams "language=Matlab" -inline false -status open - -\begin_layout Plain Layout - -echo_diagnostic('aec_rec.sw', 'aec_play.sw', 'aec_diagnostic.sw', 1024); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -The value of 1024 is the filter length and can be changed. - There will be some (hopefully) useful messages printed and echo cancelled - audio will be saved to aec_diagnostic.sw . - If even that output is bad (almost no cancellation) then there is probably - problem with the playback or recording process. -\end_layout - -\begin_layout Section -Jitter Buffer -\end_layout - -\begin_layout Standard -The jitter buffer can be enabled by including: -\begin_inset listings -lstparams "breaklines=true" -inline false -status open - -\begin_layout Plain Layout - -#include -\end_layout - -\end_inset - - and a new jitter buffer state can be initialised by: -\end_layout - -\begin_layout Standard -\begin_inset listings -lstparams "breaklines=true" -inline false -status open - -\begin_layout Plain Layout - -JitterBuffer *state = jitter_buffer_init(step); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -where the -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -step -\end_layout - -\end_inset - - argument is the default time step (in timestamp units) used for adjusting - the delay and doing concealment. - A value of 1 is always correct, but higher values may be more convenient - sometimes. - For example, if you are only able to do concealment on 20ms frames, there - is no point in the jitter buffer asking you to do it on one sample. - Another example is that for video, it makes no sense to adjust the delay - by less than a full frame. - The value provided can always be changed at a later time. -\end_layout - -\begin_layout Standard -The jitter buffer API is based on the -\begin_inset listings -inline true -status open - -\begin_layout Plain Layout - -JitterBufferPacket -\end_layout - -\end_inset - - type, which is defined as: -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -typedef struct { -\end_layout - -\begin_layout Plain Layout - - char *data; /* Data bytes contained in the packet */ -\end_layout - -\begin_layout Plain Layout - - spx_uint32_t len; /* Length of the packet in bytes */ -\end_layout - -\begin_layout Plain Layout - - spx_uint32_t timestamp; /* Timestamp for the packet */ -\end_layout - -\begin_layout Plain Layout - - spx_uint32_t span; /* Time covered by the packet (timestamp units) - */ -\end_layout - -\begin_layout Plain Layout - -} JitterBufferPacket; -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -As an example, for audio the timestamp field would be what is obtained from - the RTP timestamp field and the span would be the number of samples that - are encoded in the packet. - For Speex narrowband, span would be 160 if only one frame is included in - the packet. - -\end_layout - -\begin_layout Standard -When a packet arrives, it need to be inserter into the jitter buffer by: -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -JitterBufferPacket packet; -\end_layout - -\begin_layout Plain Layout - -/* Fill in each field in the packet struct */ -\end_layout - -\begin_layout Plain Layout - -jitter_buffer_put(state, &packet); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -When the decoder is ready to decode a packet the packet to be decoded can - be obtained by: -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -int start_offset; -\end_layout - -\begin_layout Plain Layout - -err = jitter_buffer_get(state, &packet, desired_span, &start_offset); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -If -\begin_inset listings -inline true -status open - -\begin_layout Plain Layout - -jitter_buffer_put() -\end_layout - -\end_inset - - and -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -jitter_buffer_get() -\end_layout - -\end_inset - - are called from different threads, then -\series bold -you need to protect the jitter buffer state with a mutex -\series default -. - -\end_layout - -\begin_layout Standard -Because the jitter buffer is designed not to use an explicit timer, it needs - to be told about the time explicitly. - This is done by calling: -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -jitter_buffer_tick(state); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -This needs to be done periodically in the playing thread. - This will be the last jitter buffer call before going to sleep (until more - data is played back). - In some cases, it may be preferable to use -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -jitter_buffer_remaining_span(state, remaining); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -The second argument is used to specify that we are still holding data that - has not been written to the playback device. - For instance, if 256 samples were needed by the soundcard (specified by - -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -desired_span -\end_layout - -\end_inset - -), but -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -jitter_buffer_get() -\end_layout - -\end_inset - - returned 320 samples, we would have -\begin_inset listings -inline true -status open - -\begin_layout Plain Layout - -remaining=64 -\end_layout - -\end_inset - -. -\end_layout - -\begin_layout Section -Resampler -\end_layout - -\begin_layout Standard -Speex includes a resampling modules. - To make use of the resampler, it is necessary to include its header file: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -#include -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -For each stream that is to be resampled, it is necessary to create a resampler - state with: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -SpeexResamplerState *resampler; -\end_layout - -\begin_layout Plain Layout - -resampler = speex_resampler_init(nb_channels, input_rate, output_rate, quality, - &err); -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -where -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -nb_channels -\end_layout - -\end_inset - - is the number of channels that will be used (either interleaved or non-interlea -ved), -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -input_rate -\end_layout - -\end_inset - - is the sampling rate of the input stream, -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -output_rate -\end_layout - -\end_inset - - is the sampling rate of the output stream and -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -quality -\end_layout - -\end_inset - - is the requested quality setting (0 to 10). - The quality parameter is useful for controlling the quality/complexity/latency - tradeoff. - Using a higher quality setting means less noise/aliasing, a higher complexity - and a higher latency. - Usually, a quality of 3 is acceptable for most desktop uses and quality - 10 is mostly recommended for pro audio work. - Quality 0 usually has a decent sound (certainly better than using linear - interpolation resampling), but artifacts may be heard. -\end_layout - -\begin_layout Standard -The actual resampling is performed using -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -err = speex_resampler_process_int(resampler, channelID, in, &in_length, - out, &out_length); -\end_layout - -\end_inset - -where -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -channelID -\end_layout - -\end_inset - - is the ID of the channel to be processed. - For a mono stream, use 0. - The -\emph on -in -\emph default - pointer points to the first sample of the input buffer for the selected - channel and -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -out -\end_layout - -\end_inset - - points to the first sample of the output. - The size of the input and output buffers are specified by -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -in_length -\end_layout - -\end_inset - - and -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -out_length -\end_layout - -\end_inset - - respectively. - Upon completion, these values are replaced by the number of samples read - and written by the resampler. - Unless an error occurs, either all input samples will be read or all output - samples will be written to (or both). - For floating-point samples, the function -\begin_inset listings -inline true -status open - -\begin_layout Plain Layout - -speex_resampler_process_float() -\end_layout - -\end_inset - - behaves similarly. -\end_layout - -\begin_layout Standard -It is also possible to process multiple channels at once. - To do that, you can use speex_resampler_process_interleaved_int() or -\begin_inset listings -inline true -status open - -\begin_layout Plain Layout - -speex_resampler_process_interleaved_float() -\end_layout - -\end_inset - -. - The arguments are the same except that there is no -\begin_inset listings -inline true -status collapsed - -\begin_layout Plain Layout - -channelID -\end_layout - -\end_inset - - argument. - Note that the -\series bold -length parameters are per-channel -\series default -. - So if you have 1024 samples for each of 4 channels, you pass 1024 and not - 4096. -\end_layout - -\begin_layout Standard -The resampler allows changing the quality and input/output sampling frequencies - on the fly without glitches. - This can be done with calls such as -\begin_inset listings -inline true -status open - -\begin_layout Plain Layout - -speex_resampler_set_quality() -\end_layout - -\end_inset - - and -\begin_inset listings -inline true -status open - -\begin_layout Plain Layout - -speex_resampler_set_rate() -\end_layout - -\end_inset - -. - The only side effect is that a new filter will have to be recomputed, consuming - many CPU cycles. - -\end_layout - -\begin_layout Standard -When resampling a file, it is often desirable to have the output file perfectly - synchronised with the input. - To do that, you need to call -\begin_inset listings -inline true -status open - -\begin_layout Plain Layout - -speex_resampler_skip_zeros() -\end_layout - -\end_inset - - -\series bold -before -\series default - you start processing any samples. - For real-time applications (e.g. - VoIP), it is not recommended to do that as the first process frame will - be shorter to compensate for the delay (the skipped zeros). - Instead, in real-time applications you may want to know how many delay - is introduced by the resampler. - This can be done at run-time with -\begin_inset listings -inline true -status open - -\begin_layout Plain Layout - -speex_resampler_get_input_latency() -\end_layout - -\end_inset - - and -\begin_inset listings -inline true -status open - -\begin_layout Plain Layout - -speex_resampler_get_output_latency() -\end_layout - -\end_inset - - functions. - First function returns delay measured in samples at input samplerate, while - second returns delay measured in samples at output samplerate. -\end_layout - -\begin_layout Standard -To destroy a resampler state, just call -\begin_inset listings -inline true -status open - -\begin_layout Plain Layout - -speex_resampler_destroy() -\end_layout - -\end_inset - -. -\end_layout - -\begin_layout Section -Ring Buffer -\end_layout - -\begin_layout Standard -In some cases, it is necessary to interface components that use different - block sizes. - For example, it is possible that the soundcard does not support reading/writing - in blocks of 20 -\begin_inset space ~ -\end_inset - -ms or sometimes, complicated resampling ratios mean that the blocks don't - always have the same time. - In thoses cases, it is often necessary to buffer a bit of audio using a - ring buffer. -\end_layout - -\begin_layout Standard -\begin_inset Newpage newpage -\end_inset - - -\end_layout - -\begin_layout Chapter -Formats and standards -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -standards -\end_layout - -\end_inset - - -\begin_inset CommandInset label -LatexCommand label -name "sec:Formats-and-standards" - -\end_inset - - -\end_layout - -\begin_layout Standard -Speex can encode speech in both narrowband and wideband and provides different - bit-rates. - However, not all features need to be supported by a certain implementation - or device. - In order to be called -\begin_inset Quotes eld -\end_inset - -Speex compatible -\begin_inset Quotes erd -\end_inset - - (whatever that means), an implementation must implement at least a basic - set of features. -\end_layout - -\begin_layout Standard -At the minimum, all narrowband modes of operation MUST be supported at the - decoder. - This includes the decoding of a wideband bit-stream by the narrowband decoder -\begin_inset Foot -status collapsed - -\begin_layout Plain Layout -The wideband bit-stream contains an embedded narrowband bit-stream which - can be decoded alone -\end_layout - -\end_inset - -. - If present, a wideband decoder MUST be able to decode a narrowband stream, - and MAY either be able to decode all wideband modes or be able to decode - the embedded narrowband part of all modes (which includes ignoring the - high-band bits). -\end_layout - -\begin_layout Standard -For encoders, at least one narrowband or wideband mode MUST be supported. - The main reason why all encoding modes do not have to be supported is that - some platforms may not be able to handle the complexity of encoding in - some modes. -\end_layout - -\begin_layout Section -RTP -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -RTP -\end_layout - -\end_inset - - Payload Format -\end_layout - -\begin_layout Standard -The RTP payload draft is included in appendix -\begin_inset CommandInset ref -LatexCommand ref -reference "sec:IETF-draft" - -\end_inset - - and the latest version is available at -\begin_inset Flex URL -status collapsed - -\begin_layout Plain Layout - -http://www.speex.org/drafts/latest -\end_layout - -\end_inset - -. - This draft has been sent (2003/02/26) to the Internet Engineering Task - Force (IETF) and will be discussed at the March 18th meeting in San Francisco. - -\end_layout - -\begin_layout Section -MIME Type -\end_layout - -\begin_layout Standard -For now, you should use the MIME type audio/x-speex for Speex-in-Ogg. - We will apply for type -\family typewriter -audio/speex -\family default - in the near future. -\end_layout - -\begin_layout Section -Ogg -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -Ogg -\end_layout - -\end_inset - - file format -\end_layout - -\begin_layout Standard -Speex bit-streams can be stored in Ogg files. - In this case, the first packet of the Ogg file contains the Speex header - described in table -\begin_inset CommandInset ref -LatexCommand ref -reference "cap:ogg_speex_header" - -\end_inset - -. - All integer fields in the headers are stored as little-endian. - The -\family typewriter -speex_string -\family default - field must contain the -\begin_inset Quotes eld -\end_inset - - -\family typewriter -Speex -\family default - -\begin_inset space ~ -\end_inset - - -\begin_inset space ~ -\end_inset - - -\begin_inset space ~ -\end_inset - - -\begin_inset Quotes erd -\end_inset - - (with 3 trailing spaces), which identifies the bit-stream. - The next field, -\family typewriter -speex_version -\family default - contains the version of Speex that encoded the file. - For now, refer to speex_header.[ch] for more info. - The -\emph on -beginning of stream -\emph default - ( -\family typewriter -b_o_s -\family default -) flag is set to 1 for the header. - The header packet has -\family typewriter -packetno=0 -\family default - and -\family typewriter -granulepos=0 -\family default -. -\end_layout - -\begin_layout Standard -The second packet contains the Speex comment header. - The format used is the Vorbis comment format described here: http://www.xiph.org/ -ogg/vorbis/doc/v-comment.html . - This packet has -\family typewriter -packetno=1 -\family default - and -\family typewriter -granulepos=0 -\family default -. -\end_layout - -\begin_layout Standard -The third and subsequent packets each contain one or more (number found - in header) Speex frames. - These are identified with -\family typewriter -packetno -\family default - starting from 2 and the -\family typewriter -granulepos -\family default - is the number of the last sample encoded in that packet. - The last of these packets has the -\emph on -end of stream -\emph default - ( -\family typewriter -e_o_s -\family default -) flag is set to 1. -\end_layout - -\begin_layout Standard -\begin_inset Float table -placement htbp -wide true -sideways false -status open - -\begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -begin{center} -\end_layout - -\end_inset - - -\begin_inset Tabular - - - - - - - -\begin_inset Text - -\begin_layout Plain Layout -Field -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Type -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Size -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -speex_string -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -char[] -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -8 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -speex_version -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -char[] -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -20 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -speex_version_id -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -int -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -header_size -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -int -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -rate -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -int -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -mode -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -int -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -mode_bitstream_version -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -int -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -nb_channels -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -int -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -bitrate -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -int -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -frame_size -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -int -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -vbr -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -int -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -frames_per_packet -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -int -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -extra_headers -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -int -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -reserved1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -int -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -reserved2 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -int -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\end_inset - - -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -end{center} -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Plain Layout -\begin_inset Caption - -\begin_layout Plain Layout -Ogg/Speex header packet -\begin_inset CommandInset label -LatexCommand label -name "cap:ogg_speex_header" - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -clearpage -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Chapter -Introduction to CELP Coding -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -CELP -\end_layout - -\end_inset - - -\begin_inset CommandInset label -LatexCommand label -name "sec:Introduction-to-CELP" - -\end_inset - - -\end_layout - -\begin_layout Quote -\align center - -\emph on -Do not meddle in the affairs of poles, for they are subtle and quick to - leave the unit circle. -\end_layout - -\begin_layout Standard -Speex is based on CELP, which stands for Code Excited Linear Prediction. - This section attempts to introduce the principles behind CELP, so if you - are already familiar with CELP, you can safely skip to section -\begin_inset CommandInset ref -LatexCommand ref -reference "sec:Speex-narrowband-mode" - -\end_inset - -. - The CELP technique is based on three ideas: -\end_layout - -\begin_layout Enumerate -The use of a linear prediction (LP) model to model the vocal tract -\end_layout - -\begin_layout Enumerate -The use of (adaptive and fixed) codebook entries as input (excitation) of - the LP model -\end_layout - -\begin_layout Enumerate -The search performed in closed-loop in a -\begin_inset Quotes eld -\end_inset - -perceptually weighted domain -\begin_inset Quotes erd -\end_inset - - -\end_layout - -\begin_layout Standard -This section describes the basic ideas behind CELP. - This is still a work in progress. -\end_layout - -\begin_layout Section -Source-Filter Model of Speech Prediction -\end_layout - -\begin_layout Standard -The source-filter model of speech production assumes that the vocal cords - are the source of spectrally flat sound (the excitation signal), and that - the vocal tract acts as a filter to spectrally shape the various sounds - of speech. - While still an approximation, the model is widely used in speech coding - because of its simplicity.Its use is also the reason why most speech codecs - (Speex included) perform badly on music signals. - The different phonemes can be distinguished by their excitation (source) - and spectral shape (filter). - Voiced sounds (e.g. - vowels) have an excitation signal that is periodic and that can be approximated - by an impulse train in the time domain or by regularly-spaced harmonics - in the frequency domain. - On the other hand, fricatives (such as the "s", "sh" and "f" sounds) have - an excitation signal that is similar to white Gaussian noise. - So called voice fricatives (such as "z" and "v") have excitation signal - composed of an harmonic part and a noisy part. -\end_layout - -\begin_layout Standard -The source-filter model is usually tied with the use of Linear prediction. - The CELP model is based on source-filter model, as can be seen from the - CELP decoder illustrated in Figure -\begin_inset CommandInset ref -LatexCommand ref -reference "fig:The-CELP-model" - -\end_inset - -. - -\end_layout - -\begin_layout Standard -\begin_inset Float figure -wide false -sideways false -status open - -\begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -begin{center} -\end_layout - -\end_inset - - -\begin_inset Graphics - filename celp_decoder.eps - width 45page% - keepAspectRatio - -\end_inset - - -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -end{center} -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Plain Layout -\begin_inset Caption - -\begin_layout Plain Layout -The CELP model of speech synthesis (decoder) -\begin_inset CommandInset label -LatexCommand label -name "fig:The-CELP-model" - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Section -Linear Prediction Coefficients (LPC) -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -linear prediction -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -Linear prediction is at the base of many speech coding techniques, including - CELP. - The idea behind it is to predict the signal -\begin_inset Formula $x[n]$ -\end_inset - - using a linear combination of its past samples: -\end_layout - -\begin_layout Standard -\begin_inset Formula \[ -y[n]=\sum_{i=1}^{N}a_{i}x[n-i]\] - -\end_inset - -where -\begin_inset Formula $y[n]$ -\end_inset - - is the linear prediction of -\begin_inset Formula $x[n]$ -\end_inset - -. - The prediction error is thus given by: -\begin_inset Formula \[ -e[n]=x[n]-y[n]=x[n]-\sum_{i=1}^{N}a_{i}x[n-i]\] - -\end_inset - - -\end_layout - -\begin_layout Standard -The goal of the LPC analysis is to find the best prediction coefficients - -\begin_inset Formula $a_{i}$ -\end_inset - - which minimize the quadratic error function: -\begin_inset Formula \[ -E=\sum_{n=0}^{L-1}\left[e[n]\right]^{2}=\sum_{n=0}^{L-1}\left[x[n]-\sum_{i=1}^{N}a_{i}x[n-i]\right]^{2}\] - -\end_inset - -That can be done by making all derivatives -\begin_inset Formula $\frac{\partial E}{\partial a_{i}}$ -\end_inset - - equal to zero: -\begin_inset Formula \[ -\frac{\partial E}{\partial a_{i}}=\frac{\partial}{\partial a_{i}}\sum_{n=0}^{L-1}\left[x[n]-\sum_{i=1}^{N}a_{i}x[n-i]\right]^{2}=0\] - -\end_inset - - -\end_layout - -\begin_layout Standard -For an order -\begin_inset Formula $N$ -\end_inset - - filter, the filter coefficients -\begin_inset Formula $a_{i}$ -\end_inset - - are found by solving the system -\begin_inset Formula $N\times N$ -\end_inset - - linear system -\begin_inset Formula $\mathbf{Ra}=\mathbf{r}$ -\end_inset - -, where -\begin_inset Formula \[ -\mathbf{R}=\left[\begin{array}{cccc} -R(0) & R(1) & \cdots & R(N-1)\\ -R(1) & R(0) & \cdots & R(N-2)\\ -\vdots & \vdots & \ddots & \vdots\\ -R(N-1) & R(N-2) & \cdots & R(0)\end{array}\right]\] - -\end_inset - - -\begin_inset Formula \[ -\mathbf{r}=\left[\begin{array}{c} -R(1)\\ -R(2)\\ -\vdots\\ -R(N)\end{array}\right]\] - -\end_inset - -with -\begin_inset Formula $R(m)$ -\end_inset - -, the auto-correlation -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -auto-correlation -\end_layout - -\end_inset - - of the signal -\begin_inset Formula $x[n]$ -\end_inset - -, computed as: -\end_layout - -\begin_layout Standard -\begin_inset Formula \[ -R(m)=\sum_{i=0}^{N-1}x[i]x[i-m]\] - -\end_inset - - -\end_layout - -\begin_layout Standard -Because -\begin_inset Formula $\mathbf{R}$ -\end_inset - - is Hermitian Toeplitz, the Levinson-Durbin -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -Levinson-Durbin -\end_layout - -\end_inset - - algorithm can be used, making the solution to the problem -\begin_inset Formula $\mathcal{O}\left(N^{2}\right)$ -\end_inset - - instead of -\begin_inset Formula $\mathcal{O}\left(N^{3}\right)$ -\end_inset - -. - Also, it can be proven that all the roots of -\begin_inset Formula $A(z)$ -\end_inset - - are within the unit circle, which means that -\begin_inset Formula $1/A(z)$ -\end_inset - - is always stable. - This is in theory; in practice because of finite precision, there are two - commonly used techniques to make sure we have a stable filter. - First, we multiply -\begin_inset Formula $R(0)$ -\end_inset - - by a number slightly above one (such as 1.0001), which is equivalent to - adding noise to the signal. - Also, we can apply a window to the auto-correlation, which is equivalent - to filtering in the frequency domain, reducing sharp resonances. -\end_layout - -\begin_layout Section -Pitch Prediction -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -pitch -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -During voiced segments, the speech signal is periodic, so it is possible - to take advantage of that property by approximating the excitation signal - -\begin_inset Formula $e[n]$ -\end_inset - - by a gain times the past of the excitation: -\end_layout - -\begin_layout Standard -\begin_inset Formula \[ -e[n]\simeq p[n]=\beta e[n-T]\ ,\] - -\end_inset - -where -\begin_inset Formula $T$ -\end_inset - - is the pitch period, -\begin_inset Formula $\beta$ -\end_inset - - is the pitch gain. - We call that long-term prediction since the excitation is predicted from - -\begin_inset Formula $e[n-T]$ -\end_inset - - with -\begin_inset Formula $T\gg N$ -\end_inset - -. -\end_layout - -\begin_layout Section -Innovation Codebook -\end_layout - -\begin_layout Standard -The final excitation -\begin_inset Formula $e[n]$ -\end_inset - - will be the sum of the pitch prediction and an -\emph on -innovation -\emph default - signal -\begin_inset Formula $c[n]$ -\end_inset - - taken from a fixed codebook, hence the name -\emph on -Code -\emph default - Excited Linear Prediction. - The final excitation is given by -\end_layout - -\begin_layout Standard -\begin_inset Formula \[ -e[n]=p[n]+c[n]=\beta e[n-T]+c[n]\ .\] - -\end_inset - -The quantization of -\begin_inset Formula $c[n]$ -\end_inset - - is where most of the bits in a CELP codec are allocated. - It represents the information that couldn't be obtained either from linear - prediction or pitch prediction. - In the -\emph on -z -\emph default --domain we can represent the final signal -\begin_inset Formula $X(z)$ -\end_inset - - as -\begin_inset Formula \[ -X(z)=\frac{C(z)}{A(z)\left(1-\beta z^{-T}\right)}\] - -\end_inset - - -\end_layout - -\begin_layout Section -Noise Weighting -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -error weighting -\end_layout - -\end_inset - - -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -analysis-by-synthesis -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -Most (if not all) modern audio codecs attempt to -\begin_inset Quotes eld -\end_inset - -shape -\begin_inset Quotes erd -\end_inset - - the noise so that it appears mostly in the frequency regions where the - ear cannot detect it. - For example, the ear is more tolerant to noise in parts of the spectrum - that are louder and -\emph on -vice versa -\emph default -. - In order to maximize speech quality, CELP codecs minimize the mean square - of the error (noise) in the perceptually weighted domain. - This means that a perceptual noise weighting filter -\begin_inset Formula $W(z)$ -\end_inset - - is applied to the error signal in the encoder. - In most CELP codecs, -\begin_inset Formula $W(z)$ -\end_inset - - is a pole-zero weighting filter derived from the linear prediction coefficients - (LPC), generally using bandwidth expansion. - Let the spectral envelope be represented by the synthesis filter -\begin_inset Formula $1/A(z)$ -\end_inset - -, CELP codecs typically derive the noise weighting filter as -\begin_inset Formula \begin{equation} -W(z)=\frac{A(z/\gamma_{1})}{A(z/\gamma_{2})}\ ,\label{eq:gamma-weighting}\end{equation} - -\end_inset - -where -\begin_inset Formula $\gamma_{1}=0.9$ -\end_inset - - and -\begin_inset Formula $\gamma_{2}=0.6$ -\end_inset - - in the Speex reference implementation. - If a filter -\begin_inset Formula $A(z)$ -\end_inset - - has (complex) poles at -\begin_inset Formula $p_{i}$ -\end_inset - - in the -\begin_inset Formula $z$ -\end_inset - --plane, the filter -\begin_inset Formula $A(z/\gamma)$ -\end_inset - - will have its poles at -\begin_inset Formula $p'_{i}=\gamma p_{i}$ -\end_inset - -, making it a flatter version of -\begin_inset Formula $A(z)$ -\end_inset - -. -\end_layout - -\begin_layout Standard -The weighting filter is applied to the error signal used to optimize the - codebook search through analysis-by-synthesis (AbS). - This results in a spectral shape of the noise that tends towards -\begin_inset Formula $1/W(z)$ -\end_inset - -. - While the simplicity of the model has been an important reason for the - success of CELP, it remains that -\begin_inset Formula $W(z)$ -\end_inset - - is a very rough approximation for the perceptually optimal noise weighting - function. - Fig. - -\begin_inset CommandInset ref -LatexCommand ref -reference "cap:Standard-noise-shaping" - -\end_inset - - illustrates the noise shaping that results from Eq. - -\begin_inset CommandInset ref -LatexCommand ref -reference "eq:gamma-weighting" - -\end_inset - -. - Throughout this paper, we refer to -\begin_inset Formula $W(z)$ -\end_inset - - as the noise weighting filter and to -\begin_inset Formula $1/W(z)$ -\end_inset - - as the noise shaping filter (or curve). -\end_layout - -\begin_layout Standard -\begin_inset Float figure -wide false -sideways false -status open - -\begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -begin{center} -\end_layout - -\end_inset - - -\begin_inset Graphics - filename ref_shaping.eps - width 45page% - keepAspectRatio - -\end_inset - - -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -end{center} -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Plain Layout -\begin_inset Caption - -\begin_layout Plain Layout -Standard noise shaping in CELP. - Arbitrary y-axis offset. -\begin_inset CommandInset label -LatexCommand label -name "cap:Standard-noise-shaping" - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Section -Analysis-by-Synthesis -\end_layout - -\begin_layout Standard -One of the main principles behind CELP is called Analysis-by-Synthesis (AbS), - meaning that the encoding (analysis) is performed by perceptually optimising - the decoded (synthesis) signal in a closed loop. - In theory, the best CELP stream would be produced by trying all possible - bit combinations and selecting the one that produces the best-sounding - decoded signal. - This is obviously not possible in practice for two reasons: the required - complexity is beyond any currently available hardware and the -\begin_inset Quotes eld -\end_inset - -best sounding -\begin_inset Quotes erd -\end_inset - - selection criterion implies a human listener. - -\end_layout - -\begin_layout Standard -In order to achieve real-time encoding using limited computing resources, - the CELP optimisation is broken down into smaller, more manageable, sequential - searches using the perceptual weighting function described earlier. -\end_layout - -\begin_layout Standard -\begin_inset Newpage newpage -\end_inset - - -\end_layout - -\begin_layout Chapter -The Speex Decoder Specification -\end_layout - -\begin_layout Section -Narrowband decoder -\end_layout - -\begin_layout Standard - -\end_layout - -\begin_layout Subsection -Narrowband modes -\end_layout - -\begin_layout Standard -There are 7 different narrowband bit-rates defined for Speex, ranging from - 250 bps to 24.6 kbps, although the modes below 5.9 kbps should not be used - for speech. - The bit-allocation for each mode is detailed in table -\begin_inset CommandInset ref -LatexCommand ref -reference "cap:bits-narrowband" - -\end_inset - -. - Each frame starts with the mode ID encoded with 4 bits which allows a range - from 0 to 15, though only the first 7 values are used (the others are reserved). - The parameters are listed in the table in the order they are packed in - the bit-stream. - All frame-based parameters are packed before sub-frame parameters. - The parameters for a certain sub-frame are all packed before the following - sub-frame is packed. - The -\begin_inset Quotes eld -\end_inset - -OL -\begin_inset Quotes erd -\end_inset - - in the parameter description means that the parameter is an open loop estimatio -n based on the whole frame. -\end_layout - -\begin_layout Standard -\begin_inset Float table -placement h -wide true -sideways false -status open - -\begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -begin{center} -\end_layout - -\end_inset - - -\begin_inset Tabular - - - - - - - - - - - - - - - -\begin_inset Text - -\begin_layout Plain Layout -Parameter -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Update rate -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -2 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -3 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -6 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -7 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -8 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -Wideband bit -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -Mode ID -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -LSP -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -18 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -18 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -18 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -18 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -30 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -30 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -30 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -18 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -OL pitch -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -7 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -7 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -7 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -OL pitch gain -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -OL Exc gain -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -Fine pitch -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -sub-frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -7 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -7 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -7 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -7 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -7 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -Pitch gain -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -sub-frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -7 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -7 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -7 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -Innovation gain -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -sub-frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -3 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -3 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -3 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -Innovation VQ -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -sub-frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -16 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -20 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -35 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -48 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -64 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -96 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -10 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -Total -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -43 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -119 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -160 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -220 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -300 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -364 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -492 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -79 -\end_layout - -\end_inset - - - - -\end_inset - - -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -end{center} -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Plain Layout -\begin_inset Caption - -\begin_layout Plain Layout -Bit allocation for narrowband modes -\begin_inset CommandInset label -LatexCommand label -name "cap:bits-narrowband" - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsection -LSP decoding -\end_layout - -\begin_layout Standard -Depending on the mode, LSP parameters are encoded using either 18 bits or - 30 bits. -\end_layout - -\begin_layout Standard -Interpolation -\end_layout - -\begin_layout Standard -Safe margin -\end_layout - -\begin_layout Subsection -Adaptive codebook -\end_layout - -\begin_layout Standard -For rates of 8 kbit/s and above, the pitch period is encoded for each subframe. - The real period is -\begin_inset Formula $T=p_{i}+17$ -\end_inset - - where -\begin_inset Formula $p_{i}$ -\end_inset - - is a value encoded with 7 bits and 17 corresponds to the minimum pitch. - The maximum period is 144. - At 5.95 kbit/s (mode 2), the pitch period is similarly encoded, but only - once for the frame. - Each sub-frame then has a 2-bit offset that is added to the pitch value - of the frame. - In that case, the pitch for each sub-frame is equal to -\begin_inset Formula $T-1+offset$ -\end_inset - -. - For rates below 5.95 kbit/s, only the per-frame pitch is used and the pitch - is constant for all sub-frames. -\end_layout - -\begin_layout Standard -Speex uses a 3-tap predictor for rates of 5.95 kbit/s and above. - The three gain values are obtained from a 5-bit or a 7-bit codebook, depending - on the mode. - -\end_layout - -\begin_layout Subsection -Innovation codebook -\end_layout - -\begin_layout Standard -Split codebook, size and entries depend on bit-rate -\end_layout - -\begin_layout Standard -a 5-bit gain is encoder on a per-frame basis -\end_layout - -\begin_layout Standard -Depending on the mode, higher resolution per sub-frame -\end_layout - -\begin_layout Standard -innovation sub-vectors concatenated, gain applied -\end_layout - -\begin_layout Subsection -Perceptual enhancement -\end_layout - -\begin_layout Standard -Optional, implementation-defined. - -\end_layout - -\begin_layout Subsection -Bit-stream definition -\end_layout - -\begin_layout Standard -This section defines the bit-stream that is transmitted on the wire. - One speex packet consist of 1 frame header and 4 sub-frames: -\end_layout - -\begin_layout Standard -\begin_inset Tabular - - - - - - - - - -\begin_inset Text - -\begin_layout Plain Layout -Frame Header -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Subframe 1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Subframe2 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Subframe 3 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Subframe 4 -\end_layout - -\end_inset - - - - -\end_inset - - -\end_layout - -\begin_layout Standard -The frame header is variable length, depending on decoding mode and submode. - The narrowband frame header is defined as follows: -\end_layout - -\begin_layout Standard -\begin_inset Tabular - - - - - - - - - - -\begin_inset Text - -\begin_layout Plain Layout -wb bit -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -modeid -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -LSP -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -OL-pitch -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -OL-pitchgain -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -OL ExcGain -\end_layout - -\end_inset - - - - -\end_inset - - -\end_layout - -\begin_layout Standard -wb-bit: Wideband bit (1 bit) 0=narrowband, 1=wideband -\end_layout - -\begin_layout Standard -modeid: Mode identifier (4 bits) -\end_layout - -\begin_layout Standard -LSP: Line Spectral Pairs (0, 18 or 30 bits) -\end_layout - -\begin_layout Standard -OL-pitch: Open Loop Pitch (0 or 7 bits) -\end_layout - -\begin_layout Standard -OL-pitchgain: Open Loop Pitch Gain (0 or 4 bits) -\end_layout - -\begin_layout Standard -OL-ExcGain: Open Loop Excitation Gain (0 or 5 bits) -\end_layout - -\begin_layout Standard -... -\end_layout - -\begin_layout Standard -Each subframe is defined as follows: -\end_layout - -\begin_layout Standard -\begin_inset Tabular - - - - - - - - -\begin_inset Text - -\begin_layout Plain Layout -FinePitch -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -PitchGain -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -InnovationGain -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Innovation VQ -\end_layout - -\end_inset - - - - -\end_inset - - -\end_layout - -\begin_layout Standard -FinePitch: (0 or 7 bits) -\end_layout - -\begin_layout Standard -PitchGain: (0, 5, or 7 bits) -\end_layout - -\begin_layout Standard -Innovation Gain: (0, 1, 3 bits) -\end_layout - -\begin_layout Standard -Innovation VQ: (0-96 bits) -\end_layout - -\begin_layout Standard -... -\end_layout - -\begin_layout Subsection -Sample decoder -\end_layout - -\begin_layout Standard -This section contains some sample source code, showing how a basic Speex - decoder can be implemented. - The sample decoder is narrowband submode 3 only, and with no advanced features - like enhancement, vbr etc. -\end_layout - -\begin_layout Standard -... -\end_layout - -\begin_layout Standard -\begin_inset CommandInset include -LatexCommand lstinputlisting -filename "nb_celp.c" -lstparams "caption={Sample Decoder}" - -\end_inset - - -\end_layout - -\begin_layout Subsection -Lookup tables -\end_layout - -\begin_layout Standard -The Speex decoder includes a set of lookup tables and codebooks, which are - used to convert between values of different domains. - This includes: -\end_layout - -\begin_layout Standard -- Excitation 10x16 (3200 bps) -\end_layout - -\begin_layout Standard -- Excitation 10x32 (4000 bps) -\end_layout - -\begin_layout Standard -- Excitation 20x32 (2000 bps) -\end_layout - -\begin_layout Standard -- Excitation 5x256 (12800 bps) -\end_layout - -\begin_layout Standard -- Excitation 5x64 (9600 bps) -\end_layout - -\begin_layout Standard -- Excitation 8x128 (7000 bps) -\end_layout - -\begin_layout Standard -- Codebook for 3-tap pitch prediction gain (Normal and Low Bitrate) -\end_layout - -\begin_layout Standard -- Codebook for LSPs in narrowband CELP mode -\end_layout - -\begin_layout Standard -... -\end_layout - -\begin_layout Standard -The exact lookup tables are included here for reference. -\end_layout - -\begin_layout Standard -\begin_inset CommandInset include -LatexCommand lstinputlisting -filename "../libspeex/exc_5_64_table.c" - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset CommandInset include -LatexCommand lstinputlisting -filename "../libspeex/exc_5_256_table.c" - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset CommandInset include -LatexCommand lstinputlisting -filename "../libspeex/exc_8_128_table.c" - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset CommandInset include -LatexCommand lstinputlisting -filename "../libspeex/exc_10_16_table.c" - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset CommandInset include -LatexCommand lstinputlisting -filename "../libspeex/exc_10_32_table.c" - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset CommandInset include -LatexCommand lstinputlisting -filename "../libspeex/exc_20_32_table.c" - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset CommandInset include -LatexCommand lstinputlisting -filename "../libspeex/gain_table.c" - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset CommandInset include -LatexCommand lstinputlisting -filename "../libspeex/gain_table_lbr.c" - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset CommandInset include -LatexCommand lstinputlisting -filename "../libspeex/lsp_tables_nb.c" - -\end_inset - - -\end_layout - -\begin_layout Section -Wideband embedded decoder -\end_layout - -\begin_layout Standard -QMF filter. - Narrowband signal decoded using narrowband decoder -\end_layout - -\begin_layout Standard -For the high band, the decoder is similar to the narrowband decoder, with - the main difference being that there is no adaptive codebook. -\end_layout - -\begin_layout Standard -Gain is per-subframe -\end_layout - -\begin_layout Chapter -Speex narrowband mode -\begin_inset CommandInset label -LatexCommand label -name "sec:Speex-narrowband-mode" - -\end_inset - - -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -narrowband -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -This section looks at how Speex works for narrowband ( -\begin_inset Formula $8\:\mathrm{kHz}$ -\end_inset - - sampling rate) operation. - The frame size for this mode is -\begin_inset Formula $20\:\mathrm{ms}$ -\end_inset - -, corresponding to 160 samples. - Each frame is also subdivided into 4 sub-frames of 40 samples each. -\end_layout - -\begin_layout Standard -Also many design decisions were based on the original goals and assumptions: -\end_layout - -\begin_layout Itemize -Minimizing the amount of information extracted from past frames (for robustness - to packet loss) -\end_layout - -\begin_layout Itemize -Dynamically-selectable codebooks (LSP, pitch and innovation) -\end_layout - -\begin_layout Itemize -sub-vector fixed (innovation) codebooks -\end_layout - -\begin_layout Section -Whole-Frame Analysis -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -linear prediction -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -In narrowband, Speex frames are 20 ms long (160 samples) and are subdivided - in 4 sub-frames of 5 ms each (40 samples). - For most narrowband bit-rates (8 kbps and above), the only parameters encoded - at the frame level are the Line Spectral Pairs (LSP) and a global excitation - gain -\begin_inset Formula $g_{frame}$ -\end_inset - -, as shown in Fig. - -\begin_inset CommandInset ref -LatexCommand ref -reference "cap:Frame-open-loop-analysis" - -\end_inset - -. - All other parameters are encoded at the sub-frame level. -\end_layout - -\begin_layout Standard -Linear prediction analysis is performed once per frame using an asymmetric - Hamming window centered on the fourth sub-frame. - Because linear prediction coefficients (LPC) are not robust to quantization, - they are first converted to line spectral pairs (LSP) -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -line spectral pair -\end_layout - -\end_inset - -. - The LSP's are considered to be associated to the -\begin_inset Formula $4^{th}$ -\end_inset - - sub-frames and the LSP's associated to the first 3 sub-frames are linearly - interpolated using the current and previous LSP coefficients. - The LSP coefficients and converted back to the LPC filter -\begin_inset Formula $\hat{A}(z)$ -\end_inset - -. - The non-quantized interpolated filter is denoted -\begin_inset Formula $A(z)$ -\end_inset - - and can be used for the weighting filter -\begin_inset Formula $W(z)$ -\end_inset - - because it does not need to be available to the decoder. - -\end_layout - -\begin_layout Standard -To make Speex more robust to packet loss, no prediction is applied on the - LSP coefficients prior to quantization. - The LSPs are encoded using vector quantization (VQ) with 30 bits for higher - quality modes and 18 bits for lower quality. -\end_layout - -\begin_layout Standard -\begin_inset Float figure -wide false -sideways false -status open - -\begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -begin{center} -\end_layout - -\end_inset - - -\begin_inset Graphics - filename speex_analysis.eps - width 35page% - -\end_inset - - -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -end{center} -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Plain Layout -\begin_inset Caption - -\begin_layout Plain Layout -Frame open-loop analysis -\begin_inset CommandInset label -LatexCommand label -name "cap:Frame-open-loop-analysis" - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Section -Sub-Frame Analysis-by-Synthesis -\end_layout - -\begin_layout Standard -\begin_inset Float figure -wide false -sideways false -status open - -\begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -begin{center} -\end_layout - -\end_inset - - -\begin_inset Graphics - filename speex_abs.eps - lyxscale 75 - width 40page% - -\end_inset - - -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -end{center} -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Plain Layout -\begin_inset Caption - -\begin_layout Plain Layout -Analysis-by-synthesis closed-loop optimization on a sub-frame. -\begin_inset CommandInset label -LatexCommand label -name "cap:Sub-frame-AbS" - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -The analysis-by-synthesis (AbS) encoder loop is described in Fig. - -\begin_inset CommandInset ref -LatexCommand ref -reference "cap:Sub-frame-AbS" - -\end_inset - -. - There are three main aspects where Speex significantly differs from most - other CELP codecs. - First, while most recent CELP codecs make use of fractional pitch estimation - with a single gain, Speex uses an integer to encode the pitch period, but - uses a 3-tap predictor (3 gains). - The adaptive codebook contribution -\begin_inset Formula $e_{a}[n]$ -\end_inset - - can thus be expressed as: -\begin_inset Formula \begin{equation} -e_{a}[n]=g_{0}e[n-T-1]+g_{1}e[n-T]+g_{2}e[n-T+1]\label{eq:adaptive-3tap}\end{equation} - -\end_inset - -where -\begin_inset Formula $g_{0}$ -\end_inset - -, -\begin_inset Formula $g_{1}$ -\end_inset - - and -\begin_inset Formula $g_{2}$ -\end_inset - - are the jointly quantized pitch gains and -\begin_inset Formula $e[n]$ -\end_inset - - is the codec excitation memory. - It is worth noting that when the pitch is smaller than the sub-frame size, - we repeat the excitation at a period -\begin_inset Formula $T$ -\end_inset - -. - For example, when -\begin_inset Formula $n-T+1\geq0$ -\end_inset - -, we use -\begin_inset Formula $n-2T+1$ -\end_inset - - instead. - In most modes, the pitch period is encoded with 7 bits in the -\begin_inset Formula $\left[17,144\right]$ -\end_inset - - range and the -\begin_inset Formula $\beta_{i}$ -\end_inset - - coefficients are vector-quantized using 7 bits at higher bit-rates (15 - kbps narrowband and above) and 5 bits at lower bit-rates (11 kbps narrowband - and below). -\end_layout - -\begin_layout Standard -Many current CELP codecs use moving average (MA) prediction to encode the - fixed codebook gain. - This provides slightly better coding at the expense of introducing a dependency - on previously encoded frames. - A second difference is that Speex encodes the fixed codebook gain as the - product of the global excitation gain -\begin_inset Formula $g_{frame}$ -\end_inset - - with a sub-frame gain corrections -\begin_inset Formula $g_{subf}$ -\end_inset - -. - This increases robustness to packet loss by eliminating the inter-frame - dependency. - The sub-frame gain correction is encoded before the fixed codebook is searched - (not closed-loop optimized) and uses between 0 and 3 bits per sub-frame, - depending on the bit-rate. -\end_layout - -\begin_layout Standard -The third difference is that Speex uses sub-vector quantization of the innovatio -n (fixed codebook) signal instead of an algebraic codebook. - Each sub-frame is divided into sub-vectors of lengths ranging between 5 - and 20 samples. - Each sub-vector is chosen from a bitrate-dependent codebook and all sub-vectors - are concatenated to form a sub-frame. - As an example, the 3.95 kbps mode uses a sub-vector size of 20 samples with - 32 entries in the codebook (5 bits). - This means that the innovation is encoded with 10 bits per sub-frame, or - 2000 bps. - On the other hand, the 18.2 kbps mode uses a sub-vector size of 5 samples - with 256 entries in the codebook (8 bits), so the innovation uses 64 bits - per sub-frame, or 12800 bps. - -\end_layout - -\begin_layout Section -Bit-rates -\end_layout - -\begin_layout Standard -So far, no MOS (Mean Opinion Score -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -mean opinion score -\end_layout - -\end_inset - -) subjective evaluation has been performed for Speex. - In order to give an idea of the quality achievable with it, table -\begin_inset CommandInset ref -LatexCommand ref -reference "cap:quality_vs_bps" - -\end_inset - - presents my own subjective opinion on it. - It should be noted that different people will perceive the quality differently - and that the person that designed the codec often has a bias (one way or - another) when it comes to subjective evaluation. - Last thing, it should be noted that for most codecs (including Speex) encoding - quality sometimes varies depending on the input. - Note that the complexity is only approximate (within 0.5 mflops and using - the lowest complexity setting). - Decoding requires approximately 0.5 mflops -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -complexity -\end_layout - -\end_inset - - in most modes (1 mflops with perceptual enhancement). -\end_layout - -\begin_layout Standard -\begin_inset Float table -placement h -wide true -sideways false -status open - -\begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -begin{center} -\end_layout - -\end_inset - - -\begin_inset Tabular - - - - - - - - - -\begin_inset Text - -\begin_layout Plain Layout -Mode -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Quality -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Bit-rate -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -bit-rate -\end_layout - -\end_inset - - (bps) -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -mflops -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -complexity -\end_layout - -\end_inset - - -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Quality/description -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -250 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -No transmission (DTX) -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -2,150 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -6 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Vocoder (mostly for comfort noise) -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -2 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -2 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5,950 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -9 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Very noticeable artifacts/noise, good intelligibility -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -3 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -3-4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -8,000 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -10 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Artifacts/noise sometimes noticeable -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5-6 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -11,000 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -14 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Artifacts usually noticeable only with headphones -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -7-8 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -15,000 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -11 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Need good headphones to tell the difference -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -6 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -9 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -18,200 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -17.5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Hard to tell the difference even with good headphones -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -7 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -10 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -24,600 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -14.5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Completely transparent for voice, good quality music -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -8 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -3,950 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -10.5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Very noticeable artifacts/noise, good intelligibility -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -9 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -reserved -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -10 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -reserved -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -11 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -reserved -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -12 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -reserved -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -13 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Application-defined, interpreted by callback or skipped -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -14 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Speex in-band signaling -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -15 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -- -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Terminator code -\end_layout - -\end_inset - - - - -\end_inset - - -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -end{center} -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Plain Layout -\begin_inset Caption - -\begin_layout Plain Layout -Quality versus bit-rate -\begin_inset CommandInset label -LatexCommand label -name "cap:quality_vs_bps" - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Section -Perceptual enhancement -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -perceptual enhancement -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard - -\series bold -This section was only valid for version 1.1.12 and earlier. - It does not apply to version 1.2-beta1 (and later), for which the new perceptual - enhancement is not yet documented. -\end_layout - -\begin_layout Standard -This part of the codec only applies to the decoder and can even be changed - without affecting inter-operability. - For that reason, the implementation provided and described here should - only be considered as a reference implementation. - The enhancement system is divided into two parts. - First, the synthesis filter -\begin_inset Formula $S(z)=1/A(z)$ -\end_inset - - is replaced by an enhanced filter: -\begin_inset Formula \[ -S'(z)=\frac{A\left(z/a_{2}\right)A\left(z/a_{3}\right)}{A\left(z\right)A\left(z/a_{1}\right)}\] - -\end_inset - -where -\begin_inset Formula $a_{1}$ -\end_inset - - and -\begin_inset Formula $a_{2}$ -\end_inset - - depend on the mode in use and -\begin_inset Formula $a_{3}=\frac{1}{r}\left(1-\frac{1-ra_{1}}{1-ra_{2}}\right)$ -\end_inset - - with -\begin_inset Formula $r=.9$ -\end_inset - -. - The second part of the enhancement consists of using a comb filter to enhance - the pitch in the excitation domain. - -\end_layout - -\begin_layout Standard -\begin_inset Newpage newpage -\end_inset - - -\end_layout - -\begin_layout Chapter -Speex wideband mode (sub-band CELP) -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -wideband -\end_layout - -\end_inset - - -\begin_inset CommandInset label -LatexCommand label -name "sec:Speex-wideband-mode" - -\end_inset - - -\end_layout - -\begin_layout Standard -For wideband, the Speex approach uses a -\emph on -q -\emph default -uadrature -\emph on -m -\emph default -irror -\emph on -f -\emph default -ilter -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -quadrature mirror filter -\end_layout - -\end_inset - - (QMF) to split the band in two. - The 16 kHz signal is thus divided into two 8 kHz signals, one representing - the low band (0-4 kHz), the other the high band (4-8 kHz). - The low band is encoded with the narrowband mode described in section -\begin_inset CommandInset ref -LatexCommand ref -reference "sec:Speex-narrowband-mode" - -\end_inset - - in such a way that the resulting -\begin_inset Quotes eld -\end_inset - -embedded narrowband bit-stream -\begin_inset Quotes erd -\end_inset - - can also be decoded with the narrowband decoder. - Since the low band encoding has already been described, only the high band - encoding is described in this section. -\end_layout - -\begin_layout Section -Linear Prediction -\end_layout - -\begin_layout Standard -The linear prediction part used for the high-band is very similar to what - is done for narrowband. - The only difference is that we use only 12 bits to encode the high-band - LSP's using a multi-stage vector quantizer (MSVQ). - The first level quantizes the 10 coefficients with 6 bits and the error - is then quantized using 6 bits, too. -\end_layout - -\begin_layout Section -Pitch Prediction -\end_layout - -\begin_layout Standard -That part is easy: there's no pitch prediction for the high-band. - There are two reasons for that. - First, there is usually little harmonic structure in this band (above 4 - kHz). - Second, it would be very hard to implement since the QMF folds the 4-8 - kHz band into 4-0 kHz (reversing the frequency axis), which means that - the location of the harmonics is no longer at multiples of the fundamental - (pitch). -\end_layout - -\begin_layout Section -Excitation Quantization -\end_layout - -\begin_layout Standard -The high-band excitation is coded in the same way as for narrowband. - -\end_layout - -\begin_layout Section -Bit allocation -\end_layout - -\begin_layout Standard -For the wideband mode, the entire narrowband frame is packed before the - high-band is encoded. - The narrowband part of the bit-stream is as defined in table -\begin_inset CommandInset ref -LatexCommand ref -reference "cap:bits-narrowband" - -\end_inset - -. - The high-band follows, as described in table -\begin_inset CommandInset ref -LatexCommand ref -reference "cap:bits-wideband" - -\end_inset - -. - For wideband, the mode ID is the same as the Speex quality setting and - is defined in table -\begin_inset CommandInset ref -LatexCommand ref -reference "tab:wideband-quality" - -\end_inset - -. - This also means that a wideband frame may be correctly decoded by a narrowband - decoder with the only caveat that if more than one frame is packed in the - same packet, the decoder will need to skip the high-band parts in order - to sync with the bit-stream. -\end_layout - -\begin_layout Standard -\begin_inset Float table -placement h -wide true -sideways false -status open - -\begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -begin{center} -\end_layout - -\end_inset - - -\begin_inset Tabular - - - - - - - - - - - -\begin_inset Text - -\begin_layout Plain Layout -Parameter -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Update rate -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -2 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -3 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -Wideband bit -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -Mode ID -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -3 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -3 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -3 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -3 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -3 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -LSP -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -12 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -12 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -12 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -12 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -Excitation gain -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -sub-frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -Excitation VQ -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -sub-frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -20 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -40 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -80 -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -Total -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -frame -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -36 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -112 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -192 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -352 -\end_layout - -\end_inset - - - - -\end_inset - - -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -end{center} -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Plain Layout -\begin_inset Caption - -\begin_layout Plain Layout -Bit allocation for high-band in wideband mode -\begin_inset CommandInset label -LatexCommand label -name "cap:bits-wideband" - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset Float table -placement h -wide true -sideways false -status open - -\begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -begin{center} -\end_layout - -\end_inset - - -\begin_inset Tabular - - - - - - - -\begin_inset Text - -\begin_layout Plain Layout -Mode/Quality -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Bit-rate -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -bit-rate -\end_layout - -\end_inset - - (bps) -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Quality/description -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -0 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -3,950 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Barely intelligible (mostly for comfort noise) -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -1 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -5,750 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Very noticeable artifacts/noise, poor intelligibility -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -2 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -7,750 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Very noticeable artifacts/noise, good intelligibility -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -3 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -9,800 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Artifacts/noise sometimes annoying -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -4 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -12,800 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Artifacts/noise usually noticeable -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -5 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -16,800 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Artifacts/noise sometimes noticeable -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -6 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -20,600 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Need good headphones to tell the difference -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -7 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -23,800 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Need good headphones to tell the difference -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -8 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -27,800 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Hard to tell the difference even with good headphones -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -9 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -34,200 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Hard to tell the difference even with good headphones -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -10 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -42,200 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Completely transparent for voice, good quality music -\end_layout - -\end_inset - - - - -\end_inset - - -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -end{center} -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Plain Layout -\begin_inset Caption - -\begin_layout Plain Layout -Quality versus bit-rate for the wideband encoder -\begin_inset CommandInset label -LatexCommand label -name "tab:wideband-quality" - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset ERT -status open - -\begin_layout Plain Layout - - -\backslash -clearpage -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -clearpage -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Chapter -\start_of_appendix -Sample code -\begin_inset CommandInset label -LatexCommand label -name "sec:Sample-code" - -\end_inset - - -\end_layout - -\begin_layout Standard -This section shows sample code for encoding and decoding speech using the - Speex API. - The commands can be used to encode and decode a file by calling: -\family typewriter - -\begin_inset Newline newline -\end_inset - -% sampleenc in_file.sw | sampledec out_file.sw -\family default - -\begin_inset Newline newline -\end_inset - -where both files are raw (no header) files encoded at 16 bits per sample - (in the machine natural endianness). -\end_layout - -\begin_layout Section -sampleenc.c -\end_layout - -\begin_layout Standard -sampleenc takes a raw 16 bits/sample file, encodes it and outputs a Speex - stream to stdout. - Note that the packing used is -\series bold -not -\series default - compatible with that of speexenc/speexdec. -\end_layout - -\begin_layout Standard -\begin_inset CommandInset include -LatexCommand lstinputlisting -filename "sampleenc.c" -lstparams "caption={Source code for sampleenc},label={sampleenc-source-code},numbers=left,numberstyle={\\footnotesize}" - -\end_inset - - -\end_layout - -\begin_layout Section -sampledec.c -\end_layout - -\begin_layout Standard -sampledec reads a Speex stream from stdin, decodes it and outputs it to - a raw 16 bits/sample file. - Note that the packing used is -\series bold -not -\series default - compatible with that of speexenc/speexdec. -\end_layout - -\begin_layout Standard -\begin_inset CommandInset include -LatexCommand lstinputlisting -filename "sampledec.c" -lstparams "caption={Source code for sampledec},label={sampledec-source-code},numbers=left,numberstyle={\\footnotesize}" - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset Newpage newpage -\end_inset - - -\end_layout - -\begin_layout Chapter -Jitter Buffer for Speex -\end_layout - -\begin_layout Standard -\begin_inset CommandInset include -LatexCommand lstinputlisting -filename "../speexclient/speex_jitter_buffer.c" -lstparams "caption={Example of using the jitter buffer for Speex packets},label={example-speex-jitter},numbers=left,numberstyle={\\footnotesize}" - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset Newpage newpage -\end_inset - - -\end_layout - -\begin_layout Chapter -IETF RTP Profile -\begin_inset CommandInset label -LatexCommand label -name "sec:IETF-draft" - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset CommandInset include -LatexCommand verbatiminput -filename "draft-ietf-avt-rtp-speex-05-tmp.txt" - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset Newpage newpage -\end_inset - - -\end_layout - -\begin_layout Chapter -Speex License -\begin_inset CommandInset label -LatexCommand label -name "sec:Speex-License" - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset CommandInset include -LatexCommand verbatiminput -filename "../COPYING" - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset Newpage newpage -\end_inset - - -\end_layout - -\begin_layout Chapter -GNU Free Documentation License -\end_layout - -\begin_layout Standard -Version 1.1, March 2000 -\end_layout - -\begin_layout Standard -Copyright (C) 2000 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted - to copy and distribute verbatim copies of this license document, but changing - it is not allowed. - -\end_layout - -\begin_layout Section* -0. - PREAMBLE -\end_layout - -\begin_layout Standard -The purpose of this License is to make a manual, textbook, or other written - document "free" in the sense of freedom: to assure everyone the effective - freedom to copy and redistribute it, with or without modifying it, either - commercially or noncommercially. - Secondarily, this License preserves for the author and publisher a way - to get credit for their work, while not being considered responsible for - modifications made by others. -\end_layout - -\begin_layout Standard -This License is a kind of "copyleft", which means that derivative works - of the document must themselves be free in the same sense. - It complements the GNU General Public License, which is a copyleft license - designed for free software. -\end_layout - -\begin_layout Standard -We have designed this License in order to use it for manuals for free software, - because free software needs free documentation: a free program should come - with manuals providing the same freedoms that the software does. - But this License is not limited to software manuals; it can be used for - any textual work, regardless of subject matter or whether it is published - as a printed book. - We recommend this License principally for works whose purpose is instruction - or reference. - -\end_layout - -\begin_layout Section* -1. - APPLICABILITY AND DEFINITIONS -\end_layout - -\begin_layout Standard -This License applies to any manual or other work that contains a notice - placed by the copyright holder saying it can be distributed under the terms - of this License. - The "Document", below, refers to any such manual or work. - Any member of the public is a licensee, and is addressed as "you". -\end_layout - -\begin_layout Standard -A "Modified Version" of the Document means any work containing the Document - or a portion of it, either copied verbatim, or with modifications and/or - translated into another language. -\end_layout - -\begin_layout Standard -A "Secondary Section" is a named appendix or a front-matter section of the - Document that deals exclusively with the relationship of the publishers - or authors of the Document to the Document's overall subject (or to related - matters) and contains nothing that could fall directly within that overall - subject. - (For example, if the Document is in part a textbook of mathematics, a Secondary - Section may not explain any mathematics.) The relationship could be a matter - of historical connection with the subject or with related matters, or of - legal, commercial, philosophical, ethical or political position regarding - them. -\end_layout - -\begin_layout Standard -The "Invariant Sections" are certain Secondary Sections whose titles are - designated, as being those of Invariant Sections, in the notice that says - that the Document is released under this License. -\end_layout - -\begin_layout Standard -The "Cover Texts" are certain short passages of text that are listed, as - Front-Cover Texts or Back-Cover Texts, in the notice that says that the - Document is released under this License. -\end_layout - -\begin_layout Standard -A "Transparent" copy of the Document means a machine-readable copy, represented - in a format whose specification is available to the general public, whose - contents can be viewed and edited directly and straightforwardly with generic - text editors or (for images composed of pixels) generic paint programs - or (for drawings) some widely available drawing editor, and that is suitable - for input to text formatters or for automatic translation to a variety - of formats suitable for input to text formatters. - A copy made in an otherwise Transparent file format whose markup has been - designed to thwart or discourage subsequent modification by readers is - not Transparent. - A copy that is not "Transparent" is called "Opaque". -\end_layout - -\begin_layout Standard -Examples of suitable formats for Transparent copies include plain ASCII - without markup, Texinfo input format, LaTeX input format, SGML or XML using - a publicly available DTD, and standard-conforming simple HTML designed - for human modification. - Opaque formats include PostScript, PDF, proprietary formats that can be - read and edited only by proprietary word processors, SGML or XML for which - the DTD and/or processing tools are not generally available, and the machine-ge -nerated HTML produced by some word processors for output purposes only. -\end_layout - -\begin_layout Standard -The "Title Page" means, for a printed book, the title page itself, plus - such following pages as are needed to hold, legibly, the material this - License requires to appear in the title page. - For works in formats which do not have any title page as such, "Title Page" - means the text near the most prominent appearance of the work's title, - preceding the beginning of the body of the text. -\end_layout - -\begin_layout Section* -2. - VERBATIM COPYING -\end_layout - -\begin_layout Standard -You may copy and distribute the Document in any medium, either commercially - or noncommercially, provided that this License, the copyright notices, - and the license notice saying this License applies to the Document are - reproduced in all copies, and that you add no other conditions whatsoever - to those of this License. - You may not use technical measures to obstruct or control the reading or - further copying of the copies you make or distribute. - However, you may accept compensation in exchange for copies. - If you distribute a large enough number of copies you must also follow - the conditions in section 3. -\end_layout - -\begin_layout Standard -You may also lend copies, under the same conditions stated above, and you - may publicly display copies. -\end_layout - -\begin_layout Section* -3. - COPYING IN QUANTITY -\end_layout - -\begin_layout Standard -If you publish printed copies of the Document numbering more than 100, and - the Document's license notice requires Cover Texts, you must enclose the - copies in covers that carry, clearly and legibly, all these Cover Texts: - Front-Cover Texts on the front cover, and Back-Cover Texts on the back - cover. - Both covers must also clearly and legibly identify you as the publisher - of these copies. - The front cover must present the full title with all words of the title - equally prominent and visible. - You may add other material on the covers in addition. - Copying with changes limited to the covers, as long as they preserve the - title of the Document and satisfy these conditions, can be treated as verbatim - copying in other respects. -\end_layout - -\begin_layout Standard -If the required texts for either cover are too voluminous to fit legibly, - you should put the first ones listed (as many as fit reasonably) on the - actual cover, and continue the rest onto adjacent pages. -\end_layout - -\begin_layout Standard -If you publish or distribute Opaque copies of the Document numbering more - than 100, you must either include a machine-readable Transparent copy along - with each Opaque copy, or state in or with each Opaque copy a publicly-accessib -le computer-network location containing a complete Transparent copy of the - Document, free of added material, which the general network-using public - has access to download anonymously at no charge using public-standard network - protocols. - If you use the latter option, you must take reasonably prudent steps, when - you begin distribution of Opaque copies in quantity, to ensure that this - Transparent copy will remain thus accessible at the stated location until - at least one year after the last time you distribute an Opaque copy (directly - or through your agents or retailers) of that edition to the public. -\end_layout - -\begin_layout Standard -It is requested, but not required, that you contact the authors of the Document - well before redistributing any large number of copies, to give them a chance - to provide you with an updated version of the Document. - -\end_layout - -\begin_layout Section* -4. - MODIFICATIONS -\end_layout - -\begin_layout Standard -You may copy and distribute a Modified Version of the Document under the - conditions of sections 2 and 3 above, provided that you release the Modified - Version under precisely this License, with the Modified Version filling - the role of the Document, thus licensing distribution and modification - of the Modified Version to whoever possesses a copy of it. - In addition, you must do these things in the Modified Version: -\end_layout - -\begin_layout Itemize -A. - Use in the Title Page (and on the covers, if any) a title distinct from - that of the Document, and from those of previous versions (which should, - if there were any, be listed in the History section of the Document). - You may use the same title as a previous version if the original publisher - of that version gives permission. -\end_layout - -\begin_layout Itemize -B. - List on the Title Page, as authors, one or more persons or entities responsible - for authorship of the modifications in the Modified Version, together with - at least five of the principal authors of the Document (all of its principal - authors, if it has less than five). -\end_layout - -\begin_layout Itemize -C. - State on the Title page the name of the publisher of the Modified Version, - as the publisher. -\end_layout - -\begin_layout Itemize -D. - Preserve all the copyright notices of the Document. -\end_layout - -\begin_layout Itemize -E. - Add an appropriate copyright notice for your modifications adjacent to - the other copyright notices. -\end_layout - -\begin_layout Itemize -F. - Include, immediately after the copyright notices, a license notice giving - the public permission to use the Modified Version under the terms of this - License, in the form shown in the Addendum below. -\end_layout - -\begin_layout Itemize -G. - Preserve in that license notice the full lists of Invariant Sections and - required Cover Texts given in the Document's license notice. -\end_layout - -\begin_layout Itemize -H. - Include an unaltered copy of this License. -\end_layout - -\begin_layout Itemize -I. - Preserve the section entitled "History", and its title, and add to it an - item stating at least the title, year, new authors, and publisher of the - Modified Version as given on the Title Page. - If there is no section entitled "History" in the Document, create one stating - the title, year, authors, and publisher of the Document as given on its - Title Page, then add an item describing the Modified Version as stated - in the previous sentence. -\end_layout - -\begin_layout Itemize -J. - Preserve the network location, if any, given in the Document for public - access to a Transparent copy of the Document, and likewise the network - locations given in the Document for previous versions it was based on. - These may be placed in the "History" section. - You may omit a network location for a work that was published at least - four years before the Document itself, or if the original publisher of - the version it refers to gives permission. -\end_layout - -\begin_layout Itemize -K. - In any section entitled "Acknowledgements" or "Dedications", preserve the - section's title, and preserve in the section all the substance and tone - of each of the contributor acknowledgements and/or dedications given therein. -\end_layout - -\begin_layout Itemize -L. - Preserve all the Invariant Sections of the Document, unaltered in their - text and in their titles. - Section numbers or the equivalent are not considered part of the section - titles. -\end_layout - -\begin_layout Itemize -M. - Delete any section entitled "Endorsements". - Such a section may not be included in the Modified Version. -\end_layout - -\begin_layout Itemize -N. - Do not retitle any existing section as "Endorsements" or to conflict in - title with any Invariant Section. - -\end_layout - -\begin_layout Standard -If the Modified Version includes new front-matter sections or appendices - that qualify as Secondary Sections and contain no material copied from - the Document, you may at your option designate some or all of these sections - as invariant. - To do this, add their titles to the list of Invariant Sections in the Modified - Version's license notice. - These titles must be distinct from any other section titles. -\end_layout - -\begin_layout Standard -You may add a section entitled "Endorsements", provided it contains nothing - but endorsements of your Modified Version by various parties--for example, - statements of peer review or that the text has been approved by an organization - as the authoritative definition of a standard. -\end_layout - -\begin_layout Standard -You may add a passage of up to five words as a Front-Cover Text, and a passage - of up to 25 words as a Back-Cover Text, to the end of the list of Cover - Texts in the Modified Version. - Only one passage of Front-Cover Text and one of Back-Cover Text may be - added by (or through arrangements made by) any one entity. - If the Document already includes a cover text for the same cover, previously - added by you or by arrangement made by the same entity you are acting on - behalf of, you may not add another; but you may replace the old one, on - explicit permission from the previous publisher that added the old one. -\end_layout - -\begin_layout Standard -The author(s) and publisher(s) of the Document do not by this License give - permission to use their names for publicity for or to assert or imply endorseme -nt of any Modified Version. - -\end_layout - -\begin_layout Section* -5. - COMBINING DOCUMENTS -\end_layout - -\begin_layout Standard -You may combine the Document with other documents released under this License, - under the terms defined in section 4 above for modified versions, provided - that you include in the combination all of the Invariant Sections of all - of the original documents, unmodified, and list them all as Invariant Sections - of your combined work in its license notice. -\end_layout - -\begin_layout Standard -The combined work need only contain one copy of this License, and multiple - identical Invariant Sections may be replaced with a single copy. - If there are multiple Invariant Sections with the same name but different - contents, make the title of each such section unique by adding at the end - of it, in parentheses, the name of the original author or publisher of - that section if known, or else a unique number. - Make the same adjustment to the section titles in the list of Invariant - Sections in the license notice of the combined work. -\end_layout - -\begin_layout Standard -In the combination, you must combine any sections entitled "History" in - the various original documents, forming one section entitled "History"; - likewise combine any sections entitled "Acknowledgements", and any sections - entitled "Dedications". - You must delete all sections entitled "Endorsements." -\end_layout - -\begin_layout Section* -6. - COLLECTIONS OF DOCUMENTS -\end_layout - -\begin_layout Standard -You may make a collection consisting of the Document and other documents - released under this License, and replace the individual copies of this - License in the various documents with a single copy that is included in - the collection, provided that you follow the rules of this License for - verbatim copying of each of the documents in all other respects. -\end_layout - -\begin_layout Standard -You may extract a single document from such a collection, and distribute - it individually under this License, provided you insert a copy of this - License into the extracted document, and follow this License in all other - respects regarding verbatim copying of that document. - -\end_layout - -\begin_layout Section* -7. - AGGREGATION WITH INDEPENDENT WORKS -\end_layout - -\begin_layout Standard -A compilation of the Document or its derivatives with other separate and - independent documents or works, in or on a volume of a storage or distribution - medium, does not as a whole count as a Modified Version of the Document, - provided no compilation copyright is claimed for the compilation. - Such a compilation is called an "aggregate", and this License does not - apply to the other self-contained works thus compiled with the Document, - on account of their being thus compiled, if they are not themselves derivative - works of the Document. -\end_layout - -\begin_layout Standard -If the Cover Text requirement of section 3 is applicable to these copies - of the Document, then if the Document is less than one quarter of the entire - aggregate, the Document's Cover Texts may be placed on covers that surround - only the Document within the aggregate. - Otherwise they must appear on covers around the whole aggregate. -\end_layout - -\begin_layout Section* -8. - TRANSLATION -\end_layout - -\begin_layout Standard -Translation is considered a kind of modification, so you may distribute - translations of the Document under the terms of section 4. - Replacing Invariant Sections with translations requires special permission - from their copyright holders, but you may include translations of some - or all Invariant Sections in addition to the original versions of these - Invariant Sections. - You may include a translation of this License provided that you also include - the original English version of this License. - In case of a disagreement between the translation and the original English - version of this License, the original English version will prevail. -\end_layout - -\begin_layout Section* -9. - TERMINATION -\end_layout - -\begin_layout Standard -You may not copy, modify, sublicense, or distribute the Document except - as expressly provided for under this License. - Any other attempt to copy, modify, sublicense or distribute the Document - is void, and will automatically terminate your rights under this License. - However, parties who have received copies, or rights, from you under this - License will not have their licenses terminated so long as such parties - remain in full compliance. - -\end_layout - -\begin_layout Section* -10. - FUTURE REVISIONS OF THIS LICENSE -\end_layout - -\begin_layout Standard -The Free Software Foundation may publish new, revised versions of the GNU - Free Documentation License from time to time. - Such new versions will be similar in spirit to the present version, but - may differ in detail to address new problems or concerns. - See http://www.gnu.org/copyleft/. -\end_layout - -\begin_layout Standard -Each version of the License is given a distinguishing version number. - If the Document specifies that a particular numbered version of this License - "or any later version" applies to it, you have the option of following - the terms and conditions either of that specified version or of any later - version that has been published (not as a draft) by the Free Software Foundatio -n. - If the Document does not specify a version number of this License, you - may choose any version ever published (not as a draft) by the Free Software - Foundation. -\end_layout - -\begin_layout Standard -\begin_inset CommandInset index_print -LatexCommand printindex - -\end_inset - - -\end_layout - -\end_body -\end_document diff --git a/Engine/lib/speex/doc/manual.pdf b/Engine/lib/speex/doc/manual.pdf deleted file mode 100644 index 292f304de..000000000 Binary files a/Engine/lib/speex/doc/manual.pdf and /dev/null differ diff --git a/Engine/lib/speex/doc/nb_celp.c b/Engine/lib/speex/doc/nb_celp.c deleted file mode 100644 index 50d5ffaca..000000000 --- a/Engine/lib/speex/doc/nb_celp.c +++ /dev/null @@ -1,182 +0,0 @@ -#include -#include "nb_celp.h" -#include "lsp.h" -#include "ltp.h" -#include "quant_lsp.h" -#include "cb_search.h" -#include "filters.h" -#include "os_support.h" - -#ifndef NULL -#define NULL 0 -#endif - -#define LSP_MARGIN .002f -#define SIG_SCALING 1.f -#define NB_DEC_BUFFER (NB_FRAME_SIZE+2*NB_PITCH_END+NB_SUBFRAME_SIZE+12) -#define NB_ORDER 10 -#define NB_FRAME_SIZE 160 -#define NB_SUBFRAME_SIZE 40 -#define NB_NB_SUBFRAMES 4 -#define NB_PITCH_START 17 -#define NB_PITCH_END 144 - - -struct speex_decode_state { - float excBuf[NB_DEC_BUFFER]; /**< Excitation buffer */ - float *exc; /**< Start of excitation frame */ - float old_qlsp[10]; /**< Quantized LSPs for previous frame */ - float interp_qlpc[10]; /**< Interpolated quantized LPCs */ - float mem_sp[10]; /**< Filter memory for synthesis signal */ - int first; /**< Is this the first frame? */ -}; - - -static const float exc_gain_quant_scal1[2] = {0.70469f, 1.05127f}; - - -struct speex_decode_state *nb_decoder_init(void) -{ - struct speex_decode_state *st; - - st = malloc(sizeof(*st)); - if (!st) - return NULL; - - memset(st, 0, sizeof(*st)); - st->first = 1; - - return st; -} - - -void nb_decoder_destroy(struct speex_decode_state *state) -{ - if (state) - free(state); -} - - -/* basic decoder using mode3 only */ -int nb_decode(struct speex_decode_state *st, SpeexBits *bits, float *out) -{ - int i, sub, wideband, mode, qe; - float ol_gain; - float innov[NB_SUBFRAME_SIZE]; - float exc32[NB_SUBFRAME_SIZE]; - float qlsp[NB_ORDER], interp_qlsp[NB_ORDER]; - float ak[NB_ORDER]; - - if (!bits) - return -1; - - st->exc = st->excBuf + 2*NB_PITCH_END + NB_SUBFRAME_SIZE + 6; - - /* Decode Sub-modes */ - do { - if (speex_bits_remaining(bits) < 5) - return -1; - - wideband = speex_bits_unpack_unsigned(bits, 1); - if (wideband) { - printf("wideband not supported\n"); - return -2; - } - - mode = speex_bits_unpack_unsigned(bits, 4); - if (mode == 15) - return -1; - - } while (mode > 8); - - if (mode != 3) { - printf("only mode 3 supported\n"); - return -2; - } - - /* Shift all buffers by one frame */ - SPEEX_MOVE(st->excBuf, st->excBuf+NB_FRAME_SIZE, - 2*NB_PITCH_END + NB_SUBFRAME_SIZE + 12); - - /* Unquantize LSPs */ - lsp_unquant_lbr(qlsp, NB_ORDER, bits); - - /* Handle first frame */ - if (st->first) { - st->first = 0; - - for (i=0; iold_qlsp[i] = qlsp[i]; - } - - /* Get global excitation gain */ - qe = speex_bits_unpack_unsigned(bits, 5); - ol_gain = SIG_SCALING*exp(qe/3.5); - - /* Loop on subframes */ - for (sub=0; sub<4; sub++) { - int offset, q_energy; - float *exc, *sp; - float ener; - - offset = NB_SUBFRAME_SIZE*sub; - exc = st->exc + offset; - sp = out + offset; - - SPEEX_MEMSET(exc, 0, NB_SUBFRAME_SIZE); - - /* Adaptive codebook contribution */ - pitch_unquant_3tap(exc, exc32, NB_PITCH_START, - NB_SUBFRAME_SIZE, bits, 0); - - sanitize_values32(exc32, -32000, 32000, NB_SUBFRAME_SIZE); - - /* Unquantize the innovation */ - SPEEX_MEMSET(innov, 0, NB_SUBFRAME_SIZE); - - /* Decode sub-frame gain correction */ - q_energy = speex_bits_unpack_unsigned(bits, 1); - ener = exc_gain_quant_scal1[q_energy] * ol_gain; - - /* Fixed codebook contribution */ - split_cb_shape_sign_unquant(innov, bits); - - /* De-normalize innovation and update excitation */ - signal_mul(innov, innov, ener, NB_SUBFRAME_SIZE); - - for (i=0; iexc[-NB_SUBFRAME_SIZE], NB_FRAME_SIZE); - - /* Loop on subframes */ - for (sub=0; sub<4; sub++) { - const int offset = NB_SUBFRAME_SIZE*sub; - float *sp, *exc; - - sp = out + offset; - exc = st->exc + offset; - - /* LSP interpolation (quantized and unquantized) */ - lsp_interpolate(st->old_qlsp, qlsp, interp_qlsp, NB_ORDER, - sub, NB_NB_SUBFRAMES, LSP_MARGIN); - - /* Compute interpolated LPCs (unquantized) */ - lsp_to_lpc(interp_qlsp, ak, NB_ORDER); - - iir_mem16(sp, st->interp_qlpc, sp, NB_SUBFRAME_SIZE, - NB_ORDER, st->mem_sp); - - /* Save for interpolation in next frame */ - for (i=0; iinterp_qlpc[i] = ak[i]; - } - - /* Store the LSPs for interpolation in the next frame */ - for (i=0; iold_qlsp[i] = qlsp[i]; - - return 0; -} diff --git a/Engine/lib/speex/doc/programming.html b/Engine/lib/speex/doc/programming.html deleted file mode 100644 index 7b5bc7ae6..000000000 --- a/Engine/lib/speex/doc/programming.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - Speex Programming - - - - - -
-

Speex Programming

- -
-

Encoding

- In order to encode speech using Speex, you first need to:
- -
-
#include <speex.h>
-
- You then need to declare a Speex bit-packing struct
- -
-
SpeexBits bits;
-
- and a Speex encoder state
- -
-
void *enc_state;
-
- The two are initialized by:
- -
-
speex_bits_init(&bits);
- -
enc_state = speex_encoder_init(&speex_nb_mode);
-
- For wideband coding, speex_nb_mode will be replaced by speex_wb_mode -. In most cases, you will need to know the frame size used by the mode you -are using. You can get that value in the frame_size variable with:
-
speex_encoder_ctl(enc_state, SPEEX_GET_FRAME_SIZE, &frame_size);
-
- For every input frame:
- -
-
speex_bits_reset(&bits);
- -
speex_encode(enc_state, input_frame, &bits);
- -
nbBytes = speex_bits_write(&bits, byte_ptr, MAX_NB_BYTES);
-
- where input_frame is a (float *) pointing to the beginning -of a speech frame, byte_ptr is a (char *) where the encoded frame will -be written, MAX_NB_BYTES is the maximum number of bytes that can be -written to byte_ptr without causing an overflow and nbBytes - is the number of bytes actually written to byte_ptr (the encoded -size in bytes).
-
- After you're done with the encoding, free all resources with:
- -
-
speex_bits_destroy(&bits);
- -
speex_encoder_destroy(&enc_state);
-
- That's about it for the encoder.
- -

Decoding

- In order to encode speech using Speex, you first need to:
- -
-
#include <speex.h>
-
- You then need to declare a Speex bit-packing struct
- -
-
SpeexBits bits;
-
- and a Speex encoder state
- -
-
void *dec_state;
-
- The two are initialized by:
- -
-
speex_bits_init(&bits);
- -
dec_state = speex_decoder_init(&speex_nb_mode);
-
- For wideband decoding, speex_nb_mode will be replaced by speex_wb_mode -. You can get that value in the frame_size variable with:
- -
speex_decoder_ctl(dec_state, SPEEX_GET_FRAME_SIZE, &frame_size);
-
- There is also a parameter that can be set for the decoder: whether or not -to use a perceptual post-filter. This can be set by:
-
speex_decoder_ctl(dec_state, SPEEX_SET_PF, &pf);
-
-where pf is an int that with value 0 to have the post-filter -disabled and 1 to have it enabled.
-
-For every input frame:
- -
-
speex_bits_read_from(&bits, input_bytes, nbBytes);
- -
speex_decode(st, &bits, output_frame, 0);
-
- where input_bytes is a (char *) containing the bit-stream -data received for a frame, nbBytes is the size (in bytes) of that -bit-stream, and output_frame is a (float *) and points to the -area where the decoded speech frame will be written. The last argument indicates -whether the frame we'd like to decode was lost. A value of 0 indicates the -normal case where bits points to the bit of the current frame. A value of -1 indicates that we don't have the bits for the current frame, in which case -the bits argument should be the same as the bits for the last correctly received -frame. When a frame is lost, the Speex decoder will do its best to "guess" -the sorrect signal.
-
-
-
- - - diff --git a/Engine/lib/speex/doc/ref_shaping.eps b/Engine/lib/speex/doc/ref_shaping.eps deleted file mode 100644 index 4ef7007f5..000000000 --- a/Engine/lib/speex/doc/ref_shaping.eps +++ /dev/null @@ -1,2045 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: printout.eps -%%Creator: gnuplot 4.0 patchlevel 0 -%%CreationDate: Mon Mar 6 17:15:27 2006 -%%DocumentFonts: (atend) -%%BoundingBox: 50 50 410 302 -%%Orientation: Portrait -%%EndComments -/gnudict 256 dict def -gnudict begin -/Color true def -/Solid false def -/gnulinewidth 5.000 def -/userlinewidth gnulinewidth def -/vshift -46 def -/dl {10.0 mul} def -/hpt_ 31.5 def -/vpt_ 31.5 def -/hpt hpt_ def -/vpt vpt_ def -/Rounded false def -/M {moveto} bind def -/L {lineto} bind def -/R {rmoveto} bind def -/V {rlineto} bind def -/N {newpath moveto} bind def -/C {setrgbcolor} bind def -/f {rlineto fill} bind def -/vpt2 vpt 2 mul def -/hpt2 hpt 2 mul def -/Lshow { currentpoint stroke M - 0 vshift R show } def -/Rshow { currentpoint stroke M - dup stringwidth pop neg vshift R show } def -/Cshow { currentpoint stroke M - dup stringwidth pop -2 div vshift R show } def -/UP { dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def - /hpt2 hpt 2 mul def /vpt2 vpt 2 mul def } def -/DL { Color {setrgbcolor Solid {pop []} if 0 setdash } - {pop pop pop 0 setgray Solid {pop []} if 0 setdash} ifelse } def -/BL { stroke userlinewidth 2 mul setlinewidth - Rounded { 1 setlinejoin 1 setlinecap } if } def -/AL { stroke userlinewidth 2 div setlinewidth - Rounded { 1 setlinejoin 1 setlinecap } if } def -/UL { dup gnulinewidth mul /userlinewidth exch def - dup 1 lt {pop 1} if 10 mul /udl exch def } def -/PL { stroke userlinewidth setlinewidth - Rounded { 1 setlinejoin 1 setlinecap } if } def -/LTw { PL [] 1 setgray } def -/LTb { BL [] 0 0 0 DL } def -/LTa { AL [1 udl mul 2 udl mul] 0 setdash 0 0 0 setrgbcolor } def -/LT0 { PL [] 1 0 0 DL } def -/LT1 { PL [4 dl 2 dl] 0 1 0 DL } def -/LT2 { PL [2 dl 3 dl] 0 0 1 DL } def -/LT3 { PL [1 dl 1.5 dl] 1 0 1 DL } def -/LT4 { PL [5 dl 2 dl 1 dl 2 dl] 0 1 1 DL } def -/LT5 { PL [4 dl 3 dl 1 dl 3 dl] 1 1 0 DL } def -/LT6 { PL [2 dl 2 dl 2 dl 4 dl] 0 0 0 DL } def -/LT7 { PL [2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 1 0.3 0 DL } def -/LT8 { PL [2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 0.5 0.5 0.5 DL } def -/Pnt { stroke [] 0 setdash - gsave 1 setlinecap M 0 0 V stroke grestore } def -/Dia { stroke [] 0 setdash 2 copy vpt add M - hpt neg vpt neg V hpt vpt neg V - hpt vpt V hpt neg vpt V closepath stroke - Pnt } def -/Pls { stroke [] 0 setdash vpt sub M 0 vpt2 V - currentpoint stroke M - hpt neg vpt neg R hpt2 0 V stroke - } def -/Box { stroke [] 0 setdash 2 copy exch hpt sub exch vpt add M - 0 vpt2 neg V hpt2 0 V 0 vpt2 V - hpt2 neg 0 V closepath stroke - Pnt } def -/Crs { stroke [] 0 setdash exch hpt sub exch vpt add M - hpt2 vpt2 neg V currentpoint stroke M - hpt2 neg 0 R hpt2 vpt2 V stroke } def -/TriU { stroke [] 0 setdash 2 copy vpt 1.12 mul add M - hpt neg vpt -1.62 mul V - hpt 2 mul 0 V - hpt neg vpt 1.62 mul V closepath stroke - Pnt } def -/Star { 2 copy Pls Crs } def -/BoxF { stroke [] 0 setdash exch hpt sub exch vpt add M - 0 vpt2 neg V hpt2 0 V 0 vpt2 V - hpt2 neg 0 V closepath fill } def -/TriUF { stroke [] 0 setdash vpt 1.12 mul add M - hpt neg vpt -1.62 mul V - hpt 2 mul 0 V - hpt neg vpt 1.62 mul V closepath fill } def -/TriD { stroke [] 0 setdash 2 copy vpt 1.12 mul sub M - hpt neg vpt 1.62 mul V - hpt 2 mul 0 V - hpt neg vpt -1.62 mul V closepath stroke - Pnt } def -/TriDF { stroke [] 0 setdash vpt 1.12 mul sub M - hpt neg vpt 1.62 mul V - hpt 2 mul 0 V - hpt neg vpt -1.62 mul V closepath fill} def -/DiaF { stroke [] 0 setdash vpt add M - hpt neg vpt neg V hpt vpt neg V - hpt vpt V hpt neg vpt V closepath fill } def -/Pent { stroke [] 0 setdash 2 copy gsave - translate 0 hpt M 4 {72 rotate 0 hpt L} repeat - closepath stroke grestore Pnt } def -/PentF { stroke [] 0 setdash gsave - translate 0 hpt M 4 {72 rotate 0 hpt L} repeat - closepath fill grestore } def -/Circle { stroke [] 0 setdash 2 copy - hpt 0 360 arc stroke Pnt } def -/CircleF { stroke [] 0 setdash hpt 0 360 arc fill } def -/C0 { BL [] 0 setdash 2 copy moveto vpt 90 450 arc } bind def -/C1 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 0 90 arc closepath fill - vpt 0 360 arc closepath } bind def -/C2 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 90 180 arc closepath fill - vpt 0 360 arc closepath } bind def -/C3 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 0 180 arc closepath fill - vpt 0 360 arc closepath } bind def -/C4 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 180 270 arc closepath fill - vpt 0 360 arc closepath } bind def -/C5 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 0 90 arc - 2 copy moveto - 2 copy vpt 180 270 arc closepath fill - vpt 0 360 arc } bind def -/C6 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 90 270 arc closepath fill - vpt 0 360 arc closepath } bind def -/C7 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 0 270 arc closepath fill - vpt 0 360 arc closepath } bind def -/C8 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 270 360 arc closepath fill - vpt 0 360 arc closepath } bind def -/C9 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 270 450 arc closepath fill - vpt 0 360 arc closepath } bind def -/C10 { BL [] 0 setdash 2 copy 2 copy moveto vpt 270 360 arc closepath fill - 2 copy moveto - 2 copy vpt 90 180 arc closepath fill - vpt 0 360 arc closepath } bind def -/C11 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 0 180 arc closepath fill - 2 copy moveto - 2 copy vpt 270 360 arc closepath fill - vpt 0 360 arc closepath } bind def -/C12 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 180 360 arc closepath fill - vpt 0 360 arc closepath } bind def -/C13 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 0 90 arc closepath fill - 2 copy moveto - 2 copy vpt 180 360 arc closepath fill - vpt 0 360 arc closepath } bind def -/C14 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 90 360 arc closepath fill - vpt 0 360 arc } bind def -/C15 { BL [] 0 setdash 2 copy vpt 0 360 arc closepath fill - vpt 0 360 arc closepath } bind def -/Rec { newpath 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto - neg 0 rlineto closepath } bind def -/Square { dup Rec } bind def -/Bsquare { vpt sub exch vpt sub exch vpt2 Square } bind def -/S0 { BL [] 0 setdash 2 copy moveto 0 vpt rlineto BL Bsquare } bind def -/S1 { BL [] 0 setdash 2 copy vpt Square fill Bsquare } bind def -/S2 { BL [] 0 setdash 2 copy exch vpt sub exch vpt Square fill Bsquare } bind def -/S3 { BL [] 0 setdash 2 copy exch vpt sub exch vpt2 vpt Rec fill Bsquare } bind def -/S4 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt Square fill Bsquare } bind def -/S5 { BL [] 0 setdash 2 copy 2 copy vpt Square fill - exch vpt sub exch vpt sub vpt Square fill Bsquare } bind def -/S6 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill Bsquare } bind def -/S7 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill - 2 copy vpt Square fill - Bsquare } bind def -/S8 { BL [] 0 setdash 2 copy vpt sub vpt Square fill Bsquare } bind def -/S9 { BL [] 0 setdash 2 copy vpt sub vpt vpt2 Rec fill Bsquare } bind def -/S10 { BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt Square fill - Bsquare } bind def -/S11 { BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt2 vpt Rec fill - Bsquare } bind def -/S12 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill Bsquare } bind def -/S13 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill - 2 copy vpt Square fill Bsquare } bind def -/S14 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill - 2 copy exch vpt sub exch vpt Square fill Bsquare } bind def -/S15 { BL [] 0 setdash 2 copy Bsquare fill Bsquare } bind def -/D0 { gsave translate 45 rotate 0 0 S0 stroke grestore } bind def -/D1 { gsave translate 45 rotate 0 0 S1 stroke grestore } bind def -/D2 { gsave translate 45 rotate 0 0 S2 stroke grestore } bind def -/D3 { gsave translate 45 rotate 0 0 S3 stroke grestore } bind def -/D4 { gsave translate 45 rotate 0 0 S4 stroke grestore } bind def -/D5 { gsave translate 45 rotate 0 0 S5 stroke grestore } bind def -/D6 { gsave translate 45 rotate 0 0 S6 stroke grestore } bind def -/D7 { gsave translate 45 rotate 0 0 S7 stroke grestore } bind def -/D8 { gsave translate 45 rotate 0 0 S8 stroke grestore } bind def -/D9 { gsave translate 45 rotate 0 0 S9 stroke grestore } bind def -/D10 { gsave translate 45 rotate 0 0 S10 stroke grestore } bind def -/D11 { gsave translate 45 rotate 0 0 S11 stroke grestore } bind def -/D12 { gsave translate 45 rotate 0 0 S12 stroke grestore } bind def -/D13 { gsave translate 45 rotate 0 0 S13 stroke grestore } bind def -/D14 { gsave translate 45 rotate 0 0 S14 stroke grestore } bind def -/D15 { gsave translate 45 rotate 0 0 S15 stroke grestore } bind def -/DiaE { stroke [] 0 setdash vpt add M - hpt neg vpt neg V hpt vpt neg V - hpt vpt V hpt neg vpt V closepath stroke } def -/BoxE { stroke [] 0 setdash exch hpt sub exch vpt add M - 0 vpt2 neg V hpt2 0 V 0 vpt2 V - hpt2 neg 0 V closepath stroke } def -/TriUE { stroke [] 0 setdash vpt 1.12 mul add M - hpt neg vpt -1.62 mul V - hpt 2 mul 0 V - hpt neg vpt 1.62 mul V closepath stroke } def -/TriDE { stroke [] 0 setdash vpt 1.12 mul sub M - hpt neg vpt 1.62 mul V - hpt 2 mul 0 V - hpt neg vpt -1.62 mul V closepath stroke } def -/PentE { stroke [] 0 setdash gsave - translate 0 hpt M 4 {72 rotate 0 hpt L} repeat - closepath stroke grestore } def -/CircE { stroke [] 0 setdash - hpt 0 360 arc stroke } def -/Opaque { gsave closepath 1 setgray fill grestore 0 setgray closepath } def -/DiaW { stroke [] 0 setdash vpt add M - hpt neg vpt neg V hpt vpt neg V - hpt vpt V hpt neg vpt V Opaque stroke } def -/BoxW { stroke [] 0 setdash exch hpt sub exch vpt add M - 0 vpt2 neg V hpt2 0 V 0 vpt2 V - hpt2 neg 0 V Opaque stroke } def -/TriUW { stroke [] 0 setdash vpt 1.12 mul add M - hpt neg vpt -1.62 mul V - hpt 2 mul 0 V - hpt neg vpt 1.62 mul V Opaque stroke } def -/TriDW { stroke [] 0 setdash vpt 1.12 mul sub M - hpt neg vpt 1.62 mul V - hpt 2 mul 0 V - hpt neg vpt -1.62 mul V Opaque stroke } def -/PentW { stroke [] 0 setdash gsave - translate 0 hpt M 4 {72 rotate 0 hpt L} repeat - Opaque stroke grestore } def -/CircW { stroke [] 0 setdash - hpt 0 360 arc Opaque stroke } def -/BoxFill { gsave Rec 1 setgray fill grestore } def -/BoxColFill { - gsave Rec - /Fillden exch def - currentrgbcolor - /ColB exch def /ColG exch def /ColR exch def - /ColR ColR Fillden mul Fillden sub 1 add def - /ColG ColG Fillden mul Fillden sub 1 add def - /ColB ColB Fillden mul Fillden sub 1 add def - ColR ColG ColB setrgbcolor - fill grestore } def -% -% PostScript Level 1 Pattern Fill routine -% Usage: x y w h s a XX PatternFill -% x,y = lower left corner of box to be filled -% w,h = width and height of box -% a = angle in degrees between lines and x-axis -% XX = 0/1 for no/yes cross-hatch -% -/PatternFill { gsave /PFa [ 9 2 roll ] def - PFa 0 get PFa 2 get 2 div add PFa 1 get PFa 3 get 2 div add translate - PFa 2 get -2 div PFa 3 get -2 div PFa 2 get PFa 3 get Rec - gsave 1 setgray fill grestore clip - currentlinewidth 0.5 mul setlinewidth - /PFs PFa 2 get dup mul PFa 3 get dup mul add sqrt def - 0 0 M PFa 5 get rotate PFs -2 div dup translate - 0 1 PFs PFa 4 get div 1 add floor cvi - { PFa 4 get mul 0 M 0 PFs V } for - 0 PFa 6 get ne { - 0 1 PFs PFa 4 get div 1 add floor cvi - { PFa 4 get mul 0 2 1 roll M PFs 0 V } for - } if - stroke grestore } def -% -/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont -dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall -currentdict end definefont pop -end -%%EndProlog -gnudict begin -gsave -50 50 translate -0.050 0.050 scale -0 setgray -newpath -(Helvetica) findfont 140 scalefont setfont -1.000 UL -LTb -630 420 M -63 0 V -6269 0 R --63 0 V -546 420 M -(-40) Rshow -1.000 UL -LTb -630 1056 M -63 0 V -6269 0 R --63 0 V --6353 0 R -(-30) Rshow -1.000 UL -LTb -630 1692 M -63 0 V -6269 0 R --63 0 V --6353 0 R -(-20) Rshow -1.000 UL -LTb -630 2328 M -63 0 V -6269 0 R --63 0 V --6353 0 R -(-10) Rshow -1.000 UL -LTb -630 2964 M -63 0 V -6269 0 R --63 0 V --6353 0 R -( 0) Rshow -1.000 UL -LTb -630 3600 M -63 0 V -6269 0 R --63 0 V --6353 0 R -( 10) Rshow -1.000 UL -LTb -630 4236 M -63 0 V -6269 0 R --63 0 V --6353 0 R -( 20) Rshow -1.000 UL -LTb -630 4872 M -63 0 V -6269 0 R --63 0 V --6353 0 R -( 30) Rshow -1.000 UL -LTb -630 420 M -0 63 V -0 4389 R -0 -63 V -630 280 M -( 0) Cshow -1.000 UL -LTb -1421 420 M -0 63 V -0 4389 R -0 -63 V -0 -4529 R -( 500) Cshow -1.000 UL -LTb -2213 420 M -0 63 V -0 4389 R -0 -63 V -0 -4529 R -( 1000) Cshow -1.000 UL -LTb -3004 420 M -0 63 V -0 4389 R -0 -63 V -0 -4529 R -( 1500) Cshow -1.000 UL -LTb -3796 420 M -0 63 V -0 4389 R -0 -63 V -0 -4529 R -( 2000) Cshow -1.000 UL -LTb -4587 420 M -0 63 V -0 4389 R -0 -63 V -0 -4529 R -( 2500) Cshow -1.000 UL -LTb -5379 420 M -0 63 V -0 4389 R -0 -63 V -0 -4529 R -( 3000) Cshow -1.000 UL -LTb -6170 420 M -0 63 V -0 4389 R -0 -63 V -0 -4529 R -( 3500) Cshow -1.000 UL -LTb -6962 420 M -0 63 V -0 4389 R -0 -63 V -0 -4529 R -( 4000) Cshow -1.000 UL -LTb -1.000 UL -LTb -630 420 M -6332 0 V -0 4452 V --6332 0 V -630 420 L -LTb -140 2646 M -currentpoint gsave translate 90 rotate 0 0 M -(Response \(dB\)) Cshow -grestore -LTb -3796 70 M -(Frequency \(Hz\)) Cshow -1.000 UP -1.000 UL -LT0 -LTb -6311 4739 M -(Speech signal) Rshow -LT0 -6395 4739 M -399 0 V -630 1817 M -12 -132 V -13 -287 V -12 256 V -12 139 V -13 -127 V -12 -193 V -13 256 V -12 101 V -12 -189 V -13 -269 V -12 429 V -12 152 V -13 -102 V -12 -276 V -13 139 V -12 115 V -12 -205 V -13 -174 V -12 485 V -12 193 V -13 37 V -12 -17 V -12 41 V -13 230 V -12 242 V -13 107 V -12 190 V -12 513 V -13 436 V -12 323 V -12 236 V -13 168 V -12 110 V -12 58 V -13 9 V -12 -40 V -13 -90 V -12 -141 V -12 -197 V -13 -251 V -12 -289 V -12 -283 V -13 -247 V -12 -265 V -13 -324 V -12 -302 V -12 -231 V -13 -75 V -12 150 V -12 1 V -13 -298 V -1273 782 L -12 1103 V -13 76 V -12 -338 V -13 252 V -12 357 V -12 86 V -13 -118 V -12 -341 V -12 -20 V -13 364 V -12 243 V -12 212 V -13 214 V -12 208 V -13 180 V -12 136 V -12 82 V -13 23 V -12 -40 V -12 -107 V -13 -177 V -12 -240 V -13 -259 V -12 -215 V -12 -220 V -13 -297 V -12 -196 V -12 -128 V -13 -701 V -12 632 V -12 329 V -13 -25 V -12 -470 V -13 -54 V -12 538 V -12 70 V -13 -246 V -1743 551 L -12 1111 V -13 185 V -12 -159 V -1793 652 L -12 893 V -12 321 V -13 103 V -12 164 V -12 262 V -13 239 V -12 190 V -12 141 V -stroke -1891 2965 M -13 91 V -12 39 V -13 -13 V -12 -62 V -12 -97 V -13 -110 V -12 -120 V -12 -161 V -13 -265 V -12 -453 V -12 -215 V -13 139 V -12 -195 V -2062 420 L -5 0 R -10 961 V -12 135 V -13 -422 V -12 167 V -12 491 V -13 101 V -12 -169 V -13 -737 V -12 482 V -12 299 V -13 -48 V -12 -421 V -12 -151 V -13 434 V -12 -3 V -12 -378 V -13 -12 V -12 298 V -13 -187 V -12 -44 V -12 658 V -13 272 V -12 90 V -12 -49 V -13 -191 V -12 -370 V -13 -579 V -12 -329 V -12 385 V -13 444 V -12 172 V -12 -57 V -13 -407 V -12 -311 V -12 617 V -13 97 V -12 -198 V -13 -469 V -12 446 V -12 177 V -13 -114 V -12 -483 V -12 196 V -13 269 V -12 -74 V -12 -404 V -13 263 V -12 248 V -13 -37 V -12 -66 V -12 339 V -13 312 V -12 244 V -12 215 V -13 176 V -12 125 V -13 69 V -12 15 V -12 -30 V -13 -64 V -12 -85 V -12 -104 V -13 -138 V -12 -195 V -12 -278 V -13 -354 V -12 -257 V -13 -43 V -12 -20 V -12 -73 V -13 -202 V -12 -25 V -12 318 V -13 132 V -12 -73 V -12 -242 V -13 107 V -12 220 V -13 7 V -12 -277 V -9 -811 V -6 0 R -10 887 V -12 241 V -12 20 V -13 -14 V -12 241 V -13 323 V -12 262 V -stroke -3153 2380 M -12 197 V -13 138 V -12 86 V -12 36 V -13 -10 V -12 -54 V -12 -92 V -13 -116 V -12 -108 V -13 -73 V -12 -63 V -12 -107 V -13 -195 V -12 -267 V -12 -88 V -13 50 V -12 -97 V -13 -367 V -12 -285 V -12 374 V -13 3 V -12 -352 V -12 88 V -13 347 V -12 47 V -12 -192 V -13 -264 V -12 200 V -13 16 V -12 -421 V -12 296 V -13 398 V -12 65 V -12 -212 V -13 69 V -12 453 V -12 240 V -13 104 V -12 12 V -13 -52 V -12 -82 V -12 -69 V -13 -34 V -12 -25 V -12 -64 V -13 -158 V -12 -346 V -13 -166 V -12 375 V -12 139 V -13 -46 V -12 -207 V -12 -187 V -13 102 V -12 -14 V -12 -357 V -13 -271 V -12 601 V -13 119 V -12 -172 V -12 -486 V -13 521 V -12 256 V -12 10 V -13 -219 V -12 -294 V -13 446 V -12 285 V -12 167 V -13 137 V -12 152 V -12 161 V -13 144 V -12 106 V -12 58 V -13 7 V -12 -44 V -13 -87 V -12 -116 V -12 -119 V -13 -118 V -12 -152 V -12 -241 V -13 -363 V -12 -109 V -12 172 V -13 43 V -12 -75 V -13 -176 V -12 -313 V -12 -344 V -13 236 V -12 93 V -12 -169 V -13 -102 V -12 320 V -13 123 V -12 17 V -12 207 V -13 270 V -12 201 V -12 186 V -13 217 V -12 213 V -stroke -4439 2543 M -12 174 V -13 125 V -12 79 V -13 42 V -12 14 V -12 -3 V -13 -17 V -12 -34 V -12 -62 V -13 -102 V -12 -149 V -12 -182 V -13 -151 V -12 -70 V -13 -73 V -12 -146 V -12 -150 V -13 43 V -12 81 V -12 -27 V -13 -148 V -12 -213 V -13 -14 V -12 246 V -12 262 V -13 190 V -12 94 V -12 -7 V -13 -56 V -12 149 V -12 312 V -13 269 V -12 212 V -13 169 V -12 136 V -12 105 V -13 76 V -12 45 V -12 15 V -13 -15 V -12 -43 V -13 -66 V -12 -80 V -12 -83 V -13 -79 V -12 -80 V -12 -99 V -13 -136 V -12 -193 V -12 -274 V -13 -400 V -12 -462 V -13 173 V -12 148 V -12 -21 V -13 -198 V -12 -146 V -12 391 V -13 253 V -12 99 V -12 -38 V -13 -208 V -12 -260 V -13 418 V -12 330 V -12 210 V -13 153 V -12 123 V -12 105 V -13 88 V -12 68 V -13 47 V -12 24 V -12 1 V -13 -19 V -12 -38 V -12 -54 V -13 -67 V -12 -80 V -12 -93 V -13 -111 V -12 -132 V -13 -152 V -12 -167 V -12 -183 V -13 -211 V -12 -236 V -12 -139 V -13 15 V -12 -22 V -13 -164 V -12 -405 V -12 -211 V -13 440 V -12 230 V -12 152 V -13 96 V -12 29 V -12 -28 V -13 -10 V -12 81 V -13 96 V -12 29 V -12 -69 V -stroke -5725 2104 M -13 -186 V -12 -239 V -12 142 V -13 249 V -12 155 V -12 88 V -13 49 V -12 35 V -13 39 V -12 38 V -12 13 V -13 -34 V -12 -87 V -12 -112 V -13 -72 V -12 -35 V -13 -100 V -12 -269 V -12 -452 V -13 296 V -12 99 V -12 -312 V -13 242 V -12 513 V -12 237 V -13 88 V -12 -21 V -13 -82 V -12 -1 V -12 153 V -13 177 V -12 156 V -12 145 V -13 134 V -12 114 V -12 87 V -13 56 V -12 26 V -13 -3 V -12 -30 V -12 -52 V -13 -74 V -12 -93 V -12 -108 V -13 -121 V -12 -130 V -13 -129 V -12 -118 V -12 -100 V -13 -92 V -12 -105 V -12 -135 V -13 -172 V -12 -195 V -12 -222 V -13 -353 V -12 -548 V -13 682 V -12 273 V -12 79 V -13 -59 V -12 -188 V -12 -225 V -13 39 V -12 80 V -13 -43 V -12 -44 V -12 184 V -13 213 V -12 127 V -12 42 V -13 -37 V -12 -115 V -12 -182 V -13 -179 V -12 -53 V -13 12 V -12 6 V -12 20 V -13 10 V -12 -65 V -12 -195 V -13 -296 V -12 56 V -12 100 V -13 -118 V -12 -182 V -13 253 V -12 155 V -12 -50 V -13 -222 V -12 21 V -12 197 V -13 7 V -12 -194 V -13 -77 V -12 240 V -12 73 V -13 -132 V -1.000 UL -LT1 -LTb -6311 4599 M -(LPC synthesis filter) Rshow -LT1 -6395 4599 M -399 0 V -630 4034 M -12 0 V -13 0 V -12 1 V -12 1 V -13 1 V -12 1 V -13 1 V -12 2 V -12 2 V -13 3 V -12 2 V -12 4 V -13 3 V -12 5 V -13 4 V -12 6 V -12 6 V -13 7 V -12 8 V -12 8 V -13 10 V -12 11 V -12 11 V -13 13 V -12 15 V -13 16 V -12 17 V -12 19 V -13 21 V -12 23 V -12 25 V -13 27 V -12 29 V -12 31 V -13 32 V -12 33 V -13 33 V -12 30 V -12 26 V -13 16 V -12 4 V -12 -11 V -13 -26 V -12 -38 V -13 -49 V -12 -54 V -12 -56 V -13 -58 V -12 -57 V -12 -55 V -13 -53 V -12 -52 V -12 -49 V -13 -47 V -12 -45 V -13 -44 V -12 -41 V -12 -40 V -13 -38 V -12 -37 V -12 -35 V -13 -35 V -12 -33 V -12 -31 V -13 -31 V -12 -30 V -13 -29 V -12 -28 V -12 -27 V -13 -26 V -12 -26 V -12 -24 V -13 -25 V -12 -23 V -13 -23 V -12 -22 V -12 -22 V -13 -21 V -12 -20 V -12 -20 V -13 -20 V -12 -19 V -12 -19 V -13 -18 V -12 -17 V -13 -18 V -12 -17 V -12 -16 V -13 -16 V -12 -16 V -12 -15 V -13 -15 V -12 -15 V -13 -14 V -12 -14 V -12 -14 V -13 -13 V -12 -13 V -12 -13 V -13 -12 V -12 -13 V -12 -11 V -stroke -1891 2822 M -13 -12 V -12 -11 V -13 -11 V -12 -11 V -12 -11 V -13 -10 V -12 -10 V -12 -10 V -13 -10 V -12 -9 V -12 -9 V -13 -9 V -12 -8 V -13 -9 V -12 -8 V -12 -8 V -13 -8 V -12 -7 V -12 -8 V -13 -7 V -12 -7 V -13 -7 V -12 -6 V -12 -6 V -13 -7 V -12 -6 V -12 -5 V -13 -6 V -12 -5 V -12 -6 V -13 -5 V -12 -5 V -13 -4 V -12 -5 V -12 -4 V -13 -5 V -12 -4 V -12 -4 V -13 -3 V -12 -4 V -13 -3 V -12 -4 V -12 -3 V -13 -3 V -12 -2 V -12 -3 V -13 -3 V -12 -2 V -12 -2 V -13 -2 V -12 -2 V -13 -2 V -12 -2 V -12 -1 V -13 -2 V -12 -1 V -12 -1 V -13 -2 V -12 -1 V -12 0 V -13 -1 V -12 -1 V -13 0 V -12 -1 V -12 0 V -13 0 V -12 -1 V -12 0 V -13 0 V -12 0 V -13 0 V -12 1 V -12 0 V -13 0 V -12 1 V -12 0 V -13 1 V -12 0 V -12 1 V -13 1 V -12 0 V -13 1 V -12 1 V -12 1 V -13 0 V -12 1 V -12 1 V -13 1 V -12 1 V -12 0 V -13 1 V -12 1 V -13 1 V -12 0 V -12 1 V -13 1 V -12 0 V -12 1 V -13 1 V -12 0 V -13 1 V -12 0 V -12 0 V -13 1 V -stroke -3178 2508 M -12 0 V -12 0 V -13 0 V -12 0 V -12 0 V -13 0 V -12 0 V -13 0 V -12 0 V -12 -1 V -13 0 V -12 -1 V -12 0 V -13 -1 V -12 0 V -13 -1 V -12 -1 V -12 0 V -13 -1 V -12 -1 V -12 -1 V -13 -1 V -12 -1 V -12 0 V -13 -1 V -12 -1 V -13 -1 V -12 -1 V -12 -1 V -13 -1 V -12 -1 V -12 -1 V -13 -1 V -12 -1 V -12 0 V -13 -1 V -12 -1 V -13 -1 V -12 0 V -12 -1 V -13 0 V -12 -1 V -12 0 V -13 0 V -12 0 V -13 0 V -12 0 V -12 0 V -13 0 V -12 0 V -12 0 V -13 1 V -12 1 V -12 0 V -13 1 V -12 1 V -13 1 V -12 2 V -12 1 V -13 1 V -12 2 V -12 2 V -13 2 V -12 2 V -13 2 V -12 3 V -12 2 V -13 3 V -12 3 V -12 3 V -13 4 V -12 3 V -12 4 V -13 4 V -12 4 V -13 4 V -12 4 V -12 5 V -13 5 V -12 5 V -12 5 V -13 6 V -12 6 V -12 6 V -13 6 V -12 6 V -13 7 V -12 7 V -12 7 V -13 8 V -12 8 V -12 8 V -13 8 V -12 9 V -13 9 V -12 9 V -12 9 V -13 10 V -12 10 V -12 11 V -13 11 V -12 11 V -12 12 V -13 12 V -stroke -4464 2759 M -12 12 V -13 13 V -12 13 V -12 14 V -13 14 V -12 15 V -12 15 V -13 16 V -12 16 V -12 17 V -13 17 V -12 18 V -13 18 V -12 19 V -12 20 V -13 21 V -12 21 V -12 22 V -13 23 V -12 23 V -13 24 V -12 26 V -12 26 V -13 26 V -12 28 V -12 28 V -13 30 V -12 29 V -12 31 V -13 30 V -12 31 V -13 30 V -12 29 V -12 27 V -13 26 V -12 22 V -12 18 V -13 13 V -12 8 V -13 2 V -12 -3 V -12 -9 V -13 -13 V -12 -16 V -12 -20 V -13 -21 V -12 -23 V -12 -24 V -13 -23 V -12 -24 V -13 -23 V -12 -23 V -12 -22 V -13 -21 V -12 -21 V -12 -20 V -13 -18 V -12 -18 V -12 -17 V -13 -16 V -12 -16 V -13 -14 V -12 -14 V -12 -13 V -13 -13 V -12 -11 V -12 -11 V -13 -11 V -12 -10 V -13 -9 V -12 -8 V -12 -8 V -13 -8 V -12 -6 V -12 -7 V -13 -6 V -12 -5 V -12 -5 V -13 -4 V -12 -4 V -13 -4 V -12 -3 V -12 -3 V -13 -2 V -12 -2 V -12 -2 V -13 -1 V -12 -1 V -13 0 V -12 0 V -12 0 V -13 0 V -12 1 V -12 1 V -13 1 V -12 2 V -12 2 V -13 2 V -12 2 V -13 2 V -12 3 V -12 3 V -13 2 V -12 3 V -stroke -5750 3038 M -12 3 V -13 3 V -12 3 V -12 3 V -13 3 V -12 2 V -13 3 V -12 2 V -12 2 V -13 2 V -12 2 V -12 1 V -13 0 V -12 1 V -13 0 V -12 -1 V -12 -1 V -13 -2 V -12 -2 V -12 -3 V -13 -4 V -12 -4 V -12 -4 V -13 -6 V -12 -5 V -13 -7 V -12 -6 V -12 -8 V -13 -7 V -12 -9 V -12 -8 V -13 -9 V -12 -9 V -12 -10 V -13 -9 V -12 -10 V -13 -10 V -12 -10 V -12 -11 V -13 -10 V -12 -10 V -12 -11 V -13 -10 V -12 -10 V -13 -11 V -12 -10 V -12 -10 V -13 -10 V -12 -10 V -12 -9 V -13 -10 V -12 -10 V -12 -9 V -13 -9 V -12 -9 V -13 -9 V -12 -8 V -12 -8 V -13 -9 V -12 -8 V -12 -7 V -13 -8 V -12 -7 V -13 -7 V -12 -7 V -12 -7 V -13 -7 V -12 -6 V -12 -6 V -13 -6 V -12 -6 V -12 -5 V -13 -5 V -12 -5 V -13 -5 V -12 -5 V -12 -4 V -13 -4 V -12 -4 V -12 -4 V -13 -4 V -12 -3 V -12 -3 V -13 -3 V -12 -3 V -13 -2 V -12 -3 V -12 -2 V -13 -2 V -12 -2 V -12 -1 V -13 -1 V -12 -2 V -13 0 V -12 -1 V -12 -1 V -13 0 V -1.000 UL -LT2 -LTb -6311 4459 M -(Reference shaping) Rshow -LT2 -6395 4459 M -399 0 V -630 3487 M -12 0 V -13 0 V -12 1 V -12 0 V -13 1 V -12 1 V -13 1 V -12 2 V -12 1 V -13 2 V -12 2 V -12 2 V -13 2 V -12 2 V -13 3 V -12 2 V -12 3 V -13 3 V -12 3 V -12 2 V -13 4 V -12 3 V -12 3 V -13 3 V -12 3 V -13 2 V -12 3 V -12 3 V -13 2 V -12 2 V -12 1 V -13 1 V -12 1 V -12 0 V -13 0 V -12 -2 V -13 -2 V -12 -2 V -12 -4 V -13 -4 V -12 -6 V -12 -6 V -13 -7 V -12 -8 V -13 -8 V -12 -10 V -12 -10 V -13 -11 V -12 -12 V -12 -12 V -13 -13 V -12 -13 V -12 -14 V -13 -14 V -12 -14 V -13 -15 V -12 -15 V -12 -15 V -13 -15 V -12 -15 V -12 -15 V -13 -14 V -12 -15 V -12 -15 V -13 -15 V -12 -14 V -13 -14 V -12 -15 V -12 -13 V -13 -14 V -12 -14 V -12 -13 V -13 -13 V -12 -13 V -13 -12 V -12 -12 V -12 -12 V -13 -12 V -12 -12 V -12 -11 V -13 -11 V -12 -11 V -12 -10 V -13 -10 V -12 -10 V -13 -10 V -12 -10 V -12 -9 V -13 -9 V -12 -9 V -12 -9 V -13 -8 V -12 -8 V -13 -8 V -12 -8 V -12 -8 V -13 -7 V -12 -7 V -12 -7 V -13 -7 V -12 -6 V -12 -7 V -stroke -1891 2847 M -13 -6 V -12 -6 V -13 -6 V -12 -5 V -12 -6 V -13 -5 V -12 -5 V -12 -5 V -13 -5 V -12 -5 V -12 -4 V -13 -5 V -12 -4 V -13 -4 V -12 -4 V -12 -4 V -13 -4 V -12 -3 V -12 -4 V -13 -3 V -12 -3 V -13 -3 V -12 -3 V -12 -3 V -13 -2 V -12 -3 V -12 -2 V -13 -3 V -12 -2 V -12 -2 V -13 -2 V -12 -2 V -13 -2 V -12 -1 V -12 -2 V -13 -1 V -12 -2 V -12 -1 V -13 -1 V -12 -1 V -13 -2 V -12 0 V -12 -1 V -13 -1 V -12 -1 V -12 -1 V -13 0 V -12 -1 V -12 0 V -13 0 V -12 -1 V -13 0 V -12 0 V -12 0 V -13 0 V -12 0 V -12 0 V -13 0 V -12 0 V -12 1 V -13 0 V -12 0 V -13 1 V -12 0 V -12 0 V -13 1 V -12 0 V -12 1 V -13 1 V -12 0 V -13 1 V -12 1 V -12 0 V -13 1 V -12 1 V -12 1 V -13 0 V -12 1 V -12 1 V -13 1 V -12 1 V -13 1 V -12 0 V -12 1 V -13 1 V -12 1 V -12 1 V -13 1 V -12 1 V -12 0 V -13 1 V -12 1 V -13 1 V -12 0 V -12 1 V -13 1 V -12 1 V -12 0 V -13 1 V -12 1 V -13 0 V -12 1 V -12 0 V -13 1 V -stroke -3178 2736 M -12 0 V -12 1 V -13 0 V -12 1 V -12 0 V -13 0 V -12 1 V -13 0 V -12 0 V -12 0 V -13 1 V -12 0 V -12 0 V -13 0 V -12 0 V -13 0 V -12 0 V -12 0 V -13 0 V -12 0 V -12 0 V -13 0 V -12 0 V -12 0 V -13 0 V -12 0 V -13 0 V -12 0 V -12 0 V -13 0 V -12 0 V -12 0 V -13 0 V -12 -1 V -12 0 V -13 0 V -12 0 V -13 0 V -12 1 V -12 0 V -13 0 V -12 0 V -12 0 V -13 0 V -12 0 V -13 1 V -12 0 V -12 0 V -13 1 V -12 0 V -12 1 V -13 1 V -12 0 V -12 1 V -13 1 V -12 1 V -13 0 V -12 1 V -12 2 V -13 1 V -12 1 V -12 1 V -13 2 V -12 1 V -13 2 V -12 1 V -12 2 V -13 2 V -12 2 V -12 2 V -13 2 V -12 3 V -12 2 V -13 3 V -12 2 V -13 3 V -12 3 V -12 3 V -13 3 V -12 3 V -12 4 V -13 3 V -12 4 V -12 4 V -13 4 V -12 4 V -13 4 V -12 5 V -12 4 V -13 5 V -12 5 V -12 5 V -13 5 V -12 5 V -13 6 V -12 6 V -12 6 V -13 6 V -12 6 V -12 6 V -13 7 V -12 6 V -12 7 V -13 7 V -stroke -4464 2918 M -12 8 V -13 7 V -12 8 V -12 7 V -13 8 V -12 8 V -12 9 V -13 8 V -12 9 V -12 8 V -13 9 V -12 9 V -13 9 V -12 9 V -12 9 V -13 9 V -12 10 V -12 9 V -13 9 V -12 10 V -13 9 V -12 9 V -12 9 V -13 9 V -12 9 V -12 8 V -13 8 V -12 8 V -12 8 V -13 7 V -12 7 V -13 6 V -12 6 V -12 6 V -13 4 V -12 5 V -12 3 V -13 3 V -12 3 V -13 1 V -12 1 V -12 1 V -13 0 V -12 -1 V -12 -1 V -13 -2 V -12 -2 V -12 -3 V -13 -4 V -12 -3 V -13 -4 V -12 -5 V -12 -4 V -13 -5 V -12 -5 V -12 -5 V -13 -5 V -12 -6 V -12 -5 V -13 -6 V -12 -5 V -13 -6 V -12 -5 V -12 -5 V -13 -5 V -12 -6 V -12 -5 V -13 -5 V -12 -4 V -13 -5 V -12 -4 V -12 -5 V -13 -4 V -12 -4 V -12 -4 V -13 -3 V -12 -4 V -12 -3 V -13 -3 V -12 -3 V -13 -3 V -12 -3 V -12 -2 V -13 -2 V -12 -2 V -12 -2 V -13 -2 V -12 -2 V -13 -1 V -12 -2 V -12 -1 V -13 -1 V -12 -1 V -12 -1 V -13 -1 V -12 0 V -12 -1 V -13 -1 V -12 0 V -13 -1 V -12 0 V -12 0 V -13 -1 V -12 0 V -stroke -5750 3036 M -12 0 V -13 -1 V -12 0 V -12 0 V -13 -1 V -12 0 V -13 -1 V -12 0 V -12 -1 V -13 -1 V -12 0 V -12 -1 V -13 -1 V -12 -2 V -13 -1 V -12 -1 V -12 -2 V -13 -1 V -12 -2 V -12 -2 V -13 -2 V -12 -3 V -12 -2 V -13 -3 V -12 -2 V -13 -3 V -12 -3 V -12 -3 V -13 -4 V -12 -3 V -12 -4 V -13 -3 V -12 -4 V -12 -4 V -13 -4 V -12 -4 V -13 -4 V -12 -4 V -12 -5 V -13 -4 V -12 -4 V -12 -5 V -13 -4 V -12 -5 V -13 -4 V -12 -5 V -12 -5 V -13 -4 V -12 -5 V -12 -4 V -13 -5 V -12 -4 V -12 -4 V -13 -5 V -12 -4 V -13 -4 V -12 -5 V -12 -4 V -13 -4 V -12 -4 V -12 -4 V -13 -4 V -12 -4 V -13 -3 V -12 -4 V -12 -4 V -13 -3 V -12 -3 V -12 -4 V -13 -3 V -12 -3 V -12 -3 V -13 -3 V -12 -3 V -13 -2 V -12 -3 V -12 -2 V -13 -3 V -12 -2 V -12 -2 V -13 -2 V -12 -2 V -12 -2 V -13 -1 V -12 -2 V -13 -1 V -12 -2 V -12 -1 V -13 -1 V -12 -1 V -12 -1 V -13 -1 V -12 0 V -13 -1 V -12 0 V -12 0 V -13 -1 V -1.000 UL -LTb -630 420 M -6332 0 V -0 4452 V --6332 0 V -630 420 L -1.000 UP -stroke -grestore -end -showpage -%%Trailer -%%DocumentFonts: Helvetica diff --git a/Engine/lib/speex/doc/rtp.txt b/Engine/lib/speex/doc/rtp.txt deleted file mode 100644 index 1c2515304..000000000 --- a/Engine/lib/speex/doc/rtp.txt +++ /dev/null @@ -1,76 +0,0 @@ -The Speex RTP payload is defined as a header, followed by any number of -requests to the remote encoder and all encoded speech frames. - -+--------+----------+----------------+ -| Header | Requests | Speech data... | -+--------+----------+----------------+ - -The header contains only the number of frames sent -encoded in 6 bits - - 0 1 2 3 4 5 -+-+-+-+-+-+-+ -| NB frames | -+-+-+-+-+-+-+ - -There can be any number of requests of the form - - 0 1 2 3 4 5 6 7 0 1 -+-+-+-+-+-+-+-+-+-+-+ -|R| ReqID | ReqVal | -+-+-+-+-+-+-+-+-+-+-+ - -where R is 1 when a request is following and 0 when there is no more -request. Each request (if R=1) is composed of a 4-bit request ID (ReqID) and -a 5-bit value (ReqVal) - -Possible values for ReqID are: - 0: REQ_PERSIST ReqVal=1 for persistent requests/mode selection, - 0 otherwise - 1: PERSIST_ACK Acknowledge a REQ_PERSIST from the other end, - ReqVal equals the value received - 2: MODE Choose the encoder mode directly - 3: QUALITY Choose the encoder quality - 4: VBR Set VBR on (ReqVal=1) or off (ReqVal=2) - 5: VBR_QUALITY Set the encoder quality for VBR mode - 6: LOW_MODE Set the encoder mode for low-band (wideband only) - 7: HIGH_MODE Set the encoder mode for high-band (wideband only) - -All requests should be considered at the receiver as a suggestion and -compliance is not mandatory. The PERSIST_ACK should be sent upon receiving a -REQ_PERSIST request to indicate that the request has been received. - -The speech data part contains speech frames one after the other. The size of -the encoded frames can be found since the mode is directly encoded into each -frame. - -For example, a frame where we request VBR to be on with quality 8 and we -transmit two frames encoded at 8.35 kbps (167 bits/frame) will be: - - 0 1 2 3 - 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -| NB=2 |1|ReqID=2| ReqVal=0|1|ReqID=3|ReqVal=8 |0| frame 1 | -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -| frame 1 | -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -| frame 1 | -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -| frame 1 | -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -| frame 1 | -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -| frame 1 | -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -|end| frame 2 | -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -| frame 2 | -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -| frame 2 | -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -| frame 2 | -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -| frame 2 | -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -| end frame 2 |P|P|P|P|P|P| -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ diff --git a/Engine/lib/speex/doc/sampledec.c b/Engine/lib/speex/doc/sampledec.c deleted file mode 100644 index 8e89e12ce..000000000 --- a/Engine/lib/speex/doc/sampledec.c +++ /dev/null @@ -1,65 +0,0 @@ -#include -#include - -/*The frame size in hardcoded for this sample code but it doesn't have to be*/ -#define FRAME_SIZE 160 -int main(int argc, char **argv) -{ - char *outFile; - FILE *fout; - /*Holds the audio that will be written to file (16 bits per sample)*/ - short out[FRAME_SIZE]; - /*Speex handle samples as float, so we need an array of floats*/ - float output[FRAME_SIZE]; - char cbits[200]; - int nbBytes; - /*Holds the state of the decoder*/ - void *state; - /*Holds bits so they can be read and written to by the Speex routines*/ - SpeexBits bits; - int i, tmp; - - /*Create a new decoder state in narrowband mode*/ - state = speex_decoder_init(&speex_nb_mode); - - /*Set the perceptual enhancement on*/ - tmp=1; - speex_decoder_ctl(state, SPEEX_SET_ENH, &tmp); - - outFile = argv[1]; - fout = fopen(outFile, "w"); - - /*Initialization of the structure that holds the bits*/ - speex_bits_init(&bits); - while (1) - { - /*Read the size encoded by sampleenc, this part will likely be - different in your application*/ - fread(&nbBytes, sizeof(int), 1, stdin); - fprintf (stderr, "nbBytes: %d\n", nbBytes); - if (feof(stdin)) - break; - - /*Read the "packet" encoded by sampleenc*/ - fread(cbits, 1, nbBytes, stdin); - /*Copy the data into the bit-stream struct*/ - speex_bits_read_from(&bits, cbits, nbBytes); - - /*Decode the data*/ - speex_decode(state, &bits, output); - - /*Copy from float to short (16 bits) for output*/ - for (i=0;i -#include - -/*The frame size in hardcoded for this sample code but it doesn't have to be*/ -#define FRAME_SIZE 160 -int main(int argc, char **argv) -{ - char *inFile; - FILE *fin; - short in[FRAME_SIZE]; - float input[FRAME_SIZE]; - char cbits[200]; - int nbBytes; - /*Holds the state of the encoder*/ - void *state; - /*Holds bits so they can be read and written to by the Speex routines*/ - SpeexBits bits; - int i, tmp; - - /*Create a new encoder state in narrowband mode*/ - state = speex_encoder_init(&speex_nb_mode); - - /*Set the quality to 8 (15 kbps)*/ - tmp=8; - speex_encoder_ctl(state, SPEEX_SET_QUALITY, &tmp); - - inFile = argv[1]; - fin = fopen(inFile, "r"); - - /*Initialization of the structure that holds the bits*/ - speex_bits_init(&bits); - while (1) - { - /*Read a 16 bits/sample audio frame*/ - fread(in, sizeof(short), FRAME_SIZE, fin); - if (feof(fin)) - break; - /*Copy the 16 bits values to float so Speex can work on them*/ - for (i=0;i - - - - - - - - - - - - - - - - - - - - - - The Speex Speech Codec - - - - - - - - - - -
-Speex -
-
-
- - - The Speex project - aims to build an open-source (LGPL) patent-free voice codec. Unlike - other codecs like MP3 and Ogg Vorbis, -Speex is specially designed for compressing voice at low bit-rates in the -8-32 kbps/channel range. Possible applications include Voice over IP (VoIP), - Internet audio streaming, archiving of speech data (e.g. voice mail), and -audio books. In some sense, it is meant to be complementary to the -Ogg Vorbis codec. -

If you are interested in participating to the project, contact us at - speex-devel@lists.sourceforge.net or - join our mailing list. Right now, we are mostly looking for - developers with signal processing and speech coding knowledge, as well - as people with knowledge about patents in that field. See the -task list for more details about what's left to do in Speex
-

- - - - -

Download

- - - - You can download Speex from - here.
- - -

Documentation

-This Speex manual includes information about the -algorithms used in Speex, the bit-stream, the API and more. -
-Speex manual (PDF) -
-Speex manual (Postscript) -
-Speex manual (HTML online) -
-Speex manual (HTML tarball) -

-There is also some API documentation generated by Doxygen directly from the header files -
-Speex API (PDF) - -

Samples

- -You can listen to samples encoded with Speex here - -

Who uses Speex

- -LinPhone: A SIP-based VoIP phone written for GNOME -
-Speex XMMS plugin written by Jens Burkal -
-OpenH323: An open-source H.323 stack -
-GnomeMeeting: A H323 Video Conferencing Program - -

-In development: -
-Asterisk: An open-source PBX - -

News

- -

2002/09/04

- -Speex 0.8.1 released. This release fixes a bug in the new 0.8 API (function -speex_mode_query). For those using only speexenc/speexdec, no need to upgrade -but those using libspeex (directly or through another application) should. - -

2002/08/24

- Speex 0.8.0 released. The speex_decode() function no longer uses the -'lost' parameter. Applications will need - to be updated. - -

2002/08/09

- Speex 0.7.0 released. The format of the bit stream has changed once again -and the bandwidth required has been - reduced slightly. - -

2002/08/01

- -Speex 0.6.0 has been released. This is a major release that contains many improvements and lots of bug-fixing. The post-filter that was causing problems throughout 0.5.x was replaced with a new perceptual enhancement system, which sounds better and consume much less CPU. Also many changes to Ogg encoder/decoder, including possibility to see the bit-rate being played/encoded. There is also a discontinuous transmission (DTX) mode. Last but not least, 0.6.0 now reports no error when being run with the valgrind memory debugger. - -

2002/07/26

- -Speex 0.5.2 is out and brings a number of improvements and bug fixes. First, -the search has been improved and it is now possible to choose the right -quality/encoding time tradeoff (--comp option). Is is also possible to pack -more that one frame in an Ogg packet (--nframes), reducing the overhead for -low bit-rates. Last but not least: there is now some documentation about -Speex! - - -

2002/07/17

- -Version 0.5.1 is released. This release brings quality improvements at very -low bit-rate (5.7 kbps) and a new post-filter. VBR should also be a bit -better though there's still a lot to do. Most of the modes are bit-rate -compatible with 0.5.0, with the exception of the very low bit-rate (which is -sometimes used in VBR, so expect some glitches). The source (and probably -binary) compatibility with 0.5.0 is maintained. - -

2002/07/08

- -Speex 0.5.0 is out. The most important new feature is Varible Bit-Rate -(VBR). It can be enabled by using the --vbr option to speexenc. When -encoding in VBR, the --quality option can still be used. Note VBR -implementation in this release is experimental and still requires lots of -tuning. - -

2002/06/23

- -Speex 0.4.0 is here, adding many more bit-rates to both narrowband and wideband, as -well as the ability to change bit-rate dynamically from frame to frame. The -narrowband modes now range from 8 kbps to 18 kbps, while wideband range from -10 kbps to 28 kbps. There is also a "noise coding" mode at 2 kbps for -narrowband and 3 kbps for wideband. All this will lead to real Variable -Bit-Rate (VBR) in the future. Also, worth mentioning the codec latency has -been reduced from 40 ms to 30 ms (20 ms frames + 10 ms lookahead). - -

2002/06/12

- -Speex 0.3.0 has been released. There is now a new "low bit-rate" narrowband -mode for coding speech at 8 kbps. There's also support for big-endian -machines (untested, please report bugs). Speex files now have real header -containing information like bit-stream version (revents from playing an -incompatible bit-stream), sampling rate, bit-rate and user comments. On the -quality side, the post-filter has been improved and there has been more -codebook optimization. Note that this release breaks bit-stream -compatibility with previous releases. - -

2002/06/07

- -Speex 0.2.0 is out. This is a major release with lots of improvements and -bugfixes. First, the encoder and decoder can work directly from wav files -(mono only for now) and the decoder can play directly to soundcard. Also, -most of the codebooks have been re-trained in order to improve quality (but -this also breaks format compatibility with previous versions), while -slightly decreasing complexity. Speex is now able to encode both DTMF and -music (not as good as Vorbis of course) after bugs were fixed in the pitch -prediction and LSP quantization. Last but not the least, the perceptual -post-filter has been improved. - -

2002/06/04

- -Speex 0.1.2 is out. This adds a perceptual post-filter at the decoder to -(hopefully) increase quality. It can be enabled with the --pf option to -speexdec. The Speex format remains the same for both narrowband -and wideband. - -

2002/05/15

- -Speex 0.1.0 has been released. Speex now uses the Ogg bitstream (using -libogg). That means that there is now (limited) bitstream error -recovery. Also, the narrowband bit-rate has been reduced from 15.7 kbps to -15.1 kbps and the wideband bit-rate has been reduced from 31.3 kbps to 27.7 -kbps. The quality remains roughly the same for both narrowband and -wideband. Once again, this breaks compatibility with previous versions. - -
-
-
-SourceForge Logo -
- -Jean-Mrc Valin
- $Date: 2002/09/16 00:59:10 $
- - - - - diff --git a/Engine/lib/speex/html/patents.html b/Engine/lib/speex/html/patents.html deleted file mode 100644 index d81c961e5..000000000 --- a/Engine/lib/speex/html/patents.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - Speex and patents - - - - - -
-

Position regarding patents

- -
The goal of Speex is to provide a codec that is open-source -(released under the LGPL) -and that can be used in open-source software. This implies that it also has -to be free from patent restrictions. Unfortunately, the field of speech coding -known to be a real patent minefield and to make the matter worse, each country -has its own patent laws and list of granted patents so tracking them all -would be next to impossible. This is why we cannot provide an absolute warranty -that Speex is indeed completely patent-free.
-
- That being said, we are doing our best to keep away from known patents and -we do not patent the algorithms we use. That's about all we can do about it. -If you are aware of a patent issue with Speex, please let us know.
-
-Normally there shouldn't be any problem when you use Speex. However for the -reasons explained above, if you are thinking about using Speex commercially, -we strongly suggest that you have a closer look at patent issues with respect -to your country. Note that this is not specific to Speex, since many "standardized" -codecs have an unclear patent status (like MP3, GSM and probably -others), not to mention the risks of a previously unknown patent holder claiming -rights on a standardized codec long after standardization (GIF, JPEG).
-
-
- - diff --git a/Engine/lib/speex/html/speex.png b/Engine/lib/speex/html/speex.png deleted file mode 100644 index 4db28733e..000000000 Binary files a/Engine/lib/speex/html/speex.png and /dev/null differ diff --git a/Engine/lib/speex/html/speex.webprj b/Engine/lib/speex/html/speex.webprj deleted file mode 100644 index 23139f610..000000000 --- a/Engine/lib/speex/html/speex.webprj +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/Engine/lib/speex/html/speex.xcf b/Engine/lib/speex/html/speex.xcf deleted file mode 100644 index e55471233..000000000 Binary files a/Engine/lib/speex/html/speex.xcf and /dev/null differ diff --git a/Engine/lib/speex/include/Makefile.am b/Engine/lib/speex/include/Makefile.am deleted file mode 100644 index 09613b63a..000000000 --- a/Engine/lib/speex/include/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ - -SUBDIRS = speex diff --git a/Engine/lib/speex/include/speex/Makefile.am b/Engine/lib/speex/include/speex/Makefile.am deleted file mode 100644 index dff69d63c..000000000 --- a/Engine/lib/speex/include/speex/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -nodist_pkginclude_HEADERS = speex_config_types.h - -pkginclude_HEADERS = speex.h speex_bits.h speex_callbacks.h \ - speex_header.h \ - speex_stereo.h speex_types.h - diff --git a/Engine/lib/speex/include/speex/speex.h b/Engine/lib/speex/include/speex/speex.h deleted file mode 100644 index 28c4b44df..000000000 --- a/Engine/lib/speex/include/speex/speex.h +++ /dev/null @@ -1,425 +0,0 @@ -/* Copyright (C) 2002-2006 Jean-Marc Valin*/ -/** - @file speex.h - @brief Describes the different modes of the codec -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifndef SPEEX_H -#define SPEEX_H -/** @defgroup Codec Speex encoder and decoder - * This is the Speex codec itself. - * @{ - */ - -#include "speex_types.h" -#include "speex_bits.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Values allowed for *ctl() requests */ - -/** Set enhancement on/off (decoder only) */ -#define SPEEX_SET_ENH 0 -/** Get enhancement state (decoder only) */ -#define SPEEX_GET_ENH 1 - -/*Would be SPEEX_SET_FRAME_SIZE, but it's (currently) invalid*/ -/** Obtain frame size used by encoder/decoder */ -#define SPEEX_GET_FRAME_SIZE 3 - -/** Set quality value */ -#define SPEEX_SET_QUALITY 4 -/** Get current quality setting */ -/* #define SPEEX_GET_QUALITY 5 -- Doesn't make much sense, does it? */ - -/** Set sub-mode to use */ -#define SPEEX_SET_MODE 6 -/** Get current sub-mode in use */ -#define SPEEX_GET_MODE 7 - -/** Set low-band sub-mode to use (wideband only)*/ -#define SPEEX_SET_LOW_MODE 8 -/** Get current low-band mode in use (wideband only)*/ -#define SPEEX_GET_LOW_MODE 9 - -/** Set high-band sub-mode to use (wideband only)*/ -#define SPEEX_SET_HIGH_MODE 10 -/** Get current high-band mode in use (wideband only)*/ -#define SPEEX_GET_HIGH_MODE 11 - -/** Set VBR on (1) or off (0) */ -#define SPEEX_SET_VBR 12 -/** Get VBR status (1 for on, 0 for off) */ -#define SPEEX_GET_VBR 13 - -/** Set quality value for VBR encoding (0-10) */ -#define SPEEX_SET_VBR_QUALITY 14 -/** Get current quality value for VBR encoding (0-10) */ -#define SPEEX_GET_VBR_QUALITY 15 - -/** Set complexity of the encoder (0-10) */ -#define SPEEX_SET_COMPLEXITY 16 -/** Get current complexity of the encoder (0-10) */ -#define SPEEX_GET_COMPLEXITY 17 - -/** Set bit-rate used by the encoder (or lower) */ -#define SPEEX_SET_BITRATE 18 -/** Get current bit-rate used by the encoder or decoder */ -#define SPEEX_GET_BITRATE 19 - -/** Define a handler function for in-band Speex request*/ -#define SPEEX_SET_HANDLER 20 - -/** Define a handler function for in-band user-defined request*/ -#define SPEEX_SET_USER_HANDLER 22 - -/** Set sampling rate used in bit-rate computation */ -#define SPEEX_SET_SAMPLING_RATE 24 -/** Get sampling rate used in bit-rate computation */ -#define SPEEX_GET_SAMPLING_RATE 25 - -/** Reset the encoder/decoder memories to zero*/ -#define SPEEX_RESET_STATE 26 - -/** Get VBR info (mostly used internally) */ -#define SPEEX_GET_RELATIVE_QUALITY 29 - -/** Set VAD status (1 for on, 0 for off) */ -#define SPEEX_SET_VAD 30 - -/** Get VAD status (1 for on, 0 for off) */ -#define SPEEX_GET_VAD 31 - -/** Set Average Bit-Rate (ABR) to n bits per seconds */ -#define SPEEX_SET_ABR 32 -/** Get Average Bit-Rate (ABR) setting (in bps) */ -#define SPEEX_GET_ABR 33 - -/** Set DTX status (1 for on, 0 for off) */ -#define SPEEX_SET_DTX 34 -/** Get DTX status (1 for on, 0 for off) */ -#define SPEEX_GET_DTX 35 - -/** Set submode encoding in each frame (1 for yes, 0 for no, setting to no breaks the standard) */ -#define SPEEX_SET_SUBMODE_ENCODING 36 -/** Get submode encoding in each frame */ -#define SPEEX_GET_SUBMODE_ENCODING 37 - -/*#define SPEEX_SET_LOOKAHEAD 38*/ -/** Returns the lookahead used by Speex separately for an encoder and a decoder. - * Sum encoder and decoder lookahead values to get the total codec lookahead. */ -#define SPEEX_GET_LOOKAHEAD 39 - -/** Sets tuning for packet-loss concealment (expected loss rate) */ -#define SPEEX_SET_PLC_TUNING 40 -/** Gets tuning for PLC */ -#define SPEEX_GET_PLC_TUNING 41 - -/** Sets the max bit-rate allowed in VBR mode */ -#define SPEEX_SET_VBR_MAX_BITRATE 42 -/** Gets the max bit-rate allowed in VBR mode */ -#define SPEEX_GET_VBR_MAX_BITRATE 43 - -/** Turn on/off input/output high-pass filtering */ -#define SPEEX_SET_HIGHPASS 44 -/** Get status of input/output high-pass filtering */ -#define SPEEX_GET_HIGHPASS 45 - -/** Get "activity level" of the last decoded frame, i.e. - how much damage we cause if we remove the frame */ -#define SPEEX_GET_ACTIVITY 47 - - -/* Preserving compatibility:*/ -/** Equivalent to SPEEX_SET_ENH */ -#define SPEEX_SET_PF 0 -/** Equivalent to SPEEX_GET_ENH */ -#define SPEEX_GET_PF 1 - - - - -/* Values allowed for mode queries */ -/** Query the frame size of a mode */ -#define SPEEX_MODE_FRAME_SIZE 0 - -/** Query the size of an encoded frame for a particular sub-mode */ -#define SPEEX_SUBMODE_BITS_PER_FRAME 1 - - - -/** Get major Speex version */ -#define SPEEX_LIB_GET_MAJOR_VERSION 1 -/** Get minor Speex version */ -#define SPEEX_LIB_GET_MINOR_VERSION 3 -/** Get micro Speex version */ -#define SPEEX_LIB_GET_MICRO_VERSION 5 -/** Get extra Speex version */ -#define SPEEX_LIB_GET_EXTRA_VERSION 7 -/** Get Speex version string */ -#define SPEEX_LIB_GET_VERSION_STRING 9 - -/*#define SPEEX_LIB_SET_ALLOC_FUNC 10 -#define SPEEX_LIB_GET_ALLOC_FUNC 11 -#define SPEEX_LIB_SET_FREE_FUNC 12 -#define SPEEX_LIB_GET_FREE_FUNC 13 - -#define SPEEX_LIB_SET_WARNING_FUNC 14 -#define SPEEX_LIB_GET_WARNING_FUNC 15 -#define SPEEX_LIB_SET_ERROR_FUNC 16 -#define SPEEX_LIB_GET_ERROR_FUNC 17 -*/ - -/** Number of defined modes in Speex */ -#define SPEEX_NB_MODES 3 - -/** modeID for the defined narrowband mode */ -#define SPEEX_MODEID_NB 0 - -/** modeID for the defined wideband mode */ -#define SPEEX_MODEID_WB 1 - -/** modeID for the defined ultra-wideband mode */ -#define SPEEX_MODEID_UWB 2 - -struct SpeexMode; - - -/* Prototypes for mode function pointers */ - -/** Encoder state initialization function */ -typedef void *(*encoder_init_func)(const struct SpeexMode *mode); - -/** Encoder state destruction function */ -typedef void (*encoder_destroy_func)(void *st); - -/** Main encoding function */ -typedef int (*encode_func)(void *state, void *in, SpeexBits *bits); - -/** Function for controlling the encoder options */ -typedef int (*encoder_ctl_func)(void *state, int request, void *ptr); - -/** Decoder state initialization function */ -typedef void *(*decoder_init_func)(const struct SpeexMode *mode); - -/** Decoder state destruction function */ -typedef void (*decoder_destroy_func)(void *st); - -/** Main decoding function */ -typedef int (*decode_func)(void *state, SpeexBits *bits, void *out); - -/** Function for controlling the decoder options */ -typedef int (*decoder_ctl_func)(void *state, int request, void *ptr); - - -/** Query function for a mode */ -typedef int (*mode_query_func)(const void *mode, int request, void *ptr); - -/** Struct defining a Speex mode */ -typedef struct SpeexMode { - /** Pointer to the low-level mode data */ - const void *mode; - - /** Pointer to the mode query function */ - mode_query_func query; - - /** The name of the mode (you should not rely on this to identify the mode)*/ - const char *modeName; - - /**ID of the mode*/ - int modeID; - - /**Version number of the bitstream (incremented every time we break - bitstream compatibility*/ - int bitstream_version; - - /** Pointer to encoder initialization function */ - encoder_init_func enc_init; - - /** Pointer to encoder destruction function */ - encoder_destroy_func enc_destroy; - - /** Pointer to frame encoding function */ - encode_func enc; - - /** Pointer to decoder initialization function */ - decoder_init_func dec_init; - - /** Pointer to decoder destruction function */ - decoder_destroy_func dec_destroy; - - /** Pointer to frame decoding function */ - decode_func dec; - - /** ioctl-like requests for encoder */ - encoder_ctl_func enc_ctl; - - /** ioctl-like requests for decoder */ - decoder_ctl_func dec_ctl; - -} SpeexMode; - -/** - * Returns a handle to a newly created Speex encoder state structure. For now, - * the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes - * may be added. Note that for now if you have more than one channels to - * encode, you need one state per channel. - * - * @param mode The mode to use (either speex_nb_mode or speex_wb.mode) - * @return A newly created encoder state or NULL if state allocation fails - */ -void *speex_encoder_init(const SpeexMode *mode); - -/** Frees all resources associated to an existing Speex encoder state. - * @param state Encoder state to be destroyed */ -void speex_encoder_destroy(void *state); - -/** Uses an existing encoder state to encode one frame of speech pointed to by - "in". The encoded bit-stream is saved in "bits". - @param state Encoder state - @param in Frame that will be encoded with a +-2^15 range. This data MAY be - overwritten by the encoder and should be considered uninitialised - after the call. - @param bits Bit-stream where the data will be written - @return 0 if frame needs not be transmitted (DTX only), 1 otherwise - */ -int speex_encode(void *state, float *in, SpeexBits *bits); - -/** Uses an existing encoder state to encode one frame of speech pointed to by - "in". The encoded bit-stream is saved in "bits". - @param state Encoder state - @param in Frame that will be encoded with a +-2^15 range - @param bits Bit-stream where the data will be written - @return 0 if frame needs not be transmitted (DTX only), 1 otherwise - */ -int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits); - -/** Used like the ioctl function to control the encoder parameters - * - * @param state Encoder state - * @param request ioctl-type request (one of the SPEEX_* macros) - * @param ptr Data exchanged to-from function - * @return 0 if no error, -1 if request in unknown, -2 for invalid parameter - */ -int speex_encoder_ctl(void *state, int request, void *ptr); - - -/** Returns a handle to a newly created decoder state structure. For now, - * the mode argument can be &nb_mode or &wb_mode . In the future, more modes - * may be added. Note that for now if you have more than one channels to - * decode, you need one state per channel. - * - * @param mode Speex mode (one of speex_nb_mode or speex_wb_mode) - * @return A newly created decoder state or NULL if state allocation fails - */ -void *speex_decoder_init(const SpeexMode *mode); - -/** Frees all resources associated to an existing decoder state. - * - * @param state State to be destroyed - */ -void speex_decoder_destroy(void *state); - -/** Uses an existing decoder state to decode one frame of speech from - * bit-stream bits. The output speech is saved written to out. - * - * @param state Decoder state - * @param bits Bit-stream from which to decode the frame (NULL if the packet was lost) - * @param out Where to write the decoded frame - * @return return status (0 for no error, -1 for end of stream, -2 corrupt stream) - */ -int speex_decode(void *state, SpeexBits *bits, float *out); - -/** Uses an existing decoder state to decode one frame of speech from - * bit-stream bits. The output speech is saved written to out. - * - * @param state Decoder state - * @param bits Bit-stream from which to decode the frame (NULL if the packet was lost) - * @param out Where to write the decoded frame - * @return return status (0 for no error, -1 for end of stream, -2 corrupt stream) - */ -int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out); - -/** Used like the ioctl function to control the encoder parameters - * - * @param state Decoder state - * @param request ioctl-type request (one of the SPEEX_* macros) - * @param ptr Data exchanged to-from function - * @return 0 if no error, -1 if request in unknown, -2 for invalid parameter - */ -int speex_decoder_ctl(void *state, int request, void *ptr); - - -/** Query function for mode information - * - * @param mode Speex mode - * @param request ioctl-type request (one of the SPEEX_* macros) - * @param ptr Data exchanged to-from function - * @return 0 if no error, -1 if request in unknown, -2 for invalid parameter - */ -int speex_mode_query(const SpeexMode *mode, int request, void *ptr); - -/** Functions for controlling the behavior of libspeex - * @param request ioctl-type request (one of the SPEEX_LIB_* macros) - * @param ptr Data exchanged to-from function - * @return 0 if no error, -1 if request in unknown, -2 for invalid parameter - */ -int speex_lib_ctl(int request, void *ptr); - -/** Default narrowband mode */ -extern const SpeexMode speex_nb_mode; - -/** Default wideband mode */ -extern const SpeexMode speex_wb_mode; - -/** Default "ultra-wideband" mode */ -extern const SpeexMode speex_uwb_mode; - -/** List of all modes available */ -extern const SpeexMode * const speex_mode_list[SPEEX_NB_MODES]; - -/** Obtain one of the modes available */ -const SpeexMode * speex_lib_get_mode (int mode); - -#ifndef WIN32 -/* We actually override the function in the narrowband case so that we can avoid linking in the wideband stuff */ -#define speex_lib_get_mode(mode) ((mode)==SPEEX_MODEID_NB ? &speex_nb_mode : speex_lib_get_mode (mode)) -#endif - -#ifdef __cplusplus -} -#endif - -/** @}*/ -#endif diff --git a/Engine/lib/speex/include/speex/speex_bits.h b/Engine/lib/speex/include/speex/speex_bits.h deleted file mode 100644 index f98b8268f..000000000 --- a/Engine/lib/speex/include/speex/speex_bits.h +++ /dev/null @@ -1,174 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin */ -/** - @file speex_bits.h - @brief Handles bit packing/unpacking -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifndef BITS_H -#define BITS_H -/** @defgroup SpeexBits SpeexBits: Bit-stream manipulations - * This is the structure that holds the bit-stream when encoding or decoding - * with Speex. It allows some manipulations as well. - * @{ - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** Bit-packing data structure representing (part of) a bit-stream. */ -typedef struct SpeexBits { - char *chars; /**< "raw" data */ - int nbBits; /**< Total number of bits stored in the stream*/ - int charPtr; /**< Position of the byte "cursor" */ - int bitPtr; /**< Position of the bit "cursor" within the current char */ - int owner; /**< Does the struct "own" the "raw" buffer (member "chars") */ - int overflow;/**< Set to one if we try to read past the valid data */ - int buf_size;/**< Allocated size for buffer */ - int reserved1; /**< Reserved for future use */ - void *reserved2; /**< Reserved for future use */ -} SpeexBits; - -/** Initializes and allocates resources for a SpeexBits struct */ -void speex_bits_init(SpeexBits *bits); - -/** Initializes SpeexBits struct using a pre-allocated buffer*/ -void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size); - -/** Sets the bits in a SpeexBits struct to use data from an existing buffer (for decoding without copying data) */ -void speex_bits_set_bit_buffer(SpeexBits *bits, void *buff, int buf_size); - -/** Frees all resources associated to a SpeexBits struct. Right now this does nothing since no resources are allocated, but this could change in the future.*/ -void speex_bits_destroy(SpeexBits *bits); - -/** Resets bits to initial value (just after initialization, erasing content)*/ -void speex_bits_reset(SpeexBits *bits); - -/** Rewind the bit-stream to the beginning (ready for read) without erasing the content */ -void speex_bits_rewind(SpeexBits *bits); - -/** Initializes the bit-stream from the data in an area of memory */ -void speex_bits_read_from(SpeexBits *bits, const char *bytes, int len); - -/** Append bytes to the bit-stream - * - * @param bits Bit-stream to operate on - * @param bytes pointer to the bytes what will be appended - * @param len Number of bytes of append - */ -void speex_bits_read_whole_bytes(SpeexBits *bits, const char *bytes, int len); - -/** Write the content of a bit-stream to an area of memory - * - * @param bits Bit-stream to operate on - * @param bytes Memory location where to write the bits - * @param max_len Maximum number of bytes to write (i.e. size of the "bytes" buffer) - * @return Number of bytes written to the "bytes" buffer -*/ -int speex_bits_write(SpeexBits *bits, char *bytes, int max_len); - -/** Like speex_bits_write, but writes only the complete bytes in the stream. Also removes the written bytes from the stream */ -int speex_bits_write_whole_bytes(SpeexBits *bits, char *bytes, int max_len); - -/** Append bits to the bit-stream - * @param bits Bit-stream to operate on - * @param data Value to append as integer - * @param nbBits number of bits to consider in "data" - */ -void speex_bits_pack(SpeexBits *bits, int data, int nbBits); - -/** Interpret the next bits in the bit-stream as a signed integer - * - * @param bits Bit-stream to operate on - * @param nbBits Number of bits to interpret - * @return A signed integer represented by the bits read - */ -int speex_bits_unpack_signed(SpeexBits *bits, int nbBits); - -/** Interpret the next bits in the bit-stream as an unsigned integer - * - * @param bits Bit-stream to operate on - * @param nbBits Number of bits to interpret - * @return An unsigned integer represented by the bits read - */ -unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits); - -/** Returns the number of bytes in the bit-stream, including the last one even if it is not "full" - * - * @param bits Bit-stream to operate on - * @return Number of bytes in the stream - */ -int speex_bits_nbytes(SpeexBits *bits); - -/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position - * - * @param bits Bit-stream to operate on - * @param nbBits Number of bits to look for - * @return Value of the bits peeked, interpreted as unsigned - */ -unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits); - -/** Get the value of the next bit in the stream, without modifying the - * "cursor" position - * - * @param bits Bit-stream to operate on - * @return Value of the bit peeked (one bit only) - */ -int speex_bits_peek(SpeexBits *bits); - -/** Advances the position of the "bit cursor" in the stream - * - * @param bits Bit-stream to operate on - * @param n Number of bits to advance - */ -void speex_bits_advance(SpeexBits *bits, int n); - -/** Returns the number of bits remaining to be read in a stream - * - * @param bits Bit-stream to operate on - * @return Number of bits that can still be read from the stream - */ -int speex_bits_remaining(SpeexBits *bits); - -/** Insert a terminator so that the data can be sent as a packet while auto-detecting - * the number of frames in each packet - * - * @param bits Bit-stream to operate on - */ -void speex_bits_insert_terminator(SpeexBits *bits); - -#ifdef __cplusplus -} -#endif - -/* @} */ -#endif diff --git a/Engine/lib/speex/include/speex/speex_callbacks.h b/Engine/lib/speex/include/speex/speex_callbacks.h deleted file mode 100644 index 3928c34fa..000000000 --- a/Engine/lib/speex/include/speex/speex_callbacks.h +++ /dev/null @@ -1,134 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin*/ -/** - @file speex_callbacks.h - @brief Describes callback handling and in-band signalling -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifndef SPEEX_CALLBACKS_H -#define SPEEX_CALLBACKS_H -/** @defgroup SpeexCallbacks Various definitions for Speex callbacks supported by the decoder. - * @{ - */ - -#include "speex.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** Total number of callbacks */ -#define SPEEX_MAX_CALLBACKS 16 - -/* Describes all the in-band requests */ - -/*These are 1-bit requests*/ -/** Request for perceptual enhancement (1 for on, 0 for off) */ -#define SPEEX_INBAND_ENH_REQUEST 0 -/** Reserved */ -#define SPEEX_INBAND_RESERVED1 1 - -/*These are 4-bit requests*/ -/** Request for a mode change */ -#define SPEEX_INBAND_MODE_REQUEST 2 -/** Request for a low mode change */ -#define SPEEX_INBAND_LOW_MODE_REQUEST 3 -/** Request for a high mode change */ -#define SPEEX_INBAND_HIGH_MODE_REQUEST 4 -/** Request for VBR (1 on, 0 off) */ -#define SPEEX_INBAND_VBR_QUALITY_REQUEST 5 -/** Request to be sent acknowledge */ -#define SPEEX_INBAND_ACKNOWLEDGE_REQUEST 6 -/** Request for VBR (1 for on, 0 for off) */ -#define SPEEX_INBAND_VBR_REQUEST 7 - -/*These are 8-bit requests*/ -/** Send a character in-band */ -#define SPEEX_INBAND_CHAR 8 -/** Intensity stereo information */ -#define SPEEX_INBAND_STEREO 9 - -/*These are 16-bit requests*/ -/** Transmit max bit-rate allowed */ -#define SPEEX_INBAND_MAX_BITRATE 10 - -/*These are 32-bit requests*/ -/** Acknowledge packet reception */ -#define SPEEX_INBAND_ACKNOWLEDGE 12 - -/** Callback function type */ -typedef int (*speex_callback_func)(SpeexBits *bits, void *state, void *data); - -/** Callback information */ -typedef struct SpeexCallback { - int callback_id; /**< ID associated to the callback */ - speex_callback_func func; /**< Callback handler function */ - void *data; /**< Data that will be sent to the handler */ - void *reserved1; /**< Reserved for future use */ - int reserved2; /**< Reserved for future use */ -} SpeexCallback; - -/** Handle in-band request */ -int speex_inband_handler(SpeexBits *bits, SpeexCallback *callback_list, void *state); - -/** Standard handler for mode request (change mode, no questions asked) */ -int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data); - -/** Standard handler for high mode request (change high mode, no questions asked) */ -int speex_std_high_mode_request_handler(SpeexBits *bits, void *state, void *data); - -/** Standard handler for in-band characters (write to stderr) */ -int speex_std_char_handler(SpeexBits *bits, void *state, void *data); - -/** Default handler for user-defined requests: in this case, just ignore */ -int speex_default_user_handler(SpeexBits *bits, void *state, void *data); - - - -/** Standard handler for low mode request (change low mode, no questions asked) */ -int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void *data); - -/** Standard handler for VBR request (Set VBR, no questions asked) */ -int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data); - -/** Standard handler for enhancer request (Turn enhancer on/off, no questions asked) */ -int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data); - -/** Standard handler for VBR quality request (Set VBR quality, no questions asked) */ -int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *data); - - -#ifdef __cplusplus -} -#endif - -/** @} */ -#endif diff --git a/Engine/lib/speex/include/speex/speex_config_types.h.in b/Engine/lib/speex/include/speex/speex_config_types.h.in deleted file mode 100644 index 5ea7b5561..000000000 --- a/Engine/lib/speex/include/speex/speex_config_types.h.in +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __SPEEX_TYPES_H__ -#define __SPEEX_TYPES_H__ - -@INCLUDE_STDINT@ - -typedef @SIZE16@ spx_int16_t; -typedef @USIZE16@ spx_uint16_t; -typedef @SIZE32@ spx_int32_t; -typedef @USIZE32@ spx_uint32_t; - -#endif - diff --git a/Engine/lib/speex/include/speex/speex_header.h b/Engine/lib/speex/include/speex/speex_header.h deleted file mode 100644 index ffe8c4713..000000000 --- a/Engine/lib/speex/include/speex/speex_header.h +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin */ -/** - @file speex_header.h - @brief Describes the Speex header -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - - -#ifndef SPEEX_HEADER_H -#define SPEEX_HEADER_H -/** @defgroup SpeexHeader SpeexHeader: Makes it easy to write/parse an Ogg/Speex header - * This is the Speex header for the Ogg encapsulation. You don't need that if you just use RTP. - * @{ - */ - -#include "speex_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct SpeexMode; - -/** Length of the Speex header identifier */ -#define SPEEX_HEADER_STRING_LENGTH 8 - -/** Maximum number of characters for encoding the Speex version number in the header */ -#define SPEEX_HEADER_VERSION_LENGTH 20 - -/** Speex header info for file-based formats */ -typedef struct SpeexHeader { - char speex_string[SPEEX_HEADER_STRING_LENGTH]; /**< Identifies a Speex bit-stream, always set to "Speex " */ - char speex_version[SPEEX_HEADER_VERSION_LENGTH]; /**< Speex version */ - spx_int32_t speex_version_id; /**< Version for Speex (for checking compatibility) */ - spx_int32_t header_size; /**< Total size of the header ( sizeof(SpeexHeader) ) */ - spx_int32_t rate; /**< Sampling rate used */ - spx_int32_t mode; /**< Mode used (0 for narrowband, 1 for wideband) */ - spx_int32_t mode_bitstream_version; /**< Version ID of the bit-stream */ - spx_int32_t nb_channels; /**< Number of channels encoded */ - spx_int32_t bitrate; /**< Bit-rate used */ - spx_int32_t frame_size; /**< Size of frames */ - spx_int32_t vbr; /**< 1 for a VBR encoding, 0 otherwise */ - spx_int32_t frames_per_packet; /**< Number of frames stored per Ogg packet */ - spx_int32_t extra_headers; /**< Number of additional headers after the comments */ - spx_int32_t reserved1; /**< Reserved for future use, must be zero */ - spx_int32_t reserved2; /**< Reserved for future use, must be zero */ -} SpeexHeader; - -/** Initializes a SpeexHeader using basic information */ -void speex_init_header(SpeexHeader *header, int rate, int nb_channels, const struct SpeexMode *m); - -/** Creates the header packet from the header itself (mostly involves endianness conversion) */ -char *speex_header_to_packet(SpeexHeader *header, int *size); - -/** Creates a SpeexHeader from a packet */ -SpeexHeader *speex_packet_to_header(char *packet, int size); - -/** Frees the memory allocated by either speex_header_to_packet() or speex_packet_to_header() */ -void speex_header_free(void *ptr); - -#ifdef __cplusplus -} -#endif - -/** @} */ -#endif diff --git a/Engine/lib/speex/include/speex/speex_stereo.h b/Engine/lib/speex/include/speex/speex_stereo.h deleted file mode 100644 index 5844f5a10..000000000 --- a/Engine/lib/speex/include/speex/speex_stereo.h +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin*/ -/** - @file speex_stereo.h - @brief Describes the handling for intensity stereo -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef STEREO_H -#define STEREO_H -/** @defgroup SpeexStereoState SpeexStereoState: Handling Speex stereo files - * This describes the Speex intensity stereo encoding/decoding - * @{ - */ - -#include "speex_types.h" -#include "speex_bits.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -/** If you access any of these fields directly, I'll personally come and bite you */ -typedef struct SpeexStereoState { - float balance; /**< Left/right balance info */ - float e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(right)] */ - float smooth_left; /**< Smoothed left channel gain */ - float smooth_right; /**< Smoothed right channel gain */ - float reserved1; /**< Reserved for future use */ - float reserved2; /**< Reserved for future use */ -} SpeexStereoState; - -/** Deprecated. Use speex_stereo_state_init() instead. */ -#define SPEEX_STEREO_STATE_INIT {1,.5,1,1,0,0} - -/** Initialise/create a stereo stereo state */ -SpeexStereoState *speex_stereo_state_init(); - -/** Reset/re-initialise an already allocated stereo state */ -void speex_stereo_state_reset(SpeexStereoState *stereo); - -/** Destroy a stereo stereo state */ -void speex_stereo_state_destroy(SpeexStereoState *stereo); - -/** Transforms a stereo frame into a mono frame and stores intensity stereo info in 'bits' */ -void speex_encode_stereo(float *data, int frame_size, SpeexBits *bits); - -/** Transforms a stereo frame into a mono frame and stores intensity stereo info in 'bits' */ -void speex_encode_stereo_int(spx_int16_t *data, int frame_size, SpeexBits *bits); - -/** Transforms a mono frame into a stereo frame using intensity stereo info */ -void speex_decode_stereo(float *data, int frame_size, SpeexStereoState *stereo); - -/** Transforms a mono frame into a stereo frame using intensity stereo info */ -void speex_decode_stereo_int(spx_int16_t *data, int frame_size, SpeexStereoState *stereo); - -/** Callback handler for intensity stereo info */ -int speex_std_stereo_request_handler(SpeexBits *bits, void *state, void *data); - -#ifdef __cplusplus -} -#endif - -/** @} */ -#endif diff --git a/Engine/lib/speex/include/speex/speex_types.h b/Engine/lib/speex/include/speex/speex_types.h deleted file mode 100644 index bdc63295c..000000000 --- a/Engine/lib/speex/include/speex/speex_types.h +++ /dev/null @@ -1,126 +0,0 @@ -/* speex_types.h taken from libogg */ -/******************************************************************** - * * - * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 * - * by the Xiph.Org Foundation http://www.xiph.org/ * - * * - ******************************************************************** - - function: #ifdef jail to whip a few platforms into the UNIX ideal. - last mod: $Id: os_types.h 7524 2004-08-11 04:20:36Z conrad $ - - ********************************************************************/ -/** - @file speex_types.h - @brief Speex types -*/ -#ifndef _SPEEX_TYPES_H -#define _SPEEX_TYPES_H - -#if defined(_WIN32) - -# if defined(__CYGWIN__) -# include <_G_config.h> - typedef _G_int32_t spx_int32_t; - typedef _G_uint32_t spx_uint32_t; - typedef _G_int16_t spx_int16_t; - typedef _G_uint16_t spx_uint16_t; -# elif defined(__MINGW32__) - typedef short spx_int16_t; - typedef unsigned short spx_uint16_t; - typedef int spx_int32_t; - typedef unsigned int spx_uint32_t; -# elif defined(__MWERKS__) - typedef int spx_int32_t; - typedef unsigned int spx_uint32_t; - typedef short spx_int16_t; - typedef unsigned short spx_uint16_t; -# else - /* MSVC/Borland */ - typedef __int32 spx_int32_t; - typedef unsigned __int32 spx_uint32_t; - typedef __int16 spx_int16_t; - typedef unsigned __int16 spx_uint16_t; -# endif - -#elif defined(__MACOS__) - -# include - typedef SInt16 spx_int16_t; - typedef UInt16 spx_uint16_t; - typedef SInt32 spx_int32_t; - typedef UInt32 spx_uint32_t; - -#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ - -# include - typedef int16_t spx_int16_t; - typedef u_int16_t spx_uint16_t; - typedef int32_t spx_int32_t; - typedef u_int32_t spx_uint32_t; - -#elif defined(__BEOS__) - - /* Be */ -# include - typedef int16_t spx_int16_t; - typedef u_int16_t spx_uint16_t; - typedef int32_t spx_int32_t; - typedef u_int32_t spx_uint32_t; - -#elif defined (__EMX__) - - /* OS/2 GCC */ - typedef short spx_int16_t; - typedef unsigned short spx_uint16_t; - typedef int spx_int32_t; - typedef unsigned int spx_uint32_t; - -#elif defined (DJGPP) - - /* DJGPP */ - typedef short spx_int16_t; - typedef int spx_int32_t; - typedef unsigned int spx_uint32_t; - -#elif defined(R5900) - - /* PS2 EE */ - typedef int spx_int32_t; - typedef unsigned spx_uint32_t; - typedef short spx_int16_t; - -#elif defined(__SYMBIAN32__) - - /* Symbian GCC */ - typedef signed short spx_int16_t; - typedef unsigned short spx_uint16_t; - typedef signed int spx_int32_t; - typedef unsigned int spx_uint32_t; - -#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X) - - typedef short spx_int16_t; - typedef unsigned short spx_uint16_t; - typedef long spx_int32_t; - typedef unsigned long spx_uint32_t; - -#elif defined(CONFIG_TI_C6X) - - typedef short spx_int16_t; - typedef unsigned short spx_uint16_t; - typedef int spx_int32_t; - typedef unsigned int spx_uint32_t; - -#else - -#include "speex_config_types.h" - -#endif - -#endif /* _SPEEX_TYPES_H */ diff --git a/Engine/lib/speex/libspeex/.cvsignore b/Engine/lib/speex/libspeex/.cvsignore deleted file mode 100644 index 09a90ac75..000000000 --- a/Engine/lib/speex/libspeex/.cvsignore +++ /dev/null @@ -1,11 +0,0 @@ -.deps -.libs -*.la -*.lo -*.o -Makefile -Makefile.in -testdenoise -testenc -testenc_uwb -testenc_wb diff --git a/Engine/lib/speex/libspeex/Makefile.am b/Engine/lib/speex/libspeex/Makefile.am deleted file mode 100644 index 8fe9bff91..000000000 --- a/Engine/lib/speex/libspeex/Makefile.am +++ /dev/null @@ -1,53 +0,0 @@ -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -if BUILD_VORBIS_PSY - VPSY_SOURCE=vorbis_psy.c -if BUILD_KISS_FFT - FFTSRC=kiss_fft.c _kiss_fft_guts.h kiss_fft.h kiss_fftr.c kiss_fftr.h -else -if BUILD_SMALLFT - FFTSRC=smallft.c -else - FFTSRC= -endif -endif -else - VPSY_SOURCE= - FFTSRC= -endif - -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include/speex -I$(top_builddir) @OGG_CFLAGS@ @FFT_CFLAGS@ - -lib_LTLIBRARIES = libspeex.la - -# Sources for compilation in the library -libspeex_la_SOURCES = $(VPSY_SOURCE) $(FFTSRC) cb_search.c exc_10_32_table.c exc_8_128_table.c \ - filters.c gain_table.c hexc_table.c high_lsp_tables.c lsp.c \ - ltp.c speex.c stereo.c vbr.c vq.c bits.c exc_10_16_table.c \ - exc_20_32_table.c exc_5_256_table.c exc_5_64_table.c gain_table_lbr.c hexc_10_32_table.c \ - lpc.c lsp_tables_nb.c modes.c modes_wb.c nb_celp.c quant_lsp.c sb_celp.c \ - speex_callbacks.c speex_header.c window.c - - -noinst_HEADERS = arch.h bfin.h cb_search_arm4.h cb_search_bfin.h cb_search_sse.h \ - filters.h filters_arm4.h filters_bfin.h filters_sse.h fixed_arm4.h \ - fixed_arm5e.h fixed_bfin.h fixed_debug.h lpc.h lpc_bfin.h ltp.h ltp_arm4.h \ - ltp_sse.h math_approx.h misc_bfin.h nb_celp.h quant_lsp.h sb_celp.h \ - stack_alloc.h vbr.h vq.h vq_arm4.h vq_bfin.h vq_sse.h cb_search.h fftwrap.h \ - fixed_generic.h lsp.h lsp_bfin.h ltp_bfin.h modes.h os_support.h \ - quant_lsp_bfin.h smallft.h vorbis_psy.h - - -libspeex_la_LDFLAGS = -no-undefined -version-info @SPEEX_LT_CURRENT@:@SPEEX_LT_REVISION@:@SPEEX_LT_AGE@ -libspeex_la_LIBADD = $(LIBM) - -if BUILD_BINARIES -noinst_PROGRAMS = testenc testenc_wb testenc_uwb -testenc_SOURCES = testenc.c -testenc_LDADD = libspeex.la $(LIBM) -testenc_wb_SOURCES = testenc_wb.c -testenc_wb_LDADD = libspeex.la $(LIBM) -testenc_uwb_SOURCES = testenc_uwb.c -testenc_uwb_LDADD = libspeex.la $(LIBM) -endif diff --git a/Engine/lib/speex/libspeex/_kiss_fft_guts.h b/Engine/lib/speex/libspeex/_kiss_fft_guts.h deleted file mode 100644 index 6571e79c0..000000000 --- a/Engine/lib/speex/libspeex/_kiss_fft_guts.h +++ /dev/null @@ -1,160 +0,0 @@ -/* -Copyright (c) 2003-2004, Mark Borgerding - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#define MIN(a,b) ((a)<(b) ? (a):(b)) -#define MAX(a,b) ((a)>(b) ? (a):(b)) - -/* kiss_fft.h - defines kiss_fft_scalar as either short or a float type - and defines - typedef struct { kiss_fft_scalar r; kiss_fft_scalar i; }kiss_fft_cpx; */ -#include "kiss_fft.h" -#include "math_approx.h" - -#define MAXFACTORS 32 -/* e.g. an fft of length 128 has 4 factors - as far as kissfft is concerned - 4*4*4*2 - */ - -struct kiss_fft_state{ - int nfft; - int inverse; - int factors[2*MAXFACTORS]; - kiss_fft_cpx twiddles[1]; -}; - -/* - Explanation of macros dealing with complex math: - - C_MUL(m,a,b) : m = a*b - C_FIXDIV( c , div ) : if a fixed point impl., c /= div. noop otherwise - C_SUB( res, a,b) : res = a - b - C_SUBFROM( res , a) : res -= a - C_ADDTO( res , a) : res += a - * */ -#ifdef FIXED_POINT -#include "arch.h" -# define FRACBITS 15 -# define SAMPPROD spx_int32_t -#define SAMP_MAX 32767 - -#define SAMP_MIN -SAMP_MAX - -#if defined(CHECK_OVERFLOW) -# define CHECK_OVERFLOW_OP(a,op,b) \ - if ( (SAMPPROD)(a) op (SAMPPROD)(b) > SAMP_MAX || (SAMPPROD)(a) op (SAMPPROD)(b) < SAMP_MIN ) { \ - fprintf(stderr,"WARNING:overflow @ " __FILE__ "(%d): (%d " #op" %d) = %ld\n",__LINE__,(a),(b),(SAMPPROD)(a) op (SAMPPROD)(b) ); } -#endif - - -# define smul(a,b) ( (SAMPPROD)(a)*(b) ) -# define sround( x ) (kiss_fft_scalar)( ( (x) + (1<<(FRACBITS-1)) ) >> FRACBITS ) - -# define S_MUL(a,b) sround( smul(a,b) ) - -# define C_MUL(m,a,b) \ - do{ (m).r = sround( smul((a).r,(b).r) - smul((a).i,(b).i) ); \ - (m).i = sround( smul((a).r,(b).i) + smul((a).i,(b).r) ); }while(0) - -# define C_MUL4(m,a,b) \ - do{ (m).r = PSHR32( smul((a).r,(b).r) - smul((a).i,(b).i),17 ); \ - (m).i = PSHR32( smul((a).r,(b).i) + smul((a).i,(b).r),17 ); }while(0) - -# define DIVSCALAR(x,k) \ - (x) = sround( smul( x, SAMP_MAX/k ) ) - -# define C_FIXDIV(c,div) \ - do { DIVSCALAR( (c).r , div); \ - DIVSCALAR( (c).i , div); }while (0) - -# define C_MULBYSCALAR( c, s ) \ - do{ (c).r = sround( smul( (c).r , s ) ) ;\ - (c).i = sround( smul( (c).i , s ) ) ; }while(0) - -#else /* not FIXED_POINT*/ - -# define S_MUL(a,b) ( (a)*(b) ) -#define C_MUL(m,a,b) \ - do{ (m).r = (a).r*(b).r - (a).i*(b).i;\ - (m).i = (a).r*(b).i + (a).i*(b).r; }while(0) - -#define C_MUL4(m,a,b) C_MUL(m,a,b) - -# define C_FIXDIV(c,div) /* NOOP */ -# define C_MULBYSCALAR( c, s ) \ - do{ (c).r *= (s);\ - (c).i *= (s); }while(0) -#endif - -#ifndef CHECK_OVERFLOW_OP -# define CHECK_OVERFLOW_OP(a,op,b) /* noop */ -#endif - -#define C_ADD( res, a,b)\ - do { \ - CHECK_OVERFLOW_OP((a).r,+,(b).r)\ - CHECK_OVERFLOW_OP((a).i,+,(b).i)\ - (res).r=(a).r+(b).r; (res).i=(a).i+(b).i; \ - }while(0) -#define C_SUB( res, a,b)\ - do { \ - CHECK_OVERFLOW_OP((a).r,-,(b).r)\ - CHECK_OVERFLOW_OP((a).i,-,(b).i)\ - (res).r=(a).r-(b).r; (res).i=(a).i-(b).i; \ - }while(0) -#define C_ADDTO( res , a)\ - do { \ - CHECK_OVERFLOW_OP((res).r,+,(a).r)\ - CHECK_OVERFLOW_OP((res).i,+,(a).i)\ - (res).r += (a).r; (res).i += (a).i;\ - }while(0) - -#define C_SUBFROM( res , a)\ - do {\ - CHECK_OVERFLOW_OP((res).r,-,(a).r)\ - CHECK_OVERFLOW_OP((res).i,-,(a).i)\ - (res).r -= (a).r; (res).i -= (a).i; \ - }while(0) - - -#ifdef FIXED_POINT -# define KISS_FFT_COS(phase) floor(MIN(32767,MAX(-32767,.5+32768 * cos (phase)))) -# define KISS_FFT_SIN(phase) floor(MIN(32767,MAX(-32767,.5+32768 * sin (phase)))) -# define HALF_OF(x) ((x)>>1) -#elif defined(USE_SIMD) -# define KISS_FFT_COS(phase) _mm_set1_ps( cos(phase) ) -# define KISS_FFT_SIN(phase) _mm_set1_ps( sin(phase) ) -# define HALF_OF(x) ((x)*_mm_set1_ps(.5)) -#else -# define KISS_FFT_COS(phase) (kiss_fft_scalar) cos(phase) -# define KISS_FFT_SIN(phase) (kiss_fft_scalar) sin(phase) -# define HALF_OF(x) ((x)*.5) -#endif - -#define kf_cexp(x,phase) \ - do{ \ - (x)->r = KISS_FFT_COS(phase);\ - (x)->i = KISS_FFT_SIN(phase);\ - }while(0) -#define kf_cexp2(x,phase) \ - do{ \ - (x)->r = spx_cos_norm((phase));\ - (x)->i = spx_cos_norm((phase)-32768);\ -}while(0) - - -/* a debugging function */ -#define pcpx(c)\ - fprintf(stderr,"%g + %gi\n",(double)((c)->r),(double)((c)->i) ) diff --git a/Engine/lib/speex/libspeex/arch.h b/Engine/lib/speex/libspeex/arch.h deleted file mode 100644 index 291cab828..000000000 --- a/Engine/lib/speex/libspeex/arch.h +++ /dev/null @@ -1,237 +0,0 @@ -/* Copyright (C) 2003 Jean-Marc Valin */ -/** - @file arch.h - @brief Various architecture definitions Speex -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef ARCH_H -#define ARCH_H - -#ifndef SPEEX_VERSION -#define SPEEX_MAJOR_VERSION 1 /**< Major Speex version. */ -#define SPEEX_MINOR_VERSION 1 /**< Minor Speex version. */ -#define SPEEX_MICRO_VERSION 16 /**< Micro Speex version. */ -#define SPEEX_EXTRA_VERSION "" /**< Extra Speex version. */ -#define SPEEX_VERSION "speex-1.2.0" /**< Speex version string. */ -#endif - -/* A couple test to catch stupid option combinations */ -#ifdef FIXED_POINT - -#ifdef FLOATING_POINT -#error You cannot compile as floating point and fixed point at the same time -#endif -#ifdef _USE_SSE -#error SSE is only for floating-point -#endif -#if ((defined (ARM4_ASM)||defined (ARM4_ASM)) && defined(BFIN_ASM)) || (defined (ARM4_ASM)&&defined(ARM5E_ASM)) -#error Make up your mind. What CPU do you have? -#endif -#ifdef VORBIS_PSYCHO -#error Vorbis-psy model currently not implemented in fixed-point -#endif - -#else - -#ifndef FLOATING_POINT -#error You now need to define either FIXED_POINT or FLOATING_POINT -#endif -#if defined (ARM4_ASM) || defined(ARM5E_ASM) || defined(BFIN_ASM) -#error I suppose you can have a [ARM4/ARM5E/Blackfin] that has float instructions? -#endif -#ifdef FIXED_POINT_DEBUG -#error "Don't you think enabling fixed-point is a good thing to do if you want to debug that?" -#endif - - -#endif - -#include "speex/speex_types.h" - -#define ABS(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute integer value. */ -#define ABS16(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 16-bit value. */ -#define MIN16(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 16-bit value. */ -#define MAX16(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 16-bit value. */ -#define ABS32(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 32-bit value. */ -#define MIN32(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 32-bit value. */ -#define MAX32(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 32-bit value. */ - -#ifdef FIXED_POINT - -typedef spx_int16_t spx_word16_t; -typedef spx_int32_t spx_word32_t; -typedef spx_word32_t spx_mem_t; -typedef spx_word16_t spx_coef_t; -typedef spx_word16_t spx_lsp_t; -typedef spx_word32_t spx_sig_t; - -#define Q15ONE 32767 - -#define LPC_SCALING 8192 -#define SIG_SCALING 16384 -#define LSP_SCALING 8192. -#define GAMMA_SCALING 32768. -#define GAIN_SCALING 64 -#define GAIN_SCALING_1 0.015625 - -#define LPC_SHIFT 13 -#define LSP_SHIFT 13 -#define SIG_SHIFT 14 -#define GAIN_SHIFT 6 - -#define VERY_SMALL 0 -#define VERY_LARGE32 ((spx_word32_t)2147483647) -#define VERY_LARGE16 ((spx_word16_t)32767) -#define Q15_ONE ((spx_word16_t)32767) - - -#ifdef FIXED_DEBUG -#include "fixed_debug.h" -#else - -#include "fixed_generic.h" - -#ifdef ARM5E_ASM -#include "fixed_arm5e.h" -#elif defined (ARM4_ASM) -#include "fixed_arm4.h" -#elif defined (BFIN_ASM) -#include "fixed_bfin.h" -#endif - -#endif - - -#else - -typedef float spx_mem_t; -typedef float spx_coef_t; -typedef float spx_lsp_t; -typedef float spx_sig_t; -typedef float spx_word16_t; -typedef float spx_word32_t; - -#define Q15ONE 1.0f -#define LPC_SCALING 1.f -#define SIG_SCALING 1.f -#define LSP_SCALING 1.f -#define GAMMA_SCALING 1.f -#define GAIN_SCALING 1.f -#define GAIN_SCALING_1 1.f - - -#define VERY_SMALL 1e-15f -#define VERY_LARGE32 1e15f -#define VERY_LARGE16 1e15f -#define Q15_ONE ((spx_word16_t)1.f) - -#define QCONST16(x,bits) (x) -#define QCONST32(x,bits) (x) - -#define NEG16(x) (-(x)) -#define NEG32(x) (-(x)) -#define EXTRACT16(x) (x) -#define EXTEND32(x) (x) -#define SHR16(a,shift) (a) -#define SHL16(a,shift) (a) -#define SHR32(a,shift) (a) -#define SHL32(a,shift) (a) -#define PSHR16(a,shift) (a) -#define PSHR32(a,shift) (a) -#define VSHR32(a,shift) (a) -#define SATURATE16(x,a) (x) -#define SATURATE32(x,a) (x) - -#define PSHR(a,shift) (a) -#define SHR(a,shift) (a) -#define SHL(a,shift) (a) -#define SATURATE(x,a) (x) - -#define ADD16(a,b) ((a)+(b)) -#define SUB16(a,b) ((a)-(b)) -#define ADD32(a,b) ((a)+(b)) -#define SUB32(a,b) ((a)-(b)) -#define MULT16_16_16(a,b) ((a)*(b)) -#define MULT16_16(a,b) ((spx_word32_t)(a)*(spx_word32_t)(b)) -#define MAC16_16(c,a,b) ((c)+(spx_word32_t)(a)*(spx_word32_t)(b)) - -#define MULT16_32_Q11(a,b) ((a)*(b)) -#define MULT16_32_Q13(a,b) ((a)*(b)) -#define MULT16_32_Q14(a,b) ((a)*(b)) -#define MULT16_32_Q15(a,b) ((a)*(b)) -#define MULT16_32_P15(a,b) ((a)*(b)) - -#define MAC16_32_Q11(c,a,b) ((c)+(a)*(b)) -#define MAC16_32_Q15(c,a,b) ((c)+(a)*(b)) - -#define MAC16_16_Q11(c,a,b) ((c)+(a)*(b)) -#define MAC16_16_Q13(c,a,b) ((c)+(a)*(b)) -#define MAC16_16_P13(c,a,b) ((c)+(a)*(b)) -#define MULT16_16_Q11_32(a,b) ((a)*(b)) -#define MULT16_16_Q13(a,b) ((a)*(b)) -#define MULT16_16_Q14(a,b) ((a)*(b)) -#define MULT16_16_Q15(a,b) ((a)*(b)) -#define MULT16_16_P15(a,b) ((a)*(b)) -#define MULT16_16_P13(a,b) ((a)*(b)) -#define MULT16_16_P14(a,b) ((a)*(b)) - -#define DIV32_16(a,b) (((spx_word32_t)(a))/(spx_word16_t)(b)) -#define PDIV32_16(a,b) (((spx_word32_t)(a))/(spx_word16_t)(b)) -#define DIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b)) -#define PDIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b)) - - -#endif - - -#if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X) - -/* 2 on TI C5x DSP */ -#define BYTES_PER_CHAR 2 -#define BITS_PER_CHAR 16 -#define LOG2_BITS_PER_CHAR 4 - -#else - -#define BYTES_PER_CHAR 1 -#define BITS_PER_CHAR 8 -#define LOG2_BITS_PER_CHAR 3 - -#endif - - - -#ifdef FIXED_DEBUG -extern long long spx_mips; -#endif - - -#endif diff --git a/Engine/lib/speex/libspeex/bfin.h b/Engine/lib/speex/libspeex/bfin.h deleted file mode 100644 index b934cf2f1..000000000 --- a/Engine/lib/speex/libspeex/bfin.h +++ /dev/null @@ -1,15 +0,0 @@ -/* Common Blackfin assembly defines - * - * Copyright (C) 2005-2009 Analog Devices - */ - -#if __GNUC__ <= 3 -/* GCC-3.4 and older did not use hardware loops and thus did not have - * register constraints for declaring clobbers. - */ -# define BFIN_HWLOOP0_REGS -# define BFIN_HWLOOP1_REGS -#else -# define BFIN_HWLOOP0_REGS , "LB0", "LT0", "LC0" -# define BFIN_HWLOOP1_REGS , "LB1", "LT1", "LC1" -#endif diff --git a/Engine/lib/speex/libspeex/bits.c b/Engine/lib/speex/libspeex/bits.c deleted file mode 100644 index 2d782a2de..000000000 --- a/Engine/lib/speex/libspeex/bits.c +++ /dev/null @@ -1,372 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: speex_bits.c - - Handles bit packing/unpacking - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "speex/speex_bits.h" -#include "arch.h" -#include "os_support.h" - -/* Maximum size of the bit-stream (for fixed-size allocation) */ -#ifndef MAX_CHARS_PER_FRAME -#define MAX_CHARS_PER_FRAME (2000/BYTES_PER_CHAR) -#endif - -EXPORT void speex_bits_init(SpeexBits *bits) -{ - bits->chars = (char*)speex_alloc(MAX_CHARS_PER_FRAME); - if (!bits->chars) - return; - - bits->buf_size = MAX_CHARS_PER_FRAME; - - bits->owner=1; - - speex_bits_reset(bits); -} - -EXPORT void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size) -{ - bits->chars = (char*)buff; - bits->buf_size = buf_size; - - bits->owner=0; - - speex_bits_reset(bits); -} - -EXPORT void speex_bits_set_bit_buffer(SpeexBits *bits, void *buff, int buf_size) -{ - bits->chars = (char*)buff; - bits->buf_size = buf_size; - - bits->owner=0; - - bits->nbBits=buf_size<charPtr=0; - bits->bitPtr=0; - bits->overflow=0; - -} - -EXPORT void speex_bits_destroy(SpeexBits *bits) -{ - if (bits->owner) - speex_free(bits->chars); - /* Will do something once the allocation is dynamic */ -} - -EXPORT void speex_bits_reset(SpeexBits *bits) -{ - /* We only need to clear the first byte now */ - bits->chars[0]=0; - bits->nbBits=0; - bits->charPtr=0; - bits->bitPtr=0; - bits->overflow=0; -} - -EXPORT void speex_bits_rewind(SpeexBits *bits) -{ - bits->charPtr=0; - bits->bitPtr=0; - bits->overflow=0; -} - -EXPORT void speex_bits_read_from(SpeexBits *bits, const char *chars, int len) -{ - int i; - int nchars = len / BYTES_PER_CHAR; - if (nchars > bits->buf_size) - { - speex_notify("Packet is larger than allocated buffer"); - if (bits->owner) - { - char *tmp = (char*)speex_realloc(bits->chars, nchars); - if (tmp) - { - bits->buf_size=nchars; - bits->chars=tmp; - } else { - nchars=bits->buf_size; - speex_warning("Could not resize input buffer: truncating input"); - } - } else { - speex_warning("Do not own input buffer: truncating oversize input"); - nchars=bits->buf_size; - } - } -#if (BYTES_PER_CHAR==2) -/* Swap bytes to proper endian order (could be done externally) */ -#define HTOLS(A) ((((A) >> 8)&0xff)|(((A) & 0xff)<<8)) -#else -#define HTOLS(A) (A) -#endif - for (i=0;ichars[i]=HTOLS(chars[i]); - - bits->nbBits=nchars<charPtr=0; - bits->bitPtr=0; - bits->overflow=0; -} - -static void speex_bits_flush(SpeexBits *bits) -{ - int nchars = ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR); - if (bits->charPtr>0) - SPEEX_MOVE(bits->chars, &bits->chars[bits->charPtr], nchars-bits->charPtr); - bits->nbBits -= bits->charPtr<charPtr=0; -} - -EXPORT void speex_bits_read_whole_bytes(SpeexBits *bits, const char *chars, int nbytes) -{ - int i,pos; - int nchars = nbytes/BYTES_PER_CHAR; - - if (((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR)+nchars > bits->buf_size) - { - /* Packet is larger than allocated buffer */ - if (bits->owner) - { - char *tmp = (char*)speex_realloc(bits->chars, (bits->nbBits>>LOG2_BITS_PER_CHAR)+nchars+1); - if (tmp) - { - bits->buf_size=(bits->nbBits>>LOG2_BITS_PER_CHAR)+nchars+1; - bits->chars=tmp; - } else { - nchars=bits->buf_size-(bits->nbBits>>LOG2_BITS_PER_CHAR)-1; - speex_warning("Could not resize input buffer: truncating oversize input"); - } - } else { - speex_warning("Do not own input buffer: truncating oversize input"); - nchars=bits->buf_size; - } - } - - speex_bits_flush(bits); - pos=bits->nbBits>>LOG2_BITS_PER_CHAR; - for (i=0;ichars[pos+i]=HTOLS(chars[i]); - bits->nbBits+=nchars<bitPtr; - charPtr=bits->charPtr; - nbBits=bits->nbBits; - speex_bits_insert_terminator(bits); - bits->bitPtr=bitPtr; - bits->charPtr=charPtr; - bits->nbBits=nbBits; - - if (max_nchars > ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR)) - max_nchars = ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR); - - for (i=0;ichars[i]); - return max_nchars*BYTES_PER_CHAR; -} - -EXPORT int speex_bits_write_whole_bytes(SpeexBits *bits, char *chars, int max_nbytes) -{ - int max_nchars = max_nbytes/BYTES_PER_CHAR; - int i; - if (max_nchars > ((bits->nbBits)>>LOG2_BITS_PER_CHAR)) - max_nchars = ((bits->nbBits)>>LOG2_BITS_PER_CHAR); - for (i=0;ichars[i]); - - if (bits->bitPtr>0) - bits->chars[0]=bits->chars[max_nchars]; - else - bits->chars[0]=0; - bits->charPtr=0; - bits->nbBits &= (BITS_PER_CHAR-1); - return max_nchars*BYTES_PER_CHAR; -} - -EXPORT void speex_bits_pack(SpeexBits *bits, int data, int nbBits) -{ - unsigned int d=data; - - if (bits->charPtr+((nbBits+bits->bitPtr)>>LOG2_BITS_PER_CHAR) >= bits->buf_size) - { - speex_notify("Buffer too small to pack bits"); - if (bits->owner) - { - int new_nchars = ((bits->buf_size+5)*3)>>1; - char *tmp = (char*)speex_realloc(bits->chars, new_nchars); - if (tmp) - { - bits->buf_size=new_nchars; - bits->chars=tmp; - } else { - speex_warning("Could not resize input buffer: not packing"); - return; - } - } else { - speex_warning("Do not own input buffer: not packing"); - return; - } - } - - while(nbBits) - { - int bit; - bit = (d>>(nbBits-1))&1; - bits->chars[bits->charPtr] |= bit<<(BITS_PER_CHAR-1-bits->bitPtr); - bits->bitPtr++; - - if (bits->bitPtr==BITS_PER_CHAR) - { - bits->bitPtr=0; - bits->charPtr++; - bits->chars[bits->charPtr] = 0; - } - bits->nbBits++; - nbBits--; - } -} - -EXPORT int speex_bits_unpack_signed(SpeexBits *bits, int nbBits) -{ - unsigned int d=speex_bits_unpack_unsigned(bits,nbBits); - /* If number is negative */ - if (d>>(nbBits-1)) - { - d |= (-1)<charPtr<bitPtr+nbBits>bits->nbBits) - bits->overflow=1; - if (bits->overflow) - return 0; - while(nbBits) - { - d<<=1; - d |= (bits->chars[bits->charPtr]>>(BITS_PER_CHAR-1 - bits->bitPtr))&1; - bits->bitPtr++; - if (bits->bitPtr==BITS_PER_CHAR) - { - bits->bitPtr=0; - bits->charPtr++; - } - nbBits--; - } - return d; -} - -EXPORT unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits) -{ - unsigned int d=0; - int bitPtr, charPtr; - char *chars; - - if ((bits->charPtr<bitPtr+nbBits>bits->nbBits) - bits->overflow=1; - if (bits->overflow) - return 0; - - bitPtr=bits->bitPtr; - charPtr=bits->charPtr; - chars = bits->chars; - while(nbBits) - { - d<<=1; - d |= (chars[charPtr]>>(BITS_PER_CHAR-1 - bitPtr))&1; - bitPtr++; - if (bitPtr==BITS_PER_CHAR) - { - bitPtr=0; - charPtr++; - } - nbBits--; - } - return d; -} - -EXPORT int speex_bits_peek(SpeexBits *bits) -{ - if ((bits->charPtr<bitPtr+1>bits->nbBits) - bits->overflow=1; - if (bits->overflow) - return 0; - return (bits->chars[bits->charPtr]>>(BITS_PER_CHAR-1 - bits->bitPtr))&1; -} - -EXPORT void speex_bits_advance(SpeexBits *bits, int n) -{ - if (((bits->charPtr<bitPtr+n>bits->nbBits) || bits->overflow){ - bits->overflow=1; - return; - } - bits->charPtr += (bits->bitPtr+n) >> LOG2_BITS_PER_CHAR; /* divide by BITS_PER_CHAR */ - bits->bitPtr = (bits->bitPtr+n) & (BITS_PER_CHAR-1); /* modulo by BITS_PER_CHAR */ -} - -EXPORT int speex_bits_remaining(SpeexBits *bits) -{ - if (bits->overflow) - return -1; - else - return bits->nbBits-((bits->charPtr<bitPtr); -} - -EXPORT int speex_bits_nbytes(SpeexBits *bits) -{ - return ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR); -} - -EXPORT void speex_bits_insert_terminator(SpeexBits *bits) -{ - if (bits->bitPtr) - speex_bits_pack(bits, 0, 1); - while (bits->bitPtr) - speex_bits_pack(bits, 1, 1); -} diff --git a/Engine/lib/speex/libspeex/cb_search.c b/Engine/lib/speex/libspeex/cb_search.c deleted file mode 100644 index a170fd678..000000000 --- a/Engine/lib/speex/libspeex/cb_search.c +++ /dev/null @@ -1,623 +0,0 @@ -/* Copyright (C) 2002-2006 Jean-Marc Valin - File: cb_search.c - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "cb_search.h" -#include "filters.h" -#include "stack_alloc.h" -#include "vq.h" -#include "arch.h" -#include "math_approx.h" -#include "os_support.h" - -#ifdef _USE_SSE -#include "cb_search_sse.h" -#elif defined(ARM4_ASM) || defined(ARM5E_ASM) -#include "cb_search_arm4.h" -#elif defined(BFIN_ASM) -#include "cb_search_bfin.h" -#endif - -#ifndef DISABLE_ENCODER - -#ifndef OVERRIDE_COMPUTE_WEIGHTED_CODEBOOK -static void compute_weighted_codebook(const signed char *shape_cb, const spx_word16_t *r, spx_word16_t *resp, spx_word16_t *resp2, spx_word32_t *E, int shape_cb_size, int subvect_size, char *stack) -{ - int i, j, k; - VARDECL(spx_word16_t *shape); - ALLOC(shape, subvect_size, spx_word16_t); - for (i=0;isubvect_size; - nb_subvect = params->nb_subvect; - shape_cb_size = 1<shape_bits; - shape_cb = params->shape_cb; - have_sign = params->have_sign; - ALLOC(resp, shape_cb_size*subvect_size, spx_word16_t); -#ifdef _USE_SSE - ALLOC(resp2, (shape_cb_size*subvect_size)>>2, __m128); - ALLOC(E, shape_cb_size>>2, __m128); -#else - resp2 = resp; - ALLOC(E, shape_cb_size, spx_word32_t); -#endif - ALLOC(t, nsf, spx_word16_t); - ALLOC(e, nsf, spx_sig_t); - - /* FIXME: Do we still need to copy the target? */ - SPEEX_COPY(t, target, nsf); - - compute_weighted_codebook(shape_cb, r, resp, resp2, E, shape_cb_size, subvect_size, stack); - - for (i=0;ishape_bits+have_sign); - - { - int rind; - spx_word16_t *res; - spx_word16_t sign=1; - rind = best_index; - if (rind>=shape_cb_size) - { - sign=-1; - rind-=shape_cb_size; - } - res = resp+rind*subvect_size; - if (sign>0) - for (m=0;m=shape_cb_size) - { - sign=-1; - rind-=shape_cb_size; - } - - q=subvect_size-m; -#ifdef FIXED_POINT - g=sign*shape_cb[rind*subvect_size+m]; -#else - g=sign*0.03125*shape_cb[rind*subvect_size+m]; -#endif - target_update(t+subvect_size*(i+1), g, r+q, nsf-subvect_size*(i+1)); - } - } - - /* Update excitation */ - /* FIXME: We could update the excitation directly above */ - for (j=0;j10) - N=10; - /* Complexity isn't as important for the codebooks as it is for the pitch */ - N=(2*N)/3; - if (N<1) - N=1; - if (N==1) - { - split_cb_search_shape_sign_N1(target,ak,awk1,awk2,par,p,nsf,exc,r,bits,stack,update_target); - return; - } - ALLOC(ot2, N, spx_word16_t*); - ALLOC(nt2, N, spx_word16_t*); - ALLOC(oind, N, int*); - ALLOC(nind, N, int*); - - params = (const split_cb_params *) par; - subvect_size = params->subvect_size; - nb_subvect = params->nb_subvect; - shape_cb_size = 1<shape_bits; - shape_cb = params->shape_cb; - have_sign = params->have_sign; - ALLOC(resp, shape_cb_size*subvect_size, spx_word16_t); -#ifdef _USE_SSE - ALLOC(resp2, (shape_cb_size*subvect_size)>>2, __m128); - ALLOC(E, shape_cb_size>>2, __m128); -#else - resp2 = resp; - ALLOC(E, shape_cb_size, spx_word32_t); -#endif - ALLOC(t, nsf, spx_word16_t); - ALLOC(e, nsf, spx_sig_t); - ALLOC(ind, nb_subvect, int); - - ALLOC(tmp, 2*N*nsf, spx_word16_t); - for (i=0;im;n--) - { - ndist[n] = ndist[n-1]; - best_nind[n] = best_nind[n-1]; - best_ntarget[n] = best_ntarget[n-1]; - } - /* n is equal to m here, so they're interchangeable */ - ndist[m] = err; - best_nind[n] = best_index[k]; - best_ntarget[n] = j; - break; - } - } - } - } - if (i==0) - break; - } - for (j=0;j=shape_cb_size) - { - sign=-1; - rind-=shape_cb_size; - } - - q=subvect_size-m; -#ifdef FIXED_POINT - g=sign*shape_cb[rind*subvect_size+m]; -#else - g=sign*0.03125*shape_cb[rind*subvect_size+m]; -#endif - target_update(nt[j]+subvect_size*(i+1), g, r+q, nsf-subvect_size*(i+1)); - } - - for (q=0;qshape_bits+have_sign); - } - - /* Put everything back together */ - for (i=0;i=shape_cb_size) - { - sign=-1; - rind-=shape_cb_size; - } -#ifdef FIXED_POINT - if (sign==1) - { - for (j=0;jsubvect_size; - nb_subvect = params->nb_subvect; - - shape_cb = params->shape_cb; - have_sign = params->have_sign; - - ALLOC(ind, nb_subvect, int); - ALLOC(signs, nb_subvect, int); - - /* Decode codewords and gains */ - for (i=0;ishape_bits); - } - /* Compute decoded excitation */ - for (i=0;i>>= 13;\n\t" - "A1 += R0.L*R0.L (IS);\n\t" - "W[P3++] = R0;\n\t" - "P0 += 1;\n\t" - "P2 += 2;\n\t" - "LOOP_END outter%=;\n\t" - "P4 = %4;\n\t" - "R1 = A1;\n\t" - "[P4] = R1;\n\t" - : - : "m" (subvect_size), "m" (shape_cb), "m" (r), "m" (resp), "m" (E) - : "A0", "P0", "P1", "P2", "P3", "P4", "R0", "R1", "R2", "I0", "I1", "L0", - "L1", "A0", "A1", "memory", "ASTAT" BFIN_HWLOOP0_REGS BFIN_HWLOOP1_REGS - ); - shape_cb += subvect_size; - resp += subvect_size; - E++; - } -} - -#define OVERRIDE_TARGET_UPDATE -static inline void target_update(spx_word16_t *t, spx_word16_t g, spx_word16_t *r, int len) -{ - if (!len) - return; - __asm__ __volatile__ - ( - "I0 = %0;\n\t" - "I1 = %1;\n\t" - "L0 = 0;\n\t" - "L1 = 0;\n\t" - "R2 = 4096;\n\t" - "LOOP tupdate%= LC0 = %3;\n\t" - "LOOP_BEGIN tupdate%=;\n\t" - "R0.L = W[I0] || R1.L = W[I1++];\n\t" - "R1 = (A1 = R1.L*%2.L) (IS);\n\t" - "R1 = R1 + R2;\n\t" - "R1 >>>= 13;\n\t" - "R0.L = R0.L - R1.L;\n\t" - "W[I0++] = R0.L;\n\t" - "LOOP_END tupdate%=;\n\t" - : - : "a" (t), "a" (r), "d" (g), "a" (len) - : "R0", "R1", "R2", "A1", "I0", "I1", "L0", "L1", "ASTAT" BFIN_HWLOOP0_REGS - ); -} diff --git a/Engine/lib/speex/libspeex/cb_search_sse.h b/Engine/lib/speex/libspeex/cb_search_sse.h deleted file mode 100644 index 8b039686f..000000000 --- a/Engine/lib/speex/libspeex/cb_search_sse.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (C) 2004 Jean-Marc Valin */ -/** - @file cb_search_sse.h - @brief Fixed codebook functions (SSE version) -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include - -static inline void _spx_mm_getr_ps (__m128 U, float *__Z, float *__Y, float *__X, float *__W) -{ - union { - float __a[4]; - __m128 __v; - } __u; - - __u.__v = U; - - *__Z = __u.__a[0]; - *__Y = __u.__a[1]; - *__X = __u.__a[2]; - *__W = __u.__a[3]; - -} - -#define OVERRIDE_COMPUTE_WEIGHTED_CODEBOOK -static void compute_weighted_codebook(const signed char *shape_cb, const spx_sig_t *_r, float *resp, __m128 *resp2, __m128 *E, int shape_cb_size, int subvect_size, char *stack) -{ - int i, j, k; - __m128 resj, EE; - VARDECL(__m128 *r); - VARDECL(__m128 *shape); - ALLOC(r, subvect_size, __m128); - ALLOC(shape, subvect_size, __m128); - for(j=0;j>2] = EE; - } -} diff --git a/Engine/lib/speex/libspeex/exc_10_16_table.c b/Engine/lib/speex/libspeex/exc_10_16_table.c deleted file mode 100644 index f75ba3034..000000000 --- a/Engine/lib/speex/libspeex/exc_10_16_table.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: exc_10_16_table.c - Codebook for excitation in narrowband CELP mode (3200 bps) - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -const signed char exc_10_16_table[160] = { -22,39,14,44,11,35,-2,23,-4,6, -46,-28,13,-27,-23,12,4,20,-5,9, -37,-18,-23,23,0,9,-6,-20,4,-1, --17,-5,-4,17,0,1,9,-2,1,2, -2,-12,8,-25,39,15,9,16,-55,-11, -9,11,5,10,-2,-60,8,13,-6,11, --16,27,-47,-12,11,1,16,-7,9,-3, --29,9,-14,25,-19,34,36,12,40,-10, --3,-24,-14,-37,-21,-35,-2,-36,3,-6, -67,28,6,-17,-3,-12,-16,-15,-17,-7, --59,-36,-13,1,7,1,2,10,2,11, -13,10,8,-2,7,3,5,4,2,2, --3,-8,4,-5,6,7,-42,15,35,-2, --46,38,28,-20,-9,1,7,-3,0,-2, -0,0,0,0,0,0,0,0,0,0, --15,-28,52,32,5,-5,-17,-20,-10,-1}; diff --git a/Engine/lib/speex/libspeex/exc_10_32_table.c b/Engine/lib/speex/libspeex/exc_10_32_table.c deleted file mode 100644 index 89425f0bc..000000000 --- a/Engine/lib/speex/libspeex/exc_10_32_table.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: exc_10_32_table.c - Codebook for excitation in narrowband CELP mode (4000 bps) - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -const signed char exc_10_32_table[320] = { -7,17,17,27,25,22,12,4,-3,0, -28,-36,39,-24,-15,3,-9,15,-5,10, -31,-28,11,31,-21,9,-11,-11,-2,-7, --25,14,-22,31,4,-14,19,-12,14,-5, -4,-7,4,-5,9,0,-2,42,-47,-16, -1,8,0,9,23,-57,0,28,-11,6, --31,55,-45,3,-5,4,2,-2,4,-7, --3,6,-2,7,-3,12,5,8,54,-10, -8,-7,-8,-24,-25,-27,-14,-5,8,5, -44,23,5,-9,-11,-11,-13,-9,-12,-8, --29,-8,-22,6,-15,3,-12,-1,-5,-3, -34,-1,29,-16,17,-4,12,2,1,4, --2,-4,2,-1,11,-3,-52,28,30,-9, --32,25,44,-20,-24,4,6,-1,0,0, -0,0,0,0,0,0,0,0,0,0, --25,-10,22,29,13,-13,-22,-13,-4,0, --4,-16,10,15,-36,-24,28,25,-1,-3, -66,-33,-11,-15,6,0,3,4,-2,5, -24,-20,-47,29,19,-2,-4,-1,0,-1, --2,3,1,8,-11,5,5,-57,28,28, -0,-16,4,-4,12,-6,-1,2,-20,61, --9,24,-22,-42,29,6,17,8,4,2, --65,15,8,10,5,6,5,3,2,-2, --3,5,-9,4,-5,23,13,23,-3,-63, -3,-5,-4,-6,0,-3,23,-36,-46,9, -5,5,8,4,9,-5,1,-3,10,1, --6,10,-11,24,-47,31,22,-12,14,-10, -6,11,-7,-7,7,-31,51,-12,-6,7, -6,-17,9,-11,-20,52,-19,3,-6,-6, --8,-5,23,-41,37,1,-21,10,-14,8, -7,5,-15,-15,23,39,-26,-33,7,2, --32,-30,-21,-8,4,12,17,15,14,11}; diff --git a/Engine/lib/speex/libspeex/exc_20_32_table.c b/Engine/lib/speex/libspeex/exc_20_32_table.c deleted file mode 100644 index f7b3032bb..000000000 --- a/Engine/lib/speex/libspeex/exc_20_32_table.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: exc_20_32_table.c - Codebook for excitation in narrowband CELP mode (2000 bps) - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -const signed char exc_20_32_table[640] = { -12,32,25,46,36,33,9,14,-3,6,1,-8,0,-10,-5,-7,-7,-7,-5,-5, -31,-27,24,-32,-4,10,-11,21,-3,19,23,-9,22,24,-10,-1,-10,-13,-7,-11, -42,-33,31,19,-8,0,-10,-16,1,-21,-17,10,-8,14,8,4,11,-2,5,-2, --33,11,-16,33,11,-4,9,-4,11,2,6,-5,8,-5,11,-4,-6,26,-36,-16, -0,4,-2,-8,12,6,-1,34,-46,-22,9,9,21,9,5,-66,-5,26,2,10, -13,2,19,9,12,-81,3,13,13,0,-14,22,-35,6,-7,-4,6,-6,10,-6, --31,38,-33,0,-10,-11,5,-12,12,-17,5,0,-6,13,-9,10,8,25,33,2, --12,8,-6,10,-2,21,7,17,43,5,11,-7,-9,-20,-36,-20,-23,-4,-4,-3, -27,-9,-9,-49,-39,-38,-11,-9,6,5,23,25,5,3,3,4,1,2,-3,-1, -87,39,17,-21,-9,-19,-9,-15,-13,-14,-17,-11,-10,-11,-8,-6,-1,-3,-3,-1, --54,-34,-27,-8,-11,-4,-5,0,0,4,8,6,9,7,9,7,6,5,5,5, -48,10,19,-10,12,-1,9,-3,2,5,-3,2,-2,-2,0,-2,-26,6,9,-7, --16,-9,2,7,7,-5,-43,11,22,-11,-9,34,37,-15,-13,-6,1,-1,1,1, --64,56,52,-11,-27,5,4,3,1,2,1,3,-1,-4,-4,-10,-7,-4,-4,2, --1,-7,-7,-12,-10,-15,-9,-5,-5,-11,-16,-13,6,16,4,-13,-16,-10,-4,2, --47,-13,25,47,19,-14,-20,-8,-17,0,-3,-13,1,6,-17,-14,15,1,10,6, --24,0,-10,19,-69,-8,14,49,17,-5,33,-29,3,-4,0,2,-8,5,-6,2, -120,-56,-12,-47,23,-9,6,-5,1,2,-5,1,-10,4,-1,-1,4,-1,0,-3, -30,-52,-67,30,22,11,-1,-4,3,0,7,2,0,1,-10,-4,-8,-13,5,1, -1,-1,5,13,-9,-3,-10,-62,22,48,-4,-6,2,3,5,1,1,4,1,13, -3,-20,10,-9,13,-2,-4,9,-20,44,-1,20,-32,-67,19,0,28,11,8,2, --11,15,-19,-53,31,2,34,10,6,-4,-58,8,10,13,14,1,12,2,0,0, --128,37,-8,44,-9,26,-3,18,2,6,11,-1,9,1,5,3,0,1,1,2, -12,3,-2,-3,7,25,9,18,-6,-37,3,-8,-16,3,-10,-7,17,-34,-44,11, -17,-15,-3,-16,-1,-13,11,-46,-65,-2,8,13,2,4,4,5,15,5,9,6, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, --9,19,-12,12,-28,38,29,-1,12,2,5,23,-10,3,4,-15,21,-4,3,3, -6,17,-9,-4,-8,-20,26,5,-10,6,1,-19,18,-15,-12,47,-6,-2,-7,-9, --1,-17,-2,-2,-14,30,-14,2,-7,-4,-1,-12,11,-25,16,-3,-12,11,-7,7, --17,1,19,-28,31,-7,-10,7,-10,3,12,5,-16,6,24,41,-29,-54,0,1, -7,-1,5,-6,13,10,-4,-8,8,-9,-27,-53,-38,-1,10,19,17,16,12,12, -0,3,-7,-4,13,12,-31,-14,6,-5,3,5,17,43,50,25,10,1,-6,-2}; diff --git a/Engine/lib/speex/libspeex/exc_5_256_table.c b/Engine/lib/speex/libspeex/exc_5_256_table.c deleted file mode 100644 index 169b62876..000000000 --- a/Engine/lib/speex/libspeex/exc_5_256_table.c +++ /dev/null @@ -1,290 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: exc_5_256_table.c - Codebook for excitation in narrowband CELP mode (12800 bps) - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -const signed char exc_5_256_table[1280] = { --8,-37,5,-43,5, -73,61,39,12,-3, --61,-32,2,42,30, --3,17,-27,9,34, -20,-1,-5,2,23, --7,-46,26,53,-47, -20,-2,-33,-89,-51, --64,27,11,15,-34, --5,-56,25,-9,-1, --29,1,40,67,-23, --16,16,33,19,7, -14,85,22,-10,-10, --12,-7,-1,52,89, -29,11,-20,-37,-46, --15,17,-24,-28,24, -2,1,0,23,-101, -23,14,-1,-23,-18, -9,5,-13,38,1, --28,-28,4,27,51, --26,34,-40,35,47, -54,38,-54,-26,-6, -42,-25,13,-30,-36, -18,41,-4,-33,23, --32,-7,-4,51,-3, -17,-52,56,-47,36, --2,-21,36,10,8, --33,31,19,9,-5, --40,10,-9,-21,19, -18,-78,-18,-5,0, --26,-36,-47,-51,-44, -18,40,27,-2,29, -49,-26,2,32,-54, -30,-73,54,3,-5, -36,22,53,10,-1, --84,-53,-29,-5,3, --44,53,-51,4,22, -71,-35,-1,33,-5, --27,-7,36,17,-23, --39,16,-9,-55,-15, --20,39,-35,6,-39, --14,18,48,-64,-17, --15,9,39,81,37, --68,37,47,-21,-6, --104,13,6,9,-2, -35,8,-23,18,42, -45,21,33,-5,-49, -9,-6,-43,-56,39, -2,-16,-25,87,1, --3,-9,17,-25,-11, --9,-1,10,2,-14, --14,4,-1,-10,28, --23,40,-32,26,-9, -26,4,-27,-23,3, -42,-60,1,49,-3, -27,10,-52,-40,-2, -18,45,-23,17,-44, -3,-3,17,-46,52, --40,-47,25,75,31, --49,53,30,-30,-32, --36,38,-6,-15,-16, -54,-27,-48,3,38, --29,-32,-22,-14,-4, --23,-13,32,-39,9, -8,-45,-13,34,-16, -49,40,32,31,28, -23,23,32,47,59, --68,8,62,44,25, --14,-24,-65,-16,36, -67,-25,-38,-21,4, --33,-2,42,5,-63, -40,11,26,-42,-23, --61,79,-31,23,-20, -10,-32,53,-25,-36, -10,-26,-5,3,0, --71,5,-10,-37,1, --24,21,-54,-17,1, --29,-25,-15,-27,32, -68,45,-16,-37,-18, --5,1,0,-77,71, --6,3,-20,71,-67, -29,-35,10,-30,19, -4,16,17,5,0, --14,19,2,28,26, -59,3,2,24,39, -55,-50,-45,-18,-17, -33,-35,14,-1,1, -8,87,-35,-29,0, --27,13,-7,23,-13, -37,-40,50,-35,14, -19,-7,-14,49,54, --5,22,-2,-29,-8, --27,38,13,27,48, -12,-41,-21,-15,28, -7,-16,-24,-19,-20, -11,-20,9,2,13, -23,-20,11,27,-27, -71,-69,8,2,-6, -22,12,16,16,9, --16,-8,-17,1,25, -1,40,-37,-33,66, -94,53,4,-22,-25, --41,-42,25,35,-16, --15,57,31,-29,-32, -21,16,-60,45,15, --1,7,57,-26,-47, --29,11,8,15,19, --105,-8,54,27,10, --17,6,-12,-1,-10, -4,0,23,-10,31, -13,11,10,12,-64, -23,-3,-8,-19,16, -52,24,-40,16,10, -40,5,9,0,-13, --7,-21,-8,-6,-7, --21,59,16,-53,18, --60,11,-47,14,-18, -25,-13,-24,4,-39, -16,-28,54,26,-67, -30,27,-20,-52,20, --12,55,12,18,-16, -39,-14,-6,-26,56, --88,-55,12,25,26, --37,6,75,0,-34, --81,54,-30,1,-7, -49,-23,-14,21,10, --62,-58,-57,-47,-34, -15,-4,34,-78,31, -25,-11,7,50,-10, -42,-63,14,-36,-4, -57,55,57,53,42, --42,-1,15,40,37, -15,25,-11,6,1, -31,-2,-6,-1,-7, --64,34,28,30,-1, -3,21,0,-88,-12, --56,25,-28,40,8, --28,-14,9,12,2, --6,-17,22,49,-6, --26,14,28,-20,4, --12,50,35,40,13, --38,-58,-29,17,30, -22,60,26,-54,-39, --12,58,-28,-63,10, --21,-8,-12,26,-62, -6,-10,-11,-22,-6, --7,4,1,18,2, --70,11,14,4,13, -19,-24,-34,24,67, -17,51,-21,13,23, -54,-30,48,1,-13, -80,26,-16,-2,13, --4,6,-30,29,-24, -73,-58,30,-27,20, --2,-21,41,45,30, --27,-3,-5,-18,-20, --49,-3,-35,10,42, --19,-67,-53,-11,9, -13,-15,-33,-51,-30, -15,7,25,-30,4, -28,-22,-34,54,-29, -39,-46,20,16,34, --4,47,75,1,-44, --55,-24,7,-1,9, --42,50,-8,-36,41, -68,0,-4,-10,-23, --15,-50,64,36,-9, --27,12,25,-38,-47, --37,32,-49,51,-36, -2,-4,69,-26,19, -7,45,67,46,13, --63,46,15,-47,4, --41,13,-6,5,-21, -37,26,-55,-7,33, --1,-28,10,-17,-64, --14,0,-36,-17,93, --3,-9,-66,44,-21, -3,-12,38,-6,-13, --12,19,13,43,-43, --10,-12,6,-5,9, --49,32,-5,2,4, -5,15,-16,10,-21, -8,-62,-8,64,8, -79,-1,-66,-49,-18, -5,40,-5,-30,-45, -1,-6,21,-32,93, --18,-30,-21,32,21, --18,22,8,5,-41, --54,80,22,-10,-7, --8,-23,-64,66,56, --14,-30,-41,-46,-14, --29,-37,27,-14,42, --2,-9,-29,34,14, -33,-14,22,4,10, -26,26,28,32,23, --72,-32,3,0,-14, -35,-42,-78,-32,6, -29,-18,-45,-5,7, --33,-45,-3,-22,-34, -8,-8,4,-51,-25, --9,59,-78,21,-5, --25,-48,66,-15,-17, --24,-49,-13,25,-23, --64,-6,40,-24,-19, --11,57,-33,-8,1, -10,-52,-54,28,39, -49,34,-11,-61,-41, --43,10,15,-15,51, -30,15,-51,32,-34, --2,-34,14,18,16, -1,1,-3,-3,1, -1,-18,6,16,48, -12,-5,-42,7,36, -48,7,-20,-10,7, -12,2,54,39,-38, -37,54,4,-11,-8, --46,-10,5,-10,-34, -46,-12,29,-37,39, -36,-11,24,56,17, -14,20,25,0,-25, --28,55,-7,-5,27, -3,9,-26,-8,6, --24,-10,-30,-31,-34, -18,4,22,21,40, --1,-29,-37,-8,-21, -92,-29,11,-3,11, -73,23,22,7,4, --44,-9,-11,21,-13, -11,9,-78,-1,47, -114,-12,-37,-19,-5, --11,-22,19,12,-30, -7,38,45,-21,-8, --9,55,-45,56,-21, -7,17,46,-57,-87, --6,27,31,31,7, --56,-12,46,21,-5, --12,36,3,3,-21, -43,19,12,-7,9, --14,0,-9,-33,-91, -7,26,3,-11,64, -83,-31,-46,25,2, -9,5,2,2,-1, -20,-17,10,-5,-27, --8,20,8,-19,16, --21,-13,-31,5,5, -42,24,9,34,-20, -28,-61,22,11,-39, -64,-20,-1,-30,-9, --20,24,-25,-24,-29, -22,-60,6,-5,41, --9,-87,14,34,15, --57,52,69,15,-3, --102,58,16,3,6, -60,-75,-32,26,7, --57,-27,-32,-24,-21, --29,-16,62,-46,31, -30,-27,-15,7,15}; diff --git a/Engine/lib/speex/libspeex/exc_5_64_table.c b/Engine/lib/speex/libspeex/exc_5_64_table.c deleted file mode 100644 index 6d2ae2be5..000000000 --- a/Engine/lib/speex/libspeex/exc_5_64_table.c +++ /dev/null @@ -1,98 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: exc_5_64_table.c - Codebook for excitation in narrowband CELP mode (9600 bps) - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -const signed char exc_5_64_table[320]={ -1,5,-15,49,-66, --48,-4,50,-44,7, -37,16,-18,25,-26, --26,-15,19,19,-27, --47,28,57,5,-17, --32,-41,68,21,-2, -64,56,8,-16,-13, --26,-9,-16,11,6, --39,25,-19,22,-31, -20,-45,55,-43,10, --16,47,-40,40,-20, --51,3,-17,-14,-15, --24,53,-20,-46,46, -27,-68,32,3,-18, --5,9,-31,16,-9, --10,-1,-23,48,95, -47,25,-41,-32,-3, -15,-25,-55,36,41, --27,20,5,13,14, --22,5,2,-23,18, -46,-15,17,-18,-34, --5,-8,27,-55,73, -16,2,-1,-17,40, --78,33,0,2,19, -4,53,-16,-15,-16, --28,-3,-13,49,8, --7,-29,27,-13,32, -20,32,-61,16,14, -41,44,40,24,20, -7,4,48,-60,-77, -17,-6,-48,65,-15, -32,-30,-71,-10,-3, --6,10,-2,-7,-29, --56,67,-30,7,-5, -86,-6,-10,0,5, --31,60,34,-38,-3, -24,10,-2,30,23, -24,-41,12,70,-43, -15,-17,6,13,16, --13,8,30,-15,-8, -5,23,-34,-98,-4, --13,13,-48,-31,70, -12,31,25,24,-24, -26,-7,33,-16,8, -5,-11,-14,-8,-65, -13,10,-2,-9,0, --3,-68,5,35,7, -0,-31,-1,-17,-9, --9,16,-37,-18,-1, -69,-48,-28,22,-21, --11,5,49,55,23, --86,-36,16,2,13, -63,-51,30,-11,13, -24,-18,-6,14,-19, -1,41,9,-5,27, --36,-44,-34,-37,-21, --26,31,-39,15,43, -5,-8,29,20,-8, --20,-52,-28,-1,13, -26,-34,-10,-9,27, --8,8,27,-66,4, -12,-22,49,10,-77, -32,-18,3,-38,12, --3,-1,2,2,0}; diff --git a/Engine/lib/speex/libspeex/exc_8_128_table.c b/Engine/lib/speex/libspeex/exc_8_128_table.c deleted file mode 100644 index fd0589061..000000000 --- a/Engine/lib/speex/libspeex/exc_8_128_table.c +++ /dev/null @@ -1,162 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: exc_8_128_table.c - Codebook for excitation in narrowband CELP mode (7000 bps) - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -const signed char exc_8_128_table[1024] = { --14,9,13,-32,2,-10,31,-10, --8,-8,6,-4,-1,10,-64,23, -6,20,13,6,8,-22,16,34, -7,42,-49,-28,5,26,4,-15, -41,34,41,32,33,24,23,14, -8,40,34,4,-24,-41,-19,-15, -13,-13,33,-54,24,27,-44,33, -27,-15,-15,24,-19,14,-36,14, --9,24,-12,-4,37,-5,16,-34, -5,10,33,-15,-54,-16,12,25, -12,1,2,0,3,-1,-4,-4, -11,2,-56,54,27,-20,13,-6, --46,-41,-33,-11,-5,7,12,14, --14,-5,8,20,6,3,4,-8, --5,-42,11,8,-14,25,-2,2, -13,11,-22,39,-9,9,5,-45, --9,7,-9,12,-7,34,-17,-102, -7,2,-42,18,35,-9,-34,11, --5,-2,3,22,46,-52,-25,-9, --94,8,11,-5,-5,-5,4,-7, --35,-7,54,5,-32,3,24,-9, --22,8,65,37,-1,-12,-23,-6, --9,-28,55,-33,14,-3,2,18, --60,41,-17,8,-16,17,-11,0, --11,29,-28,37,9,-53,33,-14, --9,7,-25,-7,-11,26,-32,-8, -24,-21,22,-19,19,-10,29,-14, -0,0,0,0,0,0,0,0, --5,-52,10,41,6,-30,-4,16, -32,22,-27,-22,32,-3,-28,-3, -3,-35,6,17,23,21,8,2, -4,-45,-17,14,23,-4,-31,-11, --3,14,1,19,-11,2,61,-8, -9,-12,7,-10,12,-3,-24,99, --48,23,50,-37,-5,-23,0,8, --14,35,-64,-5,46,-25,13,-1, --49,-19,-15,9,34,50,25,11, --6,-9,-16,-20,-32,-33,-32,-27, -10,-8,12,-15,56,-14,-32,33, -3,-9,1,65,-9,-9,-10,-2, --6,-23,9,17,3,-28,13,-32, -4,-2,-10,4,-16,76,12,-52, -6,13,33,-6,4,-14,-9,-3, -1,-15,-16,28,1,-15,11,16, -9,4,-21,-37,-40,-6,22,12, --15,-23,-14,-17,-16,-9,-10,-9, -13,-39,41,5,-9,16,-38,25, -46,-47,4,49,-14,17,-2,6, -18,5,-6,-33,-22,44,50,-2, -1,3,-6,7,7,-3,-21,38, --18,34,-14,-41,60,-13,6,16, --24,35,19,-13,-36,24,3,-17, --14,-10,36,44,-44,-29,-3,3, --54,-8,12,55,26,4,-2,-5, -2,-11,22,-23,2,22,1,-25, --39,66,-49,21,-8,-2,10,-14, --60,25,6,10,27,-25,16,5, --2,-9,26,-13,-20,58,-2,7, -52,-9,2,5,-4,-15,23,-1, --38,23,8,27,-6,0,-27,-7, -39,-10,-14,26,11,-45,-12,9, --5,34,4,-35,10,43,-22,-11, -56,-7,20,1,10,1,-26,9, -94,11,-27,-14,-13,1,-11,0, -14,-5,-6,-10,-4,-15,-8,-41, -21,-5,1,-28,-8,22,-9,33, --23,-4,-4,-12,39,4,-7,3, --60,80,8,-17,2,-6,12,-5, -1,9,15,27,31,30,27,23, -61,47,26,10,-5,-8,-12,-13, -5,-18,25,-15,-4,-15,-11,12, --2,-2,-16,-2,-6,24,12,11, --4,9,1,-9,14,-45,57,12, -20,-35,26,11,-64,32,-10,-10, -42,-4,-9,-16,32,24,7,10, -52,-11,-57,29,0,8,0,-6, -17,-17,-56,-40,7,20,18,12, --6,16,5,7,-1,9,1,10, -29,12,16,13,-2,23,7,9, --3,-4,-5,18,-64,13,55,-25, -9,-9,24,14,-25,15,-11,-40, --30,37,1,-19,22,-5,-31,13, --2,0,7,-4,16,-67,12,66, --36,24,-8,18,-15,-23,19,0, --45,-7,4,3,-13,13,35,5, -13,33,10,27,23,0,-7,-11, -43,-74,36,-12,2,5,-8,6, --33,11,-16,-14,-5,-7,-3,17, --34,27,-16,11,-9,15,33,-31, -8,-16,7,-6,-7,63,-55,-17, -11,-1,20,-46,34,-30,6,9, -19,28,-9,5,-24,-8,-23,-2, -31,-19,-16,-5,-15,-18,0,26, -18,37,-5,-15,-2,17,5,-27, -21,-33,44,12,-27,-9,17,11, -25,-21,-31,-7,13,33,-8,-25, --7,7,-10,4,-6,-9,48,-82, --23,-8,6,11,-23,3,-3,49, --29,25,31,4,14,16,9,-4, --18,10,-26,3,5,-44,-9,9, --47,-55,15,9,28,1,4,-3, -46,6,-6,-38,-29,-31,-15,-6, -3,0,14,-6,8,-54,-50,33, --5,1,-14,33,-48,26,-4,-5, --3,-5,-3,-5,-28,-22,77,55, --1,2,10,10,-9,-14,-66,-49, -11,-36,-6,-20,10,-10,16,12, -4,-1,-16,45,-44,-50,31,-2, -25,42,23,-32,-22,0,11,20, --40,-35,-40,-36,-32,-26,-21,-13, -52,-22,6,-24,-20,17,-5,-8, -36,-25,-11,21,-26,6,34,-8, -7,20,-3,5,-25,-8,18,-5, --9,-4,1,-9,20,20,39,48, --24,9,5,-65,22,29,4,3, --43,-11,32,-6,9,19,-27,-10, --47,-14,24,10,-7,-36,-7,-1, --4,-5,-5,16,53,25,-26,-29, --4,-12,45,-58,-34,33,-5,2, --1,27,-48,31,-15,22,-5,4, -7,7,-25,-3,11,-22,16,-12, -8,-3,7,-11,45,14,-73,-19, -56,-46,24,-20,28,-12,-2,-1, --36,-3,-33,19,-6,7,2,-15, -5,-31,-45,8,35,13,20,0, --9,48,-13,-43,-3,-13,2,-5, -72,-68,-27,2,1,-2,-7,5, -36,33,-40,-12,-4,-5,23,19}; diff --git a/Engine/lib/speex/libspeex/fftwrap.c b/Engine/lib/speex/libspeex/fftwrap.c deleted file mode 100644 index 4573479d0..000000000 --- a/Engine/lib/speex/libspeex/fftwrap.c +++ /dev/null @@ -1,448 +0,0 @@ -/* Copyright (C) 2005-2006 Jean-Marc Valin - File: fftwrap.c - - Wrapper for various FFTs - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "arch.h" -#include "os_support.h" - -#define MAX_FFT_SIZE 2048 - -#ifdef FIXED_POINT -static int maximize_range(spx_word16_t *in, spx_word16_t *out, spx_word16_t bound, int len) -{ - int i, shift; - spx_word16_t max_val = 0; - for (i=0;imax_val) - max_val = in[i]; - if (-in[i]>max_val) - max_val = -in[i]; - } - shift=0; - while (max_val <= (bound>>1) && max_val != 0) - { - max_val <<= 1; - shift++; - } - for (i=0;i - -void *spx_fft_init(int size) -{ - struct drft_lookup *table; - table = speex_alloc(sizeof(struct drft_lookup)); - spx_drft_init((struct drft_lookup *)table, size); - return (void*)table; -} - -void spx_fft_destroy(void *table) -{ - spx_drft_clear(table); - speex_free(table); -} - -void spx_fft(void *table, float *in, float *out) -{ - if (in==out) - { - int i; - float scale = 1./((struct drft_lookup *)table)->n; - speex_warning("FFT should not be done in-place"); - for (i=0;i<((struct drft_lookup *)table)->n;i++) - out[i] = scale*in[i]; - } else { - int i; - float scale = 1./((struct drft_lookup *)table)->n; - for (i=0;i<((struct drft_lookup *)table)->n;i++) - out[i] = scale*in[i]; - } - spx_drft_forward((struct drft_lookup *)table, out); -} - -void spx_ifft(void *table, float *in, float *out) -{ - if (in==out) - { - speex_warning("FFT should not be done in-place"); - } else { - int i; - for (i=0;i<((struct drft_lookup *)table)->n;i++) - out[i] = in[i]; - } - spx_drft_backward((struct drft_lookup *)table, out); -} - -#elif defined(USE_INTEL_MKL) -#include - -struct mkl_config { - DFTI_DESCRIPTOR_HANDLE desc; - int N; -}; - -void *spx_fft_init(int size) -{ - struct mkl_config *table = (struct mkl_config *) speex_alloc(sizeof(struct mkl_config)); - table->N = size; - DftiCreateDescriptor(&table->desc, DFTI_SINGLE, DFTI_REAL, 1, size); - DftiSetValue(table->desc, DFTI_PACKED_FORMAT, DFTI_PACK_FORMAT); - DftiSetValue(table->desc, DFTI_PLACEMENT, DFTI_NOT_INPLACE); - DftiSetValue(table->desc, DFTI_FORWARD_SCALE, 1.0f / size); - DftiCommitDescriptor(table->desc); - return table; -} - -void spx_fft_destroy(void *table) -{ - struct mkl_config *t = (struct mkl_config *) table; - DftiFreeDescriptor(t->desc); - speex_free(table); -} - -void spx_fft(void *table, spx_word16_t *in, spx_word16_t *out) -{ - struct mkl_config *t = (struct mkl_config *) table; - DftiComputeForward(t->desc, in, out); -} - -void spx_ifft(void *table, spx_word16_t *in, spx_word16_t *out) -{ - struct mkl_config *t = (struct mkl_config *) table; - DftiComputeBackward(t->desc, in, out); -} - -#elif defined(USE_INTEL_IPP) - -#include - -struct ipp_fft_config -{ - IppsDFTSpec_R_32f *dftSpec; - Ipp8u *buffer; -}; - -void *spx_fft_init(int size) -{ - int bufferSize = 0; - int hint; - struct ipp_fft_config *table; - - table = (struct ipp_fft_config *)speex_alloc(sizeof(struct ipp_fft_config)); - - /* there appears to be no performance difference between ippAlgHintFast and - ippAlgHintAccurate when using the with the floating point version - of the fft. */ - hint = ippAlgHintAccurate; - - ippsDFTInitAlloc_R_32f(&table->dftSpec, size, IPP_FFT_DIV_FWD_BY_N, hint); - - ippsDFTGetBufSize_R_32f(table->dftSpec, &bufferSize); - table->buffer = ippsMalloc_8u(bufferSize); - - return table; -} - -void spx_fft_destroy(void *table) -{ - struct ipp_fft_config *t = (struct ipp_fft_config *)table; - ippsFree(t->buffer); - ippsDFTFree_R_32f(t->dftSpec); - speex_free(t); -} - -void spx_fft(void *table, spx_word16_t *in, spx_word16_t *out) -{ - struct ipp_fft_config *t = (struct ipp_fft_config *)table; - ippsDFTFwd_RToPack_32f(in, out, t->dftSpec, t->buffer); -} - -void spx_ifft(void *table, spx_word16_t *in, spx_word16_t *out) -{ - struct ipp_fft_config *t = (struct ipp_fft_config *)table; - ippsDFTInv_PackToR_32f(in, out, t->dftSpec, t->buffer); -} - -#elif defined(USE_GPL_FFTW3) - -#include - -struct fftw_config { - float *in; - float *out; - fftwf_plan fft; - fftwf_plan ifft; - int N; -}; - -void *spx_fft_init(int size) -{ - struct fftw_config *table = (struct fftw_config *) speex_alloc(sizeof(struct fftw_config)); - table->in = fftwf_malloc(sizeof(float) * (size+2)); - table->out = fftwf_malloc(sizeof(float) * (size+2)); - - table->fft = fftwf_plan_dft_r2c_1d(size, table->in, (fftwf_complex *) table->out, FFTW_PATIENT); - table->ifft = fftwf_plan_dft_c2r_1d(size, (fftwf_complex *) table->in, table->out, FFTW_PATIENT); - - table->N = size; - return table; -} - -void spx_fft_destroy(void *table) -{ - struct fftw_config *t = (struct fftw_config *) table; - fftwf_destroy_plan(t->fft); - fftwf_destroy_plan(t->ifft); - fftwf_free(t->in); - fftwf_free(t->out); - speex_free(table); -} - - -void spx_fft(void *table, spx_word16_t *in, spx_word16_t *out) -{ - int i; - struct fftw_config *t = (struct fftw_config *) table; - const int N = t->N; - float *iptr = t->in; - float *optr = t->out; - const float m = 1.0 / N; - for(i=0;ifft); - - out[0] = optr[0]; - for(i=1;iN; - float *iptr = t->in; - float *optr = t->out; - - iptr[0] = in[0]; - iptr[1] = 0.0f; - for(i=1;iifft); - - for(i=0;iforward = kiss_fftr_alloc(size,0,NULL,NULL); - table->backward = kiss_fftr_alloc(size,1,NULL,NULL); - table->N = size; - return table; -} - -void spx_fft_destroy(void *table) -{ - struct kiss_config *t = (struct kiss_config *)table; - kiss_fftr_free(t->forward); - kiss_fftr_free(t->backward); - speex_free(table); -} - -#ifdef FIXED_POINT - -void spx_fft(void *table, spx_word16_t *in, spx_word16_t *out) -{ - int shift; - struct kiss_config *t = (struct kiss_config *)table; - shift = maximize_range(in, in, 32000, t->N); - kiss_fftr2(t->forward, in, out); - renorm_range(in, in, shift, t->N); - renorm_range(out, out, shift, t->N); -} - -#else - -void spx_fft(void *table, spx_word16_t *in, spx_word16_t *out) -{ - int i; - float scale; - struct kiss_config *t = (struct kiss_config *)table; - scale = 1./t->N; - kiss_fftr2(t->forward, in, out); - for (i=0;iN;i++) - out[i] *= scale; -} -#endif - -void spx_ifft(void *table, spx_word16_t *in, spx_word16_t *out) -{ - struct kiss_config *t = (struct kiss_config *)table; - kiss_fftri2(t->backward, in, out); -} - - -#else - -#error No other FFT implemented - -#endif - - -#ifdef FIXED_POINT -/*#include "smallft.h"*/ - - -void spx_fft_float(void *table, float *in, float *out) -{ - int i; -#ifdef USE_SMALLFT - int N = ((struct drft_lookup *)table)->n; -#elif defined(USE_KISS_FFT) - int N = ((struct kiss_config *)table)->N; -#else -#endif -#ifdef VAR_ARRAYS - spx_word16_t _in[N]; - spx_word16_t _out[N]; -#else - spx_word16_t _in[MAX_FFT_SIZE]; - spx_word16_t _out[MAX_FFT_SIZE]; -#endif - for (i=0;iN); - scale = 1./((struct kiss_config *)table)->N; - for (i=0;i<((struct kiss_config *)table)->N;i++) - out[i] = scale*in[i]; - spx_drft_forward(&t, out); - spx_drft_clear(&t); - } -#endif -} - -void spx_ifft_float(void *table, float *in, float *out) -{ - int i; -#ifdef USE_SMALLFT - int N = ((struct drft_lookup *)table)->n; -#elif defined(USE_KISS_FFT) - int N = ((struct kiss_config *)table)->N; -#else -#endif -#ifdef VAR_ARRAYS - spx_word16_t _in[N]; - spx_word16_t _out[N]; -#else - spx_word16_t _in[MAX_FFT_SIZE]; - spx_word16_t _out[MAX_FFT_SIZE]; -#endif - for (i=0;iN); - for (i=0;i<((struct kiss_config *)table)->N;i++) - out[i] = in[i]; - spx_drft_backward(&t, out); - spx_drft_clear(&t); - } -#endif -} - -#else - -void spx_fft_float(void *table, float *in, float *out) -{ - spx_fft(table, in, out); -} -void spx_ifft_float(void *table, float *in, float *out) -{ - spx_ifft(table, in, out); -} - -#endif diff --git a/Engine/lib/speex/libspeex/fftwrap.h b/Engine/lib/speex/libspeex/fftwrap.h deleted file mode 100644 index dfaf48944..000000000 --- a/Engine/lib/speex/libspeex/fftwrap.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (C) 2005 Jean-Marc Valin - File: fftwrap.h - - Wrapper for various FFTs - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifndef FFTWRAP_H -#define FFTWRAP_H - -#include "arch.h" - -/** Compute tables for an FFT */ -void *spx_fft_init(int size); - -/** Destroy tables for an FFT */ -void spx_fft_destroy(void *table); - -/** Forward (real to half-complex) transform */ -void spx_fft(void *table, spx_word16_t *in, spx_word16_t *out); - -/** Backward (half-complex to real) transform */ -void spx_ifft(void *table, spx_word16_t *in, spx_word16_t *out); - -/** Forward (real to half-complex) transform of float data */ -void spx_fft_float(void *table, float *in, float *out); - -/** Backward (half-complex to real) transform of float data */ -void spx_ifft_float(void *table, float *in, float *out); - -#endif diff --git a/Engine/lib/speex/libspeex/filters.c b/Engine/lib/speex/libspeex/filters.c deleted file mode 100644 index 5e1e45ee0..000000000 --- a/Engine/lib/speex/libspeex/filters.c +++ /dev/null @@ -1,836 +0,0 @@ -/* Copyright (C) 2002-2006 Jean-Marc Valin - File: filters.c - Various analysis/synthesis filters - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "filters.h" -#include "stack_alloc.h" -#include "arch.h" -#include "math_approx.h" -#include "ltp.h" -#include - -#ifdef _USE_SSE -#include "filters_sse.h" -#elif defined (ARM4_ASM) || defined(ARM5E_ASM) -#include "filters_arm4.h" -#elif defined (BFIN_ASM) -#include "filters_bfin.h" -#endif - - - -void bw_lpc(spx_word16_t gamma, const spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order) -{ - int i; - spx_word16_t tmp=gamma; - for (i=0;i=min_val && vec[i] <= max_val)) - { - if (vec[i] < min_val) - vec[i] = min_val; - else if (vec[i] > max_val) - vec[i] = max_val; - else /* Has to be NaN */ - vec[i] = 0; - } - } -} - -void highpass(const spx_word16_t *x, spx_word16_t *y, int len, int filtID, spx_mem_t *mem) -{ - int i; -#ifdef FIXED_POINT - const spx_word16_t Pcoef[5][3] = {{16384, -31313, 14991}, {16384, -31569, 15249}, {16384, -31677, 15328}, {16384, -32313, 15947}, {16384, -22446, 6537}}; - const spx_word16_t Zcoef[5][3] = {{15672, -31344, 15672}, {15802, -31601, 15802}, {15847, -31694, 15847}, {16162, -32322, 16162}, {14418, -28836, 14418}}; -#else - const spx_word16_t Pcoef[5][3] = {{1.00000f, -1.91120f, 0.91498f}, {1.00000f, -1.92683f, 0.93071f}, {1.00000f, -1.93338f, 0.93553f}, {1.00000f, -1.97226f, 0.97332f}, {1.00000f, -1.37000f, 0.39900f}}; - const spx_word16_t Zcoef[5][3] = {{0.95654f, -1.91309f, 0.95654f}, {0.96446f, -1.92879f, 0.96446f}, {0.96723f, -1.93445f, 0.96723f}, {0.98645f, -1.97277f, 0.98645f}, {0.88000f, -1.76000f, 0.88000f}}; -#endif - const spx_word16_t *den, *num; - if (filtID>4) - filtID=4; - - den = Pcoef[filtID]; num = Zcoef[filtID]; - /*return;*/ - for (i=0;i SHL32(EXTEND32(SIG_SCALING), 8)) - { - spx_word16_t scale_1; - scale = PSHR32(scale, SIG_SHIFT); - scale_1 = EXTRACT16(PDIV32_16(SHL32(EXTEND32(SIG_SCALING),7),scale)); - for (i=0;i SHR32(EXTEND32(SIG_SCALING), 2)) { - spx_word16_t scale_1; - scale = PSHR32(scale, SIG_SHIFT-5); - scale_1 = DIV32_16(SHL32(EXTEND32(SIG_SCALING),3),scale); - for (i=0;i max_val) - max_val = tmp; - } - - sig_shift=0; - while (max_val>16383) - { - sig_shift++; - max_val >>= 1; - } - - for (i=0;i max_val) - max_val = tmp; - } - if (max_val>16383) - { - spx_word32_t sum=0; - for (i=0;i= max_val) - max_val = tmp; - } - - sig_shift=0; - while (max_val>max_scale) - { - sig_shift++; - max_val >>= 1; - } - - for (i=0;i>1; - for (i=0;i>1; - N2 = N>>1; - ALLOC(xx1, M2+N2, spx_word16_t); - ALLOC(xx2, M2+N2, spx_word16_t); - - for (i = 0; i < N2; i++) - xx1[i] = x1[N2-1-i]; - for (i = 0; i < M2; i++) - xx1[N2+i] = mem1[2*i+1]; - for (i = 0; i < N2; i++) - xx2[i] = x2[N2-1-i]; - for (i = 0; i < M2; i++) - xx2[N2+i] = mem2[2*i+1]; - - for (i = 0; i < N2; i += 2) { - spx_sig_t y0, y1, y2, y3; - spx_word16_t x10, x20; - - y0 = y1 = y2 = y3 = 0; - x10 = xx1[N2-2-i]; - x20 = xx2[N2-2-i]; - - for (j = 0; j < M2; j += 2) { - spx_word16_t x11, x21; - spx_word16_t a0, a1; - - a0 = a[2*j]; - a1 = a[2*j+1]; - x11 = xx1[N2-1+j-i]; - x21 = xx2[N2-1+j-i]; - -#ifdef FIXED_POINT - /* We multiply twice by the same coef to avoid overflows */ - y0 = MAC16_16(MAC16_16(y0, a0, x11), NEG16(a0), x21); - y1 = MAC16_16(MAC16_16(y1, a1, x11), a1, x21); - y2 = MAC16_16(MAC16_16(y2, a0, x10), NEG16(a0), x20); - y3 = MAC16_16(MAC16_16(y3, a1, x10), a1, x20); -#else - y0 = ADD32(y0,MULT16_16(a0, x11-x21)); - y1 = ADD32(y1,MULT16_16(a1, x11+x21)); - y2 = ADD32(y2,MULT16_16(a0, x10-x20)); - y3 = ADD32(y3,MULT16_16(a1, x10+x20)); -#endif - a0 = a[2*j+2]; - a1 = a[2*j+3]; - x10 = xx1[N2+j-i]; - x20 = xx2[N2+j-i]; - -#ifdef FIXED_POINT - /* We multiply twice by the same coef to avoid overflows */ - y0 = MAC16_16(MAC16_16(y0, a0, x10), NEG16(a0), x20); - y1 = MAC16_16(MAC16_16(y1, a1, x10), a1, x20); - y2 = MAC16_16(MAC16_16(y2, a0, x11), NEG16(a0), x21); - y3 = MAC16_16(MAC16_16(y3, a1, x11), a1, x21); -#else - y0 = ADD32(y0,MULT16_16(a0, x10-x20)); - y1 = ADD32(y1,MULT16_16(a1, x10+x20)); - y2 = ADD32(y2,MULT16_16(a0, x11-x21)); - y3 = ADD32(y3,MULT16_16(a1, x11+x21)); -#endif - } -#ifdef FIXED_POINT - y[2*i] = EXTRACT16(SATURATE32(PSHR32(y0,15),32767)); - y[2*i+1] = EXTRACT16(SATURATE32(PSHR32(y1,15),32767)); - y[2*i+2] = EXTRACT16(SATURATE32(PSHR32(y2,15),32767)); - y[2*i+3] = EXTRACT16(SATURATE32(PSHR32(y3,15),32767)); -#else - /* Normalize up explicitly if we're in float */ - y[2*i] = 2.f*y0; - y[2*i+1] = 2.f*y1; - y[2*i+2] = 2.f*y2; - y[2*i+3] = 2.f*y3; -#endif - } - - for (i = 0; i < M2; i++) - mem1[2*i+1] = xx1[i]; - for (i = 0; i < M2; i++) - mem2[2*i+1] = xx2[i]; -} -#endif /* DISABLE_WIDEBAND */ - - -#ifndef DISABLE_DECODER - -#ifdef FIXED_POINT -#if 0 -const spx_word16_t shift_filt[3][7] = {{-33, 1043, -4551, 19959, 19959, -4551, 1043}, - {-98, 1133, -4425, 29179, 8895, -2328, 444}, - {444, -2328, 8895, 29179, -4425, 1133, -98}}; -#else -const spx_word16_t shift_filt[3][7] = {{-390, 1540, -4993, 20123, 20123, -4993, 1540}, - {-1064, 2817, -6694, 31589, 6837, -990, -209}, - {-209, -990, 6837, 31589, -6694, 2817, -1064}}; -#endif -#else -#if 0 -const float shift_filt[3][7] = {{-9.9369e-04, 3.1831e-02, -1.3889e-01, 6.0910e-01, 6.0910e-01, -1.3889e-01, 3.1831e-02}, - {-0.0029937, 0.0345613, -0.1350474, 0.8904793, 0.2714479, -0.0710304, 0.0135403}, - {0.0135403, -0.0710304, 0.2714479, 0.8904793, -0.1350474, 0.0345613, -0.0029937}}; -#else -const float shift_filt[3][7] = {{-0.011915f, 0.046995f, -0.152373f, 0.614108f, 0.614108f, -0.152373f, 0.046995f}, - {-0.0324855f, 0.0859768f, -0.2042986f, 0.9640297f, 0.2086420f, -0.0302054f, -0.0063646f}, - {-0.0063646f, -0.0302054f, 0.2086420f, 0.9640297f, -0.2042986f, 0.0859768f, -0.0324855f}}; -#endif -#endif - -static int interp_pitch( -spx_word16_t *exc, /*decoded excitation*/ -spx_word16_t *interp, /*decoded excitation*/ -int pitch, /*pitch period*/ -int len -) -{ - int i,j,k; - spx_word32_t corr[4][7]; - spx_word32_t maxcorr; - int maxi, maxj; - for (i=0;i<7;i++) - { - corr[0][i] = inner_prod(exc, exc-pitch-3+i, len); - } - for (i=0;i<3;i++) - { - for (j=0;j<7;j++) - { - int i1, i2; - spx_word32_t tmp=0; - i1 = 3-j; - if (i1<0) - i1 = 0; - i2 = 10-j; - if (i2>7) - i2 = 7; - for (k=i1;k maxcorr) - { - maxcorr = corr[i][j]; - maxi=i; - maxj=j; - } - } - } - for (i=0;i0) - { - for (k=0;k<7;k++) - { - tmp += MULT16_16(exc[i-(pitch-maxj+3)+k-3],shift_filt[maxi-1][k]); - } - } else { - tmp = SHL32(exc[i-(pitch-maxj+3)],15); - } - interp[i] = PSHR32(tmp,15); - } - return pitch-maxj+3; -} - -void multicomb( -spx_word16_t *exc, /*decoded excitation*/ -spx_word16_t *new_exc, /*enhanced excitation*/ -spx_coef_t *ak, /*LPC filter coefs*/ -int p, /*LPC order*/ -int nsf, /*sub-frame size*/ -int pitch, /*pitch period*/ -int max_pitch, -spx_word16_t comb_gain, /*gain of comb filter*/ -char *stack -) -{ - int i; - VARDECL(spx_word16_t *iexc); - spx_word16_t old_ener, new_ener; - int corr_pitch; - - spx_word16_t iexc0_mag, iexc1_mag, exc_mag; - spx_word32_t corr0, corr1; - spx_word16_t gain0, gain1; - spx_word16_t pgain1, pgain2; - spx_word16_t c1, c2; - spx_word16_t g1, g2; - spx_word16_t ngain; - spx_word16_t gg1, gg2; -#ifdef FIXED_POINT - int scaledown=0; -#endif -#if 0 /* Set to 1 to enable full pitch search */ - int nol_pitch[6]; - spx_word16_t nol_pitch_coef[6]; - spx_word16_t ol_pitch_coef; - open_loop_nbest_pitch(exc, 20, 120, nsf, - nol_pitch, nol_pitch_coef, 6, stack); - corr_pitch=nol_pitch[0]; - ol_pitch_coef = nol_pitch_coef[0]; - /*Try to remove pitch multiples*/ - for (i=1;i<6;i++) - { -#ifdef FIXED_POINT - if ((nol_pitch_coef[i]>MULT16_16_Q15(nol_pitch_coef[0],19661)) && -#else - if ((nol_pitch_coef[i]>.6*nol_pitch_coef[0]) && -#endif - (ABS(2*nol_pitch[i]-corr_pitch)<=2 || ABS(3*nol_pitch[i]-corr_pitch)<=3 || - ABS(4*nol_pitch[i]-corr_pitch)<=4 || ABS(5*nol_pitch[i]-corr_pitch)<=5)) - { - corr_pitch = nol_pitch[i]; - } - } -#else - corr_pitch = pitch; -#endif - - ALLOC(iexc, 2*nsf, spx_word16_t); - - interp_pitch(exc, iexc, corr_pitch, 80); - if (corr_pitch>max_pitch) - interp_pitch(exc, iexc+nsf, 2*corr_pitch, 80); - else - interp_pitch(exc, iexc+nsf, -corr_pitch, 80); - -#ifdef FIXED_POINT - for (i=0;i16383) - { - scaledown = 1; - break; - } - } - if (scaledown) - { - for (i=0;i MULT16_16(iexc0_mag,exc_mag)) - pgain1 = QCONST16(1., 14); - else - pgain1 = PDIV32_16(SHL32(PDIV32(corr0, exc_mag),14),iexc0_mag); - if (corr1 > MULT16_16(iexc1_mag,exc_mag)) - pgain2 = QCONST16(1., 14); - else - pgain2 = PDIV32_16(SHL32(PDIV32(corr1, exc_mag),14),iexc1_mag); - gg1 = PDIV32_16(SHL32(EXTEND32(exc_mag),8), iexc0_mag); - gg2 = PDIV32_16(SHL32(EXTEND32(exc_mag),8), iexc1_mag); - if (comb_gain>0) - { -#ifdef FIXED_POINT - c1 = (MULT16_16_Q15(QCONST16(.4,15),comb_gain)+QCONST16(.07,15)); - c2 = QCONST16(.5,15)+MULT16_16_Q14(QCONST16(1.72,14),(c1-QCONST16(.07,15))); -#else - c1 = .4*comb_gain+.07; - c2 = .5+1.72*(c1-.07); -#endif - } else - { - c1=c2=0; - } -#ifdef FIXED_POINT - g1 = 32767 - MULT16_16_Q13(MULT16_16_Q15(c2, pgain1),pgain1); - g2 = 32767 - MULT16_16_Q13(MULT16_16_Q15(c2, pgain2),pgain2); -#else - g1 = 1-c2*pgain1*pgain1; - g2 = 1-c2*pgain2*pgain2; -#endif - if (g1max_pitch) - { - gain0 = MULT16_16_Q15(QCONST16(.7,15),MULT16_16_Q14(g1,gg1)); - gain1 = MULT16_16_Q15(QCONST16(.3,15),MULT16_16_Q14(g2,gg2)); - } else { - gain0 = MULT16_16_Q15(QCONST16(.6,15),MULT16_16_Q14(g1,gg1)); - gain1 = MULT16_16_Q15(QCONST16(.6,15),MULT16_16_Q14(g2,gg2)); - } - for (i=0;i new_ener) - old_ener = new_ener; - ngain = PDIV32_16(SHL32(EXTEND32(old_ener),14),new_ener); - - for (i=0;imax_scale) - { - sig_shift++; - max_val >>= 1; - } - - __asm__ __volatile__ ( - ".normalize16loop%=: \n" - - "\tldr %4, [%0], #4 \n" - "\tldr %5, [%0], #4 \n" - "\tmov %4, %4, asr %3 \n" - "\tstrh %4, [%1], #2 \n" - "\tldr %4, [%0], #4 \n" - "\tmov %5, %5, asr %3 \n" - "\tstrh %5, [%1], #2 \n" - "\tldr %5, [%0], #4 \n" - "\tmov %4, %4, asr %3 \n" - "\tstrh %4, [%1], #2 \n" - "\tsubs %2, %2, #1 \n" - "\tmov %5, %5, asr %3 \n" - "\tstrh %5, [%1], #2 \n" - - "\tbgt .normalize16loop%=\n" - : "=r" (dead1), "=r" (dead2), "=r" (dead3), "=r" (dead4), - "=r" (dead5), "=r" (dead6) - : "0" (x), "1" (y), "2" (len>>2), "3" (sig_shift) - : "cc", "memory"); - return sig_shift; -} - diff --git a/Engine/lib/speex/libspeex/filters_bfin.h b/Engine/lib/speex/libspeex/filters_bfin.h deleted file mode 100644 index ccd57b9d1..000000000 --- a/Engine/lib/speex/libspeex/filters_bfin.h +++ /dev/null @@ -1,520 +0,0 @@ -/* Copyright (C) 2005 Analog Devices */ -/** - @file filters_bfin.h - @brief Various analysis/synthesis filters (Blackfin version) -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "bfin.h" - -#define OVERRIDE_NORMALIZE16 -int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int len) -{ - spx_sig_t max_val=1; - int sig_shift; - __asm__ - ( - "%0 = 0;\n\t" - "I0 = %1;\n\t" - "L0 = 0;\n\t" - "R1 = [I0++];\n\t" - "LOOP norm_max%= LC0 = %2;\n\t" - "LOOP_BEGIN norm_max%=;\n\t" - "R2 = ABS R1 || R1 = [I0++];\n\t" - "%0 = MAX(%0, R2);\n\t" - "LOOP_END norm_max%=;\n\t" - : "=&d" (max_val) - : "a" (x), "a" (len) - : "R1", "R2", "ASTAT" BFIN_HWLOOP0_REGS - ); - - sig_shift=0; - while (max_val>max_scale) - { - sig_shift++; - max_val >>= 1; - } - - __asm__ __volatile__ - ( - "I0 = %0;\n\t" - "L0 = 0;\n\t" - "P1 = %1;\n\t" - "R0 = [I0++];\n\t" - "LOOP norm_shift%= LC0 = %3;\n\t" - "LOOP_BEGIN norm_shift%=;\n\t" - "R1 = ASHIFT R0 by %2.L || R0 = [I0++];\n\t" - "W[P1++] = R1;\n\t" - "LOOP_END norm_shift%=;\n\t" - "R1 = ASHIFT R0 by %2.L;\n\t" - "W[P1++] = R1;\n\t" - : : "a" (x), "a" (y), "d" (-sig_shift), "a" (len-1) - : "I0", "L0", "P1", "R0", "R1", "memory", "ASTAT" BFIN_HWLOOP0_REGS - ); - return sig_shift; -} - - - -#define OVERRIDE_FILTER_MEM16 -void filter_mem16(const spx_word16_t *_x, const spx_coef_t *num, const spx_coef_t *den, spx_word16_t *_y, int N, int ord, spx_mem_t *mem, char *stack) -{ - VARDECL(spx_word32_t *xy2); - VARDECL(spx_word32_t *numden_a); - spx_word32_t *xy; - spx_word16_t *numden; - int i; - - ALLOC(xy2, (N+1), spx_word32_t); - ALLOC(numden_a, (2*ord+2), spx_word32_t); - xy = xy2+1; - numden = (spx_word16_t*) numden_a; - - for (i=0;i>> 13;\n\t" - "W[%0] = R3.L;\n\t" - "R0 <<= 1;\n\t" - "R1 = R1 + R0;\n\t" - "R1 >>>= 13;\n\t" - "W[%1] = R1.L;\n\t" - "LOOP_END samples%=;\n\t" - : "=a" (ytmp2), "=a" (y) - : "a" (awk2), "a" (ak), "d" (ord), "m" (N), "0" (ytmp2), "1" (y) - : "A0", "A1", "R0", "R1", "R2", "R3", "I0", "I1", "I2", "I3", "L0", "L1", "L2", "L3", - "ASTAT" BFIN_HWLOOP0_REGS BFIN_HWLOOP1_REGS - ); -} - - - -#if 0 /* Equivalent C function for filter_mem2 and compute_impulse_response */ -#define min(a,b) ((a)<(b) ? (a):(b)) - -void compute_impulse_response(const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_word16_t *y, int N, int ord, char *stack) -{ - int i,j; - VARDECL(spx_word16_t *ytmp); - ALLOC(ytmp, N, spx_word16_t); - - y[0] = LPC_SCALING; - for (i=0;i - -void filter_mem16_10(const float *x, const float *_num, const float *_den, float *y, int N, int ord, float *_mem) -{ - __m128 num[3], den[3], mem[3]; - - int i; - - /* Copy numerator, denominator and memory to aligned xmm */ - for (i=0;i<2;i++) - { - mem[i] = _mm_loadu_ps(_mem+4*i); - num[i] = _mm_loadu_ps(_num+4*i); - den[i] = _mm_loadu_ps(_den+4*i); - } - mem[2] = _mm_setr_ps(_mem[8], _mem[9], 0, 0); - num[2] = _mm_setr_ps(_num[8], _num[9], 0, 0); - den[2] = _mm_setr_ps(_den[8], _den[9], 0, 0); - - for (i=0;i>1; - __asm__ ( - "P0 = 15;\n\t" - "R0 = %1;\n\t" - "R1 = %2;\n\t" - //"R0 = R0 + R1;\n\t" - "R0 <<= 1;\n\t" - "DIVS (R0, R1);\n\t" - "LOOP divide%= LC0 = P0;\n\t" - "LOOP_BEGIN divide%=;\n\t" - "DIVQ (R0, R1);\n\t" - "LOOP_END divide%=;\n\t" - "R0 = R0.L;\n\t" - "%0 = R0;\n\t" - : "=m" (res) - : "m" (a), "m" (bb) - : "P0", "R0", "R1", "ASTAT" BFIN_HWLOOP0_REGS); - return res; -} - -#undef DIV32_16 -static inline spx_word16_t DIV32_16(spx_word32_t a, spx_word16_t b) -{ - spx_word32_t res, bb; - bb = b; - /* Make the roundinf consistent with the C version - (do we need to do that?)*/ - if (a<0) - a += (b-1); - __asm__ ( - "P0 = 15;\n\t" - "R0 = %1;\n\t" - "R1 = %2;\n\t" - "R0 <<= 1;\n\t" - "DIVS (R0, R1);\n\t" - "LOOP divide%= LC0 = P0;\n\t" - "LOOP_BEGIN divide%=;\n\t" - "DIVQ (R0, R1);\n\t" - "LOOP_END divide%=;\n\t" - "R0 = R0.L;\n\t" - "%0 = R0;\n\t" - : "=m" (res) - : "m" (a), "m" (bb) - : "P0", "R0", "R1", "ASTAT" BFIN_HWLOOP0_REGS); - return res; -} - -#undef MAX16 -static inline spx_word16_t MAX16(spx_word16_t a, spx_word16_t b) -{ - spx_word32_t res; - __asm__ ( - "%1 = %1.L (X);\n\t" - "%2 = %2.L (X);\n\t" - "%0 = MAX(%1,%2);" - : "=d" (res) - : "%d" (a), "d" (b) - : "ASTAT" - ); - return res; -} - -#undef MULT16_32_Q15 -static inline spx_word32_t MULT16_32_Q15(spx_word16_t a, spx_word32_t b) -{ - spx_word32_t res; - __asm__ - ( - "A1 = %2.L*%1.L (M);\n\t" - "A1 = A1 >>> 15;\n\t" - "%0 = (A1 += %2.L*%1.H) ;\n\t" - : "=&W" (res), "=&d" (b) - : "d" (a), "1" (b) - : "A1", "ASTAT" - ); - return res; -} - -#undef MAC16_32_Q15 -static inline spx_word32_t MAC16_32_Q15(spx_word32_t c, spx_word16_t a, spx_word32_t b) -{ - spx_word32_t res; - __asm__ - ( - "A1 = %2.L*%1.L (M);\n\t" - "A1 = A1 >>> 15;\n\t" - "%0 = (A1 += %2.L*%1.H);\n\t" - "%0 = %0 + %4;\n\t" - : "=&W" (res), "=&d" (b) - : "d" (a), "1" (b), "d" (c) - : "A1", "ASTAT" - ); - return res; -} - -#undef MULT16_32_Q14 -static inline spx_word32_t MULT16_32_Q14(spx_word16_t a, spx_word32_t b) -{ - spx_word32_t res; - __asm__ - ( - "%2 <<= 1;\n\t" - "A1 = %1.L*%2.L (M);\n\t" - "A1 = A1 >>> 15;\n\t" - "%0 = (A1 += %1.L*%2.H);\n\t" - : "=W" (res), "=d" (a), "=d" (b) - : "1" (a), "2" (b) - : "A1", "ASTAT" - ); - return res; -} - -#undef MAC16_32_Q14 -static inline spx_word32_t MAC16_32_Q14(spx_word32_t c, spx_word16_t a, spx_word32_t b) -{ - spx_word32_t res; - __asm__ - ( - "%1 <<= 1;\n\t" - "A1 = %2.L*%1.L (M);\n\t" - "A1 = A1 >>> 15;\n\t" - "%0 = (A1 += %2.L*%1.H);\n\t" - "%0 = %0 + %4;\n\t" - : "=&W" (res), "=&d" (b) - : "d" (a), "1" (b), "d" (c) - : "A1", "ASTAT" - ); - return res; -} - -#endif diff --git a/Engine/lib/speex/libspeex/fixed_debug.h b/Engine/lib/speex/libspeex/fixed_debug.h deleted file mode 100644 index 54f3866e8..000000000 --- a/Engine/lib/speex/libspeex/fixed_debug.h +++ /dev/null @@ -1,487 +0,0 @@ -/* Copyright (C) 2003 Jean-Marc Valin */ -/** - @file fixed_debug.h - @brief Fixed-point operations with debugging -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef FIXED_DEBUG_H -#define FIXED_DEBUG_H - -#include - -extern long long spx_mips; -#define MIPS_INC spx_mips++, - -#define QCONST16(x,bits) ((spx_word16_t)(.5+(x)*(((spx_word32_t)1)<<(bits)))) -#define QCONST32(x,bits) ((spx_word32_t)(.5+(x)*(((spx_word32_t)1)<<(bits)))) - - -#define VERIFY_SHORT(x) ((x)<=32767&&(x)>=-32768) -#define VERIFY_INT(x) ((x)<=2147483647LL&&(x)>=-2147483648LL) - -static inline short NEG16(int x) -{ - int res; - if (!VERIFY_SHORT(x)) - { - fprintf (stderr, "NEG16: input is not short: %d\n", (int)x); - } - res = -x; - if (!VERIFY_SHORT(res)) - fprintf (stderr, "NEG16: output is not short: %d\n", (int)res); - spx_mips++; - return res; -} -static inline int NEG32(long long x) -{ - long long res; - if (!VERIFY_INT(x)) - { - fprintf (stderr, "NEG16: input is not int: %d\n", (int)x); - } - res = -x; - if (!VERIFY_INT(res)) - fprintf (stderr, "NEG16: output is not int: %d\n", (int)res); - spx_mips++; - return res; -} - -#define EXTRACT16(x) _EXTRACT16(x, __FILE__, __LINE__) -static inline short _EXTRACT16(int x, char *file, int line) -{ - int res; - if (!VERIFY_SHORT(x)) - { - fprintf (stderr, "EXTRACT16: input is not short: %d in %s: line %d\n", x, file, line); - } - res = x; - spx_mips++; - return res; -} - -#define EXTEND32(x) _EXTEND32(x, __FILE__, __LINE__) -static inline int _EXTEND32(int x, char *file, int line) -{ - int res; - if (!VERIFY_SHORT(x)) - { - fprintf (stderr, "EXTEND32: input is not short: %d in %s: line %d\n", x, file, line); - } - res = x; - spx_mips++; - return res; -} - -#define SHR16(a, shift) _SHR16(a, shift, __FILE__, __LINE__) -static inline short _SHR16(int a, int shift, char *file, int line) -{ - int res; - if (!VERIFY_SHORT(a) || !VERIFY_SHORT(shift)) - { - fprintf (stderr, "SHR16: inputs are not short: %d >> %d in %s: line %d\n", a, shift, file, line); - } - res = a>>shift; - if (!VERIFY_SHORT(res)) - fprintf (stderr, "SHR16: output is not short: %d in %s: line %d\n", res, file, line); - spx_mips++; - return res; -} -#define SHL16(a, shift) _SHL16(a, shift, __FILE__, __LINE__) -static inline short _SHL16(int a, int shift, char *file, int line) -{ - int res; - if (!VERIFY_SHORT(a) || !VERIFY_SHORT(shift)) - { - fprintf (stderr, "SHL16: inputs are not short: %d %d in %s: line %d\n", a, shift, file, line); - } - res = a<>shift; - if (!VERIFY_INT(res)) - { - fprintf (stderr, "SHR32: output is not int: %d\n", (int)res); - } - spx_mips++; - return res; -} -static inline int SHL32(long long a, int shift) -{ - long long res; - if (!VERIFY_INT(a) || !VERIFY_SHORT(shift)) - { - fprintf (stderr, "SHL32: inputs are not int: %d %d\n", (int)a, shift); - } - res = a<>1))),shift)) -#define PSHR32(a,shift) (SHR32(ADD32((a),((EXTEND32(1)<<((shift))>>1))),shift)) -#define VSHR32(a, shift) (((shift)>0) ? SHR32(a, shift) : SHL32(a, -(shift))) - -#define SATURATE16(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) -#define SATURATE32(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) - -//#define SHR(a,shift) ((a) >> (shift)) -//#define SHL(a,shift) ((a) << (shift)) - -#define ADD16(a, b) _ADD16(a, b, __FILE__, __LINE__) -static inline short _ADD16(int a, int b, char *file, int line) -{ - int res; - if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) - { - fprintf (stderr, "ADD16: inputs are not short: %d %d in %s: line %d\n", a, b, file, line); - } - res = a+b; - if (!VERIFY_SHORT(res)) - { - fprintf (stderr, "ADD16: output is not short: %d+%d=%d in %s: line %d\n", a,b,res, file, line); - } - spx_mips++; - return res; -} - -#define SUB16(a, b) _SUB16(a, b, __FILE__, __LINE__) -static inline short _SUB16(int a, int b, char *file, int line) -{ - int res; - if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) - { - fprintf (stderr, "SUB16: inputs are not short: %d %d in %s: line %d\n", a, b, file, line); - } - res = a-b; - if (!VERIFY_SHORT(res)) - fprintf (stderr, "SUB16: output is not short: %d in %s: line %d\n", res, file, line); - spx_mips++; - return res; -} - -#define ADD32(a, b) _ADD32(a, b, __FILE__, __LINE__) -static inline int _ADD32(long long a, long long b, char *file, int line) -{ - long long res; - if (!VERIFY_INT(a) || !VERIFY_INT(b)) - { - fprintf (stderr, "ADD32: inputs are not int: %d %d in %s: line %d\n", (int)a, (int)b, file, line); - } - res = a+b; - if (!VERIFY_INT(res)) - { - fprintf (stderr, "ADD32: output is not int: %d in %s: line %d\n", (int)res, file, line); - } - spx_mips++; - return res; -} - -static inline int SUB32(long long a, long long b) -{ - long long res; - if (!VERIFY_INT(a) || !VERIFY_INT(b)) - { - fprintf (stderr, "SUB32: inputs are not int: %d %d\n", (int)a, (int)b); - } - res = a-b; - if (!VERIFY_INT(res)) - fprintf (stderr, "SUB32: output is not int: %d\n", (int)res); - spx_mips++; - return res; -} - -#define ADD64(a,b) (MIPS_INC(a)+(b)) - -/* result fits in 16 bits */ -static inline short MULT16_16_16(int a, int b) -{ - int res; - if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) - { - fprintf (stderr, "MULT16_16_16: inputs are not short: %d %d\n", a, b); - } - res = a*b; - if (!VERIFY_SHORT(res)) - fprintf (stderr, "MULT16_16_16: output is not short: %d\n", res); - spx_mips++; - return res; -} - -#define MULT16_16(a, b) _MULT16_16(a, b, __FILE__, __LINE__) -static inline int _MULT16_16(int a, int b, char *file, int line) -{ - long long res; - if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) - { - fprintf (stderr, "MULT16_16: inputs are not short: %d %d in %s: line %d\n", a, b, file, line); - } - res = ((long long)a)*b; - if (!VERIFY_INT(res)) - fprintf (stderr, "MULT16_16: output is not int: %d in %s: line %d\n", (int)res, file, line); - spx_mips++; - return res; -} - -#define MAC16_16(c,a,b) (spx_mips--,ADD32((c),MULT16_16((a),(b)))) -#define MAC16_16_Q11(c,a,b) (EXTRACT16(ADD16((c),EXTRACT16(SHR32(MULT16_16((a),(b)),11))))) -#define MAC16_16_Q13(c,a,b) (EXTRACT16(ADD16((c),EXTRACT16(SHR32(MULT16_16((a),(b)),13))))) -#define MAC16_16_P13(c,a,b) (EXTRACT16(ADD32((c),SHR32(ADD32(4096,MULT16_16((a),(b))),13)))) - - -#define MULT16_32_QX(a, b, Q) _MULT16_32_QX(a, b, Q, __FILE__, __LINE__) -static inline int _MULT16_32_QX(int a, long long b, int Q, char *file, int line) -{ - long long res; - if (!VERIFY_SHORT(a) || !VERIFY_INT(b)) - { - fprintf (stderr, "MULT16_32_Q%d: inputs are not short+int: %d %d in %s: line %d\n", Q, (int)a, (int)b, file, line); - } - if (ABS32(b)>=(EXTEND32(1)<<(15+Q))) - fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d in %s: line %d\n", Q, (int)a, (int)b, file, line); - res = (((long long)a)*(long long)b) >> Q; - if (!VERIFY_INT(res)) - fprintf (stderr, "MULT16_32_Q%d: output is not int: %d*%d=%d in %s: line %d\n", Q, (int)a, (int)b,(int)res, file, line); - spx_mips+=5; - return res; -} - -static inline int MULT16_32_PX(int a, long long b, int Q) -{ - long long res; - if (!VERIFY_SHORT(a) || !VERIFY_INT(b)) - { - fprintf (stderr, "MULT16_32_P%d: inputs are not short+int: %d %d\n", Q, (int)a, (int)b); - } - if (ABS32(b)>=(EXTEND32(1)<<(15+Q))) - fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d\n", Q, (int)a, (int)b); - res = ((((long long)a)*(long long)b) + ((EXTEND32(1)<>1))>> Q; - if (!VERIFY_INT(res)) - fprintf (stderr, "MULT16_32_P%d: output is not int: %d*%d=%d\n", Q, (int)a, (int)b,(int)res); - spx_mips+=5; - return res; -} - - -#define MULT16_32_Q11(a,b) MULT16_32_QX(a,b,11) -#define MAC16_32_Q11(c,a,b) ADD32((c),MULT16_32_Q11((a),(b))) -#define MULT16_32_Q12(a,b) MULT16_32_QX(a,b,12) -#define MULT16_32_Q13(a,b) MULT16_32_QX(a,b,13) -#define MULT16_32_Q14(a,b) MULT16_32_QX(a,b,14) -#define MULT16_32_Q15(a,b) MULT16_32_QX(a,b,15) -#define MULT16_32_P15(a,b) MULT16_32_PX(a,b,15) -#define MAC16_32_Q15(c,a,b) ADD32((c),MULT16_32_Q15((a),(b))) - -static inline int SATURATE(int a, int b) -{ - if (a>b) - a=b; - if (a<-b) - a = -b; - return a; -} - -static inline int MULT16_16_Q11_32(int a, int b) -{ - long long res; - if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) - { - fprintf (stderr, "MULT16_16_Q11: inputs are not short: %d %d\n", a, b); - } - res = ((long long)a)*b; - res >>= 11; - if (!VERIFY_INT(res)) - fprintf (stderr, "MULT16_16_Q11: output is not short: %d*%d=%d\n", (int)a, (int)b, (int)res); - spx_mips+=3; - return res; -} -static inline short MULT16_16_Q13(int a, int b) -{ - long long res; - if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) - { - fprintf (stderr, "MULT16_16_Q13: inputs are not short: %d %d\n", a, b); - } - res = ((long long)a)*b; - res >>= 13; - if (!VERIFY_SHORT(res)) - fprintf (stderr, "MULT16_16_Q13: output is not short: %d*%d=%d\n", a, b, (int)res); - spx_mips+=3; - return res; -} -static inline short MULT16_16_Q14(int a, int b) -{ - long long res; - if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) - { - fprintf (stderr, "MULT16_16_Q14: inputs are not short: %d %d\n", a, b); - } - res = ((long long)a)*b; - res >>= 14; - if (!VERIFY_SHORT(res)) - fprintf (stderr, "MULT16_16_Q14: output is not short: %d\n", (int)res); - spx_mips+=3; - return res; -} -static inline short MULT16_16_Q15(int a, int b) -{ - long long res; - if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) - { - fprintf (stderr, "MULT16_16_Q15: inputs are not short: %d %d\n", a, b); - } - res = ((long long)a)*b; - res >>= 15; - if (!VERIFY_SHORT(res)) - { - fprintf (stderr, "MULT16_16_Q15: output is not short: %d\n", (int)res); - } - spx_mips+=3; - return res; -} - -static inline short MULT16_16_P13(int a, int b) -{ - long long res; - if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) - { - fprintf (stderr, "MULT16_16_P13: inputs are not short: %d %d\n", a, b); - } - res = ((long long)a)*b; - res += 4096; - if (!VERIFY_INT(res)) - fprintf (stderr, "MULT16_16_P13: overflow: %d*%d=%d\n", a, b, (int)res); - res >>= 13; - if (!VERIFY_SHORT(res)) - fprintf (stderr, "MULT16_16_P13: output is not short: %d*%d=%d\n", a, b, (int)res); - spx_mips+=4; - return res; -} -static inline short MULT16_16_P14(int a, int b) -{ - long long res; - if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) - { - fprintf (stderr, "MULT16_16_P14: inputs are not short: %d %d\n", a, b); - } - res = ((long long)a)*b; - res += 8192; - if (!VERIFY_INT(res)) - fprintf (stderr, "MULT16_16_P14: overflow: %d*%d=%d\n", a, b, (int)res); - res >>= 14; - if (!VERIFY_SHORT(res)) - fprintf (stderr, "MULT16_16_P14: output is not short: %d*%d=%d\n", a, b, (int)res); - spx_mips+=4; - return res; -} -static inline short MULT16_16_P15(int a, int b) -{ - long long res; - if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) - { - fprintf (stderr, "MULT16_16_P15: inputs are not short: %d %d\n", a, b); - } - res = ((long long)a)*b; - res += 16384; - if (!VERIFY_INT(res)) - fprintf (stderr, "MULT16_16_P15: overflow: %d*%d=%d\n", a, b, (int)res); - res >>= 15; - if (!VERIFY_SHORT(res)) - fprintf (stderr, "MULT16_16_P15: output is not short: %d*%d=%d\n", a, b, (int)res); - spx_mips+=4; - return res; -} - -#define DIV32_16(a, b) _DIV32_16(a, b, __FILE__, __LINE__) - -static inline int _DIV32_16(long long a, long long b, char *file, int line) -{ - long long res; - if (b==0) - { - fprintf(stderr, "DIV32_16: divide by zero: %d/%d in %s: line %d\n", (int)a, (int)b, file, line); - return 0; - } - if (!VERIFY_INT(a) || !VERIFY_SHORT(b)) - { - fprintf (stderr, "DIV32_16: inputs are not int/short: %d %d in %s: line %d\n", (int)a, (int)b, file, line); - } - res = a/b; - if (!VERIFY_SHORT(res)) - { - fprintf (stderr, "DIV32_16: output is not short: %d / %d = %d in %s: line %d\n", (int)a,(int)b,(int)res, file, line); - if (res>32767) - res = 32767; - if (res<-32768) - res = -32768; - } - spx_mips+=20; - return res; -} - -#define DIV32(a, b) _DIV32(a, b, __FILE__, __LINE__) -static inline int _DIV32(long long a, long long b, char *file, int line) -{ - long long res; - if (b==0) - { - fprintf(stderr, "DIV32: divide by zero: %d/%d in %s: line %d\n", (int)a, (int)b, file, line); - return 0; - } - - if (!VERIFY_INT(a) || !VERIFY_INT(b)) - { - fprintf (stderr, "DIV32: inputs are not int/short: %d %d in %s: line %d\n", (int)a, (int)b, file, line); - } - res = a/b; - if (!VERIFY_INT(res)) - fprintf (stderr, "DIV32: output is not int: %d in %s: line %d\n", (int)res, file, line); - spx_mips+=36; - return res; -} -#define PDIV32(a,b) DIV32(ADD32((a),(b)>>1),b) -#define PDIV32_16(a,b) DIV32_16(ADD32((a),(b)>>1),b) - -#endif diff --git a/Engine/lib/speex/libspeex/fixed_generic.h b/Engine/lib/speex/libspeex/fixed_generic.h deleted file mode 100644 index 3fb096ed9..000000000 --- a/Engine/lib/speex/libspeex/fixed_generic.h +++ /dev/null @@ -1,106 +0,0 @@ -/* Copyright (C) 2003 Jean-Marc Valin */ -/** - @file fixed_generic.h - @brief Generic fixed-point operations -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef FIXED_GENERIC_H -#define FIXED_GENERIC_H - -#define QCONST16(x,bits) ((spx_word16_t)(.5+(x)*(((spx_word32_t)1)<<(bits)))) -#define QCONST32(x,bits) ((spx_word32_t)(.5+(x)*(((spx_word32_t)1)<<(bits)))) - -#define NEG16(x) (-(x)) -#define NEG32(x) (-(x)) -#define EXTRACT16(x) ((spx_word16_t)(x)) -#define EXTEND32(x) ((spx_word32_t)(x)) -#define SHR16(a,shift) ((a) >> (shift)) -#define SHL16(a,shift) ((a) << (shift)) -#define SHR32(a,shift) ((a) >> (shift)) -#define SHL32(a,shift) ((a) << (shift)) -#define PSHR16(a,shift) (SHR16((a)+((1<<((shift))>>1)),shift)) -#define PSHR32(a,shift) (SHR32((a)+((EXTEND32(1)<<((shift))>>1)),shift)) -#define VSHR32(a, shift) (((shift)>0) ? SHR32(a, shift) : SHL32(a, -(shift))) -#define SATURATE16(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) -#define SATURATE32(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) - -#define SHR(a,shift) ((a) >> (shift)) -#define SHL(a,shift) ((spx_word32_t)(a) << (shift)) -#define PSHR(a,shift) (SHR((a)+((EXTEND32(1)<<((shift))>>1)),shift)) -#define SATURATE(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) - - -#define ADD16(a,b) ((spx_word16_t)((spx_word16_t)(a)+(spx_word16_t)(b))) -#define SUB16(a,b) ((spx_word16_t)(a)-(spx_word16_t)(b)) -#define ADD32(a,b) ((spx_word32_t)(a)+(spx_word32_t)(b)) -#define SUB32(a,b) ((spx_word32_t)(a)-(spx_word32_t)(b)) - - -/* result fits in 16 bits */ -#define MULT16_16_16(a,b) ((((spx_word16_t)(a))*((spx_word16_t)(b)))) - -/* (spx_word32_t)(spx_word16_t) gives TI compiler a hint that it's 16x16->32 multiply */ -#define MULT16_16(a,b) (((spx_word32_t)(spx_word16_t)(a))*((spx_word32_t)(spx_word16_t)(b))) - -#define MAC16_16(c,a,b) (ADD32((c),MULT16_16((a),(b)))) -#define MULT16_32_Q12(a,b) ADD32(MULT16_16((a),SHR((b),12)), SHR(MULT16_16((a),((b)&0x00000fff)),12)) -#define MULT16_32_Q13(a,b) ADD32(MULT16_16((a),SHR((b),13)), SHR(MULT16_16((a),((b)&0x00001fff)),13)) -#define MULT16_32_Q14(a,b) ADD32(MULT16_16((a),SHR((b),14)), SHR(MULT16_16((a),((b)&0x00003fff)),14)) - -#define MULT16_32_Q11(a,b) ADD32(MULT16_16((a),SHR((b),11)), SHR(MULT16_16((a),((b)&0x000007ff)),11)) -#define MAC16_32_Q11(c,a,b) ADD32(c,ADD32(MULT16_16((a),SHR((b),11)), SHR(MULT16_16((a),((b)&0x000007ff)),11))) - -#define MULT16_32_P15(a,b) ADD32(MULT16_16((a),SHR((b),15)), PSHR(MULT16_16((a),((b)&0x00007fff)),15)) -#define MULT16_32_Q15(a,b) ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15)) -#define MAC16_32_Q15(c,a,b) ADD32(c,ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15))) - - -#define MAC16_16_Q11(c,a,b) (ADD32((c),SHR(MULT16_16((a),(b)),11))) -#define MAC16_16_Q13(c,a,b) (ADD32((c),SHR(MULT16_16((a),(b)),13))) -#define MAC16_16_P13(c,a,b) (ADD32((c),SHR(ADD32(4096,MULT16_16((a),(b))),13))) - -#define MULT16_16_Q11_32(a,b) (SHR(MULT16_16((a),(b)),11)) -#define MULT16_16_Q13(a,b) (SHR(MULT16_16((a),(b)),13)) -#define MULT16_16_Q14(a,b) (SHR(MULT16_16((a),(b)),14)) -#define MULT16_16_Q15(a,b) (SHR(MULT16_16((a),(b)),15)) - -#define MULT16_16_P13(a,b) (SHR(ADD32(4096,MULT16_16((a),(b))),13)) -#define MULT16_16_P14(a,b) (SHR(ADD32(8192,MULT16_16((a),(b))),14)) -#define MULT16_16_P15(a,b) (SHR(ADD32(16384,MULT16_16((a),(b))),15)) - -#define MUL_16_32_R15(a,bh,bl) ADD32(MULT16_16((a),(bh)), SHR(MULT16_16((a),(bl)),15)) - -#define DIV32_16(a,b) ((spx_word16_t)(((spx_word32_t)(a))/((spx_word16_t)(b)))) -#define PDIV32_16(a,b) ((spx_word16_t)(((spx_word32_t)(a)+((spx_word16_t)(b)>>1))/((spx_word16_t)(b)))) -#define DIV32(a,b) (((spx_word32_t)(a))/((spx_word32_t)(b))) -#define PDIV32(a,b) (((spx_word32_t)(a)+((spx_word16_t)(b)>>1))/((spx_word32_t)(b))) - -#endif diff --git a/Engine/lib/speex/libspeex/gain_table.c b/Engine/lib/speex/libspeex/gain_table.c deleted file mode 100644 index 63dc6e7e3..000000000 --- a/Engine/lib/speex/libspeex/gain_table.c +++ /dev/null @@ -1,160 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: gain_table.c - Codebook for 3-tap pitch prediction gain (128 entries) - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -const signed char gain_cdbk_nb[512] = { --32, -32, -32, 0, --28, -67, -5, 33, --42, -6, -32, 18, --57, -10, -54, 35, --16, 27, -41, 42, -19, -19, -40, 36, --45, 24, -21, 40, --8, -14, -18, 28, -1, 14, -58, 53, --18, -88, -39, 39, --38, 21, -18, 37, --19, 20, -43, 38, -10, 17, -48, 54, --52, -58, -13, 33, --44, -1, -11, 32, --12, -11, -34, 22, -14, 0, -46, 46, --37, -35, -34, 5, --25, 44, -30, 43, -6, -4, -63, 49, --31, 43, -41, 43, --23, 30, -43, 41, --43, 26, -14, 44, --33, 1, -13, 27, --13, 18, -37, 37, --46, -73, -45, 34, --36, 24, -25, 34, --36, -11, -20, 19, --25, 12, -18, 33, --36, -69, -59, 34, --45, 6, 8, 46, --22, -14, -24, 18, --1, 13, -44, 44, --39, -48, -26, 15, --32, 31, -37, 34, --33, 15, -46, 31, --24, 30, -36, 37, --41, 31, -23, 41, --50, 22, -4, 50, --22, 2, -21, 28, --17, 30, -34, 40, --7, -60, -28, 29, --38, 42, -28, 42, --44, -11, 21, 43, --16, 8, -44, 34, --39, -55, -43, 21, --11, -35, 26, 41, --9, 0, -34, 29, --8, 121, -81, 113, -7, -16, -22, 33, --37, 33, -31, 36, --27, -7, -36, 17, --34, 70, -57, 65, --37, -11, -48, 21, --40, 17, -1, 44, --33, 6, -6, 33, --9, 0, -20, 34, --21, 69, -33, 57, --29, 33, -31, 35, --55, 12, -1, 49, --33, 27, -22, 35, --50, -33, -47, 17, --50, 54, 51, 94, --1, -5, -44, 35, --4, 22, -40, 45, --39, -66, -25, 24, --33, 1, -26, 20, --24, -23, -25, 12, --11, 21, -45, 44, --25, -45, -19, 17, --43, 105, -16, 82, -5, -21, 1, 41, --16, 11, -33, 30, --13, -99, -4, 57, --37, 33, -15, 44, --25, 37, -63, 54, --36, 24, -31, 31, --53, -56, -38, 26, --41, -4, 4, 37, --33, 13, -30, 24, -49, 52, -94, 114, --5, -30, -15, 23, -1, 38, -40, 56, --23, 12, -36, 29, --17, 40, -47, 51, --37, -41, -39, 11, --49, 34, 0, 58, --18, -7, -4, 34, --16, 17, -27, 35, -30, 5, -62, 65, -4, 48, -68, 76, --43, 11, -11, 38, --18, 19, -15, 41, --23, -62, -39, 23, --42, 10, -2, 41, --21, -13, -13, 25, --9, 13, -47, 42, --23, -62, -24, 24, --44, 60, -21, 58, --18, -3, -52, 32, --22, 22, -36, 34, --75, 57, 16, 90, --19, 3, 10, 45, --29, 23, -38, 32, --5, -62, -51, 38, --51, 40, -18, 53, --42, 13, -24, 32, --34, 14, -20, 30, --56, -75, -26, 37, --26, 32, 15, 59, --26, 17, -29, 29, --7, 28, -52, 53, --12, -30, 5, 30, --5, -48, -5, 35, -2, 2, -43, 40, -21, 16, 16, 75, --25, -45, -32, 10, --43, 18, -10, 42, -9, 0, -1, 52, --1, 7, -30, 36, -19, -48, -4, 48, --28, 25, -29, 32, --22, 0, -31, 22, --32, 17, -10, 36, --64, -41, -62, 36, --52, 15, 16, 58, --30, -22, -32, 6, --7, 9, -38, 36}; diff --git a/Engine/lib/speex/libspeex/gain_table_lbr.c b/Engine/lib/speex/libspeex/gain_table_lbr.c deleted file mode 100644 index be464f374..000000000 --- a/Engine/lib/speex/libspeex/gain_table_lbr.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: gain_table_lbr.c - Codebook for 3-tap pitch prediction gain (32 entries) - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -const signed char gain_cdbk_lbr[128] = { --32, -32, -32, 0, --31, -58, -16, 22, --41, -24, -43, 14, --56, -22, -55, 29, --13, 33, -41, 47, --4, -39, -9, 29, --41, 15, -12, 38, --8, -15, -12, 31, -1, 2, -44, 40, --22, -66, -42, 27, --38, 28, -23, 38, --21, 14, -37, 31, -0, 21, -50, 52, --53, -71, -27, 33, --37, -1, -19, 25, --19, -5, -28, 22, -6, 65, -44, 74, --33, -48, -33, 9, --40, 57, -14, 58, --17, 4, -45, 32, --31, 38, -33, 36, --23, 28, -40, 39, --43, 29, -12, 46, --34, 13, -23, 28, --16, 15, -27, 34, --14, -82, -15, 43, --31, 25, -32, 29, --21, 5, -5, 38, --47, -63, -51, 33, --46, 12, 3, 47, --28, -17, -29, 11, --10, 14, -40, 38}; diff --git a/Engine/lib/speex/libspeex/hexc_10_32_table.c b/Engine/lib/speex/libspeex/hexc_10_32_table.c deleted file mode 100644 index 1c7f285ac..000000000 --- a/Engine/lib/speex/libspeex/hexc_10_32_table.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: hexc_10_32_table.c - Codebook for high-band excitation in SB-CELP mode (4000 bps) - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -const signed char hexc_10_32_table[320] = { --3, -2, -1, 0, -4, 5, 35, -40, -9, 13, --44, 5, -27, -1, -7, 6, -11, 7, -8, 7, -19, -14, 15, -4, 9, -10, 10, -8, 10, -9, --1, 1, 0, 0, 2, 5, -18, 22, -53, 50, -1, -23, 50, -36, 15, 3, -13, 14, -10, 6, -1, 5, -3, 4, -2, 5, -32, 25, 5, -2, --1, -4, 1, 11, -29, 26, -6, -15, 30, -18, -0, 15, -17, 40, -41, 3, 9, -2, -2, 3, --3, -1, -5, 2, 21, -6, -16, -21, 23, 2, -60, 15, 16, -16, -9, 14, 9, -1, 7, -9, -0, 1, 1, 0, -1, -6, 17, -28, 54, -45, --1, 1, -1, -6, -6, 2, 11, 26, -29, -2, -46, -21, 34, 12, -23, 32, -23, 16, -10, 3, -66, 19, -20, 24, 7, 11, -3, 0, -3, -1, --50, -46, 2, -18, -3, 4, -1, -2, 3, -3, --19, 41, -36, 9, 11, -24, 21, -16, 9, -3, --25, -3, 10, 18, -9, -2, -5, -1, -5, 6, --4, -3, 2, -26, 21, -19, 35, -15, 7, -13, -17, -19, 39, -43, 48, -31, 16, -9, 7, -2, --5, 3, -4, 9, -19, 27, -55, 63, -35, 10, -26, -44, -2, 9, 4, 1, -6, 8, -9, 5, --8, -1, -3, -16, 45, -42, 5, 15, -16, 10, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, --16, 24, -55, 47, -38, 27, -19, 7, -3, 1, -16, 27, 20, -19, 18, 5, -7, 1, -5, 2, --6, 8, -22, 0, -3, -3, 8, -1, 7, -8, -1, -3, 5, 0, 17, -48, 58, -52, 29, -7, --2, 3, -10, 6, -26, 58, -31, 1, -6, 3, -93, -29, 39, 3, 17, 5, 6, -1, -1, -1, -27, 13, 10, 19, -7, -34, 12, 10, -4, 9, --76, 9, 8, -28, -2, -11, 2, -1, 3, 1, --83, 38, -39, 4, -16, -6, -2, -5, 5, -2, -}; diff --git a/Engine/lib/speex/libspeex/hexc_table.c b/Engine/lib/speex/libspeex/hexc_table.c deleted file mode 100644 index 6e36069ef..000000000 --- a/Engine/lib/speex/libspeex/hexc_table.c +++ /dev/null @@ -1,162 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: hexc_table.c - Codebook for high-band excitation in SB-CELP mode (8000 bps with sign) - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -const signed char hexc_table[1024] = { --24, 21, -20, 5, -5, -7, 14, -10, -2, -27, 16, -20, 0, -32, 26, 19, -8, -11, -41, 31, 28, -27, -32, 34, -42, 34, -17, 22, -10, 13, -29, 18, --12, -26, -24, 11, 22, 5, -5, -5, -54, -68, -43, 57, -25, 24, 4, 4, -26, -8, -12, -17, 54, 30, -45, 1, -10, -15, 18, -41, 11, 68, -67, 37, --16, -24, -16, 38, -22, 6, -29, 30, -66, -27, 5, 7, -16, 13, 2, -12, --7, -3, -20, 36, 4, -28, 9, 3, -32, 48, 26, 39, 3, 0, 7, -21, --13, 5, -82, -7, 73, -20, 34, -9, --5, 1, -1, 10, -5, -10, -1, 9, -1, -9, 10, 0, -14, 11, -1, -2, --1, 11, 20, 96, -81, -22, -12, -9, --58, 9, 24, -30, 26, -35, 27, -12, -13, -18, 56, -59, 15, -7, 23, -15, --1, 6, -25, 14, -22, -20, 47, -11, -16, 2, 38, -23, -19, -30, -9, 40, --11, 5, 4, -6, 8, 26, -21, -11, -127, 4, 1, 6, -9, 2, -7, -2, --3, 7, -5, 10, -19, 7, -106, 91, --3, 9, -4, 21, -8, 26, -80, 8, -1, -2, -10, -17, -17, -27, 32, 71, -6, -29, 11, -23, 54, -38, 29, -22, -39, 87, -31, -12, -20, 3, -2, -2, -2, 20, 0, -1, -35, 27, 9, -6, --12, 3, -12, -6, 13, 1, 14, -22, --59, -15, -17, -25, 13, -7, 7, 3, -0, 1, -7, 6, -3, 61, -37, -23, --23, -29, 38, -31, 27, 1, -8, 2, --27, 23, -26, 36, -34, 5, 24, -24, --6, 7, 3, -59, 78, -62, 44, -16, -1, 6, 0, 17, 8, 45, 0, -110, -6, 14, -2, 32, -77, -56, 62, -3, -3, -13, 4, -16, 102, -15, -36, -1, -9, -113, 6, 23, 0, 9, 9, 5, --8, -1, -14, 5, -12, 121, -53, -27, --8, -9, 22, -13, 3, 2, -3, 1, --2, -71, 95, 38, -19, 15, -16, -5, -71, 10, 2, -32, -13, -5, 15, -1, --2, -14, -85, 30, 29, 6, 3, 2, -0, 0, 0, 0, 0, 0, 0, 0, -2, -65, -56, -9, 18, 18, 23, -14, --2, 0, 12, -29, 26, -12, 1, 2, --12, -64, 90, -6, 4, 1, 5, -5, --110, -3, -31, 22, -29, 9, 0, 8, --40, -5, 21, -5, -5, 13, 10, -18, -40, 1, 35, -20, 30, -28, 11, -6, -19, 7, 14, 18, -64, 9, -6, 16, -51, 68, 8, 16, 12, -8, 0, -9, -20, -22, 25, 7, -4, -13, 41, -35, -93, -18, -54, 11, -1, 1, -9, 4, --66, 66, -31, 20, -22, 25, -23, 11, -10, 9, 19, 15, 11, -5, -31, -10, --23, -28, -6, -6, -3, -4, 5, 3, --28, 22, -11, -42, 25, -25, -16, 41, -34, 47, -6, 2, 42, -19, -22, 5, --39, 32, 6, -35, 22, 17, -30, 8, --26, -11, -11, 3, -12, 33, 33, -37, -21, -1, 6, -4, 3, 0, -5, 5, -12, -12, 57, 27, -61, -3, 20, -17, -2, 0, 4, 0, -2, -33, -58, 81, --23, 39, -10, -5, 2, 6, -7, 5, -4, -3, -2, -13, -23, -72, 107, 15, --5, 0, -7, -3, -6, 5, -4, 15, -47, 12, -31, 25, -16, 8, 22, -25, --62, -56, -18, 14, 28, 12, 2, -11, -74, -66, 41, -20, -7, 16, -20, 16, --8, 0, -16, 4, -19, 92, 12, -59, --14, -39, 49, -25, -16, 23, -27, 19, --3, -33, 19, 85, -29, 6, -7, -10, -16, -7, -12, 1, -6, 2, 4, -2, -64, 10, -25, 41, -2, -31, 15, 0, -110, 50, 69, 35, 28, 19, -10, 2, --43, -49, -56, -15, -16, 10, 3, 12, --1, -8, 1, 26, -12, -1, 7, -11, --27, 41, 25, 1, -11, -18, 22, -7, --1, -47, -8, 23, -3, -17, -7, 18, --125, 59, -5, 3, 18, 1, 2, 3, -27, -35, 65, -53, 50, -46, 37, -21, --28, 7, 14, -37, -5, -5, 12, 5, --8, 78, -19, 21, -6, -16, 8, -7, -5, 2, 7, 2, 10, -6, 12, -60, -44, 11, -36, -32, 31, 0, 2, -2, -2, 1, -3, 7, -10, 17, -21, 10, -6, -2, 19, -2, 59, -38, -86, 38, -8, -41, -30, -45, -33, 7, 15, 28, -29, -7, 24, -40, 7, 7, 5, -2, -9, 24, -23, -18, 6, -29, 30, 2, -28, 49, -11, -46, 10, 43, -13, -9, --1, -3, -7, -7, -17, -6, 97, -33, --21, 3, 5, 1, 12, -43, -8, 28, -7, -43, -7, 17, -20, 19, -1, 2, --13, 9, 54, 34, 9, -28, -11, -9, --17, 110, -59, 44, -26, 0, 3, -12, --47, 73, -34, -43, 38, -33, 16, -5, --46, -4, -6, -2, -25, 19, -29, 28, --13, 5, 14, 27, -40, -43, 4, 32, --13, -2, -35, -4, 112, -42, 9, -12, -37, -28, 17, 14, -19, 35, -39, 23, -3, -14, -1, -57, -5, 94, -9, 3, --39, 5, 30, -10, -32, 42, -13, -14, --97, -63, 30, -9, 1, -7, 12, 5, -20, 17, -9, -36, -30, 25, 47, -9, --15, 12, -22, 98, -8, -50, 15, -27, -21, -16, -11, 2, 12, -10, 10, -3, -33, 36, -96, 0, -17, 31, -9, 9, -3, -20, 13, -11, 8, -4, 10, -10, -9, 1, 112, -70, -27, 5, -21, 2, --57, -3, -29, 10, 19, -21, 21, -10, --66, -3, 91, -35, 30, -12, 0, -7, -59, -28, 26, 2, 14, -18, 1, 1, -11, 17, 20, -54, -59, 27, 4, 29, -32, 5, 19, 12, -4, 1, 7, -10, -5, -2, 10, 0, 23, -5, 28, -104, -46, 11, 16, 3, 29, 1, -8, -14, -1, 7, -50, 88, -62, 26, 8, -17, --14, 50, 0, 32, -12, -3, -27, 18, --8, -5, 8, 3, -20, -11, 37, -12, -9, 33, 46, -101, -1, -4, 1, 6, --1, 28, -42, -15, 16, 5, -1, -2, --55, 85, 38, -9, -4, 11, -2, -9, --6, 3, -20, -10, -77, 89, 24, -3, --104, -57, -26, -31, -20, -6, -9, 14, -20, -23, 46, -15, -31, 28, 1, -15, --2, 6, -2, 31, 45, -76, 23, -25, -}; diff --git a/Engine/lib/speex/libspeex/high_lsp_tables.c b/Engine/lib/speex/libspeex/high_lsp_tables.c deleted file mode 100644 index 732c8b54f..000000000 --- a/Engine/lib/speex/libspeex/high_lsp_tables.c +++ /dev/null @@ -1,163 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: high_lsp_tables.c - Codebooks for high-band LSPs in SB-CELP mode - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -const signed char high_lsp_cdbk[512]={ -39,12,-14,-20,-29,-61,-67,-76, --32,-71,-67,68,77,46,34,5, --13,-48,-46,-72,-81,-84,-60,-58, --40,-28,82,93,68,45,29,3, --19,-47,-28,-43,-35,-30,-8,-13, --39,-91,-91,-123,-96,10,10,-6, --18,-55,-60,-91,-56,-36,-27,-16, --48,-75,40,28,-10,-28,35,9, -37,19,1,-20,-31,-41,-18,-25, --35,-68,-80,45,27,-1,47,13, -0,-29,-35,-57,-50,-79,-73,-38, --19,5,35,14,-10,-23,16,-8, -5,-24,-40,-62,-23,-27,-22,-16, --18,-46,-72,-77,43,21,33,1, --80,-70,-70,-64,-56,-52,-39,-33, --31,-38,-19,-19,-15,32,33,-2, -7,-15,-15,-24,-23,-33,-41,-56, --24,-57,5,89,64,41,27,5, --9,-47,-60,-97,-97,-124,-20,-9, --44,-73,31,29,-4,64,48,7, --35,-57,0,-3,-26,-47,-3,-6, --40,-76,-79,-48,12,81,55,10, -9,-24,-43,-73,-57,-69,16,5, --28,-53,18,29,20,0,-4,-11, -6,-13,23,7,-17,-35,-37,-37, --30,-68,-63,6,24,-9,-14,3, -21,-13,-27,-57,-49,-80,-24,-41, --5,-16,-5,1,45,25,12,-7, -3,-15,-6,-16,-15,-8,6,-13, --42,-81,-80,-87,14,1,-10,-3, --43,-69,-46,-24,-28,-29,36,6, --43,-56,-12,12,54,79,43,9, -54,22,2,8,-12,-43,-46,-52, --38,-69,-89,-5,75,38,33,5, --13,-53,-62,-87,-89,-113,-99,-55, --34,-37,62,55,33,16,21,-2, --17,-46,-29,-38,-38,-48,-39,-42, --36,-75,-72,-88,-48,-30,21,2, --15,-57,-64,-98,-84,-76,25,1, --46,-80,-12,18,-7,3,34,6, -38,31,23,4,-1,20,14,-15, --43,-78,-91,-24,14,-3,54,16, -0,-27,-28,-44,-56,-83,-92,-89, --3,34,56,41,36,22,20,-8, --7,-35,-42,-62,-49,3,12,-10, --50,-87,-96,-66,92,70,38,9, --70,-71,-62,-42,-39,-43,-11,-7, --50,-79,-58,-50,-31,32,31,-6, --4,-25,7,-17,-38,-70,-58,-27, --43,-83,-28,59,36,20,31,2, --27,-71,-80,-109,-98,-75,-33,-32, --31,-2,33,15,-6,43,33,-5, -0,-22,-10,-27,-34,-49,-11,-20, --41,-91,-100,-121,-39,57,41,10, --19,-50,-38,-59,-60,-70,-18,-20, --8,-31,-8,-15,1,-14,-26,-25, -33,21,32,17,1,-19,-19,-26, --58,-81,-35,-22,45,30,11,-11, -3,-26,-48,-87,-67,-83,-58,3, --1,-26,-20,44,10,25,39,5, --9,-35,-27,-38,7,10,4,-9, --42,-85,-102,-127,52,44,28,10, --47,-61,-40,-39,-17,-1,-10,-33, --42,-74,-48,21,-4,70,52,10}; - - -const signed char high_lsp_cdbk2[512]={ --36,-62,6,-9,-10,-14,-56,23, -1,-26,23,-48,-17,12,8,-7, -23,29,-36,-28,-6,-29,-17,-5, -40,23,10,10,-46,-13,36,6, -4,-30,-29,62,32,-32,-1,22, --14,1,-4,-22,-45,2,54,4, --30,-57,-59,-12,27,-3,-31,8, --9,5,10,-14,32,66,19,9, -2,-25,-37,23,-15,18,-38,-31, -5,-9,-21,15,0,22,62,30, -15,-12,-14,-46,77,21,33,3, -34,29,-19,50,2,11,9,-38, --12,-37,62,1,-15,54,32,6, -2,-24,20,35,-21,2,19,24, --13,55,4,9,39,-19,30,-1, --21,73,54,33,8,18,3,15, -6,-19,-47,6,-3,-48,-50,1, -26,20,8,-23,-50,65,-14,-55, --17,-31,-37,-28,53,-1,-17,-53, -1,57,11,-8,-25,-30,-37,64, -5,-52,-45,15,23,31,15,14, --25,24,33,-2,-44,-56,-18,6, --21,-43,4,-12,17,-37,20,-10, -34,15,2,15,55,21,-11,-31, --6,46,25,16,-9,-25,-8,-62, -28,17,20,-32,-29,26,30,25, --19,2,-16,-17,26,-51,2,50, -42,19,-66,23,29,-2,3,19, --19,-37,32,15,6,30,-34,13, -11,-5,40,31,10,-42,4,-9, -26,-9,-70,17,-2,-23,20,-22, --55,51,-24,-31,22,-22,15,-13, -3,-10,-28,-16,56,4,-63,11, --18,-15,-18,-38,-35,16,-7,34, --1,-21,-49,-47,9,-37,7,8, -69,55,20,6,-33,-45,-10,-9, -6,-9,12,71,15,-3,-42,-7, --24,32,-35,-2,-42,-17,-5,0, --2,-33,-54,13,-12,-34,47,23, -19,55,7,-8,74,31,14,16, --23,-26,19,12,-18,-49,-28,-31, --20,2,-14,-20,-47,78,40,13, --23,-11,21,-6,18,1,47,5, -38,35,32,46,22,8,13,16, --14,18,51,19,40,39,11,-26, --1,-17,47,2,-53,-15,31,-22, -38,21,-15,-16,5,-33,53,15, --38,86,11,-3,-24,49,13,-4, --11,-18,28,20,-12,-27,-26,35, --25,-35,-3,-20,-61,30,10,-55, --12,-22,-52,-54,-14,19,-32,-12, -45,15,-8,-48,-9,11,-32,8, --16,-34,-13,51,18,38,-2,-32, --17,22,-2,-18,-28,-70,59,27, --28,-19,-10,-20,-9,-9,-8,-21, -21,-8,35,-2,45,-3,-9,12, -0,30,7,-39,43,27,-38,-91, -30,26,19,-55,-4,63,14,-17, -13,9,13,2,7,4,6,61, -72,-1,-17,29,-1,-22,-17,8, --28,-37,63,44,41,3,2,14, -9,-6,75,-8,-7,-12,-15,-12, -13,9,-4,30,-22,-65,15,0, --45,4,-4,1,5,22,11,23}; diff --git a/Engine/lib/speex/libspeex/kiss_fft.c b/Engine/lib/speex/libspeex/kiss_fft.c deleted file mode 100644 index 285e55798..000000000 --- a/Engine/lib/speex/libspeex/kiss_fft.c +++ /dev/null @@ -1,523 +0,0 @@ -/* -Copyright (c) 2003-2004, Mark Borgerding -Copyright (c) 2005-2007, Jean-Marc Valin - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "_kiss_fft_guts.h" -#include "arch.h" -#include "os_support.h" - -/* The guts header contains all the multiplication and addition macros that are defined for - fixed or floating point complex numbers. It also delares the kf_ internal functions. - */ - -static void kf_bfly2( - kiss_fft_cpx * Fout, - const size_t fstride, - const kiss_fft_cfg st, - int m, - int N, - int mm - ) -{ - kiss_fft_cpx * Fout2; - kiss_fft_cpx * tw1; - kiss_fft_cpx t; - if (!st->inverse) { - int i,j; - kiss_fft_cpx * Fout_beg = Fout; - for (i=0;itwiddles; - for(j=0;jr , tw1->r),MULT16_16(Fout2->i , tw1->i)), 1); - ti = SHR32(ADD32(MULT16_16(Fout2->i , tw1->r),MULT16_16(Fout2->r , tw1->i)), 1); - tw1 += fstride; - Fout2->r = PSHR32(SUB32(SHL32(EXTEND32(Fout->r), 14), tr), 15); - Fout2->i = PSHR32(SUB32(SHL32(EXTEND32(Fout->i), 14), ti), 15); - Fout->r = PSHR32(ADD32(SHL32(EXTEND32(Fout->r), 14), tr), 15); - Fout->i = PSHR32(ADD32(SHL32(EXTEND32(Fout->i), 14), ti), 15); - ++Fout2; - ++Fout; - } - } - } else { - int i,j; - kiss_fft_cpx * Fout_beg = Fout; - for (i=0;itwiddles; - for(j=0;jinverse) - { - kiss_fft_cpx * Fout_beg = Fout; - for (i=0;itwiddles; - for (j=0;jtwiddles; - for (j=0;jr = PSHR16(Fout->r, 2); - Fout->i = PSHR16(Fout->i, 2); - C_SUB( scratch[5] , *Fout, scratch[1] ); - C_ADDTO(*Fout, scratch[1]); - C_ADD( scratch[3] , scratch[0] , scratch[2] ); - C_SUB( scratch[4] , scratch[0] , scratch[2] ); - Fout[m2].r = PSHR16(Fout[m2].r, 2); - Fout[m2].i = PSHR16(Fout[m2].i, 2); - C_SUB( Fout[m2], *Fout, scratch[3] ); - tw1 += fstride; - tw2 += fstride*2; - tw3 += fstride*3; - C_ADDTO( *Fout , scratch[3] ); - - Fout[m].r = scratch[5].r + scratch[4].i; - Fout[m].i = scratch[5].i - scratch[4].r; - Fout[m3].r = scratch[5].r - scratch[4].i; - Fout[m3].i = scratch[5].i + scratch[4].r; - ++Fout; - } - } - } -} - -static void kf_bfly3( - kiss_fft_cpx * Fout, - const size_t fstride, - const kiss_fft_cfg st, - size_t m - ) -{ - size_t k=m; - const size_t m2 = 2*m; - kiss_fft_cpx *tw1,*tw2; - kiss_fft_cpx scratch[5]; - kiss_fft_cpx epi3; - epi3 = st->twiddles[fstride*m]; - - tw1=tw2=st->twiddles; - - do{ - if (!st->inverse) { - C_FIXDIV(*Fout,3); C_FIXDIV(Fout[m],3); C_FIXDIV(Fout[m2],3); - } - - C_MUL(scratch[1],Fout[m] , *tw1); - C_MUL(scratch[2],Fout[m2] , *tw2); - - C_ADD(scratch[3],scratch[1],scratch[2]); - C_SUB(scratch[0],scratch[1],scratch[2]); - tw1 += fstride; - tw2 += fstride*2; - - Fout[m].r = Fout->r - HALF_OF(scratch[3].r); - Fout[m].i = Fout->i - HALF_OF(scratch[3].i); - - C_MULBYSCALAR( scratch[0] , epi3.i ); - - C_ADDTO(*Fout,scratch[3]); - - Fout[m2].r = Fout[m].r + scratch[0].i; - Fout[m2].i = Fout[m].i - scratch[0].r; - - Fout[m].r -= scratch[0].i; - Fout[m].i += scratch[0].r; - - ++Fout; - }while(--k); -} - -static void kf_bfly5( - kiss_fft_cpx * Fout, - const size_t fstride, - const kiss_fft_cfg st, - int m - ) -{ - kiss_fft_cpx *Fout0,*Fout1,*Fout2,*Fout3,*Fout4; - int u; - kiss_fft_cpx scratch[13]; - kiss_fft_cpx * twiddles = st->twiddles; - kiss_fft_cpx *tw; - kiss_fft_cpx ya,yb; - ya = twiddles[fstride*m]; - yb = twiddles[fstride*2*m]; - - Fout0=Fout; - Fout1=Fout0+m; - Fout2=Fout0+2*m; - Fout3=Fout0+3*m; - Fout4=Fout0+4*m; - - tw=st->twiddles; - for ( u=0; uinverse) { - C_FIXDIV( *Fout0,5); C_FIXDIV( *Fout1,5); C_FIXDIV( *Fout2,5); C_FIXDIV( *Fout3,5); C_FIXDIV( *Fout4,5); - } - scratch[0] = *Fout0; - - C_MUL(scratch[1] ,*Fout1, tw[u*fstride]); - C_MUL(scratch[2] ,*Fout2, tw[2*u*fstride]); - C_MUL(scratch[3] ,*Fout3, tw[3*u*fstride]); - C_MUL(scratch[4] ,*Fout4, tw[4*u*fstride]); - - C_ADD( scratch[7],scratch[1],scratch[4]); - C_SUB( scratch[10],scratch[1],scratch[4]); - C_ADD( scratch[8],scratch[2],scratch[3]); - C_SUB( scratch[9],scratch[2],scratch[3]); - - Fout0->r += scratch[7].r + scratch[8].r; - Fout0->i += scratch[7].i + scratch[8].i; - - scratch[5].r = scratch[0].r + S_MUL(scratch[7].r,ya.r) + S_MUL(scratch[8].r,yb.r); - scratch[5].i = scratch[0].i + S_MUL(scratch[7].i,ya.r) + S_MUL(scratch[8].i,yb.r); - - scratch[6].r = S_MUL(scratch[10].i,ya.i) + S_MUL(scratch[9].i,yb.i); - scratch[6].i = -S_MUL(scratch[10].r,ya.i) - S_MUL(scratch[9].r,yb.i); - - C_SUB(*Fout1,scratch[5],scratch[6]); - C_ADD(*Fout4,scratch[5],scratch[6]); - - scratch[11].r = scratch[0].r + S_MUL(scratch[7].r,yb.r) + S_MUL(scratch[8].r,ya.r); - scratch[11].i = scratch[0].i + S_MUL(scratch[7].i,yb.r) + S_MUL(scratch[8].i,ya.r); - scratch[12].r = - S_MUL(scratch[10].i,yb.i) + S_MUL(scratch[9].i,ya.i); - scratch[12].i = S_MUL(scratch[10].r,yb.i) - S_MUL(scratch[9].r,ya.i); - - C_ADD(*Fout2,scratch[11],scratch[12]); - C_SUB(*Fout3,scratch[11],scratch[12]); - - ++Fout0;++Fout1;++Fout2;++Fout3;++Fout4; - } -} - -/* perform the butterfly for one stage of a mixed radix FFT */ -static void kf_bfly_generic( - kiss_fft_cpx * Fout, - const size_t fstride, - const kiss_fft_cfg st, - int m, - int p - ) -{ - int u,k,q1,q; - kiss_fft_cpx * twiddles = st->twiddles; - kiss_fft_cpx t; - kiss_fft_cpx scratchbuf[17]; - int Norig = st->nfft; - - /*CHECKBUF(scratchbuf,nscratchbuf,p);*/ - if (p>17) - speex_fatal("KissFFT: max radix supported is 17"); - - for ( u=0; uinverse) { - C_FIXDIV(scratchbuf[q1],p); - } - k += m; - } - - k=u; - for ( q1=0 ; q1

=Norig) twidx-=Norig; - C_MUL(t,scratchbuf[q] , twiddles[twidx] ); - C_ADDTO( Fout[ k ] ,t); - } - k += m; - } - } -} - -static -void kf_shuffle( - kiss_fft_cpx * Fout, - const kiss_fft_cpx * f, - const size_t fstride, - int in_stride, - int * factors, - const kiss_fft_cfg st - ) -{ - const int p=*factors++; /* the radix */ - const int m=*factors++; /* stage's fft length/p */ - - /*printf ("fft %d %d %d %d %d %d\n", p*m, m, p, s2, fstride*in_stride, N);*/ - if (m==1) - { - int j; - for (j=0;j32000 || (spx_int32_t)p*(spx_int32_t)p > n) - p = n; /* no more factors, skip to end */ - } - n /= p; - *facbuf++ = p; - *facbuf++ = n; - } while (n > 1); -} -/* - * - * User-callable function to allocate all necessary storage space for the fft. - * - * The return value is a contiguous block of memory, allocated with malloc. As such, - * It can be freed with free(), rather than a kiss_fft-specific function. - * */ -kiss_fft_cfg kiss_fft_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem ) -{ - kiss_fft_cfg st=NULL; - size_t memneeded = sizeof(struct kiss_fft_state) - + sizeof(kiss_fft_cpx)*(nfft-1); /* twiddle factors*/ - - if ( lenmem==NULL ) { - st = ( kiss_fft_cfg)KISS_FFT_MALLOC( memneeded ); - }else{ - if (mem != NULL && *lenmem >= memneeded) - st = (kiss_fft_cfg)mem; - *lenmem = memneeded; - } - if (st) { - int i; - st->nfft=nfft; - st->inverse = inverse_fft; -#ifdef FIXED_POINT - for (i=0;iinverse) - phase = -phase; - kf_cexp2(st->twiddles+i, DIV32(SHL32(phase,17),nfft)); - } -#else - for (i=0;iinverse) - phase *= -1; - kf_cexp(st->twiddles+i, phase ); - } -#endif - kf_factor(nfft,st->factors); - } - return st; -} - - - - -void kiss_fft_stride(kiss_fft_cfg st,const kiss_fft_cpx *fin,kiss_fft_cpx *fout,int in_stride) -{ - if (fin == fout) - { - speex_fatal("In-place FFT not supported"); - /*CHECKBUF(tmpbuf,ntmpbuf,st->nfft); - kf_work(tmpbuf,fin,1,in_stride, st->factors,st); - SPEEX_MOVE(fout,tmpbuf,st->nfft);*/ - } else { - kf_shuffle( fout, fin, 1,in_stride, st->factors,st); - kf_work( fout, fin, 1,in_stride, st->factors,st, 1, in_stride, 1); - } -} - -void kiss_fft(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout) -{ - kiss_fft_stride(cfg,fin,fout,1); -} - diff --git a/Engine/lib/speex/libspeex/kiss_fft.h b/Engine/lib/speex/libspeex/kiss_fft.h deleted file mode 100644 index fa3f2c604..000000000 --- a/Engine/lib/speex/libspeex/kiss_fft.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef KISS_FFT_H -#define KISS_FFT_H - -#include -#include -#include "arch.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - ATTENTION! - If you would like a : - -- a utility that will handle the caching of fft objects - -- real-only (no imaginary time component ) FFT - -- a multi-dimensional FFT - -- a command-line utility to perform ffts - -- a command-line utility to perform fast-convolution filtering - - Then see kfc.h kiss_fftr.h kiss_fftnd.h fftutil.c kiss_fastfir.c - in the tools/ directory. -*/ - -#ifdef USE_SIMD -# include -# define kiss_fft_scalar __m128 -#define KISS_FFT_MALLOC(nbytes) memalign(16,nbytes) -#else -#define KISS_FFT_MALLOC speex_alloc -#endif - - -#ifdef FIXED_POINT -#include "arch.h" -# define kiss_fft_scalar spx_int16_t -#else -# ifndef kiss_fft_scalar -/* default is float */ -# define kiss_fft_scalar float -# endif -#endif - -typedef struct { - kiss_fft_scalar r; - kiss_fft_scalar i; -}kiss_fft_cpx; - -typedef struct kiss_fft_state* kiss_fft_cfg; - -/* - * kiss_fft_alloc - * - * Initialize a FFT (or IFFT) algorithm's cfg/state buffer. - * - * typical usage: kiss_fft_cfg mycfg=kiss_fft_alloc(1024,0,NULL,NULL); - * - * The return value from fft_alloc is a cfg buffer used internally - * by the fft routine or NULL. - * - * If lenmem is NULL, then kiss_fft_alloc will allocate a cfg buffer using malloc. - * The returned value should be free()d when done to avoid memory leaks. - * - * The state can be placed in a user supplied buffer 'mem': - * If lenmem is not NULL and mem is not NULL and *lenmem is large enough, - * then the function places the cfg in mem and the size used in *lenmem - * and returns mem. - * - * If lenmem is not NULL and ( mem is NULL or *lenmem is not large enough), - * then the function returns NULL and places the minimum cfg - * buffer size in *lenmem. - * */ - -kiss_fft_cfg kiss_fft_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem); - -/* - * kiss_fft(cfg,in_out_buf) - * - * Perform an FFT on a complex input buffer. - * for a forward FFT, - * fin should be f[0] , f[1] , ... ,f[nfft-1] - * fout will be F[0] , F[1] , ... ,F[nfft-1] - * Note that each element is complex and can be accessed like - f[k].r and f[k].i - * */ -void kiss_fft(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout); - -/* - A more generic version of the above function. It reads its input from every Nth sample. - * */ -void kiss_fft_stride(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout,int fin_stride); - -/* If kiss_fft_alloc allocated a buffer, it is one contiguous - buffer and can be simply free()d when no longer needed*/ -#define kiss_fft_free speex_free - -/* - Cleans up some memory that gets managed internally. Not necessary to call, but it might clean up - your compiler output to call this before you exit. -*/ -void kiss_fft_cleanup(void); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/Engine/lib/speex/libspeex/kiss_fftr.c b/Engine/lib/speex/libspeex/kiss_fftr.c deleted file mode 100644 index 827e0b14d..000000000 --- a/Engine/lib/speex/libspeex/kiss_fftr.c +++ /dev/null @@ -1,297 +0,0 @@ -/* -Copyright (c) 2003-2004, Mark Borgerding - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "os_support.h" -#include "kiss_fftr.h" -#include "_kiss_fft_guts.h" - -struct kiss_fftr_state{ - kiss_fft_cfg substate; - kiss_fft_cpx * tmpbuf; - kiss_fft_cpx * super_twiddles; -#ifdef USE_SIMD - long pad; -#endif -}; - -kiss_fftr_cfg kiss_fftr_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem) -{ - int i; - kiss_fftr_cfg st = NULL; - size_t subsize, memneeded; - - if (nfft & 1) { - speex_warning("Real FFT optimization must be even.\n"); - return NULL; - } - nfft >>= 1; - - kiss_fft_alloc (nfft, inverse_fft, NULL, &subsize); - memneeded = sizeof(struct kiss_fftr_state) + subsize + sizeof(kiss_fft_cpx) * ( nfft * 2); - - if (lenmem == NULL) { - st = (kiss_fftr_cfg) KISS_FFT_MALLOC (memneeded); - } else { - if (*lenmem >= memneeded) - st = (kiss_fftr_cfg) mem; - *lenmem = memneeded; - } - if (!st) - return NULL; - - st->substate = (kiss_fft_cfg) (st + 1); /*just beyond kiss_fftr_state struct */ - st->tmpbuf = (kiss_fft_cpx *) (((char *) st->substate) + subsize); - st->super_twiddles = st->tmpbuf + nfft; - kiss_fft_alloc(nfft, inverse_fft, st->substate, &subsize); - -#ifdef FIXED_POINT - for (i=0;i>1); - if (!inverse_fft) - phase = -phase; - kf_cexp2(st->super_twiddles+i, DIV32(SHL32(phase,16),nfft)); - } -#else - for (i=0;isuper_twiddles+i, phase ); - } -#endif - return st; -} - -void kiss_fftr(kiss_fftr_cfg st,const kiss_fft_scalar *timedata,kiss_fft_cpx *freqdata) -{ - /* input buffer timedata is stored row-wise */ - int k,ncfft; - kiss_fft_cpx fpnk,fpk,f1k,f2k,tw,tdc; - - if ( st->substate->inverse) { - speex_fatal("kiss fft usage error: improper alloc\n"); - } - - ncfft = st->substate->nfft; - - /*perform the parallel fft of two real signals packed in real,imag*/ - kiss_fft( st->substate , (const kiss_fft_cpx*)timedata, st->tmpbuf ); - /* The real part of the DC element of the frequency spectrum in st->tmpbuf - * contains the sum of the even-numbered elements of the input time sequence - * The imag part is the sum of the odd-numbered elements - * - * The sum of tdc.r and tdc.i is the sum of the input time sequence. - * yielding DC of input time sequence - * The difference of tdc.r - tdc.i is the sum of the input (dot product) [1,-1,1,-1... - * yielding Nyquist bin of input time sequence - */ - - tdc.r = st->tmpbuf[0].r; - tdc.i = st->tmpbuf[0].i; - C_FIXDIV(tdc,2); - CHECK_OVERFLOW_OP(tdc.r ,+, tdc.i); - CHECK_OVERFLOW_OP(tdc.r ,-, tdc.i); - freqdata[0].r = tdc.r + tdc.i; - freqdata[ncfft].r = tdc.r - tdc.i; -#ifdef USE_SIMD - freqdata[ncfft].i = freqdata[0].i = _mm_set1_ps(0); -#else - freqdata[ncfft].i = freqdata[0].i = 0; -#endif - - for ( k=1;k <= ncfft/2 ; ++k ) { - fpk = st->tmpbuf[k]; - fpnk.r = st->tmpbuf[ncfft-k].r; - fpnk.i = - st->tmpbuf[ncfft-k].i; - C_FIXDIV(fpk,2); - C_FIXDIV(fpnk,2); - - C_ADD( f1k, fpk , fpnk ); - C_SUB( f2k, fpk , fpnk ); - C_MUL( tw , f2k , st->super_twiddles[k]); - - freqdata[k].r = HALF_OF(f1k.r + tw.r); - freqdata[k].i = HALF_OF(f1k.i + tw.i); - freqdata[ncfft-k].r = HALF_OF(f1k.r - tw.r); - freqdata[ncfft-k].i = HALF_OF(tw.i - f1k.i); - } -} - -void kiss_fftri(kiss_fftr_cfg st,const kiss_fft_cpx *freqdata, kiss_fft_scalar *timedata) -{ - /* input buffer timedata is stored row-wise */ - int k, ncfft; - - if (st->substate->inverse == 0) { - speex_fatal("kiss fft usage error: improper alloc\n"); - } - - ncfft = st->substate->nfft; - - st->tmpbuf[0].r = freqdata[0].r + freqdata[ncfft].r; - st->tmpbuf[0].i = freqdata[0].r - freqdata[ncfft].r; - /*C_FIXDIV(st->tmpbuf[0],2);*/ - - for (k = 1; k <= ncfft / 2; ++k) { - kiss_fft_cpx fk, fnkc, fek, fok, tmp; - fk = freqdata[k]; - fnkc.r = freqdata[ncfft - k].r; - fnkc.i = -freqdata[ncfft - k].i; - /*C_FIXDIV( fk , 2 ); - C_FIXDIV( fnkc , 2 );*/ - - C_ADD (fek, fk, fnkc); - C_SUB (tmp, fk, fnkc); - C_MUL (fok, tmp, st->super_twiddles[k]); - C_ADD (st->tmpbuf[k], fek, fok); - C_SUB (st->tmpbuf[ncfft - k], fek, fok); -#ifdef USE_SIMD - st->tmpbuf[ncfft - k].i *= _mm_set1_ps(-1.0); -#else - st->tmpbuf[ncfft - k].i *= -1; -#endif - } - kiss_fft (st->substate, st->tmpbuf, (kiss_fft_cpx *) timedata); -} - -void kiss_fftr2(kiss_fftr_cfg st,const kiss_fft_scalar *timedata,kiss_fft_scalar *freqdata) -{ - /* input buffer timedata is stored row-wise */ - int k,ncfft; - kiss_fft_cpx f2k,tdc; - spx_word32_t f1kr, f1ki, twr, twi; - - if ( st->substate->inverse) { - speex_fatal("kiss fft usage error: improper alloc\n"); - } - - ncfft = st->substate->nfft; - - /*perform the parallel fft of two real signals packed in real,imag*/ - kiss_fft( st->substate , (const kiss_fft_cpx*)timedata, st->tmpbuf ); - /* The real part of the DC element of the frequency spectrum in st->tmpbuf - * contains the sum of the even-numbered elements of the input time sequence - * The imag part is the sum of the odd-numbered elements - * - * The sum of tdc.r and tdc.i is the sum of the input time sequence. - * yielding DC of input time sequence - * The difference of tdc.r - tdc.i is the sum of the input (dot product) [1,-1,1,-1... - * yielding Nyquist bin of input time sequence - */ - - tdc.r = st->tmpbuf[0].r; - tdc.i = st->tmpbuf[0].i; - C_FIXDIV(tdc,2); - CHECK_OVERFLOW_OP(tdc.r ,+, tdc.i); - CHECK_OVERFLOW_OP(tdc.r ,-, tdc.i); - freqdata[0] = tdc.r + tdc.i; - freqdata[2*ncfft-1] = tdc.r - tdc.i; - - for ( k=1;k <= ncfft/2 ; ++k ) - { - /*fpk = st->tmpbuf[k]; - fpnk.r = st->tmpbuf[ncfft-k].r; - fpnk.i = - st->tmpbuf[ncfft-k].i; - C_FIXDIV(fpk,2); - C_FIXDIV(fpnk,2); - - C_ADD( f1k, fpk , fpnk ); - C_SUB( f2k, fpk , fpnk ); - - C_MUL( tw , f2k , st->super_twiddles[k]); - - freqdata[2*k-1] = HALF_OF(f1k.r + tw.r); - freqdata[2*k] = HALF_OF(f1k.i + tw.i); - freqdata[2*(ncfft-k)-1] = HALF_OF(f1k.r - tw.r); - freqdata[2*(ncfft-k)] = HALF_OF(tw.i - f1k.i); - */ - - /*f1k.r = PSHR32(ADD32(EXTEND32(st->tmpbuf[k].r), EXTEND32(st->tmpbuf[ncfft-k].r)),1); - f1k.i = PSHR32(SUB32(EXTEND32(st->tmpbuf[k].i), EXTEND32(st->tmpbuf[ncfft-k].i)),1); - f2k.r = PSHR32(SUB32(EXTEND32(st->tmpbuf[k].r), EXTEND32(st->tmpbuf[ncfft-k].r)),1); - f2k.i = SHR32(ADD32(EXTEND32(st->tmpbuf[k].i), EXTEND32(st->tmpbuf[ncfft-k].i)),1); - - C_MUL( tw , f2k , st->super_twiddles[k]); - - freqdata[2*k-1] = HALF_OF(f1k.r + tw.r); - freqdata[2*k] = HALF_OF(f1k.i + tw.i); - freqdata[2*(ncfft-k)-1] = HALF_OF(f1k.r - tw.r); - freqdata[2*(ncfft-k)] = HALF_OF(tw.i - f1k.i); - */ - f2k.r = SHR32(SUB32(EXTEND32(st->tmpbuf[k].r), EXTEND32(st->tmpbuf[ncfft-k].r)),1); - f2k.i = PSHR32(ADD32(EXTEND32(st->tmpbuf[k].i), EXTEND32(st->tmpbuf[ncfft-k].i)),1); - - f1kr = SHL32(ADD32(EXTEND32(st->tmpbuf[k].r), EXTEND32(st->tmpbuf[ncfft-k].r)),13); - f1ki = SHL32(SUB32(EXTEND32(st->tmpbuf[k].i), EXTEND32(st->tmpbuf[ncfft-k].i)),13); - - twr = SHR32(SUB32(MULT16_16(f2k.r,st->super_twiddles[k].r),MULT16_16(f2k.i,st->super_twiddles[k].i)), 1); - twi = SHR32(ADD32(MULT16_16(f2k.i,st->super_twiddles[k].r),MULT16_16(f2k.r,st->super_twiddles[k].i)), 1); - -#ifdef FIXED_POINT - freqdata[2*k-1] = PSHR32(f1kr + twr, 15); - freqdata[2*k] = PSHR32(f1ki + twi, 15); - freqdata[2*(ncfft-k)-1] = PSHR32(f1kr - twr, 15); - freqdata[2*(ncfft-k)] = PSHR32(twi - f1ki, 15); -#else - freqdata[2*k-1] = .5f*(f1kr + twr); - freqdata[2*k] = .5f*(f1ki + twi); - freqdata[2*(ncfft-k)-1] = .5f*(f1kr - twr); - freqdata[2*(ncfft-k)] = .5f*(twi - f1ki); - -#endif - } -} - -void kiss_fftri2(kiss_fftr_cfg st,const kiss_fft_scalar *freqdata,kiss_fft_scalar *timedata) -{ - /* input buffer timedata is stored row-wise */ - int k, ncfft; - - if (st->substate->inverse == 0) { - speex_fatal ("kiss fft usage error: improper alloc\n"); - } - - ncfft = st->substate->nfft; - - st->tmpbuf[0].r = freqdata[0] + freqdata[2*ncfft-1]; - st->tmpbuf[0].i = freqdata[0] - freqdata[2*ncfft-1]; - /*C_FIXDIV(st->tmpbuf[0],2);*/ - - for (k = 1; k <= ncfft / 2; ++k) { - kiss_fft_cpx fk, fnkc, fek, fok, tmp; - fk.r = freqdata[2*k-1]; - fk.i = freqdata[2*k]; - fnkc.r = freqdata[2*(ncfft - k)-1]; - fnkc.i = -freqdata[2*(ncfft - k)]; - /*C_FIXDIV( fk , 2 ); - C_FIXDIV( fnkc , 2 );*/ - - C_ADD (fek, fk, fnkc); - C_SUB (tmp, fk, fnkc); - C_MUL (fok, tmp, st->super_twiddles[k]); - C_ADD (st->tmpbuf[k], fek, fok); - C_SUB (st->tmpbuf[ncfft - k], fek, fok); -#ifdef USE_SIMD - st->tmpbuf[ncfft - k].i *= _mm_set1_ps(-1.0); -#else - st->tmpbuf[ncfft - k].i *= -1; -#endif - } - kiss_fft (st->substate, st->tmpbuf, (kiss_fft_cpx *) timedata); -} diff --git a/Engine/lib/speex/libspeex/kiss_fftr.h b/Engine/lib/speex/libspeex/kiss_fftr.h deleted file mode 100644 index 7bfb42334..000000000 --- a/Engine/lib/speex/libspeex/kiss_fftr.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef KISS_FTR_H -#define KISS_FTR_H - -#include "kiss_fft.h" -#ifdef __cplusplus -extern "C" { -#endif - - -/* - - Real optimized version can save about 45% cpu time vs. complex fft of a real seq. - - - - */ - -typedef struct kiss_fftr_state *kiss_fftr_cfg; - - -kiss_fftr_cfg kiss_fftr_alloc(int nfft,int inverse_fft,void * mem, size_t * lenmem); -/* - nfft must be even - - If you don't care to allocate space, use mem = lenmem = NULL -*/ - - -void kiss_fftr(kiss_fftr_cfg cfg,const kiss_fft_scalar *timedata,kiss_fft_cpx *freqdata); -/* - input timedata has nfft scalar points - output freqdata has nfft/2+1 complex points -*/ - -void kiss_fftr2(kiss_fftr_cfg st,const kiss_fft_scalar *timedata,kiss_fft_scalar *freqdata); - -void kiss_fftri(kiss_fftr_cfg cfg,const kiss_fft_cpx *freqdata,kiss_fft_scalar *timedata); - -void kiss_fftri2(kiss_fftr_cfg st,const kiss_fft_scalar *freqdata, kiss_fft_scalar *timedata); - -/* - input freqdata has nfft/2+1 complex points - output timedata has nfft scalar points -*/ - -#define kiss_fftr_free speex_free - -#ifdef __cplusplus -} -#endif -#endif diff --git a/Engine/lib/speex/libspeex/lpc.c b/Engine/lib/speex/libspeex/lpc.c deleted file mode 100644 index fca4d9eea..000000000 --- a/Engine/lib/speex/libspeex/lpc.c +++ /dev/null @@ -1,198 +0,0 @@ -/* - Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann, - Technische Universitaet Berlin - - Any use of this software is permitted provided that this notice is not - removed and that neither the authors nor the Technische Universitaet Berlin - are deemed to have made any representations as to the suitability of this - software for any purpose nor are held responsible for any defects of - this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - - As a matter of courtesy, the authors request to be informed about uses - this software has found, about bugs in this software, and about any - improvements that may be of general interest. - - Berlin, 28.11.1994 - Jutta Degener - Carsten Bormann - - - Code modified by Jean-Marc Valin - - Speex License: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef DISABLE_ENCODER - -#include "lpc.h" - -#ifdef BFIN_ASM -#include "lpc_bfin.h" -#endif - -/* LPC analysis - * - * The next two functions calculate linear prediction coefficients - * and/or the related reflection coefficients from the first P_MAX+1 - * values of the autocorrelation function. - */ - -/* Invented by N. Levinson in 1947, modified by J. Durbin in 1959. - */ - -/* returns minimum mean square error */ -spx_word32_t _spx_lpc( -spx_coef_t *lpc, /* out: [0...p-1] LPC coefficients */ -const spx_word16_t *ac, /* in: [0...p] autocorrelation values */ -int p -) -{ - int i, j; - spx_word16_t r; - spx_word16_t error = ac[0]; - - for (i = 0; i < p; i++) { - - /* Sum up this iteration's reflection coefficient */ - spx_word32_t rr = NEG32(SHL32(EXTEND32(ac[i + 1]),13)); - for (j = 0; j < i; j++) - rr = SUB32(rr,MULT16_16(lpc[j],ac[i - j])); -#ifdef FIXED_POINT - r = DIV32_16(rr+PSHR32(error,1),ADD16(error,8)); -#else - r = rr/(error+.003*ac[0]); -#endif - /* Update LPC coefficients and total error */ - lpc[i] = r; - for (j = 0; j < (i+1)>>1; j++) - { - spx_word16_t tmp1, tmp2; - /* It could be that j == i-1-j, in which case, we're updating the same value twice, which is OK */ - tmp1 = lpc[j]; - tmp2 = lpc[i-1-j]; - lpc[j] = MAC16_16_P13(tmp1,r,tmp2); - lpc[i-1-j] = MAC16_16_P13(tmp2,r,tmp1); - } - - error = SUB16(error,MULT16_16_Q13(r,MULT16_16_Q13(error,r))); - } - return error; -} - - -#ifdef FIXED_POINT - -/* Compute the autocorrelation - * ,--, - * ac(i) = > x(n) * x(n-i) for all n - * `--' - * for lags between 0 and lag-1, and x == 0 outside 0...n-1 - */ - -#ifndef OVERRIDE_SPEEX_AUTOCORR -void _spx_autocorr( -const spx_word16_t *x, /* in: [0...n-1] samples x */ -spx_word16_t *ac, /* out: [0...lag-1] ac values */ -int lag, -int n -) -{ - spx_word32_t d; - int i, j; - spx_word32_t ac0=1; - int shift, ac_shift; - - for (j=0;j x(n) * x(n-i) for all n - * `--' - * for lags between 0 and lag-1, and x == 0 outside 0...n-1 - */ -void _spx_autocorr( -const spx_word16_t *x, /* in: [0...n-1] samples x */ -float *ac, /* out: [0...lag-1] ac values */ -int lag, -int n -) -{ - float d; - int i; - while (lag--) - { - for (i = lag, d = 0; i < n; i++) - d += x[i] * x[i-lag]; - ac[lag] = d; - } - ac[0] += 10; -} - -#endif - - -#endif /* DISABLE_ENCODER */ diff --git a/Engine/lib/speex/libspeex/lpc.h b/Engine/lib/speex/libspeex/lpc.h deleted file mode 100644 index 952ecdd93..000000000 --- a/Engine/lib/speex/libspeex/lpc.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin */ -/** - @file lpc.h - @brief Functions for LPC (Linear Prediction Coefficients) analysis -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef LPC_H -#define LPC_H - -#include "arch.h" - -void _spx_autocorr( - const spx_word16_t * x, /* in: [0...n-1] samples x */ - spx_word16_t *ac, /* out: [0...lag-1] ac values */ - int lag, int n); - -spx_word32_t /* returns minimum mean square error */ -_spx_lpc( - spx_coef_t * lpc, /* [0...p-1] LPC coefficients */ - const spx_word16_t * ac, /* in: [0...p] autocorrelation values */ - int p - ); - - -#endif diff --git a/Engine/lib/speex/libspeex/lpc_bfin.h b/Engine/lib/speex/libspeex/lpc_bfin.h deleted file mode 100644 index d7d11c008..000000000 --- a/Engine/lib/speex/libspeex/lpc_bfin.h +++ /dev/null @@ -1,134 +0,0 @@ -/* Copyright (C) 2005 Analog Devices */ -/** - @file lpc_bfin.h - @author Jean-Marc Valin - @brief Functions for LPC (Linear Prediction Coefficients) analysis (Blackfin version) -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "bfin.h" - -#define OVERRIDE_SPEEX_AUTOCORR -void _spx_autocorr( -const spx_word16_t *x, /* in: [0...n-1] samples x */ -spx_word16_t *ac, /* out: [0...lag-1] ac values */ -int lag, -int n - ) -{ - spx_word32_t d; - const spx_word16_t *xs; - int i, j; - spx_word32_t ac0=1; - spx_word32_t ac32[11], *ac32top; - int shift, ac_shift; - ac32top = ac32+lag-1; - int lag_1, N_lag; - int nshift; - lag_1 = lag-1; - N_lag = n-lag_1; - for (j=0;j> 1;\n\t" - "LOOP_BEGIN pitch%=;\n\t" - "I1 = P0;\n\t" - "A1 = A0 = 0;\n\t" - "R1 = [I1++];\n\t" - "LOOP inner_prod%= LC1 = P3 >> 1;\n\t" - "LOOP_BEGIN inner_prod%=;\n\t" - "A1 += R0.L*R1.H, A0 += R0.L*R1.L (IS) || R1.L = W[I1++];\n\t" - "A1 += R0.H*R1.L, A0 += R0.H*R1.H (IS) || R1.H = W[I1++] || R0 = [I0++];\n\t" - "LOOP_END inner_prod%=;\n\t" - "A0 = ASHIFT A0 by R4.L;\n\t" - "A1 = ASHIFT A1 by R4.L;\n\t" - - "R2 = A0, R3 = A1;\n\t" - "[P1--] = R2;\n\t" - "[P1--] = R3;\n\t" - "P0 += 4;\n\t" - "LOOP_END pitch%=;\n\t" - : : "m" (xs), "m" (x), "m" (ac32top), "m" (N_lag), "m" (lag_1), "m" (nshift) - : "A0", "A1", "P0", "P1", "P2", "P3", "P4", "R0", "R1", "R2", "R3", "R4", "I0", "I1", "L0", "L1", "B0", "B1", "memory", - "ASTAT" BFIN_HWLOOP0_REGS BFIN_HWLOOP1_REGS - ); - d=0; - for (j=0;j -#include "lsp.h" -#include "stack_alloc.h" -#include "math_approx.h" - -#ifndef M_PI -#define M_PI 3.14159265358979323846 /* pi */ -#endif - -#ifndef NULL -#define NULL 0 -#endif - -#ifdef FIXED_POINT - -#define FREQ_SCALE 16384 - -/*#define ANGLE2X(a) (32768*cos(((a)/8192.)))*/ -#define ANGLE2X(a) (SHL16(spx_cos(a),2)) - -/*#define X2ANGLE(x) (acos(.00006103515625*(x))*LSP_SCALING)*/ -#define X2ANGLE(x) (spx_acos(x)) - -#ifdef BFIN_ASM -#include "lsp_bfin.h" -#endif - -#else - -/*#define C1 0.99940307 -#define C2 -0.49558072 -#define C3 0.03679168*/ - -#define FREQ_SCALE 1. -#define ANGLE2X(a) (spx_cos(a)) -#define X2ANGLE(x) (acos(x)) - -#endif - -#ifndef DISABLE_ENCODER - -/*---------------------------------------------------------------------------*\ - - FUNCTION....: cheb_poly_eva() - - AUTHOR......: David Rowe - DATE CREATED: 24/2/93 - - This function evaluates a series of Chebyshev polynomials - -\*---------------------------------------------------------------------------*/ - -#ifdef FIXED_POINT - -#ifndef OVERRIDE_CHEB_POLY_EVA -static inline spx_word32_t cheb_poly_eva( - spx_word16_t *coef, /* P or Q coefs in Q13 format */ - spx_word16_t x, /* cos of freq (-1.0 to 1.0) in Q14 format */ - int m, /* LPC order/2 */ - char *stack -) -{ - int i; - spx_word16_t b0, b1; - spx_word32_t sum; - - /*Prevents overflows*/ - if (x>16383) - x = 16383; - if (x<-16383) - x = -16383; - - /* Initialise values */ - b1=16384; - b0=x; - - /* Evaluate Chebyshev series formulation usin g iterative approach */ - sum = ADD32(EXTEND32(coef[m]), EXTEND32(MULT16_16_P14(coef[m-1],x))); - for(i=2;i<=m;i++) - { - spx_word16_t tmp=b0; - b0 = SUB16(MULT16_16_Q13(x,b0), b1); - b1 = tmp; - sum = ADD32(sum, EXTEND32(MULT16_16_P14(coef[m-i],b0))); - } - - return sum; -} -#endif - -#else - -static float cheb_poly_eva(spx_word32_t *coef, spx_word16_t x, int m, char *stack) -{ - int k; - float b0, b1, tmp; - - /* Initial conditions */ - b0=0; /* b_(m+1) */ - b1=0; /* b_(m+2) */ - - x*=2; - - /* Calculate the b_(k) */ - for(k=m;k>0;k--) - { - tmp=b0; /* tmp holds the previous value of b0 */ - b0=x*b0-b1+coef[m-k]; /* b0 holds its new value based on b0 and b1 */ - b1=tmp; /* b1 holds the previous value of b0 */ - } - - return(-b1+.5*x*b0+coef[m]); -} -#endif - -/*---------------------------------------------------------------------------*\ - - FUNCTION....: lpc_to_lsp() - - AUTHOR......: David Rowe - DATE CREATED: 24/2/93 - - This function converts LPC coefficients to LSP - coefficients. - -\*---------------------------------------------------------------------------*/ - -#ifdef FIXED_POINT -#define SIGN_CHANGE(a,b) ((((a)^(b))&0x80000000)||(b==0)) -#else -#define SIGN_CHANGE(a,b) (((a)*(b))<0.0) -#endif - - -int lpc_to_lsp (spx_coef_t *a,int lpcrdr,spx_lsp_t *freq,int nb,spx_word16_t delta, char *stack) -/* float *a lpc coefficients */ -/* int lpcrdr order of LPC coefficients (10) */ -/* float *freq LSP frequencies in the x domain */ -/* int nb number of sub-intervals (4) */ -/* float delta grid spacing interval (0.02) */ - - -{ - spx_word16_t temp_xr,xl,xr,xm=0; - spx_word32_t psuml,psumr,psumm,temp_psumr/*,temp_qsumr*/; - int i,j,m,k; - VARDECL(spx_word32_t *Q); /* ptrs for memory allocation */ - VARDECL(spx_word32_t *P); - VARDECL(spx_word16_t *Q16); /* ptrs for memory allocation */ - VARDECL(spx_word16_t *P16); - spx_word32_t *px; /* ptrs of respective P'(z) & Q'(z) */ - spx_word32_t *qx; - spx_word32_t *p; - spx_word32_t *q; - spx_word16_t *pt; /* ptr used for cheb_poly_eval() - whether P' or Q' */ - int roots=0; /* DR 8/2/94: number of roots found */ - m = lpcrdr/2; /* order of P'(z) & Q'(z) polynomials */ - - /* Allocate memory space for polynomials */ - ALLOC(Q, (m+1), spx_word32_t); - ALLOC(P, (m+1), spx_word32_t); - - /* determine P'(z)'s and Q'(z)'s coefficients where - P'(z) = P(z)/(1 + z^(-1)) and Q'(z) = Q(z)/(1-z^(-1)) */ - - px = P; /* initialise ptrs */ - qx = Q; - p = px; - q = qx; - -#ifdef FIXED_POINT - *px++ = LPC_SCALING; - *qx++ = LPC_SCALING; - for(i=0;i=32768) - speex_warning_int("px", *px); - if (fabs(*qx)>=32768) - speex_warning_int("qx", *qx);*/ - *px = PSHR32(*px,2); - *qx = PSHR32(*qx,2); - px++; - qx++; - } - /* The reason for this lies in the way cheb_poly_eva() is implemented for fixed-point */ - P[m] = PSHR32(P[m],3); - Q[m] = PSHR32(Q[m],3); -#else - *px++ = LPC_SCALING; - *qx++ = LPC_SCALING; - for(i=0;i= -FREQ_SCALE){ - spx_word16_t dd; - /* Modified by JMV to provide smaller steps around x=+-1 */ -#ifdef FIXED_POINT - dd = MULT16_16_Q15(delta,SUB16(FREQ_SCALE, MULT16_16_Q14(MULT16_16_Q14(xl,xl),14000))); - if (psuml<512 && psuml>-512) - dd = PSHR16(dd,1); -#else - dd=delta*(1-.9*xl*xl); - if (fabs(psuml)<.2) - dd *= .5; -#endif - xr = SUB16(xl, dd); /* interval spacing */ - psumr = cheb_poly_eva(pt,xr,m,stack);/* poly(xl-delta_x) */ - temp_psumr = psumr; - temp_xr = xr; - - /* if no sign change increment xr and re-evaluate poly(xr). Repeat til - sign change. - if a sign change has occurred the interval is bisected and then - checked again for a sign change which determines in which - interval the zero lies in. - If there is no sign change between poly(xm) and poly(xl) set interval - between xm and xr else set interval between xl and xr and repeat till - root is located within the specified limits */ - - if(SIGN_CHANGE(psumr,psuml)) - { - roots++; - - psumm=psuml; - for(k=0;k<=nb;k++){ -#ifdef FIXED_POINT - xm = ADD16(PSHR16(xl,1),PSHR16(xr,1)); /* bisect the interval */ -#else - xm = .5*(xl+xr); /* bisect the interval */ -#endif - psumm=cheb_poly_eva(pt,xm,m,stack); - /*if(psumm*psuml>0.)*/ - if(!SIGN_CHANGE(psumm,psuml)) - { - psuml=psumm; - xl=xm; - } else { - psumr=psumm; - xr=xm; - } - } - - /* once zero is found, reset initial interval to xr */ - freq[j] = X2ANGLE(xm); - xl = xm; - break; - } - else{ - psuml=temp_psumr; - xl=temp_xr; - } - } - } - return(roots); -} - -#endif /* DISABLE_ENCODER */ -/*---------------------------------------------------------------------------*\ - - FUNCTION....: lsp_to_lpc() - - AUTHOR......: David Rowe - DATE CREATED: 24/2/93 - - Converts LSP coefficients to LPC coefficients. - -\*---------------------------------------------------------------------------*/ - -#ifdef FIXED_POINT - -void lsp_to_lpc(const spx_lsp_t *freq,spx_coef_t *ak,int lpcrdr, char *stack) -/* float *freq array of LSP frequencies in the x domain */ -/* float *ak array of LPC coefficients */ -/* int lpcrdr order of LPC coefficients */ -{ - int i,j; - spx_word32_t xout1,xout2,xin; - spx_word32_t mult, a; - VARDECL(spx_word16_t *freqn); - VARDECL(spx_word32_t **xp); - VARDECL(spx_word32_t *xpmem); - VARDECL(spx_word32_t **xq); - VARDECL(spx_word32_t *xqmem); - int m = lpcrdr>>1; - - /* - - Reconstruct P(z) and Q(z) by cascading second order polynomials - in form 1 - 2cos(w)z(-1) + z(-2), where w is the LSP frequency. - In the time domain this is: - - y(n) = x(n) - 2cos(w)x(n-1) + x(n-2) - - This is what the ALLOCS below are trying to do: - - int xp[m+1][lpcrdr+1+2]; // P matrix in QIMP - int xq[m+1][lpcrdr+1+2]; // Q matrix in QIMP - - These matrices store the output of each stage on each row. The - final (m-th) row has the output of the final (m-th) cascaded - 2nd order filter. The first row is the impulse input to the - system (not written as it is known). - - The version below takes advantage of the fact that a lot of the - outputs are zero or known, for example if we put an inpulse - into the first section the "clock" it 10 times only the first 3 - outputs samples are non-zero (it's an FIR filter). - */ - - ALLOC(xp, (m+1), spx_word32_t*); - ALLOC(xpmem, (m+1)*(lpcrdr+1+2), spx_word32_t); - - ALLOC(xq, (m+1), spx_word32_t*); - ALLOC(xqmem, (m+1)*(lpcrdr+1+2), spx_word32_t); - - for(i=0; i<=m; i++) { - xp[i] = xpmem + i*(lpcrdr+1+2); - xq[i] = xqmem + i*(lpcrdr+1+2); - } - - /* work out 2cos terms in Q14 */ - - ALLOC(freqn, lpcrdr, spx_word16_t); - for (i=0;i 32767) a = 32767; - ak[j-1] = (short)a; - - } - -} - -#else - -void lsp_to_lpc(const spx_lsp_t *freq,spx_coef_t *ak,int lpcrdr, char *stack) -/* float *freq array of LSP frequencies in the x domain */ -/* float *ak array of LPC coefficients */ -/* int lpcrdr order of LPC coefficients */ - - -{ - int i,j; - float xout1,xout2,xin1,xin2; - VARDECL(float *Wp); - float *pw,*n1,*n2,*n3,*n4=NULL; - VARDECL(float *x_freq); - int m = lpcrdr>>1; - - ALLOC(Wp, 4*m+2, float); - pw = Wp; - - /* initialise contents of array */ - - for(i=0;i<=4*m+1;i++){ /* set contents of buffer to 0 */ - *pw++ = 0.0; - } - - /* Set pointers up */ - - pw = Wp; - xin1 = 1.0; - xin2 = 1.0; - - ALLOC(x_freq, lpcrdr, float); - for (i=0;i0) - ak[j-1] = (xout1 + xout2)*0.5f; - *(n4+1) = xin1; - *(n4+2) = xin2; - - xin1 = 0.0; - xin2 = 0.0; - } - -} -#endif - - -#ifdef FIXED_POINT - - -void lsp_interpolate(spx_lsp_t *old_lsp, spx_lsp_t *new_lsp, spx_lsp_t *lsp, int len, int subframe, int nb_subframes, spx_word16_t margin) -{ - int i; - spx_word16_t m = margin; - spx_word16_t m2 = 25736-margin; - spx_word16_t tmp = DIV32_16(SHL32(EXTEND32(1 + subframe),14),nb_subframes); - spx_word16_t tmp2 = 16384-tmp; - for (i=0;im2) - lsp[len-1]=m2; - for (i=1;ilsp[i+1]-m) - lsp[i]= SHR16(lsp[i],1) + SHR16(lsp[i+1]-m,1); - } -} - -#else - - -void lsp_interpolate(spx_lsp_t *old_lsp, spx_lsp_t *new_lsp, spx_lsp_t *lsp, int len, int subframe, int nb_subframes, spx_word16_t margin) -{ - int i; - float tmp = (1.0f + subframe)/nb_subframes; - for (i=0;iLSP_SCALING*(M_PI-margin)) - lsp[len-1]=LSP_SCALING*(M_PI-margin); - for (i=1;ilsp[i+1]-LSP_SCALING*margin) - lsp[i]= .5f* (lsp[i] + lsp[i+1]-LSP_SCALING*margin); - } -} - -#endif diff --git a/Engine/lib/speex/libspeex/lsp.h b/Engine/lib/speex/libspeex/lsp.h deleted file mode 100644 index 6560f85c3..000000000 --- a/Engine/lib/speex/libspeex/lsp.h +++ /dev/null @@ -1,62 +0,0 @@ -/*---------------------------------------------------------------------------*\ -Original Copyright - FILE........: AK2LSPD.H - TYPE........: Turbo C header file - COMPANY.....: Voicetronix - AUTHOR......: James Whitehall - DATE CREATED: 21/11/95 - -Modified by Jean-Marc Valin - - This file contains functions for converting Linear Prediction - Coefficients (LPC) to Line Spectral Pair (LSP) and back. Note that the - LSP coefficients are not in radians format but in the x domain of the - unit circle. - -\*---------------------------------------------------------------------------*/ -/** - @file lsp.h - @brief Line Spectral Pair (LSP) functions. -*/ -/* Speex License: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef __AK2LSPD__ -#define __AK2LSPD__ - -#include "arch.h" - -int lpc_to_lsp (spx_coef_t *a, int lpcrdr, spx_lsp_t *freq, int nb, spx_word16_t delta, char *stack); -void lsp_to_lpc(const spx_lsp_t *freq, spx_coef_t *ak, int lpcrdr, char *stack); - -/*Added by JMV*/ -void lsp_interpolate(spx_lsp_t *old_lsp, spx_lsp_t *new_lsp, spx_lsp_t *interp_lsp, int len, int subframe, int nb_subframes, spx_word16_t margin); - -#endif /* __AK2LSPD__ */ diff --git a/Engine/lib/speex/libspeex/lsp_bfin.h b/Engine/lib/speex/libspeex/lsp_bfin.h deleted file mode 100644 index 530367c13..000000000 --- a/Engine/lib/speex/libspeex/lsp_bfin.h +++ /dev/null @@ -1,89 +0,0 @@ -/* Copyright (C) 2006 David Rowe */ -/** - @file lsp_bfin.h - @author David Rowe - @brief LSP routines optimised for the Blackfin -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#define OVERRIDE_CHEB_POLY_EVA -#ifdef OVERRIDE_CHEB_POLY_EVA -static inline spx_word32_t cheb_poly_eva( - spx_word16_t *coef, /* P or Q coefs in Q13 format */ - spx_word16_t x, /* cos of freq (-1.0 to 1.0) in Q14 format */ - int m, /* LPC order/2 */ - char *stack -) -{ - spx_word32_t sum; - - __asm__ __volatile__ - ( - "P0 = %2;\n\t" /* P0: coef[m], coef[m-1],..., coef[0] */ - "R4 = 8192;\n\t" /* R4: rounding constant */ - "R2 = %1;\n\t" /* R2: x */ - - "R5 = -16383;\n\t" - "R2 = MAX(R2,R5);\n\t" - "R5 = 16383;\n\t" - "R2 = MIN(R2,R5);\n\t" - - "R3 = W[P0--] (X);\n\t" /* R3: sum */ - "R5 = W[P0--] (X);\n\t" - "R5 = R5.L * R2.L (IS);\n\t" - "R5 = R5 + R4;\n\t" - "R5 >>>= 14;\n\t" - "R3 = R3 + R5;\n\t" - - "R0 = R2;\n\t" /* R0: b0 */ - "R1 = 16384;\n\t" /* R1: b1 */ - "LOOP cpe%= LC0 = %3;\n\t" - "LOOP_BEGIN cpe%=;\n\t" - "P1 = R0;\n\t" - "R0 = R2.L * R0.L (IS) || R5 = W[P0--] (X);\n\t" - "R0 >>>= 13;\n\t" - "R0 = R0 - R1;\n\t" - "R1 = P1;\n\t" - "R5 = R5.L * R0.L (IS);\n\t" - "R5 = R5 + R4;\n\t" - "R5 >>>= 14;\n\t" - "R3 = R3 + R5;\n\t" - "LOOP_END cpe%=;\n\t" - "%0 = R3;\n\t" - : "=&d" (sum) - : "a" (x), "a" (&coef[m]), "a" (m-1) - : "R0", "R1", "R3", "R2", "R4", "R5", "P0", "P1", "ASTAT" BFIN_HWLOOP0_REGS - ); - return sum; -} -#endif - - - diff --git a/Engine/lib/speex/libspeex/lsp_tables_nb.c b/Engine/lib/speex/libspeex/lsp_tables_nb.c deleted file mode 100644 index 8015b9ac9..000000000 --- a/Engine/lib/speex/libspeex/lsp_tables_nb.c +++ /dev/null @@ -1,360 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: lsp_tables_nb.c - Codebooks for LSPs in narrowband CELP mode - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -const signed char cdbk_nb[640]={ -30,19,38,34,40,32,46,43,58,43, -5,-18,-25,-40,-33,-55,-52,20,34,28, --20,-63,-97,-92,61,53,47,49,53,75, --14,-53,-77,-79,0,-3,-5,19,22,26, --9,-53,-55,66,90,72,85,68,74,52, --4,-41,-58,-31,-18,-31,27,32,30,18, -24,3,8,5,-12,-3,26,28,74,63, --2,-39,-67,-77,-106,-74,59,59,73,65, -44,40,71,72,82,83,98,88,89,60, --6,-31,-47,-48,-13,-39,-9,7,2,79, --1,-39,-60,-17,87,81,65,50,45,19, --21,-67,-91,-87,-41,-50,7,18,39,74, -10,-31,-28,39,24,13,23,5,56,45, -29,10,-5,-13,-11,-35,-18,-8,-10,-8, --25,-71,-77,-21,2,16,50,63,87,87, -5,-32,-40,-51,-68,0,12,6,54,34, -5,-12,32,52,68,64,69,59,65,45, -14,-16,-31,-40,-65,-67,41,49,47,37, --11,-52,-75,-84,-4,57,48,42,42,33, --11,-51,-68,-6,13,0,8,-8,26,32, --23,-53,0,36,56,76,97,105,111,97, --1,-28,-39,-40,-43,-54,-44,-40,-18,35, -16,-20,-19,-28,-42,29,47,38,74,45, -3,-29,-48,-62,-80,-104,-33,56,59,59, -10,17,46,72,84,101,117,123,123,106, --7,-33,-49,-51,-70,-67,-27,-31,70,67, --16,-62,-85,-20,82,71,86,80,85,74, --19,-58,-75,-45,-29,-33,-18,-25,45,57, --12,-42,-5,12,28,36,52,64,81,82, -13,-9,-27,-28,22,3,2,22,26,6, --6,-44,-51,2,15,10,48,43,49,34, --19,-62,-84,-89,-102,-24,8,17,61,68, -39,24,23,19,16,-5,12,15,27,15, --8,-44,-49,-60,-18,-32,-28,52,54,62, --8,-48,-77,-70,66,101,83,63,61,37, --12,-50,-75,-64,33,17,13,25,15,77, -1,-42,-29,72,64,46,49,31,61,44, --8,-47,-54,-46,-30,19,20,-1,-16,0, -16,-12,-18,-9,-26,-27,-10,-22,53,45, --10,-47,-75,-82,-105,-109,8,25,49,77, -50,65,114,117,124,118,115,96,90,61, --9,-45,-63,-60,-75,-57,8,11,20,29, -0,-35,-49,-43,40,47,35,40,55,38, --24,-76,-103,-112,-27,3,23,34,52,75, -8,-29,-43,12,63,38,35,29,24,8, -25,11,1,-15,-18,-43,-7,37,40,21, --20,-56,-19,-19,-4,-2,11,29,51,63, --2,-44,-62,-75,-89,30,57,51,74,51, -50,46,68,64,65,52,63,55,65,43, -18,-9,-26,-35,-55,-69,3,6,8,17, --15,-61,-86,-97,1,86,93,74,78,67, --1,-38,-66,-48,48,39,29,25,17,-1, -13,13,29,39,50,51,69,82,97,98, --2,-36,-46,-27,-16,-30,-13,-4,-7,-4, -25,-5,-11,-6,-25,-21,33,12,31,29, --8,-38,-52,-63,-68,-89,-33,-1,10,74, --2,-15,59,91,105,105,101,87,84,62, --7,-33,-50,-35,-54,-47,25,17,82,81, --13,-56,-83,21,58,31,42,25,72,65, --24,-66,-91,-56,9,-2,21,10,69,75, -2,-24,11,22,25,28,38,34,48,33, -7,-29,-26,17,15,-1,14,0,-2,0, --6,-41,-67,6,-2,-9,19,2,85,74, --22,-67,-84,-71,-50,3,11,-9,2,62}; - -const signed char cdbk_nb_low1[320]={ --34,-52,-15,45,2, -23,21,52,24,-33, --9,-1,9,-44,-41, --13,-17,44,22,-17, --6,-4,-1,22,38, -26,16,2,50,27, --35,-34,-9,-41,6, -0,-16,-34,51,8, --14,-31,-49,15,-33, -45,49,33,-11,-37, --62,-54,45,11,-5, --72,11,-1,-12,-11, -24,27,-11,-43,46, -43,33,-12,-9,-1, -1,-4,-23,-57,-71, -11,8,16,17,-8, --20,-31,-41,53,48, --16,3,65,-24,-8, --23,-32,-37,-32,-49, --10,-17,6,38,5, --9,-17,-46,8,52, -3,6,45,40,39, --7,-6,-34,-74,31, -8,1,-16,43,68, --11,-19,-31,4,6, -0,-6,-17,-16,-38, --16,-30,2,9,-39, --16,-1,43,-10,48, -3,3,-16,-31,-3, -62,68,43,13,3, --10,8,20,-56,12, -12,-2,-18,22,-15, --40,-36,1,7,41, -0,1,46,-6,-62, --4,-12,-2,-11,-83, --13,-2,91,33,-10, -0,4,-11,-16,79, -32,37,14,9,51, --21,-28,-56,-34,0, -21,9,-26,11,28, --42,-54,-23,-2,-15, -31,30,8,-39,-66, --39,-36,31,-28,-40, --46,35,40,22,24, -33,48,23,-34,14, -40,32,17,27,-3, -25,26,-13,-61,-17, -11,4,31,60,-6, --26,-41,-64,13,16, --26,54,31,-11,-23, --9,-11,-34,-71,-21, --34,-35,55,50,29, --22,-27,-50,-38,57, -33,42,57,48,26, -11,0,-49,-31,26, --4,-14,5,78,37, -17,0,-49,-12,-23, -26,14,2,2,-43, --17,-12,10,-8,-4, -8,18,12,-6,20, --12,-6,-13,-25,34, -15,40,49,7,8, -13,20,20,-19,-22, --2,-8,2,51,-51}; - -const signed char cdbk_nb_low2[320]={ --6,53,-21,-24,4, -26,17,-4,-37,25, -17,-36,-13,31,3, --6,27,15,-10,31, -28,26,-10,-10,-40, -16,-7,15,13,41, --9,0,-4,50,-6, --7,14,38,22,0, --48,2,1,-13,-19, -32,-3,-60,11,-17, --1,-24,-34,-1,35, --5,-27,28,44,13, -25,15,42,-11,15, -51,35,-36,20,8, --4,-12,-29,19,-47, -49,-15,-4,16,-29, --39,14,-30,4,25, --9,-5,-51,-14,-3, --40,-32,38,5,-9, --8,-4,-1,-22,71, --3,14,26,-18,-22, -24,-41,-25,-24,6, -23,19,-10,39,-26, --27,65,45,2,-7, --26,-8,22,-12,16, -15,16,-35,-5,33, --21,-8,0,23,33, -34,6,21,36,6, --7,-22,8,-37,-14, -31,38,11,-4,-3, --39,-32,-8,32,-23, --6,-12,16,20,-28, --4,23,13,-52,-1, -22,6,-33,-40,-6, -4,-62,13,5,-26, -35,39,11,2,57, --11,9,-20,-28,-33, -52,-5,-6,-2,22, --14,-16,-48,35,1, --58,20,13,33,-1, --74,56,-18,-22,-31, -12,6,-14,4,-2, --9,-47,10,-3,29, --17,-5,61,14,47, --12,2,72,-39,-17, -92,64,-53,-51,-15, --30,-38,-41,-29,-28, -27,9,36,9,-35, --42,81,-21,20,25, --16,-5,-17,-35,21, -15,-28,48,2,-2, -9,-19,29,-40,30, --18,-18,18,-16,-57, -15,-20,-12,-15,-37, --15,33,-39,21,-22, --13,35,11,13,-38, --63,29,23,-27,32, -18,3,-26,42,33, --64,-66,-17,16,56, -2,36,3,31,21, --41,-39,8,-57,14, -37,-2,19,-36,-19, --23,-29,-16,1,-3, --8,-10,31,64,-65}; - -const signed char cdbk_nb_high1[320]={ --26,-8,29,21,4, -19,-39,33,-7,-36, -56,54,48,40,29, --4,-24,-42,-66,-43, --60,19,-2,37,41, --10,-37,-60,-64,18, --22,77,73,40,25, -4,19,-19,-66,-2, -11,5,21,14,26, --25,-86,-4,18,1, -26,-37,10,37,-1, -24,-12,-59,-11,20, --6,34,-16,-16,42, -19,-28,-51,53,32, -4,10,62,21,-12, --34,27,4,-48,-48, --50,-49,31,-7,-21, --42,-25,-4,-43,-22, -59,2,27,12,-9, --6,-16,-8,-32,-58, --16,-29,-5,41,23, --30,-33,-46,-13,-10, --38,52,52,1,-17, --9,10,26,-25,-6, -33,-20,53,55,25, --32,-5,-42,23,21, -66,5,-28,20,9, -75,29,-7,-42,-39, -15,3,-23,21,6, -11,1,-29,14,63, -10,54,26,-24,-51, --49,7,-23,-51,15, --66,1,60,25,10, -0,-30,-4,-15,17, -19,59,40,4,-5, -33,6,-22,-58,-70, --5,23,-6,60,44, --29,-16,-47,-29,52, --19,50,28,16,35, -31,36,0,-21,6, -21,27,22,42,7, --66,-40,-8,7,19, -46,0,-4,60,36, -45,-7,-29,-6,-32, --39,2,6,-9,33, -20,-51,-34,18,-6, -19,6,11,5,-19, --29,-2,42,-11,-45, --21,-55,57,37,2, --14,-67,-16,-27,-38, -69,48,19,2,-17, -20,-20,-16,-34,-17, --25,-61,10,73,45, -16,-40,-64,-17,-29, --22,56,17,-39,8, --11,8,-25,-18,-13, --19,8,54,57,36, --17,-26,-4,6,-21, -40,42,-4,20,31, -53,10,-34,-53,31, --17,35,0,15,-6, --20,-63,-73,22,25, -29,17,8,-29,-39, --69,18,15,-15,-5}; - -const signed char cdbk_nb_high2[320]={ -11,47,16,-9,-46, --32,26,-64,34,-5, -38,-7,47,20,2, --73,-99,-3,-45,20, -70,-52,15,-6,-7, --82,31,21,47,51, -39,-3,9,0,-41, --7,-15,-54,2,0, -27,-31,9,-45,-22, --38,-24,-24,8,-33, -23,5,50,-36,-17, --18,-51,-2,13,19, -43,12,-15,-12,61, -38,38,7,13,0, -6,-1,3,62,9, -27,22,-33,38,-35, --9,30,-43,-9,-32, --1,4,-4,1,-5, --11,-8,38,31,11, --10,-42,-21,-37,1, -43,15,-13,-35,-19, --18,15,23,-26,59, -1,-21,53,8,-41, --50,-14,-28,4,21, -25,-28,-40,5,-40, --41,4,51,-33,-8, --8,1,17,-60,12, -25,-41,17,34,43, -19,45,7,-37,24, --15,56,-2,35,-10, -48,4,-47,-2,5, --5,-54,5,-3,-33, --10,30,-2,-44,-24, --38,9,-9,42,4, -6,-56,44,-16,9, --40,-26,18,-20,10, -28,-41,-21,-4,13, --18,32,-30,-3,37, -15,22,28,50,-40, -3,-29,-64,7,51, --19,-11,17,-27,-40, --64,24,-12,-7,-27, -3,37,48,-1,2, --9,-38,-34,46,1, -27,-6,19,-13,26, -10,34,20,25,40, -50,-6,-7,30,9, --24,0,-23,71,-61, -22,58,-34,-4,2, --49,-33,25,30,-8, --6,-16,77,2,38, --8,-35,-6,-30,56, -78,31,33,-20,13, --39,20,22,4,21, --8,4,-6,10,-83, --41,9,-25,-43,15, --7,-12,-34,-39,-37, --33,19,30,16,-33, -42,-25,25,-68,44, --15,-11,-4,23,50, -14,4,-39,-43,20, --30,60,9,-20,7, -16,19,-33,37,29, -16,-35,7,38,-27}; diff --git a/Engine/lib/speex/libspeex/ltp.c b/Engine/lib/speex/libspeex/ltp.c deleted file mode 100644 index 347a9db74..000000000 --- a/Engine/lib/speex/libspeex/ltp.c +++ /dev/null @@ -1,850 +0,0 @@ -/* Copyright (C) 2002-2006 Jean-Marc Valin - File: ltp.c - Long-Term Prediction functions - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include "ltp.h" -#include "stack_alloc.h" -#include "filters.h" -#include "math_approx.h" -#include "os_support.h" - -#ifndef NULL -#define NULL 0 -#endif - - -#ifdef _USE_SSE -#include "ltp_sse.h" -#elif defined (ARM4_ASM) || defined(ARM5E_ASM) -#include "ltp_arm4.h" -#elif defined (BFIN_ASM) -#include "ltp_bfin.h" -#endif - -#ifndef OVERRIDE_INNER_PROD -spx_word32_t inner_prod(const spx_word16_t *x, const spx_word16_t *y, int len) -{ - spx_word32_t sum=0; - len >>= 2; - while(len--) - { - spx_word32_t part=0; - part = MAC16_16(part,*x++,*y++); - part = MAC16_16(part,*x++,*y++); - part = MAC16_16(part,*x++,*y++); - part = MAC16_16(part,*x++,*y++); - /* HINT: If you had a 40-bit accumulator, you could shift only at the end */ - sum = ADD32(sum,SHR32(part,6)); - } - return sum; -} -#endif - -#ifndef DISABLE_ENCODER - -#ifndef OVERRIDE_PITCH_XCORR -#if 0 /* HINT: Enable this for machines with enough registers (i.e. not x86) */ -static void pitch_xcorr(const spx_word16_t *_x, const spx_word16_t *_y, spx_word32_t *corr, int len, int nb_pitch, char *stack) -{ - int i,j; - for (i=0;i16383) - { - scaledown=1; - break; - } - } - /* If the weighted input is close to saturation, then we scale it down */ - if (scaledown) - { - for (i=-end;iMULT16_16(best_score[N-1],ADD16(1,ener16[i-start]))) - { - /* We can safely put it last and then check */ - best_score[N-1]=tmp; - best_ener[N-1]=ener16[i-start]+1; - pitch[N-1]=i; - /* Check if it comes in front of others */ - for (j=0;jMULT16_16(best_score[j],ADD16(1,ener16[i-start]))) - { - for (k=N-1;k>j;k--) - { - best_score[k]=best_score[k-1]; - best_ener[k]=best_ener[k-1]; - pitch[k]=pitch[k-1]; - } - best_score[j]=tmp; - best_ener[j]=ener16[i-start]+1; - pitch[j]=i; - break; - } - } - } - } - - /* Compute open-loop gain if necessary */ - if (gain) - { - for (j=0;jbest_sum && gain_sum<=max_gain) { - best_sum=sum; - best_cdbk=i; - } - } - - return best_cdbk; -} -#endif - -/** Finds the best quantized 3-tap pitch predictor by analysis by synthesis */ -static spx_word32_t pitch_gain_search_3tap( -const spx_word16_t target[], /* Target vector */ -const spx_coef_t ak[], /* LPCs for this subframe */ -const spx_coef_t awk1[], /* Weighted LPCs #1 for this subframe */ -const spx_coef_t awk2[], /* Weighted LPCs #2 for this subframe */ -spx_sig_t exc[], /* Excitation */ -const signed char *gain_cdbk, -int gain_cdbk_size, -int pitch, /* Pitch value */ -int p, /* Number of LPC coeffs */ -int nsf, /* Number of samples in subframe */ -SpeexBits *bits, -char *stack, -const spx_word16_t *exc2, -const spx_word16_t *r, -spx_word16_t *new_target, -int *cdbk_index, -int plc_tuning, -spx_word32_t cumul_gain, -int scaledown -) -{ - int i,j; - VARDECL(spx_word16_t *tmp1); - VARDECL(spx_word16_t *e); - spx_word16_t *x[3]; - spx_word32_t corr[3]; - spx_word32_t A[3][3]; - spx_word16_t gain[3]; - spx_word32_t err; - spx_word16_t max_gain=128; - int best_cdbk=0; - - ALLOC(tmp1, 3*nsf, spx_word16_t); - ALLOC(e, nsf, spx_word16_t); - - if (cumul_gain > 262144) - max_gain = 31; - - x[0]=tmp1; - x[1]=tmp1+nsf; - x[2]=tmp1+2*nsf; - - for (j=0;j0) - bound = pp; - for (j=0;j0) - bound = pp+pitch; - for (;j=0;i--) - { - spx_word16_t e0=exc2[-pitch-1+i]; -#ifdef FIXED_POINT - /* Scale excitation down if needed (avoiding overflow) */ - if (scaledown) - e0 = SHR16(e0,1); -#endif - x[i][0]=MULT16_16_Q14(r[0], e0); - for (j=0;j30) - plc_tuning=30; -#ifdef FIXED_POINT - C[0] = SHL32(C[0],1); - C[1] = SHL32(C[1],1); - C[2] = SHL32(C[2],1); - C[3] = SHL32(C[3],1); - C[4] = SHL32(C[4],1); - C[5] = SHL32(C[5],1); - C[6] = MAC16_32_Q15(C[6],MULT16_16_16(plc_tuning,655),C[6]); - C[7] = MAC16_32_Q15(C[7],MULT16_16_16(plc_tuning,655),C[7]); - C[8] = MAC16_32_Q15(C[8],MULT16_16_16(plc_tuning,655),C[8]); - normalize16(C, C16, 32767, 9); -#else - C[6]*=.5*(1+.02*plc_tuning); - C[7]*=.5*(1+.02*plc_tuning); - C[8]*=.5*(1+.02*plc_tuning); -#endif - - best_cdbk = pitch_gain_search_3tap_vq(gain_cdbk, gain_cdbk_size, C16, max_gain); - -#ifdef FIXED_POINT - gain[0] = ADD16(32,(spx_word16_t)gain_cdbk[best_cdbk*4]); - gain[1] = ADD16(32,(spx_word16_t)gain_cdbk[best_cdbk*4+1]); - gain[2] = ADD16(32,(spx_word16_t)gain_cdbk[best_cdbk*4+2]); - /*printf ("%d %d %d %d\n",gain[0],gain[1],gain[2], best_cdbk);*/ -#else - gain[0] = 0.015625*gain_cdbk[best_cdbk*4] + .5; - gain[1] = 0.015625*gain_cdbk[best_cdbk*4+1]+ .5; - gain[2] = 0.015625*gain_cdbk[best_cdbk*4+2]+ .5; -#endif - *cdbk_index=best_cdbk; - } - - SPEEX_MEMSET(exc, 0, nsf); - for (i=0;i<3;i++) - { - int j; - int tmp1, tmp3; - int pp=pitch+1-i; - tmp1=nsf; - if (tmp1>pp) - tmp1=pp; - for (j=0;jpp+pitch) - tmp3=pp+pitch; - for (j=tmp1;jgain_bits; - gain_cdbk = params->gain_cdbk + 4*gain_cdbk_size*cdbk_offset; - - N=complexity; - if (N>10) - N=10; - if (N<1) - N=1; - - ALLOC(nbest, N, int); - params = (const ltp_params*) par; - - if (endpitch_bits); - speex_bits_pack(bits, 0, params->gain_bits); - SPEEX_MEMSET(exc, 0, nsf); - return start; - } - -#ifdef FIXED_POINT - /* Check if we need to scale everything down in the pitch search to avoid overflows */ - for (i=0;i16383) - { - scaledown=1; - break; - } - } - for (i=-end;i<0;i++) - { - if (ABS16(exc2[i])>16383) - { - scaledown=1; - break; - } - } -#endif - if (N>end-start+1) - N=end-start+1; - if (end != start) - open_loop_nbest_pitch(sw, start, end, nsf, nbest, NULL, N, stack); - else - nbest[0] = start; - - ALLOC(best_exc, nsf, spx_sig_t); - ALLOC(new_target, nsf, spx_word16_t); - ALLOC(best_target, nsf, spx_word16_t); - - for (i=0;ipitch_bits); - speex_bits_pack(bits, best_gain_index, params->gain_bits); -#ifdef FIXED_POINT - *cumul_gain = MULT16_32_Q13(SHL16(params->gain_cdbk[4*best_gain_index+3],8), MAX32(1024,*cumul_gain)); -#else - *cumul_gain = 0.03125*MAX32(1024,*cumul_gain)*params->gain_cdbk[4*best_gain_index+3]; -#endif - /*printf ("%f\n", cumul_gain);*/ - /*printf ("encode pitch: %d %d\n", best_pitch, best_gain_index);*/ - SPEEX_COPY(exc, best_exc, nsf); - SPEEX_COPY(target, best_target, nsf); -#ifdef FIXED_POINT - /* Scale target back up if needed */ - if (scaledown) - { - for (i=0;igain_bits; - gain_cdbk = params->gain_cdbk + 4*gain_cdbk_size*cdbk_offset; - - pitch = speex_bits_unpack_unsigned(bits, params->pitch_bits); - pitch += start; - gain_index = speex_bits_unpack_unsigned(bits, params->gain_bits); - /*printf ("decode pitch: %d %d\n", pitch, gain_index);*/ -#ifdef FIXED_POINT - gain[0] = ADD16(32,(spx_word16_t)gain_cdbk[gain_index*4]); - gain[1] = ADD16(32,(spx_word16_t)gain_cdbk[gain_index*4+1]); - gain[2] = ADD16(32,(spx_word16_t)gain_cdbk[gain_index*4+2]); -#else - gain[0] = 0.015625*gain_cdbk[gain_index*4]+.5; - gain[1] = 0.015625*gain_cdbk[gain_index*4+1]+.5; - gain[2] = 0.015625*gain_cdbk[gain_index*4+2]+.5; -#endif - - if (count_lost && pitch > subframe_offset) - { - spx_word16_t gain_sum; - if (1) { -#ifdef FIXED_POINT - spx_word16_t tmp = count_lost < 4 ? last_pitch_gain : SHR16(last_pitch_gain,1); - if (tmp>62) - tmp=62; -#else - spx_word16_t tmp = count_lost < 4 ? last_pitch_gain : 0.5 * last_pitch_gain; - if (tmp>.95) - tmp=.95; -#endif - gain_sum = gain_3tap_to_1tap(gain); - - if (gain_sum > tmp) - { - spx_word16_t fact = DIV32_16(SHL32(EXTEND32(tmp),14),gain_sum); - for (i=0;i<3;i++) - gain[i]=MULT16_16_Q14(fact,gain[i]); - } - - } - - } - - *pitch_val = pitch; - gain_val[0]=gain[0]; - gain_val[1]=gain[1]; - gain_val[2]=gain[2]; - gain[0] = SHL16(gain[0],7); - gain[1] = SHL16(gain[1],7); - gain[2] = SHL16(gain[2],7); - SPEEX_MEMSET(exc_out, 0, nsf); - for (i=0;i<3;i++) - { - int j; - int tmp1, tmp3; - int pp=pitch+1-i; - tmp1=nsf; - if (tmp1>pp) - tmp1=pp; - for (j=0;jpp+pitch) - tmp3=pp+pitch; - for (j=tmp1;j63) - pitch_coef=63; -#else - if (pitch_coef>.99) - pitch_coef=.99; -#endif - for (i=0;i63) - pitch_coef=63; -#else - if (pitch_coef>.99) - pitch_coef=.99; -#endif - for (i=0;i0 ? g[0] : -SHR16(g[0],1)) + (g[2]>0 ? g[2] : -SHR16(g[2],1))) -#else -#define gain_3tap_to_1tap(g) (ABS(g[1]) + (g[0]>0 ? g[0] : -.5*g[0]) + (g[2]>0 ? g[2] : -.5*g[2])) -#endif - -spx_word32_t inner_prod(const spx_word16_t *x, const spx_word16_t *y, int len); - -void open_loop_nbest_pitch(spx_word16_t *sw, int start, int end, int len, int *pitch, spx_word16_t *gain, int N, char *stack); - - -/** Finds the best quantized 3-tap pitch predictor by analysis by synthesis */ -int pitch_search_3tap( -spx_word16_t target[], /* Target vector */ -spx_word16_t *sw, -spx_coef_t ak[], /* LPCs for this subframe */ -spx_coef_t awk1[], /* Weighted LPCs #1 for this subframe */ -spx_coef_t awk2[], /* Weighted LPCs #2 for this subframe */ -spx_sig_t exc[], /* Overlapping codebook */ -const void *par, -int start, /* Smallest pitch value allowed */ -int end, /* Largest pitch value allowed */ -spx_word16_t pitch_coef, /* Voicing (pitch) coefficient */ -int p, /* Number of LPC coeffs */ -int nsf, /* Number of samples in subframe */ -SpeexBits *bits, -char *stack, -spx_word16_t *exc2, -spx_word16_t *r, -int complexity, -int cdbk_offset, -int plc_tuning, -spx_word32_t *cumul_gain -); - -/*Unquantize adaptive codebook and update pitch contribution*/ -void pitch_unquant_3tap( -spx_word16_t exc[], /* Input excitation */ -spx_word32_t exc_out[], /* Output excitation */ -int start, /* Smallest pitch value allowed */ -int end, /* Largest pitch value allowed */ -spx_word16_t pitch_coef, /* Voicing (pitch) coefficient */ -const void *par, -int nsf, /* Number of samples in subframe */ -int *pitch_val, -spx_word16_t *gain_val, -SpeexBits *bits, -char *stack, -int lost, -int subframe_offset, -spx_word16_t last_pitch_gain, -int cdbk_offset -); - -/** Forced pitch delay and gain */ -int forced_pitch_quant( -spx_word16_t target[], /* Target vector */ -spx_word16_t *sw, -spx_coef_t ak[], /* LPCs for this subframe */ -spx_coef_t awk1[], /* Weighted LPCs #1 for this subframe */ -spx_coef_t awk2[], /* Weighted LPCs #2 for this subframe */ -spx_sig_t exc[], /* Excitation */ -const void *par, -int start, /* Smallest pitch value allowed */ -int end, /* Largest pitch value allowed */ -spx_word16_t pitch_coef, /* Voicing (pitch) coefficient */ -int p, /* Number of LPC coeffs */ -int nsf, /* Number of samples in subframe */ -SpeexBits *bits, -char *stack, -spx_word16_t *exc2, -spx_word16_t *r, -int complexity, -int cdbk_offset, -int plc_tuning, -spx_word32_t *cumul_gain -); - -/** Unquantize forced pitch delay and gain */ -void forced_pitch_unquant( -spx_word16_t exc[], /* Input excitation */ -spx_word32_t exc_out[], /* Output excitation */ -int start, /* Smallest pitch value allowed */ -int end, /* Largest pitch value allowed */ -spx_word16_t pitch_coef, /* Voicing (pitch) coefficient */ -const void *par, -int nsf, /* Number of samples in subframe */ -int *pitch_val, -spx_word16_t *gain_val, -SpeexBits *bits, -char *stack, -int lost, -int subframe_offset, -spx_word16_t last_pitch_gain, -int cdbk_offset -); - -#endif /* LTP_H */ diff --git a/Engine/lib/speex/libspeex/ltp_arm4.h b/Engine/lib/speex/libspeex/ltp_arm4.h deleted file mode 100644 index cdb94e603..000000000 --- a/Engine/lib/speex/libspeex/ltp_arm4.h +++ /dev/null @@ -1,187 +0,0 @@ -/* Copyright (C) 2004 Jean-Marc Valin */ -/** - @file ltp_arm4.h - @brief Long-Term Prediction functions (ARM4 version) -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#define OVERRIDE_INNER_PROD -spx_word32_t inner_prod(const spx_word16_t *x, const spx_word16_t *y, int len) -{ - spx_word32_t sum1=0,sum2=0; - spx_word16_t *deadx, *deady; - int deadlen, dead1, dead2, dead3, dead4, dead5, dead6; - __asm__ __volatile__ ( - "\tldrsh %5, [%0], #2 \n" - "\tldrsh %6, [%1], #2 \n" - ".inner_prod_loop%=:\n" - "\tsub %7, %7, %7\n" - "\tsub %10, %10, %10\n" - - "\tldrsh %8, [%0], #2 \n" - "\tldrsh %9, [%1], #2 \n" - "\tmla %7, %5, %6, %7\n" - "\tldrsh %5, [%0], #2 \n" - "\tldrsh %6, [%1], #2 \n" - "\tmla %10, %8, %9, %10\n" - "\tldrsh %8, [%0], #2 \n" - "\tldrsh %9, [%1], #2 \n" - "\tmla %7, %5, %6, %7\n" - "\tldrsh %5, [%0], #2 \n" - "\tldrsh %6, [%1], #2 \n" - "\tmla %10, %8, %9, %10\n" - - "\tldrsh %8, [%0], #2 \n" - "\tldrsh %9, [%1], #2 \n" - "\tmla %7, %5, %6, %7\n" - "\tldrsh %5, [%0], #2 \n" - "\tldrsh %6, [%1], #2 \n" - "\tmla %10, %8, %9, %10\n" - "\tldrsh %8, [%0], #2 \n" - "\tldrsh %9, [%1], #2 \n" - "\tmla %7, %5, %6, %7\n" - "\tldrsh %5, [%0], #2 \n" - "\tldrsh %6, [%1], #2 \n" - "\tmla %10, %8, %9, %10\n" - - "\tsubs %4, %4, #1\n" - "\tadd %2, %2, %7, asr #5\n" - "\tadd %3, %3, %10, asr #5\n" - "\tbne .inner_prod_loop%=\n" - : "=r" (deadx), "=r" (deady), "+r" (sum1), "+r" (sum2), - "=r" (deadlen), "=r" (dead1), "=r" (dead2), "=r" (dead3), - "=r" (dead4), "=r" (dead5), "=r" (dead6) - : "0" (x), "1" (y), "4" (len>>3) - : "cc" - ); - return (sum1+sum2)>>1; -} - -#define OVERRIDE_PITCH_XCORR -void pitch_xcorr(const spx_word16_t *_x, const spx_word16_t *_y, spx_word32_t *corr, int len, int nb_pitch, char *stack) -{ - int i,j; - for (i=0;i>> 6;\n\t" - "R0 = A0;\n\t" - "%0 = R0;\n\t" - : "=m" (sum) - : "m" (x), "m" (y), "d" (len-1) - : "P0", "P1", "P2", "R0", "R1", "A0", "I0", "I1", "L0", "L1", "R3", "ASTAT" BFIN_HWLOOP0_REGS - ); - return sum; -} - -#define OVERRIDE_PITCH_XCORR -void pitch_xcorr(const spx_word16_t *_x, const spx_word16_t *_y, spx_word32_t *corr, int len, int nb_pitch, char *stack) -{ - corr += nb_pitch - 1; - __asm__ __volatile__ ( - "P2 = %0;\n\t" - "I0 = P2;\n\t" /* x in I0 */ - "B0 = P2;\n\t" /* x in B0 */ - "R0 = %3;\n\t" /* len in R0 */ - "P3 = %3;\n\t" - "P3 += -2;\n\t" /* len in R0 */ - "P4 = %4;\n\t" /* nb_pitch in R0 */ - "R1 = R0 << 1;\n\t" /* number of bytes in x */ - "L0 = R1;\n\t" - "P0 = %1;\n\t" - - "P1 = %2;\n\t" - "B1 = P1;\n\t" - "L1 = 0;\n\t" /*Disable looping on I1*/ - - "r0 = [I0++];\n\t" - "LOOP pitch%= LC0 = P4 >> 1;\n\t" - "LOOP_BEGIN pitch%=;\n\t" - "I1 = P0;\n\t" - "A1 = A0 = 0;\n\t" - "R1 = [I1++];\n\t" - "LOOP inner_prod%= LC1 = P3 >> 1;\n\t" - "LOOP_BEGIN inner_prod%=;\n\t" - "A1 += R0.L*R1.H, A0 += R0.L*R1.L (IS) || R1.L = W[I1++];\n\t" - "A1 += R0.H*R1.L, A0 += R0.H*R1.H (IS) || R1.H = W[I1++] || R0 = [I0++];\n\t" - "LOOP_END inner_prod%=;\n\t" - "A1 += R0.L*R1.H, A0 += R0.L*R1.L (IS) || R1.L = W[I1++];\n\t" - "A1 += R0.H*R1.L, A0 += R0.H*R1.H (IS) || R0 = [I0++];\n\t" - "A0 = A0 >>> 6;\n\t" - "A1 = A1 >>> 6;\n\t" - "R2 = A0, R3 = A1;\n\t" - "[P1--] = r2;\n\t" - "[P1--] = r3;\n\t" - "P0 += 4;\n\t" - "LOOP_END pitch%=;\n\t" - "L0 = 0;\n\t" - : : "m" (_x), "m" (_y), "m" (corr), "m" (len), "m" (nb_pitch) - : "A0", "A1", "P0", "P1", "P2", "P3", "P4", "R0", "R1", "R2", "R3", "I0", "I1", "L0", "L1", "B0", "B1", "memory", - "ASTAT" BFIN_HWLOOP0_REGS BFIN_HWLOOP1_REGS - ); -} - -#define OVERRIDE_COMPUTE_PITCH_ERROR -static inline spx_word32_t compute_pitch_error(spx_word16_t *C, spx_word16_t *g, spx_word16_t pitch_control) -{ - spx_word32_t sum; - __asm__ __volatile__ - ( - "A0 = 0;\n\t" - - "R0 = W[%1++];\n\t" - "R1.L = %2.L*%5.L (IS);\n\t" - "A0 += R1.L*R0.L (IS) || R0 = W[%1++];\n\t" - - "R1.L = %3.L*%5.L (IS);\n\t" - "A0 += R1.L*R0.L (IS) || R0 = W[%1++];\n\t" - - "R1.L = %4.L*%5.L (IS);\n\t" - "A0 += R1.L*R0.L (IS) || R0 = W[%1++];\n\t" - - "R1.L = %2.L*%3.L (IS);\n\t" - "A0 -= R1.L*R0.L (IS) || R0 = W[%1++];\n\t" - - "R1.L = %4.L*%3.L (IS);\n\t" - "A0 -= R1.L*R0.L (IS) || R0 = W[%1++];\n\t" - - "R1.L = %4.L*%2.L (IS);\n\t" - "A0 -= R1.L*R0.L (IS) || R0 = W[%1++];\n\t" - - "R1.L = %2.L*%2.L (IS);\n\t" - "A0 -= R1.L*R0.L (IS) || R0 = W[%1++];\n\t" - - "R1.L = %3.L*%3.L (IS);\n\t" - "A0 -= R1.L*R0.L (IS) || R0 = W[%1++];\n\t" - - "R1.L = %4.L*%4.L (IS);\n\t" - "A0 -= R1.L*R0.L (IS);\n\t" - - "%0 = A0;\n\t" - : "=&D" (sum), "=a" (C) - : "d" (g[0]), "d" (g[1]), "d" (g[2]), "d" (pitch_control), "1" (C) - : "R0", "R1", "R2", "A0", "ASTAT" - ); - return sum; -} - -#define OVERRIDE_OPEN_LOOP_NBEST_PITCH -#ifdef OVERRIDE_OPEN_LOOP_NBEST_PITCH -void open_loop_nbest_pitch(spx_word16_t *sw, int start, int end, int len, int *pitch, spx_word16_t *gain, int N, char *stack) -{ - int i,j,k; - VARDECL(spx_word32_t *best_score); - VARDECL(spx_word32_t *best_ener); - spx_word32_t e0; - VARDECL(spx_word32_t *corr); - VARDECL(spx_word32_t *energy); - - ALLOC(best_score, N, spx_word32_t); - ALLOC(best_ener, N, spx_word32_t); - ALLOC(corr, end-start+1, spx_word32_t); - ALLOC(energy, end-start+2, spx_word32_t); - - for (i=0;i>>= 6;\n\t" -" R1 = R1 + R2;\n\t" -" R0 >>>= 6;\n\t" -" R1 = R1 - R0;\n\t" -" R2 = MAX(R1,R3);\n\t" -"eu2: [P0++] = R2;\n\t" - : : "d" (energy), "d" (&sw[-start-1]), "d" (&sw[-start+len-1]), - "a" (end-start) - : "P0", "I1", "I2", "R0", "R1", "R2", "R3", "ASTAT" BFIN_HWLOOP1_REGS - ); - - pitch_xcorr(sw, sw-end, corr, len, end-start+1, stack); - - /* FIXME: Fixed-point and floating-point code should be merged */ - { - VARDECL(spx_word16_t *corr16); - VARDECL(spx_word16_t *ener16); - ALLOC(corr16, end-start+1, spx_word16_t); - ALLOC(ener16, end-start+1, spx_word16_t); - /* Normalize to 180 so we can square it and it still fits in 16 bits */ - normalize16(corr, corr16, 180, end-start+1); - normalize16(energy, ener16, 180, end-start+1); - - if (N == 1) { - /* optimised asm to handle N==1 case */ - __asm__ __volatile__ - ( -" I0 = %1;\n\t" /* I0: corr16[] */ -" L0 = 0;\n\t" -" I1 = %2;\n\t" /* I1: energy */ -" L1 = 0;\n\t" -" R2 = -1;\n\t" /* R2: best score */ -" R3 = 0;\n\t" /* R3: best energy */ -" P0 = %4;\n\t" /* P0: best pitch */ -" P1 = %4;\n\t" /* P1: counter */ -" LSETUP (sl1, sl2) LC1 = %3;\n\t" -"sl1: R0.L = W [I0++] || R1.L = W [I1++];\n\t" -" R0 = R0.L * R0.L (IS);\n\t" -" R1 += 1;\n\t" -" R4 = R0.L * R3.L;\n\t" -" R5 = R2.L * R1.L;\n\t" -" cc = R5 < R4;\n\t" -" if cc R2 = R0;\n\t" -" if cc R3 = R1;\n\t" -" if cc P0 = P1;\n\t" -"sl2: P1 += 1;\n\t" -" %0 = P0;\n\t" - : "=&d" (pitch[0]) - : "a" (corr16), "a" (ener16), "a" (end+1-start), "d" (start) - : "P0", "P1", "I0", "I1", "R0", "R1", "R2", "R3", "R4", "R5", - "ASTAT", "CC" BFIN_HWLOOP1_REGS - ); - - } - else { - for (i=start;i<=end;i++) - { - spx_word16_t tmp = MULT16_16_16(corr16[i-start],corr16[i-start]); - /* Instead of dividing the tmp by the energy, we multiply on the other side */ - if (MULT16_16(tmp,best_ener[N-1])>MULT16_16(best_score[N-1],ADD16(1,ener16[i-start]))) - { - /* We can safely put it last and then check */ - best_score[N-1]=tmp; - best_ener[N-1]=ener16[i-start]+1; - pitch[N-1]=i; - /* Check if it comes in front of others */ - for (j=0;jMULT16_16(best_score[j],ADD16(1,ener16[i-start]))) - { - for (k=N-1;k>j;k--) - { - best_score[k]=best_score[k-1]; - best_ener[k]=best_ener[k-1]; - pitch[k]=pitch[k-1]; - } - best_score[j]=tmp; - best_ener[j]=ener16[i-start]+1; - pitch[j]=i; - break; - } - } - } - } - } - } - - /* Compute open-loop gain */ - if (gain) - { - for (j=0;jbest_sum && gain_sum<=max_gain) ------ (1) - - if (sum>best_sum && !(gain_sum>max_gain)) ------ (2) - - if (max_gain<=gain_sum) { ------ (3) - sum = -VERY_LARGE32; - } - if (best_sum<=sum) - - The blackin cc instructions are all of the form: - - cc = x < y (or cc = x <= y) -*/ -" R1 = B0\n\t" -" R2 = %5\n\t" -" R3 = %6\n\t" -" cc = R2 <= R1;\n\t" -" if cc R0 = R3;\n\t" -" cc = %0 <= R0;\n\t" -" if cc %0 = R0;\n\t" -" if cc %1 = P1;\n\t" - -"pgs2: P1 += 1;\n\t" - - : "=&d" (best_sum), "=&d" (best_cdbk) - : "a" (gain_cdbk), "a" (C16), "a" (gain_cdbk_size), "a" (max_gain), - "b" (-VERY_LARGE32) - : "R0", "R1", "R2", "R3", "R4", "P0", - "P1", "I1", "L1", "A0", "B0", "CC", "ASTAT" BFIN_HWLOOP1_REGS - ); - - return best_cdbk; -} -#endif - diff --git a/Engine/lib/speex/libspeex/ltp_sse.h b/Engine/lib/speex/libspeex/ltp_sse.h deleted file mode 100644 index bed6eaac9..000000000 --- a/Engine/lib/speex/libspeex/ltp_sse.h +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin */ -/** - @file ltp_sse.h - @brief Long-Term Prediction functions (SSE version) -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include - -#define OVERRIDE_INNER_PROD -float inner_prod(const float *a, const float *b, int len) -{ - int i; - float ret; - __m128 sum = _mm_setzero_ps(); - for (i=0;i<(len>>2);i+=2) - { - sum = _mm_add_ps(sum, _mm_mul_ps(_mm_loadu_ps(a+0), _mm_loadu_ps(b+0))); - sum = _mm_add_ps(sum, _mm_mul_ps(_mm_loadu_ps(a+4), _mm_loadu_ps(b+4))); - a += 8; - b += 8; - } - sum = _mm_add_ps(sum, _mm_movehl_ps(sum, sum)); - sum = _mm_add_ss(sum, _mm_shuffle_ps(sum, sum, 0x55)); - _mm_store_ss(&ret, sum); - return ret; -} - -#define OVERRIDE_PITCH_XCORR -void pitch_xcorr(const float *_x, const float *_y, float *corr, int len, int nb_pitch, char *stack) -{ - int i, offset; - VARDECL(__m128 *x); - VARDECL(__m128 *y); - int N, L; - N = len>>2; - L = nb_pitch>>2; - ALLOC(x, N, __m128); - ALLOC(y, N+L, __m128); - for (i=0;i=(spx_int32_t)65536) - { - x >>= 16; - r += 16; - } - if (x>=256) - { - x >>= 8; - r += 8; - } - if (x>=16) - { - x >>= 4; - r += 4; - } - if (x>=4) - { - x >>= 2; - r += 2; - } - if (x>=2) - { - r += 1; - } - return r; -} - -static inline spx_int16_t spx_ilog4(spx_uint32_t x) -{ - int r=0; - if (x>=(spx_int32_t)65536) - { - x >>= 16; - r += 8; - } - if (x>=256) - { - x >>= 8; - r += 4; - } - if (x>=16) - { - x >>= 4; - r += 2; - } - if (x>=4) - { - r += 1; - } - return r; -} - -#ifdef FIXED_POINT - -/** Generate a pseudo-random number */ -static inline spx_word16_t speex_rand(spx_word16_t std, spx_int32_t *seed) -{ - spx_word32_t res; - *seed = 1664525 * *seed + 1013904223; - res = MULT16_16(EXTRACT16(SHR32(*seed,16)),std); - return EXTRACT16(PSHR32(SUB32(res, SHR32(res, 3)),14)); -} - -/* sqrt(x) ~= 0.22178 + 1.29227*x - 0.77070*x^2 + 0.25723*x^3 (for .25 < x < 1) */ -/*#define C0 3634 -#define C1 21173 -#define C2 -12627 -#define C3 4215*/ - -/* sqrt(x) ~= 0.22178 + 1.29227*x - 0.77070*x^2 + 0.25659*x^3 (for .25 < x < 1) */ -#define C0 3634 -#define C1 21173 -#define C2 -12627 -#define C3 4204 - -static inline spx_word16_t spx_sqrt(spx_word32_t x) -{ - int k; - spx_word32_t rt; - k = spx_ilog4(x)-6; - x = VSHR32(x, (k<<1)); - rt = ADD16(C0, MULT16_16_Q14(x, ADD16(C1, MULT16_16_Q14(x, ADD16(C2, MULT16_16_Q14(x, (C3))))))); - rt = VSHR32(rt,7-k); - return rt; -} - -/* log(x) ~= -2.18151 + 4.20592*x - 2.88938*x^2 + 0.86535*x^3 (for .5 < x < 1) */ - - -#define A1 16469 -#define A2 2242 -#define A3 1486 - -static inline spx_word16_t spx_acos(spx_word16_t x) -{ - int s=0; - spx_word16_t ret; - spx_word16_t sq; - if (x<0) - { - s=1; - x = NEG16(x); - } - x = SUB16(16384,x); - - x = x >> 1; - sq = MULT16_16_Q13(x, ADD16(A1, MULT16_16_Q13(x, ADD16(A2, MULT16_16_Q13(x, (A3)))))); - ret = spx_sqrt(SHL32(EXTEND32(sq),13)); - - /*ret = spx_sqrt(67108864*(-1.6129e-04 + 2.0104e+00*f + 2.7373e-01*f*f + 1.8136e-01*f*f*f));*/ - if (s) - ret = SUB16(25736,ret); - return ret; -} - - -#define K1 8192 -#define K2 -4096 -#define K3 340 -#define K4 -10 - -static inline spx_word16_t spx_cos(spx_word16_t x) -{ - spx_word16_t x2; - - if (x<12868) - { - x2 = MULT16_16_P13(x,x); - return ADD32(K1, MULT16_16_P13(x2, ADD32(K2, MULT16_16_P13(x2, ADD32(K3, MULT16_16_P13(K4, x2)))))); - } else { - x = SUB16(25736,x); - x2 = MULT16_16_P13(x,x); - return SUB32(-K1, MULT16_16_P13(x2, ADD32(K2, MULT16_16_P13(x2, ADD32(K3, MULT16_16_P13(K4, x2)))))); - } -} - -#define L1 32767 -#define L2 -7651 -#define L3 8277 -#define L4 -626 - -static inline spx_word16_t _spx_cos_pi_2(spx_word16_t x) -{ - spx_word16_t x2; - - x2 = MULT16_16_P15(x,x); - return ADD16(1,MIN16(32766,ADD32(SUB16(L1,x2), MULT16_16_P15(x2, ADD32(L2, MULT16_16_P15(x2, ADD32(L3, MULT16_16_P15(L4, x2)))))))); -} - -static inline spx_word16_t spx_cos_norm(spx_word32_t x) -{ - x = x&0x0001ffff; - if (x>SHL32(EXTEND32(1), 16)) - x = SUB32(SHL32(EXTEND32(1), 17),x); - if (x&0x00007fff) - { - if (x14) - return 0x7fffffff; - else if (integer < -15) - return 0; - frac = SHL16(x-SHL16(integer,11),3); - frac = ADD16(D0, MULT16_16_Q14(frac, ADD16(D1, MULT16_16_Q14(frac, ADD16(D2 , MULT16_16_Q14(D3,frac)))))); - return VSHR32(EXTEND32(frac), -integer-2); -} - -/* Input in Q11 format, output in Q16 */ -static inline spx_word32_t spx_exp(spx_word16_t x) -{ - if (x>21290) - return 0x7fffffff; - else if (x<-21290) - return 0; - else - return spx_exp2(MULT16_16_P14(23637,x)); -} -#define M1 32767 -#define M2 -21 -#define M3 -11943 -#define M4 4936 - -static inline spx_word16_t spx_atan01(spx_word16_t x) -{ - return MULT16_16_P15(x, ADD32(M1, MULT16_16_P15(x, ADD32(M2, MULT16_16_P15(x, ADD32(M3, MULT16_16_P15(M4, x))))))); -} - -#undef M1 -#undef M2 -#undef M3 -#undef M4 - -/* Input in Q15, output in Q14 */ -static inline spx_word16_t spx_atan(spx_word32_t x) -{ - if (x <= 32767) - { - return SHR16(spx_atan01(x),1); - } else { - int e = spx_ilog2(x); - if (e>=29) - return 25736; - x = DIV32_16(SHL32(EXTEND32(32767),29-e), EXTRACT16(SHR32(x, e-14))); - return SUB16(25736, SHR16(spx_atan01(x),1)); - } -} -#else - -#ifndef M_PI -#define M_PI 3.14159265358979323846 /* pi */ -#endif - -#define C1 0.9999932946f -#define C2 -0.4999124376f -#define C3 0.0414877472f -#define C4 -0.0012712095f - - -#define SPX_PI_2 1.5707963268 -static inline spx_word16_t spx_cos(spx_word16_t x) -{ - if (x>2)-1), "0" (src), "1" (dest) - : "R0", "I0", "L0", "memory" BFIN_HWLOOP0_REGS - ); - return dest; -} diff --git a/Engine/lib/speex/libspeex/modes.c b/Engine/lib/speex/libspeex/modes.c deleted file mode 100644 index 88e431aef..000000000 --- a/Engine/lib/speex/libspeex/modes.c +++ /dev/null @@ -1,390 +0,0 @@ -/* Copyright (C) 2002-2006 Jean-Marc Valin - File: modes.c - - Describes the different modes of the codec - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "modes.h" -#include "ltp.h" -#include "quant_lsp.h" -#include "cb_search.h" -#include "sb_celp.h" -#include "nb_celp.h" -#include "vbr.h" -#include "arch.h" -#include - -#ifndef NULL -#define NULL 0 -#endif - -#ifdef DISABLE_ENCODER -#define nb_encoder_init NULL -#define nb_encoder_destroy NULL -#define nb_encode NULL -#define nb_encoder_ctl NULL - -#define split_cb_search_shape_sign NULL -#define noise_codebook_quant NULL -#define pitch_search_3tap NULL -#define forced_pitch_quant NULL -#define lsp_quant_nb NULL -#define lsp_quant_lbr NULL -#endif /* DISABLE_ENCODER */ - -#ifdef DISABLE_DECODER -#define nb_decoder_init NULL -#define nb_decoder_destroy NULL -#define nb_decode NULL -#define nb_decoder_ctl NULL - -#define noise_codebook_unquant NULL -#define split_cb_shape_sign_unquant NULL -#define lsp_unquant_nb NULL -#define lsp_unquant_lbr NULL -#define pitch_unquant_3tap NULL -#define forced_pitch_unquant NULL -#endif /* DISABLE_DECODER */ - -/* Extern declarations for all codebooks we use here */ -extern const signed char gain_cdbk_nb[]; -extern const signed char gain_cdbk_lbr[]; -extern const signed char exc_5_256_table[]; -extern const signed char exc_5_64_table[]; -extern const signed char exc_8_128_table[]; -extern const signed char exc_10_32_table[]; -extern const signed char exc_10_16_table[]; -extern const signed char exc_20_32_table[]; - - -/* Parameters for Long-Term Prediction (LTP)*/ -static const ltp_params ltp_params_nb = { - gain_cdbk_nb, - 7, - 7 -}; - -/* Parameters for Long-Term Prediction (LTP)*/ -static const ltp_params ltp_params_vlbr = { - gain_cdbk_lbr, - 5, - 0 -}; - -/* Parameters for Long-Term Prediction (LTP)*/ -static const ltp_params ltp_params_lbr = { - gain_cdbk_lbr, - 5, - 7 -}; - -/* Parameters for Long-Term Prediction (LTP)*/ -static const ltp_params ltp_params_med = { - gain_cdbk_lbr, - 5, - 7 -}; - -/* Split-VQ innovation parameters for very low bit-rate narrowband */ -static const split_cb_params split_cb_nb_vlbr = { - 10, /*subvect_size*/ - 4, /*nb_subvect*/ - exc_10_16_table, /*shape_cb*/ - 4, /*shape_bits*/ - 0, -}; - -/* Split-VQ innovation parameters for very low bit-rate narrowband */ -static const split_cb_params split_cb_nb_ulbr = { - 20, /*subvect_size*/ - 2, /*nb_subvect*/ - exc_20_32_table, /*shape_cb*/ - 5, /*shape_bits*/ - 0, -}; - -/* Split-VQ innovation parameters for low bit-rate narrowband */ -static const split_cb_params split_cb_nb_lbr = { - 10, /*subvect_size*/ - 4, /*nb_subvect*/ - exc_10_32_table, /*shape_cb*/ - 5, /*shape_bits*/ - 0, -}; - - -/* Split-VQ innovation parameters narrowband */ -static const split_cb_params split_cb_nb = { - 5, /*subvect_size*/ - 8, /*nb_subvect*/ - exc_5_64_table, /*shape_cb*/ - 6, /*shape_bits*/ - 0, -}; - -/* Split-VQ innovation parameters narrowband */ -static const split_cb_params split_cb_nb_med = { - 8, /*subvect_size*/ - 5, /*nb_subvect*/ - exc_8_128_table, /*shape_cb*/ - 7, /*shape_bits*/ - 0, -}; - -/* Split-VQ innovation for low-band wideband */ -static const split_cb_params split_cb_sb = { - 5, /*subvect_size*/ - 8, /*nb_subvect*/ - exc_5_256_table, /*shape_cb*/ - 8, /*shape_bits*/ - 0, -}; - - - -/* 2150 bps "vocoder-like" mode for comfort noise */ -static const SpeexSubmode nb_submode1 = { - 0, - 1, - 0, - 0, - /* LSP quantization */ - lsp_quant_lbr, - lsp_unquant_lbr, - /* No pitch quantization */ - forced_pitch_quant, - forced_pitch_unquant, - NULL, - /* No innovation quantization (noise only) */ - noise_codebook_quant, - noise_codebook_unquant, - NULL, - -1, - 43 -}; - -/* 3.95 kbps very low bit-rate mode */ -static const SpeexSubmode nb_submode8 = { - 0, - 1, - 0, - 0, - /*LSP quantization*/ - lsp_quant_lbr, - lsp_unquant_lbr, - /*No pitch quantization*/ - forced_pitch_quant, - forced_pitch_unquant, - NULL, - /*Innovation quantization*/ - split_cb_search_shape_sign, - split_cb_shape_sign_unquant, - &split_cb_nb_ulbr, - QCONST16(.5,15), - 79 -}; - -/* 5.95 kbps very low bit-rate mode */ -static const SpeexSubmode nb_submode2 = { - 0, - 0, - 0, - 0, - /*LSP quantization*/ - lsp_quant_lbr, - lsp_unquant_lbr, - /*No pitch quantization*/ - pitch_search_3tap, - pitch_unquant_3tap, - <p_params_vlbr, - /*Innovation quantization*/ - split_cb_search_shape_sign, - split_cb_shape_sign_unquant, - &split_cb_nb_vlbr, - QCONST16(.6,15), - 119 -}; - -/* 8 kbps low bit-rate mode */ -static const SpeexSubmode nb_submode3 = { - -1, - 0, - 1, - 0, - /*LSP quantization*/ - lsp_quant_lbr, - lsp_unquant_lbr, - /*Pitch quantization*/ - pitch_search_3tap, - pitch_unquant_3tap, - <p_params_lbr, - /*Innovation quantization*/ - split_cb_search_shape_sign, - split_cb_shape_sign_unquant, - &split_cb_nb_lbr, - QCONST16(.55,15), - 160 -}; - -/* 11 kbps medium bit-rate mode */ -static const SpeexSubmode nb_submode4 = { - -1, - 0, - 1, - 0, - /*LSP quantization*/ - lsp_quant_lbr, - lsp_unquant_lbr, - /*Pitch quantization*/ - pitch_search_3tap, - pitch_unquant_3tap, - <p_params_med, - /*Innovation quantization*/ - split_cb_search_shape_sign, - split_cb_shape_sign_unquant, - &split_cb_nb_med, - QCONST16(.45,15), - 220 -}; - -/* 15 kbps high bit-rate mode */ -static const SpeexSubmode nb_submode5 = { - -1, - 0, - 3, - 0, - /*LSP quantization*/ - lsp_quant_nb, - lsp_unquant_nb, - /*Pitch quantization*/ - pitch_search_3tap, - pitch_unquant_3tap, - <p_params_nb, - /*Innovation quantization*/ - split_cb_search_shape_sign, - split_cb_shape_sign_unquant, - &split_cb_nb, - QCONST16(.25,15), - 300 -}; - -/* 18.2 high bit-rate mode */ -static const SpeexSubmode nb_submode6 = { - -1, - 0, - 3, - 0, - /*LSP quantization*/ - lsp_quant_nb, - lsp_unquant_nb, - /*Pitch quantization*/ - pitch_search_3tap, - pitch_unquant_3tap, - <p_params_nb, - /*Innovation quantization*/ - split_cb_search_shape_sign, - split_cb_shape_sign_unquant, - &split_cb_sb, - QCONST16(.15,15), - 364 -}; - -/* 24.6 kbps high bit-rate mode */ -static const SpeexSubmode nb_submode7 = { - -1, - 0, - 3, - 1, - /*LSP quantization*/ - lsp_quant_nb, - lsp_unquant_nb, - /*Pitch quantization*/ - pitch_search_3tap, - pitch_unquant_3tap, - <p_params_nb, - /*Innovation quantization*/ - split_cb_search_shape_sign, - split_cb_shape_sign_unquant, - &split_cb_nb, - QCONST16(.05,15), - 492 -}; - - -/* Default mode for narrowband */ -static const SpeexNBMode nb_mode = { - NB_FRAME_SIZE, /*frameSize*/ - NB_SUBFRAME_SIZE, /*subframeSize*/ - NB_ORDER, /*lpcSize*/ - NB_PITCH_START, /*pitchStart*/ - NB_PITCH_END, /*pitchEnd*/ - QCONST16(0.92,15), /* gamma1 */ - QCONST16(0.6,15), /* gamma2 */ - QCONST16(.0002,15), /*lpc_floor*/ - {NULL, &nb_submode1, &nb_submode2, &nb_submode3, &nb_submode4, &nb_submode5, &nb_submode6, &nb_submode7, - &nb_submode8, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, - 5, - {1, 8, 2, 3, 3, 4, 4, 5, 5, 6, 7} -}; - - -/* Default mode for narrowband */ -EXPORT const SpeexMode speex_nb_mode = { - &nb_mode, - nb_mode_query, - "narrowband", - 0, - 4, - nb_encoder_init, - nb_encoder_destroy, - nb_encode, - nb_decoder_init, - nb_decoder_destroy, - nb_decode, - nb_encoder_ctl, - nb_decoder_ctl, -}; - - - -EXPORT int speex_mode_query(const SpeexMode *mode, int request, void *ptr) -{ - return mode->query(mode->mode, request, ptr); -} - -#ifdef FIXED_DEBUG -long long spx_mips=0; -#endif - diff --git a/Engine/lib/speex/libspeex/modes.h b/Engine/lib/speex/libspeex/modes.h deleted file mode 100644 index 0977a579b..000000000 --- a/Engine/lib/speex/libspeex/modes.h +++ /dev/null @@ -1,160 +0,0 @@ -/* Copyright (C) 2002-2006 Jean-Marc Valin */ -/** - @file modes.h - @brief Describes the different modes of the codec -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifndef MODES_H -#define MODES_H - -#include "speex/speex.h" -#include "arch.h" - -#define NB_SUBMODES 16 -#define NB_SUBMODE_BITS 4 - -#define SB_SUBMODES 8 -#define SB_SUBMODE_BITS 3 - -/* Used internally, NOT TO BE USED in applications */ -/** Used internally*/ -#define SPEEX_GET_PI_GAIN 100 -/** Used internally*/ -#define SPEEX_GET_EXC 101 -/** Used internally*/ -#define SPEEX_GET_INNOV 102 -/** Used internally*/ -#define SPEEX_GET_DTX_STATUS 103 -/** Used internally*/ -#define SPEEX_SET_INNOVATION_SAVE 104 -/** Used internally*/ -#define SPEEX_SET_WIDEBAND 105 - -/** Used internally*/ -#define SPEEX_GET_STACK 106 - - -/** Quantizes LSPs */ -typedef void (*lsp_quant_func)(spx_lsp_t *, spx_lsp_t *, int, SpeexBits *); - -/** Decodes quantized LSPs */ -typedef void (*lsp_unquant_func)(spx_lsp_t *, int, SpeexBits *); - - -/** Long-term predictor quantization */ -typedef int (*ltp_quant_func)(spx_word16_t *, spx_word16_t *, spx_coef_t *, spx_coef_t *, - spx_coef_t *, spx_sig_t *, const void *, int, int, spx_word16_t, - int, int, SpeexBits*, char *, spx_word16_t *, spx_word16_t *, int, int, int, spx_word32_t *); - -/** Long-term un-quantize */ -typedef void (*ltp_unquant_func)(spx_word16_t *, spx_word32_t *, int, int, spx_word16_t, const void *, int, int *, - spx_word16_t *, SpeexBits*, char*, int, int, spx_word16_t, int); - - -/** Innovation quantization function */ -typedef void (*innovation_quant_func)(spx_word16_t *, spx_coef_t *, spx_coef_t *, spx_coef_t *, const void *, int, int, - spx_sig_t *, spx_word16_t *, SpeexBits *, char *, int, int); - -/** Innovation unquantization function */ -typedef void (*innovation_unquant_func)(spx_sig_t *, const void *, int, SpeexBits*, char *, spx_int32_t *); - -/** Description of a Speex sub-mode (wither narrowband or wideband */ -typedef struct SpeexSubmode { - int lbr_pitch; /**< Set to -1 for "normal" modes, otherwise encode pitch using a global pitch and allowing a +- lbr_pitch variation (for low not-rates)*/ - int forced_pitch_gain; /**< Use the same (forced) pitch gain for all sub-frames */ - int have_subframe_gain; /**< Number of bits to use as sub-frame innovation gain */ - int double_codebook; /**< Apply innovation quantization twice for higher quality (and higher bit-rate)*/ - /*LSP functions*/ - lsp_quant_func lsp_quant; /**< LSP quantization function */ - lsp_unquant_func lsp_unquant; /**< LSP unquantization function */ - - /*Long-term predictor functions*/ - ltp_quant_func ltp_quant; /**< Long-term predictor (pitch) quantizer */ - ltp_unquant_func ltp_unquant; /**< Long-term predictor (pitch) un-quantizer */ - const void *ltp_params; /**< Pitch parameters (options) */ - - /*Quantization of innovation*/ - innovation_quant_func innovation_quant; /**< Innovation quantization */ - innovation_unquant_func innovation_unquant; /**< Innovation un-quantization */ - const void *innovation_params; /**< Innovation quantization parameters*/ - - spx_word16_t comb_gain; /**< Gain of enhancer comb filter */ - - int bits_per_frame; /**< Number of bits per frame after encoding*/ -} SpeexSubmode; - -/** Struct defining the encoding/decoding mode*/ -typedef struct SpeexNBMode { - int frameSize; /**< Size of frames used for encoding */ - int subframeSize; /**< Size of sub-frames used for encoding */ - int lpcSize; /**< Order of LPC filter */ - int pitchStart; /**< Smallest pitch value allowed */ - int pitchEnd; /**< Largest pitch value allowed */ - - spx_word16_t gamma1; /**< Perceptual filter parameter #1 */ - spx_word16_t gamma2; /**< Perceptual filter parameter #2 */ - spx_word16_t lpc_floor; /**< Noise floor for LPC analysis */ - - const SpeexSubmode *submodes[NB_SUBMODES]; /**< Sub-mode data for the mode */ - int defaultSubmode; /**< Default sub-mode to use when encoding */ - int quality_map[11]; /**< Mode corresponding to each quality setting */ -} SpeexNBMode; - - -/** Struct defining the encoding/decoding mode for SB-CELP (wideband) */ -typedef struct SpeexSBMode { - const SpeexMode *nb_mode; /**< Embedded narrowband mode */ - int frameSize; /**< Size of frames used for encoding */ - int subframeSize; /**< Size of sub-frames used for encoding */ - int lpcSize; /**< Order of LPC filter */ - spx_word16_t gamma1; /**< Perceptual filter parameter #1 */ - spx_word16_t gamma2; /**< Perceptual filter parameter #1 */ - spx_word16_t lpc_floor; /**< Noise floor for LPC analysis */ - spx_word16_t folding_gain; - - const SpeexSubmode *submodes[SB_SUBMODES]; /**< Sub-mode data for the mode */ - int defaultSubmode; /**< Default sub-mode to use when encoding */ - int low_quality_map[11]; /**< Mode corresponding to each quality setting */ - int quality_map[11]; /**< Mode corresponding to each quality setting */ -#ifndef DISABLE_VBR - const float (*vbr_thresh)[11]; -#endif - int nb_modes; -} SpeexSBMode; - -int speex_encode_native(void *state, spx_word16_t *in, SpeexBits *bits); -int speex_decode_native(void *state, SpeexBits *bits, spx_word16_t *out); - -int nb_mode_query(const void *mode, int request, void *ptr); -int wb_mode_query(const void *mode, int request, void *ptr); - -#endif diff --git a/Engine/lib/speex/libspeex/modes_wb.c b/Engine/lib/speex/libspeex/modes_wb.c deleted file mode 100644 index aef5fdfeb..000000000 --- a/Engine/lib/speex/libspeex/modes_wb.c +++ /dev/null @@ -1,322 +0,0 @@ -/* Copyright (C) 2002-2007 Jean-Marc Valin - File: modes.c - - Describes the wideband modes of the codec - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "modes.h" -#include "ltp.h" -#include "quant_lsp.h" -#include "cb_search.h" -#include "sb_celp.h" -#include "nb_celp.h" -#include "vbr.h" -#include "arch.h" -#include -#include "os_support.h" - - -#ifndef NULL -#define NULL 0 -#endif - -#if defined(DISABLE_ENCODER) || defined(DISABLE_WIDEBAND) -#define split_cb_search_shape_sign NULL -#define noise_codebook_quant NULL -#define pitch_search_3tap NULL -#define forced_pitch_quant NULL -#define sb_encoder_init NULL -#define sb_encoder_destroy NULL -#define sb_encode NULL -#define sb_encoder_ctl NULL -#define lsp_quant_high NULL -#endif /* DISABLE_ENCODER */ - -#if defined(DISABLE_DECODER) || defined(DISABLE_WIDEBAND) -#define noise_codebook_unquant NULL -#define split_cb_shape_sign_unquant NULL -#define lsp_unquant_high NULL -#define sb_decoder_init NULL -#define sb_decoder_destroy NULL -#define sb_decode NULL -#define sb_decoder_ctl NULL -#endif /* DISABLE_DECODER */ - -EXPORT const SpeexMode * const speex_mode_list[SPEEX_NB_MODES] = {&speex_nb_mode, &speex_wb_mode, &speex_uwb_mode}; - -extern const signed char hexc_table[]; -extern const signed char hexc_10_32_table[]; - -#ifndef DISABLE_WIDEBAND - -/* Split-VQ innovation for high-band wideband */ -static const split_cb_params split_cb_high = { - 8, /*subvect_size*/ - 5, /*nb_subvect*/ - hexc_table, /*shape_cb*/ - 7, /*shape_bits*/ - 1, -}; - - -/* Split-VQ innovation for high-band wideband */ -static const split_cb_params split_cb_high_lbr = { - 10, /*subvect_size*/ - 4, /*nb_subvect*/ - hexc_10_32_table, /*shape_cb*/ - 5, /*shape_bits*/ - 0, -}; - -#endif - - -static const SpeexSubmode wb_submode1 = { - 0, - 0, - 1, - 0, - /*LSP quantization*/ - lsp_quant_high, - lsp_unquant_high, - /*Pitch quantization*/ - NULL, - NULL, - NULL, - /*No innovation quantization*/ - NULL, - NULL, - NULL, - -1, - 36 -}; - - -static const SpeexSubmode wb_submode2 = { - 0, - 0, - 1, - 0, - /*LSP quantization*/ - lsp_quant_high, - lsp_unquant_high, - /*Pitch quantization*/ - NULL, - NULL, - NULL, - /*Innovation quantization*/ - split_cb_search_shape_sign, - split_cb_shape_sign_unquant, -#ifdef DISABLE_WIDEBAND - NULL, -#else - &split_cb_high_lbr, -#endif - -1, - 112 -}; - - -static const SpeexSubmode wb_submode3 = { - 0, - 0, - 1, - 0, - /*LSP quantization*/ - lsp_quant_high, - lsp_unquant_high, - /*Pitch quantization*/ - NULL, - NULL, - NULL, - /*Innovation quantization*/ - split_cb_search_shape_sign, - split_cb_shape_sign_unquant, -#ifdef DISABLE_WIDEBAND - NULL, -#else - &split_cb_high, -#endif - -1, - 192 -}; - -static const SpeexSubmode wb_submode4 = { - 0, - 0, - 1, - 1, - /*LSP quantization*/ - lsp_quant_high, - lsp_unquant_high, - /*Pitch quantization*/ - NULL, - NULL, - NULL, - /*Innovation quantization*/ - split_cb_search_shape_sign, - split_cb_shape_sign_unquant, -#ifdef DISABLE_WIDEBAND - NULL, -#else - &split_cb_high, -#endif - -1, - 352 -}; - - -/* Split-band wideband CELP mode*/ -static const SpeexSBMode sb_wb_mode = { - &speex_nb_mode, - 160, /*frameSize*/ - 40, /*subframeSize*/ - 8, /*lpcSize*/ -#ifdef FIXED_POINT - 29491, 19661, /* gamma1, gamma2 */ -#else - 0.9, 0.6, /* gamma1, gamma2 */ -#endif - QCONST16(.0002,15), /*lpc_floor*/ - QCONST16(0.9f,15), - {NULL, &wb_submode1, &wb_submode2, &wb_submode3, &wb_submode4, NULL, NULL, NULL}, - 3, - {1, 8, 2, 3, 4, 5, 5, 6, 6, 7, 7}, - {1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 4}, -#ifndef DISABLE_VBR - vbr_hb_thresh, -#endif - 5 -}; - - -EXPORT const SpeexMode speex_wb_mode = { - &sb_wb_mode, - wb_mode_query, - "wideband (sub-band CELP)", - 1, - 4, - sb_encoder_init, - sb_encoder_destroy, - sb_encode, - sb_decoder_init, - sb_decoder_destroy, - sb_decode, - sb_encoder_ctl, - sb_decoder_ctl, -}; - - - -/* "Ultra-wideband" mode stuff */ - - - -/* Split-band "ultra-wideband" (32 kbps) CELP mode*/ -static const SpeexSBMode sb_uwb_mode = { - &speex_wb_mode, - 320, /*frameSize*/ - 80, /*subframeSize*/ - 8, /*lpcSize*/ -#ifdef FIXED_POINT - 29491, 19661, /* gamma1, gamma2 */ -#else - 0.9, 0.6, /* gamma1, gamma2 */ -#endif - QCONST16(.0002,15), /*lpc_floor*/ - QCONST16(0.7f,15), - {NULL, &wb_submode1, NULL, NULL, NULL, NULL, NULL, NULL}, - 1, - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, - {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, -#ifndef DISABLE_VBR - vbr_uhb_thresh, -#endif - 2 -}; - -int wb_mode_query(const void *mode, int request, void *ptr) -{ - const SpeexSBMode *m = (const SpeexSBMode*)mode; - - switch (request) - { - case SPEEX_MODE_FRAME_SIZE: - *((int*)ptr)=2*m->frameSize; - break; - case SPEEX_SUBMODE_BITS_PER_FRAME: - if (*((int*)ptr)==0) - *((int*)ptr) = SB_SUBMODE_BITS+1; - else if (m->submodes[*((int*)ptr)]==NULL) - *((int*)ptr) = -1; - else - *((int*)ptr) = m->submodes[*((int*)ptr)]->bits_per_frame; - break; - default: - speex_warning_int("Unknown wb_mode_query request: ", request); - return -1; - } - return 0; -} - - -EXPORT const SpeexMode speex_uwb_mode = { - &sb_uwb_mode, - wb_mode_query, - "ultra-wideband (sub-band CELP)", - 2, - 4, - sb_encoder_init, - sb_encoder_destroy, - sb_encode, - sb_decoder_init, - sb_decoder_destroy, - sb_decode, - sb_encoder_ctl, - sb_decoder_ctl, -}; - -/* We have defined speex_lib_get_mode() as a macro in speex.h */ -#undef speex_lib_get_mode - -EXPORT const SpeexMode * speex_lib_get_mode (int mode) -{ - if (mode < 0 || mode >= SPEEX_NB_MODES) return NULL; - - return speex_mode_list[mode]; -} - - - diff --git a/Engine/lib/speex/libspeex/nb_celp.c b/Engine/lib/speex/libspeex/nb_celp.c deleted file mode 100644 index b68d5070a..000000000 --- a/Engine/lib/speex/libspeex/nb_celp.c +++ /dev/null @@ -1,1821 +0,0 @@ -/* Copyright (C) 2002-2006 Jean-Marc Valin - File: nb_celp.c - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include "nb_celp.h" -#include "lpc.h" -#include "lsp.h" -#include "ltp.h" -#include "quant_lsp.h" -#include "cb_search.h" -#include "filters.h" -#include "stack_alloc.h" -#include "vq.h" -#include "vbr.h" -#include "arch.h" -#include "math_approx.h" -#include "os_support.h" - -#ifdef VORBIS_PSYCHO -#include "vorbis_psy.h" -#endif - -#ifndef NULL -#define NULL 0 -#endif - -#define SUBMODE(x) st->submodes[st->submodeID]->x - -/* Default size for the encoder and decoder stack (can be changed at compile time). - This does not apply when using variable-size arrays or alloca. */ -#ifndef NB_ENC_STACK -#define NB_ENC_STACK (8000*sizeof(spx_sig_t)) -#endif - -#ifndef NB_DEC_STACK -#define NB_DEC_STACK (4000*sizeof(spx_sig_t)) -#endif - - -#ifdef FIXED_POINT -static const spx_word32_t ol_gain_table[32]={18900, 25150, 33468, 44536, 59265, 78865, 104946, 139653, 185838, 247297, 329081, 437913, 582736, 775454, 1031906, 1373169, 1827293, 2431601, 3235761, 4305867, 5729870, 7624808, 10146425, 13501971, 17967238, 23909222, 31816294, 42338330, 56340132, 74972501, 99766822, 132760927}; -static const spx_word16_t exc_gain_quant_scal3_bound[7]={1841, 3883, 6051, 8062, 10444, 13580, 18560}; -static const spx_word16_t exc_gain_quant_scal3[8]={1002, 2680, 5086, 7016, 9108, 11781, 15380, 21740}; -static const spx_word16_t exc_gain_quant_scal1_bound[1]={14385}; -static const spx_word16_t exc_gain_quant_scal1[2]={11546, 17224}; - -#define LSP_MARGIN 16 -#define LSP_DELTA1 6553 -#define LSP_DELTA2 1638 - -#else - -static const float exc_gain_quant_scal3_bound[7]={0.112338f, 0.236980f, 0.369316f, 0.492054f, 0.637471f, 0.828874f, 1.132784f}; -static const float exc_gain_quant_scal3[8]={0.061130f, 0.163546f, 0.310413f, 0.428220f, 0.555887f, 0.719055f, 0.938694f, 1.326874f}; -static const float exc_gain_quant_scal1_bound[1]={0.87798f}; -static const float exc_gain_quant_scal1[2]={0.70469f, 1.05127f}; - -#define LSP_MARGIN .002f -#define LSP_DELTA1 .2f -#define LSP_DELTA2 .05f - -#endif - -#ifdef VORBIS_PSYCHO -#define EXTRA_BUFFER 100 -#else -#define EXTRA_BUFFER 0 -#endif - - -extern const spx_word16_t lag_window[]; -extern const spx_word16_t lpc_window[]; - -#ifndef DISABLE_ENCODER -void *nb_encoder_init(const SpeexMode *m) -{ - EncState *st; - const SpeexNBMode *mode; - int i; - - mode=(const SpeexNBMode *)m->mode; - st = (EncState*)speex_alloc(sizeof(EncState)); - if (!st) - return NULL; -#if defined(VAR_ARRAYS) || defined (USE_ALLOCA) - st->stack = NULL; -#else - st->stack = (char*)speex_alloc_scratch(NB_ENC_STACK); -#endif - - st->mode=m; - - st->gamma1=mode->gamma1; - st->gamma2=mode->gamma2; - st->lpc_floor = mode->lpc_floor; - - st->submodes=mode->submodes; - st->submodeID=st->submodeSelect=mode->defaultSubmode; - st->bounded_pitch = 1; - - st->encode_submode = 1; - -#ifdef VORBIS_PSYCHO - st->psy = vorbis_psy_init(8000, 256); - st->curve = (float*)speex_alloc(128*sizeof(float)); - st->old_curve = (float*)speex_alloc(128*sizeof(float)); - st->psy_window = (float*)speex_alloc(256*sizeof(float)); -#endif - - st->cumul_gain = 1024; - - st->window= lpc_window; - - /* Create the window for autocorrelation (lag-windowing) */ - st->lagWindow = lag_window; - - st->first = 1; - for (i=0;iold_lsp[i]= DIV32(MULT16_16(QCONST16(3.1415927f, LSP_SHIFT), i+1), NB_ORDER+1); - - st->innov_rms_save = NULL; - -#ifndef DISABLE_VBR - vbr_init(&st->vbr); - st->vbr_quality = 8; - st->vbr_enabled = 0; - st->vbr_max = 0; - st->vad_enabled = 0; - st->dtx_enabled = 0; - st->dtx_count=0; - st->abr_enabled = 0; - st->abr_drift = 0; - st->abr_drift2 = 0; -#endif /* #ifndef DISABLE_VBR */ - - st->plc_tuning = 2; - st->complexity=2; - st->sampling_rate=8000; - st->isWideband = 0; - st->highpass_enabled = 1; - -#ifdef ENABLE_VALGRIND - VALGRIND_MAKE_READABLE(st, NB_ENC_STACK); -#endif - return st; -} - -void nb_encoder_destroy(void *state) -{ - EncState *st=(EncState *)state; - /* Free all allocated memory */ -#if !(defined(VAR_ARRAYS) || defined (USE_ALLOCA)) - speex_free_scratch(st->stack); -#endif - -#ifndef DISABLE_VBR - vbr_destroy(&st->vbr); -#endif /* #ifndef DISABLE_VBR */ - -#ifdef VORBIS_PSYCHO - vorbis_psy_destroy(st->psy); - speex_free (st->curve); - speex_free (st->old_curve); - speex_free (st->psy_window); -#endif - - /*Free state memory... should be last*/ - speex_free(st); -} - - -int nb_encoder_ctl(void *state, int request, void *ptr) -{ - EncState *st; - st=(EncState*)state; - switch(request) - { - case SPEEX_GET_FRAME_SIZE: - (*(spx_int32_t*)ptr) = NB_FRAME_SIZE; - break; - case SPEEX_SET_LOW_MODE: - case SPEEX_SET_MODE: - st->submodeSelect = st->submodeID = (*(spx_int32_t*)ptr); - break; - case SPEEX_GET_LOW_MODE: - case SPEEX_GET_MODE: - (*(spx_int32_t*)ptr) = st->submodeID; - break; -#ifndef DISABLE_VBR - case SPEEX_SET_VBR: - st->vbr_enabled = (*(spx_int32_t*)ptr); - break; - case SPEEX_GET_VBR: - (*(spx_int32_t*)ptr) = st->vbr_enabled; - break; - case SPEEX_SET_VAD: - st->vad_enabled = (*(spx_int32_t*)ptr); - break; - case SPEEX_GET_VAD: - (*(spx_int32_t*)ptr) = st->vad_enabled; - break; - case SPEEX_SET_DTX: - st->dtx_enabled = (*(spx_int32_t*)ptr); - break; - case SPEEX_GET_DTX: - (*(spx_int32_t*)ptr) = st->dtx_enabled; - break; - case SPEEX_SET_ABR: - st->abr_enabled = (*(spx_int32_t*)ptr); - st->vbr_enabled = st->abr_enabled!=0; - if (st->vbr_enabled) - { - spx_int32_t i=10; - spx_int32_t rate, target; - float vbr_qual; - target = (*(spx_int32_t*)ptr); - while (i>=0) - { - speex_encoder_ctl(st, SPEEX_SET_QUALITY, &i); - speex_encoder_ctl(st, SPEEX_GET_BITRATE, &rate); - if (rate <= target) - break; - i--; - } - vbr_qual=i; - if (vbr_qual<0) - vbr_qual=0; - speex_encoder_ctl(st, SPEEX_SET_VBR_QUALITY, &vbr_qual); - st->abr_count=0; - st->abr_drift=0; - st->abr_drift2=0; - } - - break; - case SPEEX_GET_ABR: - (*(spx_int32_t*)ptr) = st->abr_enabled; - break; -#endif /* #ifndef DISABLE_VBR */ -#if !defined(DISABLE_VBR) && !defined(DISABLE_FLOAT_API) - case SPEEX_SET_VBR_QUALITY: - st->vbr_quality = (*(float*)ptr); - break; - case SPEEX_GET_VBR_QUALITY: - (*(float*)ptr) = st->vbr_quality; - break; -#endif /* !defined(DISABLE_VBR) && !defined(DISABLE_FLOAT_API) */ - case SPEEX_SET_QUALITY: - { - int quality = (*(spx_int32_t*)ptr); - if (quality < 0) - quality = 0; - if (quality > 10) - quality = 10; - st->submodeSelect = st->submodeID = ((const SpeexNBMode*)(st->mode->mode))->quality_map[quality]; - } - break; - case SPEEX_SET_COMPLEXITY: - st->complexity = (*(spx_int32_t*)ptr); - if (st->complexity<0) - st->complexity=0; - break; - case SPEEX_GET_COMPLEXITY: - (*(spx_int32_t*)ptr) = st->complexity; - break; - case SPEEX_SET_BITRATE: - { - spx_int32_t i=10; - spx_int32_t rate, target; - target = (*(spx_int32_t*)ptr); - while (i>=0) - { - speex_encoder_ctl(st, SPEEX_SET_QUALITY, &i); - speex_encoder_ctl(st, SPEEX_GET_BITRATE, &rate); - if (rate <= target) - break; - i--; - } - } - break; - case SPEEX_GET_BITRATE: - if (st->submodes[st->submodeID]) - (*(spx_int32_t*)ptr) = st->sampling_rate*SUBMODE(bits_per_frame)/NB_FRAME_SIZE; - else - (*(spx_int32_t*)ptr) = st->sampling_rate*(NB_SUBMODE_BITS+1)/NB_FRAME_SIZE; - break; - case SPEEX_SET_SAMPLING_RATE: - st->sampling_rate = (*(spx_int32_t*)ptr); - break; - case SPEEX_GET_SAMPLING_RATE: - (*(spx_int32_t*)ptr)=st->sampling_rate; - break; - case SPEEX_RESET_STATE: - { - int i; - st->bounded_pitch = 1; - st->first = 1; - for (i=0;iold_lsp[i]= DIV32(MULT16_16(QCONST16(3.1415927f, LSP_SHIFT), i+1), NB_ORDER+1); - for (i=0;imem_sw[i]=st->mem_sw_whole[i]=st->mem_sp[i]=st->mem_exc[i]=0; - for (i=0;iexcBuf[i]=st->swBuf[i]=0; - for (i=0;iwinBuf[i]=0; - } - break; - case SPEEX_SET_SUBMODE_ENCODING: - st->encode_submode = (*(spx_int32_t*)ptr); - break; - case SPEEX_GET_SUBMODE_ENCODING: - (*(spx_int32_t*)ptr) = st->encode_submode; - break; - case SPEEX_GET_LOOKAHEAD: - (*(spx_int32_t*)ptr)=(NB_WINDOW_SIZE-NB_FRAME_SIZE); - break; - case SPEEX_SET_PLC_TUNING: - st->plc_tuning = (*(spx_int32_t*)ptr); - if (st->plc_tuning>100) - st->plc_tuning=100; - break; - case SPEEX_GET_PLC_TUNING: - (*(spx_int32_t*)ptr)=(st->plc_tuning); - break; -#ifndef DISABLE_VBR - case SPEEX_SET_VBR_MAX_BITRATE: - st->vbr_max = (*(spx_int32_t*)ptr); - break; - case SPEEX_GET_VBR_MAX_BITRATE: - (*(spx_int32_t*)ptr) = st->vbr_max; - break; -#endif /* #ifndef DISABLE_VBR */ - case SPEEX_SET_HIGHPASS: - st->highpass_enabled = (*(spx_int32_t*)ptr); - break; - case SPEEX_GET_HIGHPASS: - (*(spx_int32_t*)ptr) = st->highpass_enabled; - break; - - /* This is all internal stuff past this point */ - case SPEEX_GET_PI_GAIN: - { - int i; - spx_word32_t *g = (spx_word32_t*)ptr; - for (i=0;ipi_gain[i]; - } - break; - case SPEEX_GET_EXC: - { - int i; - for (i=0;iexc+i*NB_SUBFRAME_SIZE, NB_SUBFRAME_SIZE); - } - break; -#ifndef DISABLE_VBR - case SPEEX_GET_RELATIVE_QUALITY: - (*(float*)ptr)=st->relative_quality; - break; -#endif /* #ifndef DISABLE_VBR */ - case SPEEX_SET_INNOVATION_SAVE: - st->innov_rms_save = (spx_word16_t*)ptr; - break; - case SPEEX_SET_WIDEBAND: - st->isWideband = *((spx_int32_t*)ptr); - break; - case SPEEX_GET_STACK: - *((char**)ptr) = st->stack; - break; - default: - speex_warning_int("Unknown nb_ctl request: ", request); - return -1; - } - return 0; -} - - -int nb_encode(void *state, void *vin, SpeexBits *bits) -{ - EncState *st; - int i, sub, roots; - int ol_pitch; - spx_word16_t ol_pitch_coef; - spx_word32_t ol_gain; - VARDECL(spx_word16_t *target); - VARDECL(spx_sig_t *innov); - VARDECL(spx_word32_t *exc32); - VARDECL(spx_mem_t *mem); - VARDECL(spx_coef_t *bw_lpc1); - VARDECL(spx_coef_t *bw_lpc2); - VARDECL(spx_coef_t *lpc); - VARDECL(spx_lsp_t *lsp); - VARDECL(spx_lsp_t *qlsp); - VARDECL(spx_lsp_t *interp_lsp); - VARDECL(spx_lsp_t *interp_qlsp); - VARDECL(spx_coef_t *interp_lpc); - VARDECL(spx_coef_t *interp_qlpc); - char *stack; - VARDECL(spx_word16_t *syn_resp); - - spx_word32_t ener=0; - spx_word16_t fine_gain; - spx_word16_t *in = (spx_word16_t*)vin; - - st=(EncState *)state; - stack=st->stack; - - ALLOC(lpc, NB_ORDER, spx_coef_t); - ALLOC(bw_lpc1, NB_ORDER, spx_coef_t); - ALLOC(bw_lpc2, NB_ORDER, spx_coef_t); - ALLOC(lsp, NB_ORDER, spx_lsp_t); - ALLOC(qlsp, NB_ORDER, spx_lsp_t); - ALLOC(interp_lsp, NB_ORDER, spx_lsp_t); - ALLOC(interp_qlsp, NB_ORDER, spx_lsp_t); - ALLOC(interp_lpc, NB_ORDER, spx_coef_t); - ALLOC(interp_qlpc, NB_ORDER, spx_coef_t); - - st->exc = st->excBuf + NB_PITCH_END + 2; - st->sw = st->swBuf + NB_PITCH_END + 2; - /* Move signals 1 frame towards the past */ - SPEEX_MOVE(st->excBuf, st->excBuf+NB_FRAME_SIZE, NB_PITCH_END+2); - SPEEX_MOVE(st->swBuf, st->swBuf+NB_FRAME_SIZE, NB_PITCH_END+2); - - if (st->highpass_enabled) - highpass(in, in, NB_FRAME_SIZE, (st->isWideband?HIGHPASS_WIDEBAND:HIGHPASS_NARROWBAND)|HIGHPASS_INPUT, st->mem_hp); - - { - VARDECL(spx_word16_t *w_sig); - VARDECL(spx_word16_t *autocorr); - ALLOC(w_sig, NB_WINDOW_SIZE, spx_word16_t); - ALLOC(autocorr, NB_ORDER+1, spx_word16_t); - /* Window for analysis */ - for (i=0;iwinBuf[i],st->window[i]); - for (;iwindow[i]); - /* Compute auto-correlation */ - _spx_autocorr(w_sig, autocorr, NB_ORDER+1, NB_WINDOW_SIZE); - autocorr[0] = ADD16(autocorr[0],MULT16_16_Q15(autocorr[0],st->lpc_floor)); /* Noise floor in auto-correlation domain */ - - /* Lag windowing: equivalent to filtering in the power-spectrum domain */ - for (i=0;ilagWindow[i]); - autocorr[0] = ADD16(autocorr[0],1); - - /* Levinson-Durbin */ - _spx_lpc(lpc, autocorr, NB_ORDER); - /* LPC to LSPs (x-domain) transform */ - roots=lpc_to_lsp (lpc, NB_ORDER, lsp, 10, LSP_DELTA1, stack); - /* Check if we found all the roots */ - if (roots!=NB_ORDER) - { - /*If we can't find all LSP's, do some damage control and use previous filter*/ - for (i=0;iold_lsp[i]; - } - } - } - - - - - /* Whole frame analysis (open-loop estimation of pitch and excitation gain) */ - { - int diff = NB_WINDOW_SIZE-NB_FRAME_SIZE; - if (st->first) - for (i=0;iold_lsp, lsp, interp_lsp, NB_ORDER, NB_NB_SUBFRAMES, NB_NB_SUBFRAMES<<1, LSP_MARGIN); - - /* Compute interpolated LPCs (unquantized) for whole frame*/ - lsp_to_lpc(interp_lsp, interp_lpc, NB_ORDER,stack); - - - /*Open-loop pitch*/ - if (!st->submodes[st->submodeID] || (st->complexity>2 && SUBMODE(have_subframe_gain)<3) || SUBMODE(forced_pitch_gain) || SUBMODE(lbr_pitch) != -1 -#ifndef DISABLE_VBR - || st->vbr_enabled || st->vad_enabled -#endif - ) - { - int nol_pitch[6]; - spx_word16_t nol_pitch_coef[6]; - - bw_lpc(0.9, interp_lpc, bw_lpc1, NB_ORDER); - bw_lpc(0.55, interp_lpc, bw_lpc2, NB_ORDER); - - SPEEX_COPY(st->sw, st->winBuf, diff); - SPEEX_COPY(st->sw+diff, in, NB_FRAME_SIZE-diff); - filter10(st->sw, bw_lpc1, bw_lpc2, st->sw, NB_FRAME_SIZE, st->mem_sw_whole, stack); - - open_loop_nbest_pitch(st->sw, NB_PITCH_START, NB_PITCH_END, NB_FRAME_SIZE, - nol_pitch, nol_pitch_coef, 6, stack); - ol_pitch=nol_pitch[0]; - ol_pitch_coef = nol_pitch_coef[0]; - /*Try to remove pitch multiples*/ - for (i=1;i<6;i++) - { -#ifdef FIXED_POINT - if ((nol_pitch_coef[i]>MULT16_16_Q15(nol_pitch_coef[0],27853)) && -#else - if ((nol_pitch_coef[i]>.85*nol_pitch_coef[0]) && -#endif - (ABS(2*nol_pitch[i]-ol_pitch)<=2 || ABS(3*nol_pitch[i]-ol_pitch)<=3 || - ABS(4*nol_pitch[i]-ol_pitch)<=4 || ABS(5*nol_pitch[i]-ol_pitch)<=5)) - { - /*ol_pitch_coef=nol_pitch_coef[i];*/ - ol_pitch = nol_pitch[i]; - } - } - /*if (ol_pitch>50) - ol_pitch/=2;*/ - /*ol_pitch_coef = sqrt(ol_pitch_coef);*/ - - } else { - ol_pitch=0; - ol_pitch_coef=0; - } - - /*Compute "real" excitation*/ - /*SPEEX_COPY(st->exc, st->winBuf, diff); - SPEEX_COPY(st->exc+diff, in, NB_FRAME_SIZE-diff);*/ - fir_mem16(st->winBuf, interp_lpc, st->exc, diff, NB_ORDER, st->mem_exc, stack); - fir_mem16(in, interp_lpc, st->exc+diff, NB_FRAME_SIZE-diff, NB_ORDER, st->mem_exc, stack); - - /* Compute open-loop excitation gain */ - { - spx_word16_t g = compute_rms16(st->exc, NB_FRAME_SIZE); - if (st->submodeID!=1 && ol_pitch>0) - ol_gain = MULT16_16(g, MULT16_16_Q14(QCONST16(1.1,14), - spx_sqrt(QCONST32(1.,28)-MULT16_32_Q15(QCONST16(.8,15),SHL32(MULT16_16(ol_pitch_coef,ol_pitch_coef),16))))); - else - ol_gain = SHL32(EXTEND32(g),SIG_SHIFT); - } - } - -#ifdef VORBIS_PSYCHO - SPEEX_MOVE(st->psy_window, st->psy_window+NB_FRAME_SIZE, 256-NB_FRAME_SIZE); - SPEEX_COPY(&st->psy_window[256-NB_FRAME_SIZE], in, NB_FRAME_SIZE); - compute_curve(st->psy, st->psy_window, st->curve); - /*print_vec(st->curve, 128, "curve");*/ - if (st->first) - SPEEX_COPY(st->old_curve, st->curve, 128); -#endif - - /*VBR stuff*/ -#ifndef DISABLE_VBR - if (st->vbr_enabled||st->vad_enabled) - { - float lsp_dist=0; - for (i=0;iold_lsp[i] - lsp[i])*(st->old_lsp[i] - lsp[i]); - lsp_dist /= LSP_SCALING*LSP_SCALING; - - if (st->abr_enabled) - { - float qual_change=0; - if (st->abr_drift2 * st->abr_drift > 0) - { - /* Only adapt if long-term and short-term drift are the same sign */ - qual_change = -.00001*st->abr_drift/(1+st->abr_count); - if (qual_change>.05) - qual_change=.05; - if (qual_change<-.05) - qual_change=-.05; - } - st->vbr_quality += qual_change; - if (st->vbr_quality>10) - st->vbr_quality=10; - if (st->vbr_quality<0) - st->vbr_quality=0; - } - - st->relative_quality = vbr_analysis(&st->vbr, in, NB_FRAME_SIZE, ol_pitch, GAIN_SCALING_1*ol_pitch_coef); - /*if (delta_qual<0)*/ - /* delta_qual*=.1*(3+st->vbr_quality);*/ - if (st->vbr_enabled) - { - spx_int32_t mode; - int choice=0; - float min_diff=100; - mode = 8; - while (mode) - { - int v1; - float thresh; - v1=(int)floor(st->vbr_quality); - if (v1==10) - thresh = vbr_nb_thresh[mode][v1]; - else - thresh = (st->vbr_quality-v1)*vbr_nb_thresh[mode][v1+1] + (1+v1-st->vbr_quality)*vbr_nb_thresh[mode][v1]; - if (st->relative_quality > thresh && - st->relative_quality-threshrelative_quality-thresh; - } - mode--; - } - mode=choice; - if (mode==0) - { - if (st->dtx_count==0 || lsp_dist>.05 || !st->dtx_enabled || st->dtx_count>20) - { - mode=1; - st->dtx_count=1; - } else { - mode=0; - st->dtx_count++; - } - } else { - st->dtx_count=0; - } - - speex_encoder_ctl(state, SPEEX_SET_MODE, &mode); - if (st->vbr_max>0) - { - spx_int32_t rate; - speex_encoder_ctl(state, SPEEX_GET_BITRATE, &rate); - if (rate > st->vbr_max) - { - rate = st->vbr_max; - speex_encoder_ctl(state, SPEEX_SET_BITRATE, &rate); - } - } - - if (st->abr_enabled) - { - spx_int32_t bitrate; - speex_encoder_ctl(state, SPEEX_GET_BITRATE, &bitrate); - st->abr_drift+=(bitrate-st->abr_enabled); - st->abr_drift2 = .95*st->abr_drift2 + .05*(bitrate-st->abr_enabled); - st->abr_count += 1.0; - } - - } else { - /*VAD only case*/ - int mode; - if (st->relative_quality<2) - { - if (st->dtx_count==0 || lsp_dist>.05 || !st->dtx_enabled || st->dtx_count>20) - { - st->dtx_count=1; - mode=1; - } else { - mode=0; - st->dtx_count++; - } - } else { - st->dtx_count = 0; - mode=st->submodeSelect; - } - /*speex_encoder_ctl(state, SPEEX_SET_MODE, &mode);*/ - st->submodeID=mode; - } - } else { - st->relative_quality = -1; - } -#endif /* #ifndef DISABLE_VBR */ - - if (st->encode_submode) - { - /* First, transmit a zero for narrowband */ - speex_bits_pack(bits, 0, 1); - - /* Transmit the sub-mode we use for this frame */ - speex_bits_pack(bits, st->submodeID, NB_SUBMODE_BITS); - - } - - /* If null mode (no transmission), just set a couple things to zero*/ - if (st->submodes[st->submodeID] == NULL) - { - for (i=0;iexc[i]=st->sw[i]=VERY_SMALL; - - for (i=0;imem_sw[i]=0; - st->first=1; - st->bounded_pitch = 1; - - SPEEX_COPY(st->winBuf, in+2*NB_FRAME_SIZE-NB_WINDOW_SIZE, NB_WINDOW_SIZE-NB_FRAME_SIZE); - - /* Clear memory (no need to really compute it) */ - for (i=0;imem_sp[i] = 0; - return 0; - - } - - /* LSP Quantization */ - if (st->first) - { - for (i=0;iold_lsp[i] = lsp[i]; - } - - - /*Quantize LSPs*/ -#if 1 /*0 for unquantized*/ - SUBMODE(lsp_quant)(lsp, qlsp, NB_ORDER, bits); -#else - for (i=0;i15) - quant=15; - if (quant<0) - quant=0; - speex_bits_pack(bits, quant, 4); - ol_pitch_coef=MULT16_16_P15(QCONST16(0.066667,15),SHL16(quant,GAIN_SHIFT)); - } - - - /*Quantize and transmit open-loop excitation gain*/ -#ifdef FIXED_POINT - { - int qe = scal_quant32(ol_gain, ol_gain_table, 32); - /*ol_gain = exp(qe/3.5)*SIG_SCALING;*/ - ol_gain = MULT16_32_Q15(28406,ol_gain_table[qe]); - speex_bits_pack(bits, qe, 5); - } -#else - { - int qe = (int)(floor(.5+3.5*log(ol_gain*1.0/SIG_SCALING))); - if (qe<0) - qe=0; - if (qe>31) - qe=31; - ol_gain = exp(qe/3.5)*SIG_SCALING; - speex_bits_pack(bits, qe, 5); - } -#endif - - - - /* Special case for first frame */ - if (st->first) - { - for (i=0;iold_qlsp[i] = qlsp[i]; - } - - /* Target signal */ - ALLOC(target, NB_SUBFRAME_SIZE, spx_word16_t); - ALLOC(innov, NB_SUBFRAME_SIZE, spx_sig_t); - ALLOC(exc32, NB_SUBFRAME_SIZE, spx_word32_t); - ALLOC(syn_resp, NB_SUBFRAME_SIZE, spx_word16_t); - ALLOC(mem, NB_ORDER, spx_mem_t); - - /* Loop on sub-frames */ - for (sub=0;subexc+offset; - /* Weighted signal */ - sw=st->sw+offset; - - /* LSP interpolation (quantized and unquantized) */ - lsp_interpolate(st->old_lsp, lsp, interp_lsp, NB_ORDER, sub, NB_NB_SUBFRAMES, LSP_MARGIN); - lsp_interpolate(st->old_qlsp, qlsp, interp_qlsp, NB_ORDER, sub, NB_NB_SUBFRAMES, LSP_MARGIN); - - /* Compute interpolated LPCs (quantized and unquantized) */ - lsp_to_lpc(interp_lsp, interp_lpc, NB_ORDER,stack); - - lsp_to_lpc(interp_qlsp, interp_qlpc, NB_ORDER, stack); - - /* Compute analysis filter gain at w=pi (for use in SB-CELP) */ - { - spx_word32_t pi_g=LPC_SCALING; - for (i=0;iinterp_qlpc[i] + st->interp_qlpc[i+1];*/ - pi_g = ADD32(pi_g, SUB32(EXTEND32(interp_qlpc[i+1]),EXTEND32(interp_qlpc[i]))); - } - st->pi_gain[sub] = pi_g; - } - -#ifdef VORBIS_PSYCHO - { - float curr_curve[128]; - float fact = ((float)sub+1.0f)/NB_NB_SUBFRAMES; - for (i=0;i<128;i++) - curr_curve[i] = (1.0f-fact)*st->old_curve[i] + fact*st->curve[i]; - curve_to_lpc(st->psy, curr_curve, bw_lpc1, bw_lpc2, 10); - } -#else - /* Compute bandwidth-expanded (unquantized) LPCs for perceptual weighting */ - bw_lpc(st->gamma1, interp_lpc, bw_lpc1, NB_ORDER); - bw_lpc(st->gamma2, interp_lpc, bw_lpc2, NB_ORDER); - /*print_vec(st->bw_lpc1, 10, "bw_lpc");*/ -#endif - - /*FIXME: This will break if we change the window size */ - speex_assert(NB_WINDOW_SIZE-NB_FRAME_SIZE == NB_SUBFRAME_SIZE); - if (sub==0) - inBuf = st->winBuf; - else - inBuf = &in[((sub-1)*NB_SUBFRAME_SIZE)]; - for (i=0;icomplexity==0) - response_bound >>= 1; - compute_impulse_response(interp_qlpc, bw_lpc1, bw_lpc2, syn_resp, response_bound, NB_ORDER, stack); - for (i=response_bound;imem_sp[i],1); - for (i=0;imem_sw[i],1); - filter10(exc, st->bw_lpc1, st->bw_lpc2, exc, response_bound, mem, stack); - SPEEX_MEMSET(&exc[response_bound], 0, NB_SUBFRAME_SIZE-response_bound); -#else - iir_mem16(exc, interp_qlpc, exc, NB_SUBFRAME_SIZE, NB_ORDER, mem, stack); - for (i=0;imem_sw[i],1); - filter10(exc, bw_lpc1, bw_lpc2, exc, NB_SUBFRAME_SIZE, mem, stack); -#endif - - /* Compute weighted signal */ - for (i=0;imem_sw[i]; - filter10(sw, bw_lpc1, bw_lpc2, sw, NB_SUBFRAME_SIZE, mem, stack); - - if (st->complexity==0) - for (i=0;imem_sw[i]=mem[i]; - - /* Compute target signal (saturation prevents overflows on clipped input speech) */ - for (i=0;imem_exc2, stack); - /* If we have a long-term predictor (otherwise, something's wrong) */ - speex_assert (SUBMODE(ltp_quant)); - { - int pit_min, pit_max; - /* Long-term prediction */ - if (SUBMODE(lbr_pitch) != -1) - { - /* Low bit-rate pitch handling */ - int margin; - margin = SUBMODE(lbr_pitch); - if (margin) - { - if (ol_pitch < NB_PITCH_START+margin-1) - ol_pitch=NB_PITCH_START+margin-1; - if (ol_pitch > NB_PITCH_END-margin) - ol_pitch=NB_PITCH_END-margin; - pit_min = ol_pitch-margin+1; - pit_max = ol_pitch+margin; - } else { - pit_min=pit_max=ol_pitch; - } - } else { - pit_min = NB_PITCH_START; - pit_max = NB_PITCH_END; - } - - /* Force pitch to use only the current frame if needed */ - if (st->bounded_pitch && pit_max>offset) - pit_max=offset; - - /* Perform pitch search */ - pitch = SUBMODE(ltp_quant)(target, sw, interp_qlpc, bw_lpc1, bw_lpc2, - exc32, SUBMODE(ltp_params), pit_min, pit_max, ol_pitch_coef, - NB_ORDER, NB_SUBFRAME_SIZE, bits, stack, - exc, syn_resp, st->complexity, 0, st->plc_tuning, &st->cumul_gain); - - st->pitch[sub]=pitch; - } - /* Quantization of innovation */ - SPEEX_MEMSET(innov, 0, NB_SUBFRAME_SIZE); - - /* FIXME: Make sure this is safe from overflows (so far so good) */ - for (i=0;icomplexity, SUBMODE(double_codebook)); - - /* De-normalize innovation and update excitation */ - signal_mul(innov, innov, ener, NB_SUBFRAME_SIZE); - - /* In some (rare) modes, we do a second search (more bits) to reduce noise even more */ - if (SUBMODE(double_codebook)) { - char *tmp_stack=stack; - VARDECL(spx_sig_t *innov2); - ALLOC(innov2, NB_SUBFRAME_SIZE, spx_sig_t); - SPEEX_MEMSET(innov2, 0, NB_SUBFRAME_SIZE); - for (i=0;icomplexity, 0); - signal_mul(innov2, innov2, MULT16_32_Q15(QCONST16(0.454545f,15),ener), NB_SUBFRAME_SIZE); - for (i=0;iinnov_rms_save) - st->innov_rms_save[sub] = compute_rms(innov, NB_SUBFRAME_SIZE); - } - - /* Final signal synthesis from excitation */ - iir_mem16(exc, interp_qlpc, sw, NB_SUBFRAME_SIZE, NB_ORDER, st->mem_sp, stack); - - /* Compute weighted signal again, from synthesized speech (not sure it's the right thing) */ - if (st->complexity!=0) - filter10(sw, bw_lpc1, bw_lpc2, sw, NB_SUBFRAME_SIZE, st->mem_sw, stack); - - } - - /* Store the LSPs for interpolation in the next frame */ - if (st->submodeID>=1) - { - for (i=0;iold_lsp[i] = lsp[i]; - for (i=0;iold_qlsp[i] = qlsp[i]; - } - -#ifdef VORBIS_PSYCHO - if (st->submodeID>=1) - SPEEX_COPY(st->old_curve, st->curve, 128); -#endif - - if (st->submodeID==1) - { -#ifndef DISABLE_VBR - if (st->dtx_count) - speex_bits_pack(bits, 15, 4); - else -#endif - speex_bits_pack(bits, 0, 4); - } - - /* The next frame will not be the first (Duh!) */ - st->first = 0; - SPEEX_COPY(st->winBuf, in+2*NB_FRAME_SIZE-NB_WINDOW_SIZE, NB_WINDOW_SIZE-NB_FRAME_SIZE); - - if (SUBMODE(innovation_quant) == noise_codebook_quant || st->submodeID==0) - st->bounded_pitch = 1; - else - st->bounded_pitch = 0; - - return 1; -} -#endif /* DISABLE_ENCODER */ - - -#ifndef DISABLE_DECODER -void *nb_decoder_init(const SpeexMode *m) -{ - DecState *st; - const SpeexNBMode *mode; - int i; - - mode=(const SpeexNBMode*)m->mode; - st = (DecState *)speex_alloc(sizeof(DecState)); - if (!st) - return NULL; -#if defined(VAR_ARRAYS) || defined (USE_ALLOCA) - st->stack = NULL; -#else - st->stack = (char*)speex_alloc_scratch(NB_DEC_STACK); -#endif - - st->mode=m; - - - st->encode_submode = 1; - - st->first=1; - /* Codec parameters, should eventually have several "modes"*/ - - st->submodes=mode->submodes; - st->submodeID=mode->defaultSubmode; - - st->lpc_enh_enabled=1; - - SPEEX_MEMSET(st->excBuf, 0, NB_FRAME_SIZE + NB_PITCH_END); - - st->last_pitch = 40; - st->count_lost=0; - st->pitch_gain_buf[0] = st->pitch_gain_buf[1] = st->pitch_gain_buf[2] = 0; - st->pitch_gain_buf_idx = 0; - st->seed = 1000; - - st->sampling_rate=8000; - st->last_ol_gain = 0; - - st->user_callback.func = &speex_default_user_handler; - st->user_callback.data = NULL; - for (i=0;i<16;i++) - st->speex_callbacks[i].func = NULL; - - st->voc_m1=st->voc_m2=st->voc_mean=0; - st->voc_offset=0; - st->dtx_enabled=0; - st->isWideband = 0; - st->highpass_enabled = 1; - -#ifdef ENABLE_VALGRIND - VALGRIND_MAKE_READABLE(st, NB_DEC_STACK); -#endif - return st; -} - -void nb_decoder_destroy(void *state) -{ -#if !(defined(VAR_ARRAYS) || defined (USE_ALLOCA)) - DecState *st; - st=(DecState*)state; - - speex_free_scratch(st->stack); -#endif - - speex_free(state); -} - -int nb_decoder_ctl(void *state, int request, void *ptr) -{ - DecState *st; - st=(DecState*)state; - switch(request) - { - case SPEEX_SET_LOW_MODE: - case SPEEX_SET_MODE: - st->submodeID = (*(spx_int32_t*)ptr); - break; - case SPEEX_GET_LOW_MODE: - case SPEEX_GET_MODE: - (*(spx_int32_t*)ptr) = st->submodeID; - break; - case SPEEX_SET_ENH: - st->lpc_enh_enabled = *((spx_int32_t*)ptr); - break; - case SPEEX_GET_ENH: - *((spx_int32_t*)ptr) = st->lpc_enh_enabled; - break; - case SPEEX_GET_FRAME_SIZE: - (*(spx_int32_t*)ptr) = NB_FRAME_SIZE; - break; - case SPEEX_GET_BITRATE: - if (st->submodes[st->submodeID]) - (*(spx_int32_t*)ptr) = st->sampling_rate*SUBMODE(bits_per_frame)/NB_FRAME_SIZE; - else - (*(spx_int32_t*)ptr) = st->sampling_rate*(NB_SUBMODE_BITS+1)/NB_FRAME_SIZE; - break; - case SPEEX_SET_SAMPLING_RATE: - st->sampling_rate = (*(spx_int32_t*)ptr); - break; - case SPEEX_GET_SAMPLING_RATE: - (*(spx_int32_t*)ptr)=st->sampling_rate; - break; - case SPEEX_SET_HANDLER: - { - SpeexCallback *c = (SpeexCallback*)ptr; - st->speex_callbacks[c->callback_id].func=c->func; - st->speex_callbacks[c->callback_id].data=c->data; - st->speex_callbacks[c->callback_id].callback_id=c->callback_id; - } - break; - case SPEEX_SET_USER_HANDLER: - { - SpeexCallback *c = (SpeexCallback*)ptr; - st->user_callback.func=c->func; - st->user_callback.data=c->data; - st->user_callback.callback_id=c->callback_id; - } - break; - case SPEEX_RESET_STATE: - { - int i; - for (i=0;imem_sp[i]=0; - for (i=0;iexcBuf[i]=0; - } - break; - case SPEEX_SET_SUBMODE_ENCODING: - st->encode_submode = (*(spx_int32_t*)ptr); - break; - case SPEEX_GET_SUBMODE_ENCODING: - (*(spx_int32_t*)ptr) = st->encode_submode; - break; - case SPEEX_GET_LOOKAHEAD: - (*(spx_int32_t*)ptr)=NB_SUBFRAME_SIZE; - break; - case SPEEX_SET_HIGHPASS: - st->highpass_enabled = (*(spx_int32_t*)ptr); - break; - case SPEEX_GET_HIGHPASS: - (*(spx_int32_t*)ptr) = st->highpass_enabled; - break; - /* FIXME: Convert to fixed-point and re-enable even when float API is disabled */ -#ifndef DISABLE_FLOAT_API - case SPEEX_GET_ACTIVITY: - { - float ret; - ret = log(st->level/st->min_level)/log(st->max_level/st->min_level); - if (ret>1) - ret = 1; - /* Done in a strange way to catch NaNs as well */ - if (!(ret > 0)) - ret = 0; - /*printf ("%f %f %f %f\n", st->level, st->min_level, st->max_level, ret);*/ - (*(spx_int32_t*)ptr) = (int)(100*ret); - } - break; -#endif - case SPEEX_GET_PI_GAIN: - { - int i; - spx_word32_t *g = (spx_word32_t*)ptr; - for (i=0;ipi_gain[i]; - } - break; - case SPEEX_GET_EXC: - { - int i; - for (i=0;iexc+i*NB_SUBFRAME_SIZE, NB_SUBFRAME_SIZE); - } - break; - case SPEEX_GET_DTX_STATUS: - *((spx_int32_t*)ptr) = st->dtx_enabled; - break; - case SPEEX_SET_INNOVATION_SAVE: - st->innov_save = (spx_word16_t*)ptr; - break; - case SPEEX_SET_WIDEBAND: - st->isWideband = *((spx_int32_t*)ptr); - break; - case SPEEX_GET_STACK: - *((char**)ptr) = st->stack; - break; - default: - speex_warning_int("Unknown nb_ctl request: ", request); - return -1; - } - return 0; -} - - -#define median3(a, b, c) ((a) < (b) ? ((b) < (c) ? (b) : ((a) < (c) ? (c) : (a))) : ((c) < (b) ? (b) : ((c) < (a) ? (c) : (a)))) - -#ifdef FIXED_POINT -const spx_word16_t attenuation[10] = {32767, 31483, 27923, 22861, 17278, 12055, 7764, 4616, 2533, 1283}; -#else -const spx_word16_t attenuation[10] = {1., 0.961, 0.852, 0.698, 0.527, 0.368, 0.237, 0.141, 0.077, 0.039}; - -#endif - -static void nb_decode_lost(DecState *st, spx_word16_t *out, char *stack) -{ - int i; - int pitch_val; - spx_word16_t pitch_gain; - spx_word16_t fact; - spx_word16_t gain_med; - spx_word16_t innov_gain; - spx_word16_t noise_gain; - - st->exc = st->excBuf + 2*NB_PITCH_END + NB_SUBFRAME_SIZE + 6; - - if (st->count_lost<10) - fact = attenuation[st->count_lost]; - else - fact = 0; - - gain_med = median3(st->pitch_gain_buf[0], st->pitch_gain_buf[1], st->pitch_gain_buf[2]); - if (gain_med < st->last_pitch_gain) - st->last_pitch_gain = gain_med; - -#ifdef FIXED_POINT - pitch_gain = st->last_pitch_gain; - if (pitch_gain>54) - pitch_gain = 54; - pitch_gain = SHL16(pitch_gain, 9); -#else - pitch_gain = GAIN_SCALING_1*st->last_pitch_gain; - if (pitch_gain>.85) - pitch_gain=.85; -#endif - pitch_gain = MULT16_16_Q15(fact,pitch_gain) + VERY_SMALL; - /* FIXME: This was rms of innovation (not exc) */ - innov_gain = compute_rms16(st->exc, NB_FRAME_SIZE); - noise_gain = MULT16_16_Q15(innov_gain, MULT16_16_Q15(fact, SUB16(Q15ONE,MULT16_16_Q15(pitch_gain,pitch_gain)))); - /* Shift all buffers by one frame */ - SPEEX_MOVE(st->excBuf, st->excBuf+NB_FRAME_SIZE, 2*NB_PITCH_END + NB_SUBFRAME_SIZE + 12); - - - pitch_val = st->last_pitch + SHR32((spx_int32_t)speex_rand(1+st->count_lost, &st->seed),SIG_SHIFT); - if (pitch_val > NB_PITCH_END) - pitch_val = NB_PITCH_END; - if (pitch_val < NB_PITCH_START) - pitch_val = NB_PITCH_START; - for (i=0;iexc[i]= MULT16_16_Q15(pitch_gain, (st->exc[i-pitch_val]+VERY_SMALL)) + - speex_rand(noise_gain, &st->seed); - } - - bw_lpc(QCONST16(.98,15), st->interp_qlpc, st->interp_qlpc, NB_ORDER); - iir_mem16(&st->exc[-NB_SUBFRAME_SIZE], st->interp_qlpc, out, NB_FRAME_SIZE, - NB_ORDER, st->mem_sp, stack); - highpass(out, out, NB_FRAME_SIZE, HIGHPASS_NARROWBAND|HIGHPASS_OUTPUT, st->mem_hp); - - st->first = 0; - st->count_lost++; - st->pitch_gain_buf[st->pitch_gain_buf_idx++] = PSHR16(pitch_gain,9); - if (st->pitch_gain_buf_idx > 2) /* rollover */ - st->pitch_gain_buf_idx = 0; -} - -/* Just so we don't need to carry the complete wideband mode information */ -static const int wb_skip_table[8] = {0, 36, 112, 192, 352, 0, 0, 0}; - -int nb_decode(void *state, SpeexBits *bits, void *vout) -{ - DecState *st; - int i, sub; - int pitch; - spx_word16_t pitch_gain[3]; - spx_word32_t ol_gain=0; - int ol_pitch=0; - spx_word16_t ol_pitch_coef=0; - int best_pitch=40; - spx_word16_t best_pitch_gain=0; - int wideband; - int m; - char *stack; - VARDECL(spx_sig_t *innov); - VARDECL(spx_word32_t *exc32); - VARDECL(spx_coef_t *ak); - VARDECL(spx_lsp_t *qlsp); - spx_word16_t pitch_average=0; - - spx_word16_t *out = (spx_word16_t*)vout; - VARDECL(spx_lsp_t *interp_qlsp); - - st=(DecState*)state; - stack=st->stack; - - st->exc = st->excBuf + 2*NB_PITCH_END + NB_SUBFRAME_SIZE + 6; - - /* Check if we're in DTX mode*/ - if (!bits && st->dtx_enabled) - { - st->submodeID=0; - } else - { - /* If bits is NULL, consider the packet to be lost (what could we do anyway) */ - if (!bits) - { - nb_decode_lost(st, out, stack); - return 0; - } - - if (st->encode_submode) - { - - /* Search for next narrowband block (handle requests, skip wideband blocks) */ - do { - if (speex_bits_remaining(bits)<5) - return -1; - wideband = speex_bits_unpack_unsigned(bits, 1); - if (wideband) /* Skip wideband block (for compatibility) */ - { - int submode; - int advance; - advance = submode = speex_bits_unpack_unsigned(bits, SB_SUBMODE_BITS); - /*speex_mode_query(&speex_wb_mode, SPEEX_SUBMODE_BITS_PER_FRAME, &advance);*/ - advance = wb_skip_table[submode]; - if (advance < 0) - { - speex_notify("Invalid mode encountered. The stream is corrupted."); - return -2; - } - advance -= (SB_SUBMODE_BITS+1); - speex_bits_advance(bits, advance); - - if (speex_bits_remaining(bits)<5) - return -1; - wideband = speex_bits_unpack_unsigned(bits, 1); - if (wideband) - { - advance = submode = speex_bits_unpack_unsigned(bits, SB_SUBMODE_BITS); - /*speex_mode_query(&speex_wb_mode, SPEEX_SUBMODE_BITS_PER_FRAME, &advance);*/ - advance = wb_skip_table[submode]; - if (advance < 0) - { - speex_notify("Invalid mode encountered. The stream is corrupted."); - return -2; - } - advance -= (SB_SUBMODE_BITS+1); - speex_bits_advance(bits, advance); - wideband = speex_bits_unpack_unsigned(bits, 1); - if (wideband) - { - speex_notify("More than two wideband layers found. The stream is corrupted."); - return -2; - } - - } - } - if (speex_bits_remaining(bits)<4) - return -1; - /* FIXME: Check for overflow */ - m = speex_bits_unpack_unsigned(bits, 4); - if (m==15) /* We found a terminator */ - { - return -1; - } else if (m==14) /* Speex in-band request */ - { - int ret = speex_inband_handler(bits, st->speex_callbacks, state); - if (ret) - return ret; - } else if (m==13) /* User in-band request */ - { - int ret = st->user_callback.func(bits, state, st->user_callback.data); - if (ret) - return ret; - } else if (m>8) /* Invalid mode */ - { - speex_notify("Invalid mode encountered. The stream is corrupted."); - return -2; - } - - } while (m>8); - - /* Get the sub-mode that was used */ - st->submodeID = m; - } - - } - - /* Shift all buffers by one frame */ - SPEEX_MOVE(st->excBuf, st->excBuf+NB_FRAME_SIZE, 2*NB_PITCH_END + NB_SUBFRAME_SIZE + 12); - - /* If null mode (no transmission), just set a couple things to zero*/ - if (st->submodes[st->submodeID] == NULL) - { - VARDECL(spx_coef_t *lpc); - ALLOC(lpc, NB_ORDER, spx_coef_t); - bw_lpc(QCONST16(0.93f,15), st->interp_qlpc, lpc, NB_ORDER); - { - spx_word16_t innov_gain=0; - /* FIXME: This was innov, not exc */ - innov_gain = compute_rms16(st->exc, NB_FRAME_SIZE); - for (i=0;iexc[i]=speex_rand(innov_gain, &st->seed); - } - - - st->first=1; - - /* Final signal synthesis from excitation */ - iir_mem16(st->exc, lpc, out, NB_FRAME_SIZE, NB_ORDER, st->mem_sp, stack); - - st->count_lost=0; - return 0; - } - - ALLOC(qlsp, NB_ORDER, spx_lsp_t); - - /* Unquantize LSPs */ - SUBMODE(lsp_unquant)(qlsp, NB_ORDER, bits); - - /*Damp memory if a frame was lost and the LSP changed too much*/ - if (st->count_lost) - { - spx_word16_t fact; - spx_word32_t lsp_dist=0; - for (i=0;iold_qlsp[i] - qlsp[i]))); -#ifdef FIXED_POINT - fact = SHR16(19661,SHR32(lsp_dist,LSP_SHIFT+2)); -#else - fact = .6*exp(-.2*lsp_dist); -#endif - for (i=0;imem_sp[i] = MULT16_32_Q15(fact,st->mem_sp[i]); - } - - - /* Handle first frame and lost-packet case */ - if (st->first || st->count_lost) - { - for (i=0;iold_qlsp[i] = qlsp[i]; - } - - /* Get open-loop pitch estimation for low bit-rate pitch coding */ - if (SUBMODE(lbr_pitch)!=-1) - { - ol_pitch = NB_PITCH_START+speex_bits_unpack_unsigned(bits, 7); - } - - if (SUBMODE(forced_pitch_gain)) - { - int quant; - quant = speex_bits_unpack_unsigned(bits, 4); - ol_pitch_coef=MULT16_16_P15(QCONST16(0.066667,15),SHL16(quant,GAIN_SHIFT)); - } - - /* Get global excitation gain */ - { - int qe; - qe = speex_bits_unpack_unsigned(bits, 5); -#ifdef FIXED_POINT - /* FIXME: Perhaps we could slightly lower the gain here when the output is going to saturate? */ - ol_gain = MULT16_32_Q15(28406,ol_gain_table[qe]); -#else - ol_gain = SIG_SCALING*exp(qe/3.5); -#endif - } - - ALLOC(ak, NB_ORDER, spx_coef_t); - ALLOC(innov, NB_SUBFRAME_SIZE, spx_sig_t); - ALLOC(exc32, NB_SUBFRAME_SIZE, spx_word32_t); - - if (st->submodeID==1) - { - int extra; - extra = speex_bits_unpack_unsigned(bits, 4); - - if (extra==15) - st->dtx_enabled=1; - else - st->dtx_enabled=0; - } - if (st->submodeID>1) - st->dtx_enabled=0; - - /*Loop on subframes */ - for (sub=0;subexc+offset; - /* Original signal */ - if (st->innov_save) - innov_save = st->innov_save+offset; - - - /* Reset excitation */ - SPEEX_MEMSET(exc, 0, NB_SUBFRAME_SIZE); - - /*Adaptive codebook contribution*/ - speex_assert (SUBMODE(ltp_unquant)); - { - int pit_min, pit_max; - /* Handle pitch constraints if any */ - if (SUBMODE(lbr_pitch) != -1) - { - int margin; - margin = SUBMODE(lbr_pitch); - if (margin) - { -/* GT - need optimization? - if (ol_pitch < NB_PITCH_START+margin-1) - ol_pitch=NB_PITCH_START+margin-1; - if (ol_pitch > NB_PITCH_END-margin) - ol_pitch=NB_PITCH_END-margin; - pit_min = ol_pitch-margin+1; - pit_max = ol_pitch+margin; -*/ - pit_min = ol_pitch-margin+1; - if (pit_min < NB_PITCH_START) - pit_min = NB_PITCH_START; - pit_max = ol_pitch+margin; - if (pit_max > NB_PITCH_END) - pit_max = NB_PITCH_END; - } else { - pit_min = pit_max = ol_pitch; - } - } else { - pit_min = NB_PITCH_START; - pit_max = NB_PITCH_END; - } - - - - SUBMODE(ltp_unquant)(exc, exc32, pit_min, pit_max, ol_pitch_coef, SUBMODE(ltp_params), - NB_SUBFRAME_SIZE, &pitch, &pitch_gain[0], bits, stack, - st->count_lost, offset, st->last_pitch_gain, 0); - - /* Ensuring that things aren't blowing up as would happen if e.g. an encoder is - crafting packets to make us produce NaNs and slow down the decoder (vague DoS threat). - We can probably be even more aggressive and limit to 15000 or so. */ - sanitize_values32(exc32, NEG32(QCONST32(32000,SIG_SHIFT-1)), QCONST32(32000,SIG_SHIFT-1), NB_SUBFRAME_SIZE); - - tmp = gain_3tap_to_1tap(pitch_gain); - - pitch_average += tmp; - if ((tmp>best_pitch_gain&&ABS(2*best_pitch-pitch)>=3&&ABS(3*best_pitch-pitch)>=4&&ABS(4*best_pitch-pitch)>=5) - || (tmp>MULT16_16_Q15(QCONST16(.6,15),best_pitch_gain)&&(ABS(best_pitch-2*pitch)<3||ABS(best_pitch-3*pitch)<4||ABS(best_pitch-4*pitch)<5)) - || (MULT16_16_Q15(QCONST16(.67,15),tmp)>best_pitch_gain&&(ABS(2*best_pitch-pitch)<3||ABS(3*best_pitch-pitch)<4||ABS(4*best_pitch-pitch)<5)) ) - { - best_pitch = pitch; - if (tmp > best_pitch_gain) - best_pitch_gain = tmp; - } - } - - /* Unquantize the innovation */ - { - int q_energy; - spx_word32_t ener; - - SPEEX_MEMSET(innov, 0, NB_SUBFRAME_SIZE); - - /* Decode sub-frame gain correction */ - if (SUBMODE(have_subframe_gain)==3) - { - q_energy = speex_bits_unpack_unsigned(bits, 3); - ener = MULT16_32_Q14(exc_gain_quant_scal3[q_energy],ol_gain); - } else if (SUBMODE(have_subframe_gain)==1) - { - q_energy = speex_bits_unpack_unsigned(bits, 1); - ener = MULT16_32_Q14(exc_gain_quant_scal1[q_energy],ol_gain); - } else { - ener = ol_gain; - } - - speex_assert (SUBMODE(innovation_unquant)); - { - /*Fixed codebook contribution*/ - SUBMODE(innovation_unquant)(innov, SUBMODE(innovation_params), NB_SUBFRAME_SIZE, bits, stack, &st->seed); - /* De-normalize innovation and update excitation */ - - signal_mul(innov, innov, ener, NB_SUBFRAME_SIZE); - - /* Decode second codebook (only for some modes) */ - if (SUBMODE(double_codebook)) - { - char *tmp_stack=stack; - VARDECL(spx_sig_t *innov2); - ALLOC(innov2, NB_SUBFRAME_SIZE, spx_sig_t); - SPEEX_MEMSET(innov2, 0, NB_SUBFRAME_SIZE); - SUBMODE(innovation_unquant)(innov2, SUBMODE(innovation_params), NB_SUBFRAME_SIZE, bits, stack, &st->seed); - signal_mul(innov2, innov2, MULT16_32_Q15(QCONST16(0.454545f,15),ener), NB_SUBFRAME_SIZE); - for (i=0;isubmodeID==1) - { - spx_word16_t g=ol_pitch_coef; - g=MULT16_16_P14(QCONST16(1.5f,14),(g-QCONST16(.2f,6))); - if (g<0) - g=0; - if (g>GAIN_SCALING) - g=GAIN_SCALING; - - SPEEX_MEMSET(exc, 0, NB_SUBFRAME_SIZE); - while (st->voc_offsetvoc_offset]= g*sqrt(2*ol_pitch)*ol_gain; - Not quite sure why we need the factor of two in the sqrt */ - if (st->voc_offset>=0) - exc[st->voc_offset]=MULT16_16(spx_sqrt(MULT16_16_16(2,ol_pitch)),EXTRACT16(PSHR32(MULT16_16(g,PSHR32(ol_gain,SIG_SHIFT)),6))); - st->voc_offset+=ol_pitch; - } - st->voc_offset -= NB_SUBFRAME_SIZE; - - for (i=0;ivoc_m1)), - SUB16(MULT16_16_Q15(Q15_ONE-MULT16_16_16(QCONST16(.85f,9),g),EXTRACT16(PSHR32(innov[i],SIG_SHIFT))), - MULT16_16_Q15(MULT16_16_16(QCONST16(.15f,9),g),EXTRACT16(PSHR32(st->voc_m2,SIG_SHIFT))) - )); - st->voc_m1 = exci; - st->voc_m2=innov[i]; - st->voc_mean = EXTRACT16(PSHR32(ADD32(MULT16_16(QCONST16(.8f,15),st->voc_mean), MULT16_16(QCONST16(.2f,15),exc[i])), 15)); - exc[i]-=st->voc_mean; - } - } - - } - } - - ALLOC(interp_qlsp, NB_ORDER, spx_lsp_t); - - if (st->lpc_enh_enabled && SUBMODE(comb_gain)>0 && !st->count_lost) - { - multicomb(st->exc-NB_SUBFRAME_SIZE, out, st->interp_qlpc, NB_ORDER, 2*NB_SUBFRAME_SIZE, best_pitch, 40, SUBMODE(comb_gain), stack); - multicomb(st->exc+NB_SUBFRAME_SIZE, out+2*NB_SUBFRAME_SIZE, st->interp_qlpc, NB_ORDER, 2*NB_SUBFRAME_SIZE, best_pitch, 40, SUBMODE(comb_gain), stack); - } else { - SPEEX_COPY(out, &st->exc[-NB_SUBFRAME_SIZE], NB_FRAME_SIZE); - } - - /* If the last packet was lost, re-scale the excitation to obtain the same energy as encoded in ol_gain */ - if (st->count_lost) - { - spx_word16_t exc_ener; - spx_word32_t gain32; - spx_word16_t gain; - exc_ener = compute_rms16 (st->exc, NB_FRAME_SIZE); - gain32 = PDIV32(ol_gain, ADD16(exc_ener,1)); -#ifdef FIXED_POINT - if (gain32 > 32767) - gain32 = 32767; - gain = EXTRACT16(gain32); -#else - if (gain32 > 2) - gain32=2; - gain = gain32; -#endif - for (i=0;iexc[i] = MULT16_16_Q14(gain, st->exc[i]); - out[i]=st->exc[i-NB_SUBFRAME_SIZE]; - } - } - - /*Loop on subframes */ - for (sub=0;subold_qlsp, qlsp, interp_qlsp, NB_ORDER, sub, NB_NB_SUBFRAMES, LSP_MARGIN); - - /* Compute interpolated LPCs (unquantized) */ - lsp_to_lpc(interp_qlsp, ak, NB_ORDER, stack); - - /* Compute analysis filter at w=pi */ - { - spx_word32_t pi_g=LPC_SCALING; - for (i=0;iinterp_qlpc[i] + st->interp_qlpc[i+1];*/ - pi_g = ADD32(pi_g, SUB32(EXTEND32(ak[i+1]),EXTEND32(ak[i]))); - } - st->pi_gain[sub] = pi_g; - } - - iir_mem16(sp, st->interp_qlpc, sp, NB_SUBFRAME_SIZE, NB_ORDER, - st->mem_sp, stack); - - for (i=0;iinterp_qlpc[i] = ak[i]; - - } - - if (st->highpass_enabled) - highpass(out, out, NB_FRAME_SIZE, (st->isWideband?HIGHPASS_WIDEBAND:HIGHPASS_NARROWBAND)|HIGHPASS_OUTPUT, st->mem_hp); - /*for (i=0;iframe[i]);*/ - - /* Tracking output level */ - st->level = 1+PSHR32(ol_gain,SIG_SHIFT); - st->max_level = MAX16(MULT16_16_Q15(QCONST16(.99f,15), st->max_level), st->level); - st->min_level = MIN16(ADD16(1,MULT16_16_Q14(QCONST16(1.01f,14), st->min_level)), st->level); - if (st->max_level < st->min_level+1) - st->max_level = st->min_level+1; - /*printf ("%f %f %f %d\n", og, st->min_level, st->max_level, update);*/ - - /* Store the LSPs for interpolation in the next frame */ - for (i=0;iold_qlsp[i] = qlsp[i]; - - /* The next frame will not be the first (Duh!) */ - st->first = 0; - st->count_lost=0; - st->last_pitch = best_pitch; -#ifdef FIXED_POINT - st->last_pitch_gain = PSHR16(pitch_average,2); -#else - st->last_pitch_gain = .25*pitch_average; -#endif - st->pitch_gain_buf[st->pitch_gain_buf_idx++] = st->last_pitch_gain; - if (st->pitch_gain_buf_idx > 2) /* rollover */ - st->pitch_gain_buf_idx = 0; - - st->last_ol_gain = ol_gain; - - return 0; -} -#endif /* DISABLE_DECODER */ - diff --git a/Engine/lib/speex/libspeex/nb_celp.h b/Engine/lib/speex/libspeex/nb_celp.h deleted file mode 100644 index a8d308806..000000000 --- a/Engine/lib/speex/libspeex/nb_celp.h +++ /dev/null @@ -1,199 +0,0 @@ -/* Copyright (C) 2002-2006 Jean-Marc Valin */ -/** - @file nb_celp.h - @brief Narrowband CELP encoder/decoder -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifndef NB_CELP_H -#define NB_CELP_H - -#include "modes.h" -#include "speex/speex_callbacks.h" -#include "vbr.h" -#include "filters.h" - -#ifdef VORBIS_PSYCHO -#include "vorbis_psy.h" -#endif - -#define NB_ORDER 10 -#define NB_FRAME_SIZE 160 -#define NB_SUBFRAME_SIZE 40 -#define NB_NB_SUBFRAMES 4 -#define NB_PITCH_START 17 -#define NB_PITCH_END 144 - -#define NB_WINDOW_SIZE (NB_FRAME_SIZE+NB_SUBFRAME_SIZE) -#define NB_EXCBUF (NB_FRAME_SIZE+NB_PITCH_END+2) -#define NB_DEC_BUFFER (NB_FRAME_SIZE+2*NB_PITCH_END+NB_SUBFRAME_SIZE+12) -/**Structure representing the full state of the narrowband encoder*/ -typedef struct EncState { - const SpeexMode *mode; /**< Mode corresponding to the state */ - int first; /**< Is this the first frame? */ - - spx_word32_t cumul_gain; /**< Product of previously used pitch gains (Q10) */ - int bounded_pitch; /**< Next frame should not rely on previous frames for pitch */ - int ol_pitch; /**< Open-loop pitch */ - int ol_voiced; /**< Open-loop voiced/non-voiced decision */ - int pitch[NB_NB_SUBFRAMES]; - -#ifdef VORBIS_PSYCHO - VorbisPsy *psy; - float *psy_window; - float *curve; - float *old_curve; -#endif - - spx_word16_t gamma1; /**< Perceptual filter: A(z/gamma1) */ - spx_word16_t gamma2; /**< Perceptual filter: A(z/gamma2) */ - spx_word16_t lpc_floor; /**< Noise floor multiplier for A[0] in LPC analysis*/ - char *stack; /**< Pseudo-stack allocation for temporary memory */ - spx_word16_t winBuf[NB_WINDOW_SIZE-NB_FRAME_SIZE]; /**< Input buffer (original signal) */ - spx_word16_t excBuf[NB_EXCBUF]; /**< Excitation buffer */ - spx_word16_t *exc; /**< Start of excitation frame */ - spx_word16_t swBuf[NB_EXCBUF]; /**< Weighted signal buffer */ - spx_word16_t *sw; /**< Start of weighted signal frame */ - const spx_word16_t *window; /**< Temporary (Hanning) window */ - const spx_word16_t *lagWindow; /**< Window applied to auto-correlation */ - spx_lsp_t old_lsp[NB_ORDER]; /**< LSPs for previous frame */ - spx_lsp_t old_qlsp[NB_ORDER]; /**< Quantized LSPs for previous frame */ - spx_mem_t mem_sp[NB_ORDER]; /**< Filter memory for signal synthesis */ - spx_mem_t mem_sw[NB_ORDER]; /**< Filter memory for perceptually-weighted signal */ - spx_mem_t mem_sw_whole[NB_ORDER]; /**< Filter memory for perceptually-weighted signal (whole frame)*/ - spx_mem_t mem_exc[NB_ORDER]; /**< Filter memory for excitation (whole frame) */ - spx_mem_t mem_exc2[NB_ORDER]; /**< Filter memory for excitation (whole frame) */ - spx_mem_t mem_hp[2]; /**< High-pass filter memory */ - spx_word32_t pi_gain[NB_NB_SUBFRAMES]; /**< Gain of LPC filter at theta=pi (fe/2) */ - spx_word16_t *innov_rms_save; /**< If non-NULL, innovation RMS is copied here */ - -#ifndef DISABLE_VBR - VBRState vbr; /**< State of the VBR data */ - float vbr_quality; /**< Quality setting for VBR encoding */ - float relative_quality; /**< Relative quality that will be needed by VBR */ - spx_int32_t vbr_enabled; /**< 1 for enabling VBR, 0 otherwise */ - spx_int32_t vbr_max; /**< Max bit-rate allowed in VBR mode */ - int vad_enabled; /**< 1 for enabling VAD, 0 otherwise */ - int dtx_enabled; /**< 1 for enabling DTX, 0 otherwise */ - int dtx_count; /**< Number of consecutive DTX frames */ - spx_int32_t abr_enabled; /**< ABR setting (in bps), 0 if off */ - float abr_drift; - float abr_drift2; - float abr_count; -#endif /* #ifndef DISABLE_VBR */ - - int complexity; /**< Complexity setting (0-10 from least complex to most complex) */ - spx_int32_t sampling_rate; - int plc_tuning; - int encode_submode; - const SpeexSubmode * const *submodes; /**< Sub-mode data */ - int submodeID; /**< Activated sub-mode */ - int submodeSelect; /**< Mode chosen by the user (may differ from submodeID if VAD is on) */ - int isWideband; /**< Is this used as part of the embedded wideband codec */ - int highpass_enabled; /**< Is the input filter enabled */ -} EncState; - -/**Structure representing the full state of the narrowband decoder*/ -typedef struct DecState { - const SpeexMode *mode; /**< Mode corresponding to the state */ - int first; /**< Is this the first frame? */ - int count_lost; /**< Was the last frame lost? */ - spx_int32_t sampling_rate; - - spx_word16_t last_ol_gain; /**< Open-loop gain for previous frame */ - - char *stack; /**< Pseudo-stack allocation for temporary memory */ - spx_word16_t excBuf[NB_DEC_BUFFER]; /**< Excitation buffer */ - spx_word16_t *exc; /**< Start of excitation frame */ - spx_lsp_t old_qlsp[NB_ORDER]; /**< Quantized LSPs for previous frame */ - spx_coef_t interp_qlpc[NB_ORDER]; /**< Interpolated quantized LPCs */ - spx_mem_t mem_sp[NB_ORDER]; /**< Filter memory for synthesis signal */ - spx_mem_t mem_hp[2]; /**< High-pass filter memory */ - spx_word32_t pi_gain[NB_NB_SUBFRAMES]; /**< Gain of LPC filter at theta=pi (fe/2) */ - spx_word16_t *innov_save; /** If non-NULL, innovation is copied here */ - - spx_word16_t level; - spx_word16_t max_level; - spx_word16_t min_level; - - /* This is used in packet loss concealment */ - int last_pitch; /**< Pitch of last correctly decoded frame */ - spx_word16_t last_pitch_gain; /**< Pitch gain of last correctly decoded frame */ - spx_word16_t pitch_gain_buf[3]; /**< Pitch gain of last decoded frames */ - int pitch_gain_buf_idx; /**< Tail of the buffer */ - spx_int32_t seed; /** Seed used for random number generation */ - - int encode_submode; - const SpeexSubmode * const *submodes; /**< Sub-mode data */ - int submodeID; /**< Activated sub-mode */ - int lpc_enh_enabled; /**< 1 when LPC enhancer is on, 0 otherwise */ - SpeexCallback speex_callbacks[SPEEX_MAX_CALLBACKS]; - - SpeexCallback user_callback; - - /*Vocoder data*/ - spx_word16_t voc_m1; - spx_word32_t voc_m2; - spx_word16_t voc_mean; - int voc_offset; - - int dtx_enabled; - int isWideband; /**< Is this used as part of the embedded wideband codec */ - int highpass_enabled; /**< Is the input filter enabled */ -} DecState; - -/** Initializes encoder state*/ -void *nb_encoder_init(const SpeexMode *m); - -/** De-allocates encoder state resources*/ -void nb_encoder_destroy(void *state); - -/** Encodes one frame*/ -int nb_encode(void *state, void *in, SpeexBits *bits); - - -/** Initializes decoder state*/ -void *nb_decoder_init(const SpeexMode *m); - -/** De-allocates decoder state resources*/ -void nb_decoder_destroy(void *state); - -/** Decodes one frame*/ -int nb_decode(void *state, SpeexBits *bits, void *out); - -/** ioctl-like function for controlling a narrowband encoder */ -int nb_encoder_ctl(void *state, int request, void *ptr); - -/** ioctl-like function for controlling a narrowband decoder */ -int nb_decoder_ctl(void *state, int request, void *ptr); - - -#endif diff --git a/Engine/lib/speex/libspeex/os_support.h b/Engine/lib/speex/libspeex/os_support.h deleted file mode 100644 index 2e23a5eb4..000000000 --- a/Engine/lib/speex/libspeex/os_support.h +++ /dev/null @@ -1,169 +0,0 @@ -/* Copyright (C) 2007 Jean-Marc Valin - - File: os_support.h - This is the (tiny) OS abstraction layer. Aside from math.h, this is the - only place where system headers are allowed. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef OS_SUPPORT_H -#define OS_SUPPORT_H - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#ifdef OS_SUPPORT_CUSTOM -#include "os_support_custom.h" -#endif - -/** Speex wrapper for calloc. To do your own dynamic allocation, all you need to do is replace this function, speex_realloc and speex_free - NOTE: speex_alloc needs to CLEAR THE MEMORY */ -#ifndef OVERRIDE_SPEEX_ALLOC -static inline void *speex_alloc (int size) -{ - /* WARNING: this is not equivalent to malloc(). If you want to use malloc() - or your own allocator, YOU NEED TO CLEAR THE MEMORY ALLOCATED. Otherwise - you will experience strange bugs */ - return calloc(size,1); -} -#endif - -/** Same as speex_alloc, except that the area is only needed inside a Speex call (might cause problem with wideband though) */ -#ifndef OVERRIDE_SPEEX_ALLOC_SCRATCH -static inline void *speex_alloc_scratch (int size) -{ - /* Scratch space doesn't need to be cleared */ - return calloc(size,1); -} -#endif - -/** Speex wrapper for realloc. To do your own dynamic allocation, all you need to do is replace this function, speex_alloc and speex_free */ -#ifndef OVERRIDE_SPEEX_REALLOC -static inline void *speex_realloc (void *ptr, int size) -{ - return realloc(ptr, size); -} -#endif - -/** Speex wrapper for calloc. To do your own dynamic allocation, all you need to do is replace this function, speex_realloc and speex_alloc */ -#ifndef OVERRIDE_SPEEX_FREE -static inline void speex_free (void *ptr) -{ - free(ptr); -} -#endif - -/** Same as speex_free, except that the area is only needed inside a Speex call (might cause problem with wideband though) */ -#ifndef OVERRIDE_SPEEX_FREE_SCRATCH -static inline void speex_free_scratch (void *ptr) -{ - free(ptr); -} -#endif - -/** Copy n elements from src to dst. The 0* term provides compile-time type checking */ -#ifndef OVERRIDE_SPEEX_COPY -#define SPEEX_COPY(dst, src, n) (memcpy((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) )) -#endif - -/** Copy n elements from src to dst, allowing overlapping regions. The 0* term - provides compile-time type checking */ -#ifndef OVERRIDE_SPEEX_MOVE -#define SPEEX_MOVE(dst, src, n) (memmove((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) )) -#endif - -/** For n elements worth of memory, set every byte to the value of c, starting at address dst */ -#ifndef OVERRIDE_SPEEX_MEMSET -#define SPEEX_MEMSET(dst, c, n) (memset((dst), (c), (n)*sizeof(*(dst)))) -#endif - - -#ifndef OVERRIDE_SPEEX_FATAL -static inline void _speex_fatal(const char *str, const char *file, int line) -{ - fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str); - exit(1); -} -#endif - -#ifndef OVERRIDE_SPEEX_WARNING -static inline void speex_warning(const char *str) -{ -#ifndef DISABLE_WARNINGS - fprintf (stderr, "warning: %s\n", str); -#endif -} -#endif - -#ifndef OVERRIDE_SPEEX_WARNING_INT -static inline void speex_warning_int(const char *str, int val) -{ -#ifndef DISABLE_WARNINGS - fprintf (stderr, "warning: %s %d\n", str, val); -#endif -} -#endif - -#ifndef OVERRIDE_SPEEX_NOTIFY -static inline void speex_notify(const char *str) -{ -#ifndef DISABLE_NOTIFICATIONS - fprintf (stderr, "notification: %s\n", str); -#endif -} -#endif - -#ifndef OVERRIDE_SPEEX_PUTC -/** Speex wrapper for putc */ -static inline void _speex_putc(int ch, void *file) -{ - FILE *f = (FILE *)file; - fprintf(f, "%c", ch); -} -#endif - -#define speex_fatal(str) _speex_fatal(str, __FILE__, __LINE__); -#define speex_assert(cond) {if (!(cond)) {speex_fatal("assertion failed: " #cond);}} - -#ifndef RELEASE -static inline void print_vec(float *vec, int len, char *name) -{ - int i; - printf ("%s ", name); - for (i=0;i -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -#include "arch.h" - -#ifdef BFIN_ASM -#include "quant_lsp_bfin.h" -#endif - -#ifdef FIXED_POINT - -#define LSP_LINEAR(i) (SHL16(i+1,11)) -#define LSP_LINEAR_HIGH(i) (ADD16(MULT16_16_16(i,2560),6144)) -#define LSP_DIV_256(x) (SHL16((spx_word16_t)x, 5)) -#define LSP_DIV_512(x) (SHL16((spx_word16_t)x, 4)) -#define LSP_DIV_1024(x) (SHL16((spx_word16_t)x, 3)) -#define LSP_PI 25736 - -#else - -#define LSP_LINEAR(i) (.25*(i)+.25) -#define LSP_LINEAR_HIGH(i) (.3125*(i)+.75) -#define LSP_SCALE 256. -#define LSP_DIV_256(x) (0.0039062*(x)) -#define LSP_DIV_512(x) (0.0019531*(x)) -#define LSP_DIV_1024(x) (0.00097656*(x)) -#define LSP_PI M_PI - -#endif - -#ifndef DISABLE_ENCODER -static void compute_quant_weights(spx_lsp_t *qlsp, spx_word16_t *quant_weight, int order) -{ - int i; - spx_word16_t tmp1, tmp2; - for (i=0;i tmp2 ? tmp1 : tmp2; - }*/ - - for (i=0;i>> 16;\n\t" -" R1 = (A1 += R2.L*R0.H) (IS);\n\t" -"4: R3 = R3 + R1;\n\t" - -" cc =R3<%0;\n\t" -" if cc %0=R3;\n\t" -" if cc %1=R5;\n\t" -"2: R5 += 1;\n\t" -" L0 = 0;\n\t" -" L1 = 0;\n\t" - : "=&d" (best_dist), "=&d" (best_id) - : "a" (x), "a" (weight), "b" (cdbk), "a" (nbVec), "a" (nbDim) - : "I0", "I1", "P2", "R0", "R1", "R2", "R3", "R5", "A1", - "L0", "L1", "B0", "B1", "CC", "ASTAT" BFIN_HWLOOP0_REGS BFIN_HWLOOP1_REGS - ); - - for (j=0;j -#include "sb_celp.h" -#include "filters.h" -#include "lpc.h" -#include "lsp.h" -#include "stack_alloc.h" -#include "cb_search.h" -#include "quant_lsp.h" -#include "vq.h" -#include "ltp.h" -#include "arch.h" -#include "math_approx.h" -#include "os_support.h" - -#ifndef NULL -#define NULL 0 -#endif - -/* Default size for the encoder and decoder stack (can be changed at compile time). - This does not apply when using variable-size arrays or alloca. */ -#ifndef SB_ENC_STACK -#define SB_ENC_STACK (10000*sizeof(spx_sig_t)) -#endif - -#ifndef SB_DEC_STACK -#define SB_DEC_STACK (6000*sizeof(spx_sig_t)) -#endif - - -#ifndef DISABLE_WIDEBAND - - -#define sqr(x) ((x)*(x)) - -#define SUBMODE(x) st->submodes[st->submodeID]->x - -#ifdef FIXED_POINT -static const spx_word16_t gc_quant_bound[16] = {125, 164, 215, 282, 370, 484, 635, 832, 1090, 1428, 1871, 2452, 3213, 4210, 5516, 7228}; -static const spx_word16_t fold_quant_bound[32] = { - 39, 44, 50, 57, 64, 73, 83, 94, - 106, 120, 136, 154, 175, 198, 225, 255, - 288, 327, 370, 420, 476, 539, 611, 692, - 784, 889, 1007, 1141, 1293, 1465, 1660, 1881}; -#define LSP_MARGIN 410 -#define LSP_DELTA1 6553 -#define LSP_DELTA2 1638 - -#else - -static const spx_word16_t gc_quant_bound[16] = { - 0.97979, 1.28384, 1.68223, 2.20426, 2.88829, 3.78458, 4.95900, 6.49787, - 8.51428, 11.15642, 14.61846, 19.15484, 25.09895, 32.88761, 43.09325, 56.46588}; -static const spx_word16_t fold_quant_bound[32] = { - 0.30498, 0.34559, 0.39161, 0.44375, 0.50283, 0.56979, 0.64565, 0.73162, - 0.82903, 0.93942, 1.06450, 1.20624, 1.36685, 1.54884, 1.75506, 1.98875, - 2.25355, 2.55360, 2.89361, 3.27889, 3.71547, 4.21018, 4.77076, 5.40598, - 6.12577, 6.94141, 7.86565, 8.91295, 10.09969, 11.44445, 12.96826, 14.69497}; - -#define LSP_MARGIN .05 -#define LSP_DELTA1 .2 -#define LSP_DELTA2 .05 - -#endif - -#define QMF_ORDER 64 - -#ifdef FIXED_POINT -static const spx_word16_t h0[64] = {2, -7, -7, 18, 15, -39, -25, 75, 35, -130, -41, 212, 38, -327, -17, 483, -32, -689, 124, 956, -283, -1307, 543, 1780, -973, -2467, 1733, 3633, -3339, -6409, 9059, 30153, 30153, 9059, -6409, -3339, 3633, 1733, -2467, -973, 1780, 543, -1307, -283, 956, 124, -689, -32, 483, -17, -327, 38, 212, -41, -130, 35, 75, -25, -39, 15, 18, -7, -7, 2}; - -#else -static const float h0[64] = { - 3.596189e-05f, -0.0001123515f, - -0.0001104587f, 0.0002790277f, - 0.0002298438f, -0.0005953563f, - -0.0003823631f, 0.00113826f, - 0.0005308539f, -0.001986177f, - -0.0006243724f, 0.003235877f, - 0.0005743159f, -0.004989147f, - -0.0002584767f, 0.007367171f, - -0.0004857935f, -0.01050689f, - 0.001894714f, 0.01459396f, - -0.004313674f, -0.01994365f, - 0.00828756f, 0.02716055f, - -0.01485397f, -0.03764973f, - 0.026447f, 0.05543245f, - -0.05095487f, -0.09779096f, - 0.1382363f, 0.4600981f, - 0.4600981f, 0.1382363f, - -0.09779096f, -0.05095487f, - 0.05543245f, 0.026447f, - -0.03764973f, -0.01485397f, - 0.02716055f, 0.00828756f, - -0.01994365f, -0.004313674f, - 0.01459396f, 0.001894714f, - -0.01050689f, -0.0004857935f, - 0.007367171f, -0.0002584767f, - -0.004989147f, 0.0005743159f, - 0.003235877f, -0.0006243724f, - -0.001986177f, 0.0005308539f, - 0.00113826f, -0.0003823631f, - -0.0005953563f, 0.0002298438f, - 0.0002790277f, -0.0001104587f, - -0.0001123515f, 3.596189e-05f -}; - -#endif - -extern const spx_word16_t lag_window[]; -extern const spx_word16_t lpc_window[]; - -#ifndef DISABLE_ENCODER -void *sb_encoder_init(const SpeexMode *m) -{ - int i; - spx_int32_t tmp; - SBEncState *st; - const SpeexSBMode *mode; - - st = (SBEncState*)speex_alloc(sizeof(SBEncState)); - if (!st) - return NULL; - st->mode = m; - mode = (const SpeexSBMode*)m->mode; - - - st->st_low = speex_encoder_init(mode->nb_mode); -#if defined(VAR_ARRAYS) || defined (USE_ALLOCA) - st->stack = NULL; -#else - /*st->stack = (char*)speex_alloc_scratch(SB_ENC_STACK);*/ - speex_encoder_ctl(st->st_low, SPEEX_GET_STACK, &st->stack); -#endif - - st->full_frame_size = 2*mode->frameSize; - st->frame_size = mode->frameSize; - st->subframeSize = mode->subframeSize; - st->nbSubframes = mode->frameSize/mode->subframeSize; - st->windowSize = st->frame_size+st->subframeSize; - st->lpcSize=mode->lpcSize; - - st->encode_submode = 1; - st->submodes=mode->submodes; - st->submodeSelect = st->submodeID=mode->defaultSubmode; - - tmp=9; - speex_encoder_ctl(st->st_low, SPEEX_SET_QUALITY, &tmp); - tmp=1; - speex_encoder_ctl(st->st_low, SPEEX_SET_WIDEBAND, &tmp); - - st->lpc_floor = mode->lpc_floor; - st->gamma1=mode->gamma1; - st->gamma2=mode->gamma2; - st->first=1; - - st->high=(spx_word16_t*)speex_alloc((st->windowSize-st->frame_size)*sizeof(spx_word16_t)); - - st->h0_mem=(spx_word16_t*)speex_alloc((QMF_ORDER)*sizeof(spx_word16_t)); - - st->window= lpc_window; - - st->lagWindow = lag_window; - - st->old_lsp = (spx_lsp_t*)speex_alloc(st->lpcSize*sizeof(spx_lsp_t)); - st->old_qlsp = (spx_lsp_t*)speex_alloc(st->lpcSize*sizeof(spx_lsp_t)); - st->interp_qlpc = (spx_coef_t*)speex_alloc(st->lpcSize*sizeof(spx_coef_t)); - st->pi_gain = (spx_word32_t*)speex_alloc((st->nbSubframes)*sizeof(spx_word32_t)); - st->exc_rms = (spx_word16_t*)speex_alloc((st->nbSubframes)*sizeof(spx_word16_t)); - st->innov_rms_save = NULL; - - st->mem_sp = (spx_mem_t*)speex_alloc((st->lpcSize)*sizeof(spx_mem_t)); - st->mem_sp2 = (spx_mem_t*)speex_alloc((st->lpcSize)*sizeof(spx_mem_t)); - st->mem_sw = (spx_mem_t*)speex_alloc((st->lpcSize)*sizeof(spx_mem_t)); - - for (i=0;ilpcSize;i++) - st->old_lsp[i]= DIV32(MULT16_16(QCONST16(3.1415927f, LSP_SHIFT), i+1), st->lpcSize+1); - -#ifndef DISABLE_VBR - st->vbr_quality = 8; - st->vbr_enabled = 0; - st->vbr_max = 0; - st->vbr_max_high = 20000; /* We just need a big value here */ - st->vad_enabled = 0; - st->abr_enabled = 0; - st->relative_quality=0; -#endif /* #ifndef DISABLE_VBR */ - - st->complexity=2; - speex_encoder_ctl(st->st_low, SPEEX_GET_SAMPLING_RATE, &st->sampling_rate); - st->sampling_rate*=2; -#ifdef ENABLE_VALGRIND - VALGRIND_MAKE_READABLE(st, (st->stack-(char*)st)); -#endif - return st; -} - -void sb_encoder_destroy(void *state) -{ - SBEncState *st=(SBEncState*)state; - - speex_encoder_destroy(st->st_low); -#if !(defined(VAR_ARRAYS) || defined (USE_ALLOCA)) - /*speex_free_scratch(st->stack);*/ -#endif - - speex_free(st->high); - - speex_free(st->h0_mem); - - speex_free(st->old_lsp); - speex_free(st->old_qlsp); - speex_free(st->interp_qlpc); - speex_free(st->pi_gain); - speex_free(st->exc_rms); - - speex_free(st->mem_sp); - speex_free(st->mem_sp2); - speex_free(st->mem_sw); - - - speex_free(st); -} - -int sb_encoder_ctl(void *state, int request, void *ptr) -{ - SBEncState *st; - st=(SBEncState*)state; - switch(request) - { - case SPEEX_GET_FRAME_SIZE: - (*(spx_int32_t*)ptr) = st->full_frame_size; - break; - case SPEEX_SET_HIGH_MODE: - st->submodeSelect = st->submodeID = (*(spx_int32_t*)ptr); - break; - case SPEEX_SET_LOW_MODE: - speex_encoder_ctl(st->st_low, SPEEX_SET_LOW_MODE, ptr); - break; - case SPEEX_SET_DTX: - speex_encoder_ctl(st->st_low, SPEEX_SET_DTX, ptr); - break; - case SPEEX_GET_DTX: - speex_encoder_ctl(st->st_low, SPEEX_GET_DTX, ptr); - break; - case SPEEX_GET_LOW_MODE: - speex_encoder_ctl(st->st_low, SPEEX_GET_LOW_MODE, ptr); - break; - case SPEEX_SET_MODE: - speex_encoder_ctl(st, SPEEX_SET_QUALITY, ptr); - break; -#ifndef DISABLE_VBR - case SPEEX_SET_VBR: - st->vbr_enabled = (*(spx_int32_t*)ptr); - speex_encoder_ctl(st->st_low, SPEEX_SET_VBR, ptr); - break; - case SPEEX_GET_VBR: - (*(spx_int32_t*)ptr) = st->vbr_enabled; - break; - case SPEEX_SET_VAD: - st->vad_enabled = (*(spx_int32_t*)ptr); - speex_encoder_ctl(st->st_low, SPEEX_SET_VAD, ptr); - break; - case SPEEX_GET_VAD: - (*(spx_int32_t*)ptr) = st->vad_enabled; - break; -#endif /* #ifndef DISABLE_VBR */ -#if !defined(DISABLE_VBR) && !defined(DISABLE_FLOAT_API) - case SPEEX_SET_VBR_QUALITY: - { - spx_int32_t q; - float qual = (*(float*)ptr)+.6; - st->vbr_quality = (*(float*)ptr); - if (qual>10) - qual=10; - q=(int)floor(.5+*(float*)ptr); - if (q>10) - q=10; - speex_encoder_ctl(st->st_low, SPEEX_SET_VBR_QUALITY, &qual); - speex_encoder_ctl(state, SPEEX_SET_QUALITY, &q); - break; - } - case SPEEX_GET_VBR_QUALITY: - (*(float*)ptr) = st->vbr_quality; - break; -#endif /* #if !defined(DISABLE_VBR) && !defined(DISABLE_FLOAT_API) */ -#ifndef DISABLE_VBR - case SPEEX_SET_ABR: - st->abr_enabled = (*(spx_int32_t*)ptr); - st->vbr_enabled = st->abr_enabled!=0; - speex_encoder_ctl(st->st_low, SPEEX_SET_VBR, &st->vbr_enabled); - if (st->vbr_enabled) - { - spx_int32_t i=10, rate, target; - float vbr_qual; - target = (*(spx_int32_t*)ptr); - while (i>=0) - { - speex_encoder_ctl(st, SPEEX_SET_QUALITY, &i); - speex_encoder_ctl(st, SPEEX_GET_BITRATE, &rate); - if (rate <= target) - break; - i--; - } - vbr_qual=i; - if (vbr_qual<0) - vbr_qual=0; - speex_encoder_ctl(st, SPEEX_SET_VBR_QUALITY, &vbr_qual); - st->abr_count=0; - st->abr_drift=0; - st->abr_drift2=0; - } - - break; - case SPEEX_GET_ABR: - (*(spx_int32_t*)ptr) = st->abr_enabled; - break; -#endif /* #ifndef DISABLE_VBR */ - - case SPEEX_SET_QUALITY: - { - spx_int32_t nb_qual; - int quality = (*(spx_int32_t*)ptr); - if (quality < 0) - quality = 0; - if (quality > 10) - quality = 10; - st->submodeSelect = st->submodeID = ((const SpeexSBMode*)(st->mode->mode))->quality_map[quality]; - nb_qual = ((const SpeexSBMode*)(st->mode->mode))->low_quality_map[quality]; - speex_encoder_ctl(st->st_low, SPEEX_SET_MODE, &nb_qual); - } - break; - case SPEEX_SET_COMPLEXITY: - speex_encoder_ctl(st->st_low, SPEEX_SET_COMPLEXITY, ptr); - st->complexity = (*(spx_int32_t*)ptr); - if (st->complexity<1) - st->complexity=1; - break; - case SPEEX_GET_COMPLEXITY: - (*(spx_int32_t*)ptr) = st->complexity; - break; - case SPEEX_SET_BITRATE: - { - spx_int32_t i=10; - spx_int32_t rate, target; - target = (*(spx_int32_t*)ptr); - while (i>=0) - { - speex_encoder_ctl(st, SPEEX_SET_QUALITY, &i); - speex_encoder_ctl(st, SPEEX_GET_BITRATE, &rate); - if (rate <= target) - break; - i--; - } - } - break; - case SPEEX_GET_BITRATE: - speex_encoder_ctl(st->st_low, request, ptr); - /*fprintf (stderr, "before: %d\n", (*(int*)ptr));*/ - if (st->submodes[st->submodeID]) - (*(spx_int32_t*)ptr) += st->sampling_rate*SUBMODE(bits_per_frame)/st->full_frame_size; - else - (*(spx_int32_t*)ptr) += st->sampling_rate*(SB_SUBMODE_BITS+1)/st->full_frame_size; - /*fprintf (stderr, "after: %d\n", (*(int*)ptr));*/ - break; - case SPEEX_SET_SAMPLING_RATE: - { - spx_int32_t tmp=(*(spx_int32_t*)ptr); - st->sampling_rate = tmp; - tmp>>=1; - speex_encoder_ctl(st->st_low, SPEEX_SET_SAMPLING_RATE, &tmp); - } - break; - case SPEEX_GET_SAMPLING_RATE: - (*(spx_int32_t*)ptr)=st->sampling_rate; - break; - case SPEEX_RESET_STATE: - { - int i; - st->first = 1; - for (i=0;ilpcSize;i++) - st->old_lsp[i]= DIV32(MULT16_16(QCONST16(3.1415927f, LSP_SHIFT), i+1), st->lpcSize+1); - for (i=0;ilpcSize;i++) - st->mem_sw[i]=st->mem_sp[i]=st->mem_sp2[i]=0; - for (i=0;ih0_mem[i]=0; - } - break; - case SPEEX_SET_SUBMODE_ENCODING: - st->encode_submode = (*(spx_int32_t*)ptr); - speex_encoder_ctl(st->st_low, SPEEX_SET_SUBMODE_ENCODING, ptr); - break; - case SPEEX_GET_SUBMODE_ENCODING: - (*(spx_int32_t*)ptr) = st->encode_submode; - break; - case SPEEX_GET_LOOKAHEAD: - speex_encoder_ctl(st->st_low, SPEEX_GET_LOOKAHEAD, ptr); - (*(spx_int32_t*)ptr) = 2*(*(spx_int32_t*)ptr) + QMF_ORDER - 1; - break; - case SPEEX_SET_PLC_TUNING: - speex_encoder_ctl(st->st_low, SPEEX_SET_PLC_TUNING, ptr); - break; - case SPEEX_GET_PLC_TUNING: - speex_encoder_ctl(st->st_low, SPEEX_GET_PLC_TUNING, ptr); - break; -#ifndef DISABLE_VBR - case SPEEX_SET_VBR_MAX_BITRATE: - { - st->vbr_max = (*(spx_int32_t*)ptr); - if (SPEEX_SET_VBR_MAX_BITRATE<1) - { - speex_encoder_ctl(st->st_low, SPEEX_SET_VBR_MAX_BITRATE, &st->vbr_max); - st->vbr_max_high = 17600; - } else { - spx_int32_t low_rate; - if (st->vbr_max >= 42200) - { - st->vbr_max_high = 17600; - } else if (st->vbr_max >= 27800) - { - st->vbr_max_high = 9600; - } else if (st->vbr_max > 20600) - { - st->vbr_max_high = 5600; - } else { - st->vbr_max_high = 1800; - } - if (st->subframeSize==80) - st->vbr_max_high = 1800; - low_rate = st->vbr_max - st->vbr_max_high; - speex_encoder_ctl(st->st_low, SPEEX_SET_VBR_MAX_BITRATE, &low_rate); - } - } - break; - case SPEEX_GET_VBR_MAX_BITRATE: - (*(spx_int32_t*)ptr) = st->vbr_max; - break; -#endif /* #ifndef DISABLE_VBR */ - case SPEEX_SET_HIGHPASS: - speex_encoder_ctl(st->st_low, SPEEX_SET_HIGHPASS, ptr); - break; - case SPEEX_GET_HIGHPASS: - speex_encoder_ctl(st->st_low, SPEEX_GET_HIGHPASS, ptr); - break; - - - /* This is all internal stuff past this point */ - case SPEEX_GET_PI_GAIN: - { - int i; - spx_word32_t *g = (spx_word32_t*)ptr; - for (i=0;inbSubframes;i++) - g[i]=st->pi_gain[i]; - } - break; - case SPEEX_GET_EXC: - { - int i; - for (i=0;inbSubframes;i++) - ((spx_word16_t*)ptr)[i] = st->exc_rms[i]; - } - break; -#ifndef DISABLE_VBR - case SPEEX_GET_RELATIVE_QUALITY: - (*(float*)ptr)=st->relative_quality; - break; -#endif /* #ifndef DISABLE_VBR */ - case SPEEX_SET_INNOVATION_SAVE: - st->innov_rms_save = (spx_word16_t*)ptr; - break; - case SPEEX_SET_WIDEBAND: - speex_encoder_ctl(st->st_low, SPEEX_SET_WIDEBAND, ptr); - break; - case SPEEX_GET_STACK: - *((char**)ptr) = st->stack; - break; - default: - speex_warning_int("Unknown nb_ctl request: ", request); - return -1; - } - return 0; -} - - -int sb_encode(void *state, void *vin, SpeexBits *bits) -{ - SBEncState *st; - int i, roots, sub; - char *stack; - VARDECL(spx_mem_t *mem); - VARDECL(spx_sig_t *innov); - VARDECL(spx_word16_t *target); - VARDECL(spx_word16_t *syn_resp); - VARDECL(spx_word32_t *low_pi_gain); - spx_word16_t *low; - spx_word16_t *high; - VARDECL(spx_word16_t *low_exc_rms); - VARDECL(spx_word16_t *low_innov_rms); - const SpeexSBMode *mode; - spx_int32_t dtx; - spx_word16_t *in = (spx_word16_t*)vin; - spx_word16_t e_low=0, e_high=0; - VARDECL(spx_coef_t *lpc); - VARDECL(spx_coef_t *interp_lpc); - VARDECL(spx_coef_t *bw_lpc1); - VARDECL(spx_coef_t *bw_lpc2); - VARDECL(spx_lsp_t *lsp); - VARDECL(spx_lsp_t *qlsp); - VARDECL(spx_lsp_t *interp_lsp); - VARDECL(spx_lsp_t *interp_qlsp); - - st = (SBEncState*)state; - stack=st->stack; - mode = (const SpeexSBMode*)(st->mode->mode); - low = in; - high = in+st->frame_size; - - /* High-band buffering / sync with low band */ - /* Compute the two sub-bands by filtering with QMF h0*/ - qmf_decomp(in, h0, low, high, st->full_frame_size, QMF_ORDER, st->h0_mem, stack); - -#ifndef DISABLE_VBR - if (st->vbr_enabled || st->vad_enabled) - { - /* Need to compute things here before the signal is trashed by the encoder */ - /*FIXME: Are the two signals (low, high) in sync? */ - e_low = compute_rms16(low, st->frame_size); - e_high = compute_rms16(high, st->frame_size); - } -#endif /* #ifndef DISABLE_VBR */ - - ALLOC(low_innov_rms, st->nbSubframes, spx_word16_t); - speex_encoder_ctl(st->st_low, SPEEX_SET_INNOVATION_SAVE, low_innov_rms); - /* Encode the narrowband part*/ - speex_encode_native(st->st_low, low, bits); - - high = high - (st->windowSize-st->frame_size); - SPEEX_COPY(high, st->high, st->windowSize-st->frame_size); - SPEEX_COPY(st->high, &high[st->frame_size], st->windowSize-st->frame_size); - - - ALLOC(low_pi_gain, st->nbSubframes, spx_word32_t); - ALLOC(low_exc_rms, st->nbSubframes, spx_word16_t); - speex_encoder_ctl(st->st_low, SPEEX_GET_PI_GAIN, low_pi_gain); - speex_encoder_ctl(st->st_low, SPEEX_GET_EXC, low_exc_rms); - - speex_encoder_ctl(st->st_low, SPEEX_GET_LOW_MODE, &dtx); - - if (dtx==0) - dtx=1; - else - dtx=0; - - ALLOC(lpc, st->lpcSize, spx_coef_t); - ALLOC(interp_lpc, st->lpcSize, spx_coef_t); - ALLOC(bw_lpc1, st->lpcSize, spx_coef_t); - ALLOC(bw_lpc2, st->lpcSize, spx_coef_t); - - ALLOC(lsp, st->lpcSize, spx_lsp_t); - ALLOC(qlsp, st->lpcSize, spx_lsp_t); - ALLOC(interp_lsp, st->lpcSize, spx_lsp_t); - ALLOC(interp_qlsp, st->lpcSize, spx_lsp_t); - - { - VARDECL(spx_word16_t *autocorr); - VARDECL(spx_word16_t *w_sig); - ALLOC(autocorr, st->lpcSize+1, spx_word16_t); - ALLOC(w_sig, st->windowSize, spx_word16_t); - /* Window for analysis */ - /* FIXME: This is a kludge */ - if (st->subframeSize==80) - { - for (i=0;iwindowSize;i++) - w_sig[i] = EXTRACT16(SHR32(MULT16_16(high[i],st->window[i>>1]),SIG_SHIFT)); - } else { - for (i=0;iwindowSize;i++) - w_sig[i] = EXTRACT16(SHR32(MULT16_16(high[i],st->window[i]),SIG_SHIFT)); - } - /* Compute auto-correlation */ - _spx_autocorr(w_sig, autocorr, st->lpcSize+1, st->windowSize); - autocorr[0] = ADD16(autocorr[0],MULT16_16_Q15(autocorr[0],st->lpc_floor)); /* Noise floor in auto-correlation domain */ - - /* Lag windowing: equivalent to filtering in the power-spectrum domain */ - for (i=0;ilpcSize+1;i++) - autocorr[i] = MULT16_16_Q14(autocorr[i],st->lagWindow[i]); - - /* Levinson-Durbin */ - _spx_lpc(lpc, autocorr, st->lpcSize); - } - - /* LPC to LSPs (x-domain) transform */ - roots=lpc_to_lsp (lpc, st->lpcSize, lsp, 10, LSP_DELTA1, stack); - if (roots!=st->lpcSize) - { - roots = lpc_to_lsp (lpc, st->lpcSize, lsp, 10, LSP_DELTA2, stack); - if (roots!=st->lpcSize) { - /*If we can't find all LSP's, do some damage control and use a flat filter*/ - for (i=0;ilpcSize;i++) - { - lsp[i]=st->old_lsp[i]; - } - } - } - -#ifndef DISABLE_VBR - /* VBR code */ - if ((st->vbr_enabled || st->vad_enabled) && !dtx) - { - float ratio; - if (st->abr_enabled) - { - float qual_change=0; - if (st->abr_drift2 * st->abr_drift > 0) - { - /* Only adapt if long-term and short-term drift are the same sign */ - qual_change = -.00001*st->abr_drift/(1+st->abr_count); - if (qual_change>.1) - qual_change=.1; - if (qual_change<-.1) - qual_change=-.1; - } - st->vbr_quality += qual_change; - if (st->vbr_quality>10) - st->vbr_quality=10; - if (st->vbr_quality<0) - st->vbr_quality=0; - } - - - ratio = 2*log((1.f+e_high)/(1.f+e_low)); - - speex_encoder_ctl(st->st_low, SPEEX_GET_RELATIVE_QUALITY, &st->relative_quality); - if (ratio<-4) - ratio=-4; - if (ratio>2) - ratio=2; - /*if (ratio>-2)*/ - if (st->vbr_enabled) - { - spx_int32_t modeid; - modeid = mode->nb_modes-1; - st->relative_quality+=1.0*(ratio+2); - if (st->relative_quality<-1) - st->relative_quality=-1; - while (modeid) - { - int v1; - float thresh; - v1=(int)floor(st->vbr_quality); - if (v1==10) - thresh = mode->vbr_thresh[modeid][v1]; - else - thresh = (st->vbr_quality-v1) * mode->vbr_thresh[modeid][v1+1] + - (1+v1-st->vbr_quality) * mode->vbr_thresh[modeid][v1]; - if (st->relative_quality >= thresh && st->sampling_rate*st->submodes[modeid]->bits_per_frame/st->full_frame_size <= st->vbr_max_high) - break; - modeid--; - } - speex_encoder_ctl(state, SPEEX_SET_HIGH_MODE, &modeid); - if (st->abr_enabled) - { - spx_int32_t bitrate; - speex_encoder_ctl(state, SPEEX_GET_BITRATE, &bitrate); - st->abr_drift+=(bitrate-st->abr_enabled); - st->abr_drift2 = .95*st->abr_drift2 + .05*(bitrate-st->abr_enabled); - st->abr_count += 1.0; - } - - } else { - /* VAD only */ - int modeid; - if (st->relative_quality<2.0) - modeid=1; - else - modeid=st->submodeSelect; - /*speex_encoder_ctl(state, SPEEX_SET_MODE, &mode);*/ - st->submodeID=modeid; - - } - /*fprintf (stderr, "%f %f\n", ratio, low_qual);*/ - } -#endif /* #ifndef DISABLE_VBR */ - - if (st->encode_submode) - { - speex_bits_pack(bits, 1, 1); - if (dtx) - speex_bits_pack(bits, 0, SB_SUBMODE_BITS); - else - speex_bits_pack(bits, st->submodeID, SB_SUBMODE_BITS); - } - - /* If null mode (no transmission), just set a couple things to zero*/ - if (dtx || st->submodes[st->submodeID] == NULL) - { - for (i=0;iframe_size;i++) - high[i]=VERY_SMALL; - - for (i=0;ilpcSize;i++) - st->mem_sw[i]=0; - st->first=1; - - /* Final signal synthesis from excitation */ - iir_mem16(high, st->interp_qlpc, high, st->frame_size, st->lpcSize, st->mem_sp, stack); - - if (dtx) - return 0; - else - return 1; - } - - - /* LSP quantization */ - SUBMODE(lsp_quant)(lsp, qlsp, st->lpcSize, bits); - - if (st->first) - { - for (i=0;ilpcSize;i++) - st->old_lsp[i] = lsp[i]; - for (i=0;ilpcSize;i++) - st->old_qlsp[i] = qlsp[i]; - } - - ALLOC(mem, st->lpcSize, spx_mem_t); - ALLOC(syn_resp, st->subframeSize, spx_word16_t); - ALLOC(innov, st->subframeSize, spx_sig_t); - ALLOC(target, st->subframeSize, spx_word16_t); - - for (sub=0;subnbSubframes;sub++) - { - VARDECL(spx_word16_t *exc); - VARDECL(spx_word16_t *res); - VARDECL(spx_word16_t *sw); - spx_word16_t *sp; - spx_word16_t filter_ratio; /*Q7*/ - int offset; - spx_word32_t rl, rh; /*Q13*/ - spx_word16_t eh=0; - - offset = st->subframeSize*sub; - sp=high+offset; - ALLOC(exc, st->subframeSize, spx_word16_t); - ALLOC(res, st->subframeSize, spx_word16_t); - ALLOC(sw, st->subframeSize, spx_word16_t); - - /* LSP interpolation (quantized and unquantized) */ - lsp_interpolate(st->old_lsp, lsp, interp_lsp, st->lpcSize, sub, st->nbSubframes, LSP_MARGIN); - lsp_interpolate(st->old_qlsp, qlsp, interp_qlsp, st->lpcSize, sub, st->nbSubframes, LSP_MARGIN); - - lsp_to_lpc(interp_lsp, interp_lpc, st->lpcSize,stack); - lsp_to_lpc(interp_qlsp, st->interp_qlpc, st->lpcSize, stack); - - bw_lpc(st->gamma1, interp_lpc, bw_lpc1, st->lpcSize); - bw_lpc(st->gamma2, interp_lpc, bw_lpc2, st->lpcSize); - - /* Compute mid-band (4000 Hz for wideband) response of low-band and high-band - filters */ - st->pi_gain[sub]=LPC_SCALING; - rh = LPC_SCALING; - for (i=0;ilpcSize;i+=2) - { - rh += st->interp_qlpc[i+1] - st->interp_qlpc[i]; - st->pi_gain[sub] += st->interp_qlpc[i] + st->interp_qlpc[i+1]; - } - - rl = low_pi_gain[sub]; -#ifdef FIXED_POINT - filter_ratio=EXTRACT16(SATURATE(PDIV32(SHL32(ADD32(rl,82),7),ADD32(82,rh)),32767)); -#else - filter_ratio=(rl+.01)/(rh+.01); -#endif - - /* Compute "real excitation" */ - fir_mem16(sp, st->interp_qlpc, exc, st->subframeSize, st->lpcSize, st->mem_sp2, stack); - /* Compute energy of low-band and high-band excitation */ - - eh = compute_rms16(exc, st->subframeSize); - - if (!SUBMODE(innovation_quant)) {/* 1 for spectral folding excitation, 0 for stochastic */ - spx_word32_t g; /*Q7*/ - spx_word16_t el; /*Q0*/ - el = low_innov_rms[sub]; - - /* Gain to use if we want to use the low-band excitation for high-band */ - g=PDIV32(MULT16_16(filter_ratio,eh),EXTEND32(ADD16(1,el))); - -#if 0 - { - char *tmp_stack=stack; - float *tmp_sig; - float g2; - ALLOC(tmp_sig, st->subframeSize, spx_sig_t); - for (i=0;ilpcSize;i++) - mem[i]=st->mem_sp[i]; - iir_mem2(st->low_innov+offset, st->interp_qlpc, tmp_sig, st->subframeSize, st->lpcSize, mem); - g2 = compute_rms(sp, st->subframeSize)/(.01+compute_rms(tmp_sig, st->subframeSize)); - /*fprintf (stderr, "gains: %f %f\n", g, g2);*/ - g = g2; - stack = tmp_stack; - } -#endif - - /*print_vec(&g, 1, "gain factor");*/ - /* Gain quantization */ - { - int quant = scal_quant(g, fold_quant_bound, 32); - /*speex_warning_int("tata", quant);*/ - if (quant<0) - quant=0; - if (quant>31) - quant=31; - speex_bits_pack(bits, quant, 5); - } - if (st->innov_rms_save) - { - st->innov_rms_save[sub] = eh; - } - st->exc_rms[sub] = eh; - } else { - spx_word16_t gc; /*Q7*/ - spx_word32_t scale; /*Q14*/ - spx_word16_t el; /*Q0*/ - el = low_exc_rms[sub]; /*Q0*/ - - gc = PDIV32_16(MULT16_16(filter_ratio,1+eh),1+el); - - /* This is a kludge that cleans up a historical bug */ - if (st->subframeSize==80) - gc = MULT16_16_P15(QCONST16(0.70711f,15),gc); - /*printf ("%f %f %f %f\n", el, eh, filter_ratio, gc);*/ - { - int qgc = scal_quant(gc, gc_quant_bound, 16); - speex_bits_pack(bits, qgc, 4); - gc = MULT16_16_Q15(QCONST16(0.87360,15),gc_quant_bound[qgc]); - } - if (st->subframeSize==80) - gc = MULT16_16_P14(QCONST16(1.4142f,14), gc); - - scale = SHL32(MULT16_16(PDIV32_16(SHL32(EXTEND32(gc),SIG_SHIFT-6),filter_ratio),(1+el)),6); - - compute_impulse_response(st->interp_qlpc, bw_lpc1, bw_lpc2, syn_resp, st->subframeSize, st->lpcSize, stack); - - - /* Reset excitation */ - for (i=0;isubframeSize;i++) - res[i]=VERY_SMALL; - - /* Compute zero response (ringing) of A(z/g1) / ( A(z/g2) * Aq(z) ) */ - for (i=0;ilpcSize;i++) - mem[i]=st->mem_sp[i]; - iir_mem16(res, st->interp_qlpc, res, st->subframeSize, st->lpcSize, mem, stack); - - for (i=0;ilpcSize;i++) - mem[i]=st->mem_sw[i]; - filter_mem16(res, bw_lpc1, bw_lpc2, res, st->subframeSize, st->lpcSize, mem, stack); - - /* Compute weighted signal */ - for (i=0;ilpcSize;i++) - mem[i]=st->mem_sw[i]; - filter_mem16(sp, bw_lpc1, bw_lpc2, sw, st->subframeSize, st->lpcSize, mem, stack); - - /* Compute target signal */ - for (i=0;isubframeSize;i++) - target[i]=SUB16(sw[i],res[i]); - - signal_div(target, target, scale, st->subframeSize); - - /* Reset excitation */ - SPEEX_MEMSET(innov, 0, st->subframeSize); - - /*print_vec(target, st->subframeSize, "\ntarget");*/ - SUBMODE(innovation_quant)(target, st->interp_qlpc, bw_lpc1, bw_lpc2, - SUBMODE(innovation_params), st->lpcSize, st->subframeSize, - innov, syn_resp, bits, stack, st->complexity, SUBMODE(double_codebook)); - /*print_vec(target, st->subframeSize, "after");*/ - - signal_mul(innov, innov, scale, st->subframeSize); - - if (SUBMODE(double_codebook)) { - char *tmp_stack=stack; - VARDECL(spx_sig_t *innov2); - ALLOC(innov2, st->subframeSize, spx_sig_t); - SPEEX_MEMSET(innov2, 0, st->subframeSize); - for (i=0;isubframeSize;i++) - target[i]=MULT16_16_P13(QCONST16(2.5f,13), target[i]); - - SUBMODE(innovation_quant)(target, st->interp_qlpc, bw_lpc1, bw_lpc2, - SUBMODE(innovation_params), st->lpcSize, st->subframeSize, - innov2, syn_resp, bits, stack, st->complexity, 0); - signal_mul(innov2, innov2, MULT16_32_P15(QCONST16(0.4f,15),scale), st->subframeSize); - - for (i=0;isubframeSize;i++) - innov[i] = ADD32(innov[i],innov2[i]); - stack = tmp_stack; - } - for (i=0;isubframeSize;i++) - exc[i] = PSHR32(innov[i],SIG_SHIFT); - - if (st->innov_rms_save) - { - st->innov_rms_save[sub] = MULT16_16_Q15(QCONST16(.70711f, 15), compute_rms(innov, st->subframeSize)); - } - st->exc_rms[sub] = compute_rms16(exc, st->subframeSize); - - - } - - - /*Keep the previous memory*/ - for (i=0;ilpcSize;i++) - mem[i]=st->mem_sp[i]; - /* Final signal synthesis from excitation */ - iir_mem16(exc, st->interp_qlpc, sp, st->subframeSize, st->lpcSize, st->mem_sp, stack); - - /* Compute weighted signal again, from synthesized speech (not sure it's the right thing) */ - filter_mem16(sp, bw_lpc1, bw_lpc2, sw, st->subframeSize, st->lpcSize, st->mem_sw, stack); - } - - for (i=0;ilpcSize;i++) - st->old_lsp[i] = lsp[i]; - for (i=0;ilpcSize;i++) - st->old_qlsp[i] = qlsp[i]; - - st->first=0; - - return 1; -} - -#endif /* DISABLE_ENCODER */ - - -#ifndef DISABLE_DECODER -void *sb_decoder_init(const SpeexMode *m) -{ - spx_int32_t tmp; - SBDecState *st; - const SpeexSBMode *mode; - st = (SBDecState*)speex_alloc(sizeof(SBDecState)); - if (!st) - return NULL; - st->mode = m; - mode=(const SpeexSBMode*)m->mode; - st->encode_submode = 1; - - st->st_low = speex_decoder_init(mode->nb_mode); -#if defined(VAR_ARRAYS) || defined (USE_ALLOCA) - st->stack = NULL; -#else - /*st->stack = (char*)speex_alloc_scratch(SB_DEC_STACK);*/ - speex_decoder_ctl(st->st_low, SPEEX_GET_STACK, &st->stack); -#endif - - st->full_frame_size = 2*mode->frameSize; - st->frame_size = mode->frameSize; - st->subframeSize = mode->subframeSize; - st->nbSubframes = mode->frameSize/mode->subframeSize; - st->lpcSize=mode->lpcSize; - speex_decoder_ctl(st->st_low, SPEEX_GET_SAMPLING_RATE, &st->sampling_rate); - st->sampling_rate*=2; - tmp=1; - speex_decoder_ctl(st->st_low, SPEEX_SET_WIDEBAND, &tmp); - - st->submodes=mode->submodes; - st->submodeID=mode->defaultSubmode; - - st->first=1; - - st->g0_mem = (spx_word16_t*)speex_alloc((QMF_ORDER)*sizeof(spx_word16_t)); - st->g1_mem = (spx_word16_t*)speex_alloc((QMF_ORDER)*sizeof(spx_word16_t)); - - st->excBuf = (spx_word16_t*)speex_alloc((st->subframeSize)*sizeof(spx_word16_t)); - - st->old_qlsp = (spx_lsp_t*)speex_alloc((st->lpcSize)*sizeof(spx_lsp_t)); - st->interp_qlpc = (spx_coef_t*)speex_alloc(st->lpcSize*sizeof(spx_coef_t)); - - st->pi_gain = (spx_word32_t*)speex_alloc((st->nbSubframes)*sizeof(spx_word32_t)); - st->exc_rms = (spx_word16_t*)speex_alloc((st->nbSubframes)*sizeof(spx_word16_t)); - st->mem_sp = (spx_mem_t*)speex_alloc((2*st->lpcSize)*sizeof(spx_mem_t)); - - st->innov_save = NULL; - - - st->lpc_enh_enabled=0; - st->seed = 1000; - -#ifdef ENABLE_VALGRIND - VALGRIND_MAKE_READABLE(st, (st->stack-(char*)st)); -#endif - return st; -} - -void sb_decoder_destroy(void *state) -{ - SBDecState *st; - st = (SBDecState*)state; - speex_decoder_destroy(st->st_low); -#if !(defined(VAR_ARRAYS) || defined (USE_ALLOCA)) - /*speex_free_scratch(st->stack);*/ -#endif - - speex_free(st->g0_mem); - speex_free(st->g1_mem); - speex_free(st->excBuf); - speex_free(st->old_qlsp); - speex_free(st->interp_qlpc); - speex_free(st->pi_gain); - speex_free(st->exc_rms); - speex_free(st->mem_sp); - - speex_free(state); -} - - - -int sb_decoder_ctl(void *state, int request, void *ptr) -{ - SBDecState *st; - st=(SBDecState*)state; - switch(request) - { - case SPEEX_SET_HIGH_MODE: - st->submodeID = (*(spx_int32_t*)ptr); - break; - case SPEEX_SET_LOW_MODE: - speex_decoder_ctl(st->st_low, SPEEX_SET_LOW_MODE, ptr); - break; - case SPEEX_GET_LOW_MODE: - speex_decoder_ctl(st->st_low, SPEEX_GET_LOW_MODE, ptr); - break; - case SPEEX_GET_FRAME_SIZE: - (*(spx_int32_t*)ptr) = st->full_frame_size; - break; - case SPEEX_SET_ENH: - speex_decoder_ctl(st->st_low, request, ptr); - st->lpc_enh_enabled = *((spx_int32_t*)ptr); - break; - case SPEEX_GET_ENH: - *((spx_int32_t*)ptr) = st->lpc_enh_enabled; - break; - case SPEEX_SET_MODE: - case SPEEX_SET_QUALITY: - { - spx_int32_t nb_qual; - int quality = (*(spx_int32_t*)ptr); - if (quality < 0) - quality = 0; - if (quality > 10) - quality = 10; - st->submodeID = ((const SpeexSBMode*)(st->mode->mode))->quality_map[quality]; - nb_qual = ((const SpeexSBMode*)(st->mode->mode))->low_quality_map[quality]; - speex_decoder_ctl(st->st_low, SPEEX_SET_MODE, &nb_qual); - } - break; - case SPEEX_GET_BITRATE: - speex_decoder_ctl(st->st_low, request, ptr); - if (st->submodes[st->submodeID]) - (*(spx_int32_t*)ptr) += st->sampling_rate*SUBMODE(bits_per_frame)/st->full_frame_size; - else - (*(spx_int32_t*)ptr) += st->sampling_rate*(SB_SUBMODE_BITS+1)/st->full_frame_size; - break; - case SPEEX_SET_SAMPLING_RATE: - { - spx_int32_t tmp=(*(spx_int32_t*)ptr); - st->sampling_rate = tmp; - tmp>>=1; - speex_decoder_ctl(st->st_low, SPEEX_SET_SAMPLING_RATE, &tmp); - } - break; - case SPEEX_GET_SAMPLING_RATE: - (*(spx_int32_t*)ptr)=st->sampling_rate; - break; - case SPEEX_SET_HANDLER: - speex_decoder_ctl(st->st_low, SPEEX_SET_HANDLER, ptr); - break; - case SPEEX_SET_USER_HANDLER: - speex_decoder_ctl(st->st_low, SPEEX_SET_USER_HANDLER, ptr); - break; - case SPEEX_RESET_STATE: - { - int i; - for (i=0;i<2*st->lpcSize;i++) - st->mem_sp[i]=0; - for (i=0;ig0_mem[i]=st->g1_mem[i]=0; - st->last_ener=0; - } - break; - case SPEEX_SET_SUBMODE_ENCODING: - st->encode_submode = (*(spx_int32_t*)ptr); - speex_decoder_ctl(st->st_low, SPEEX_SET_SUBMODE_ENCODING, ptr); - break; - case SPEEX_GET_SUBMODE_ENCODING: - (*(spx_int32_t*)ptr) = st->encode_submode; - break; - case SPEEX_GET_LOOKAHEAD: - speex_decoder_ctl(st->st_low, SPEEX_GET_LOOKAHEAD, ptr); - (*(spx_int32_t*)ptr) = 2*(*(spx_int32_t*)ptr); - break; - case SPEEX_SET_HIGHPASS: - speex_decoder_ctl(st->st_low, SPEEX_SET_HIGHPASS, ptr); - break; - case SPEEX_GET_HIGHPASS: - speex_decoder_ctl(st->st_low, SPEEX_GET_HIGHPASS, ptr); - break; - case SPEEX_GET_ACTIVITY: - speex_decoder_ctl(st->st_low, SPEEX_GET_ACTIVITY, ptr); - break; - case SPEEX_GET_PI_GAIN: - { - int i; - spx_word32_t *g = (spx_word32_t*)ptr; - for (i=0;inbSubframes;i++) - g[i]=st->pi_gain[i]; - } - break; - case SPEEX_GET_EXC: - { - int i; - for (i=0;inbSubframes;i++) - ((spx_word16_t*)ptr)[i] = st->exc_rms[i]; - } - break; - case SPEEX_GET_DTX_STATUS: - speex_decoder_ctl(st->st_low, SPEEX_GET_DTX_STATUS, ptr); - break; - case SPEEX_SET_INNOVATION_SAVE: - st->innov_save = (spx_word16_t*)ptr; - break; - case SPEEX_SET_WIDEBAND: - speex_decoder_ctl(st->st_low, SPEEX_SET_WIDEBAND, ptr); - break; - case SPEEX_GET_STACK: - *((char**)ptr) = st->stack; - break; - default: - speex_warning_int("Unknown nb_ctl request: ", request); - return -1; - } - return 0; -} - - -static void sb_decode_lost(SBDecState *st, spx_word16_t *out, int dtx, char *stack) -{ - int i; - int saved_modeid=0; - - if (dtx) - { - saved_modeid=st->submodeID; - st->submodeID=1; - } else { - bw_lpc(QCONST16(0.99f,15), st->interp_qlpc, st->interp_qlpc, st->lpcSize); - } - - st->first=1; - - - /* Final signal synthesis from excitation */ - if (!dtx) - { - st->last_ener = MULT16_16_Q15(QCONST16(.9f,15),st->last_ener); - } - for (i=0;iframe_size;i++) - out[i+st->frame_size] = speex_rand(st->last_ener, &st->seed); - - iir_mem16(out+st->frame_size, st->interp_qlpc, out+st->frame_size, st->frame_size, st->lpcSize, - st->mem_sp, stack); - - - /* Reconstruct the original */ - qmf_synth(out, out+st->frame_size, h0, out, st->full_frame_size, QMF_ORDER, st->g0_mem, st->g1_mem, stack); - if (dtx) - { - st->submodeID=saved_modeid; - } - - return; -} - -int sb_decode(void *state, SpeexBits *bits, void *vout) -{ - int i, sub; - SBDecState *st; - int wideband; - int ret; - char *stack; - VARDECL(spx_word32_t *low_pi_gain); - VARDECL(spx_word16_t *low_exc_rms); - VARDECL(spx_coef_t *ak); - VARDECL(spx_lsp_t *qlsp); - VARDECL(spx_lsp_t *interp_qlsp); - spx_int32_t dtx; - const SpeexSBMode *mode; - spx_word16_t *out = (spx_word16_t*)vout; - spx_word16_t *low_innov_alias; - spx_word32_t exc_ener_sum = 0; - - st = (SBDecState*)state; - stack=st->stack; - mode = (const SpeexSBMode*)(st->mode->mode); - - low_innov_alias = out+st->frame_size; - speex_decoder_ctl(st->st_low, SPEEX_SET_INNOVATION_SAVE, low_innov_alias); - /* Decode the low-band */ - ret = speex_decode_native(st->st_low, bits, out); - - speex_decoder_ctl(st->st_low, SPEEX_GET_DTX_STATUS, &dtx); - - /* If error decoding the narrowband part, propagate error */ - if (ret!=0) - { - return ret; - } - - if (!bits) - { - sb_decode_lost(st, out, dtx, stack); - return 0; - } - - if (st->encode_submode) - { - - /*Check "wideband bit"*/ - if (speex_bits_remaining(bits)>0) - wideband = speex_bits_peek(bits); - else - wideband = 0; - if (wideband) - { - /*Regular wideband frame, read the submode*/ - wideband = speex_bits_unpack_unsigned(bits, 1); - st->submodeID = speex_bits_unpack_unsigned(bits, SB_SUBMODE_BITS); - } else - { - /*Was a narrowband frame, set "null submode"*/ - st->submodeID = 0; - } - if (st->submodeID != 0 && st->submodes[st->submodeID] == NULL) - { - speex_notify("Invalid mode encountered. The stream is corrupted."); - return -2; - } - } - - /* If null mode (no transmission), just set a couple things to zero*/ - if (st->submodes[st->submodeID] == NULL) - { - if (dtx) - { - sb_decode_lost(st, out, 1, stack); - return 0; - } - - for (i=0;iframe_size;i++) - out[st->frame_size+i]=VERY_SMALL; - - st->first=1; - - /* Final signal synthesis from excitation */ - iir_mem16(out+st->frame_size, st->interp_qlpc, out+st->frame_size, st->frame_size, st->lpcSize, st->mem_sp, stack); - - qmf_synth(out, out+st->frame_size, h0, out, st->full_frame_size, QMF_ORDER, st->g0_mem, st->g1_mem, stack); - - return 0; - - } - - ALLOC(low_pi_gain, st->nbSubframes, spx_word32_t); - ALLOC(low_exc_rms, st->nbSubframes, spx_word16_t); - speex_decoder_ctl(st->st_low, SPEEX_GET_PI_GAIN, low_pi_gain); - speex_decoder_ctl(st->st_low, SPEEX_GET_EXC, low_exc_rms); - - ALLOC(qlsp, st->lpcSize, spx_lsp_t); - ALLOC(interp_qlsp, st->lpcSize, spx_lsp_t); - SUBMODE(lsp_unquant)(qlsp, st->lpcSize, bits); - - if (st->first) - { - for (i=0;ilpcSize;i++) - st->old_qlsp[i] = qlsp[i]; - } - - ALLOC(ak, st->lpcSize, spx_coef_t); - - for (sub=0;subnbSubframes;sub++) - { - VARDECL(spx_word32_t *exc); - spx_word16_t *innov_save=NULL; - spx_word16_t *sp; - spx_word16_t filter_ratio; - spx_word16_t el=0; - int offset; - spx_word32_t rl=0,rh=0; - - offset = st->subframeSize*sub; - sp=out+st->frame_size+offset; - ALLOC(exc, st->subframeSize, spx_word32_t); - /* Pointer for saving innovation */ - if (st->innov_save) - { - innov_save = st->innov_save+2*offset; - SPEEX_MEMSET(innov_save, 0, 2*st->subframeSize); - } - - /* LSP interpolation */ - lsp_interpolate(st->old_qlsp, qlsp, interp_qlsp, st->lpcSize, sub, st->nbSubframes, LSP_MARGIN); - - /* LSP to LPC */ - lsp_to_lpc(interp_qlsp, ak, st->lpcSize, stack); - - /* Calculate reponse ratio between the low and high filter in the middle - of the band (4000 Hz) */ - - st->pi_gain[sub]=LPC_SCALING; - rh = LPC_SCALING; - for (i=0;ilpcSize;i+=2) - { - rh += ak[i+1] - ak[i]; - st->pi_gain[sub] += ak[i] + ak[i+1]; - } - - rl = low_pi_gain[sub]; -#ifdef FIXED_POINT - filter_ratio=EXTRACT16(SATURATE(PDIV32(SHL32(ADD32(rl,82),7),ADD32(82,rh)),32767)); -#else - filter_ratio=(rl+.01)/(rh+.01); -#endif - - SPEEX_MEMSET(exc, 0, st->subframeSize); - if (!SUBMODE(innovation_unquant)) - { - spx_word32_t g; - int quant; - - quant = speex_bits_unpack_unsigned(bits, 5); - g= spx_exp(MULT16_16(QCONST16(.125f,11),(quant-10))); - - g = PDIV32(g, filter_ratio); - - for (i=0;isubframeSize;i+=2) - { - exc[i]=SHL32(MULT16_32_P15(MULT16_16_Q15(mode->folding_gain,low_innov_alias[offset+i]),SHL32(g,6)),SIG_SHIFT); - exc[i+1]=NEG32(SHL32(MULT16_32_P15(MULT16_16_Q15(mode->folding_gain,low_innov_alias[offset+i+1]),SHL32(g,6)),SIG_SHIFT)); - } - - } else { - spx_word16_t gc; - spx_word32_t scale; - int qgc = speex_bits_unpack_unsigned(bits, 4); - - el = low_exc_rms[sub]; - gc = MULT16_16_Q15(QCONST16(0.87360,15),gc_quant_bound[qgc]); - - if (st->subframeSize==80) - gc = MULT16_16_P14(QCONST16(1.4142f,14),gc); - - scale = SHL32(PDIV32(SHL32(MULT16_16(gc, el),3), filter_ratio),SIG_SHIFT-3); - SUBMODE(innovation_unquant)(exc, SUBMODE(innovation_params), st->subframeSize, - bits, stack, &st->seed); - - signal_mul(exc,exc,scale,st->subframeSize); - - if (SUBMODE(double_codebook)) { - char *tmp_stack=stack; - VARDECL(spx_sig_t *innov2); - ALLOC(innov2, st->subframeSize, spx_sig_t); - SPEEX_MEMSET(innov2, 0, st->subframeSize); - SUBMODE(innovation_unquant)(innov2, SUBMODE(innovation_params), st->subframeSize, - bits, stack, &st->seed); - signal_mul(innov2, innov2, MULT16_32_P15(QCONST16(0.4f,15),scale), st->subframeSize); - for (i=0;isubframeSize;i++) - exc[i] = ADD32(exc[i],innov2[i]); - stack = tmp_stack; - } - - } - - if (st->innov_save) - { - for (i=0;isubframeSize;i++) - innov_save[2*i]=EXTRACT16(PSHR32(exc[i],SIG_SHIFT)); - } - - iir_mem16(st->excBuf, st->interp_qlpc, sp, st->subframeSize, st->lpcSize, - st->mem_sp, stack); - for (i=0;isubframeSize;i++) - st->excBuf[i]=EXTRACT16(PSHR32(exc[i],SIG_SHIFT)); - for (i=0;ilpcSize;i++) - st->interp_qlpc[i] = ak[i]; - st->exc_rms[sub] = compute_rms16(st->excBuf, st->subframeSize); - exc_ener_sum = ADD32(exc_ener_sum, DIV32(MULT16_16(st->exc_rms[sub],st->exc_rms[sub]), st->nbSubframes)); - } - st->last_ener = spx_sqrt(exc_ener_sum); - - qmf_synth(out, out+st->frame_size, h0, out, st->full_frame_size, QMF_ORDER, st->g0_mem, st->g1_mem, stack); - for (i=0;ilpcSize;i++) - st->old_qlsp[i] = qlsp[i]; - - st->first=0; - - return 0; -} -#endif /* DISABLE_DECODER */ - - - -#endif - diff --git a/Engine/lib/speex/libspeex/sb_celp.h b/Engine/lib/speex/libspeex/sb_celp.h deleted file mode 100644 index 141d0c2e1..000000000 --- a/Engine/lib/speex/libspeex/sb_celp.h +++ /dev/null @@ -1,154 +0,0 @@ -/* Copyright (C) 2002-2006 Jean-Marc Valin */ -/** - @file sb_celp.h - @brief Sub-band CELP mode used for wideband encoding -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifndef SB_CELP_H -#define SB_CELP_H - -#include "modes.h" -#include "nb_celp.h" - -/**Structure representing the full state of the sub-band encoder*/ -typedef struct SBEncState { - const SpeexMode *mode; /**< Pointer to the mode (containing for vtable info) */ - void *st_low; /**< State of the low-band (narrowband) encoder */ - int full_frame_size; /**< Length of full-band frames*/ - int frame_size; /**< Length of high-band frames*/ - int subframeSize; /**< Length of high-band sub-frames*/ - int nbSubframes; /**< Number of high-band sub-frames*/ - int windowSize; /**< Length of high-band LPC window*/ - int lpcSize; /**< Order of high-band LPC analysis */ - int first; /**< First frame? */ - spx_word16_t lpc_floor; /**< Controls LPC analysis noise floor */ - spx_word16_t gamma1; /**< Perceptual weighting coef 1 */ - spx_word16_t gamma2; /**< Perceptual weighting coef 2 */ - - char *stack; /**< Temporary allocation stack */ - spx_word16_t *high; /**< High-band signal (buffer) */ - spx_word16_t *h0_mem; - - const spx_word16_t *window; /**< LPC analysis window */ - const spx_word16_t *lagWindow; /**< Auto-correlation window */ - spx_lsp_t *old_lsp; /**< LSPs of previous frame */ - spx_lsp_t *old_qlsp; /**< Quantized LSPs of previous frame */ - spx_coef_t *interp_qlpc; /**< Interpolated quantized LPCs for current sub-frame */ - - spx_mem_t *mem_sp; /**< Synthesis signal memory */ - spx_mem_t *mem_sp2; - spx_mem_t *mem_sw; /**< Perceptual signal memory */ - spx_word32_t *pi_gain; - spx_word16_t *exc_rms; - spx_word16_t *innov_rms_save; /**< If non-NULL, innovation is copied here */ - -#ifndef DISABLE_VBR - float vbr_quality; /**< Quality setting for VBR encoding */ - int vbr_enabled; /**< 1 for enabling VBR, 0 otherwise */ - spx_int32_t vbr_max; /**< Max bit-rate allowed in VBR mode (total) */ - spx_int32_t vbr_max_high; /**< Max bit-rate allowed in VBR mode for the high-band */ - spx_int32_t abr_enabled; /**< ABR setting (in bps), 0 if off */ - float abr_drift; - float abr_drift2; - float abr_count; - int vad_enabled; /**< 1 for enabling VAD, 0 otherwise */ - float relative_quality; -#endif /* #ifndef DISABLE_VBR */ - - int encode_submode; - const SpeexSubmode * const *submodes; - int submodeID; - int submodeSelect; - int complexity; - spx_int32_t sampling_rate; - -} SBEncState; - - -/**Structure representing the full state of the sub-band decoder*/ -typedef struct SBDecState { - const SpeexMode *mode; /**< Pointer to the mode (containing for vtable info) */ - void *st_low; /**< State of the low-band (narrowband) encoder */ - int full_frame_size; - int frame_size; - int subframeSize; - int nbSubframes; - int lpcSize; - int first; - spx_int32_t sampling_rate; - int lpc_enh_enabled; - - char *stack; - spx_word16_t *g0_mem, *g1_mem; - - spx_word16_t *excBuf; - spx_lsp_t *old_qlsp; - spx_coef_t *interp_qlpc; - - spx_mem_t *mem_sp; - spx_word32_t *pi_gain; - spx_word16_t *exc_rms; - spx_word16_t *innov_save; /** If non-NULL, innovation is copied here */ - - spx_word16_t last_ener; - spx_int32_t seed; - - int encode_submode; - const SpeexSubmode * const *submodes; - int submodeID; -} SBDecState; - - -/**Initializes encoder state*/ -void *sb_encoder_init(const SpeexMode *m); - -/**De-allocates encoder state resources*/ -void sb_encoder_destroy(void *state); - -/**Encodes one frame*/ -int sb_encode(void *state, void *in, SpeexBits *bits); - - -/**Initializes decoder state*/ -void *sb_decoder_init(const SpeexMode *m); - -/**De-allocates decoder state resources*/ -void sb_decoder_destroy(void *state); - -/**Decodes one frame*/ -int sb_decode(void *state, SpeexBits *bits, void *out); - -int sb_encoder_ctl(void *state, int request, void *ptr); - -int sb_decoder_ctl(void *state, int request, void *ptr); - -#endif diff --git a/Engine/lib/speex/libspeex/smallft.c b/Engine/lib/speex/libspeex/smallft.c deleted file mode 100644 index 82c3b0a4a..000000000 --- a/Engine/lib/speex/libspeex/smallft.c +++ /dev/null @@ -1,1261 +0,0 @@ -/******************************************************************** - * * - * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * - * by the XIPHOPHORUS Company http://www.xiph.org/ * - * * - ******************************************************************** - - function: *unnormalized* fft transform - last mod: $Id: smallft.c,v 1.19 2003/10/08 05:12:37 jm Exp $ - - ********************************************************************/ - -/* FFT implementation from OggSquish, minus cosine transforms, - * minus all but radix 2/4 case. In Vorbis we only need this - * cut-down version. - * - * To do more than just power-of-two sized vectors, see the full - * version I wrote for NetLib. - * - * Note that the packing is a little strange; rather than the FFT r/i - * packing following R_0, I_n, R_1, I_1, R_2, I_2 ... R_n-1, I_n-1, - * it follows R_0, R_1, I_1, R_2, I_2 ... R_n-1, I_n-1, I_n like the - * FORTRAN version - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include "smallft.h" -#include "arch.h" -#include "os_support.h" - -static void drfti1(int n, float *wa, int *ifac){ - static int ntryh[4] = { 4,2,3,5 }; - static float tpi = 6.28318530717958648f; - float arg,argh,argld,fi; - int ntry=0,i,j=-1; - int k1, l1, l2, ib; - int ld, ii, ip, is, nq, nr; - int ido, ipm, nfm1; - int nl=n; - int nf=0; - - L101: - j++; - if (j < 4) - ntry=ntryh[j]; - else - ntry+=2; - - L104: - nq=nl/ntry; - nr=nl-ntry*nq; - if (nr!=0) goto L101; - - nf++; - ifac[nf+1]=ntry; - nl=nq; - if(ntry!=2)goto L107; - if(nf==1)goto L107; - - for (i=1;i>1; - ipp2=ip; - idp2=ido; - nbd=(ido-1)>>1; - t0=l1*ido; - t10=ip*ido; - - if(ido==1)goto L119; - for(ik=0;ikl1){ - for(j=1;j>1; - ipp2=ip; - ipph=(ip+1)>>1; - if(idol1)goto L139; - - is= -ido-1; - t1=0; - for(j=1;jn==1)return; - drftf1(l->n,data,l->trigcache,l->trigcache+l->n,l->splitcache); -} - -void spx_drft_backward(struct drft_lookup *l,float *data){ - if (l->n==1)return; - drftb1(l->n,data,l->trigcache,l->trigcache+l->n,l->splitcache); -} - -void spx_drft_init(struct drft_lookup *l,int n) -{ - l->n=n; - l->trigcache=(float*)speex_alloc(3*n*sizeof(*l->trigcache)); - l->splitcache=(int*)speex_alloc(32*sizeof(*l->splitcache)); - fdrffti(n, l->trigcache, l->splitcache); -} - -void spx_drft_clear(struct drft_lookup *l) -{ - if(l) - { - if(l->trigcache) - speex_free(l->trigcache); - if(l->splitcache) - speex_free(l->splitcache); - } -} diff --git a/Engine/lib/speex/libspeex/smallft.h b/Engine/lib/speex/libspeex/smallft.h deleted file mode 100644 index 446e2f65b..000000000 --- a/Engine/lib/speex/libspeex/smallft.h +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************** - * * - * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * - * by the XIPHOPHORUS Company http://www.xiph.org/ * - * * - ******************************************************************** - - function: fft transform - last mod: $Id: smallft.h,v 1.3 2003/09/16 18:35:45 jm Exp $ - - ********************************************************************/ -/** - @file smallft.h - @brief Discrete Rotational Fourier Transform (DRFT) -*/ - -#ifndef _V_SMFT_H_ -#define _V_SMFT_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -/** Discrete Rotational Fourier Transform lookup */ -struct drft_lookup{ - int n; - float *trigcache; - int *splitcache; -}; - -extern void spx_drft_forward(struct drft_lookup *l,float *data); -extern void spx_drft_backward(struct drft_lookup *l,float *data); -extern void spx_drft_init(struct drft_lookup *l,int n); -extern void spx_drft_clear(struct drft_lookup *l); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/Engine/lib/speex/libspeex/speex.c b/Engine/lib/speex/libspeex/speex.c deleted file mode 100644 index 33701ba26..000000000 --- a/Engine/lib/speex/libspeex/speex.c +++ /dev/null @@ -1,253 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: speex.c - - Basic Speex functions - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "modes.h" -#include -#include "os_support.h" - -#ifndef NULL -#define NULL 0 -#endif - -#define MAX_IN_SAMPLES 640 - - - -EXPORT void *speex_encoder_init(const SpeexMode *mode) -{ - return mode->enc_init(mode); -} - -EXPORT void *speex_decoder_init(const SpeexMode *mode) -{ - return mode->dec_init(mode); -} - -EXPORT void speex_encoder_destroy(void *state) -{ - (*((SpeexMode**)state))->enc_destroy(state); -} - -EXPORT void speex_decoder_destroy(void *state) -{ - (*((SpeexMode**)state))->dec_destroy(state); -} - - - -int speex_encode_native(void *state, spx_word16_t *in, SpeexBits *bits) -{ - return (*((SpeexMode**)state))->enc(state, in, bits); -} - -int speex_decode_native(void *state, SpeexBits *bits, spx_word16_t *out) -{ - return (*((SpeexMode**)state))->dec(state, bits, out); -} - - - -#ifdef FIXED_POINT - -#ifndef DISABLE_FLOAT_API -EXPORT int speex_encode(void *state, float *in, SpeexBits *bits) -{ - int i; - spx_int32_t N; - spx_int16_t short_in[MAX_IN_SAMPLES]; - speex_encoder_ctl(state, SPEEX_GET_FRAME_SIZE, &N); - for (i=0;i32767.f) - short_in[i] = 32767; - else if (in[i]<-32768.f) - short_in[i] = -32768; - else - short_in[i] = (spx_int16_t)floor(.5+in[i]); - } - return (*((SpeexMode**)state))->enc(state, short_in, bits); -} -#endif /* #ifndef DISABLE_FLOAT_API */ - -EXPORT int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits) -{ - SpeexMode *mode; - mode = *(SpeexMode**)state; - return (mode)->enc(state, in, bits); -} - -#ifndef DISABLE_FLOAT_API -EXPORT int speex_decode(void *state, SpeexBits *bits, float *out) -{ - int i, ret; - spx_int32_t N; - spx_int16_t short_out[MAX_IN_SAMPLES]; - speex_decoder_ctl(state, SPEEX_GET_FRAME_SIZE, &N); - ret = (*((SpeexMode**)state))->dec(state, bits, short_out); - for (i=0;idec(state, bits, out); -} - -#else - -EXPORT int speex_encode(void *state, float *in, SpeexBits *bits) -{ - return (*((SpeexMode**)state))->enc(state, in, bits); -} - -EXPORT int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits) -{ - int i; - spx_int32_t N; - float float_in[MAX_IN_SAMPLES]; - speex_encoder_ctl(state, SPEEX_GET_FRAME_SIZE, &N); - for (i=0;ienc(state, float_in, bits); -} - -EXPORT int speex_decode(void *state, SpeexBits *bits, float *out) -{ - return (*((SpeexMode**)state))->dec(state, bits, out); -} - -EXPORT int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out) -{ - int i; - spx_int32_t N; - float float_out[MAX_IN_SAMPLES]; - int ret; - speex_decoder_ctl(state, SPEEX_GET_FRAME_SIZE, &N); - ret = (*((SpeexMode**)state))->dec(state, bits, float_out); - if (ret == 0) - { - for (i=0;i32767.f) - out[i] = 32767; - else if (float_out[i]<-32768.f) - out[i] = -32768; - else - out[i] = (spx_int16_t)floor(.5+float_out[i]); - } - } - return ret; -} -#endif - - - -EXPORT int speex_encoder_ctl(void *state, int request, void *ptr) -{ - return (*((SpeexMode**)state))->enc_ctl(state, request, ptr); -} - -EXPORT int speex_decoder_ctl(void *state, int request, void *ptr) -{ - return (*((SpeexMode**)state))->dec_ctl(state, request, ptr); -} - - - -int nb_mode_query(const void *mode, int request, void *ptr) -{ - const SpeexNBMode *m = (const SpeexNBMode*)mode; - - switch (request) - { - case SPEEX_MODE_FRAME_SIZE: - *((int*)ptr)=m->frameSize; - break; - case SPEEX_SUBMODE_BITS_PER_FRAME: - if (*((int*)ptr)==0) - *((int*)ptr) = NB_SUBMODE_BITS+1; - else if (m->submodes[*((int*)ptr)]==NULL) - *((int*)ptr) = -1; - else - *((int*)ptr) = m->submodes[*((int*)ptr)]->bits_per_frame; - break; - default: - speex_warning_int("Unknown nb_mode_query request: ", request); - return -1; - } - return 0; -} - - - -EXPORT int speex_lib_ctl(int request, void *ptr) -{ - switch (request) - { - case SPEEX_LIB_GET_MAJOR_VERSION: - *((int*)ptr) = SPEEX_MAJOR_VERSION; - break; - case SPEEX_LIB_GET_MINOR_VERSION: - *((int*)ptr) = SPEEX_MINOR_VERSION; - break; - case SPEEX_LIB_GET_MICRO_VERSION: - *((int*)ptr) = SPEEX_MICRO_VERSION; - break; - case SPEEX_LIB_GET_EXTRA_VERSION: - *((const char**)ptr) = SPEEX_EXTRA_VERSION; - break; - case SPEEX_LIB_GET_VERSION_STRING: - *((const char**)ptr) = SPEEX_VERSION; - break; - /*case SPEEX_LIB_SET_ALLOC_FUNC: - break; - case SPEEX_LIB_GET_ALLOC_FUNC: - break; - case SPEEX_LIB_SET_FREE_FUNC: - break; - case SPEEX_LIB_GET_FREE_FUNC: - break;*/ - default: - speex_warning_int("Unknown wb_mode_query request: ", request); - return -1; - } - return 0; -} diff --git a/Engine/lib/speex/libspeex/speex_callbacks.c b/Engine/lib/speex/libspeex/speex_callbacks.c deleted file mode 100644 index 8be9e389b..000000000 --- a/Engine/lib/speex/libspeex/speex_callbacks.c +++ /dev/null @@ -1,144 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File speex_callbacks.c - Callback handling and in-band signalling - - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "speex/speex_callbacks.h" -#include "arch.h" -#include "os_support.h" - -EXPORT int speex_inband_handler(SpeexBits *bits, SpeexCallback *callback_list, void *state) -{ - int id; - SpeexCallback *callback; - /*speex_bits_advance(bits, 5);*/ - id=speex_bits_unpack_unsigned(bits, 4); - callback = callback_list+id; - - if (callback->func) - { - return callback->func(bits, state, callback->data); - } else - /*If callback is not registered, skip the right number of bits*/ - { - int adv; - if (id<2) - adv = 1; - else if (id<8) - adv = 4; - else if (id<10) - adv = 8; - else if (id<12) - adv = 16; - else if (id<14) - adv = 32; - else - adv = 64; - speex_bits_advance(bits, adv); - } - return 0; -} - -EXPORT int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data) -{ - spx_int32_t m; - m = speex_bits_unpack_unsigned(bits, 4); - speex_encoder_ctl(data, SPEEX_SET_MODE, &m); - return 0; -} - -EXPORT int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void *data) -{ - spx_int32_t m; - m = speex_bits_unpack_unsigned(bits, 4); - speex_encoder_ctl(data, SPEEX_SET_LOW_MODE, &m); - return 0; -} - -EXPORT int speex_std_high_mode_request_handler(SpeexBits *bits, void *state, void *data) -{ - spx_int32_t m; - m = speex_bits_unpack_unsigned(bits, 4); - speex_encoder_ctl(data, SPEEX_SET_HIGH_MODE, &m); - return 0; -} - -#ifndef DISABLE_VBR -EXPORT int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data) -{ - spx_int32_t vbr; - vbr = speex_bits_unpack_unsigned(bits, 1); - speex_encoder_ctl(data, SPEEX_SET_VBR, &vbr); - return 0; -} -#endif /* #ifndef DISABLE_VBR */ - -EXPORT int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data) -{ - spx_int32_t enh; - enh = speex_bits_unpack_unsigned(bits, 1); - speex_decoder_ctl(data, SPEEX_SET_ENH, &enh); - return 0; -} - -#ifndef DISABLE_VBR -EXPORT int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *data) -{ - float qual; - qual = speex_bits_unpack_unsigned(bits, 4); - speex_encoder_ctl(data, SPEEX_SET_VBR_QUALITY, &qual); - return 0; -} -#endif /* #ifndef DISABLE_VBR */ - -EXPORT int speex_std_char_handler(SpeexBits *bits, void *state, void *data) -{ - unsigned char ch; - ch = speex_bits_unpack_unsigned(bits, 8); - _speex_putc(ch, data); - /*printf("speex_std_char_handler ch=%x\n", ch);*/ - return 0; -} - - - -/* Default handler for user callbacks: skip it */ -EXPORT int speex_default_user_handler(SpeexBits *bits, void *state, void *data) -{ - int req_size = speex_bits_unpack_unsigned(bits, 4); - speex_bits_advance(bits, 5+8*req_size); - return 0; -} diff --git a/Engine/lib/speex/libspeex/speex_header.c b/Engine/lib/speex/libspeex/speex_header.c deleted file mode 100644 index 5900d365a..000000000 --- a/Engine/lib/speex/libspeex/speex_header.c +++ /dev/null @@ -1,202 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: speex_header.c - Describes the Speex header - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "arch.h" -#include "speex/speex_header.h" -#include "speex/speex.h" -#include "os_support.h" - -#ifndef NULL -#define NULL 0 -#endif - -/** Convert little endian */ -static inline spx_int32_t le_int(spx_int32_t i) -{ -#if !defined(__LITTLE_ENDIAN__) && ( defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__) ) - spx_uint32_t ui, ret; - ui = i; - ret = ui>>24; - ret |= (ui>>8)&0x0000ff00; - ret |= (ui<<8)&0x00ff0000; - ret |= (ui<<24); - return ret; -#else - return i; -#endif -} - -#define ENDIAN_SWITCH(x) {x=le_int(x);} - - -/* -typedef struct SpeexHeader { - char speex_string[8]; - char speex_version[SPEEX_HEADER_VERSION_LENGTH]; - int speex_version_id; - int header_size; - int rate; - int mode; - int mode_bitstream_version; - int nb_channels; - int bitrate; - int frame_size; - int vbr; - int frames_per_packet; - int extra_headers; - int reserved1; - int reserved2; -} SpeexHeader; -*/ - -EXPORT void speex_init_header(SpeexHeader *header, int rate, int nb_channels, const SpeexMode *m) -{ - int i; - const char *h="Speex "; - /* - strncpy(header->speex_string, "Speex ", 8); - strncpy(header->speex_version, SPEEX_VERSION, SPEEX_HEADER_VERSION_LENGTH-1); - header->speex_version[SPEEX_HEADER_VERSION_LENGTH-1]=0; - */ - for (i=0;i<8;i++) - header->speex_string[i]=h[i]; - for (i=0;ispeex_version[i]=SPEEX_VERSION[i]; - for (;ispeex_version[i]=0; - - header->speex_version_id = 1; - header->header_size = sizeof(SpeexHeader); - - header->rate = rate; - header->mode = m->modeID; - header->mode_bitstream_version = m->bitstream_version; - if (m->modeID<0) - speex_warning("This mode is meant to be used alone"); - header->nb_channels = nb_channels; - header->bitrate = -1; - speex_mode_query(m, SPEEX_MODE_FRAME_SIZE, &header->frame_size); - header->vbr = 0; - - header->frames_per_packet = 0; - header->extra_headers = 0; - header->reserved1 = 0; - header->reserved2 = 0; -} - -EXPORT char *speex_header_to_packet(SpeexHeader *header, int *size) -{ - SpeexHeader *le_header; - le_header = (SpeexHeader*)speex_alloc(sizeof(SpeexHeader)); - - SPEEX_COPY(le_header, header, 1); - - /*Make sure everything is now little-endian*/ - ENDIAN_SWITCH(le_header->speex_version_id); - ENDIAN_SWITCH(le_header->header_size); - ENDIAN_SWITCH(le_header->rate); - ENDIAN_SWITCH(le_header->mode); - ENDIAN_SWITCH(le_header->mode_bitstream_version); - ENDIAN_SWITCH(le_header->nb_channels); - ENDIAN_SWITCH(le_header->bitrate); - ENDIAN_SWITCH(le_header->frame_size); - ENDIAN_SWITCH(le_header->vbr); - ENDIAN_SWITCH(le_header->frames_per_packet); - ENDIAN_SWITCH(le_header->extra_headers); - - *size = sizeof(SpeexHeader); - return (char *)le_header; -} - -EXPORT SpeexHeader *speex_packet_to_header(char *packet, int size) -{ - int i; - SpeexHeader *le_header; - const char *h = "Speex "; - - /*FIXME: Do we allow larger headers?*/ - if (size < (int)sizeof(SpeexHeader)) - { - speex_notify("Speex header too small"); - return NULL; - } - - - for (i=0;i<8;i++) - if (packet[i]!=h[i]) - { - /* This doesn't look like a Speex file */ - return NULL; - } - - le_header = (SpeexHeader*)speex_alloc(sizeof(SpeexHeader)); - - SPEEX_COPY(le_header, (SpeexHeader*)packet, 1); - - /*Make sure everything is converted correctly from little-endian*/ - ENDIAN_SWITCH(le_header->speex_version_id); - ENDIAN_SWITCH(le_header->header_size); - ENDIAN_SWITCH(le_header->rate); - ENDIAN_SWITCH(le_header->mode); - ENDIAN_SWITCH(le_header->mode_bitstream_version); - ENDIAN_SWITCH(le_header->nb_channels); - ENDIAN_SWITCH(le_header->bitrate); - ENDIAN_SWITCH(le_header->frame_size); - ENDIAN_SWITCH(le_header->vbr); - ENDIAN_SWITCH(le_header->frames_per_packet); - ENDIAN_SWITCH(le_header->extra_headers); - - if (le_header->mode >= SPEEX_NB_MODES || le_header->mode < 0) - { - speex_notify("Invalid mode specified in Speex header"); - speex_free (le_header); - return NULL; - } - - if (le_header->nb_channels>2) - le_header->nb_channels = 2; - if (le_header->nb_channels<1) - le_header->nb_channels = 1; - - return le_header; - -} - -EXPORT void speex_header_free(void *ptr) -{ - speex_free(ptr); -} diff --git a/Engine/lib/speex/libspeex/stack_alloc.h b/Engine/lib/speex/libspeex/stack_alloc.h deleted file mode 100644 index 5264e666b..000000000 --- a/Engine/lib/speex/libspeex/stack_alloc.h +++ /dev/null @@ -1,115 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin */ -/** - @file stack_alloc.h - @brief Temporary memory allocation on stack -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef STACK_ALLOC_H -#define STACK_ALLOC_H - -#ifdef USE_ALLOCA -# ifdef WIN32 -# include -# else -# ifdef HAVE_ALLOCA_H -# include -# else -# include -# endif -# endif -#endif - -/** - * @def ALIGN(stack, size) - * - * Aligns the stack to a 'size' boundary - * - * @param stack Stack - * @param size New size boundary - */ - -/** - * @def PUSH(stack, size, type) - * - * Allocates 'size' elements of type 'type' on the stack - * - * @param stack Stack - * @param size Number of elements - * @param type Type of element - */ - -/** - * @def VARDECL(var) - * - * Declare variable on stack - * - * @param var Variable to declare - */ - -/** - * @def ALLOC(var, size, type) - * - * Allocate 'size' elements of 'type' on stack - * - * @param var Name of variable to allocate - * @param size Number of elements - * @param type Type of element - */ - -#ifdef ENABLE_VALGRIND - -#include - -#define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1)) - -#define PUSH(stack, size, type) (VALGRIND_MAKE_NOACCESS(stack, 1000),ALIGN((stack),sizeof(type)),VALGRIND_MAKE_WRITABLE(stack, ((size)*sizeof(type))),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type)))) - -#else - -#define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1)) - -#define PUSH(stack, size, type) (ALIGN((stack),sizeof(type)),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type)))) - -#endif - -#if defined(VAR_ARRAYS) -#define VARDECL(var) -#define ALLOC(var, size, type) type var[size] -#elif defined(USE_ALLOCA) -#define VARDECL(var) var -#define ALLOC(var, size, type) var = alloca(sizeof(type)*(size)) -#else -#define VARDECL(var) var -#define ALLOC(var, size, type) var = PUSH(stack, size, type) -#endif - - -#endif diff --git a/Engine/lib/speex/libspeex/stereo.c b/Engine/lib/speex/libspeex/stereo.c deleted file mode 100644 index 83642cb74..000000000 --- a/Engine/lib/speex/libspeex/stereo.c +++ /dev/null @@ -1,303 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: stereo.c - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "speex/speex_stereo.h" -#include "speex/speex_callbacks.h" -#include "math_approx.h" -#include "vq.h" -#include -#include "os_support.h" - -typedef struct RealSpeexStereoState { - spx_word32_t balance; /**< Left/right balance info */ - spx_word32_t e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(right)] */ - spx_word32_t smooth_left; /**< Smoothed left channel gain */ - spx_word32_t smooth_right; /**< Smoothed right channel gain */ - spx_uint32_t reserved1; /**< Reserved for future use */ - spx_int32_t reserved2; /**< Reserved for future use */ -} RealSpeexStereoState; - - -/*float e_ratio_quant[4] = {1, 1.26, 1.587, 2};*/ -#ifndef FIXED_POINT -static const float e_ratio_quant[4] = {.25f, .315f, .397f, .5f}; -static const float e_ratio_quant_bounds[3] = {0.2825f, 0.356f, 0.4485f}; -#else -static const spx_word16_t e_ratio_quant[4] = {8192, 10332, 13009, 16384}; -static const spx_word16_t e_ratio_quant_bounds[3] = {9257, 11665, 14696}; -static const spx_word16_t balance_bounds[31] = {18, 23, 30, 38, 49, 63, 81, 104, - 134, 172, 221, 284, 364, 468, 600, 771, - 990, 1271, 1632, 2096, 2691, 3455, 4436, 5696, - 7314, 9392, 12059, 15484, 19882, 25529, 32766}; -#endif - -/* This is an ugly compatibility hack that properly resets the stereo state - In case it it compiled in fixed-point, but initialised with the deprecated - floating point static initialiser */ -#ifdef FIXED_POINT -#define COMPATIBILITY_HACK(s) do {if ((s)->reserved1 != 0xdeadbeef) speex_stereo_state_reset((SpeexStereoState*)s); } while (0); -#else -#define COMPATIBILITY_HACK(s) -#endif - -EXPORT SpeexStereoState *speex_stereo_state_init() -{ - SpeexStereoState *stereo = speex_alloc(sizeof(SpeexStereoState)); - speex_stereo_state_reset(stereo); - return stereo; -} - -EXPORT void speex_stereo_state_reset(SpeexStereoState *_stereo) -{ - RealSpeexStereoState *stereo = (RealSpeexStereoState*)_stereo; -#ifdef FIXED_POINT - stereo->balance = 65536; - stereo->e_ratio = 16384; - stereo->smooth_left = 16384; - stereo->smooth_right = 16384; - stereo->reserved1 = 0xdeadbeef; - stereo->reserved2 = 0; -#else - stereo->balance = 1.0f; - stereo->e_ratio = .5f; - stereo->smooth_left = 1.f; - stereo->smooth_right = 1.f; - stereo->reserved1 = 0; - stereo->reserved2 = 0; -#endif -} - -EXPORT void speex_stereo_state_destroy(SpeexStereoState *stereo) -{ - speex_free(stereo); -} - -#ifndef DISABLE_ENCODER -#ifndef DISABLE_FLOAT_API -EXPORT void speex_encode_stereo(float *data, int frame_size, SpeexBits *bits) -{ - int i, tmp; - float e_left=0, e_right=0, e_tot=0; - float balance, e_ratio; - for (i=0;i0) - speex_bits_pack(bits, 0, 1); - else - speex_bits_pack(bits, 1, 1); - balance=floor(.5+fabs(balance)); - if (balance>30) - balance=31; - - speex_bits_pack(bits, (int)balance, 5); - - /* FIXME: this is a hack */ - tmp=scal_quant(e_ratio*Q15_ONE, e_ratio_quant_bounds, 4); - speex_bits_pack(bits, tmp, 2); -} -#endif /* #ifndef DISABLE_FLOAT_API */ - -EXPORT void speex_encode_stereo_int(spx_int16_t *data, int frame_size, SpeexBits *bits) -{ - int i, tmp; - spx_word32_t e_left=0, e_right=0, e_tot=0; - spx_word32_t balance, e_ratio; - spx_word32_t largest, smallest; - int balance_id; -#ifdef FIXED_POINT - int shift; -#endif - - /* In band marker */ - speex_bits_pack(bits, 14, 5); - /* Stereo marker */ - speex_bits_pack(bits, SPEEX_INBAND_STEREO, 4); - - for (i=0;i e_right) - { - speex_bits_pack(bits, 0, 1); - largest = e_left; - smallest = e_right; - } else { - speex_bits_pack(bits, 1, 1); - largest = e_right; - smallest = e_left; - } - - /* Balance quantization */ -#ifdef FIXED_POINT - shift = spx_ilog2(largest)-15; - largest = VSHR32(largest, shift-4); - smallest = VSHR32(smallest, shift); - balance = DIV32(largest, ADD32(smallest, 1)); - if (balance > 32767) - balance = 32767; - balance_id = scal_quant(EXTRACT16(balance), balance_bounds, 32); -#else - balance=(largest+1.)/(smallest+1.); - balance=4*log(balance); - balance_id=floor(.5+fabs(balance)); - if (balance_id>30) - balance_id=31; -#endif - - speex_bits_pack(bits, balance_id, 5); - - /* "coherence" quantisation */ -#ifdef FIXED_POINT - shift = spx_ilog2(e_tot); - e_tot = VSHR32(e_tot, shift-25); - e_left = VSHR32(e_left, shift-10); - e_right = VSHR32(e_right, shift-10); - e_ratio = DIV32(e_tot, e_left+e_right+1); -#else - e_ratio = e_tot/(1.+e_left+e_right); -#endif - - tmp=scal_quant(EXTRACT16(e_ratio), e_ratio_quant_bounds, 4); - /*fprintf (stderr, "%d %d %d %d\n", largest, smallest, balance_id, e_ratio);*/ - speex_bits_pack(bits, tmp, 2); -} -#else /* DISABLE_ENCODER */ -EXPORT void speex_encode_stereo_int(spx_int16_t *data, int frame_size, SpeexBits *bits) -{ -} -#endif /* DISABLE_ENCODER */ - - -#ifndef DISABLE_FLOAT_API -EXPORT void speex_decode_stereo(float *data, int frame_size, SpeexStereoState *_stereo) -{ - int i; - spx_word32_t balance; - spx_word16_t e_left, e_right, e_ratio; - RealSpeexStereoState *stereo = (RealSpeexStereoState*)_stereo; - - COMPATIBILITY_HACK(stereo); - - balance=stereo->balance; - e_ratio=stereo->e_ratio; - - /* These two are Q14, with max value just below 2. */ - e_right = DIV32(QCONST32(1., 22), spx_sqrt(MULT16_32_Q15(e_ratio, ADD32(QCONST32(1., 16), balance)))); - e_left = SHR32(MULT16_16(spx_sqrt(balance), e_right), 8); - - for (i=frame_size-1;i>=0;i--) - { - spx_word16_t tmp=data[i]; - stereo->smooth_left = EXTRACT16(PSHR32(MAC16_16(MULT16_16(stereo->smooth_left, QCONST16(0.98, 15)), e_left, QCONST16(0.02, 15)), 15)); - stereo->smooth_right = EXTRACT16(PSHR32(MAC16_16(MULT16_16(stereo->smooth_right, QCONST16(0.98, 15)), e_right, QCONST16(0.02, 15)), 15)); - data[2*i] = (float)MULT16_16_P14(stereo->smooth_left, tmp); - data[2*i+1] = (float)MULT16_16_P14(stereo->smooth_right, tmp); - } -} -#endif /* #ifndef DISABLE_FLOAT_API */ - -EXPORT void speex_decode_stereo_int(spx_int16_t *data, int frame_size, SpeexStereoState *_stereo) -{ - int i; - spx_word32_t balance; - spx_word16_t e_left, e_right, e_ratio; - RealSpeexStereoState *stereo = (RealSpeexStereoState*)_stereo; - - COMPATIBILITY_HACK(stereo); - - balance=stereo->balance; - e_ratio=stereo->e_ratio; - - /* These two are Q14, with max value just below 2. */ - e_right = DIV32(QCONST32(1., 22), spx_sqrt(MULT16_32_Q15(e_ratio, ADD32(QCONST32(1., 16), balance)))); - e_left = SHR32(MULT16_16(spx_sqrt(balance), e_right), 8); - - for (i=frame_size-1;i>=0;i--) - { - spx_int16_t tmp=data[i]; - stereo->smooth_left = EXTRACT16(PSHR32(MAC16_16(MULT16_16(stereo->smooth_left, QCONST16(0.98, 15)), e_left, QCONST16(0.02, 15)), 15)); - stereo->smooth_right = EXTRACT16(PSHR32(MAC16_16(MULT16_16(stereo->smooth_right, QCONST16(0.98, 15)), e_right, QCONST16(0.02, 15)), 15)); - data[2*i] = (spx_int16_t)MULT16_16_P14(stereo->smooth_left, tmp); - data[2*i+1] = (spx_int16_t)MULT16_16_P14(stereo->smooth_right, tmp); - } -} - -EXPORT int speex_std_stereo_request_handler(SpeexBits *bits, void *state, void *data) -{ - RealSpeexStereoState *stereo; - spx_word16_t sign=1, dexp; - int tmp; - - stereo = (RealSpeexStereoState*)data; - - COMPATIBILITY_HACK(stereo); - - if (speex_bits_unpack_unsigned(bits, 1)) - sign=-1; - dexp = speex_bits_unpack_unsigned(bits, 5); -#ifndef FIXED_POINT - stereo->balance = exp(sign*.25*dexp); -#else - stereo->balance = spx_exp(MULT16_16(sign, SHL16(dexp, 9))); -#endif - tmp = speex_bits_unpack_unsigned(bits, 2); - stereo->e_ratio = e_ratio_quant[tmp]; - - return 0; -} diff --git a/Engine/lib/speex/libspeex/testenc.c b/Engine/lib/speex/libspeex/testenc.c deleted file mode 100644 index 1f634ed74..000000000 --- a/Engine/lib/speex/libspeex/testenc.c +++ /dev/null @@ -1,145 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "speex/speex_callbacks.h" -#include -#include - -#ifdef FIXED_DEBUG -extern long long spx_mips; -#endif - -#define FRAME_SIZE 160 -#include -int main(int argc, char **argv) -{ - char *inFile, *outFile, *bitsFile; - FILE *fin, *fout, *fbits=NULL; - short in_short[FRAME_SIZE]; - short out_short[FRAME_SIZE]; - int snr_frames = 0; - char cbits[200]; - int nbBits; - int i; - void *st; - void *dec; - SpeexBits bits; - spx_int32_t tmp; - int bitCount=0; - spx_int32_t skip_group_delay; - SpeexCallback callback; - - st = speex_encoder_init(speex_lib_get_mode(SPEEX_MODEID_NB)); - dec = speex_decoder_init(speex_lib_get_mode(SPEEX_MODEID_NB)); - - /* BEGIN: You probably don't need the following in a real application */ - callback.callback_id = SPEEX_INBAND_CHAR; - callback.func = speex_std_char_handler; - callback.data = stderr; - speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback); - - callback.callback_id = SPEEX_INBAND_MODE_REQUEST; - callback.func = speex_std_mode_request_handler; - callback.data = st; - speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback); - /* END of unnecessary stuff */ - - tmp=1; - speex_decoder_ctl(dec, SPEEX_SET_ENH, &tmp); - tmp=0; - speex_encoder_ctl(st, SPEEX_SET_VBR, &tmp); - tmp=8; - speex_encoder_ctl(st, SPEEX_SET_QUALITY, &tmp); - tmp=1; - speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &tmp); - - /* Turn this off if you want to measure SNR (on by default) */ - tmp=1; - speex_encoder_ctl(st, SPEEX_SET_HIGHPASS, &tmp); - speex_decoder_ctl(dec, SPEEX_SET_HIGHPASS, &tmp); - - speex_encoder_ctl(st, SPEEX_GET_LOOKAHEAD, &skip_group_delay); - speex_decoder_ctl(dec, SPEEX_GET_LOOKAHEAD, &tmp); - skip_group_delay += tmp; - - if (argc != 4 && argc != 3) - { - fprintf (stderr, "Usage: encode [in file] [out file] [bits file]\nargc = %d", argc); - exit(1); - } - inFile = argv[1]; - fin = fopen(inFile, "rb"); - outFile = argv[2]; - fout = fopen(outFile, "wb+"); - if (argc==4) - { - bitsFile = argv[3]; - fbits = fopen(bitsFile, "wb"); - } - speex_bits_init(&bits); - while (!feof(fin)) - { - fread(in_short, sizeof(short), FRAME_SIZE, fin); - if (feof(fin)) - break; - speex_bits_reset(&bits); - - speex_encode_int(st, in_short, &bits); - nbBits = speex_bits_write(&bits, cbits, 200); - bitCount+=bits.nbBits; - - if (argc==4) - fwrite(cbits, 1, nbBits, fbits); - speex_bits_rewind(&bits); - - speex_decode_int(dec, &bits, out_short); - speex_bits_reset(&bits); - - fwrite(&out_short[skip_group_delay], sizeof(short), FRAME_SIZE-skip_group_delay, fout); - skip_group_delay = 0; - } - fprintf (stderr, "Total encoded size: %d bits\n", bitCount); - speex_encoder_destroy(st); - speex_decoder_destroy(dec); - speex_bits_destroy(&bits); - -#ifndef DISABLE_FLOAT_API - { - float sigpow,errpow,snr, seg_snr=0; - sigpow = 0; - errpow = 0; - - /* This code just computes SNR, so you don't need it either */ - rewind(fin); - rewind(fout); - - while ( FRAME_SIZE == fread(in_short, sizeof(short), FRAME_SIZE, fin) - && - FRAME_SIZE == fread(out_short, sizeof(short), FRAME_SIZE,fout) ) - { - float s=0, e=0; - for (i=0;i -#include - -#ifdef FIXED_DEBUG -extern long long spx_mips; -#endif - -#define FRAME_SIZE 640 -#include -int main(int argc, char **argv) -{ - char *inFile, *outFile, *bitsFile; - FILE *fin, *fout, *fbits=NULL; - short in_short[FRAME_SIZE]; - short out_short[FRAME_SIZE]; - float sigpow,errpow,snr, seg_snr=0; - int snr_frames = 0; - char cbits[200]; - int nbBits; - int i; - void *st; - void *dec; - SpeexBits bits; - spx_int32_t tmp; - int bitCount=0; - spx_int32_t skip_group_delay; - SpeexCallback callback; - - sigpow = 0; - errpow = 0; - - st = speex_encoder_init(speex_lib_get_mode(SPEEX_MODEID_UWB)); - dec = speex_decoder_init(speex_lib_get_mode(SPEEX_MODEID_UWB)); - - callback.callback_id = SPEEX_INBAND_CHAR; - callback.func = speex_std_char_handler; - callback.data = stderr; - speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback); - - callback.callback_id = SPEEX_INBAND_MODE_REQUEST; - callback.func = speex_std_mode_request_handler; - callback.data = st; - speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback); - - tmp=0; - speex_decoder_ctl(dec, SPEEX_SET_ENH, &tmp); - tmp=0; - speex_encoder_ctl(st, SPEEX_SET_VBR, &tmp); - tmp=7; - speex_encoder_ctl(st, SPEEX_SET_QUALITY, &tmp); - tmp=1; - speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &tmp); - - speex_encoder_ctl(st, SPEEX_GET_LOOKAHEAD, &skip_group_delay); - speex_decoder_ctl(dec, SPEEX_GET_LOOKAHEAD, &tmp); - skip_group_delay += tmp; - - - if (argc != 4 && argc != 3) - { - fprintf (stderr, "Usage: encode [in file] [out file] [bits file]\nargc = %d", argc); - exit(1); - } - inFile = argv[1]; - fin = fopen(inFile, "rb"); - outFile = argv[2]; - fout = fopen(outFile, "wb+"); - if (argc==4) - { - bitsFile = argv[3]; - fbits = fopen(bitsFile, "wb"); - } - speex_bits_init(&bits); - while (!feof(fin)) - { - fread(in_short, sizeof(short), FRAME_SIZE, fin); - if (feof(fin)) - break; - speex_bits_reset(&bits); - - speex_encode_int(st, in_short, &bits); - nbBits = speex_bits_write(&bits, cbits, 200); - bitCount+=bits.nbBits; - - if (argc==4) - fwrite(cbits, 1, nbBits, fbits); - speex_bits_rewind(&bits); - - speex_decode_int(dec, &bits, out_short); - speex_bits_reset(&bits); - - fwrite(&out_short[skip_group_delay], sizeof(short), FRAME_SIZE-skip_group_delay, fout); - skip_group_delay = 0; - } - fprintf (stderr, "Total encoded size: %d bits\n", bitCount); - speex_encoder_destroy(st); - speex_decoder_destroy(dec); - - rewind(fin); - rewind(fout); - - while ( FRAME_SIZE == fread(in_short, sizeof(short), FRAME_SIZE, fin) - && - FRAME_SIZE == fread(out_short, sizeof(short), FRAME_SIZE,fout) ) - { - float s=0, e=0; - for (i=0;i -#include - -#ifdef FIXED_DEBUG -extern long long spx_mips; -#endif - -#define FRAME_SIZE 320 -#include -int main(int argc, char **argv) -{ - char *inFile, *outFile, *bitsFile; - FILE *fin, *fout, *fbits=NULL; - short in_short[FRAME_SIZE]; - short out_short[FRAME_SIZE]; - float sigpow,errpow,snr, seg_snr=0; - int snr_frames = 0; - char cbits[200]; - int nbBits; - int i; - void *st; - void *dec; - SpeexBits bits; - spx_int32_t tmp; - int bitCount=0; - spx_int32_t skip_group_delay; - SpeexCallback callback; - - sigpow = 0; - errpow = 0; - - st = speex_encoder_init(speex_lib_get_mode(SPEEX_MODEID_WB)); - dec = speex_decoder_init(speex_lib_get_mode(SPEEX_MODEID_WB)); - - callback.callback_id = SPEEX_INBAND_CHAR; - callback.func = speex_std_char_handler; - callback.data = stderr; - speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback); - - callback.callback_id = SPEEX_INBAND_MODE_REQUEST; - callback.func = speex_std_mode_request_handler; - callback.data = st; - speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback); - - tmp=1; - speex_decoder_ctl(dec, SPEEX_SET_ENH, &tmp); - tmp=0; - speex_encoder_ctl(st, SPEEX_SET_VBR, &tmp); - tmp=8; - speex_encoder_ctl(st, SPEEX_SET_QUALITY, &tmp); - tmp=3; - speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &tmp); - /*tmp=3; - speex_encoder_ctl(st, SPEEX_SET_HIGH_MODE, &tmp); - tmp=6; - speex_encoder_ctl(st, SPEEX_SET_LOW_MODE, &tmp); -*/ - - speex_encoder_ctl(st, SPEEX_GET_LOOKAHEAD, &skip_group_delay); - speex_decoder_ctl(dec, SPEEX_GET_LOOKAHEAD, &tmp); - skip_group_delay += tmp; - - - if (argc != 4 && argc != 3) - { - fprintf (stderr, "Usage: encode [in file] [out file] [bits file]\nargc = %d", argc); - exit(1); - } - inFile = argv[1]; - fin = fopen(inFile, "rb"); - outFile = argv[2]; - fout = fopen(outFile, "wb+"); - if (argc==4) - { - bitsFile = argv[3]; - fbits = fopen(bitsFile, "wb"); - } - speex_bits_init(&bits); - while (!feof(fin)) - { - fread(in_short, sizeof(short), FRAME_SIZE, fin); - if (feof(fin)) - break; - speex_bits_reset(&bits); - - speex_encode_int(st, in_short, &bits); - nbBits = speex_bits_write(&bits, cbits, 200); - bitCount+=bits.nbBits; - - if (argc==4) - fwrite(cbits, 1, nbBits, fbits); - speex_bits_rewind(&bits); - - speex_decode_int(dec, &bits, out_short); - speex_bits_reset(&bits); - - fwrite(&out_short[skip_group_delay], sizeof(short), FRAME_SIZE-skip_group_delay, fout); - skip_group_delay = 0; - } - fprintf (stderr, "Total encoded size: %d bits\n", bitCount); - speex_encoder_destroy(st); - speex_decoder_destroy(dec); - speex_bits_destroy(&bits); - - rewind(fin); - rewind(fout); - - while ( FRAME_SIZE == fread(in_short, sizeof(short), FRAME_SIZE, fin) - && - FRAME_SIZE == fread(out_short, sizeof(short), FRAME_SIZE,fout) ) - { - float s=0, e=0; - for (i=0;i - - -#define sqr(x) ((x)*(x)) - -#define MIN_ENERGY 6000 -#define NOISE_POW .3 - -#ifndef DISABLE_VBR - -const float vbr_nb_thresh[9][11]={ - {-1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f}, /* CNG */ - { 4.0f, 2.5f, 2.0f, 1.2f, 0.5f,-0.25f, -0.5f, -0.7f, -0.8f, -0.9f, -1.0f}, /* 2 kbps */ - {10.0f, 6.5f, 5.2f, 4.5f, 3.9f, 3.7f, 3.0f, 2.5f, 2.3f, 1.8f, 1.0f}, /* 6 kbps */ - {11.0f, 8.8f, 7.5f, 6.5f, 5.0f, 4.2f, 3.9f, 3.9f, 3.5f, 3.0f, 1.0f}, /* 8 kbps */ - {11.0f, 11.0f, 9.9f, 8.5f, 7.0f, 5.25f, 4.5f, 4.0f, 4.0f, 4.0f, 2.0f}, /* 11 kbps */ - {11.0f, 11.0f, 11.0f, 11.0f, 9.5f, 9.25f, 8.0f, 7.0f, 5.0f, 4.0f, 3.0f}, /* 15 kbps */ - {11.0f, 11.0f, 11.0f, 11.0f, 11.0f, 11.0f, 9.5f, 8.5f, 6.2f, 5.2f, 5.0f}, /* 18 kbps */ - {11.0f, 11.0f, 11.0f, 11.0f, 11.0f, 11.0f, 11.0f, 11.0f, 10.0f, 9.8f, 7.5f}, /* 24 kbps */ - { 7.0f, 4.5f, 3.7f, 3.0f, 2.5f, 1.0f, 1.8f, 1.5f, 1.0f, 0.0f, 0.0f} /* 4 kbps */ -}; - - -const float vbr_hb_thresh[5][11]={ - {-1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f}, /* silence */ - {-1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f}, /* 2 kbps */ - {11.0f, 11.0f, 9.5f, 8.5f, 7.5f, 6.0f, 5.0f, 3.9f, 3.0f, 2.0f, 1.0f}, /* 6 kbps */ - {11.0f, 11.0f, 11.0f, 11.0f, 11.0f, 9.5f, 8.7f, 7.8f, 7.0f, 6.5f, 4.0f}, /* 10 kbps */ - {11.0f, 11.0f, 11.0f, 11.0f, 11.0f, 11.0f, 11.0f, 11.0f, 9.8f, 7.5f, 5.5f} /* 18 kbps */ -}; - -const float vbr_uhb_thresh[2][11]={ - {-1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f}, /* silence */ - { 3.9f, 2.5f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f} /* 2 kbps */ -}; - -void vbr_init(VBRState *vbr) -{ - int i; - - vbr->average_energy=1600000; - vbr->last_energy=1; - vbr->accum_sum=0; - vbr->soft_pitch=0; - vbr->last_pitch_coef=0; - vbr->last_quality=0; - - vbr->noise_accum = .05*pow(MIN_ENERGY, NOISE_POW); - vbr->noise_accum_count=.05; - vbr->noise_level=vbr->noise_accum/vbr->noise_accum_count; - vbr->consec_noise=0; - - - for (i=0;ilast_log_energy[i] = log(MIN_ENERGY); -} - - -/* - This function should analyse the signal and decide how critical the - coding error will be perceptually. The following factors should be - taken into account: - - -Attacks (positive energy derivative) should be coded with more bits - - -Stationary voiced segments should receive more bits - - -Segments with (very) low absolute energy should receive less bits (maybe - only shaped noise?) - - -DTX for near-zero energy? - - -Stationary fricative segments should have less bits - - -Temporal masking: when energy slope is decreasing, decrease the bit-rate - - -Decrease bit-rate for males (low pitch)? - - -(wideband only) less bits in the high-band when signal is very - non-stationary (harder to notice high-frequency noise)??? - -*/ - -float vbr_analysis(VBRState *vbr, spx_word16_t *sig, int len, int pitch, float pitch_coef) -{ - int i; - float ener=0, ener1=0, ener2=0; - float qual=7; - float log_energy; - float non_st=0; - float voicing; - float pow_ener; - - for (i=0;i>1;i++) - ener1 += ((float)sig[i])*sig[i]; - - for (i=len>>1;ilast_log_energy[i]); - non_st = non_st/(30*VBR_MEMORY_SIZE); - if (non_st>1) - non_st=1; - - voicing = 3*(pitch_coef-.4)*fabs(pitch_coef-.4); - vbr->average_energy = 0.9*vbr->average_energy + .1*ener; - vbr->noise_level=vbr->noise_accum/vbr->noise_accum_count; - pow_ener = pow(ener,NOISE_POW); - if (vbr->noise_accum_count<.06 && ener>MIN_ENERGY) - vbr->noise_accum = .05*pow_ener; - - if ((voicing<.3 && non_st < .2 && pow_ener < 1.2*vbr->noise_level) - || (voicing<.3 && non_st < .05 && pow_ener < 1.5*vbr->noise_level) - || (voicing<.4 && non_st < .05 && pow_ener < 1.2*vbr->noise_level) - || (voicing<0 && non_st < .05)) - { - float tmp; - - vbr->consec_noise++; - if (pow_ener > 3*vbr->noise_level) - tmp = 3*vbr->noise_level; - else - tmp = pow_ener; - if (vbr->consec_noise>=4) - { - vbr->noise_accum = .95*vbr->noise_accum + .05*tmp; - vbr->noise_accum_count = .95*vbr->noise_accum_count + .05; - } - } else { - vbr->consec_noise=0; - } - - if (pow_ener < vbr->noise_level && ener>MIN_ENERGY) - { - vbr->noise_accum = .95*vbr->noise_accum + .05*pow_ener; - vbr->noise_accum_count = .95*vbr->noise_accum_count + .05; - } - - /* Checking for very low absolute energy */ - if (ener < 30000) - { - qual -= .7; - if (ener < 10000) - qual-=.7; - if (ener < 3000) - qual-=.7; - } else { - float short_diff, long_diff; - short_diff = log((ener+1)/(1+vbr->last_energy)); - long_diff = log((ener+1)/(1+vbr->average_energy)); - /*fprintf (stderr, "%f %f\n", short_diff, long_diff);*/ - - if (long_diff<-5) - long_diff=-5; - if (long_diff>2) - long_diff=2; - - if (long_diff>0) - qual += .6*long_diff; - if (long_diff<0) - qual += .5*long_diff; - if (short_diff>0) - { - if (short_diff>5) - short_diff=5; - qual += 1*short_diff; - } - /* Checking for energy increases */ - if (ener2 > 1.6*ener1) - qual += .5; - } - vbr->last_energy = ener; - vbr->soft_pitch = .8*vbr->soft_pitch + .2*pitch_coef; - qual += 2.2*((pitch_coef-.4) + (vbr->soft_pitch-.4)); - - if (qual < vbr->last_quality) - qual = .5*qual + .5*vbr->last_quality; - if (qual<4) - qual=4; - if (qual>10) - qual=10; - - /* - if (vbr->consec_noise>=2) - qual-=1.3; - if (vbr->consec_noise>=5) - qual-=1.3; - if (vbr->consec_noise>=12) - qual-=1.3; - */ - if (vbr->consec_noise>=3) - qual=4; - - if (vbr->consec_noise) - qual -= 1.0 * (log(3.0 + vbr->consec_noise)-log(3)); - if (qual<0) - qual=0; - - if (ener<1600000) - { - if (vbr->consec_noise>2) - qual-=0.5*(log(3.0 + vbr->consec_noise)-log(3)); - if (ener<10000&&vbr->consec_noise>2) - qual-=0.5*(log(3.0 + vbr->consec_noise)-log(3)); - if (qual<0) - qual=0; - qual += .3*log(.0001+ener/1600000.0); - } - if (qual<-1) - qual=-1; - - /*printf ("%f %f %f %f\n", qual, voicing, non_st, pow_ener/(.01+vbr->noise_level));*/ - - vbr->last_pitch_coef = pitch_coef; - vbr->last_quality = qual; - - for (i=VBR_MEMORY_SIZE-1;i>0;i--) - vbr->last_log_energy[i] = vbr->last_log_energy[i-1]; - vbr->last_log_energy[0] = log_energy; - - /*printf ("VBR: %f %f %f %f\n", (float)(log_energy-log(vbr->average_energy+MIN_ENERGY)), non_st, voicing, vbr->noise_level);*/ - - return qual; -} - -void vbr_destroy(VBRState *vbr) -{ -} - -#endif /* #ifndef DISABLE_VBR */ diff --git a/Engine/lib/speex/libspeex/vbr.h b/Engine/lib/speex/libspeex/vbr.h deleted file mode 100644 index 816344023..000000000 --- a/Engine/lib/speex/libspeex/vbr.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin */ -/** - @file vbr.h - @brief Variable Bit-Rate (VBR) related routines -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - - -#ifndef VBR_H -#define VBR_H - -#include "arch.h" - -#define VBR_MEMORY_SIZE 5 - -extern const float vbr_nb_thresh[9][11]; -extern const float vbr_hb_thresh[5][11]; -extern const float vbr_uhb_thresh[2][11]; - -/** VBR state. */ -typedef struct VBRState { - float average_energy; - float last_energy; - float last_log_energy[VBR_MEMORY_SIZE]; - float accum_sum; - float last_pitch_coef; - float soft_pitch; - float last_quality; - float noise_level; - float noise_accum; - float noise_accum_count; - int consec_noise; -} VBRState; - -void vbr_init(VBRState *vbr); - -float vbr_analysis(VBRState *vbr, spx_word16_t *sig, int len, int pitch, float pitch_coef); - -void vbr_destroy(VBRState *vbr); - -#endif diff --git a/Engine/lib/speex/libspeex/vorbis_psy.c b/Engine/lib/speex/libspeex/vorbis_psy.c deleted file mode 100644 index cb385b7a3..000000000 --- a/Engine/lib/speex/libspeex/vorbis_psy.c +++ /dev/null @@ -1,509 +0,0 @@ -/* Copyright (C) 2005 Jean-Marc Valin, CSIRO, Christopher Montgomery - File: vorbis_psy.c - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef VORBIS_PSYCHO - -#include "arch.h" -#include "smallft.h" -#include "lpc.h" -#include "vorbis_psy.h" -#include "os_support.h" - -#include -#include -#include - -/* psychoacoustic setup ********************************************/ - -static VorbisPsyInfo example_tuning = { - - .5,.5, - 3,3,25, - - /*63 125 250 500 1k 2k 4k 8k 16k*/ - // vorbis mode 4 style - //{-32,-32,-32,-32,-28,-24,-22,-20,-20, -20, -20, -8, -6, -6, -6, -6, -6}, - { -4, -6, -6, -6, -6, -6, -6, -6, -8, -8,-10,-10, -8, -6, -4, -4, -2}, - - { - 0, 1, 2, 3, 4, 5, 5, 5, /* 7dB */ - 6, 6, 6, 5, 4, 4, 4, 4, /* 15dB */ - 4, 4, 5, 5, 5, 6, 6, 6, /* 23dB */ - 7, 7, 7, 8, 8, 8, 9, 10, /* 31dB */ - 11,12,13,14,15,16,17, 18, /* 39dB */ - } - -}; - - - -/* there was no great place to put this.... */ -#include -static void _analysis_output(char *base,int i,float *v,int n,int bark,int dB){ - int j; - FILE *of; - char buffer[80]; - - sprintf(buffer,"%s_%d.m",base,i); - of=fopen(buffer,"w"); - - if(!of)perror("failed to open data dump file"); - - for(j=0;j> 16; - if( lo>=0 ) break; - hi = b[i] & 0xffff; - - tN = N[hi] + N[-lo]; - tX = X[hi] - X[-lo]; - tXX = XX[hi] + XX[-lo]; - tY = Y[hi] + Y[-lo]; - tXY = XY[hi] - XY[-lo]; - - A = tY * tXX - tX * tXY; - B = tN * tXY - tX * tY; - D = tN * tXX - tX * tX; - R = (A + x * B) / D; - if (R < 0.f) - R = 0.f; - - noise[i] = R - offset; - } - - for ( ;; i++, x += 1.f) { - - lo = b[i] >> 16; - hi = b[i] & 0xffff; - if(hi>=n)break; - - tN = N[hi] - N[lo]; - tX = X[hi] - X[lo]; - tXX = XX[hi] - XX[lo]; - tY = Y[hi] - Y[lo]; - tXY = XY[hi] - XY[lo]; - - A = tY * tXX - tX * tXY; - B = tN * tXY - tX * tY; - D = tN * tXX - tX * tX; - R = (A + x * B) / D; - if (R < 0.f) R = 0.f; - - noise[i] = R - offset; - } - for ( ; i < n; i++, x += 1.f) { - - R = (A + x * B) / D; - if (R < 0.f) R = 0.f; - - noise[i] = R - offset; - } - - if (fixed <= 0) return; - - for (i = 0, x = 0.f;; i++, x += 1.f) { - hi = i + fixed / 2; - lo = hi - fixed; - if(lo>=0)break; - - tN = N[hi] + N[-lo]; - tX = X[hi] - X[-lo]; - tXX = XX[hi] + XX[-lo]; - tY = Y[hi] + Y[-lo]; - tXY = XY[hi] - XY[-lo]; - - - A = tY * tXX - tX * tXY; - B = tN * tXY - tX * tY; - D = tN * tXX - tX * tX; - R = (A + x * B) / D; - - if (R - offset < noise[i]) noise[i] = R - offset; - } - for ( ;; i++, x += 1.f) { - - hi = i + fixed / 2; - lo = hi - fixed; - if(hi>=n)break; - - tN = N[hi] - N[lo]; - tX = X[hi] - X[lo]; - tXX = XX[hi] - XX[lo]; - tY = Y[hi] - Y[lo]; - tXY = XY[hi] - XY[lo]; - - A = tY * tXX - tX * tXY; - B = tN * tXY - tX * tY; - D = tN * tXX - tX * tX; - R = (A + x * B) / D; - - if (R - offset < noise[i]) noise[i] = R - offset; - } - for ( ; i < n; i++, x += 1.f) { - R = (A + x * B) / D; - if (R - offset < noise[i]) noise[i] = R - offset; - } -} - -static void _vp_noisemask(VorbisPsy *p, - float *logfreq, - float *logmask){ - - int i,n=p->n/2; - float *work=alloca(n*sizeof(*work)); - - bark_noise_hybridmp(n,p->bark,logfreq,logmask, - 140.,-1); - - for(i=0;ibark,work,logmask,0., - p->vi->noisewindowfixed); - - for(i=0;i=NOISE_COMPAND_LEVELS)dB=NOISE_COMPAND_LEVELS-1; - if(dB<0)dB=0; - logmask[i]= work[i]+p->vi->noisecompand[dB]+p->noiseoffset[i]; - } - -} - -VorbisPsy *vorbis_psy_init(int rate, int n) -{ - long i,j,lo=-99,hi=1; - VorbisPsy *p = speex_alloc(sizeof(VorbisPsy)); - memset(p,0,sizeof(*p)); - - p->n = n; - spx_drft_init(&p->lookup, n); - p->bark = speex_alloc(n*sizeof(*p->bark)); - p->rate=rate; - p->vi = &example_tuning; - - /* BH4 window */ - p->window = speex_alloc(sizeof(*p->window)*n); - float a0 = .35875f; - float a1 = .48829f; - float a2 = .14128f; - float a3 = .01168f; - for(i=0;iwindow[i] = //a0 - a1*cos(2.*M_PI/n*(i+.5)) + a2*cos(4.*M_PI/n*(i+.5)) - a3*cos(6.*M_PI/n*(i+.5)); - sin((i+.5)/n * M_PI)*sin((i+.5)/n * M_PI); - /* bark scale lookups */ - for(i=0;ivi->noisewindowlominvi->noisewindowlo);lo++); - - for(;hi<=n && (hivi->noisewindowhimin || - toBARK(rate/(2*n)*hi)<(bark+p->vi->noisewindowhi));hi++); - - p->bark[i]=((lo-1)<<16)+(hi-1); - - } - - /* set up rolling noise median */ - p->noiseoffset=speex_alloc(n*sizeof(*p->noiseoffset)); - - for(i=0;i=P_BANDS-1)halfoc=P_BANDS-1; - inthalfoc=(int)halfoc; - del=halfoc-inthalfoc; - - p->noiseoffset[i]= - p->vi->noiseoff[inthalfoc]*(1.-del) + - p->vi->noiseoff[inthalfoc+1]*del; - - } -#if 0 - _analysis_output_always("noiseoff0",ls,p->noiseoffset,n,1,0,0); -#endif - - return p; -} - -void vorbis_psy_destroy(VorbisPsy *p) -{ - if(p){ - spx_drft_clear(&p->lookup); - if(p->bark) - speex_free(p->bark); - if(p->noiseoffset) - speex_free(p->noiseoffset); - if(p->window) - speex_free(p->window); - memset(p,0,sizeof(*p)); - speex_free(p); - } -} - -void compute_curve(VorbisPsy *psy, float *audio, float *curve) -{ - int i; - float work[psy->n]; - - float scale=4.f/psy->n; - float scale_dB; - - scale_dB=todB(scale); - - /* window the PCM data; use a BH4 window, not vorbis */ - for(i=0;in;i++) - work[i]=audio[i] * psy->window[i]; - - { - static int seq=0; - - //_analysis_output("win",seq,work,psy->n,0,0); - - seq++; - } - - /* FFT yields more accurate tonal estimation (not phase sensitive) */ - spx_drft_forward(&psy->lookup,work); - - /* magnitudes */ - work[0]=scale_dB+todB(work[0]); - for(i=1;in-1;i+=2){ - float temp = work[i]*work[i] + work[i+1]*work[i+1]; - work[(i+1)>>1] = scale_dB+.5f * todB(temp); - } - - /* derive a noise curve */ - _vp_noisemask(psy,work,curve); -#define SIDEL 12 - for (i=0;in>>1)-i-1]=curve[(psy->n>>1)-SIDEH]; - } - for(i=0;i<((psy->n)>>1);i++) - curve[i] = fromdB(1.2*curve[i]+.2*i); - //curve[i] = fromdB(0.8*curve[i]+.35*i); - //curve[i] = fromdB(0.9*curve[i])*pow(1.0*i+45,1.3); -} - -/* Transform a masking curve (power spectrum) into a pole-zero filter */ -void curve_to_lpc(VorbisPsy *psy, float *curve, float *awk1, float *awk2, int ord) -{ - int i; - float ac[psy->n]; - float tmp; - int len = psy->n >> 1; - for (i=0;i<2*len;i++) - ac[i] = 0; - for (i=1;ilookup, ac); - _spx_lpc(awk1, ac, ord); - tmp = 1.; - for (i=0;ilookup, ac); - /* Compute (power) response of awk1 (all zero) */ - ac[0] *= ac[0]; - for (i=1;ilookup, ac); - _spx_lpc(awk2, ac, ord); - tmp = 1; - for (i=0;i -#include - -#define ORDER 10 -#define CURVE_SIZE 24 - -int main() -{ - int i; - float curve[CURVE_SIZE]; - float awk1[ORDER], awk2[ORDER]; - for (i=0;i1e-13?log((x)*(x))*4.34294480f:-30) -#define fromdB(x) (exp((x)*.11512925f)) - -/* The bark scale equations are approximations, since the original - table was somewhat hand rolled. The below are chosen to have the - best possible fit to the rolled tables, thus their somewhat odd - appearance (these are more accurate and over a longer range than - the oft-quoted bark equations found in the texts I have). The - approximations are valid from 0 - 30kHz (nyquist) or so. - - all f in Hz, z in Bark */ - -#define toBARK(n) (13.1f*atan(.00074f*(n))+2.24f*atan((n)*(n)*1.85e-8f)+1e-4f*(n)) -#define fromBARK(z) (102.f*(z)-2.f*pow(z,2.f)+.4f*pow(z,3.f)+pow(1.46f,z)-1.f) - -/* Frequency to octave. We arbitrarily declare 63.5 Hz to be octave - 0.0 */ - -#define toOC(n) (log(n)*1.442695f-5.965784f) -#define fromOC(o) (exp(((o)+5.965784f)*.693147f)) - - -typedef struct { - - float noisewindowlo; - float noisewindowhi; - int noisewindowlomin; - int noisewindowhimin; - int noisewindowfixed; - float noiseoff[P_BANDS]; - float noisecompand[NOISE_COMPAND_LEVELS]; - -} VorbisPsyInfo; - - - -typedef struct { - int n; - int rate; - struct drft_lookup lookup; - VorbisPsyInfo *vi; - - float *window; - float *noiseoffset; - long *bark; - -} VorbisPsy; - - -VorbisPsy *vorbis_psy_init(int rate, int size); -void vorbis_psy_destroy(VorbisPsy *psy); -void compute_curve(VorbisPsy *psy, float *audio, float *curve); -void curve_to_lpc(VorbisPsy *psy, float *curve, float *awk1, float *awk2, int ord); - -#endif -#endif diff --git a/Engine/lib/speex/libspeex/vq.c b/Engine/lib/speex/libspeex/vq.c deleted file mode 100644 index c7f139659..000000000 --- a/Engine/lib/speex/libspeex/vq.c +++ /dev/null @@ -1,147 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: vq.c - Vector quantization - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "vq.h" -#include "stack_alloc.h" -#include "arch.h" - -#ifdef _USE_SSE -#include -#include "vq_sse.h" -#elif defined(SHORTCUTS) && (defined(ARM4_ASM) || defined(ARM5E_ASM)) -#include "vq_arm4.h" -#elif defined(BFIN_ASM) -#include "vq_bfin.h" -#endif - -#ifndef DISABLE_ENCODER -int scal_quant(spx_word16_t in, const spx_word16_t *boundary, int entries) -{ - int i=0; - while (iboundary[0]) - { - boundary++; - i++; - } - return i; -} - -int scal_quant32(spx_word32_t in, const spx_word32_t *boundary, int entries) -{ - int i=0; - while (iboundary[0]) - { - boundary++; - i++; - } - return i; -} -#endif /* DISABLE_ENCODER */ - -#if !defined(OVERRIDE_VQ_NBEST) && !defined(DISABLE_ENCODER) -/*Finds the indices of the n-best entries in a codebook*/ -void vq_nbest(spx_word16_t *in, const spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist, char *stack) -{ - int i,j,k,used; - used = 0; - for (i=0;i= 1) && (k > used || dist < best_dist[k-1]); k--) - { - best_dist[k]=best_dist[k-1]; - nbest[k] = nbest[k-1]; - } - best_dist[k]=dist; - nbest[k]=i; - used++; - } - } -} -#endif /* !defined(OVERRIDE_VQ_NBEST) && !defined(DISABLE_ENCODER) */ - - - - -#if !defined(OVERRIDE_VQ_NBEST_SIGN) && !defined(DISABLE_WIDEBAND) && !defined(DISABLE_ENCODER) -/*Finds the indices of the n-best entries in a codebook with sign*/ -void vq_nbest_sign(spx_word16_t *in, const spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist, char *stack) -{ - int i,j,k, sign, used; - used=0; - for (i=0;i0) - { - sign=0; - dist=-dist; - } else - { - sign=1; - } -#ifdef FIXED_POINT - dist = ADD32(dist,SHR32(E[i],1)); -#else - dist = ADD32(dist,.5f*E[i]); -#endif - if (i= 1) && (k > used || dist < best_dist[k-1]); k--) - { - best_dist[k]=best_dist[k-1]; - nbest[k] = nbest[k-1]; - } - best_dist[k]=dist; - nbest[k]=i; - used++; - if (sign) - nbest[k]+=entries; - } - } -} -#endif /* !defined(OVERRIDE_VQ_NBEST_SIGN) && !defined(DISABLE_WIDEBAND) && !defined(DISABLE_ENCODER) */ diff --git a/Engine/lib/speex/libspeex/vq.h b/Engine/lib/speex/libspeex/vq.h deleted file mode 100644 index 5a4ced249..000000000 --- a/Engine/lib/speex/libspeex/vq.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin */ -/** - @file vq.h - @brief Vector quantization -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef VQ_H -#define VQ_H - -#include "arch.h" - -int scal_quant(spx_word16_t in, const spx_word16_t *boundary, int entries); -int scal_quant32(spx_word32_t in, const spx_word32_t *boundary, int entries); - -#ifdef _USE_SSE -#include -void vq_nbest(spx_word16_t *in, const __m128 *codebook, int len, int entries, __m128 *E, int N, int *nbest, spx_word32_t *best_dist, char *stack); - -void vq_nbest_sign(spx_word16_t *in, const __m128 *codebook, int len, int entries, __m128 *E, int N, int *nbest, spx_word32_t *best_dist, char *stack); -#else -void vq_nbest(spx_word16_t *in, const spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist, char *stack); - -void vq_nbest_sign(spx_word16_t *in, const spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist, char *stack); -#endif - -#endif diff --git a/Engine/lib/speex/libspeex/vq_arm4.h b/Engine/lib/speex/libspeex/vq_arm4.h deleted file mode 100644 index 585b8613c..000000000 --- a/Engine/lib/speex/libspeex/vq_arm4.h +++ /dev/null @@ -1,115 +0,0 @@ -/* Copyright (C) 2004 Jean-Marc Valin */ -/** - @file vq_arm4.h - @brief ARM4-optimized vq routine -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#define OVERRIDE_VQ_NBEST -void vq_nbest(spx_word16_t *in, const spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist, char *stack) -{ - int i,j; - for (i=0;i>= 1;\n\t" - "A0 = %0;\n\t" - "R0.L = W[%1++%7] || R1.L = W[I0++];\n\t" - "LOOP vq_loop%= LC1 = %5;\n\t" - "LOOP_BEGIN vq_loop%=;\n\t" - "%0 = (A0 -= R0.L*R1.L) (IS) || R0.L = W[%1++%7] || R1.L = W[I0++];\n\t" - "LOOP_END vq_loop%=;\n\t" - "%0 = (A0 -= R0.L*R1.L) (IS);\n\t" - "cc = %0 < %2;\n\t" - "if cc %2 = %0;\n\t" - "if cc %3 = R2;\n\t" - "R2 += 1;\n\t" - "LOOP_END entries_loop%=;\n\t" - : "=&D" (dist), "=&a" (codebook), "=&d" (best_dist[0]), "=&d" (nbest[0]), "=&a" (E) - : "a" (len-1), "a" (in), "a" (2), "d" (entries), "d" (len<<1), "1" (codebook), "4" (E), "2" (best_dist[0]), "3" (nbest[0]) - : "R0", "R1", "R2", "I0", "L0", "B0", "A0", "cc", "memory", - "ASTAT" BFIN_HWLOOP0_REGS BFIN_HWLOOP1_REGS - ); - } - } else { - int i,k,used; - used = 0; - for (i=0;i>= 1;\n\t" - "A0 = %0;\n\t" - "I0 = %3;\n\t" - "L0 = 0;\n\t" - "R0.L = W[%1++%4] || R1.L = W[I0++];\n\t" - "LOOP vq_loop%= LC0 = %2;\n\t" - "LOOP_BEGIN vq_loop%=;\n\t" - "%0 = (A0 -= R0.L*R1.L) (IS) || R0.L = W[%1++%4] || R1.L = W[I0++];\n\t" - "LOOP_END vq_loop%=;\n\t" - "%0 = (A0 -= R0.L*R1.L) (IS);\n\t" - : "=D" (dist), "=a" (codebook) - : "a" (len-1), "a" (in), "a" (2), "1" (codebook), "0" (E[i]) - : "R0", "R1", "I0", "L0", "A0", "ASTAT" BFIN_HWLOOP0_REGS - ); - if (i= 1) && (k > used || dist < best_dist[k-1]); k--) - { - best_dist[k]=best_dist[k-1]; - nbest[k] = nbest[k-1]; - } - best_dist[k]=dist; - nbest[k]=i; - used++; - } - } - } -} diff --git a/Engine/lib/speex/libspeex/vq_sse.h b/Engine/lib/speex/libspeex/vq_sse.h deleted file mode 100644 index 2abe880b9..000000000 --- a/Engine/lib/speex/libspeex/vq_sse.h +++ /dev/null @@ -1,120 +0,0 @@ -/* Copyright (C) 2004 Jean-Marc Valin */ -/** - @file vq_sse.h - @brief SSE-optimized vq routine -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#define OVERRIDE_VQ_NBEST -void vq_nbest(spx_word16_t *_in, const __m128 *codebook, int len, int entries, __m128 *E, int N, int *nbest, spx_word32_t *best_dist, char *stack) -{ - int i,j,k,used; - VARDECL(float *dist); - VARDECL(__m128 *in); - __m128 half; - used = 0; - ALLOC(dist, entries, float); - half = _mm_set_ps1(.5f); - ALLOC(in, len, __m128); - for (i=0;i>2;i++) - { - __m128 d = _mm_mul_ps(E[i], half); - for (j=0;j= 1) && (k > used || dist[i] < best_dist[k-1]); k--) - { - best_dist[k]=best_dist[k-1]; - nbest[k] = nbest[k-1]; - } - best_dist[k]=dist[i]; - nbest[k]=i; - used++; - } - } -} - - - - -#define OVERRIDE_VQ_NBEST_SIGN -void vq_nbest_sign(spx_word16_t *_in, const __m128 *codebook, int len, int entries, __m128 *E, int N, int *nbest, spx_word32_t *best_dist, char *stack) -{ - int i,j,k,used; - VARDECL(float *dist); - VARDECL(__m128 *in); - - used = 0; - ALLOC(dist, entries, float); - - ALLOC(in, len, __m128); - for (i=0;i>2;i++) - { - __m128 d = _mm_setzero_ps(); - for (j=0;j0) - { - sign=0; - dist[i]=-dist[i]; - } else - { - sign=1; - } - dist[i] += .5f*((float*)E)[i]; - if (i= 1) && (k > used || dist[i] < best_dist[k-1]); k--) - { - best_dist[k]=best_dist[k-1]; - nbest[k] = nbest[k-1]; - } - best_dist[k]=dist[i]; - nbest[k]=i; - used++; - if (sign) - nbest[k]+=entries; - } - } -} diff --git a/Engine/lib/speex/libspeex/window.c b/Engine/lib/speex/libspeex/window.c deleted file mode 100644 index a89d4d71f..000000000 --- a/Engine/lib/speex/libspeex/window.c +++ /dev/null @@ -1,102 +0,0 @@ -/* Copyright (C) 2006 Jean-Marc Valin - File: window.c - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "arch.h" - -#ifdef FIXED_POINT -const spx_word16_t lag_window[11] = { - 32767, 32675, 32397, 31940, 31311, 30520, 29581, 28508, 27318, 26029, 24661 -}; - -const spx_word16_t lpc_window[200] = { -2621, 2627, 2642, 2668, 2704, 2750, 2807, 2874, -2951, 3038, 3135, 3242, 3359, 3486, 3623, 3769, -3925, 4090, 4264, 4448, 4641, 4843, 5053, 5272, -5500, 5736, 5981, 6233, 6493, 6761, 7036, 7319, -7609, 7905, 8209, 8519, 8835, 9157, 9485, 9819, -10158, 10502, 10852, 11206, 11564, 11926, 12293, 12663, -13037, 13414, 13793, 14176, 14561, 14948, 15337, 15727, -16119, 16512, 16906, 17300, 17695, 18089, 18484, 18877, -19270, 19662, 20053, 20442, 20829, 21214, 21596, 21976, -22353, 22726, 23096, 23463, 23826, 24184, 24538, 24887, -25231, 25570, 25904, 26232, 26555, 26871, 27181, 27484, -27781, 28070, 28353, 28628, 28896, 29157, 29409, 29653, -29889, 30117, 30336, 30547, 30749, 30941, 31125, 31300, -31465, 31621, 31767, 31903, 32030, 32147, 32254, 32352, -32439, 32516, 32582, 32639, 32685, 32722, 32747, 32763, -32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, -32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, -32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, -32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, -32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, -32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, -32767, 32767, 32767, 32723, 32590, 32368, 32058, 31661, -31177, 30610, 29959, 29227, 28416, 27528, 26566, 25532, -24430, 23263, 22034, 20747, 19406, 18015, 16579, 15104, -13594, 12058, 10503, 8941, 7391, 5887, 4498, 3392 -}; -#else -const spx_word16_t lag_window[11] = { - 1.00000f, 0.99716f, 0.98869f, 0.97474f, 0.95554f, 0.93140f, 0.90273f, 0.86998f, 0.83367f, 0.79434f, 0.75258f -}; - -const spx_word16_t lpc_window[200] = { - 0.080000f, 0.080158f, 0.080630f, 0.081418f, 0.082520f, 0.083935f, 0.085663f, 0.087703f, - 0.090052f, 0.092710f, 0.095674f, 0.098943f, 0.102514f, 0.106385f, 0.110553f, 0.115015f, - 0.119769f, 0.124811f, 0.130137f, 0.135744f, 0.141628f, 0.147786f, 0.154212f, 0.160902f, - 0.167852f, 0.175057f, 0.182513f, 0.190213f, 0.198153f, 0.206328f, 0.214731f, 0.223357f, - 0.232200f, 0.241254f, 0.250513f, 0.259970f, 0.269619f, 0.279453f, 0.289466f, 0.299651f, - 0.310000f, 0.320507f, 0.331164f, 0.341965f, 0.352901f, 0.363966f, 0.375151f, 0.386449f, - 0.397852f, 0.409353f, 0.420943f, 0.432615f, 0.444361f, 0.456172f, 0.468040f, 0.479958f, - 0.491917f, 0.503909f, 0.515925f, 0.527959f, 0.540000f, 0.552041f, 0.564075f, 0.576091f, - 0.588083f, 0.600042f, 0.611960f, 0.623828f, 0.635639f, 0.647385f, 0.659057f, 0.670647f, - 0.682148f, 0.693551f, 0.704849f, 0.716034f, 0.727099f, 0.738035f, 0.748836f, 0.759493f, - 0.770000f, 0.780349f, 0.790534f, 0.800547f, 0.810381f, 0.820030f, 0.829487f, 0.838746f, - 0.847800f, 0.856643f, 0.865269f, 0.873672f, 0.881847f, 0.889787f, 0.897487f, 0.904943f, - 0.912148f, 0.919098f, 0.925788f, 0.932214f, 0.938372f, 0.944256f, 0.949863f, 0.955189f, - 0.960231f, 0.964985f, 0.969447f, 0.973615f, 0.977486f, 0.981057f, 0.984326f, 0.987290f, - 0.989948f, 0.992297f, 0.994337f, 0.996065f, 0.997480f, 0.998582f, 0.999370f, 0.999842f, - 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, - 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, - 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, - 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, - 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, - 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, - 1.000000f, 1.000000f, 1.000000f, 0.998640f, 0.994566f, 0.987787f, 0.978324f, 0.966203f, - 0.951458f, 0.934131f, 0.914270f, 0.891931f, 0.867179f, 0.840084f, 0.810723f, 0.779182f, - 0.745551f, 0.709930f, 0.672424f, 0.633148f, 0.592223f, 0.549781f, 0.505964f, 0.460932f, - 0.414863f, 0.367968f, 0.320511f, 0.272858f, 0.225569f, 0.179655f, 0.137254f, 0.103524f -}; -#endif diff --git a/Engine/lib/speex/m4/add_cflags.m4 b/Engine/lib/speex/m4/add_cflags.m4 deleted file mode 100644 index 08f4a4097..000000000 --- a/Engine/lib/speex/m4/add_cflags.m4 +++ /dev/null @@ -1,18 +0,0 @@ -dnl @synopsis XIPH_ADD_CFLAGS -dnl -dnl Add the given option to CFLAGS, if it doesn't break the compiler - -AC_DEFUN([XIPH_ADD_CFLAGS], -[AC_MSG_CHECKING([if $CC accepts $1]) - ac_add_cflags__old_cflags="$CFLAGS" - CFLAGS="$1" - AC_TRY_LINK([ - #include - ], - [puts("Hello, World!"); return 0;], - AC_MSG_RESULT([yes]) - CFLAGS="$ac_add_cflags__old_cflags $1", - AC_MSG_RESULT([no]) - CFLAGS="$ac_add_cflags__old_cflags" - ) -])# XIPH_ADD_CFLAGS diff --git a/Engine/lib/speex/m4/pkg.m4 b/Engine/lib/speex/m4/pkg.m4 deleted file mode 100644 index 4b77f9f0a..000000000 --- a/Engine/lib/speex/m4/pkg.m4 +++ /dev/null @@ -1,272 +0,0 @@ -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 1 (pkg-config-0.24) -# -# Copyright © 2004 Scott James Remnant . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) -m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) -AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) -AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi -fi[]dnl -])# PKG_PROG_PKG_CONFIG - -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -# only at the first occurence in configure.ac, so if the first place -# it's called might be skipped (such as if it is within an "if", you -# have to call PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_default([$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- -m4_define([_PKG_CONFIG], -[if test -n "$$1"; then - pkg_cv_[]$1="$$1" - elif test -n "$PKG_CONFIG"; then - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes ], - [pkg_failed=yes]) - else - pkg_failed=untried -fi[]dnl -])# _PKG_CONFIG - -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED - - -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $1]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - m4_default([$4], [AC_MSG_ERROR( -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT])[]dnl - ]) -elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) - m4_default([$4], [AC_MSG_FAILURE( -[The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see .])[]dnl - ]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - $3 -fi[]dnl -])# PKG_CHECK_MODULES - -# PKG_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable pkgconfigdir as the location where a module -# should install pkg-config .pc files. By default the directory is -# $libdir/pkgconfig, but the default can be changed by passing -# DIRECTORY. The user can override through the --with-pkgconfigdir -# parameter. -AC_DEFUN([PKG_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([pkgconfigdir], - [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, - [with_pkgconfigdir=]pkg_default) -AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -]) dnl PKG_INSTALLDIR - - -# PKG_NOARCH_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable noarch_pkgconfigdir as the location where a -# module should install arch-independent pkg-config .pc files. By -# default the directory is $datadir/pkgconfig, but the default can be -# changed by passing DIRECTORY. The user can override through the -# --with-noarch-pkgconfigdir parameter. -AC_DEFUN([PKG_NOARCH_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([noarch-pkgconfigdir], - [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, - [with_noarch_pkgconfigdir=]pkg_default) -AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -]) dnl PKG_NOARCH_INSTALLDIR - -# PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, -# [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], -# [DESCRIPTION], [DEFAULT]) -# -# Prepare a "--with-" configure option using the lowercase [VARIABLE-PREFIX] -# name, merging the behaviour of AC_ARG_WITH and PKG_CHECK_MODULES in a single -# macro -# -# -------------------------------------------------------------- -AC_DEFUN([PKG_WITH_MODULES], -[ -m4_pushdef([with_arg], m4_tolower([$1])) - -m4_pushdef([description], - [m4_default([$5], [build with ]with_arg[ support])]) - -m4_pushdef([def_arg], [m4_default([$6], [auto])]) -m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) -m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) - -m4_case(def_arg, - [yes],[m4_pushdef([with_without], [--without-]with_arg)], - [m4_pushdef([with_without],[--with-]with_arg)]) - -AC_ARG_WITH(with_arg, - AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, - [AS_TR_SH([with_]with_arg)=def_arg]) - -AS_CASE([$AS_TR_SH([with_]with_arg)], - [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], - [auto],[PKG_CHECK_MODULES([$1],[$2], - [m4_n([def_action_if_found]) $3], - [m4_n([def_action_if_not_found]) $4])]) - -m4_popdef([with_arg]) -m4_popdef([description]) -m4_popdef([def_arg]) - -]) dnl PKG_WITH_MODULES - -# PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, -# [DESCRIPTION], [DEFAULT]) -# -# Convenience macro to trigger AM_CONDITIONAL after -# PKG_WITH_MODULES check. -# -# HAVE_[VARIABLE-PREFIX] is exported as make variable. -# -# -------------------------------------------------------------- -AC_DEFUN([PKG_HAVE_WITH_MODULES], -[ -PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) - -AM_CONDITIONAL([HAVE_][$1], - [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) -]) - -# PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, -# [DESCRIPTION], [DEFAULT]) -# -# Convenience macro to run AM_CONDITIONAL and AC_DEFINE after -# PKG_WITH_MODULES check. -# -# HAVE_[VARIABLE-PREFIX] is exported as make and preprocessor variable. -# -# -------------------------------------------------------------- -AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], -[ -PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) - -AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], - [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) -]) diff --git a/Engine/lib/speex/macosx/English.lproj/InfoPlist.strings b/Engine/lib/speex/macosx/English.lproj/InfoPlist.strings deleted file mode 100644 index 166513d3b..000000000 Binary files a/Engine/lib/speex/macosx/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/Engine/lib/speex/macosx/Info.plist b/Engine/lib/speex/macosx/Info.plist deleted file mode 100644 index 1d1c47c81..000000000 --- a/Engine/lib/speex/macosx/Info.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - Speex - CFBundleGetInfoString - Speex framework 1.1.12svn, Copyright © 2002-2006 Xiph.Org Foundation - CFBundleIconFile - - CFBundleIdentifier - org.xiph.speex - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.1.12svn - CFBundleSignature - ???? - CFBundleVersion - 1.1.12d1 - NSHumanReadableCopyright - Speex framework 1.1.12svn, Copyright © 2002-2006 Xiph.Org Foundation - CSResourcesFileMapped - - - diff --git a/Engine/lib/speex/macosx/Speex.xcodeproj/project.pbxproj b/Engine/lib/speex/macosx/Speex.xcodeproj/project.pbxproj deleted file mode 100644 index 6025aadad..000000000 --- a/Engine/lib/speex/macosx/Speex.xcodeproj/project.pbxproj +++ /dev/null @@ -1,713 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 42; - objects = { - -/* Begin PBXBuildFile section */ - 37CA8DEB0DD73333005C8CB6 /* modes_wb.c in Sources */ = {isa = PBXBuildFile; fileRef = 37CA8DEA0DD73333005C8CB6 /* modes_wb.c */; }; - 37CA8DEC0DD73333005C8CB6 /* modes_wb.c in Sources */ = {isa = PBXBuildFile; fileRef = 37CA8DEA0DD73333005C8CB6 /* modes_wb.c */; }; - 37CA8E000DD7352A005C8CB6 /* os_support.h in Headers */ = {isa = PBXBuildFile; fileRef = 37CA8DFF0DD7352A005C8CB6 /* os_support.h */; }; - 73814B000907FB8200C478FC /* speex_header.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF40907FB8200C478FC /* speex_header.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 73814B030907FB8200C478FC /* speex_stereo.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF70907FB8200C478FC /* speex_stereo.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 73814B040907FB8200C478FC /* speex_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF80907FB8200C478FC /* speex_types.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 73814B060907FBAB00C478FC /* speex_callbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF10907FB8200C478FC /* speex_callbacks.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 73814B070907FBAD00C478FC /* speex_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF00907FB8200C478FC /* speex_bits.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 73814B080907FBAE00C478FC /* speex.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AEF0907FB8200C478FC /* speex.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 73814B5A0907FC9900C478FC /* bits.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B0D0907FC9900C478FC /* bits.c */; }; - 73814B5E0907FC9900C478FC /* cb_search.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B110907FC9900C478FC /* cb_search.c */; }; - 73814B600907FC9900C478FC /* exc_5_64_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B130907FC9900C478FC /* exc_5_64_table.c */; }; - 73814B610907FC9900C478FC /* exc_5_256_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B140907FC9900C478FC /* exc_5_256_table.c */; }; - 73814B620907FC9900C478FC /* exc_8_128_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B150907FC9900C478FC /* exc_8_128_table.c */; }; - 73814B630907FC9900C478FC /* exc_10_16_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B160907FC9900C478FC /* exc_10_16_table.c */; }; - 73814B640907FC9900C478FC /* exc_10_32_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B170907FC9900C478FC /* exc_10_32_table.c */; }; - 73814B650907FC9900C478FC /* exc_20_32_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B180907FC9900C478FC /* exc_20_32_table.c */; }; - 73814B690907FC9900C478FC /* filters.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B1C0907FC9900C478FC /* filters.c */; }; - 73814B700907FC9900C478FC /* gain_table_lbr.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B230907FC9900C478FC /* gain_table_lbr.c */; }; - 73814B710907FC9900C478FC /* gain_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B240907FC9900C478FC /* gain_table.c */; }; - 73814B720907FC9900C478FC /* hexc_10_32_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B250907FC9900C478FC /* hexc_10_32_table.c */; }; - 73814B730907FC9900C478FC /* hexc_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B260907FC9900C478FC /* hexc_table.c */; }; - 73814B740907FC9900C478FC /* high_lsp_tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B270907FC9900C478FC /* high_lsp_tables.c */; }; - 73814B780907FC9900C478FC /* lpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2B0907FC9900C478FC /* lpc.c */; }; - 73814B7A0907FC9900C478FC /* lsp_tables_nb.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2D0907FC9900C478FC /* lsp_tables_nb.c */; }; - 73814B7B0907FC9900C478FC /* lsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2E0907FC9900C478FC /* lsp.c */; }; - 73814B800907FC9900C478FC /* ltp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B330907FC9900C478FC /* ltp.c */; }; - 73814B8A0907FC9900C478FC /* modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B3D0907FC9900C478FC /* modes.c */; }; - 73814B8C0907FC9900C478FC /* nb_celp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B3F0907FC9900C478FC /* nb_celp.c */; }; - 73814B8F0907FC9900C478FC /* quant_lsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B420907FC9900C478FC /* quant_lsp.c */; }; - 73814B910907FC9900C478FC /* sb_celp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B440907FC9900C478FC /* sb_celp.c */; }; - 73814B930907FC9900C478FC /* smallft.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B460907FC9900C478FC /* smallft.c */; }; - 73814B950907FC9900C478FC /* speex_callbacks.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B480907FC9900C478FC /* speex_callbacks.c */; }; - 73814B960907FC9900C478FC /* speex_header.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B490907FC9900C478FC /* speex_header.c */; }; - 73814B970907FC9900C478FC /* speex.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B4A0907FC9900C478FC /* speex.c */; }; - 73814B990907FC9900C478FC /* stereo.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B4C0907FC9900C478FC /* stereo.c */; }; - 73814B9F0907FC9900C478FC /* vbr.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B520907FC9900C478FC /* vbr.c */; }; - 73814BA40907FC9900C478FC /* vq.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B570907FC9900C478FC /* vq.c */; }; - 738837540B193581005C7A69 /* _kiss_fft_guts.h in Headers */ = {isa = PBXBuildFile; fileRef = 738837460B193581005C7A69 /* _kiss_fft_guts.h */; }; - 738837550B193581005C7A69 /* fftwrap.c in Sources */ = {isa = PBXBuildFile; fileRef = 738837470B193581005C7A69 /* fftwrap.c */; }; - 738837560B193581005C7A69 /* fftwrap.h in Headers */ = {isa = PBXBuildFile; fileRef = 738837480B193581005C7A69 /* fftwrap.h */; }; - 738837590B193581005C7A69 /* kiss_fft.c in Sources */ = {isa = PBXBuildFile; fileRef = 7388374B0B193581005C7A69 /* kiss_fft.c */; }; - 7388375A0B193581005C7A69 /* kiss_fft.h in Headers */ = {isa = PBXBuildFile; fileRef = 7388374C0B193581005C7A69 /* kiss_fft.h */; }; - 7388375B0B193581005C7A69 /* kiss_fftr.c in Sources */ = {isa = PBXBuildFile; fileRef = 7388374D0B193581005C7A69 /* kiss_fftr.c */; }; - 7388375C0B193581005C7A69 /* kiss_fftr.h in Headers */ = {isa = PBXBuildFile; fileRef = 7388374E0B193581005C7A69 /* kiss_fftr.h */; }; - 7388375D0B193581005C7A69 /* lsp_bfin.h in Headers */ = {isa = PBXBuildFile; fileRef = 7388374F0B193581005C7A69 /* lsp_bfin.h */; }; - 7388375E0B193581005C7A69 /* pseudofloat.h in Headers */ = {isa = PBXBuildFile; fileRef = 738837500B193581005C7A69 /* pseudofloat.h */; }; - 7388375F0B193581005C7A69 /* quant_lsp_bfin.h in Headers */ = {isa = PBXBuildFile; fileRef = 738837510B193581005C7A69 /* quant_lsp_bfin.h */; }; - 738837600B193581005C7A69 /* vorbis_psy.c in Sources */ = {isa = PBXBuildFile; fileRef = 738837520B193581005C7A69 /* vorbis_psy.c */; }; - 738837610B193581005C7A69 /* vorbis_psy.h in Headers */ = {isa = PBXBuildFile; fileRef = 738837530B193581005C7A69 /* vorbis_psy.h */; }; - 7388377B0B193784005C7A69 /* bits.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B0D0907FC9900C478FC /* bits.c */; }; - 7388377C0B193785005C7A69 /* cb_search.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B110907FC9900C478FC /* cb_search.c */; }; - 7388377D0B193788005C7A69 /* exc_10_16_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B160907FC9900C478FC /* exc_10_16_table.c */; }; - 7388377E0B193789005C7A69 /* exc_10_32_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B170907FC9900C478FC /* exc_10_32_table.c */; }; - 7388377F0B19378A005C7A69 /* exc_20_32_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B180907FC9900C478FC /* exc_20_32_table.c */; }; - 738837800B19378A005C7A69 /* exc_5_256_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B140907FC9900C478FC /* exc_5_256_table.c */; }; - 738837810B19378C005C7A69 /* exc_5_64_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B130907FC9900C478FC /* exc_5_64_table.c */; }; - 738837820B19378E005C7A69 /* exc_8_128_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B150907FC9900C478FC /* exc_8_128_table.c */; }; - 738837830B193791005C7A69 /* fftwrap.c in Sources */ = {isa = PBXBuildFile; fileRef = 738837470B193581005C7A69 /* fftwrap.c */; }; - 738837850B193793005C7A69 /* filters.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B1C0907FC9900C478FC /* filters.c */; }; - 738837860B193795005C7A69 /* gain_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B240907FC9900C478FC /* gain_table.c */; }; - 738837870B193796005C7A69 /* gain_table_lbr.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B230907FC9900C478FC /* gain_table_lbr.c */; }; - 738837880B193799005C7A69 /* hexc_10_32_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B250907FC9900C478FC /* hexc_10_32_table.c */; }; - 738837890B19379B005C7A69 /* hexc_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B260907FC9900C478FC /* hexc_table.c */; }; - 7388378A0B19379E005C7A69 /* high_lsp_tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B270907FC9900C478FC /* high_lsp_tables.c */; }; - 7388378C0B1937A4005C7A69 /* kiss_fft.c in Sources */ = {isa = PBXBuildFile; fileRef = 7388374B0B193581005C7A69 /* kiss_fft.c */; }; - 7388378D0B1937A9005C7A69 /* kiss_fftr.c in Sources */ = {isa = PBXBuildFile; fileRef = 7388374D0B193581005C7A69 /* kiss_fftr.c */; }; - 7388378F0B1937B0005C7A69 /* lpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2B0907FC9900C478FC /* lpc.c */; }; - 738837900B1937B0005C7A69 /* lsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2E0907FC9900C478FC /* lsp.c */; }; - 738837910B1937B5005C7A69 /* lsp_tables_nb.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2D0907FC9900C478FC /* lsp_tables_nb.c */; }; - 738837920B1937B7005C7A69 /* ltp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B330907FC9900C478FC /* ltp.c */; }; - 738837960B1937BE005C7A69 /* modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B3D0907FC9900C478FC /* modes.c */; }; - 738837970B1937C0005C7A69 /* nb_celp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B3F0907FC9900C478FC /* nb_celp.c */; }; - 738837990B1937C4005C7A69 /* quant_lsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B420907FC9900C478FC /* quant_lsp.c */; }; - 7388379A0B1937C6005C7A69 /* sb_celp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B440907FC9900C478FC /* sb_celp.c */; }; - 7388379B0B1937C9005C7A69 /* smallft.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B460907FC9900C478FC /* smallft.c */; }; - 7388379C0B1937CB005C7A69 /* speex.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B4A0907FC9900C478FC /* speex.c */; }; - 7388379D0B1937CE005C7A69 /* speex_callbacks.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B480907FC9900C478FC /* speex_callbacks.c */; }; - 7388379E0B1937D0005C7A69 /* speex_header.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B490907FC9900C478FC /* speex_header.c */; }; - 7388379F0B1937D1005C7A69 /* stereo.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B4C0907FC9900C478FC /* stereo.c */; }; - 738837A00B1937DA005C7A69 /* vbr.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B520907FC9900C478FC /* vbr.c */; }; - 738837A10B1937DD005C7A69 /* vorbis_psy.c in Sources */ = {isa = PBXBuildFile; fileRef = 738837520B193581005C7A69 /* vorbis_psy.c */; }; - 738837A20B1937DF005C7A69 /* vq.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B570907FC9900C478FC /* vq.c */; }; - 738837A30B1937E1005C7A69 /* window.c in Sources */ = {isa = PBXBuildFile; fileRef = BFF73DCF0A78AA170078A4A8 /* window.c */; }; - 8D07F2C00486CC7A007CD1D0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; }; - BFF73DD00A78AA170078A4A8 /* window.c in Sources */ = {isa = PBXBuildFile; fileRef = BFF73DCF0A78AA170078A4A8 /* window.c */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 32BAE0B70371A74B00C91783 /* Speex_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Speex_Prefix.pch; sourceTree = ""; }; - 37CA8DEA0DD73333005C8CB6 /* modes_wb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = modes_wb.c; path = ../libspeex/modes_wb.c; sourceTree = SOURCE_ROOT; }; - 37CA8DFF0DD7352A005C8CB6 /* os_support.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = os_support.h; path = ../libspeex/os_support.h; sourceTree = SOURCE_ROOT; }; - 73814AEF0907FB8200C478FC /* speex.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex.h; sourceTree = ""; }; - 73814AF00907FB8200C478FC /* speex_bits.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_bits.h; sourceTree = ""; }; - 73814AF10907FB8200C478FC /* speex_callbacks.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_callbacks.h; sourceTree = ""; }; - 73814AF40907FB8200C478FC /* speex_header.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_header.h; sourceTree = ""; }; - 73814AF70907FB8200C478FC /* speex_stereo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_stereo.h; sourceTree = ""; }; - 73814AF80907FB8200C478FC /* speex_types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_types.h; sourceTree = ""; }; - 73814B0C0907FC9900C478FC /* arch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = arch.h; path = ../libspeex/arch.h; sourceTree = SOURCE_ROOT; }; - 73814B0D0907FC9900C478FC /* bits.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = bits.c; path = ../libspeex/bits.c; sourceTree = SOURCE_ROOT; }; - 73814B0E0907FC9900C478FC /* cb_search_arm4.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = cb_search_arm4.h; path = ../libspeex/cb_search_arm4.h; sourceTree = SOURCE_ROOT; }; - 73814B0F0907FC9900C478FC /* cb_search_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = cb_search_bfin.h; path = ../libspeex/cb_search_bfin.h; sourceTree = SOURCE_ROOT; }; - 73814B100907FC9900C478FC /* cb_search_sse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = cb_search_sse.h; path = ../libspeex/cb_search_sse.h; sourceTree = SOURCE_ROOT; }; - 73814B110907FC9900C478FC /* cb_search.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = cb_search.c; path = ../libspeex/cb_search.c; sourceTree = SOURCE_ROOT; }; - 73814B120907FC9900C478FC /* cb_search.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = cb_search.h; path = ../libspeex/cb_search.h; sourceTree = SOURCE_ROOT; }; - 73814B130907FC9900C478FC /* exc_5_64_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = exc_5_64_table.c; path = ../libspeex/exc_5_64_table.c; sourceTree = SOURCE_ROOT; }; - 73814B140907FC9900C478FC /* exc_5_256_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = exc_5_256_table.c; path = ../libspeex/exc_5_256_table.c; sourceTree = SOURCE_ROOT; }; - 73814B150907FC9900C478FC /* exc_8_128_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = exc_8_128_table.c; path = ../libspeex/exc_8_128_table.c; sourceTree = SOURCE_ROOT; }; - 73814B160907FC9900C478FC /* exc_10_16_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = exc_10_16_table.c; path = ../libspeex/exc_10_16_table.c; sourceTree = SOURCE_ROOT; }; - 73814B170907FC9900C478FC /* exc_10_32_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = exc_10_32_table.c; path = ../libspeex/exc_10_32_table.c; sourceTree = SOURCE_ROOT; }; - 73814B180907FC9900C478FC /* exc_20_32_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = exc_20_32_table.c; path = ../libspeex/exc_20_32_table.c; sourceTree = SOURCE_ROOT; }; - 73814B190907FC9900C478FC /* filters_arm4.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = filters_arm4.h; path = ../libspeex/filters_arm4.h; sourceTree = SOURCE_ROOT; }; - 73814B1A0907FC9900C478FC /* filters_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = filters_bfin.h; path = ../libspeex/filters_bfin.h; sourceTree = SOURCE_ROOT; }; - 73814B1B0907FC9900C478FC /* filters_sse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = filters_sse.h; path = ../libspeex/filters_sse.h; sourceTree = SOURCE_ROOT; }; - 73814B1C0907FC9900C478FC /* filters.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = filters.c; path = ../libspeex/filters.c; sourceTree = SOURCE_ROOT; }; - 73814B1D0907FC9900C478FC /* filters.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = filters.h; path = ../libspeex/filters.h; sourceTree = SOURCE_ROOT; }; - 73814B1E0907FC9900C478FC /* fixed_arm4.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = fixed_arm4.h; path = ../libspeex/fixed_arm4.h; sourceTree = SOURCE_ROOT; }; - 73814B1F0907FC9900C478FC /* fixed_arm5e.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = fixed_arm5e.h; path = ../libspeex/fixed_arm5e.h; sourceTree = SOURCE_ROOT; }; - 73814B200907FC9900C478FC /* fixed_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = fixed_bfin.h; path = ../libspeex/fixed_bfin.h; sourceTree = SOURCE_ROOT; }; - 73814B210907FC9900C478FC /* fixed_debug.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = fixed_debug.h; path = ../libspeex/fixed_debug.h; sourceTree = SOURCE_ROOT; }; - 73814B220907FC9900C478FC /* fixed_generic.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = fixed_generic.h; path = ../libspeex/fixed_generic.h; sourceTree = SOURCE_ROOT; }; - 73814B230907FC9900C478FC /* gain_table_lbr.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = gain_table_lbr.c; path = ../libspeex/gain_table_lbr.c; sourceTree = SOURCE_ROOT; }; - 73814B240907FC9900C478FC /* gain_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = gain_table.c; path = ../libspeex/gain_table.c; sourceTree = SOURCE_ROOT; }; - 73814B250907FC9900C478FC /* hexc_10_32_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hexc_10_32_table.c; path = ../libspeex/hexc_10_32_table.c; sourceTree = SOURCE_ROOT; }; - 73814B260907FC9900C478FC /* hexc_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hexc_table.c; path = ../libspeex/hexc_table.c; sourceTree = SOURCE_ROOT; }; - 73814B270907FC9900C478FC /* high_lsp_tables.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = high_lsp_tables.c; path = ../libspeex/high_lsp_tables.c; sourceTree = SOURCE_ROOT; }; - 73814B2A0907FC9900C478FC /* lpc_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = lpc_bfin.h; path = ../libspeex/lpc_bfin.h; sourceTree = SOURCE_ROOT; }; - 73814B2B0907FC9900C478FC /* lpc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lpc.c; path = ../libspeex/lpc.c; sourceTree = SOURCE_ROOT; }; - 73814B2C0907FC9900C478FC /* lpc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = lpc.h; path = ../libspeex/lpc.h; sourceTree = SOURCE_ROOT; }; - 73814B2D0907FC9900C478FC /* lsp_tables_nb.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lsp_tables_nb.c; path = ../libspeex/lsp_tables_nb.c; sourceTree = SOURCE_ROOT; }; - 73814B2E0907FC9900C478FC /* lsp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lsp.c; path = ../libspeex/lsp.c; sourceTree = SOURCE_ROOT; }; - 73814B2F0907FC9900C478FC /* lsp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = lsp.h; path = ../libspeex/lsp.h; sourceTree = SOURCE_ROOT; }; - 73814B300907FC9900C478FC /* ltp_arm4.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ltp_arm4.h; path = ../libspeex/ltp_arm4.h; sourceTree = SOURCE_ROOT; }; - 73814B310907FC9900C478FC /* ltp_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ltp_bfin.h; path = ../libspeex/ltp_bfin.h; sourceTree = SOURCE_ROOT; }; - 73814B320907FC9900C478FC /* ltp_sse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ltp_sse.h; path = ../libspeex/ltp_sse.h; sourceTree = SOURCE_ROOT; }; - 73814B330907FC9900C478FC /* ltp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ltp.c; path = ../libspeex/ltp.c; sourceTree = SOURCE_ROOT; }; - 73814B340907FC9900C478FC /* ltp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ltp.h; path = ../libspeex/ltp.h; sourceTree = SOURCE_ROOT; }; - 73814B380907FC9900C478FC /* math_approx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = math_approx.h; path = ../libspeex/math_approx.h; sourceTree = SOURCE_ROOT; }; - 73814B3A0907FC9900C478FC /* misc_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = misc_bfin.h; path = ../libspeex/misc_bfin.h; sourceTree = SOURCE_ROOT; }; - 73814B3D0907FC9900C478FC /* modes.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = modes.c; path = ../libspeex/modes.c; sourceTree = SOURCE_ROOT; }; - 73814B3E0907FC9900C478FC /* modes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = modes.h; path = ../libspeex/modes.h; sourceTree = SOURCE_ROOT; }; - 73814B3F0907FC9900C478FC /* nb_celp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = nb_celp.c; path = ../libspeex/nb_celp.c; sourceTree = SOURCE_ROOT; }; - 73814B400907FC9900C478FC /* nb_celp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = nb_celp.h; path = ../libspeex/nb_celp.h; sourceTree = SOURCE_ROOT; }; - 73814B420907FC9900C478FC /* quant_lsp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = quant_lsp.c; path = ../libspeex/quant_lsp.c; sourceTree = SOURCE_ROOT; }; - 73814B430907FC9900C478FC /* quant_lsp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = quant_lsp.h; path = ../libspeex/quant_lsp.h; sourceTree = SOURCE_ROOT; }; - 73814B440907FC9900C478FC /* sb_celp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sb_celp.c; path = ../libspeex/sb_celp.c; sourceTree = SOURCE_ROOT; }; - 73814B450907FC9900C478FC /* sb_celp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sb_celp.h; path = ../libspeex/sb_celp.h; sourceTree = SOURCE_ROOT; }; - 73814B460907FC9900C478FC /* smallft.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = smallft.c; path = ../libspeex/smallft.c; sourceTree = SOURCE_ROOT; }; - 73814B470907FC9900C478FC /* smallft.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = smallft.h; path = ../libspeex/smallft.h; sourceTree = SOURCE_ROOT; }; - 73814B480907FC9900C478FC /* speex_callbacks.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = speex_callbacks.c; path = ../libspeex/speex_callbacks.c; sourceTree = SOURCE_ROOT; }; - 73814B490907FC9900C478FC /* speex_header.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = speex_header.c; path = ../libspeex/speex_header.c; sourceTree = SOURCE_ROOT; }; - 73814B4A0907FC9900C478FC /* speex.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = speex.c; path = ../libspeex/speex.c; sourceTree = SOURCE_ROOT; }; - 73814B4B0907FC9900C478FC /* stack_alloc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = stack_alloc.h; path = ../libspeex/stack_alloc.h; sourceTree = SOURCE_ROOT; }; - 73814B4C0907FC9900C478FC /* stereo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = stereo.c; path = ../libspeex/stereo.c; sourceTree = SOURCE_ROOT; }; - 73814B4F0907FC9900C478FC /* testenc_uwb.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testenc_uwb.c; path = ../libspeex/testenc_uwb.c; sourceTree = SOURCE_ROOT; }; - 73814B500907FC9900C478FC /* testenc_wb.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testenc_wb.c; path = ../libspeex/testenc_wb.c; sourceTree = SOURCE_ROOT; }; - 73814B510907FC9900C478FC /* testenc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testenc.c; path = ../libspeex/testenc.c; sourceTree = SOURCE_ROOT; }; - 73814B520907FC9900C478FC /* vbr.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = vbr.c; path = ../libspeex/vbr.c; sourceTree = SOURCE_ROOT; }; - 73814B530907FC9900C478FC /* vbr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = vbr.h; path = ../libspeex/vbr.h; sourceTree = SOURCE_ROOT; }; - 73814B540907FC9900C478FC /* vq_arm4.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = vq_arm4.h; path = ../libspeex/vq_arm4.h; sourceTree = SOURCE_ROOT; }; - 73814B550907FC9900C478FC /* vq_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = vq_bfin.h; path = ../libspeex/vq_bfin.h; sourceTree = SOURCE_ROOT; }; - 73814B560907FC9900C478FC /* vq_sse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = vq_sse.h; path = ../libspeex/vq_sse.h; sourceTree = SOURCE_ROOT; }; - 73814B570907FC9900C478FC /* vq.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = vq.c; path = ../libspeex/vq.c; sourceTree = SOURCE_ROOT; }; - 73814B580907FC9900C478FC /* vq.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = vq.h; path = ../libspeex/vq.h; sourceTree = SOURCE_ROOT; }; - 738837460B193581005C7A69 /* _kiss_fft_guts.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = _kiss_fft_guts.h; path = ../libspeex/_kiss_fft_guts.h; sourceTree = SOURCE_ROOT; }; - 738837470B193581005C7A69 /* fftwrap.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fftwrap.c; path = ../libspeex/fftwrap.c; sourceTree = SOURCE_ROOT; }; - 738837480B193581005C7A69 /* fftwrap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = fftwrap.h; path = ../libspeex/fftwrap.h; sourceTree = SOURCE_ROOT; }; - 7388374B0B193581005C7A69 /* kiss_fft.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = kiss_fft.c; path = ../libspeex/kiss_fft.c; sourceTree = SOURCE_ROOT; }; - 7388374C0B193581005C7A69 /* kiss_fft.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = kiss_fft.h; path = ../libspeex/kiss_fft.h; sourceTree = SOURCE_ROOT; }; - 7388374D0B193581005C7A69 /* kiss_fftr.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = kiss_fftr.c; path = ../libspeex/kiss_fftr.c; sourceTree = SOURCE_ROOT; }; - 7388374E0B193581005C7A69 /* kiss_fftr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = kiss_fftr.h; path = ../libspeex/kiss_fftr.h; sourceTree = SOURCE_ROOT; }; - 7388374F0B193581005C7A69 /* lsp_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = lsp_bfin.h; path = ../libspeex/lsp_bfin.h; sourceTree = SOURCE_ROOT; }; - 738837500B193581005C7A69 /* pseudofloat.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pseudofloat.h; path = ../libspeex/pseudofloat.h; sourceTree = SOURCE_ROOT; }; - 738837510B193581005C7A69 /* quant_lsp_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = quant_lsp_bfin.h; path = ../libspeex/quant_lsp_bfin.h; sourceTree = SOURCE_ROOT; }; - 738837520B193581005C7A69 /* vorbis_psy.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = vorbis_psy.c; path = ../libspeex/vorbis_psy.c; sourceTree = SOURCE_ROOT; }; - 738837530B193581005C7A69 /* vorbis_psy.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = vorbis_psy.h; path = ../libspeex/vorbis_psy.h; sourceTree = SOURCE_ROOT; }; - 738837770B193667005C7A69 /* libspeex.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libspeex.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 8D07F2C70486CC7A007CD1D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D07F2C80486CC7A007CD1D0 /* Speex.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Speex.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - BFF73DCF0A78AA170078A4A8 /* window.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = window.c; path = ../libspeex/window.c; sourceTree = SOURCE_ROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 738837750B193667005C7A69 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8D07F2C30486CC7A007CD1D0 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 034768DDFF38A45A11DB9C8B /* Products */ = { - isa = PBXGroup; - children = ( - 8D07F2C80486CC7A007CD1D0 /* Speex.framework */, - 738837770B193667005C7A69 /* libspeex.a */, - ); - name = Products; - sourceTree = ""; - }; - 0867D691FE84028FC02AAC07 /* Speex */ = { - isa = PBXGroup; - children = ( - 08FB77ACFE841707C02AAC07 /* Source */, - 73814AEB0907FB6400C478FC /* Headers */, - 089C1665FE841158C02AAC07 /* Resources */, - 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */, - 034768DDFF38A45A11DB9C8B /* Products */, - ); - name = Speex; - sourceTree = ""; - }; - 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = { - isa = PBXGroup; - children = ( - ); - name = "External Frameworks and Libraries"; - sourceTree = ""; - }; - 089C1665FE841158C02AAC07 /* Resources */ = { - isa = PBXGroup; - children = ( - 8D07F2C70486CC7A007CD1D0 /* Info.plist */, - 089C1666FE841158C02AAC07 /* InfoPlist.strings */, - ); - name = Resources; - sourceTree = ""; - }; - 08FB77ACFE841707C02AAC07 /* Source */ = { - isa = PBXGroup; - children = ( - 37CA8DFF0DD7352A005C8CB6 /* os_support.h */, - 37CA8DEA0DD73333005C8CB6 /* modes_wb.c */, - 738837460B193581005C7A69 /* _kiss_fft_guts.h */, - 738837470B193581005C7A69 /* fftwrap.c */, - 738837480B193581005C7A69 /* fftwrap.h */, - 7388374B0B193581005C7A69 /* kiss_fft.c */, - 7388374C0B193581005C7A69 /* kiss_fft.h */, - 7388374D0B193581005C7A69 /* kiss_fftr.c */, - 7388374E0B193581005C7A69 /* kiss_fftr.h */, - 7388374F0B193581005C7A69 /* lsp_bfin.h */, - 738837500B193581005C7A69 /* pseudofloat.h */, - 738837510B193581005C7A69 /* quant_lsp_bfin.h */, - 738837520B193581005C7A69 /* vorbis_psy.c */, - 738837530B193581005C7A69 /* vorbis_psy.h */, - 73814B0C0907FC9900C478FC /* arch.h */, - 73814B0D0907FC9900C478FC /* bits.c */, - 73814B0E0907FC9900C478FC /* cb_search_arm4.h */, - 73814B0F0907FC9900C478FC /* cb_search_bfin.h */, - 73814B100907FC9900C478FC /* cb_search_sse.h */, - BFF73DCF0A78AA170078A4A8 /* window.c */, - 73814B110907FC9900C478FC /* cb_search.c */, - 73814B120907FC9900C478FC /* cb_search.h */, - 73814B130907FC9900C478FC /* exc_5_64_table.c */, - 73814B140907FC9900C478FC /* exc_5_256_table.c */, - 73814B150907FC9900C478FC /* exc_8_128_table.c */, - 73814B160907FC9900C478FC /* exc_10_16_table.c */, - 73814B170907FC9900C478FC /* exc_10_32_table.c */, - 73814B180907FC9900C478FC /* exc_20_32_table.c */, - 73814B190907FC9900C478FC /* filters_arm4.h */, - 73814B1A0907FC9900C478FC /* filters_bfin.h */, - 73814B1B0907FC9900C478FC /* filters_sse.h */, - 73814B1C0907FC9900C478FC /* filters.c */, - 73814B1D0907FC9900C478FC /* filters.h */, - 73814B1E0907FC9900C478FC /* fixed_arm4.h */, - 73814B1F0907FC9900C478FC /* fixed_arm5e.h */, - 73814B200907FC9900C478FC /* fixed_bfin.h */, - 73814B210907FC9900C478FC /* fixed_debug.h */, - 73814B220907FC9900C478FC /* fixed_generic.h */, - 73814B230907FC9900C478FC /* gain_table_lbr.c */, - 73814B240907FC9900C478FC /* gain_table.c */, - 73814B250907FC9900C478FC /* hexc_10_32_table.c */, - 73814B260907FC9900C478FC /* hexc_table.c */, - 73814B270907FC9900C478FC /* high_lsp_tables.c */, - 73814B2A0907FC9900C478FC /* lpc_bfin.h */, - 73814B2B0907FC9900C478FC /* lpc.c */, - 73814B2C0907FC9900C478FC /* lpc.h */, - 73814B2D0907FC9900C478FC /* lsp_tables_nb.c */, - 73814B2E0907FC9900C478FC /* lsp.c */, - 73814B2F0907FC9900C478FC /* lsp.h */, - 73814B300907FC9900C478FC /* ltp_arm4.h */, - 73814B310907FC9900C478FC /* ltp_bfin.h */, - 73814B320907FC9900C478FC /* ltp_sse.h */, - 73814B330907FC9900C478FC /* ltp.c */, - 73814B340907FC9900C478FC /* ltp.h */, - 73814B380907FC9900C478FC /* math_approx.h */, - 73814B3A0907FC9900C478FC /* misc_bfin.h */, - 73814B3D0907FC9900C478FC /* modes.c */, - 73814B3E0907FC9900C478FC /* modes.h */, - 73814B3F0907FC9900C478FC /* nb_celp.c */, - 73814B400907FC9900C478FC /* nb_celp.h */, - 73814B420907FC9900C478FC /* quant_lsp.c */, - 73814B430907FC9900C478FC /* quant_lsp.h */, - 73814B440907FC9900C478FC /* sb_celp.c */, - 73814B450907FC9900C478FC /* sb_celp.h */, - 73814B460907FC9900C478FC /* smallft.c */, - 73814B470907FC9900C478FC /* smallft.h */, - 73814B480907FC9900C478FC /* speex_callbacks.c */, - 73814B490907FC9900C478FC /* speex_header.c */, - 73814B4A0907FC9900C478FC /* speex.c */, - 73814B4B0907FC9900C478FC /* stack_alloc.h */, - 73814B4C0907FC9900C478FC /* stereo.c */, - 73814B4F0907FC9900C478FC /* testenc_uwb.c */, - 73814B500907FC9900C478FC /* testenc_wb.c */, - 73814B510907FC9900C478FC /* testenc.c */, - 73814B520907FC9900C478FC /* vbr.c */, - 73814B530907FC9900C478FC /* vbr.h */, - 73814B540907FC9900C478FC /* vq_arm4.h */, - 73814B550907FC9900C478FC /* vq_bfin.h */, - 73814B560907FC9900C478FC /* vq_sse.h */, - 73814B570907FC9900C478FC /* vq.c */, - 73814B580907FC9900C478FC /* vq.h */, - 32BAE0B70371A74B00C91783 /* Speex_Prefix.pch */, - ); - name = Source; - sourceTree = ""; - }; - 73814AEB0907FB6400C478FC /* Headers */ = { - isa = PBXGroup; - children = ( - 73814AEC0907FB8200C478FC /* speex */, - ); - name = Headers; - sourceTree = ""; - }; - 73814AEC0907FB8200C478FC /* speex */ = { - isa = PBXGroup; - children = ( - 73814AEF0907FB8200C478FC /* speex.h */, - 73814AF00907FB8200C478FC /* speex_bits.h */, - 73814AF10907FB8200C478FC /* speex_callbacks.h */, - 73814AF40907FB8200C478FC /* speex_header.h */, - 73814AF70907FB8200C478FC /* speex_stereo.h */, - 73814AF80907FB8200C478FC /* speex_types.h */, - ); - name = speex; - path = ../include/speex; - sourceTree = SOURCE_ROOT; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 738837730B193667005C7A69 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8D07F2BD0486CC7A007CD1D0 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 73814B000907FB8200C478FC /* speex_header.h in Headers */, - 73814B030907FB8200C478FC /* speex_stereo.h in Headers */, - 73814B040907FB8200C478FC /* speex_types.h in Headers */, - 73814B060907FBAB00C478FC /* speex_callbacks.h in Headers */, - 73814B070907FBAD00C478FC /* speex_bits.h in Headers */, - 73814B080907FBAE00C478FC /* speex.h in Headers */, - 738837540B193581005C7A69 /* _kiss_fft_guts.h in Headers */, - 738837560B193581005C7A69 /* fftwrap.h in Headers */, - 7388375A0B193581005C7A69 /* kiss_fft.h in Headers */, - 7388375C0B193581005C7A69 /* kiss_fftr.h in Headers */, - 7388375D0B193581005C7A69 /* lsp_bfin.h in Headers */, - 7388375E0B193581005C7A69 /* pseudofloat.h in Headers */, - 7388375F0B193581005C7A69 /* quant_lsp_bfin.h in Headers */, - 738837610B193581005C7A69 /* vorbis_psy.h in Headers */, - 37CA8E000DD7352A005C8CB6 /* os_support.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 738837760B193667005C7A69 /* libspeex (static) */ = { - isa = PBXNativeTarget; - buildConfigurationList = 738837780B193687005C7A69 /* Build configuration list for PBXNativeTarget "libspeex (static)" */; - buildPhases = ( - 738837730B193667005C7A69 /* Headers */, - 738837740B193667005C7A69 /* Sources */, - 738837750B193667005C7A69 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "libspeex (static)"; - productName = speex; - productReference = 738837770B193667005C7A69 /* libspeex.a */; - productType = "com.apple.product-type.library.static"; - }; - 8D07F2BC0486CC7A007CD1D0 /* Speex */ = { - isa = PBXNativeTarget; - buildConfigurationList = 73814ADF0907FB1E00C478FC /* Build configuration list for PBXNativeTarget "Speex" */; - buildPhases = ( - 8D07F2BD0486CC7A007CD1D0 /* Headers */, - 8D07F2BF0486CC7A007CD1D0 /* Resources */, - 8D07F2C10486CC7A007CD1D0 /* Sources */, - 8D07F2C30486CC7A007CD1D0 /* Frameworks */, - 8D07F2C50486CC7A007CD1D0 /* Rez */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Speex; - productInstallPath = "$(HOME)/Library/Frameworks"; - productName = Speex; - productReference = 8D07F2C80486CC7A007CD1D0 /* Speex.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 0867D690FE84028FC02AAC07 /* Project object */ = { - isa = PBXProject; - buildConfigurationList = 73814AE30907FB1E00C478FC /* Build configuration list for PBXProject "Speex" */; - compatibilityVersion = "Xcode 2.4"; - hasScannedForEncodings = 1; - mainGroup = 0867D691FE84028FC02AAC07 /* Speex */; - productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */; - projectDirPath = ""; - projectRoot = ..; - targets = ( - 8D07F2BC0486CC7A007CD1D0 /* Speex */, - 738837760B193667005C7A69 /* libspeex (static) */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D07F2BF0486CC7A007CD1D0 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D07F2C00486CC7A007CD1D0 /* InfoPlist.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXRezBuildPhase section */ - 8D07F2C50486CC7A007CD1D0 /* Rez */ = { - isa = PBXRezBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXRezBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 738837740B193667005C7A69 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 7388377B0B193784005C7A69 /* bits.c in Sources */, - 7388377C0B193785005C7A69 /* cb_search.c in Sources */, - 7388377D0B193788005C7A69 /* exc_10_16_table.c in Sources */, - 7388377E0B193789005C7A69 /* exc_10_32_table.c in Sources */, - 7388377F0B19378A005C7A69 /* exc_20_32_table.c in Sources */, - 738837800B19378A005C7A69 /* exc_5_256_table.c in Sources */, - 738837810B19378C005C7A69 /* exc_5_64_table.c in Sources */, - 738837820B19378E005C7A69 /* exc_8_128_table.c in Sources */, - 738837830B193791005C7A69 /* fftwrap.c in Sources */, - 738837850B193793005C7A69 /* filters.c in Sources */, - 738837860B193795005C7A69 /* gain_table.c in Sources */, - 738837870B193796005C7A69 /* gain_table_lbr.c in Sources */, - 738837880B193799005C7A69 /* hexc_10_32_table.c in Sources */, - 738837890B19379B005C7A69 /* hexc_table.c in Sources */, - 7388378A0B19379E005C7A69 /* high_lsp_tables.c in Sources */, - 7388378C0B1937A4005C7A69 /* kiss_fft.c in Sources */, - 7388378D0B1937A9005C7A69 /* kiss_fftr.c in Sources */, - 7388378F0B1937B0005C7A69 /* lpc.c in Sources */, - 738837900B1937B0005C7A69 /* lsp.c in Sources */, - 738837910B1937B5005C7A69 /* lsp_tables_nb.c in Sources */, - 738837920B1937B7005C7A69 /* ltp.c in Sources */, - 738837960B1937BE005C7A69 /* modes.c in Sources */, - 738837970B1937C0005C7A69 /* nb_celp.c in Sources */, - 738837990B1937C4005C7A69 /* quant_lsp.c in Sources */, - 7388379A0B1937C6005C7A69 /* sb_celp.c in Sources */, - 7388379B0B1937C9005C7A69 /* smallft.c in Sources */, - 7388379C0B1937CB005C7A69 /* speex.c in Sources */, - 7388379D0B1937CE005C7A69 /* speex_callbacks.c in Sources */, - 7388379E0B1937D0005C7A69 /* speex_header.c in Sources */, - 7388379F0B1937D1005C7A69 /* stereo.c in Sources */, - 738837A00B1937DA005C7A69 /* vbr.c in Sources */, - 738837A10B1937DD005C7A69 /* vorbis_psy.c in Sources */, - 738837A20B1937DF005C7A69 /* vq.c in Sources */, - 738837A30B1937E1005C7A69 /* window.c in Sources */, - 37CA8DEC0DD73333005C8CB6 /* modes_wb.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8D07F2C10486CC7A007CD1D0 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 73814B5A0907FC9900C478FC /* bits.c in Sources */, - 73814B5E0907FC9900C478FC /* cb_search.c in Sources */, - 73814B600907FC9900C478FC /* exc_5_64_table.c in Sources */, - 73814B610907FC9900C478FC /* exc_5_256_table.c in Sources */, - 73814B620907FC9900C478FC /* exc_8_128_table.c in Sources */, - 73814B630907FC9900C478FC /* exc_10_16_table.c in Sources */, - 73814B640907FC9900C478FC /* exc_10_32_table.c in Sources */, - 73814B650907FC9900C478FC /* exc_20_32_table.c in Sources */, - 73814B690907FC9900C478FC /* filters.c in Sources */, - 73814B700907FC9900C478FC /* gain_table_lbr.c in Sources */, - 73814B710907FC9900C478FC /* gain_table.c in Sources */, - 73814B720907FC9900C478FC /* hexc_10_32_table.c in Sources */, - 73814B730907FC9900C478FC /* hexc_table.c in Sources */, - 73814B740907FC9900C478FC /* high_lsp_tables.c in Sources */, - 73814B780907FC9900C478FC /* lpc.c in Sources */, - 73814B7A0907FC9900C478FC /* lsp_tables_nb.c in Sources */, - 73814B7B0907FC9900C478FC /* lsp.c in Sources */, - 73814B800907FC9900C478FC /* ltp.c in Sources */, - 73814B8A0907FC9900C478FC /* modes.c in Sources */, - 73814B8C0907FC9900C478FC /* nb_celp.c in Sources */, - 73814B8F0907FC9900C478FC /* quant_lsp.c in Sources */, - 73814B910907FC9900C478FC /* sb_celp.c in Sources */, - 73814B930907FC9900C478FC /* smallft.c in Sources */, - 73814B950907FC9900C478FC /* speex_callbacks.c in Sources */, - 73814B960907FC9900C478FC /* speex_header.c in Sources */, - 73814B970907FC9900C478FC /* speex.c in Sources */, - 73814B990907FC9900C478FC /* stereo.c in Sources */, - 73814B9F0907FC9900C478FC /* vbr.c in Sources */, - 73814BA40907FC9900C478FC /* vq.c in Sources */, - BFF73DD00A78AA170078A4A8 /* window.c in Sources */, - 738837550B193581005C7A69 /* fftwrap.c in Sources */, - 738837590B193581005C7A69 /* kiss_fft.c in Sources */, - 7388375B0B193581005C7A69 /* kiss_fftr.c in Sources */, - 738837600B193581005C7A69 /* vorbis_psy.c in Sources */, - 37CA8DEB0DD73333005C8CB6 /* modes_wb.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 089C1666FE841158C02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C1667FE841158C02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 73814AE00907FB1E00C478FC /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_VERSION = A; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Speex_Prefix.pch; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = /Library/Frameworks; - LIBRARY_STYLE = DYNAMIC; - MACH_O_TYPE = mh_dylib; - PRODUCT_NAME = Speex; - WRAPPER_EXTENSION = framework; - ZERO_LINK = YES; - }; - name = Debug; - }; - 73814AE10907FB1E00C478FC /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_VERSION = A; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Speex_Prefix.pch; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = /Library/Frameworks; - LIBRARY_STYLE = DYNAMIC; - MACH_O_TYPE = mh_dylib; - PRODUCT_NAME = Speex; - WRAPPER_EXTENSION = framework; - ZERO_LINK = NO; - }; - name = Release; - }; - 73814AE40907FB1E00C478FC /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - __MACOSX__, - FLOATING_POINT, - "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_PROJECT_1)", - ); - GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_PROJECT_1 = "EXPORT=__attribute__((visibility(\\\"default\\\")))"; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Debug; - }; - 73814AE50907FB1E00C478FC /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - GCC_OPTIMIZATION_LEVEL = 3; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - __MACOSX__, - FLOATING_POINT, - "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_PROJECT_1)", - ); - GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_PROJECT_1 = "EXPORT=__attribute__((visibility(\\\"default\\\")))"; - OTHER_CFLAGS = ( - "$(OTHER_CFLAGS)", - "-falign-loops=16", - ); - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Release; - }; - 738837790B193687005C7A69 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/lib; - PREBINDING = NO; - PRODUCT_NAME = speex; - ZERO_LINK = YES; - }; - name = Debug; - }; - 7388377A0B193687005C7A69 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = YES; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - INSTALL_PATH = /usr/local/lib; - PREBINDING = NO; - PRODUCT_NAME = speex; - ZERO_LINK = NO; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 73814ADF0907FB1E00C478FC /* Build configuration list for PBXNativeTarget "Speex" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 73814AE00907FB1E00C478FC /* Debug */, - 73814AE10907FB1E00C478FC /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 73814AE30907FB1E00C478FC /* Build configuration list for PBXProject "Speex" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 73814AE40907FB1E00C478FC /* Debug */, - 73814AE50907FB1E00C478FC /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 738837780B193687005C7A69 /* Build configuration list for PBXNativeTarget "libspeex (static)" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 738837790B193687005C7A69 /* Debug */, - 7388377A0B193687005C7A69 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 0867D690FE84028FC02AAC07 /* Project object */; -} diff --git a/Engine/lib/speex/macosx/Speex_Prefix.pch b/Engine/lib/speex/macosx/Speex_Prefix.pch deleted file mode 100644 index 13abf5e41..000000000 --- a/Engine/lib/speex/macosx/Speex_Prefix.pch +++ /dev/null @@ -1,5 +0,0 @@ -// -// Prefix header for all source files of the 'Speex' target in the 'Speex' project. -// - -#include diff --git a/Engine/lib/speex/macosx/Speex_UB.xcodeproj/project.pbxproj b/Engine/lib/speex/macosx/Speex_UB.xcodeproj/project.pbxproj deleted file mode 100644 index 49b0fb9ba..000000000 --- a/Engine/lib/speex/macosx/Speex_UB.xcodeproj/project.pbxproj +++ /dev/null @@ -1,578 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 42; - objects = { - -/* Begin PBXBuildFile section */ - 73814B000907FB8200C478FC /* speex_header.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF40907FB8200C478FC /* speex_header.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 73814B030907FB8200C478FC /* speex_stereo.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF70907FB8200C478FC /* speex_stereo.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 73814B040907FB8200C478FC /* speex_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF80907FB8200C478FC /* speex_types.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 73814B060907FBAB00C478FC /* speex_callbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF10907FB8200C478FC /* speex_callbacks.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 73814B070907FBAD00C478FC /* speex_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF00907FB8200C478FC /* speex_bits.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 73814B080907FBAE00C478FC /* speex.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AEF0907FB8200C478FC /* speex.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 73814B5A0907FC9900C478FC /* bits.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B0D0907FC9900C478FC /* bits.c */; }; - 73814B5E0907FC9900C478FC /* cb_search.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B110907FC9900C478FC /* cb_search.c */; }; - 73814B600907FC9900C478FC /* exc_5_64_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B130907FC9900C478FC /* exc_5_64_table.c */; }; - 73814B610907FC9900C478FC /* exc_5_256_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B140907FC9900C478FC /* exc_5_256_table.c */; }; - 73814B620907FC9900C478FC /* exc_8_128_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B150907FC9900C478FC /* exc_8_128_table.c */; }; - 73814B630907FC9900C478FC /* exc_10_16_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B160907FC9900C478FC /* exc_10_16_table.c */; }; - 73814B640907FC9900C478FC /* exc_10_32_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B170907FC9900C478FC /* exc_10_32_table.c */; }; - 73814B650907FC9900C478FC /* exc_20_32_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B180907FC9900C478FC /* exc_20_32_table.c */; }; - 73814B690907FC9900C478FC /* filters.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B1C0907FC9900C478FC /* filters.c */; }; - 73814B700907FC9900C478FC /* gain_table_lbr.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B230907FC9900C478FC /* gain_table_lbr.c */; }; - 73814B710907FC9900C478FC /* gain_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B240907FC9900C478FC /* gain_table.c */; }; - 73814B720907FC9900C478FC /* hexc_10_32_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B250907FC9900C478FC /* hexc_10_32_table.c */; }; - 73814B730907FC9900C478FC /* hexc_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B260907FC9900C478FC /* hexc_table.c */; }; - 73814B740907FC9900C478FC /* high_lsp_tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B270907FC9900C478FC /* high_lsp_tables.c */; }; - 73814B760907FC9900C478FC /* lbr_48k_tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B290907FC9900C478FC /* lbr_48k_tables.c */; }; - 73814B780907FC9900C478FC /* lpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2B0907FC9900C478FC /* lpc.c */; }; - 73814B7A0907FC9900C478FC /* lsp_tables_nb.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2D0907FC9900C478FC /* lsp_tables_nb.c */; }; - 73814B7B0907FC9900C478FC /* lsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2E0907FC9900C478FC /* lsp.c */; }; - 73814B800907FC9900C478FC /* ltp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B330907FC9900C478FC /* ltp.c */; }; - 73814B840907FC9900C478FC /* math_approx.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B370907FC9900C478FC /* math_approx.c */; }; - 73814B880907FC9900C478FC /* misc.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B3B0907FC9900C478FC /* misc.c */; }; - 73814B8A0907FC9900C478FC /* modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B3D0907FC9900C478FC /* modes.c */; }; - 73814B8C0907FC9900C478FC /* nb_celp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B3F0907FC9900C478FC /* nb_celp.c */; }; - 73814B8F0907FC9900C478FC /* quant_lsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B420907FC9900C478FC /* quant_lsp.c */; }; - 73814B910907FC9900C478FC /* sb_celp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B440907FC9900C478FC /* sb_celp.c */; }; - 73814B930907FC9900C478FC /* smallft.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B460907FC9900C478FC /* smallft.c */; }; - 73814B950907FC9900C478FC /* speex_callbacks.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B480907FC9900C478FC /* speex_callbacks.c */; }; - 73814B960907FC9900C478FC /* speex_header.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B490907FC9900C478FC /* speex_header.c */; }; - 73814B970907FC9900C478FC /* speex.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B4A0907FC9900C478FC /* speex.c */; }; - 73814B990907FC9900C478FC /* stereo.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B4C0907FC9900C478FC /* stereo.c */; }; - 73814B9F0907FC9900C478FC /* vbr.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B520907FC9900C478FC /* vbr.c */; }; - 73814BA40907FC9900C478FC /* vq.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B570907FC9900C478FC /* vq.c */; }; - 8D07F2C00486CC7A007CD1D0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; }; -/* End PBXBuildFile section */ - -/* Begin PBXBuildStyle section */ - 4F0BB7EC011F40E904CA0E50 /* Development */ = { - isa = PBXBuildStyle; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - ZERO_LINK = YES; - }; - name = Development; - }; - 4F0BB7ED011F40E904CA0E50 /* Deployment */ = { - isa = PBXBuildStyle; - buildSettings = { - COPY_PHASE_STRIP = YES; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - ZERO_LINK = NO; - }; - name = Deployment; - }; -/* End PBXBuildStyle section */ - -/* Begin PBXFileReference section */ - 089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 32BAE0B70371A74B00C91783 /* Speex_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Speex_Prefix.pch; sourceTree = ""; }; - 73814AEF0907FB8200C478FC /* speex.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex.h; sourceTree = ""; }; - 73814AF00907FB8200C478FC /* speex_bits.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_bits.h; sourceTree = ""; }; - 73814AF10907FB8200C478FC /* speex_callbacks.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_callbacks.h; sourceTree = ""; }; - 73814AF40907FB8200C478FC /* speex_header.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_header.h; sourceTree = ""; }; - 73814AF70907FB8200C478FC /* speex_stereo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_stereo.h; sourceTree = ""; }; - 73814AF80907FB8200C478FC /* speex_types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_types.h; sourceTree = ""; }; - 73814B0C0907FC9900C478FC /* arch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = arch.h; path = ../libspeex/arch.h; sourceTree = SOURCE_ROOT; }; - 73814B0D0907FC9900C478FC /* bits.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = bits.c; path = ../libspeex/bits.c; sourceTree = SOURCE_ROOT; }; - 73814B0E0907FC9900C478FC /* cb_search_arm4.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = cb_search_arm4.h; path = ../libspeex/cb_search_arm4.h; sourceTree = SOURCE_ROOT; }; - 73814B0F0907FC9900C478FC /* cb_search_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = cb_search_bfin.h; path = ../libspeex/cb_search_bfin.h; sourceTree = SOURCE_ROOT; }; - 73814B100907FC9900C478FC /* cb_search_sse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = cb_search_sse.h; path = ../libspeex/cb_search_sse.h; sourceTree = SOURCE_ROOT; }; - 73814B110907FC9900C478FC /* cb_search.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = cb_search.c; path = ../libspeex/cb_search.c; sourceTree = SOURCE_ROOT; }; - 73814B120907FC9900C478FC /* cb_search.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = cb_search.h; path = ../libspeex/cb_search.h; sourceTree = SOURCE_ROOT; }; - 73814B130907FC9900C478FC /* exc_5_64_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = exc_5_64_table.c; path = ../libspeex/exc_5_64_table.c; sourceTree = SOURCE_ROOT; }; - 73814B140907FC9900C478FC /* exc_5_256_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = exc_5_256_table.c; path = ../libspeex/exc_5_256_table.c; sourceTree = SOURCE_ROOT; }; - 73814B150907FC9900C478FC /* exc_8_128_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = exc_8_128_table.c; path = ../libspeex/exc_8_128_table.c; sourceTree = SOURCE_ROOT; }; - 73814B160907FC9900C478FC /* exc_10_16_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = exc_10_16_table.c; path = ../libspeex/exc_10_16_table.c; sourceTree = SOURCE_ROOT; }; - 73814B170907FC9900C478FC /* exc_10_32_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = exc_10_32_table.c; path = ../libspeex/exc_10_32_table.c; sourceTree = SOURCE_ROOT; }; - 73814B180907FC9900C478FC /* exc_20_32_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = exc_20_32_table.c; path = ../libspeex/exc_20_32_table.c; sourceTree = SOURCE_ROOT; }; - 73814B190907FC9900C478FC /* filters_arm4.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = filters_arm4.h; path = ../libspeex/filters_arm4.h; sourceTree = SOURCE_ROOT; }; - 73814B1A0907FC9900C478FC /* filters_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = filters_bfin.h; path = ../libspeex/filters_bfin.h; sourceTree = SOURCE_ROOT; }; - 73814B1B0907FC9900C478FC /* filters_sse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = filters_sse.h; path = ../libspeex/filters_sse.h; sourceTree = SOURCE_ROOT; }; - 73814B1C0907FC9900C478FC /* filters.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = filters.c; path = ../libspeex/filters.c; sourceTree = SOURCE_ROOT; }; - 73814B1D0907FC9900C478FC /* filters.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = filters.h; path = ../libspeex/filters.h; sourceTree = SOURCE_ROOT; }; - 73814B1E0907FC9900C478FC /* fixed_arm4.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = fixed_arm4.h; path = ../libspeex/fixed_arm4.h; sourceTree = SOURCE_ROOT; }; - 73814B1F0907FC9900C478FC /* fixed_arm5e.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = fixed_arm5e.h; path = ../libspeex/fixed_arm5e.h; sourceTree = SOURCE_ROOT; }; - 73814B200907FC9900C478FC /* fixed_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = fixed_bfin.h; path = ../libspeex/fixed_bfin.h; sourceTree = SOURCE_ROOT; }; - 73814B210907FC9900C478FC /* fixed_debug.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = fixed_debug.h; path = ../libspeex/fixed_debug.h; sourceTree = SOURCE_ROOT; }; - 73814B220907FC9900C478FC /* fixed_generic.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = fixed_generic.h; path = ../libspeex/fixed_generic.h; sourceTree = SOURCE_ROOT; }; - 73814B230907FC9900C478FC /* gain_table_lbr.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = gain_table_lbr.c; path = ../libspeex/gain_table_lbr.c; sourceTree = SOURCE_ROOT; }; - 73814B240907FC9900C478FC /* gain_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = gain_table.c; path = ../libspeex/gain_table.c; sourceTree = SOURCE_ROOT; }; - 73814B250907FC9900C478FC /* hexc_10_32_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hexc_10_32_table.c; path = ../libspeex/hexc_10_32_table.c; sourceTree = SOURCE_ROOT; }; - 73814B260907FC9900C478FC /* hexc_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hexc_table.c; path = ../libspeex/hexc_table.c; sourceTree = SOURCE_ROOT; }; - 73814B270907FC9900C478FC /* high_lsp_tables.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = high_lsp_tables.c; path = ../libspeex/high_lsp_tables.c; sourceTree = SOURCE_ROOT; }; - 73814B290907FC9900C478FC /* lbr_48k_tables.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lbr_48k_tables.c; path = ../libspeex/lbr_48k_tables.c; sourceTree = SOURCE_ROOT; }; - 73814B2A0907FC9900C478FC /* lpc_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = lpc_bfin.h; path = ../libspeex/lpc_bfin.h; sourceTree = SOURCE_ROOT; }; - 73814B2B0907FC9900C478FC /* lpc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lpc.c; path = ../libspeex/lpc.c; sourceTree = SOURCE_ROOT; }; - 73814B2C0907FC9900C478FC /* lpc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = lpc.h; path = ../libspeex/lpc.h; sourceTree = SOURCE_ROOT; }; - 73814B2D0907FC9900C478FC /* lsp_tables_nb.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lsp_tables_nb.c; path = ../libspeex/lsp_tables_nb.c; sourceTree = SOURCE_ROOT; }; - 73814B2E0907FC9900C478FC /* lsp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lsp.c; path = ../libspeex/lsp.c; sourceTree = SOURCE_ROOT; }; - 73814B2F0907FC9900C478FC /* lsp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = lsp.h; path = ../libspeex/lsp.h; sourceTree = SOURCE_ROOT; }; - 73814B300907FC9900C478FC /* ltp_arm4.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ltp_arm4.h; path = ../libspeex/ltp_arm4.h; sourceTree = SOURCE_ROOT; }; - 73814B310907FC9900C478FC /* ltp_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ltp_bfin.h; path = ../libspeex/ltp_bfin.h; sourceTree = SOURCE_ROOT; }; - 73814B320907FC9900C478FC /* ltp_sse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ltp_sse.h; path = ../libspeex/ltp_sse.h; sourceTree = SOURCE_ROOT; }; - 73814B330907FC9900C478FC /* ltp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ltp.c; path = ../libspeex/ltp.c; sourceTree = SOURCE_ROOT; }; - 73814B340907FC9900C478FC /* ltp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ltp.h; path = ../libspeex/ltp.h; sourceTree = SOURCE_ROOT; }; - 73814B370907FC9900C478FC /* math_approx.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = math_approx.c; path = ../libspeex/math_approx.c; sourceTree = SOURCE_ROOT; }; - 73814B380907FC9900C478FC /* math_approx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = math_approx.h; path = ../libspeex/math_approx.h; sourceTree = SOURCE_ROOT; }; - 73814B3A0907FC9900C478FC /* misc_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = misc_bfin.h; path = ../libspeex/misc_bfin.h; sourceTree = SOURCE_ROOT; }; - 73814B3B0907FC9900C478FC /* misc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = misc.c; path = ../libspeex/misc.c; sourceTree = SOURCE_ROOT; }; - 73814B3C0907FC9900C478FC /* misc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = misc.h; path = ../libspeex/misc.h; sourceTree = SOURCE_ROOT; }; - 73814B3D0907FC9900C478FC /* modes.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = modes.c; path = ../libspeex/modes.c; sourceTree = SOURCE_ROOT; }; - 73814B3E0907FC9900C478FC /* modes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = modes.h; path = ../libspeex/modes.h; sourceTree = SOURCE_ROOT; }; - 73814B3F0907FC9900C478FC /* nb_celp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = nb_celp.c; path = ../libspeex/nb_celp.c; sourceTree = SOURCE_ROOT; }; - 73814B400907FC9900C478FC /* nb_celp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = nb_celp.h; path = ../libspeex/nb_celp.h; sourceTree = SOURCE_ROOT; }; - 73814B420907FC9900C478FC /* quant_lsp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = quant_lsp.c; path = ../libspeex/quant_lsp.c; sourceTree = SOURCE_ROOT; }; - 73814B430907FC9900C478FC /* quant_lsp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = quant_lsp.h; path = ../libspeex/quant_lsp.h; sourceTree = SOURCE_ROOT; }; - 73814B440907FC9900C478FC /* sb_celp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sb_celp.c; path = ../libspeex/sb_celp.c; sourceTree = SOURCE_ROOT; }; - 73814B450907FC9900C478FC /* sb_celp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sb_celp.h; path = ../libspeex/sb_celp.h; sourceTree = SOURCE_ROOT; }; - 73814B460907FC9900C478FC /* smallft.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = smallft.c; path = ../libspeex/smallft.c; sourceTree = SOURCE_ROOT; }; - 73814B470907FC9900C478FC /* smallft.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = smallft.h; path = ../libspeex/smallft.h; sourceTree = SOURCE_ROOT; }; - 73814B480907FC9900C478FC /* speex_callbacks.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = speex_callbacks.c; path = ../libspeex/speex_callbacks.c; sourceTree = SOURCE_ROOT; }; - 73814B490907FC9900C478FC /* speex_header.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = speex_header.c; path = ../libspeex/speex_header.c; sourceTree = SOURCE_ROOT; }; - 73814B4A0907FC9900C478FC /* speex.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = speex.c; path = ../libspeex/speex.c; sourceTree = SOURCE_ROOT; }; - 73814B4B0907FC9900C478FC /* stack_alloc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = stack_alloc.h; path = ../libspeex/stack_alloc.h; sourceTree = SOURCE_ROOT; }; - 73814B4C0907FC9900C478FC /* stereo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = stereo.c; path = ../libspeex/stereo.c; sourceTree = SOURCE_ROOT; }; - 73814B4F0907FC9900C478FC /* testenc_uwb.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testenc_uwb.c; path = ../libspeex/testenc_uwb.c; sourceTree = SOURCE_ROOT; }; - 73814B500907FC9900C478FC /* testenc_wb.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testenc_wb.c; path = ../libspeex/testenc_wb.c; sourceTree = SOURCE_ROOT; }; - 73814B510907FC9900C478FC /* testenc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testenc.c; path = ../libspeex/testenc.c; sourceTree = SOURCE_ROOT; }; - 73814B520907FC9900C478FC /* vbr.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = vbr.c; path = ../libspeex/vbr.c; sourceTree = SOURCE_ROOT; }; - 73814B530907FC9900C478FC /* vbr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = vbr.h; path = ../libspeex/vbr.h; sourceTree = SOURCE_ROOT; }; - 73814B540907FC9900C478FC /* vq_arm4.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = vq_arm4.h; path = ../libspeex/vq_arm4.h; sourceTree = SOURCE_ROOT; }; - 73814B550907FC9900C478FC /* vq_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = vq_bfin.h; path = ../libspeex/vq_bfin.h; sourceTree = SOURCE_ROOT; }; - 73814B560907FC9900C478FC /* vq_sse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = vq_sse.h; path = ../libspeex/vq_sse.h; sourceTree = SOURCE_ROOT; }; - 73814B570907FC9900C478FC /* vq.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = vq.c; path = ../libspeex/vq.c; sourceTree = SOURCE_ROOT; }; - 73814B580907FC9900C478FC /* vq.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = vq.h; path = ../libspeex/vq.h; sourceTree = SOURCE_ROOT; }; - 8D07F2C70486CC7A007CD1D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D07F2C80486CC7A007CD1D0 /* Speex.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Speex.framework; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D07F2C30486CC7A007CD1D0 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 034768DDFF38A45A11DB9C8B /* Products */ = { - isa = PBXGroup; - children = ( - 8D07F2C80486CC7A007CD1D0 /* Speex.framework */, - ); - name = Products; - sourceTree = ""; - }; - 0867D691FE84028FC02AAC07 /* Speex */ = { - isa = PBXGroup; - children = ( - 08FB77ACFE841707C02AAC07 /* Source */, - 73814AEB0907FB6400C478FC /* Headers */, - 089C1665FE841158C02AAC07 /* Resources */, - 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */, - 034768DDFF38A45A11DB9C8B /* Products */, - ); - name = Speex; - sourceTree = ""; - }; - 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = { - isa = PBXGroup; - children = ( - ); - name = "External Frameworks and Libraries"; - sourceTree = ""; - }; - 089C1665FE841158C02AAC07 /* Resources */ = { - isa = PBXGroup; - children = ( - 8D07F2C70486CC7A007CD1D0 /* Info.plist */, - 089C1666FE841158C02AAC07 /* InfoPlist.strings */, - ); - name = Resources; - sourceTree = ""; - }; - 08FB77ACFE841707C02AAC07 /* Source */ = { - isa = PBXGroup; - children = ( - 73814B0C0907FC9900C478FC /* arch.h */, - 73814B0D0907FC9900C478FC /* bits.c */, - 73814B0E0907FC9900C478FC /* cb_search_arm4.h */, - 73814B0F0907FC9900C478FC /* cb_search_bfin.h */, - 73814B100907FC9900C478FC /* cb_search_sse.h */, - 73814B110907FC9900C478FC /* cb_search.c */, - 73814B120907FC9900C478FC /* cb_search.h */, - 73814B130907FC9900C478FC /* exc_5_64_table.c */, - 73814B140907FC9900C478FC /* exc_5_256_table.c */, - 73814B150907FC9900C478FC /* exc_8_128_table.c */, - 73814B160907FC9900C478FC /* exc_10_16_table.c */, - 73814B170907FC9900C478FC /* exc_10_32_table.c */, - 73814B180907FC9900C478FC /* exc_20_32_table.c */, - 73814B190907FC9900C478FC /* filters_arm4.h */, - 73814B1A0907FC9900C478FC /* filters_bfin.h */, - 73814B1B0907FC9900C478FC /* filters_sse.h */, - 73814B1C0907FC9900C478FC /* filters.c */, - 73814B1D0907FC9900C478FC /* filters.h */, - 73814B1E0907FC9900C478FC /* fixed_arm4.h */, - 73814B1F0907FC9900C478FC /* fixed_arm5e.h */, - 73814B200907FC9900C478FC /* fixed_bfin.h */, - 73814B210907FC9900C478FC /* fixed_debug.h */, - 73814B220907FC9900C478FC /* fixed_generic.h */, - 73814B230907FC9900C478FC /* gain_table_lbr.c */, - 73814B240907FC9900C478FC /* gain_table.c */, - 73814B250907FC9900C478FC /* hexc_10_32_table.c */, - 73814B260907FC9900C478FC /* hexc_table.c */, - 73814B270907FC9900C478FC /* high_lsp_tables.c */, - 73814B290907FC9900C478FC /* lbr_48k_tables.c */, - 73814B2A0907FC9900C478FC /* lpc_bfin.h */, - 73814B2B0907FC9900C478FC /* lpc.c */, - 73814B2C0907FC9900C478FC /* lpc.h */, - 73814B2D0907FC9900C478FC /* lsp_tables_nb.c */, - 73814B2E0907FC9900C478FC /* lsp.c */, - 73814B2F0907FC9900C478FC /* lsp.h */, - 73814B300907FC9900C478FC /* ltp_arm4.h */, - 73814B310907FC9900C478FC /* ltp_bfin.h */, - 73814B320907FC9900C478FC /* ltp_sse.h */, - 73814B330907FC9900C478FC /* ltp.c */, - 73814B340907FC9900C478FC /* ltp.h */, - 73814B370907FC9900C478FC /* math_approx.c */, - 73814B380907FC9900C478FC /* math_approx.h */, - 73814B3A0907FC9900C478FC /* misc_bfin.h */, - 73814B3B0907FC9900C478FC /* misc.c */, - 73814B3C0907FC9900C478FC /* misc.h */, - 73814B3D0907FC9900C478FC /* modes.c */, - 73814B3E0907FC9900C478FC /* modes.h */, - 73814B3F0907FC9900C478FC /* nb_celp.c */, - 73814B400907FC9900C478FC /* nb_celp.h */, - 73814B420907FC9900C478FC /* quant_lsp.c */, - 73814B430907FC9900C478FC /* quant_lsp.h */, - 73814B440907FC9900C478FC /* sb_celp.c */, - 73814B450907FC9900C478FC /* sb_celp.h */, - 73814B460907FC9900C478FC /* smallft.c */, - 73814B470907FC9900C478FC /* smallft.h */, - 73814B480907FC9900C478FC /* speex_callbacks.c */, - 73814B490907FC9900C478FC /* speex_header.c */, - 73814B4A0907FC9900C478FC /* speex.c */, - 73814B4B0907FC9900C478FC /* stack_alloc.h */, - 73814B4C0907FC9900C478FC /* stereo.c */, - 73814B4F0907FC9900C478FC /* testenc_uwb.c */, - 73814B500907FC9900C478FC /* testenc_wb.c */, - 73814B510907FC9900C478FC /* testenc.c */, - 73814B520907FC9900C478FC /* vbr.c */, - 73814B530907FC9900C478FC /* vbr.h */, - 73814B540907FC9900C478FC /* vq_arm4.h */, - 73814B550907FC9900C478FC /* vq_bfin.h */, - 73814B560907FC9900C478FC /* vq_sse.h */, - 73814B570907FC9900C478FC /* vq.c */, - 73814B580907FC9900C478FC /* vq.h */, - 32BAE0B70371A74B00C91783 /* Speex_Prefix.pch */, - ); - name = Source; - sourceTree = ""; - }; - 73814AEB0907FB6400C478FC /* Headers */ = { - isa = PBXGroup; - children = ( - 73814AEC0907FB8200C478FC /* speex */, - ); - name = Headers; - sourceTree = ""; - }; - 73814AEC0907FB8200C478FC /* speex */ = { - isa = PBXGroup; - children = ( - 73814AEF0907FB8200C478FC /* speex.h */, - 73814AF00907FB8200C478FC /* speex_bits.h */, - 73814AF10907FB8200C478FC /* speex_callbacks.h */, - 73814AF40907FB8200C478FC /* speex_header.h */, - 73814AF70907FB8200C478FC /* speex_stereo.h */, - 73814AF80907FB8200C478FC /* speex_types.h */, - ); - name = speex; - path = ../include/speex; - sourceTree = SOURCE_ROOT; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 8D07F2BD0486CC7A007CD1D0 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 73814B000907FB8200C478FC /* speex_header.h in Headers */, - 73814B030907FB8200C478FC /* speex_stereo.h in Headers */, - 73814B040907FB8200C478FC /* speex_types.h in Headers */, - 73814B060907FBAB00C478FC /* speex_callbacks.h in Headers */, - 73814B070907FBAD00C478FC /* speex_bits.h in Headers */, - 73814B080907FBAE00C478FC /* speex.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 8D07F2BC0486CC7A007CD1D0 /* Speex */ = { - isa = PBXNativeTarget; - buildConfigurationList = 73814ADF0907FB1E00C478FC /* Build configuration list for PBXNativeTarget "Speex" */; - buildPhases = ( - 8D07F2BD0486CC7A007CD1D0 /* Headers */, - 8D07F2BF0486CC7A007CD1D0 /* Resources */, - 8D07F2C10486CC7A007CD1D0 /* Sources */, - 8D07F2C30486CC7A007CD1D0 /* Frameworks */, - 8D07F2C50486CC7A007CD1D0 /* Rez */, - ); - buildRules = ( - ); - buildSettings = { - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_VERSION = A; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Speex_Prefix.pch; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Library/Frameworks"; - LIBRARY_STYLE = DYNAMIC; - PRODUCT_NAME = Speex; - WRAPPER_EXTENSION = framework; - }; - dependencies = ( - ); - name = Speex; - productInstallPath = "$(HOME)/Library/Frameworks"; - productName = Speex; - productReference = 8D07F2C80486CC7A007CD1D0 /* Speex.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 0867D690FE84028FC02AAC07 /* Project object */ = { - isa = PBXProject; - buildConfigurationList = 73814AE30907FB1E00C478FC /* Build configuration list for PBXProject "Speex_UB" */; - buildSettings = { - }; - buildStyles = ( - 4F0BB7EC011F40E904CA0E50 /* Development */, - 4F0BB7ED011F40E904CA0E50 /* Deployment */, - ); - hasScannedForEncodings = 1; - mainGroup = 0867D691FE84028FC02AAC07 /* Speex */; - productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */; - projectDirPath = ""; - targets = ( - 8D07F2BC0486CC7A007CD1D0 /* Speex */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D07F2BF0486CC7A007CD1D0 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D07F2C00486CC7A007CD1D0 /* InfoPlist.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXRezBuildPhase section */ - 8D07F2C50486CC7A007CD1D0 /* Rez */ = { - isa = PBXRezBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXRezBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D07F2C10486CC7A007CD1D0 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 73814B5A0907FC9900C478FC /* bits.c in Sources */, - 73814B5E0907FC9900C478FC /* cb_search.c in Sources */, - 73814B600907FC9900C478FC /* exc_5_64_table.c in Sources */, - 73814B610907FC9900C478FC /* exc_5_256_table.c in Sources */, - 73814B620907FC9900C478FC /* exc_8_128_table.c in Sources */, - 73814B630907FC9900C478FC /* exc_10_16_table.c in Sources */, - 73814B640907FC9900C478FC /* exc_10_32_table.c in Sources */, - 73814B650907FC9900C478FC /* exc_20_32_table.c in Sources */, - 73814B690907FC9900C478FC /* filters.c in Sources */, - 73814B700907FC9900C478FC /* gain_table_lbr.c in Sources */, - 73814B710907FC9900C478FC /* gain_table.c in Sources */, - 73814B720907FC9900C478FC /* hexc_10_32_table.c in Sources */, - 73814B730907FC9900C478FC /* hexc_table.c in Sources */, - 73814B740907FC9900C478FC /* high_lsp_tables.c in Sources */, - 73814B760907FC9900C478FC /* lbr_48k_tables.c in Sources */, - 73814B780907FC9900C478FC /* lpc.c in Sources */, - 73814B7A0907FC9900C478FC /* lsp_tables_nb.c in Sources */, - 73814B7B0907FC9900C478FC /* lsp.c in Sources */, - 73814B800907FC9900C478FC /* ltp.c in Sources */, - 73814B840907FC9900C478FC /* math_approx.c in Sources */, - 73814B880907FC9900C478FC /* misc.c in Sources */, - 73814B8A0907FC9900C478FC /* modes.c in Sources */, - 73814B8C0907FC9900C478FC /* nb_celp.c in Sources */, - 73814B8F0907FC9900C478FC /* quant_lsp.c in Sources */, - 73814B910907FC9900C478FC /* sb_celp.c in Sources */, - 73814B930907FC9900C478FC /* smallft.c in Sources */, - 73814B950907FC9900C478FC /* speex_callbacks.c in Sources */, - 73814B960907FC9900C478FC /* speex_header.c in Sources */, - 73814B970907FC9900C478FC /* speex.c in Sources */, - 73814B990907FC9900C478FC /* stereo.c in Sources */, - 73814B9F0907FC9900C478FC /* vbr.c in Sources */, - 73814BA40907FC9900C478FC /* vq.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 089C1666FE841158C02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C1667FE841158C02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 73814AE00907FB1E00C478FC /* Development */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_VERSION = A; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Speex_Prefix.pch; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = /Library/Frameworks; - LIBRARY_STYLE = DYNAMIC; - MACH_O_TYPE = mh_dylib; - PRODUCT_NAME = Speex; - WRAPPER_EXTENSION = framework; - ZERO_LINK = YES; - }; - name = Development; - }; - 73814AE10907FB1E00C478FC /* Deployment */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_VERSION = A; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Speex_Prefix.pch; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = /Library/Frameworks; - LIBRARY_STYLE = DYNAMIC; - MACH_O_TYPE = mh_dylib; - PRODUCT_NAME = Speex; - WRAPPER_EXTENSION = framework; - ZERO_LINK = NO; - }; - name = Deployment; - }; - 73814AE20907FB1E00C478FC /* Default */ = { - isa = XCBuildConfiguration; - buildSettings = { - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_VERSION = A; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Speex_Prefix.pch; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = /Library/Frameworks; - LIBRARY_STYLE = DYNAMIC; - MACH_O_TYPE = mh_dylib; - PRODUCT_NAME = Speex; - WRAPPER_EXTENSION = framework; - }; - name = Default; - }; - 73814AE40907FB1E00C478FC /* Development */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - GCC_PREPROCESSOR_DEFINITIONS = __MACOSX__; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Development; - }; - 73814AE50907FB1E00C478FC /* Deployment */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - GCC_PREPROCESSOR_DEFINITIONS = __MACOSX__; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Deployment; - }; - 73814AE60907FB1E00C478FC /* Default */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - GCC_PREPROCESSOR_DEFINITIONS = __MACOSX__; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Default; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 73814ADF0907FB1E00C478FC /* Build configuration list for PBXNativeTarget "Speex" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 73814AE00907FB1E00C478FC /* Development */, - 73814AE10907FB1E00C478FC /* Deployment */, - 73814AE20907FB1E00C478FC /* Default */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; - }; - 73814AE30907FB1E00C478FC /* Build configuration list for PBXProject "Speex_UB" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 73814AE40907FB1E00C478FC /* Development */, - 73814AE50907FB1E00C478FC /* Deployment */, - 73814AE60907FB1E00C478FC /* Default */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; - }; -/* End XCConfigurationList section */ - }; - rootObject = 0867D690FE84028FC02AAC07 /* Project object */; -} diff --git a/Engine/lib/speex/speex.m4 b/Engine/lib/speex/speex.m4 deleted file mode 100644 index be144e1fa..000000000 --- a/Engine/lib/speex/speex.m4 +++ /dev/null @@ -1,104 +0,0 @@ -# Configure paths for libspeex -# Jean-Marc Valin -# Shamelessly stolen from: -# Jack Moffitt 10-21-2000 -# Shamelessly stolen from Owen Taylor and Manish Singh - -dnl XIPH_PATH_SPEEX([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) -dnl Test for libspeex, and define SPEEX_CFLAGS and SPEEX_LIBS -dnl -AC_DEFUN([XIPH_PATH_SPEEX], -[dnl -dnl Get the cflags and libraries -dnl -AC_ARG_WITH(speex,[ --with-speex=PFX Prefix where libspeex is installed (optional)], speex_prefix="$withval", speex_prefix="") -AC_ARG_WITH(speex-libraries,[ --with-speex-libraries=DIR Directory where libspeex library is installed (optional)], speex_libraries="$withval", speex_libraries="") -AC_ARG_WITH(speex-includes,[ --with-speex-includes=DIR Directory where libspeex header files are installed (optional)], speex_includes="$withval", speex_includes="") -AC_ARG_ENABLE(speextest, [ --disable-speextest Do not try to compile and run a test Speex program],, enable_speextest=yes) - - if test "x$speex_libraries" != "x" ; then - SPEEX_LIBS="-L$speex_libraries" - elif test "x$speex_prefix" != "x" ; then - SPEEX_LIBS="-L$speex_prefix/lib" - elif test "x$prefix" != "xNONE" ; then - SPEEX_LIBS="-L$prefix/lib" - fi - - SPEEX_LIBS="$SPEEX_LIBS -lspeex" - - if test "x$speex_includes" != "x" ; then - SPEEX_CFLAGS="-I$speex_includes" - elif test "x$speex_prefix" != "x" ; then - SPEEX_CFLAGS="-I$speex_prefix/include" - elif test "x$prefix" != "xNONE"; then - SPEEX_CFLAGS="-I$prefix/include" - fi - - AC_MSG_CHECKING(for Speex) - no_speex="" - - - if test "x$enable_speextest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $SPEEX_CFLAGS" - LIBS="$LIBS $SPEEX_LIBS" -dnl -dnl Now check if the installed Speex is sufficiently new. -dnl - rm -f conf.speextest - AC_TRY_RUN([ -#include -#include -#include -#include - -int main () -{ - system("touch conf.speextest"); - return 0; -} - -],, no_speex=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - - if test "x$no_speex" = "x" ; then - AC_MSG_RESULT(yes) - ifelse([$1], , :, [$1]) - else - AC_MSG_RESULT(no) - if test -f conf.speextest ; then - : - else - echo "*** Could not run Speex test program, checking why..." - CFLAGS="$CFLAGS $SPEEX_CFLAGS" - LIBS="$LIBS $SPEEX_LIBS" - AC_TRY_LINK([ -#include -#include -], [ return 0; ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding Speex or finding the wrong" - echo "*** version of Speex. If it is not finding Speex, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means Speex was incorrectly installed" - echo "*** or that you have moved Speex since it was installed." ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - SPEEX_CFLAGS="" - SPEEX_LIBS="" - ifelse([$2], , :, [$2]) - fi - AC_SUBST(SPEEX_CFLAGS) - AC_SUBST(SPEEX_LIBS) - rm -f conf.speextest -]) diff --git a/Engine/lib/speex/speex.pc.in b/Engine/lib/speex/speex.pc.in deleted file mode 100644 index 97bba4ff9..000000000 --- a/Engine/lib/speex/speex.pc.in +++ /dev/null @@ -1,15 +0,0 @@ -# libspeex pkg-config source file - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: speex -Description: Speex is an audio codec tuned for speech -Version: @SPEEX_VERSION@ -Requires: -Conflicts: -Libs: -L${libdir} -lspeex -Libs.private: @LIBM@ -Cflags: -I${includedir} diff --git a/Engine/lib/speex/speexclient/README b/Engine/lib/speex/speexclient/README deleted file mode 100644 index 69140d322..000000000 --- a/Engine/lib/speex/speexclient/README +++ /dev/null @@ -1,18 +0,0 @@ -This is a VERY SIMPLE Speex VoIP client. It is not a complete VoIP application, -isn't compatible with anything else (including probably future versions of -itself) and does not support any form of standard protocols. It is intended -only as a way to show how to use Speex in a VoIP application. - -To use it: - -On Alices machine: -% speexclient plughw:0,0 bob.somewhere.net alice_port bob_port - -On Bob's machine: -% speexclient plughw:0,0 alice.somewhere.net bob_port alice_port - -where bob_port is the UDP port on which bob receives and alice_port is the -UDP port on which alice receives. In most cases, the two ports can be the same. - -Note that the clients do not even know whether they are connected or not. All -they do is send/receive the audio to/from a specific port. diff --git a/Engine/lib/speex/speexclient/alsa_device.c b/Engine/lib/speex/speexclient/alsa_device.c deleted file mode 100644 index 90b9fe426..000000000 --- a/Engine/lib/speex/speexclient/alsa_device.c +++ /dev/null @@ -1,431 +0,0 @@ -/* - Copyright (C) 2004-2006 Jean-Marc Valin - Copyright (C) 2006 Commonwealth Scientific and Industrial Research - Organisation (CSIRO) Australia - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "alsa_device.h" -#include -#include - -struct AlsaDevice_ { - char *device_name; - int channels; - int period; - snd_pcm_t *capture_handle; - snd_pcm_t *playback_handle; - int readN, writeN; - struct pollfd *read_fd, *write_fd; -}; - -AlsaDevice *alsa_device_open(char *device_name, unsigned int rate, int channels, int period) -{ - int dir; - int err; - snd_pcm_hw_params_t *hw_params; - snd_pcm_sw_params_t *sw_params; - snd_pcm_uframes_t period_size = period; - snd_pcm_uframes_t buffer_size = 2*period; - static snd_output_t *jcd_out; - AlsaDevice *dev = malloc(sizeof(*dev)); - if (!dev) - return NULL; - dev->device_name = malloc(1+strlen(device_name)); - if (!dev->device_name) - { - free(dev); - return NULL; - } - strcpy(dev->device_name, device_name); - dev->channels = channels; - dev->period = period; - err = snd_output_stdio_attach(&jcd_out, stdout, 0); - - if ((err = snd_pcm_open (&dev->capture_handle, dev->device_name, SND_PCM_STREAM_CAPTURE, 0)) < 0) { - fprintf (stderr, "cannot open audio device %s (%s)\n", - dev->device_name, - snd_strerror (err)); - assert(0); - } - - if ((err = snd_pcm_hw_params_malloc (&hw_params)) < 0) { - fprintf (stderr, "cannot allocate hardware parameter structure (%s)\n", - snd_strerror (err)); - assert(0); - } - - if ((err = snd_pcm_hw_params_any (dev->capture_handle, hw_params)) < 0) { - fprintf (stderr, "cannot initialize hardware parameter structure (%s)\n", - snd_strerror (err)); - assert(0); - } - - if ((err = snd_pcm_hw_params_set_access (dev->capture_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) { - fprintf (stderr, "cannot set access type (%s)\n", - snd_strerror (err)); - assert(0); - } - - if ((err = snd_pcm_hw_params_set_format (dev->capture_handle, hw_params, SND_PCM_FORMAT_S16_LE)) < 0) { - fprintf (stderr, "cannot set sample format (%s)\n", - snd_strerror (err)); - assert(0); - } - - if ((err = snd_pcm_hw_params_set_rate_near (dev->capture_handle, hw_params, &rate, 0)) < 0) { - fprintf (stderr, "cannot set sample rate (%s)\n", - snd_strerror (err)); - assert(0); - } - /*fprintf (stderr, "rate = %d\n", rate);*/ - - if ((err = snd_pcm_hw_params_set_channels (dev->capture_handle, hw_params, channels)) < 0) { - fprintf (stderr, "cannot set channel count (%s)\n", - snd_strerror (err)); - assert(0); - } - - period_size = period; - dir = 0; - if ((err = snd_pcm_hw_params_set_period_size_near (dev->capture_handle, hw_params, &period_size, &dir)) < 0) { - fprintf (stderr, "cannot set period size (%s)\n", - snd_strerror (err)); - assert(0); - } - - if ((err = snd_pcm_hw_params_set_periods (dev->capture_handle, hw_params, 2, 0)) < 0) { - fprintf (stderr, "cannot set number of periods (%s)\n", - snd_strerror (err)); - assert(0); - } - - buffer_size = period_size * 2; - dir=0; - if ((err = snd_pcm_hw_params_set_buffer_size_near (dev->capture_handle, hw_params, &buffer_size)) < 0) { - fprintf (stderr, "cannot set buffer time (%s)\n", - snd_strerror (err)); - assert(0); - } - - if ((err = snd_pcm_hw_params (dev->capture_handle, hw_params)) < 0) { - fprintf (stderr, "cannot set capture parameters (%s)\n", - snd_strerror (err)); - assert(0); - } - /*snd_pcm_dump_setup(dev->capture_handle, jcd_out);*/ - snd_pcm_hw_params_free (hw_params); - - if ((err = snd_pcm_sw_params_malloc (&sw_params)) < 0) { - fprintf (stderr, "cannot allocate software parameters structure (%s)\n", - snd_strerror (err)); - assert(0); - } - if ((err = snd_pcm_sw_params_current (dev->capture_handle, sw_params)) < 0) { - fprintf (stderr, "cannot initialize software parameters structure (%s)\n", - snd_strerror (err)); - assert(0); - } - if ((err = snd_pcm_sw_params_set_avail_min (dev->capture_handle, sw_params, period)) < 0) { - fprintf (stderr, "cannot set minimum available count (%s)\n", - snd_strerror (err)); - assert(0); - } - if ((err = snd_pcm_sw_params (dev->capture_handle, sw_params)) < 0) { - fprintf (stderr, "cannot set software parameters (%s)\n", - snd_strerror (err)); - assert(0); - } - - - if ((err = snd_pcm_open (&dev->playback_handle, dev->device_name, SND_PCM_STREAM_PLAYBACK, 0)) < 0) { - fprintf (stderr, "cannot open audio device %s (%s)\n", - dev->device_name, - snd_strerror (err)); - assert(0); - } - - if ((err = snd_pcm_hw_params_malloc (&hw_params)) < 0) { - fprintf (stderr, "cannot allocate hardware parameter structure (%s)\n", - snd_strerror (err)); - assert(0); - } - - if ((err = snd_pcm_hw_params_any (dev->playback_handle, hw_params)) < 0) { - fprintf (stderr, "cannot initialize hardware parameter structure (%s)\n", - snd_strerror (err)); - assert(0); - } - - if ((err = snd_pcm_hw_params_set_access (dev->playback_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) { - fprintf (stderr, "cannot set access type (%s)\n", - snd_strerror (err)); - assert(0); - } - - if ((err = snd_pcm_hw_params_set_format (dev->playback_handle, hw_params, SND_PCM_FORMAT_S16_LE)) < 0) { - fprintf (stderr, "cannot set sample format (%s)\n", - snd_strerror (err)); - assert(0); - } - - if ((err = snd_pcm_hw_params_set_rate_near (dev->playback_handle, hw_params, &rate, 0)) < 0) { - fprintf (stderr, "cannot set sample rate (%s)\n", - snd_strerror (err)); - assert(0); - } - /*fprintf (stderr, "rate = %d\n", rate);*/ - - if ((err = snd_pcm_hw_params_set_channels (dev->playback_handle, hw_params, channels)) < 0) { - fprintf (stderr, "cannot set channel count (%s)\n", - snd_strerror (err)); - assert(0); - } - - period_size = period; - dir = 0; - if ((err = snd_pcm_hw_params_set_period_size_near (dev->playback_handle, hw_params, &period_size, &dir)) < 0) { - fprintf (stderr, "cannot set period size (%s)\n", - snd_strerror (err)); - assert(0); - } - if ((err = snd_pcm_hw_params_set_periods (dev->playback_handle, hw_params, 2, 0)) < 0) { - fprintf (stderr, "cannot set number of periods (%s)\n", - snd_strerror (err)); - assert(0); - } - buffer_size = period_size * 2; - dir=0; - if ((err = snd_pcm_hw_params_set_buffer_size_near (dev->playback_handle, hw_params, &buffer_size)) < 0) { - fprintf (stderr, "cannot set buffer time (%s)\n", - snd_strerror (err)); - assert(0); - } - - - if ((err = snd_pcm_hw_params (dev->playback_handle, hw_params)) < 0) { - fprintf (stderr, "cannot set playback parameters (%s)\n", - snd_strerror (err)); - assert(0); - } - - /*snd_pcm_dump_setup(dev->playback_handle, jcd_out);*/ - snd_pcm_hw_params_free (hw_params); - - - if ((err = snd_pcm_sw_params_malloc (&sw_params)) < 0) { - fprintf (stderr, "cannot allocate software parameters structure (%s)\n", - snd_strerror (err)); - assert(0); - } - if ((err = snd_pcm_sw_params_current (dev->playback_handle, sw_params)) < 0) { - fprintf (stderr, "cannot initialize software parameters structure (%s)\n", - snd_strerror (err)); - assert(0); - } - if ((err = snd_pcm_sw_params_set_avail_min (dev->playback_handle, sw_params, period)) < 0) { - fprintf (stderr, "cannot set minimum available count (%s)\n", - snd_strerror (err)); - assert(0); - } - if ((err = snd_pcm_sw_params_set_start_threshold (dev->playback_handle, sw_params, period)) < 0) { - fprintf (stderr, "cannot set start mode (%s)\n", - snd_strerror (err)); - assert(0); - } - if ((err = snd_pcm_sw_params (dev->playback_handle, sw_params)) < 0) { - fprintf (stderr, "cannot set software parameters (%s)\n", - snd_strerror (err)); - assert(0); - } - - - snd_pcm_link(dev->capture_handle, dev->playback_handle); - if ((err = snd_pcm_prepare (dev->capture_handle)) < 0) { - fprintf (stderr, "cannot prepare audio interface for use (%s)\n", - snd_strerror (err)); - assert(0); - } - if ((err = snd_pcm_prepare (dev->playback_handle)) < 0) { - fprintf (stderr, "cannot prepare audio interface for use (%s)\n", - snd_strerror (err)); - assert(0); - } - - dev->readN = snd_pcm_poll_descriptors_count(dev->capture_handle); - dev->writeN = snd_pcm_poll_descriptors_count(dev->playback_handle); - - dev->read_fd = malloc(dev->readN*sizeof(*dev->read_fd)); - /*printf ("descriptors: %d %d\n", dev->readN, dev->writeN);*/ - if (snd_pcm_poll_descriptors(dev->capture_handle, dev->read_fd, dev->readN) != dev->readN) - { - fprintf (stderr, "cannot obtain capture file descriptors (%s)\n", - snd_strerror (err)); - assert(0); - } - - dev->write_fd = malloc(dev->writeN*sizeof(*dev->read_fd)); - if (snd_pcm_poll_descriptors(dev->playback_handle, dev->write_fd, dev->writeN) != dev->writeN) - { - fprintf (stderr, "cannot obtain playback file descriptors (%s)\n", - snd_strerror (err)); - assert(0); - } - return dev; -} - -void alsa_device_close(AlsaDevice *dev) -{ - snd_pcm_close(dev->capture_handle); - snd_pcm_close(dev->playback_handle); - free(dev->device_name); - free(dev); -} - -int alsa_device_read(AlsaDevice *dev, short *pcm, int len) -{ - int err; - /*fprintf (stderr, "-");*/ - if ((err = snd_pcm_readi (dev->capture_handle, pcm, len)) != len) - { - if (err<0) - { - //fprintf(stderr, "error %d, EPIPE = %d\n", err, EPIPE); - if (err == -EPIPE) - { - fprintf (stderr, "An overrun has occured, reseting capture\n"); - } else - { - fprintf (stderr, "read from audio interface failed (%s)\n", - snd_strerror (err)); - } - if ((err = snd_pcm_prepare (dev->capture_handle)) < 0) - { - fprintf (stderr, "cannot prepare audio interface for use (%s)\n", - snd_strerror (err)); - } - if ((err = snd_pcm_start (dev->capture_handle)) < 0) - { - fprintf (stderr, "cannot prepare audio interface for use (%s)\n", - snd_strerror (err)); - } - /*alsa_device_read(dev,pcm,len);*/ - } else { - fprintf (stderr, "Couldn't read as many samples as I wanted (%d instead of %d)\n", err, len); - } - return 1; - } - return 0; -} - -int alsa_device_write(AlsaDevice *dev, const short *pcm, int len) -{ - int err; - /*fprintf (stderr, "+");*/ - if ((err = snd_pcm_writei (dev->playback_handle, pcm, len)) != len) - { - if (err<0) - { - if (err == -EPIPE) - { - fprintf (stderr, "An underrun has occured, reseting playback, len=%d\n", len); - } else - { - fprintf (stderr, "write to audio interface failed (%s)\n", - snd_strerror (err)); - } - if ((err = snd_pcm_prepare (dev->playback_handle)) < 0) - { - fprintf (stderr, "cannot prepare audio interface for use (%s)\n", - snd_strerror (err)); - } - } else { - fprintf (stderr, "Couldn't write as many samples as I wanted (%d instead of %d)\n", err, len); - } - /*alsa_device_write(dev,pcm,len);*/ - return 1; - } - return 0; -} - -int alsa_device_capture_ready(AlsaDevice *dev, struct pollfd *pfds, unsigned int nfds) -{ - unsigned short revents=0; - int err; - if ((err = snd_pcm_poll_descriptors_revents(dev->capture_handle, pfds, dev->readN, &revents)) < 0) - { - //cerr << "error in snd_pcm_poll_descriptors_revents for capture: " << snd_strerror (err) << endl; - //FIXME: This is a kludge - fprintf (stderr, "error in alsa_device_capture_ready: %s\n", snd_strerror (err)); - return pfds[0].revents & POLLIN; - } - //cerr << (revents & POLLERR) << endl; - return revents & POLLIN; -} - -int alsa_device_playback_ready(AlsaDevice *dev, struct pollfd *pfds, unsigned int nfds) -{ - unsigned short revents=0; - int err; - if ((err = snd_pcm_poll_descriptors_revents(dev->playback_handle, pfds+dev->readN, dev->writeN, &revents)) < 0) - { - //cerr << "error in snd_pcm_poll_descriptors_revents for playback: " << snd_strerror (err) << endl; - //FIXME: This is a kludge - fprintf (stderr, "error in alsa_device_playback_ready: %s\n", snd_strerror (err)); - return pfds[1].revents & POLLOUT; - } - //cerr << (revents & POLLERR) << endl; - return revents & POLLOUT; -} - -void alsa_device_start(AlsaDevice *dev) -{ - int i; - short pcm[dev->period*dev->channels]; - for (i=0;iperiod*dev->channels;i++) - pcm[i] = 0; - alsa_device_write(dev, pcm, dev->period); - alsa_device_write(dev, pcm, dev->period); - snd_pcm_start(dev->capture_handle); - snd_pcm_start(dev->playback_handle); -} - -int alsa_device_nfds(AlsaDevice *dev) -{ - return dev->writeN+dev->readN; -} - -void alsa_device_getfds(AlsaDevice *dev, struct pollfd *pfds, unsigned int nfds) -{ - int i; - assert (nfds >= dev->writeN+dev->readN); - for (i=0;ireadN;i++) - pfds[i] = dev->read_fd[i]; - for (i=0;iwriteN;i++) - pfds[i+dev->readN] = dev->write_fd[i]; -} diff --git a/Engine/lib/speex/speexclient/alsa_device.h b/Engine/lib/speex/speexclient/alsa_device.h deleted file mode 100644 index a5b3787a6..000000000 --- a/Engine/lib/speex/speexclient/alsa_device.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - Copyright (C) 2004-2006 Jean-Marc Valin - Copyright (C) 2006 Commonwealth Scientific and Industrial Research - Organisation (CSIRO) Australia - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifndef ALSA_DEVICE_H -#define ALSA_DEVICE_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct AlsaDevice_; - -typedef struct AlsaDevice_ AlsaDevice; - -AlsaDevice *alsa_device_open(char *device_name, unsigned int rate, int channels, int period); - -void alsa_device_close(AlsaDevice *dev); - -int alsa_device_read(AlsaDevice *dev, short *pcm, int len); - -int alsa_device_write(AlsaDevice *dev, const short *pcm, int len); - -int alsa_device_capture_ready(AlsaDevice *dev, struct pollfd *pfds, unsigned int nfds); - -int alsa_device_playback_ready(AlsaDevice *dev, struct pollfd *pfds, unsigned int nfds); - -void alsa_device_start(AlsaDevice *dev); - -int alsa_device_nfds(AlsaDevice *dev); - -void alsa_device_getfds(AlsaDevice *dev, struct pollfd *pfds, unsigned int nfds); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/Engine/lib/speex/speexclient/compile.sh b/Engine/lib/speex/speexclient/compile.sh deleted file mode 100644 index fae58a0b7..000000000 --- a/Engine/lib/speex/speexclient/compile.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -gcc -Wall -I../include speex_jitter_buffer.c speexclient.c alsa_device.c `pkg-config --cflags speexdsp` -o speexclient -lspeex -lspeexdsp -lasound -lm `pkg-config --libs speexdsp` - diff --git a/Engine/lib/speex/speexclient/speex_jitter_buffer.c b/Engine/lib/speex/speexclient/speex_jitter_buffer.c deleted file mode 100644 index aa76d26c7..000000000 --- a/Engine/lib/speex/speexclient/speex_jitter_buffer.c +++ /dev/null @@ -1,91 +0,0 @@ -#include -#include "speex_jitter_buffer.h" - -#ifndef NULL -#define NULL 0 -#endif - - -void speex_jitter_init(SpeexJitter *jitter, void *decoder, int sampling_rate) -{ - jitter->dec = decoder; - speex_decoder_ctl(decoder, SPEEX_GET_FRAME_SIZE, &jitter->frame_size); - - jitter->packets = jitter_buffer_init(jitter->frame_size); - - speex_bits_init(&jitter->current_packet); - jitter->valid_bits = 0; - -} - -void speex_jitter_destroy(SpeexJitter *jitter) -{ - jitter_buffer_destroy(jitter->packets); - speex_bits_destroy(&jitter->current_packet); -} - -void speex_jitter_put(SpeexJitter *jitter, char *packet, int len, int timestamp) -{ - JitterBufferPacket p; - p.data = packet; - p.len = len; - p.timestamp = timestamp; - p.span = jitter->frame_size; - jitter_buffer_put(jitter->packets, &p); -} - -void speex_jitter_get(SpeexJitter *jitter, spx_int16_t *out, int *current_timestamp) -{ - int i; - int ret; - spx_int32_t activity; - char data[2048]; - JitterBufferPacket packet; - packet.data = data; - packet.len = 2048; - - if (jitter->valid_bits) - { - /* Try decoding last received packet */ - ret = speex_decode_int(jitter->dec, &jitter->current_packet, out); - if (ret == 0) - { - jitter_buffer_tick(jitter->packets); - return; - } else { - jitter->valid_bits = 0; - } - } - - ret = jitter_buffer_get(jitter->packets, &packet, jitter->frame_size, NULL); - - if (ret != JITTER_BUFFER_OK) - { - /* No packet found */ - - /*fprintf (stderr, "lost/late frame\n");*/ - /*Packet is late or lost*/ - speex_decode_int(jitter->dec, NULL, out); - } else { - speex_bits_read_from(&jitter->current_packet, packet.data, packet.len); - /* Decode packet */ - ret = speex_decode_int(jitter->dec, &jitter->current_packet, out); - if (ret == 0) - { - jitter->valid_bits = 1; - } else { - /* Error while decoding */ - for (i=0;iframe_size;i++) - out[i]=0; - } - } - speex_decoder_ctl(jitter->dec, SPEEX_GET_ACTIVITY, &activity); - if (activity < 30) - jitter_buffer_update_delay(jitter->packets, &packet, NULL); - jitter_buffer_tick(jitter->packets); -} - -int speex_jitter_get_pointer_timestamp(SpeexJitter *jitter) -{ - return jitter_buffer_get_pointer_timestamp(jitter->packets); -} diff --git a/Engine/lib/speex/speexclient/speex_jitter_buffer.h b/Engine/lib/speex/speexclient/speex_jitter_buffer.h deleted file mode 100644 index 0d81ebba5..000000000 --- a/Engine/lib/speex/speexclient/speex_jitter_buffer.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin */ -/** - @file speex_jitter_buffer.h - @brief Adaptive jitter buffer for Speex packets only -*/ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** @defgroup SpeexJitter SpeexJitter: Adaptive jitter buffer specifically for Speex - * This is the jitter buffer that reorders UDP/RTP packets and adjusts the buffer size - * to maintain good quality and low latency. This is a simplified version that works only - * with Speex, but is much easier to use. - * @{ -*/ - -/** Speex jitter-buffer state. Never use it directly! */ -typedef struct SpeexJitter { - SpeexBits current_packet; /**< Current Speex packet */ - int valid_bits; /**< True if Speex bits are valid */ - JitterBuffer *packets; /**< Generic jitter buffer state */ - void *dec; /**< Pointer to Speex decoder */ - spx_int32_t frame_size; /**< Frame size of Speex decoder */ -} SpeexJitter; - -/** Initialise jitter buffer - * - * @param jitter State of the Speex jitter buffer - * @param decoder Speex decoder to call - * @param sampling_rate Sampling rate used by the decoder -*/ -void speex_jitter_init(SpeexJitter *jitter, void *decoder, int sampling_rate); - -/** Destroy jitter buffer */ -void speex_jitter_destroy(SpeexJitter *jitter); - -/** Put one packet into the jitter buffer */ -void speex_jitter_put(SpeexJitter *jitter, char *packet, int len, int timestamp); - -/** Get one packet from the jitter buffer */ -void speex_jitter_get(SpeexJitter *jitter, spx_int16_t *out, int *start_offset); - -/** Get pointer timestamp of jitter buffer */ -int speex_jitter_get_pointer_timestamp(SpeexJitter *jitter); - -#ifdef __cplusplus -} -#endif - -/* @} */ diff --git a/Engine/lib/speex/speexclient/speexclient.c b/Engine/lib/speex/speexclient/speexclient.c deleted file mode 100644 index 116befe1e..000000000 --- a/Engine/lib/speex/speexclient/speexclient.c +++ /dev/null @@ -1,250 +0,0 @@ -/*************************************************************************** - Copyright (C) 2004-2006 by Jean-Marc Valin - Copyright (C) 2006 Commonwealth Scientific and Industrial Research - Organisation (CSIRO) Australia - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -****************************************************************************/ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include /* close() */ -#include /* memset() */ - -#include "alsa_device.h" -#include -#include -#include -#include -#include "speex_jitter_buffer.h" - -#include - -#define MAX_MSG 1500 - -#define SAMPLING_RATE 16000 -#define FRAME_SIZE 320 - -int main(int argc, char *argv[]) -{ - - int sd, rc, n; - int i; - struct sockaddr_in cliAddr, remoteAddr; - char msg[MAX_MSG]; - struct hostent *h; - int local_port, remote_port; - int nfds; - struct pollfd *pfds; - SpeexPreprocessState *preprocess; - AlsaDevice *audio_dev; - int tmp; - - if (argc != 5) - { - fprintf(stderr, "wrong options\n"); - exit(1); - } - - h = gethostbyname(argv[2]); - if(h==NULL) { - fprintf(stderr, "%s: unknown host '%s' \n", argv[0], argv[1]); - exit(1); - } - - local_port = atoi(argv[3]); - remote_port = atoi(argv[4]); - - printf("%s: sending data to '%s' (IP : %s) \n", argv[0], h->h_name, - inet_ntoa(*(struct in_addr *)h->h_addr_list[0])); - - { - remoteAddr.sin_family = h->h_addrtype; - memcpy((char *) &remoteAddr.sin_addr.s_addr, - h->h_addr_list[0], h->h_length); - remoteAddr.sin_port = htons(remote_port); - } - /* socket creation */ - sd=socket(AF_INET, SOCK_DGRAM, 0); - if(sd<0) { - printf("%s: cannot open socket \n",argv[0]); - exit(1); - } - - /* bind any port */ - cliAddr.sin_family = AF_INET; - cliAddr.sin_addr.s_addr = htonl(INADDR_ANY); - cliAddr.sin_port = htons(local_port); - - rc = bind(sd, (struct sockaddr *) &cliAddr, sizeof(cliAddr)); - if(rc<0) { - printf("%s: cannot bind port\n", argv[0]); - exit(1); - } - - /* Setup audio device */ - audio_dev = alsa_device_open(argv[1], SAMPLING_RATE, 1, FRAME_SIZE); - - /* Setup the encoder and decoder in wideband */ - void *enc_state, *dec_state; - enc_state = speex_encoder_init(&speex_wb_mode); - tmp = 8; - speex_encoder_ctl(enc_state, SPEEX_SET_QUALITY, &tmp); - tmp = 2; - speex_encoder_ctl(enc_state, SPEEX_SET_COMPLEXITY, &tmp); - dec_state = speex_decoder_init(&speex_wb_mode); - tmp = 1; - speex_decoder_ctl(dec_state, SPEEX_SET_ENH, &tmp); - SpeexBits enc_bits, dec_bits; - speex_bits_init(&enc_bits); - speex_bits_init(&dec_bits); - - - struct sched_param param; - /*param.sched_priority = 40; */ - param.sched_priority = sched_get_priority_min(SCHED_FIFO); - if (sched_setscheduler(0,SCHED_FIFO,¶m)) - perror("sched_setscheduler"); - - int send_timestamp = 0; - int recv_started=0; - - /* Setup all file descriptors for poll()ing */ - nfds = alsa_device_nfds(audio_dev); - pfds = malloc(sizeof(*pfds)*(nfds+1)); - alsa_device_getfds(audio_dev, pfds, nfds); - pfds[nfds].fd = sd; - pfds[nfds].events = POLLIN; - - /* Setup jitter buffer using decoder */ - SpeexJitter jitter; - speex_jitter_init(&jitter, dec_state, SAMPLING_RATE); - - /* Echo canceller with 200 ms tail length */ - SpeexEchoState *echo_state = speex_echo_state_init(FRAME_SIZE, 10*FRAME_SIZE); - tmp = SAMPLING_RATE; - speex_echo_ctl(echo_state, SPEEX_ECHO_SET_SAMPLING_RATE, &tmp); - - /* Setup preprocessor and associate with echo canceller for residual echo suppression */ - preprocess = speex_preprocess_state_init(FRAME_SIZE, SAMPLING_RATE); - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_ECHO_STATE, echo_state); - - alsa_device_start(audio_dev); - - /* Infinite loop on capture, playback and receiving packets */ - while (1) - { - /* Wait for either 1) capture 2) playback 3) socket data */ - poll(pfds, nfds+1, -1); - /* Received packets */ - if (pfds[nfds].revents & POLLIN) - { - /*fprintf (stderr, "x");*/ - n = recv(sd, msg, MAX_MSG, 0); - int recv_timestamp = ((int*)msg)[1]; - int payload = ((int*)msg)[0]; - - if ((payload & 0x80000000) == 0) - { - /* Put content of the packet into the jitter buffer, except for the pseudo-header */ - speex_jitter_put(&jitter, msg+8, n-8, recv_timestamp); - recv_started = 1; - } - - } - /* Ready to play a frame (playback) */ - if (alsa_device_playback_ready(audio_dev, pfds, nfds)) - { - short pcm[FRAME_SIZE]; - if (recv_started) - { - /* Get audio from the jitter buffer */ - speex_jitter_get(&jitter, pcm, NULL); - } else { - for (i=0;i. - Ditto for AIX 3.2 and . */ -#ifndef _NO_PROTO -# define _NO_PROTO -#endif - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#if !defined __STDC__ || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -# ifndef const -# define const -# endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -# include -# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -# define ELIDE_CODE -# endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -# include -# include -#endif /* GNU C library. */ - -#ifdef VMS -# include -# if HAVE_STRING_H - 0 -# include -# endif -#endif - -#ifndef _ -/* This is for other GNU distributions with internationalized messages. - When compiling libc, the _ macro is predefined. */ -# ifdef HAVE_LIBINTL_H -# include -# define _(msgid) gettext (msgid) -# else -# define _(msgid) (msgid) -# endif -#endif - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt_win.h" - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* 1003.2 says this must be 1 before any call. */ -int optind = 1; - -/* Formerly, initialization of getopt depended on optind==0, which - causes problems with re-calling getopt as programs generally don't - know that. */ - -int __getopt_initialized; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return -1 with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; - -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -# include -# define my_index strchr -#else - -#include - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -#ifndef getenv -extern char *getenv (); -#endif - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -/* If using GCC, we can safely declare strlen this way. - If not using GCC, it is ok not to declare it. */ -#ifdef __GNUC__ -/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. - That was relevant to code that was here before. */ -# if (!defined __STDC__ || !__STDC__) && !defined strlen -/* gcc with -traditional declares the built-in strlen to return int, - and has done so at least since version 2.4.5. -- rms. */ -extern int strlen (const char *); -# endif /* not __STDC__ */ -#endif /* __GNUC__ */ - -#endif /* not __GNU_LIBRARY__ */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -#ifdef _LIBC -/* Bash 2.0 gives us an environment variable containing flags - indicating ARGV elements that should not be considered arguments. */ - -/* Defined in getopt_init.c */ -extern char *__getopt_nonoption_flags; - -static int nonoption_flags_max_len; -static int nonoption_flags_len; - -static int original_argc; -static char *const *original_argv; - -/* Make sure the environment variable bash 2.0 puts in the environment - is valid for the getopt call we must make sure that the ARGV passed - to getopt is that one passed to the process. */ -static void -__attribute__ ((unused)) -store_args_and_env (int argc, char *const *argv) -{ - /* XXX This is no good solution. We should rather copy the args so - that we can compare them later. But we must not use malloc(3). */ - original_argc = argc; - original_argv = argv; -} -# ifdef text_set_element -text_set_element (__libc_subinit, store_args_and_env); -# endif /* text_set_element */ - -# define SWAP_FLAGS(ch1, ch2) \ - if (nonoption_flags_len > 0) \ - { \ - char __tmp = __getopt_nonoption_flags[ch1]; \ - __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ - __getopt_nonoption_flags[ch2] = __tmp; \ - } -#else /* !_LIBC */ -# define SWAP_FLAGS(ch1, ch2) -#endif /* _LIBC */ - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -#if defined __STDC__ && __STDC__ -static void exchange (char **); -#endif - -static void -exchange (argv) - char **argv; -{ - int bottom = first_nonopt; - int middle = last_nonopt; - int top = optind; - char *tem; - - /* Exchange the shorter segment with the far end of the longer segment. - That puts the shorter segment into the right place. - It leaves the longer segment in the right place overall, - but it consists of two parts that need to be swapped next. */ - -#ifdef _LIBC - /* First make sure the handling of the `__getopt_nonoption_flags' - string can work normally. Our top argument must be in the range - of the string. */ - if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) - { - /* We must extend the array. The user plays games with us and - presents new arguments. */ - char *new_str = malloc (top + 1); - if (new_str == NULL) - nonoption_flags_len = nonoption_flags_max_len = 0; - else - { - memset (__mempcpy (new_str, __getopt_nonoption_flags, - nonoption_flags_max_len), - '\0', top + 1 - nonoption_flags_max_len); - nonoption_flags_max_len = top + 1; - __getopt_nonoption_flags = new_str; - } - } -#endif - - while (top > middle && middle > bottom) - { - if (top - middle > middle - bottom) - { - /* Bottom segment is the short one. */ - int len = middle - bottom; - register int i; - - /* Swap it with the top part of the top segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[top - (middle - bottom) + i]; - argv[top - (middle - bottom) + i] = tem; - SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); - } - /* Exclude the moved bottom segment from further swapping. */ - top -= len; - } - else - { - /* Top segment is the short one. */ - int len = top - middle; - register int i; - - /* Swap it with the bottom part of the bottom segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[middle + i]; - argv[middle + i] = tem; - SWAP_FLAGS (bottom + i, middle + i); - } - /* Exclude the moved top segment from further swapping. */ - bottom += len; - } - } - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Initialize the internal data when the first call is made. */ - -#if defined __STDC__ && __STDC__ -static const char *_getopt_initialize (int, char *const *, const char *); -#endif -static const char * -_getopt_initialize (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - /* Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - first_nonopt = last_nonopt = optind; - - nextchar = NULL; - - posixly_correct = getenv ("POSIXLY_CORRECT"); - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - -#ifdef _LIBC - if (posixly_correct == NULL - && argc == original_argc && argv == original_argv) - { - if (nonoption_flags_max_len == 0) - { - if (__getopt_nonoption_flags == NULL - || __getopt_nonoption_flags[0] == '\0') - nonoption_flags_max_len = -1; - else - { - const char *orig_str = __getopt_nonoption_flags; - int len = nonoption_flags_max_len = strlen (orig_str); - if (nonoption_flags_max_len < argc) - nonoption_flags_max_len = argc; - __getopt_nonoption_flags = - (char *) malloc (nonoption_flags_max_len); - if (__getopt_nonoption_flags == NULL) - nonoption_flags_max_len = -1; - else - memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), - '\0', nonoption_flags_max_len - len); - } - } - nonoption_flags_len = nonoption_flags_max_len; - } - else - nonoption_flags_len = 0; -#endif - - return optstring; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns -1. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - optarg = NULL; - - if (optind == 0 || !__getopt_initialized) - { - if (optind == 0) - optind = 1; /* Don't scan ARGV[0], the program name. */ - optstring = _getopt_initialize (argc, argv, optstring); - __getopt_initialized = 1; - } - - /* Test whether ARGV[optind] points to a non-option argument. - Either it does not have option syntax, or there is an environment flag - from the shell indicating it is not an option. The later information - is only used when the used in the GNU libc. */ -#ifdef _LIBC -# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ - || (optind < nonoption_flags_len \ - && __getopt_nonoption_flags[optind] == '1')) -#else -# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') -#endif - - if (nextchar == NULL || *nextchar == '\0') - { - /* Advance to the next ARGV-element. */ - - /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been - moved back by the user (who may also have changed the arguments). */ - if (last_nonopt > optind) - last_nonopt = optind; - if (first_nonopt > optind) - first_nonopt = optind; - - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc && NONOPTION_P) - optind++; - last_nonopt = optind; - } - - /* The special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return -1; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if (NONOPTION_P) - { - if (ordering == REQUIRE_ORDER) - return -1; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Skip the initial punctuation. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - /* Decode the current option-ARGV-element. */ - - /* Check whether the ARGV-element is a long option. - - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - - On the other hand, if there's a long option "fubar" and - the ARGV-element is "-fu", do consider that an abbreviation of - the long option, just like "--fu", and not "-f" with arg "u". - - This distinction seems to be the most useful approach. */ - - if (longopts != NULL - && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = -1; - int option_index; - - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) - == (unsigned int) strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - optopt = 0; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) - { - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - _("%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - _("%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); - } - - nextchar += strlen (nextchar); - - optopt = pfound->val; - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - optopt = pfound->val; - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) - { - if (opterr) - { - if (argv[optind][1] == '-') - /* --option */ - fprintf (stderr, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); - else - /* +option or -option */ - fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); - } - nextchar = (char *) ""; - optind++; - optopt = 0; - return '?'; - } - } - - /* Look at and handle the next short option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - if (temp == NULL || c == ':') - { - if (opterr) - { - if (posixly_correct) - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: illegal option -- %c\n"), - argv[0], c); - else - fprintf (stderr, _("%s: invalid option -- %c\n"), - argv[0], c); - } - optopt = c; - return '?'; - } - /* Convenience. Treat POSIX -W foo same as long option --foo */ - if (temp[0] == 'W' && temp[1] == ';') - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = 0; - int option_index; - - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - return c; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - - /* optarg is now the argument, see if it's in the - table of longopts. */ - - for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - return '?'; - } - if (pfound != NULL) - { - option_index = indfound; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) - fprintf (stderr, _("\ -%s: option `-W %s' doesn't allow an argument\n"), - argv[0], pfound->name); - - nextchar += strlen (nextchar); - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - nextchar = NULL; - return 'W'; /* Let the application handle it. */ - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = NULL; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, - _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); -} - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - - c = getopt (argc, argv, "abc:d:0123456789"); - if (c == -1) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ diff --git a/Engine/lib/speex/src/getopt1.c b/Engine/lib/speex/src/getopt1.c deleted file mode 100644 index fe2eb1d8a..000000000 --- a/Engine/lib/speex/src/getopt1.c +++ /dev/null @@ -1,188 +0,0 @@ -/* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "getopt_win.h" - -#if !defined __STDC__ || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -#include -#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -#include -#endif - -#ifndef NULL -#define NULL 0 -#endif - -int -getopt_long (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 0); -} - -/* Like getopt_long, but '-' as well as '--' can indicate a long option. - If an option that starts with '-' (not '--') doesn't match a long option, - but does match a short option, it is parsed as a short option - instead. */ - -int -getopt_long_only (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 1); -} - - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -#include - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - int option_index = 0; - static struct option long_options[] = - { - {"add", 1, 0, 0}, - {"append", 0, 0, 0}, - {"delete", 1, 0, 0}, - {"verbose", 0, 0, 0}, - {"create", 0, 0, 0}, - {"file", 1, 0, 0}, - {0, 0, 0, 0} - }; - - c = getopt_long (argc, argv, "abc:d:0123456789", - long_options, &option_index); - if (c == -1) - break; - - switch (c) - { - case 0: - printf ("option %s", long_options[option_index].name); - if (optarg) - printf (" with arg %s", optarg); - printf ("\n"); - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case 'd': - printf ("option d with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ diff --git a/Engine/lib/speex/src/getopt_win.h b/Engine/lib/speex/src/getopt_win.h deleted file mode 100644 index b0147e9d2..000000000 --- a/Engine/lib/speex/src/getopt_win.h +++ /dev/null @@ -1,169 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _GETOPT_H - -#ifndef __need_getopt -# define _GETOPT_H 1 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -#ifndef __need_getopt -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -# if defined __STDC__ && __STDC__ - const char *name; -# else - char *name; -# endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -# define no_argument 0 -# define required_argument 1 -# define optional_argument 2 -#endif /* need getopt */ - - -/* Get definitions and prototypes for functions to process the - arguments in ARGV (ARGC of them, minus the program name) for - options given in OPTS. - - Return the option character from OPTS just read. Return -1 when - there are no more options. For unrecognized options, or options - missing arguments, `optopt' is set to the option letter, and '?' is - returned. - - The OPTS string is a list of characters which are recognized option - letters, optionally followed by colons, specifying that that letter - takes an argument, to be placed in `optarg'. - - If a letter in OPTS is followed by two colons, its argument is - optional. This behavior is specific to the GNU `getopt'. - - The argument `--' causes premature termination of argument - scanning, explicitly telling `getopt' that there are no more - options. - - If OPTS begins with `--', then non-option arguments are treated as - arguments to the option '\0'. This behavior is specific to the GNU - `getopt'. */ - -#if defined __STDC__ && __STDC__ -# ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int __argc, char *const *__argv, const char *__shortopts); -# else /* not __GNU_LIBRARY__ */ -extern int getopt (); -# endif /* __GNU_LIBRARY__ */ - -# ifndef __need_getopt -extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, - const struct option *__longopts, int *__longind); -extern int getopt_long_only (int __argc, char *const *__argv, - const char *__shortopts, - const struct option *__longopts, int *__longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int __argc, char *const *__argv, - const char *__shortopts, - const struct option *__longopts, int *__longind, - int __long_only); -# endif -#else /* not __STDC__ */ -extern int getopt (); -# ifndef __need_getopt -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -# endif -#endif /* __STDC__ */ - -#ifdef __cplusplus -} -#endif - -/* Make sure we later can get all the definitions and declarations. */ -#undef __need_getopt - -#endif /* getopt.h */ diff --git a/Engine/lib/speex/src/skeleton.c b/Engine/lib/speex/src/skeleton.c deleted file mode 100644 index 24089cb1d..000000000 --- a/Engine/lib/speex/src/skeleton.c +++ /dev/null @@ -1,188 +0,0 @@ -/* - * skeleton.c - * author: Tahseen Mohammad - */ - -#include -#include -#include - -#include - -#include "skeleton.h" - -/* write an ogg_page to a file pointer */ -int write_ogg_page_to_file(ogg_page *og, FILE *out) { - int written; - - written = fwrite(og->header,1, og->header_len, out); - written += fwrite(og->body,1, og->body_len, out); - - return written; -} - -int add_message_header_field(fisbone_packet *fp, - char *header_key, - char *header_value) { - - /* size of both key and value + ': ' + CRLF */ - int this_message_size = strlen(header_key) + strlen(header_value) + 4; - if (fp->message_header_fields == NULL) { - fp->message_header_fields = _ogg_calloc(this_message_size, sizeof(char)); - } else { - int new_size = (fp->current_header_size + this_message_size) * sizeof(char); - fp->message_header_fields = _ogg_realloc(fp->message_header_fields, new_size); - } - snprintf(fp->message_header_fields + fp->current_header_size, - this_message_size+1, - "%s: %s\r\n", - header_key, - header_value); - fp->current_header_size += this_message_size; - - return 0; -} - -/* create a ogg_packet from a fishead_packet structure */ -ogg_packet ogg_from_fishead(fishead_packet *fp) { - - ogg_packet op; - - memset(&op, 0, sizeof(op)); - op.packet = _ogg_calloc(FISHEAD_SIZE, sizeof(unsigned char)); - memset(op.packet, 0, FISHEAD_SIZE); - - memcpy (op.packet, FISHEAD_IDENTIFIER, 8); /* identifier */ - *((ogg_uint16_t*)(op.packet+8)) = SKELETON_VERSION_MAJOR; /* version major */ - *((ogg_uint16_t*)(op.packet+10)) = SKELETON_VERSION_MINOR; /* version minor */ - *((ogg_int64_t*)(op.packet+12)) = (ogg_int64_t)fp->ptime_n; /* presentationtime numerator */ - *((ogg_int64_t*)(op.packet+20)) = (ogg_int64_t)fp->ptime_d; /* presentationtime denominator */ - *((ogg_int64_t*)(op.packet+28)) = (ogg_int64_t)fp->btime_n; /* basetime numerator */ - *((ogg_int64_t*)(op.packet+36)) = (ogg_int64_t)fp->btime_d; /* basetime denominator */ - /* TODO: UTC time, set to zero for now */ - - op.b_o_s = 1; /* its the first packet of the stream */ - op.e_o_s = 0; /* its not the last packet of the stream */ - op.bytes = FISHEAD_SIZE; /* length of the packet in bytes */ - - return op; -} - -/* create a ogg_packet from a fisbone_packet structure. - * call this method after the fisbone_packet is filled and all message header fields are added - * by calling add_message_header_field method. - */ -ogg_packet ogg_from_fisbone(fisbone_packet *fp) { - - ogg_packet op; - int packet_size = FISBONE_SIZE + fp->current_header_size; - - memset (&op, 0, sizeof (op)); - op.packet = _ogg_calloc (packet_size, sizeof(unsigned char)); - memset (op.packet, 0, packet_size); - memcpy (op.packet, FISBONE_IDENTIFIER, 8); /* identifier */ - *((ogg_uint32_t*)(op.packet+8)) = FISBONE_MESSAGE_HEADER_OFFSET; /* offset of the message header fields */ - *((ogg_uint32_t*)(op.packet+12)) = fp->serial_no; /* serialno of the respective stream */ - *((ogg_uint32_t*)(op.packet+16)) = fp->nr_header_packet; /* number of header packets */ - *((ogg_int64_t*)(op.packet+20)) = fp->granule_rate_n; /* granulrate numerator */ - *((ogg_int64_t*)(op.packet+28)) = fp->granule_rate_d; /* granulrate denominator */ - *((ogg_int64_t*)(op.packet+36)) = fp->start_granule; /* start granule */ - *((ogg_uint32_t*)(op.packet+44)) = fp->preroll; /* preroll, for theora its 0 */ - *(op.packet+48) = fp->granule_shift; /* granule shift */ - memcpy((op.packet+FISBONE_SIZE), fp->message_header_fields, fp->current_header_size); - - op.b_o_s = 0; - op.e_o_s = 0; - op.bytes = packet_size; /* size of the packet in bytes */ - - return op; -} - -/* fills up a fishead_packet from a fishead ogg_packet of a skeleton bistream */ -fishead_packet fishead_from_ogg(ogg_packet *op) { - - fishead_packet fp; - - if (memcmp(op->packet, FISHEAD_IDENTIFIER, 8)) - ; /* invalid packet what do we do? */ - - fp.version_major = *((ogg_uint16_t*)(op->packet+8)); /* version major */ - fp.version_minor = *((ogg_uint16_t*)(op->packet+10)); /* version minor */ - fp.ptime_n = *((ogg_int64_t*)(op->packet+12)); /* presentationtime numerator */ - fp.ptime_d = *((ogg_int64_t*)(op->packet+20)); /* presentationtime denominator */ - fp.btime_n = *((ogg_int64_t*)(op->packet+28)); /* basetime numerator */ - fp.btime_d = *((ogg_int64_t*)(op->packet+36)); /* basetime denominator */ - memcpy(fp.UTC, op->packet+44, 20); - - return fp; -} - -/* fills up a fisbone_packet from a fisbone ogg_packet of a skeleton bitstream */ -fisbone_packet fisbone_from_ogg(ogg_packet *op) { - - fisbone_packet fp; - - if (memcmp(op->packet, FISBONE_IDENTIFIER, 8)) - ; /* invalid value, what do we do? */ - fp.serial_no = *((ogg_uint32_t*)(op->packet+12)); /* serialno of the stream represented by this fisbone packet */ - fp.nr_header_packet = *((ogg_uint32_t*)(op->packet+16)); /* number of header packets */ - fp.granule_rate_n = *((ogg_int64_t*)(op->packet+20)); /* granulrate numerator */ - fp.granule_rate_d = *((ogg_int64_t*)(op->packet+28)); /* granulrate denominator */ - fp.start_granule = *((ogg_int64_t*)(op->packet+36)); /* start granule */ - fp.preroll = *((ogg_uint32_t*)(op->packet+44)); /* preroll, for theora its 0 */ - fp.granule_shift = *(op->packet+48); /* granule shift */ - fp.current_header_size = op->bytes - FISBONE_SIZE; - fp.message_header_fields = _ogg_calloc(fp.current_header_size+1, sizeof(char)); - memcpy(fp.message_header_fields, op->packet+FISBONE_SIZE, fp.current_header_size); - - return fp; -} - -int add_fishead_to_stream(ogg_stream_state *os, fishead_packet *fp) { - - ogg_packet op; - - op = ogg_from_fishead(fp); - ogg_stream_packetin(os, &op); - _ogg_free(op.packet); - - return 0; -} - -int add_fisbone_to_stream(ogg_stream_state *os, fisbone_packet *fp) { - - ogg_packet op; - - op = ogg_from_fisbone(fp); - ogg_stream_packetin(os, &op); - _ogg_free(op.packet); - - return 0; -} - -int add_eos_packet_to_stream(ogg_stream_state *os) { - - ogg_packet op; - - memset (&op, 0, sizeof(op)); - op.e_o_s = 1; - ogg_stream_packetin(os, &op); - - return 0; -} - -int flush_ogg_stream_to_file(ogg_stream_state *os, FILE *out) { - - ogg_page og; - int result; - - while((result = ogg_stream_flush(os, &og))) - { - if(!result) break; - result = write_ogg_page_to_file(&og, out); - if(result != og.header_len + og.body_len) - return 1; - } - - return 0; -} diff --git a/Engine/lib/speex/src/skeleton.h b/Engine/lib/speex/src/skeleton.h deleted file mode 100644 index f07d7a3e1..000000000 --- a/Engine/lib/speex/src/skeleton.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * skeleton.h - * author: Tahseen Mohammad - */ - -#ifndef _SKELETON_H -#define _SKELETON_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef WIN32 -#define snprintf _snprintf -#endif - -#include - -#define SKELETON_VERSION_MAJOR 3 -#define SKELETON_VERSION_MINOR 0 -#define FISHEAD_IDENTIFIER "fishead\0" -#define FISBONE_IDENTIFIER "fisbone\0" -#define FISHEAD_SIZE 64 -#define FISBONE_SIZE 52 -#define FISBONE_MESSAGE_HEADER_OFFSET 44 - -/* fishead_packet holds a fishead header packet. */ -typedef struct { - ogg_uint16_t version_major; /* skeleton version major */ - ogg_uint16_t version_minor; /* skeleton version minor */ - /* Start time of the presentation - * For a new stream presentationtime & basetime is same. */ - ogg_int64_t ptime_n; /* presentation time numerator */ - ogg_int64_t ptime_d; /* presentation time denominator */ - ogg_int64_t btime_n; /* basetime numerator */ - ogg_int64_t btime_d; /* basetime denominator */ - /* will holds the time of origin of the stream, a 20 bit field. */ - unsigned char UTC[20]; -} fishead_packet; - -/* fisbone_packet holds a fisbone header packet. */ -typedef struct { - ogg_uint32_t serial_no; /* serial no of the corresponding stream */ - ogg_uint32_t nr_header_packet; /* number of header packets */ - /* granule rate is the temporal resolution of the logical bitstream */ - ogg_int64_t granule_rate_n; /* granule rate numerator */ - ogg_int64_t granule_rate_d; /* granule rate denominator */ - ogg_int64_t start_granule; /* start granule value */ - ogg_uint32_t preroll; /* preroll */ - unsigned char granule_shift; /* 1 byte value holding the granule shift */ - char *message_header_fields; /* holds all the message header fields */ - /* current total size of the message header fields, for realloc purpose, initially zero */ - ogg_uint32_t current_header_size; -} fisbone_packet; - -extern int write_ogg_page_to_file(ogg_page *og, FILE *out); -extern int add_message_header_field(fisbone_packet *fp, char *header_key, char *header_value); -/* remember to deallocate the returned ogg_packet properly */ -extern ogg_packet ogg_from_fishead(fishead_packet *fp); -extern ogg_packet ogg_from_fisbone(fisbone_packet *fp); -extern fishead_packet fishead_from_ogg(ogg_packet *op); -extern fisbone_packet fisbone_from_ogg(ogg_packet *op); -extern int add_fishead_to_stream(ogg_stream_state *os, fishead_packet *fp); -extern int add_fisbone_to_stream(ogg_stream_state *os, fisbone_packet *fp); -extern int add_eos_packet_to_stream(ogg_stream_state *os); -extern int flush_ogg_stream_to_file(ogg_stream_state *os, FILE *out); - -#ifdef __cplusplus -} -#endif - -#endif /* _SKELETON_H */ - - - - - - diff --git a/Engine/lib/speex/src/speexdec.1 b/Engine/lib/speex/src/speexdec.1 deleted file mode 100644 index 3545f0941..000000000 --- a/Engine/lib/speex/src/speexdec.1 +++ /dev/null @@ -1,78 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.29. -.TH SPEEXDEC "1" "September 2003" "speexdec version 1.1" "User Commands" -.SH NAME -speexdec \- The reference implementation speex decoder. -.SH SYNOPSIS -.B speexdec -[\fIoptions\fR] \fIinput_file.spx \fR[\fIoutput_file\fR] -.SH DESCRIPTION -Decodes a Speex file and produce a WAV file or raw file -.SS "input_file can be:" -.TP -filename.spx -regular Speex file -.TP -- -stdin -.SS "output_file can be:" -.TP -filename.wav -Wav file -.TP -filename.* -Raw PCM file (any extension other that .wav) -.TP -- -stdout -.TP -(nothing) -Will be played to soundcard -.SH OPTIONS -.TP -\fB\-\-enh\fR -Enable perceptual enhancement (default) -.TP -\fB\-\-no\-enh\fR -Disable perceptual enhancement -.TP -\fB\-\-force\-nb\fR -Force decoding in narrowband -.TP -\fB\-\-force\-wb\fR -Force decoding in wideband -.TP -\fB\-\-force\-uwb\fR -Force decoding in ultra-wideband -.TP -\fB\-\-mono\fR -Force decoding in mono -.TP -\fB\-\-stereo\fR -Force decoding in stereo -.TP -\fB\-\-rate\fR n -Force decoding at sampling rate n Hz -.TP -\fB\-\-packet\-loss\fR n -Simulate n % random packet loss -.TP -\fB\-V\fR -Verbose mode (show bit-rate) -.TP -\fB\-h\fR, \fB\-\-help\fR -This help -.TP -\fB\-v\fR, \fB\-\-version\fR -Version information -.TP -\fB\-\-pf\fR -Deprecated, use \fB\-\-enh\fR instead -.TP -\fB\-\-no\-pf\fR -Deprecated, use \fB\-\-no\-enh\fR instead -.PP -More information is available from the Speex site: http://www.speex.org -.PP -Please report bugs to the mailing list `speex-dev@xiph.org'. -.SH COPYRIGHT -Copyright \(co 2002 Jean-Marc Valin diff --git a/Engine/lib/speex/src/speexdec.c b/Engine/lib/speex/src/speexdec.c deleted file mode 100644 index 4721dc1cd..000000000 --- a/Engine/lib/speex/src/speexdec.c +++ /dev/null @@ -1,807 +0,0 @@ -/* Copyright (C) 2002-2006 Jean-Marc Valin - File: speexdec.c - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#if !defined WIN32 && !defined _WIN32 -#include -#endif -#ifdef HAVE_GETOPT_H -#include -#endif -#ifndef HAVE_GETOPT_LONG -#include "getopt_win.h" -#endif -#include -#include - -#include - -#if defined WIN32 || defined _WIN32 -#include "wave_out.h" -/* We need the following two to set stdout to binary */ -#include -#include -#endif -#include - -#ifdef __MINGW32__ -#include "wave_out.c" -#endif - -#ifdef HAVE_SYS_SOUNDCARD_H -#include -#include -#include -#include -#include - -#elif defined HAVE_SYS_AUDIOIO_H -#include -#include -#include -#include -#ifndef AUDIO_ENCODING_SLINEAR -#define AUDIO_ENCODING_SLINEAR AUDIO_ENCODING_LINEAR /* Solaris */ -#endif - -#endif - -#include -#include "wav_io.h" -#include "speex/speex_header.h" -#include "speex/speex_stereo.h" -#include "speex/speex_callbacks.h" - -#define MAX_FRAME_SIZE 2000 - -#define readint(buf, base) (((buf[base+3]<<24)&0xff000000)| \ - ((buf[base+2]<<16)&0xff0000)| \ - ((buf[base+1]<<8)&0xff00)| \ - (buf[base]&0xff)) - -static void print_comments(char *comments, int length) -{ - char *c=comments; - int len, i, nb_fields; - char *end; - - if (length<8) - { - fprintf (stderr, "Invalid/corrupted comments\n"); - return; - } - end = c+length; - len=readint(c, 0); - c+=4; - if (len < 0 || c+len>end) - { - fprintf (stderr, "Invalid/corrupted comments\n"); - return; - } - fwrite(c, 1, len, stderr); - c+=len; - fprintf (stderr, "\n"); - if (c+4>end) - { - fprintf (stderr, "Invalid/corrupted comments\n"); - return; - } - nb_fields=readint(c, 0); - c+=4; - for (i=0;iend) - { - fprintf (stderr, "Invalid/corrupted comments\n"); - return; - } - len=readint(c, 0); - c+=4; - if (len < 0 || c+len>end) - { - fprintf (stderr, "Invalid/corrupted comments\n"); - return; - } - fwrite(c, 1, len, stderr); - c+=len; - fprintf (stderr, "\n"); - } -} - -FILE *out_file_open(char *outFile, int rate, int *channels) -{ - FILE *fout=NULL; - /*Open output file*/ - if (strlen(outFile)==0) - { -#if defined HAVE_SYS_SOUNDCARD_H - int audio_fd, format, stereo; - audio_fd=open("/dev/dsp", O_WRONLY); - if (audio_fd<0) - { - perror("Cannot open /dev/dsp"); - exit(1); - } - - format=AFMT_S16_NE; - if (ioctl(audio_fd, SNDCTL_DSP_SETFMT, &format)==-1) - { - perror("SNDCTL_DSP_SETFMT"); - close(audio_fd); - exit(1); - } - - stereo=0; - if (*channels==2) - stereo=1; - if (ioctl(audio_fd, SNDCTL_DSP_STEREO, &stereo)==-1) - { - perror("SNDCTL_DSP_STEREO"); - close(audio_fd); - exit(1); - } - if (stereo!=0) - { - if (*channels==1) - fprintf (stderr, "Cannot set mono mode, will decode in stereo\n"); - *channels=2; - } - - if (ioctl(audio_fd, SNDCTL_DSP_SPEED, &rate)==-1) - { - perror("SNDCTL_DSP_SPEED"); - close(audio_fd); - exit(1); - } - fout = fdopen(audio_fd, "w"); -#elif defined HAVE_SYS_AUDIOIO_H - audio_info_t info; - int audio_fd; - - audio_fd = open("/dev/audio", O_WRONLY); - if (audio_fd<0) - { - perror("Cannot open /dev/audio"); - exit(1); - } - - AUDIO_INITINFO(&info); -#ifdef AUMODE_PLAY /* NetBSD/OpenBSD */ - info.mode = AUMODE_PLAY; -#endif - info.play.encoding = AUDIO_ENCODING_SLINEAR; - info.play.precision = 16; - info.play.sample_rate = rate; - info.play.channels = *channels; - - if (ioctl(audio_fd, AUDIO_SETINFO, &info) < 0) - { - perror ("AUDIO_SETINFO"); - exit(1); - } - fout = fdopen(audio_fd, "w"); -#elif defined WIN32 || defined _WIN32 - { - unsigned int speex_channels = *channels; - if (Set_WIN_Params (INVALID_FILEDESC, rate, SAMPLE_SIZE, speex_channels)) - { - fprintf (stderr, "Can't access %s\n", "WAVE OUT"); - exit(1); - } - } -#else - fprintf (stderr, "No soundcard support\n"); - exit(1); -#endif - } else { - if (strcmp(outFile,"-")==0) - { -#if defined WIN32 || defined _WIN32 - _setmode(_fileno(stdout), _O_BINARY); -#elif defined OS2 - _fsetmode(stdout,"b"); -#endif - fout=stdout; - } - else - { - fout = fopen(outFile, "wb"); - if (!fout) - { - perror(outFile); - exit(1); - } - if (strcmp(outFile+strlen(outFile)-4,".wav")==0 || strcmp(outFile+strlen(outFile)-4,".WAV")==0) - write_wav_header(fout, rate, *channels, 0, 0); - } - } - return fout; -} - -void usage() -{ - printf ("Usage: speexdec [options] input_file.spx [output_file]\n"); - printf ("\n"); - printf ("Decodes a Speex file and produce a WAV file or raw file\n"); - printf ("\n"); - printf ("input_file can be:\n"); - printf (" filename.spx regular Speex file\n"); - printf (" - stdin\n"); - printf ("\n"); - printf ("output_file can be:\n"); - printf (" filename.wav Wav file\n"); - printf (" filename.* Raw PCM file (any extension other that .wav)\n"); - printf (" - stdout\n"); - printf (" (nothing) Will be played to soundcard\n"); - printf ("\n"); - printf ("Options:\n"); - printf (" --enh Enable perceptual enhancement (default)\n"); - printf (" --no-enh Disable perceptual enhancement\n"); - printf (" --force-nb Force decoding in narrowband\n"); - printf (" --force-wb Force decoding in wideband\n"); - printf (" --force-uwb Force decoding in ultra-wideband\n"); - printf (" --mono Force decoding in mono\n"); - printf (" --stereo Force decoding in stereo\n"); - printf (" --rate n Force decoding at sampling rate n Hz\n"); - printf (" --packet-loss n Simulate n %% random packet loss\n"); - printf (" -V Verbose mode (show bit-rate)\n"); - printf (" -h, --help This help\n"); - printf (" -v, --version Version information\n"); - printf (" --pf Deprecated, use --enh instead\n"); - printf (" --no-pf Deprecated, use --no-enh instead\n"); - printf ("\n"); - printf ("More information is available from the Speex site: http://www.speex.org\n"); - printf ("\n"); - printf ("Please report bugs to the mailing list `speex-dev@xiph.org'.\n"); -} - -void version() -{ - const char* speex_version; - speex_lib_ctl(SPEEX_LIB_GET_VERSION_STRING, (void*)&speex_version); - printf ("speexdec (Speex decoder) version %s (compiled " __DATE__ ")\n", speex_version); - printf ("Copyright (C) 2002-2006 Jean-Marc Valin\n"); -} - -void version_short() -{ - const char* speex_version; - speex_lib_ctl(SPEEX_LIB_GET_VERSION_STRING, (void*)&speex_version); - printf ("speexdec version %s\n", speex_version); - printf ("Copyright (C) 2002-2006 Jean-Marc Valin\n"); -} - -static void *process_header(ogg_packet *op, spx_int32_t enh_enabled, spx_int32_t *frame_size, int *granule_frame_size, spx_int32_t *rate, int *nframes, int forceMode, int *channels, SpeexStereoState *stereo, int *extra_headers, int quiet) -{ - void *st; - const SpeexMode *mode; - SpeexHeader *header; - int modeID; - SpeexCallback callback; - - header = speex_packet_to_header((char*)op->packet, op->bytes); - if (!header) - { - fprintf (stderr, "Cannot read header\n"); - return NULL; - } - if (header->mode >= SPEEX_NB_MODES || header->mode<0) - { - fprintf (stderr, "Mode number %d does not (yet/any longer) exist in this version\n", - header->mode); - free(header); - return NULL; - } - - modeID = header->mode; - if (forceMode!=-1) - modeID = forceMode; - - mode = speex_lib_get_mode (modeID); - - if (header->speex_version_id > 1) - { - fprintf (stderr, "This file was encoded with Speex bit-stream version %d, which I don't know how to decode\n", header->speex_version_id); - free(header); - return NULL; - } - - if (mode->bitstream_version < header->mode_bitstream_version) - { - fprintf (stderr, "The file was encoded with a newer version of Speex. You need to upgrade in order to play it.\n"); - free(header); - return NULL; - } - if (mode->bitstream_version > header->mode_bitstream_version) - { - fprintf (stderr, "The file was encoded with an older version of Speex. You would need to downgrade the version in order to play it.\n"); - free(header); - return NULL; - } - - st = speex_decoder_init(mode); - if (!st) - { - fprintf (stderr, "Decoder initialization failed.\n"); - free(header); - return NULL; - } - speex_decoder_ctl(st, SPEEX_SET_ENH, &enh_enabled); - speex_decoder_ctl(st, SPEEX_GET_FRAME_SIZE, frame_size); - *granule_frame_size = *frame_size; - - if (!*rate) - *rate = header->rate; - /* Adjust rate if --force-* options are used */ - if (forceMode!=-1) - { - if (header->mode < forceMode) - { - *rate <<= (forceMode - header->mode); - *granule_frame_size >>= (forceMode - header->mode); - } - if (header->mode > forceMode) - { - *rate >>= (header->mode - forceMode); - *granule_frame_size <<= (header->mode - forceMode); - } - } - - - speex_decoder_ctl(st, SPEEX_SET_SAMPLING_RATE, rate); - - *nframes = header->frames_per_packet; - - if (*channels==-1) - *channels = header->nb_channels; - - if (!(*channels==1)) - { - *channels = 2; - callback.callback_id = SPEEX_INBAND_STEREO; - callback.func = speex_std_stereo_request_handler; - callback.data = stereo; - speex_decoder_ctl(st, SPEEX_SET_HANDLER, &callback); - } - - if (!quiet) - { - fprintf (stderr, "Decoding %d Hz audio using %s mode", - *rate, mode->modeName); - - if (*channels==1) - fprintf (stderr, " (mono"); - else - fprintf (stderr, " (stereo"); - - if (header->vbr) - fprintf (stderr, ", VBR)\n"); - else - fprintf(stderr, ")\n"); - /*fprintf (stderr, "Decoding %d Hz audio at %d bps using %s mode\n", - *rate, mode->bitrate, mode->modeName);*/ - } - - *extra_headers = header->extra_headers; - - free(header); - return st; -} - -int main(int argc, char **argv) -{ - int c; - int option_index = 0; - char *inFile, *outFile; - FILE *fin, *fout=NULL; - short out[MAX_FRAME_SIZE]; - short output[MAX_FRAME_SIZE]; - int frame_size=0, granule_frame_size=0; - void *st=NULL; - SpeexBits bits; - int packet_count=0; - int stream_init = 0; - int quiet = 0; - ogg_int64_t page_granule=0, last_granule=0; - int skip_samples=0, page_nb_packets; - struct option long_options[] = - { - {"help", no_argument, NULL, 0}, - {"quiet", no_argument, NULL, 0}, - {"version", no_argument, NULL, 0}, - {"version-short", no_argument, NULL, 0}, - {"enh", no_argument, NULL, 0}, - {"no-enh", no_argument, NULL, 0}, - {"pf", no_argument, NULL, 0}, - {"no-pf", no_argument, NULL, 0}, - {"force-nb", no_argument, NULL, 0}, - {"force-wb", no_argument, NULL, 0}, - {"force-uwb", no_argument, NULL, 0}, - {"rate", required_argument, NULL, 0}, - {"mono", no_argument, NULL, 0}, - {"stereo", no_argument, NULL, 0}, - {"packet-loss", required_argument, NULL, 0}, - {0, 0, 0, 0} - }; - ogg_sync_state oy; - ogg_page og; - ogg_packet op; - ogg_stream_state os; - int enh_enabled; - int nframes=2; - int print_bitrate=0; - int close_in=0; - int eos=0; - int forceMode=-1; - int audio_size=0; - float loss_percent=-1; - SpeexStereoState stereo = SPEEX_STEREO_STATE_INIT; - int channels=-1; - int rate=0; - int extra_headers=0; - int wav_format=0; - int lookahead; - int speex_serialno = -1; - - enh_enabled = 1; - - /*Process options*/ - while(1) - { - c = getopt_long (argc, argv, "hvV", - long_options, &option_index); - if (c==-1) - break; - - switch(c) - { - case 0: - if (strcmp(long_options[option_index].name,"help")==0) - { - usage(); - exit(0); - } else if (strcmp(long_options[option_index].name,"quiet")==0) - { - quiet = 1; - } else if (strcmp(long_options[option_index].name,"version")==0) - { - version(); - exit(0); - } else if (strcmp(long_options[option_index].name,"version-short")==0) - { - version_short(); - exit(0); - } else if (strcmp(long_options[option_index].name,"enh")==0) - { - enh_enabled=1; - } else if (strcmp(long_options[option_index].name,"no-enh")==0) - { - enh_enabled=0; - } else if (strcmp(long_options[option_index].name,"pf")==0) - { - fprintf (stderr, "--pf is deprecated, use --enh instead\n"); - enh_enabled=1; - } else if (strcmp(long_options[option_index].name,"no-pf")==0) - { - fprintf (stderr, "--no-pf is deprecated, use --no-enh instead\n"); - enh_enabled=0; - } else if (strcmp(long_options[option_index].name,"force-nb")==0) - { - forceMode=0; - } else if (strcmp(long_options[option_index].name,"force-wb")==0) - { - forceMode=1; - } else if (strcmp(long_options[option_index].name,"force-uwb")==0) - { - forceMode=2; - } else if (strcmp(long_options[option_index].name,"mono")==0) - { - channels=1; - } else if (strcmp(long_options[option_index].name,"stereo")==0) - { - channels=2; - } else if (strcmp(long_options[option_index].name,"rate")==0) - { - rate=atoi (optarg); - } else if (strcmp(long_options[option_index].name,"packet-loss")==0) - { - loss_percent = atof(optarg); - } - break; - case 'h': - usage(); - exit(0); - break; - case 'v': - version(); - exit(0); - break; - case 'V': - print_bitrate=1; - break; - case '?': - usage(); - exit(1); - break; - } - } - if (argc-optind!=2 && argc-optind!=1) - { - usage(); - exit(1); - } - inFile=argv[optind]; - - if (argc-optind==2) - outFile=argv[optind+1]; - else - outFile = ""; - wav_format = strlen(outFile)>=4 && ( - strcmp(outFile+strlen(outFile)-4,".wav")==0 - || strcmp(outFile+strlen(outFile)-4,".WAV")==0); - /*Open input file*/ - if (strcmp(inFile, "-")==0) - { -#if defined WIN32 || defined _WIN32 - _setmode(_fileno(stdin), _O_BINARY); -#endif - fin=stdin; - } - else - { - fin = fopen(inFile, "rb"); - if (!fin) - { - perror(inFile); - exit(1); - } - close_in=1; - } - - - /*Init Ogg data struct*/ - ogg_sync_init(&oy); - - speex_bits_init(&bits); - /*Main decoding loop*/ - - while (1) - { - char *data; - int i, j, nb_read; - /*Get the ogg buffer for writing*/ - data = ogg_sync_buffer(&oy, 200); - /*Read bitstream from input file*/ - nb_read = fread(data, sizeof(char), 200, fin); - ogg_sync_wrote(&oy, nb_read); - - /*Loop for all complete pages we got (most likely only one)*/ - while (ogg_sync_pageout(&oy, &og)==1) - { - int packet_no; - if (stream_init == 0) { - ogg_stream_init(&os, ogg_page_serialno(&og)); - stream_init = 1; - } - if (ogg_page_serialno(&og) != os.serialno) { - /* so all streams are read. */ - ogg_stream_reset_serialno(&os, ogg_page_serialno(&og)); - } - /*Add page to the bitstream*/ - ogg_stream_pagein(&os, &og); - page_granule = ogg_page_granulepos(&og); - page_nb_packets = ogg_page_packets(&og); - if (page_granule>0 && frame_size) - { - /* FIXME: shift the granule values if --force-* is specified */ - skip_samples = frame_size*(page_nb_packets*granule_frame_size*nframes - (page_granule-last_granule))/granule_frame_size; - if (ogg_page_eos(&og)) - skip_samples = -skip_samples; - /*else if (!ogg_page_bos(&og)) - skip_samples = 0;*/ - } else - { - skip_samples = 0; - } - /*printf ("page granulepos: %d %d %d\n", skip_samples, page_nb_packets, (int)page_granule);*/ - last_granule = page_granule; - /*Extract all available packets*/ - packet_no=0; - while (!eos && ogg_stream_packetout(&os, &op) == 1) - { - if (op.bytes>=5 && !memcmp(op.packet, "Speex", 5)) { - speex_serialno = os.serialno; - } - if (speex_serialno == -1 || os.serialno != speex_serialno) - break; - /*If first packet, process as Speex header*/ - if (packet_count==0) - { - st = process_header(&op, enh_enabled, &frame_size, &granule_frame_size, &rate, &nframes, forceMode, &channels, &stereo, &extra_headers, quiet); - if (!st) - exit(1); - speex_decoder_ctl(st, SPEEX_GET_LOOKAHEAD, &lookahead); - if (!nframes) - nframes=1; - fout = out_file_open(outFile, rate, &channels); - - } else if (packet_count==1) - { - if (!quiet) - print_comments((char*)op.packet, op.bytes); - } else if (packet_count<=1+extra_headers) - { - /* Ignore extra headers */ - } else { - int lost=0; - packet_no++; - if (loss_percent>0 && 100*((float)rand())/RAND_MAX 0) - { - /*printf ("chopping first packet\n");*/ - new_frame_size -= skip_samples+lookahead; - frame_offset = skip_samples+lookahead; - } - if (packet_no == page_nb_packets && skip_samples < 0) - { - int packet_length = nframes*frame_size+skip_samples+lookahead; - new_frame_size = packet_length - j*frame_size; - if (new_frame_size<0) - new_frame_size = 0; - if (new_frame_size>frame_size) - new_frame_size = frame_size; - /*printf ("chopping end: %d %d %d\n", new_frame_size, packet_length, packet_no);*/ - } - if (new_frame_size>0) - { -#if defined WIN32 || defined _WIN32 - if (strlen(outFile)==0) - WIN_Play_Samples (out+frame_offset*channels, sizeof(short) * new_frame_size*channels); - else -#endif - fwrite(out+frame_offset*channels, sizeof(short), new_frame_size*channels, fout); - - audio_size+=sizeof(short)*new_frame_size*channels; - } - } - } - } - packet_count++; - } - } - if (feof(fin)) - break; - - } - - if (fout && wav_format) - { - if (fseek(fout,4,SEEK_SET)==0) - { - int tmp; - tmp = le_int(audio_size+36); - fwrite(&tmp,4,1,fout); - if (fseek(fout,32,SEEK_CUR)==0) - { - tmp = le_int(audio_size); - fwrite(&tmp,4,1,fout); - } else - { - fprintf (stderr, "First seek worked, second didn't\n"); - } - } else { - fprintf (stderr, "Cannot seek on wave file, size will be incorrect\n"); - } - } - - if (st) - speex_decoder_destroy(st); - else - { - fprintf (stderr, "This doesn't look like a Speex file\n"); - } - speex_bits_destroy(&bits); - if (stream_init) - ogg_stream_clear(&os); - ogg_sync_clear(&oy); - -#if defined WIN32 || defined _WIN32 - if (strlen(outFile)==0) - WIN_Audio_close (); -#endif - - if (close_in) - fclose(fin); - if (fout != NULL) - fclose(fout); - - return 0; -} diff --git a/Engine/lib/speex/src/speexenc.1 b/Engine/lib/speex/src/speexenc.1 deleted file mode 100644 index 9b0d6a78c..000000000 --- a/Engine/lib/speex/src/speexenc.1 +++ /dev/null @@ -1,105 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.29. -.TH SPEEXENC "1" "September 2003" "speexenc version 1.1" "User Commands" -.SH NAME -speexenc \- The reference implementation speex encoder. -.SH SYNOPSIS -.B speexenc -[\fIoptions\fR] \fIinput_file output_file\fR -.SH DESCRIPTION -Encodes input_file using Speex. It can read the WAV or raw files. -.SS "input_file can be:" -.TP -filename.wav -wav file -.TP -filename.* -Raw PCM file (any extension other than .wav) -.TP -- -stdin -.SS "output_file can be:" -.TP -filename.spx -Speex file -.TP -- -stdout -.SH OPTIONS -.TP -\fB\-n\fR, \fB\-\-narrowband\fR -Narrowband (8 kHz) input file -.TP -\fB\-w\fR, \fB\-\-wideband\fR -Wideband (16 kHz) input file -.HP -\fB\-u\fR, \fB\-\-ultra\-wideband\fR "Ultra-wideband" (32 kHz) input file -.TP -\fB\-\-quality\fR n -Encoding quality (0-10), default 8 -.TP -\fB\-\-bitrate\fR n -Encoding bit-rate (use bit-rate n or lower) -.TP -\fB\-\-vbr\fR -Enable variable bit-rate (VBR) -.TP -\fB\-\-abr\fR rate -Enable average bit-rate (ABR) at rate bps -.TP -\fB\-\-vad\fR -Enable voice activity detection (VAD) -.TP -\fB\-\-dtx\fR -Enable file-based discontinuous transmission (DTX) -.TP -\fB\-\-comp\fR n -Set encoding complexity (0-10), default 3 -.TP -\fB\-\-nframes\fR n -Number of frames per Ogg packet (1-10), default 1 -.TP -\fB\-\-comment\fR -Add the given string as an extra comment. This may be -used multiple times -.TP -\fB\-\-author\fR -Author of this track -.TP -\fB\-\-title\fR -Title for this track -.TP -\fB\-h\fR, \fB\-\-help\fR -This help -.TP -\fB\-v\fR, \fB\-\-version\fR -Version information -.TP -\fB\-V\fR -Verbose mode (show bit-rate) -.SS "Raw input options:" -.TP -\fB\-\-rate\fR n -Sampling rate for raw input -.TP -\fB\-\-stereo\fR -Consider raw input as stereo -.TP -\fB\-\-le\fR -Raw input is little-endian -.TP -\fB\-\-be\fR -Raw input is big-endian -.TP -\fB\-\-8bit\fR -Raw input is 8-bit unsigned -.TP -\fB\-\-16bit\fR -Raw input is 16-bit signed -.PP -Default raw PCM input is 16-bit, little-endian, mono -.PP -More information is available from the Speex site: http://www.speex.org -.PP -Please report bugs to the mailing list `speex-dev@xiph.org'. -.SH COPYRIGHT -Copyright \(co 2002 Jean-Marc Valin diff --git a/Engine/lib/speex/src/speexenc.c b/Engine/lib/speex/src/speexenc.c deleted file mode 100644 index 52733399b..000000000 --- a/Engine/lib/speex/src/speexenc.c +++ /dev/null @@ -1,1044 +0,0 @@ -/* Copyright (C) 2002-2006 Jean-Marc Valin - File: speexenc.c - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#if !defined WIN32 && !defined _WIN32 -#include -#endif -#ifdef HAVE_GETOPT_H -#include -#endif -#ifndef HAVE_GETOPT_LONG -#include "getopt_win.h" -#endif -#include -#include -#include - -#include "speex/speex.h" -#include "speex/speex_header.h" -#include "speex/speex_stereo.h" -#include -#include "wav_io.h" -#ifdef USE_SPEEXDSP -#include -#endif - -#if defined WIN32 || defined _WIN32 -/* We need the following two to set stdout to binary */ -#include -#include -#endif - -#include "skeleton.h" - - -void comment_init(char **comments, int* length, char *vendor_string); -void comment_add(char **comments, int* length, char *tag, char *val); - - -/*Write an Ogg page to a file pointer*/ -int oe_write_page(ogg_page *page, FILE *fp) -{ - int written; - written = fwrite(page->header,1,page->header_len, fp); - written += fwrite(page->body,1,page->body_len, fp); - - return written; -} - -#define MAX_FRAME_SIZE 2000 -#define MAX_FRAME_BYTES 2000 - -/* Convert input audio bits, endians and channels */ -static int read_samples(FILE *fin,int frame_size, int bits, int channels, int lsb, short * input, char *buff, spx_int32_t *size) -{ - unsigned char in[MAX_FRAME_BYTES*2]; - int i; - short *s; - int nb_read; - size_t to_read; - - if (size && *size<=0) - { - return 0; - } - - to_read = bits/8*channels*frame_size; - - /*Read input audio*/ - if (size) - { - if (*size >= to_read) - { - *size -= to_read; - } - else - { - to_read = *size; - *size = 0; - } - } - - if (buff) - { - for (i=0;i<12;i++) - in[i]=buff[i]; - nb_read = fread(in+12,1,to_read-12,fin) + 12; - if (size) - *size += 12; - } else { - nb_read = fread(in,1,to_read,fin); - } - - nb_read /= bits/8*channels; - - /*fprintf (stderr, "%d\n", nb_read);*/ - if (nb_read==0) - return 0; - - s=(short*)in; - if(bits==8) - { - /* Convert 8->16 bits */ - for(i=frame_size*channels-1;i>=0;i--) - { - s[i]=(in[i]<<8)^0x8000; - } - } else - { - /* convert to our endian format */ - for(i=0;iextra_headers; - fp.granule_rate_n = header->rate; - fp.granule_rate_d = 1; - fp.start_granule = 0; - fp.preroll = 3; - fp.granule_shift = 0; - - add_message_header_field(&fp, "Content-Type", "audio/x-speex"); - - add_fisbone_to_stream(os, &fp); -} - -void version() -{ - const char* speex_version; - speex_lib_ctl(SPEEX_LIB_GET_VERSION_STRING, (void*)&speex_version); - printf ("speexenc (Speex encoder) version %s (compiled " __DATE__ ")\n", speex_version); - printf ("Copyright (C) 2002-2006 Jean-Marc Valin\n"); -} - -void version_short() -{ - const char* speex_version; - speex_lib_ctl(SPEEX_LIB_GET_VERSION_STRING, (void*)&speex_version); - printf ("speexenc version %s\n", speex_version); - printf ("Copyright (C) 2002-2006 Jean-Marc Valin\n"); -} - -void usage() -{ - printf ("Usage: speexenc [options] input_file output_file\n"); - printf ("\n"); - printf ("Encodes input_file using Speex. It can read the WAV or raw files.\n"); - printf ("\n"); - printf ("input_file can be:\n"); - printf (" filename.wav wav file\n"); - printf (" filename.* Raw PCM file (any extension other than .wav)\n"); - printf (" - stdin\n"); - printf ("\n"); - printf ("output_file can be:\n"); - printf (" filename.spx Speex file\n"); - printf (" - stdout\n"); - printf ("\n"); - printf ("Options:\n"); - printf (" -n, --narrowband Narrowband (8 kHz) input file\n"); - printf (" -w, --wideband Wideband (16 kHz) input file\n"); - printf (" -u, --ultra-wideband \"Ultra-wideband\" (32 kHz) input file\n"); - printf (" --quality n Encoding quality (0-10), default 8\n"); - printf (" --bitrate n Encoding bit-rate (use bit-rate n or lower)\n"); - printf (" --vbr Enable variable bit-rate (VBR)\n"); - printf (" --vbr-max-bitrate Set max VBR bit-rate allowed\n"); - printf (" --abr rate Enable average bit-rate (ABR) at rate bps\n"); - printf (" --vad Enable voice activity detection (VAD)\n"); - printf (" --dtx Enable file-based discontinuous transmission (DTX)\n"); - printf (" --comp n Set encoding complexity (0-10), default 3\n"); - printf (" --nframes n Number of frames per Ogg packet (1-10), default 1\n"); -#ifdef USE_SPEEXDSP - printf (" --denoise Denoise the input before encoding\n"); - printf (" --agc Apply adaptive gain control (AGC) before encoding\n"); -#endif - printf (" --no-highpass Disable the encoder's built-in high-pass filter\n"); - printf (" --skeleton Outputs ogg skeleton metadata (may cause incompatibilities)\n"); - printf (" --comment Add the given string as an extra comment. This may be\n"); - printf (" used multiple times\n"); - printf (" --author Author of this track\n"); - printf (" --title Title for this track\n"); - printf (" -h, --help This help\n"); - printf (" -v, --version Version information\n"); - printf (" -V Verbose mode (show bit-rate)\n"); - printf (" --print-rate Print the bitrate for each frame to standard output\n"); - printf ("Raw input options:\n"); - printf (" --rate n Sampling rate for raw input\n"); - printf (" --stereo Consider raw input as stereo\n"); - printf (" --le Raw input is little-endian\n"); - printf (" --be Raw input is big-endian\n"); - printf (" --8bit Raw input is 8-bit unsigned\n"); - printf (" --16bit Raw input is 16-bit signed\n"); - printf ("Default raw PCM input is 16-bit, little-endian, mono\n"); - printf ("\n"); - printf ("More information is available from the Speex site: http://www.speex.org\n"); - printf ("\n"); - printf ("Please report bugs to the mailing list `speex-dev@xiph.org'.\n"); -} - - -int main(int argc, char **argv) -{ - int nb_samples, total_samples=0, nb_encoded; - int c; - int option_index = 0; - char *inFile, *outFile; - FILE *fin, *fout; - short input[MAX_FRAME_SIZE]; - spx_int32_t frame_size; - int quiet=0; - spx_int32_t vbr_enabled=0; - spx_int32_t vbr_max=0; - int abr_enabled=0; - spx_int32_t vad_enabled=0; - spx_int32_t dtx_enabled=0; - int nbBytes; - const SpeexMode *mode=NULL; - int modeID = -1; - void *st; - SpeexBits bits; - char cbits[MAX_FRAME_BYTES]; - int with_skeleton = 0; - struct option long_options[] = - { - {"wideband", no_argument, NULL, 0}, - {"ultra-wideband", no_argument, NULL, 0}, - {"narrowband", no_argument, NULL, 0}, - {"vbr", no_argument, NULL, 0}, - {"vbr-max-bitrate", required_argument, NULL, 0}, - {"abr", required_argument, NULL, 0}, - {"vad", no_argument, NULL, 0}, - {"dtx", no_argument, NULL, 0}, - {"quality", required_argument, NULL, 0}, - {"bitrate", required_argument, NULL, 0}, - {"nframes", required_argument, NULL, 0}, - {"comp", required_argument, NULL, 0}, -#ifdef USE_SPEEXDSP - {"denoise", no_argument, NULL, 0}, - {"agc", no_argument, NULL, 0}, -#endif - {"no-highpass", no_argument, NULL, 0}, - {"skeleton",no_argument,NULL, 0}, - {"help", no_argument, NULL, 0}, - {"quiet", no_argument, NULL, 0}, - {"le", no_argument, NULL, 0}, - {"be", no_argument, NULL, 0}, - {"8bit", no_argument, NULL, 0}, - {"16bit", no_argument, NULL, 0}, - {"stereo", no_argument, NULL, 0}, - {"rate", required_argument, NULL, 0}, - {"version", no_argument, NULL, 0}, - {"version-short", no_argument, NULL, 0}, - {"comment", required_argument, NULL, 0}, - {"author", required_argument, NULL, 0}, - {"title", required_argument, NULL, 0}, - {"print-rate", no_argument, NULL, 0}, - {0, 0, 0, 0} - }; - int print_bitrate=0; - spx_int32_t rate=0; - spx_int32_t size; - int chan=1; - int fmt=16; - spx_int32_t quality=-1; - float vbr_quality=-1; - int lsb=1; - ogg_stream_state os; - ogg_stream_state so; /* ogg stream for skeleton bitstream */ - ogg_page og; - ogg_packet op; - int bytes_written=0, ret, result; - int id=-1; - SpeexHeader header; - int nframes=1; - spx_int32_t complexity=3; - const char* speex_version; - char vendor_string[64]; - char *comments; - int comments_length; - int close_in=0, close_out=0; - int eos=0; - spx_int32_t bitrate=0; - double cumul_bits=0, enc_frames=0; - char first_bytes[12]; - int wave_input=0; - spx_int32_t tmp; -#ifdef USE_SPEEXDSP - SpeexPreprocessState *preprocess = NULL; - int denoise_enabled=0, agc_enabled=0; -#endif - int highpass_enabled=1; - int output_rate=0; - spx_int32_t lookahead = 0; - - speex_lib_ctl(SPEEX_LIB_GET_VERSION_STRING, (void*)&speex_version); - snprintf(vendor_string, sizeof(vendor_string), "Encoded with Speex %s", speex_version); - - comment_init(&comments, &comments_length, vendor_string); - - /*Process command-line options*/ - while(1) - { - c = getopt_long (argc, argv, "nwuhvV", - long_options, &option_index); - if (c==-1) - break; - - switch(c) - { - case 0: - if (strcmp(long_options[option_index].name,"narrowband")==0) - { - modeID = SPEEX_MODEID_NB; - } else if (strcmp(long_options[option_index].name,"wideband")==0) - { - modeID = SPEEX_MODEID_WB; - } else if (strcmp(long_options[option_index].name,"ultra-wideband")==0) - { - modeID = SPEEX_MODEID_UWB; - } else if (strcmp(long_options[option_index].name,"vbr")==0) - { - vbr_enabled=1; - } else if (strcmp(long_options[option_index].name,"vbr-max-bitrate")==0) - { - vbr_max=atoi(optarg); - if (vbr_max<1) - { - fprintf (stderr, "Invalid VBR max bit-rate value: %d\n", vbr_max); - exit(1); - } - } else if (strcmp(long_options[option_index].name,"abr")==0) - { - abr_enabled=atoi(optarg); - if (!abr_enabled) - { - fprintf (stderr, "Invalid ABR value: %d\n", abr_enabled); - exit(1); - } - } else if (strcmp(long_options[option_index].name,"vad")==0) - { - vad_enabled=1; - } else if (strcmp(long_options[option_index].name,"dtx")==0) - { - dtx_enabled=1; - } else if (strcmp(long_options[option_index].name,"quality")==0) - { - quality = atoi (optarg); - vbr_quality=atof(optarg); - } else if (strcmp(long_options[option_index].name,"bitrate")==0) - { - bitrate = atoi (optarg); - } else if (strcmp(long_options[option_index].name,"nframes")==0) - { - nframes = atoi (optarg); - if (nframes<1) - nframes=1; - if (nframes>10) - nframes=10; - } else if (strcmp(long_options[option_index].name,"comp")==0) - { - complexity = atoi (optarg); -#ifdef USE_SPEEXDSP - } else if (strcmp(long_options[option_index].name,"denoise")==0) - { - denoise_enabled=1; - } else if (strcmp(long_options[option_index].name,"agc")==0) - { - agc_enabled=1; -#endif - } else if (strcmp(long_options[option_index].name,"no-highpass")==0) - { - highpass_enabled=0; - } else if (strcmp(long_options[option_index].name,"skeleton")==0) - { - with_skeleton=1; - } else if (strcmp(long_options[option_index].name,"help")==0) - { - usage(); - exit(0); - } else if (strcmp(long_options[option_index].name,"quiet")==0) - { - quiet = 1; - } else if (strcmp(long_options[option_index].name,"version")==0) - { - version(); - exit(0); - } else if (strcmp(long_options[option_index].name,"version-short")==0) - { - version_short(); - exit(0); - } else if (strcmp(long_options[option_index].name,"print-rate")==0) - { - output_rate=1; - } else if (strcmp(long_options[option_index].name,"le")==0) - { - lsb=1; - } else if (strcmp(long_options[option_index].name,"be")==0) - { - lsb=0; - } else if (strcmp(long_options[option_index].name,"8bit")==0) - { - fmt=8; - } else if (strcmp(long_options[option_index].name,"16bit")==0) - { - fmt=16; - } else if (strcmp(long_options[option_index].name,"stereo")==0) - { - chan=2; - } else if (strcmp(long_options[option_index].name,"rate")==0) - { - rate=atoi (optarg); - } else if (strcmp(long_options[option_index].name,"comment")==0) - { - if (!strchr(optarg, '=')) - { - fprintf (stderr, "Invalid comment: %s\n", optarg); - fprintf (stderr, "Comments must be of the form name=value\n"); - exit(1); - } - comment_add(&comments, &comments_length, NULL, optarg); - } else if (strcmp(long_options[option_index].name,"author")==0) - { - comment_add(&comments, &comments_length, "author=", optarg); - } else if (strcmp(long_options[option_index].name,"title")==0) - { - comment_add(&comments, &comments_length, "title=", optarg); - } - - break; - case 'n': - modeID = SPEEX_MODEID_NB; - break; - case 'h': - usage(); - exit(0); - break; - case 'v': - version(); - exit(0); - break; - case 'V': - print_bitrate=1; - break; - case 'w': - modeID = SPEEX_MODEID_WB; - break; - case 'u': - modeID = SPEEX_MODEID_UWB; - break; - case '?': - usage(); - exit(1); - break; - } - } - if (argc-optind!=2) - { - usage(); - exit(1); - } - inFile=argv[optind]; - outFile=argv[optind+1]; - - /*Initialize Ogg stream struct*/ - srand(time(NULL)); - if (ogg_stream_init(&os, rand())==-1) - { - fprintf(stderr,"Error: stream init failed\n"); - exit(1); - } - if (with_skeleton && ogg_stream_init(&so, rand())==-1) - { - fprintf(stderr,"Error: stream init failed\n"); - exit(1); - } - - if (strcmp(inFile, "-")==0) - { -#if defined WIN32 || defined _WIN32 - _setmode(_fileno(stdin), _O_BINARY); -#elif defined OS2 - _fsetmode(stdin,"b"); -#endif - fin=stdin; - } - else - { - fin = fopen(inFile, "rb"); - if (!fin) - { - perror(inFile); - exit(1); - } - close_in=1; - } - - { - if (fread(first_bytes, 1, 12, fin) != 12) - { - perror("short file"); - exit(1); - } - if (strncmp(first_bytes,"RIFF",4)==0 || strncmp(first_bytes,"riff",4)==0) - { - if (read_wav_header(fin, &rate, &chan, &fmt, &size)==-1) - exit(1); - wave_input=1; - lsb=1; /* CHECK: exists big-endian .wav ?? */ - } - } - - if (modeID==-1 && !rate) - { - /* By default, use narrowband/8 kHz */ - modeID = SPEEX_MODEID_NB; - rate=8000; - } else if (modeID!=-1 && rate) - { - mode = speex_lib_get_mode (modeID); - if (rate>48000) - { - fprintf (stderr, "Error: sampling rate too high: %d Hz, try down-sampling\n", rate); - exit(1); - } else if (rate>25000) - { - if (modeID != SPEEX_MODEID_UWB) - { - fprintf (stderr, "Warning: Trying to encode in %s at %d Hz. I'll do it but I suggest you try ultra-wideband instead\n", mode->modeName , rate); - } - } else if (rate>12500) - { - if (modeID != SPEEX_MODEID_WB) - { - fprintf (stderr, "Warning: Trying to encode in %s at %d Hz. I'll do it but I suggest you try wideband instead\n", mode->modeName , rate); - } - } else if (rate>=6000) - { - if (modeID != SPEEX_MODEID_NB) - { - fprintf (stderr, "Warning: Trying to encode in %s at %d Hz. I'll do it but I suggest you try narrowband instead\n", mode->modeName , rate); - } - } else { - fprintf (stderr, "Error: sampling rate too low: %d Hz\n", rate); - exit(1); - } - } else if (modeID==-1) - { - if (rate>48000) - { - fprintf (stderr, "Error: sampling rate too high: %d Hz, try down-sampling\n", rate); - exit(1); - } else if (rate>25000) - { - modeID = SPEEX_MODEID_UWB; - } else if (rate>12500) - { - modeID = SPEEX_MODEID_WB; - } else if (rate>=6000) - { - modeID = SPEEX_MODEID_NB; - } else { - fprintf (stderr, "Error: Sampling rate too low: %d Hz\n", rate); - exit(1); - } - } else if (!rate) - { - if (modeID == SPEEX_MODEID_NB) - rate=8000; - else if (modeID == SPEEX_MODEID_WB) - rate=16000; - else if (modeID == SPEEX_MODEID_UWB) - rate=32000; - } - - if (!quiet) - if (rate!=8000 && rate!=16000 && rate!=32000) - fprintf (stderr, "Warning: Speex is only optimized for 8, 16 and 32 kHz. It will still work at %d Hz but your mileage may vary\n", rate); - - if (!mode) - mode = speex_lib_get_mode (modeID); - - speex_init_header(&header, rate, 1, mode); - header.frames_per_packet=nframes; - header.vbr=vbr_enabled; - header.nb_channels = chan; - - { - char *st_string="mono"; - if (chan==2) - st_string="stereo"; - if (!quiet) - fprintf (stderr, "Encoding %d Hz audio using %s mode (%s)\n", - header.rate, mode->modeName, st_string); - } - /*fprintf (stderr, "Encoding %d Hz audio at %d bps using %s mode\n", - header.rate, mode->bitrate, mode->modeName);*/ - - /*Initialize Speex encoder*/ - st = speex_encoder_init(mode); - - if (strcmp(outFile,"-")==0) - { -#if defined WIN32 || defined _WIN32 - _setmode(_fileno(stdout), _O_BINARY); -#endif - fout=stdout; - } - else - { - fout = fopen(outFile, "wb"); - if (!fout) - { - perror(outFile); - exit(1); - } - close_out=1; - } - - speex_encoder_ctl(st, SPEEX_GET_FRAME_SIZE, &frame_size); - speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &complexity); - speex_encoder_ctl(st, SPEEX_SET_SAMPLING_RATE, &rate); - - if (quality >= 0) - { - if (vbr_enabled) - { - if (vbr_max>0) - speex_encoder_ctl(st, SPEEX_SET_VBR_MAX_BITRATE, &vbr_max); - speex_encoder_ctl(st, SPEEX_SET_VBR_QUALITY, &vbr_quality); - } - else - speex_encoder_ctl(st, SPEEX_SET_QUALITY, &quality); - } - if (bitrate) - { - if (quality >= 0 && vbr_enabled) - fprintf (stderr, "Warning: --bitrate option is overriding --quality\n"); - speex_encoder_ctl(st, SPEEX_SET_BITRATE, &bitrate); - } - if (vbr_enabled) - { - tmp=1; - speex_encoder_ctl(st, SPEEX_SET_VBR, &tmp); - } else if (vad_enabled) - { - tmp=1; - speex_encoder_ctl(st, SPEEX_SET_VAD, &tmp); - } - if (dtx_enabled) - speex_encoder_ctl(st, SPEEX_SET_DTX, &tmp); - if (dtx_enabled && !(vbr_enabled || abr_enabled || vad_enabled)) - { - fprintf (stderr, "Warning: --dtx is useless without --vad, --vbr or --abr\n"); - } else if ((vbr_enabled || abr_enabled) && (vad_enabled)) - { - fprintf (stderr, "Warning: --vad is already implied by --vbr or --abr\n"); - } - if (with_skeleton) { - fprintf (stderr, "Warning: Enabling skeleton output may cause some decoders to fail.\n"); - } - - if (abr_enabled) - { - speex_encoder_ctl(st, SPEEX_SET_ABR, &abr_enabled); - } - - speex_encoder_ctl(st, SPEEX_SET_HIGHPASS, &highpass_enabled); - - speex_encoder_ctl(st, SPEEX_GET_LOOKAHEAD, &lookahead); - -#ifdef USE_SPEEXDSP - if (denoise_enabled || agc_enabled) - { - preprocess = speex_preprocess_state_init(frame_size, rate); - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_DENOISE, &denoise_enabled); - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_AGC, &agc_enabled); - lookahead += frame_size; - } -#endif - /* first packet should be the skeleton header. */ - - if (with_skeleton) { - add_fishead_packet(&so); - if ((ret = flush_ogg_stream_to_file(&so, fout))) { - fprintf (stderr,"Error: failed skeleton (fishead) header to output stream\n"); - exit(1); - } else - bytes_written += ret; - } - - /*Write header*/ - { - int packet_size; - op.packet = (unsigned char *)speex_header_to_packet(&header, &packet_size); - op.bytes = packet_size; - op.b_o_s = 1; - op.e_o_s = 0; - op.granulepos = 0; - op.packetno = 0; - ogg_stream_packetin(&os, &op); - free(op.packet); - - while((result = ogg_stream_flush(&os, &og))) - { - if(!result) break; - ret = oe_write_page(&og, fout); - if(ret != og.header_len + og.body_len) - { - fprintf (stderr,"Error: failed writing header to output stream\n"); - exit(1); - } - else - bytes_written += ret; - } - - op.packet = (unsigned char *)comments; - op.bytes = comments_length; - op.b_o_s = 0; - op.e_o_s = 0; - op.granulepos = 0; - op.packetno = 1; - ogg_stream_packetin(&os, &op); - } - - /* fisbone packet should be write after all bos pages */ - if (with_skeleton) { - add_fisbone_packet(&so, os.serialno, &header); - if ((ret = flush_ogg_stream_to_file(&so, fout))) { - fprintf (stderr,"Error: failed writing skeleton (fisbone )header to output stream\n"); - exit(1); - } else - bytes_written += ret; - } - - /* writing the rest of the speex header packets */ - while((result = ogg_stream_flush(&os, &og))) - { - if(!result) break; - ret = oe_write_page(&og, fout); - if(ret != og.header_len + og.body_len) - { - fprintf (stderr,"Error: failed writing header to output stream\n"); - exit(1); - } - else - bytes_written += ret; - } - - free(comments); - - /* write the skeleton eos packet */ - if (with_skeleton) { - add_eos_packet_to_stream(&so); - if ((ret = flush_ogg_stream_to_file(&so, fout))) { - fprintf (stderr,"Error: failed writing skeleton header to output stream\n"); - exit(1); - } else - bytes_written += ret; - } - - - speex_bits_init(&bits); - - if (!wave_input) - { - nb_samples = read_samples(fin,frame_size,fmt,chan,lsb,input, first_bytes, NULL); - } else { - nb_samples = read_samples(fin,frame_size,fmt,chan,lsb,input, NULL, &size); - } - if (nb_samples==0) - eos=1; - total_samples += nb_samples; - nb_encoded = -lookahead; - /*Main encoding loop (one frame per iteration)*/ - while (!eos || total_samples>nb_encoded) - { - id++; - /*Encode current frame*/ - if (chan==2) - speex_encode_stereo_int(input, frame_size, &bits); - -#ifdef USE_SPEEXDSP - if (preprocess) - speex_preprocess(preprocess, input, NULL); -#endif - speex_encode_int(st, input, &bits); - - nb_encoded += frame_size; - if (print_bitrate) { - int tmp; - char ch=13; - speex_encoder_ctl(st, SPEEX_GET_BITRATE, &tmp); - fputc (ch, stderr); - cumul_bits += tmp; - enc_frames += 1; - if (!quiet) - { - if (vad_enabled || vbr_enabled || abr_enabled) - fprintf (stderr, "Bitrate is use: %d bps (average %d bps) ", tmp, (int)(cumul_bits/enc_frames)); - else - fprintf (stderr, "Bitrate is use: %d bps ", tmp); - if (output_rate) - printf ("%d\n", tmp); - } - - } - - if (wave_input) - { - nb_samples = read_samples(fin,frame_size,fmt,chan,lsb,input, NULL, &size); - } else { - nb_samples = read_samples(fin,frame_size,fmt,chan,lsb,input, NULL, NULL); - } - if (nb_samples==0) - { - eos=1; - } - if (eos && total_samples<=nb_encoded) - op.e_o_s = 1; - else - op.e_o_s = 0; - total_samples += nb_samples; - - if ((id+1)%nframes!=0) - continue; - speex_bits_insert_terminator(&bits); - nbBytes = speex_bits_write(&bits, cbits, MAX_FRAME_BYTES); - speex_bits_reset(&bits); - op.packet = (unsigned char *)cbits; - op.bytes = nbBytes; - op.b_o_s = 0; - /*Is this redundent?*/ - if (eos && total_samples<=nb_encoded) - op.e_o_s = 1; - else - op.e_o_s = 0; - op.granulepos = (id+1)*frame_size-lookahead; - if (op.granulepos>total_samples) - op.granulepos = total_samples; - /*printf ("granulepos: %d %d %d %d %d %d\n", (int)op.granulepos, id, nframes, lookahead, 5, 6);*/ - op.packetno = 2+id/nframes; - ogg_stream_packetin(&os, &op); - - /*Write all new pages (most likely 0 or 1)*/ - while (ogg_stream_pageout(&os,&og)) - { - ret = oe_write_page(&og, fout); - if(ret != og.header_len + og.body_len) - { - fprintf (stderr,"Error: failed writing header to output stream\n"); - exit(1); - } - else - bytes_written += ret; - } - } - if ((id+1)%nframes!=0) - { - while ((id+1)%nframes!=0) - { - id++; - speex_bits_pack(&bits, 15, 5); - } - nbBytes = speex_bits_write(&bits, cbits, MAX_FRAME_BYTES); - op.packet = (unsigned char *)cbits; - op.bytes = nbBytes; - op.b_o_s = 0; - op.e_o_s = 1; - op.granulepos = (id+1)*frame_size-lookahead; - if (op.granulepos>total_samples) - op.granulepos = total_samples; - - op.packetno = 2+id/nframes; - ogg_stream_packetin(&os, &op); - } - /*Flush all pages left to be written*/ - while (ogg_stream_flush(&os, &og)) - { - ret = oe_write_page(&og, fout); - if(ret != og.header_len + og.body_len) - { - fprintf (stderr,"Error: failed writing header to output stream\n"); - exit(1); - } - else - bytes_written += ret; - } - - speex_encoder_destroy(st); - speex_bits_destroy(&bits); - ogg_stream_clear(&os); - - if (close_in) - fclose(fin); - if (close_out) - fclose(fout); - return 0; -} - -/* - Comments will be stored in the Vorbis style. - It is describled in the "Structure" section of - http://www.xiph.org/ogg/vorbis/doc/v-comment.html - -The comment header is decoded as follows: - 1) [vendor_length] = read an unsigned integer of 32 bits - 2) [vendor_string] = read a UTF-8 vector as [vendor_length] octets - 3) [user_comment_list_length] = read an unsigned integer of 32 bits - 4) iterate [user_comment_list_length] times { - 5) [length] = read an unsigned integer of 32 bits - 6) this iteration's user comment = read a UTF-8 vector as [length] octets - } - 7) [framing_bit] = read a single bit as boolean - 8) if ( [framing_bit] unset or end of packet ) then ERROR - 9) done. - - If you have troubles, please write to ymnk@jcraft.com. - */ - -#define readint(buf, base) (((buf[base+3]<<24)&0xff000000)| \ - ((buf[base+2]<<16)&0xff0000)| \ - ((buf[base+1]<<8)&0xff00)| \ - (buf[base]&0xff)) -#define writeint(buf, base, val) do{ buf[base+3]=((val)>>24)&0xff; \ - buf[base+2]=((val)>>16)&0xff; \ - buf[base+1]=((val)>>8)&0xff; \ - buf[base]=(val)&0xff; \ - }while(0) - -void comment_init(char **comments, int* length, char *vendor_string) -{ - int vendor_length=strlen(vendor_string); - int user_comment_list_length=0; - int len=4+vendor_length+4; - char *p=(char*)malloc(len); - if(p==NULL){ - fprintf (stderr, "malloc failed in comment_init()\n"); - exit(1); - } - writeint(p, 0, vendor_length); - memcpy(p+4, vendor_string, vendor_length); - writeint(p, 4+vendor_length, user_comment_list_length); - *length=len; - *comments=p; -} -void comment_add(char **comments, int* length, char *tag, char *val) -{ - char* p=*comments; - int vendor_length=readint(p, 0); - int user_comment_list_length=readint(p, 4+vendor_length); - int tag_len=(tag?strlen(tag):0); - int val_len=strlen(val); - int len=(*length)+4+tag_len+val_len; - - p=(char*)realloc(p, len); - if(p==NULL){ - fprintf (stderr, "realloc failed in comment_add()\n"); - exit(1); - } - - writeint(p, *length, tag_len+val_len); /* length of comment */ - if(tag) memcpy(p+*length+4, tag, tag_len); /* comment */ - memcpy(p+*length+4+tag_len, val, val_len); /* comment */ - writeint(p, 4+vendor_length, user_comment_list_length+1); - - *comments=p; - *length=len; -} -#undef readint -#undef writeint diff --git a/Engine/lib/speex/src/wav_io.c b/Engine/lib/speex/src/wav_io.c deleted file mode 100644 index c2e2bc854..000000000 --- a/Engine/lib/speex/src/wav_io.c +++ /dev/null @@ -1,228 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: wav_io.c - Routines to handle wav (RIFF) headers - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include "wav_io.h" - - -int read_wav_header(FILE *file, int *rate, int *channels, int *format, spx_int32_t *size) -{ - char ch[5]; - spx_int32_t itmp; - spx_int16_t stmp; - spx_int32_t bpersec; - spx_int16_t balign; - int skip_bytes; - int i; - - ch[4]=0; -#if 0 - fread(ch, 1, 4, file); - if (strcmp(ch, "RIFF")!=0) - { - fseek(file, 0, SEEK_SET); - return 0; - } - - fread(&itmp, 4, 1, file); - *size = le_int(itmp-36); - - fread(ch, 1, 4, file); - if (strcmp(ch, "WAVE")!=0) - { - fprintf (stderr, "RIFF file is not a WAVE file\n"); - return -1; - } -#endif - fread(ch, 1, 4, file); - while (strcmp(ch, "fmt ")!=0) - { - fread(&itmp, 4, 1, file); - itmp = le_int(itmp); - /*fprintf (stderr, "skip=%d\n", itmp);*/ - /*strange way of seeking, but it works even for pipes*/ - for (i=0;i2) - { - fprintf (stderr, "Only mono and (intensity) stereo supported\n"); - return -1; - } - - fread(&itmp, 4, 1, file); - itmp = le_int(itmp); - *rate = itmp; - if (*rate != 8000 && *rate != 16000 && *rate != 11025 && *rate != 22050 && *rate != 32000 && *rate != 44100 && *rate != 48000) - { - fprintf (stderr, "Only 8 kHz (narrowband) and 16 kHz (wideband) supported (plus 11.025 kHz and 22.05 kHz, but your mileage may vary)\n"); - return -1; - } - - fread(&itmp, 4, 1, file); - bpersec = le_int(itmp); - - fread(&stmp, 2, 1, file); - balign = le_short(stmp); - - fread(&stmp, 2, 1, file); - stmp = le_short(stmp); - if (stmp!=16 && stmp!=8) - { - fprintf (stderr, "Only 8/16-bit linear supported\n"); - return -1; - } - *format=stmp; - - if (bpersec!=*rate**channels*stmp/8) - { - fprintf (stderr, "Corrupted header: ByteRate mismatch\n"); - return -1; - } - - if (balign!=*channels*stmp/8) - { - fprintf (stderr, "Corrupted header: BlockAlign mismatch\n"); - return -1; - } - - - /*strange way of seeking, but it works even for pipes*/ - if (skip_bytes>0) - for (i=0;i -#include "speex/speex_types.h" - -#if !defined(__LITTLE_ENDIAN__) && ( defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__) ) -#define le_short(s) ((short) ((unsigned short) (s) << 8) | ((unsigned short) (s) >> 8)) -#define be_short(s) ((short) (s)) -#else -#define le_short(s) ((short) (s)) -#define be_short(s) ((short) ((unsigned short) (s) << 8) | ((unsigned short) (s) >> 8)) -#endif - -/** Convert little endian */ -static inline spx_int32_t le_int(spx_int32_t i) -{ -#if !defined(__LITTLE_ENDIAN__) && ( defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__) ) - spx_uint32_t ui, ret; - ui = i; - ret = ui>>24; - ret |= (ui>>8)&0x0000ff00; - ret |= (ui<<8)&0x00ff0000; - ret |= (ui<<24); - return ret; -#else - return i; -#endif -} - -int read_wav_header(FILE *file, int *rate, int *channels, int *format, spx_int32_t *size); - -void write_wav_header(FILE *file, int rate, int channels, int format, int size); - -#endif diff --git a/Engine/lib/speex/src/wave_out.c b/Engine/lib/speex/src/wave_out.c deleted file mode 100644 index 0f871b902..000000000 --- a/Engine/lib/speex/src/wave_out.c +++ /dev/null @@ -1,220 +0,0 @@ -/* Copyright (c) 2002, John Edwards - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -/* Set TABS = 4 */ -/******************************************************************** - - function: To provide playback of 16 bit PCM wave data in Win32 - environments from decoded compressed files. - - ********************************************************************/ - -#if defined WIN32 || defined _WIN32 - -#include -#include -#include "wave_out.h" - -#define MAXWAVESIZE 4294967040LU -#define MAX_WAVEBLOCKS 32 - -// This is modified for USE_WIN_AUDIO - ONLY 2002-02-27 - - -static CRITICAL_SECTION cs; -static HWAVEOUT dev = NULL; -static int ScheduledBlocks = 0; -static int PlayedWaveHeadersCount = 0; // free index -static WAVEHDR* PlayedWaveHeaders [MAX_WAVEBLOCKS]; - -static int -Box ( const char* msg ) -{ - MessageBox ( NULL, msg, " "VERSION_STRING": Error Message . . .", MB_OK | MB_ICONEXCLAMATION ); - return -1; -} - - -/* - * This function registers already played WAVE chunks. Freeing is done by free_memory(), - */ - -static void CALLBACK -wave_callback ( HWAVEOUT hWave, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2 ) -{ - if ( uMsg == WOM_DONE ) { - EnterCriticalSection ( &cs ); - PlayedWaveHeaders [PlayedWaveHeadersCount++] = (WAVEHDR*) dwParam1; - LeaveCriticalSection ( &cs ); - } -} - - -static void -free_memory ( void ) -{ - WAVEHDR* wh; - HGLOBAL hg; - - EnterCriticalSection ( &cs ); - wh = PlayedWaveHeaders [--PlayedWaveHeadersCount]; - ScheduledBlocks--; // decrease the number of USED blocks - LeaveCriticalSection ( &cs ); - - waveOutUnprepareHeader ( dev, wh, sizeof (WAVEHDR) ); - - hg = GlobalHandle ( wh -> lpData ); // Deallocate the buffer memory - GlobalUnlock (hg); - GlobalFree (hg); - - hg = GlobalHandle ( wh ); // Deallocate the header memory - GlobalUnlock (hg); - GlobalFree (hg); -} - - -Int -Set_WIN_Params ( FILE_T dummyFile , - Ldouble SampleFreq, - Uint BitsPerSample, - Uint Channels ) -{ - WAVEFORMATEX outFormat; - UINT deviceID = WAVE_MAPPER; - - (void) dummyFile; - - if ( waveOutGetNumDevs () == 0 ) - return Box ( "No audio device present." ); - - outFormat.wFormatTag = WAVE_FORMAT_PCM; - outFormat.wBitsPerSample = BitsPerSample; - outFormat.nChannels = Channels; - outFormat.nSamplesPerSec = (unsigned long)(SampleFreq + 0.5); - outFormat.nBlockAlign = (outFormat.wBitsPerSample + 7) / 8 * outFormat.nChannels; - outFormat.nAvgBytesPerSec = outFormat.nSamplesPerSec * outFormat.nBlockAlign; - - switch ( waveOutOpen ( &dev, deviceID, &outFormat, (DWORD_PTR)wave_callback, 0, CALLBACK_FUNCTION ) ) - { - case MMSYSERR_ALLOCATED: return Box ( "Device is already open." ); - case MMSYSERR_BADDEVICEID: return Box ( "The specified device is out of range." ); - case MMSYSERR_NODRIVER: return Box ( "There is no audio driver in this system." ); - case MMSYSERR_NOMEM: return Box ( "Unable to allocate sound memory." ); - case WAVERR_BADFORMAT: return Box ( "This audio format is not supported." ); - case WAVERR_SYNC: return Box ( "The device is synchronous." ); - default: return Box ( "Unknown media error." ); - case MMSYSERR_NOERROR: break; - } - - waveOutReset ( dev ); - InitializeCriticalSection ( &cs ); - SetPriorityClass ( GetCurrentProcess (), HIGH_PRIORITY_CLASS ); - return 0; -} - - -int -WIN_Play_Samples ( const void* data, size_t len ) -{ - HGLOBAL hg; - HGLOBAL hg2; - LPWAVEHDR wh; - void* allocptr; - - do { - while ( PlayedWaveHeadersCount > 0 ) // free used blocks ... - free_memory (); - - if ( ScheduledBlocks < sizeof(PlayedWaveHeaders)/sizeof(*PlayedWaveHeaders) ) // wait for a free block ... - break; - Sleep (26); - } while (1); - - if ( (hg2 = GlobalAlloc ( GMEM_MOVEABLE, len )) == NULL ) // allocate some memory for a copy of the buffer - return Box ( "GlobalAlloc failed." ); - - allocptr = GlobalLock (hg2); - CopyMemory ( allocptr, data, len ); // Here we can call any modification output functions we want.... - - if ( (hg = GlobalAlloc (GMEM_MOVEABLE | GMEM_ZEROINIT, sizeof (WAVEHDR))) == NULL ) // now make a header and WRITE IT! - return -1; - - wh = GlobalLock (hg); - wh -> dwBufferLength = len; - wh -> lpData = allocptr; - - if ( waveOutPrepareHeader ( dev, wh, sizeof (WAVEHDR)) != MMSYSERR_NOERROR ) { - GlobalUnlock (hg); - GlobalFree (hg); - return -1; - } - - if ( waveOutWrite ( dev, wh, sizeof (WAVEHDR)) != MMSYSERR_NOERROR ) { - GlobalUnlock (hg); - GlobalFree (hg); - return -1; - } - - EnterCriticalSection ( &cs ); - ScheduledBlocks++; - LeaveCriticalSection ( &cs ); - - return len; -} - - -int -WIN_Audio_close ( void ) -{ - if ( dev != NULL ) { - - while ( ScheduledBlocks > 0 ) { - Sleep (ScheduledBlocks); - while ( PlayedWaveHeadersCount > 0 ) // free used blocks ... - free_memory (); - } - - waveOutReset (dev); // reset the device - waveOutClose (dev); // close the device - dev = NULL; - } - - DeleteCriticalSection ( &cs ); - ScheduledBlocks = 0; - return 0; -} - -#endif - -/* end of wave_out.c */ diff --git a/Engine/lib/speex/src/wave_out.h b/Engine/lib/speex/src/wave_out.h deleted file mode 100644 index a4aa3c183..000000000 --- a/Engine/lib/speex/src/wave_out.h +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright (c) 2002, John Edwards - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -// WAVE_OUT.H - Necessary stuff for WIN_AUDIO - -#ifndef WAVE_OUT_H -#define WAVE_OUT_H - -#include -#include -#ifdef __MINGW32__ -#include -#endif - -#define VERSION_STRING "\n 0.7.0\n" - -#define Cdecl __cdecl -#define __attribute__(x) -#define sleep(__sec) Sleep ((__sec) * 1000) -#define inline __inline -#define restrict - -//// constants ///////////////////////////////////////////////////// - -#define CD_SAMPLE_FREQ 44.1e3 -#define SAMPLE_SIZE 16 -#define SAMPLE_SIZE_STRING "" -#define WINAUDIO_FD ((FILE_T)-128) -#define FILE_T FILE* -#define INVALID_FILEDESC NULL - -//// Simple types ////////////////////////////////////////////////// - -typedef signed int Int; // at least -32767...+32767, fast type -typedef unsigned int Uint; // at least 0...65535, fast type -typedef long double Ldouble; // most exact floating point format - -//// procedures/functions ////////////////////////////////////////// -// wave_out.c -Int Set_WIN_Params ( FILE_T dummyFile , Ldouble SampleFreq, Uint BitsPerSample, Uint Channels); -int WIN_Play_Samples ( const void* buff, size_t len ); -int WIN_Audio_close ( void ); - -#endif /* WAVE_OUT_H */ diff --git a/Engine/lib/speex/symbian/Makefile.am b/Engine/lib/speex/symbian/Makefile.am deleted file mode 100644 index 6cdaf24b4..000000000 --- a/Engine/lib/speex/symbian/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = bld.inf config.h speex.mmp diff --git a/Engine/lib/speex/symbian/bld.inf b/Engine/lib/speex/symbian/bld.inf deleted file mode 100644 index 07f8f6f53..000000000 --- a/Engine/lib/speex/symbian/bld.inf +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright (C) 2003 Commonwealth Scientific and Industrial Research - Organisation (CSIRO) Australia - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of CSIRO Australia nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -PRJ_EXPORTS - -..\include\speex\speex_bits.h \epoc32\include\speex\speex_bits.h -..\include\speex\speex_callbacks.h \epoc32\include\speex\speex_callbacks.h -..\include\speex\speex_config_types.h \epoc32\include\speex\speex_config_types.h -..\include\speex\speex.h \epoc32\include\speex\speex.h -..\include\speex\speex_header.h \epoc32\include\speex\speex_header.h -..\include\speex\speex_stereo.h \epoc32\include\speex\speex_stereo.h -..\include\speex\speex_types.h \epoc32\include\speex\speex_types.h - - -PRJ_MMPFILES - -speex.mmp diff --git a/Engine/lib/speex/symbian/speex.mmp b/Engine/lib/speex/symbian/speex.mmp deleted file mode 100644 index d50ad5bc1..000000000 --- a/Engine/lib/speex/symbian/speex.mmp +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2003 Commonwealth Scientific and Industrial Research - Organisation (CSIRO) Australia - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of CSIRO Australia nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -TARGET speex.lib -TARGETTYPE lib -UID 0 -MACRO HAVE_CONFIG_H -SOURCEPATH ..\libspeex -SOURCE bits.c cb_search.c exc_5_64_table.c exc_5_256_table.c exc_8_128_table.c -SOURCE exc_10_16_table.c exc_10_32_table.c exc_20_32_table.c fftwrap.c kiss_fft.c kiss_fftr.c filters.c gain_table.c -SOURCE gain_table_lbr.c hexc_10_32_table.c hexc_table.c high_lsp_tables.c -SOURCE lbr_48k_tables.c lpc.c lsp.c lsp_tables_nb.c ltp.c math_approx.c misc.c -SOURCE modes.c nb_celp.c quant_lsp.c sb_celp.c smallft.c -SOURCE speex.c speex_callbacks.c speex_header.c stereo.c vbr.c vq.c window.c -USERINCLUDE . ..\include\speex -SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\include diff --git a/Engine/lib/speex/ti/Makefile.am b/Engine/lib/speex/ti/Makefile.am deleted file mode 100644 index 200ca1954..000000000 --- a/Engine/lib/speex/ti/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -SUBDIRS = speex_C54_test speex_C55_test speex_C64_test - -EXTRA_DIST = config.h testenc-TI-C5x.c os_support_custom.h testenc-TI-C64x.c - diff --git a/Engine/lib/speex/ti/os_support_custom.h b/Engine/lib/speex/ti/os_support_custom.h deleted file mode 100644 index 1accbcb1b..000000000 --- a/Engine/lib/speex/ti/os_support_custom.h +++ /dev/null @@ -1,128 +0,0 @@ -/* Copyright (C) 2007 Psi Systems, Inc. - Author: Jean-Marc Valin - File: os_support_custom.h - Memory Allocation overrides to allow user control rather than C alloc/free. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef MANUAL_ALLOC - -/* To avoid changing the Speex call model, this file relies on four static variables - The user main creates two linear buffers, and initializes spxGlobalHeap/ScratchPtr - to point to the start of the two buffers, and initializes spxGlobalHeap/ScratchEnd - to point to the first address following the last byte of the two buffers. - - This mechanism allows, for example, data caching for multichannel applications, - where the Speex state is swapped from a large slow memory to a small fast memory - each time the codec runs. - - Persistent data is allocated in spxGlobalHeap (instead of calloc), while scratch - data is allocated in spxGlobalScratch. -*/ - -extern char *spxGlobalHeapPtr, *spxGlobalHeapEnd; -extern char *spxGlobalScratchPtr, *spxGlobalScratchEnd; - -/* Make sure that all structures are aligned to largest type */ -#define BLOCK_MASK (sizeof(long double)-1) -extern inline void speex_warning(const char *str); - -#define OVERRIDE_SPEEX_ALLOC -static inline void *speex_alloc (int size) -{ - void *ptr; - - ptr = (void *) (((int)spxGlobalHeapPtr + BLOCK_MASK) & ~BLOCK_MASK); //Start on 8 boundary - - spxGlobalHeapPtr = (char *)((int)ptr + size); // Update pointer to next free location - - if (spxGlobalHeapPtr > spxGlobalHeapEnd ) - { -#ifdef VERBOSE_ALLOC - fprintf (stderr, "insufficient space for persistent alloc request %d bytes\n", size); -#endif - return 0; - } - -#ifdef VERBOSE_ALLOC - fprintf (stderr, "Persist Allocated %d chars at %x, %d remaining\n", size, ptr, ((int)spxGlobalHeapEnd - (int)spxGlobalHeapPtr)); -#endif - memset(ptr, 0, size); - return ptr; -} - -#define OVERRIDE_SPEEX_ALLOC_SCRATCH -static inline void *speex_alloc_scratch (int size) -{ - void *ptr; - - ptr = (void *) (((int)spxGlobalScratchPtr + BLOCK_MASK) & ~BLOCK_MASK); //Start on 8 boundary - - spxGlobalScratchPtr = (char *)((int)ptr + size); // Update pointer to next free location - - if (spxGlobalScratchPtr > spxGlobalScratchEnd ) - { -#ifdef VERBOSE_ALLOC - fprintf (stderr, "insufficient space for scratch alloc request %d bytes\n", size); -#endif - return 0; - } - -#ifdef VERBOSE_ALLOC - fprintf (stderr, "Scratch Allocated %d chars at %x, %d remaining\n", size, ptr, ((int)spxGlobalScratchEnd - (int)spxGlobalScratchPtr)); -#endif - memset(ptr, 0, size); - return ptr; -} - -#define OVERRIDE_SPEEX_REALLOC -static inline void *speex_realloc (void *ptr, int size) -{ -#ifdef VERBOSE_ALLOC - speex_warning("realloc attempted, not allowed"); -#endif - return 0; -} - -#define OVERRIDE_SPEEX_FREE -static inline void speex_free (void *ptr) -{ -#ifdef VERBOSE_ALLOC - speex_warning("at speex_free"); -#endif -} -#define OVERRIDE_SPEEX_FREE_SCRATCH -static inline void speex_free_scratch (void *ptr) -{ -#ifdef VERBOSE_ALLOC - speex_warning("at speex_free_scratch"); -#endif -} - -#endif /* !MANUAL_ALLOC */ diff --git a/Engine/lib/speex/ti/speex_C54_test/Makefile.am b/Engine/lib/speex/ti/speex_C54_test/Makefile.am deleted file mode 100644 index f7b10bc4c..000000000 --- a/Engine/lib/speex/ti/speex_C54_test/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = speex_C54_test.cmd speex_C54_test.pjt - - diff --git a/Engine/lib/speex/ti/speex_C54_test/speex_C54_test.cmd b/Engine/lib/speex/ti/speex_C54_test/speex_C54_test.cmd deleted file mode 100644 index 4989a35f7..000000000 --- a/Engine/lib/speex/ti/speex_C54_test/speex_C54_test.cmd +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright (C) 2005 Psi Systems, Inc. - File: speex_C54_test.cmd - Linker command file with memory allocation for TI TMS320VC5416 processor - for use with TI Code Composer (TM) DSP development tools. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - --c --stack 0x2000 --heap 0x1000 /* If private memory allocation is used for Speex */ -/*-heap 0x6000 /* If calloc is used for Speex */ --lrts_ext.lib - -MEMORY -{ -/* PAGE 0: P_DARAM03: origin = 0x80, len = 0x7f00*/ - PAGE 0: P_DARAM03: origin = 0x5000, len = 0x2f80 - PAGE 0: VECT: origin = 0x7f80, len = 0x80 - PAGE 0: P_DARAM47: origin = 0x18000, len = 0x8000 - PAGE 0: SARAM03: origin = 0x28000, len = 0x8000 - PAGE 0: SARAM47: origin = 0x38000, len = 0x8000 - - PAGE 1: USERREGS: origin = 0x60, len = 0x1a - PAGE 1: BIOSREGS: origin = 0x7c, len = 0x4 - PAGE 1: CSLREGS: origin = 0x7a, len = 0x2 - D_DARAM03: origin = 0x80, len = 0x4f80 - D_DARAM47: origin = 0x8000, len = 0x8000 -} - -SECTIONS -{ - .vectors: {} > VECT PAGE 0 - .bootmem: {rts_ext.lib (.text)} > P_DARAM03 PAGE 0 -/* .bootmem: {} > P_DARAM03 PAGE 0 */ - .text: {} > SARAM03 PAGE 0 - .cinit: {} > SARAM03 PAGE 0 - .switch: {} > SARAM03 PAGE 0 - .bss: {} > D_DARAM03 | D_DARAM47 PAGE 1 - .far: {} > D_DARAM03 | D_DARAM47 PAGE 1 - .const: {} > D_DARAM03 | D_DARAM47 PAGE 1 - .sysmem: {} > D_DARAM47 PAGE 1 - .cio: {} > D_DARAM03 | D_DARAM47 PAGE 1 - .stack: {} > D_DARAM03 | D_DARAM47 PAGE 1 - .myheap: {} > D_DARAM47 PAGE 1 -} diff --git a/Engine/lib/speex/ti/speex_C54_test/speex_C54_test.pjt b/Engine/lib/speex/ti/speex_C54_test/speex_C54_test.pjt deleted file mode 100644 index e02a14efb..000000000 --- a/Engine/lib/speex/ti/speex_C54_test/speex_C54_test.pjt +++ /dev/null @@ -1,59 +0,0 @@ -; Code Composer Project File, Version 2.0 (do not modify or remove this line) - -[Project Settings] -ProjectDir="C:\Speex\speex_14274\ti\speex_C54_test\" -ProjectType=Executable -CPUFamily=TMS320C54XX -Tool="Compiler" -Tool="CustomBuilder" -Tool="DspBiosBuilder" -Tool="Linker" -Config="Debug" -Config="Release" - -[Source Files] -Source="..\..\libspeex\bits.c" -Source="..\..\libspeex\cb_search.c" -Source="..\..\libspeex\exc_10_16_table.c" -Source="..\..\libspeex\exc_10_32_table.c" -Source="..\..\libspeex\exc_20_32_table.c" -Source="..\..\libspeex\exc_5_256_table.c" -Source="..\..\libspeex\exc_5_64_table.c" -Source="..\..\libspeex\exc_8_128_table.c" -Source="..\..\libspeex\filters.c" -Source="..\..\libspeex\gain_table.c" -Source="..\..\libspeex\gain_table_lbr.c" -Source="..\..\libspeex\lpc.c" -Source="..\..\libspeex\lsp.c" -Source="..\..\libspeex\lsp_tables_nb.c" -Source="..\..\libspeex\ltp.c" -Source="..\..\libspeex\modes.c" -Source="..\..\libspeex\nb_celp.c" -Source="..\..\libspeex\quant_lsp.c" -Source="..\..\libspeex\sb_celp.c" -Source="..\..\libspeex\speex.c" -Source="..\..\libspeex\speex_callbacks.c" -Source="..\..\libspeex\vbr.c" -Source="..\..\libspeex\vq.c" -Source="..\..\libspeex\window.c" -Source="..\..\ti\testenc-TI-C5x.c" -Source="speex_C54_test.cmd" - -["Compiler" Settings: "Debug"] -Options=-g -q -o3 -fr"..\ti\speex_C54_test\Debug" -i"..\ti" -i"..\include" -d"_DEBUG" -d"CONFIG_TI_C54X" -d"HAVE_CONFIG_H" -d"NO_LONGLONG" -mf -ms - -["Compiler" Settings: "Release"] -Options=-q -o2 -fr"..\ti\speex_C54_test\Release" -i"..\ti" -i"..\include" -d"CONFIG_TI_C54X" -d"HAVE_CONFIG_H" -d"NO_LONGLONG" -mf -ms - -["DspBiosBuilder" Settings: "Debug"] -Options=-v54 - -["DspBiosBuilder" Settings: "Release"] -Options=-v54 - -["Linker" Settings: "Debug"] -Options=-q -c -heap4096 -m".\Debug\speex_C54_test.map" -o".\Debug\speex_C54_test.out" -stack4096 -w -x - -["Linker" Settings: "Release"] -Options=-q -c -m".\Release\speex_C54_test.map" -o".\Release\speex_C54_test.out" -w -x - diff --git a/Engine/lib/speex/ti/speex_C55_test/Makefile.am b/Engine/lib/speex/ti/speex_C55_test/Makefile.am deleted file mode 100644 index 6c89ed7c1..000000000 --- a/Engine/lib/speex/ti/speex_C55_test/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = speex_C55_test.cmd speex_C55_test.pjt diff --git a/Engine/lib/speex/ti/speex_C55_test/speex_C55_test.cmd b/Engine/lib/speex/ti/speex_C55_test/speex_C55_test.cmd deleted file mode 100644 index 17cbf01dc..000000000 --- a/Engine/lib/speex/ti/speex_C55_test/speex_C55_test.cmd +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright (C) 2005 Psi Systems, Inc. - File: speex_C55_test.cmd - Linker command file with memory allocation for TI TMS320VC5509A processor - for use with TI Code Composer (TM) DSP development tools. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - --c --stack 0x1c00 --heap 0x1000 /* If private memory allocation is used for Speex */ -/*-heap 0x6000 / * If calloc is used for Speex */ --sysstack 0x200 --lrts55.lib - -MEMORY -{ - DARAM: origin = 0x200, len = 0x7e00 - DARAM_B: origin = 0x8000, len = 0x8000 - VECT: origin = 0x100, len = 0x100 - SARAM_A: origin = 0x10000, len = 0x10000 - SARAM_B: origin = 0x20000, len = 0x20000 -} - -SECTIONS -{ - .vectors: {} > VECT - .bootmem: {} > DARAM - .text: {} > SARAM_B - .cinit: {} > SARAM_B - .switch: {} > SARAM_B - .bss: {} > DARAM -/* .far: {} > DARAM*/ - .const: {} > DARAM - .sysmem: {} > DARAM_B - .cio: {} > DARAM - .stack: {} > DARAM - .sysstack: {} > DARAM - .myheap: {} > SARAM_A -} diff --git a/Engine/lib/speex/ti/speex_C55_test/speex_C55_test.pjt b/Engine/lib/speex/ti/speex_C55_test/speex_C55_test.pjt deleted file mode 100644 index b4d6b66fe..000000000 --- a/Engine/lib/speex/ti/speex_C55_test/speex_C55_test.pjt +++ /dev/null @@ -1,59 +0,0 @@ -; Code Composer Project File, Version 2.0 (do not modify or remove this line) - -[Project Settings] -ProjectDir="C:\Speex\speex_14274\ti\speex_C55_test\" -ProjectType=Executable -CPUFamily=TMS320C55XX -Tool="Compiler" -Tool="CustomBuilder" -Tool="DspBiosBuilder" -Tool="Linker" -Config="Debug" -Config="Release" - -[Source Files] -Source="..\..\libspeex\bits.c" -Source="..\..\libspeex\cb_search.c" -Source="..\..\libspeex\exc_10_16_table.c" -Source="..\..\libspeex\exc_10_32_table.c" -Source="..\..\libspeex\exc_20_32_table.c" -Source="..\..\libspeex\exc_5_256_table.c" -Source="..\..\libspeex\exc_5_64_table.c" -Source="..\..\libspeex\exc_8_128_table.c" -Source="..\..\libspeex\filters.c" -Source="..\..\libspeex\gain_table.c" -Source="..\..\libspeex\gain_table_lbr.c" -Source="..\..\libspeex\lpc.c" -Source="..\..\libspeex\lsp.c" -Source="..\..\libspeex\lsp_tables_nb.c" -Source="..\..\libspeex\ltp.c" -Source="..\..\libspeex\modes.c" -Source="..\..\libspeex\nb_celp.c" -Source="..\..\libspeex\quant_lsp.c" -Source="..\..\libspeex\sb_celp.c" -Source="..\..\libspeex\speex.c" -Source="..\..\libspeex\speex_callbacks.c" -Source="..\..\libspeex\vbr.c" -Source="..\..\libspeex\vq.c" -Source="..\..\libspeex\window.c" -Source="..\..\ti\testenc-TI-C5x.c" -Source="speex_C55_test.cmd" - -["Compiler" Settings: "Debug"] -Options=-g -q -o3 -fr"..\ti\speex_C55_test\Debug" -i"..\ti" -i"..\include" -d"_DEBUG" -d"CONFIG_TI_C55X" -d"HAVE_CONFIG_H" -mn - -["Compiler" Settings: "Release"] -Options=-q -o2 -fr"..\ti\speex_C55_test\Release" -i"..\ti" -i"..\include" -d"CONFIG_TI_C55X" -d"HAVE_CONFIG_H" -mn - -["DspBiosBuilder" Settings: "Debug"] -Options=-v55 - -["DspBiosBuilder" Settings: "Release"] -Options=-v55 - -["Linker" Settings: "Debug"] -Options=-q -c -m".\Debug\speex_C55_test.map" -o".\Debug\speex_C55_test.out" -w -x - -["Linker" Settings: "Release"] -Options=-q -c -m".\Release\speex_C55_test.map" -o".\Release\speex_C55_test.out" -w -x - diff --git a/Engine/lib/speex/ti/speex_C64_test/Makefile.am b/Engine/lib/speex/ti/speex_C64_test/Makefile.am deleted file mode 100644 index 14ea2baae..000000000 --- a/Engine/lib/speex/ti/speex_C64_test/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = speex_C64_test.cmd speex_C64_test.pjt diff --git a/Engine/lib/speex/ti/speex_C64_test/speex_C64_test.cmd b/Engine/lib/speex/ti/speex_C64_test/speex_C64_test.cmd deleted file mode 100644 index 1e023db65..000000000 --- a/Engine/lib/speex/ti/speex_C64_test/speex_C64_test.cmd +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright (C) 2005 Psi Systems, Inc. - File: speex_C64_test.cmd - Linker command file with memory allocation for TI TMS320C6415 processor - for use with TI Code Composer (TM) DSP development tools. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - --stack 0x10000 --heap 0x10000 - - -MEMORY -{ - VECRAM : origin = 0x0, len = 0x200 - IPRAM : origin = 0x200, len = 0x40000 - IDRAM : origin = 0x80000, len = 0x70000 -} - -SECTIONS -{ - .vectors > VECRAM - .text > IPRAM - - .bss > IDRAM - .cinit > IDRAM - .const > IDRAM - .far > IDRAM - .stack > IDRAM - .cio > IDRAM - .sysmem > IDRAM - .switch > IDRAM - .myheap > IDRAM -} diff --git a/Engine/lib/speex/ti/speex_C64_test/speex_C64_test.pjt b/Engine/lib/speex/ti/speex_C64_test/speex_C64_test.pjt deleted file mode 100644 index 1fec98f29..000000000 --- a/Engine/lib/speex/ti/speex_C64_test/speex_C64_test.pjt +++ /dev/null @@ -1,60 +0,0 @@ -; Code Composer Project File, Version 2.0 (do not modify or remove this line) - -[Project Settings] -ProjectDir="C:\Speex\speex_14274\ti\speex_C64_test\" -ProjectType=Executable -CPUFamily=TMS320C64XX -Tool="Compiler" -Tool="CustomBuilder" -Tool="DspBiosBuilder" -Tool="Linker" -Config="Debug" -Config="Release" - -[Source Files] -Source="..\..\..\..\CCStudio_v3.1\C6000\cgtools\lib\rts6400.lib" -Source="..\..\libspeex\bits.c" -Source="..\..\libspeex\cb_search.c" -Source="..\..\libspeex\exc_10_16_table.c" -Source="..\..\libspeex\exc_10_32_table.c" -Source="..\..\libspeex\exc_20_32_table.c" -Source="..\..\libspeex\exc_5_256_table.c" -Source="..\..\libspeex\exc_5_64_table.c" -Source="..\..\libspeex\exc_8_128_table.c" -Source="..\..\libspeex\filters.c" -Source="..\..\libspeex\gain_table.c" -Source="..\..\libspeex\gain_table_lbr.c" -Source="..\..\libspeex\lpc.c" -Source="..\..\libspeex\lsp.c" -Source="..\..\libspeex\lsp_tables_nb.c" -Source="..\..\libspeex\ltp.c" -Source="..\..\libspeex\modes.c" -Source="..\..\libspeex\nb_celp.c" -Source="..\..\libspeex\quant_lsp.c" -Source="..\..\libspeex\sb_celp.c" -Source="..\..\libspeex\speex.c" -Source="..\..\libspeex\speex_callbacks.c" -Source="..\..\libspeex\vbr.c" -Source="..\..\libspeex\vq.c" -Source="..\..\libspeex\window.c" -Source="..\testenc-TI-C64x.c" -Source="speex_C64_test.cmd" - -["Compiler" Settings: "Debug"] -Options=-g -o3 -fr"$(Proj_dir)\Debug" -i"..\ti" -i"..\include" -d"_DEBUG" -d"CONFIG_TI_C6X" -d"HAVE_CONFIG_H" -mv6400 - -["Compiler" Settings: "Release"] -Options=-o3 -fr"$(Proj_dir)\Release" -i"..\ti" -i"..\include" -d"HAVE_CONFIG_H" -mv6400 - -["DspBiosBuilder" Settings: "Debug"] -Options=-v6x - -["DspBiosBuilder" Settings: "Release"] -Options=-v6x - -["Linker" Settings: "Debug"] -Options=-c -m".\Debug\speex_C64_test.map" -o".\Debug\speex_C64_test.out" -w -x - -["Linker" Settings: "Release"] -Options=-c -m".\Release\speex_C64_test.map" -o".\Release\speex_C64_test.out" -w -x - diff --git a/Engine/lib/speex/ti/testenc-TI-C5x.c b/Engine/lib/speex/ti/testenc-TI-C5x.c deleted file mode 100644 index 45979e644..000000000 --- a/Engine/lib/speex/ti/testenc-TI-C5x.c +++ /dev/null @@ -1,294 +0,0 @@ -/* Copyright (C) 2005 Psi Systems, Inc. - File: testenc-TI-C5x.c - Encoder/Decoder Loop Main file for TI C54xx and C55xx processors - for use with TI Code Composer (TM) DSP development tools. - Modified from speexlib/testenc.c - - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -/* Modified from speexlib/testenc.c for Code Composer simulator */ - -#include -#include -#include -#include -#include <..\libspeex\arch.h> - -#undef DECODE_ONLY -#define CHECK_RESULT /* Compares original file with encoded/decoder file */ -#define TESTENC_BYTES_PER_FRAME 20 /* 8kbps */ -#define TESTENC_QUALITY 4 /* 8kbps */ -//#define TESTENC_BYTES_PER_FRAME 28 /* 11kbps */ -//#define TESTENC_QUALITY 5 /* 11 kbps */ - -/* For narrowband, QUALITY maps to these bit rates (see modes.c, manual.pdf) - * {1, 8, 2, 3, 3, 4, 4, 5, 5, 6, 7} - * 0 -> 2150 - * 1 -> 3950 - * 2 -> 5950 - * 3 -> 8000 - * 4 -> 8000 - * 5 -> 11000 - * 6 -> 11000 - * 7 -> 15000 - * 8 -> 15000 - * 9 -> 18200 - *10 -> 26400 */ - -#ifdef FIXED_DEBUG -extern long long spx_mips; -#endif -#include - -#ifdef MANUAL_ALLOC -/* Take all Speex space from this private heap */ -/* This is useful for multichannel applications */ -#pragma DATA_SECTION(spxHeap, ".myheap"); -static char spxHeap[SPEEX_PERSIST_STACK_SIZE]; - -#pragma DATA_SECTION(spxScratch, ".myheap"); -static char spxScratch[SPEEX_SCRATCH_STACK_SIZE]; - -char *spxGlobalHeapPtr, *spxGlobalHeapEnd; -char *spxGlobalScratchPtr, *spxGlobalScratchEnd; -#endif - -void byte2word(short* pInBuf, short* pOutBuf, int nWords) -{ - short *pIn, *pOut, sNext; - int i; - - pIn = pInBuf; - pOut = pOutBuf; - for(i=0;i> 8); - } -} - -void main() -{ - char *outFile, *bitsFile; - FILE *fout, *fbits=NULL; -#if !defined(DECODE_ONLY) || defined(CHECK_RESULT) - char *inFile; - FILE *fin; - short in_short[FRAME_SIZE]; -#endif - short out_short[FRAME_SIZE]; - short inout_byte[2*FRAME_SIZE]; -#ifndef DECODE_ONLY - int nbChars; -#endif -#ifdef CHECK_RESULT - float sigpow,errpow,snr, seg_snr=0; - int snr_frames = 0; - int i; -#endif - char cbits[TESTENC_BYTES_PER_FRAME/2 + 2]; /* temp store for encoded data */ - void *st; - void *dec; - SpeexBits bits; - spx_int32_t tmp; - unsigned long bitCount=0; - spx_int32_t skip_group_delay; - SpeexCallback callback; - - /* C54xx defaults to max wait states, even for parts like C5416 with - larger internal memory. Need to force the wait state register to zero */ - -#ifdef CONFIG_TI_C54X - asm(" STM #0,SWWSR"); -#endif - -#ifdef CHECK_RESULT - sigpow = 0; - errpow = 0; -#endif - -#ifdef MANUAL_ALLOC - spxGlobalHeapPtr = spxHeap; - spxGlobalHeapEnd = spxHeap + sizeof(spxHeap); - - spxGlobalScratchPtr = spxScratch; - spxGlobalScratchEnd = spxScratch + sizeof(spxScratch); -#endif - st = speex_encoder_init(&speex_nb_mode); -#ifdef MANUAL_ALLOC - spxGlobalScratchPtr = spxScratch; /* Reuse scratch for decoder */ -#endif - dec = speex_decoder_init(&speex_nb_mode); - - callback.callback_id = SPEEX_INBAND_CHAR; - callback.func = speex_std_char_handler; - callback.data = stderr; - speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback); - - callback.callback_id = SPEEX_INBAND_MODE_REQUEST; - callback.func = speex_std_mode_request_handler; - callback.data = st; - speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback); - - tmp=0; - speex_decoder_ctl(dec, SPEEX_SET_ENH, &tmp); - tmp=0; - speex_encoder_ctl(st, SPEEX_SET_VBR, &tmp); - tmp=TESTENC_QUALITY; - speex_encoder_ctl(st, SPEEX_SET_QUALITY, &tmp); - tmp=1; /* Lowest */ - speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &tmp); - -#ifdef DISABLE_HIGHPASS - /* Turn this off if you want to measure SNR (on by default) */ - tmp=0; - speex_encoder_ctl(st, SPEEX_SET_HIGHPASS, &tmp); - speex_decoder_ctl(dec, SPEEX_SET_HIGHPASS, &tmp); -#endif - - speex_encoder_ctl(st, SPEEX_GET_LOOKAHEAD, &skip_group_delay); - speex_decoder_ctl(dec, SPEEX_GET_LOOKAHEAD, &tmp); - skip_group_delay += tmp; - fprintf (stderr, "decoder lookahead = %ld\n", skip_group_delay); - -#ifdef DECODE_ONLY - bitsFile = "c:\\speextrunktest\\samples\\malebitsin.dat"; - fbits = fopen(bitsFile, "rb"); -#else - bitsFile = "c:\\speextrunktest\\samples\\malebits5x.dat"; - fbits = fopen(bitsFile, "wb"); -#endif -#if !defined(DECODE_ONLY) || defined(CHECK_RESULT) - inFile = "c:\\speextrunktest\\samples\\male.snd"; - fin = fopen(inFile, "rb"); -#endif - outFile = "c:\\speextrunktest\\samples\\maleout5x.snd"; - fout = fopen(outFile, "wb+"); - - speex_bits_init(&bits); -#ifndef DECODE_ONLY - while (!feof(fin)) - { - fread(inout_byte, 2, FRAME_SIZE, fin); - byte2word(inout_byte, in_short, FRAME_SIZE); /* C5x has 16-bit char */ - - if (feof(fin)) - break; - speex_bits_reset(&bits); - - speex_encode_int(st, in_short, &bits); - nbChars = speex_bits_write(&bits, cbits, - sizeof(cbits)*BYTES_PER_CHAR) /BYTES_PER_CHAR; - bitCount+=bits.nbBits; - - word2byte((short *) cbits, inout_byte, nbChars); - fwrite(inout_byte, 2, nbChars, fbits); - speex_bits_rewind(&bits); - -#else /* DECODE_ONLY */ - while (!feof(fbits)) - { - fread(inout_byte, 1, TESTENC_BYTES_PER_FRAME, fbits); - - if (feof(fbits)) - break; - - byte2word(inout_byte, (short *)cbits, TESTENC_BYTES_PER_FRAME/2); - speex_bits_read_from(&bits, cbits, TESTENC_BYTES_PER_FRAME); - bitCount+=160; -#endif - speex_decode_int(dec, &bits, out_short); - speex_bits_reset(&bits); - - word2byte(&out_short[skip_group_delay], inout_byte, FRAME_SIZE-skip_group_delay); - fwrite(inout_byte, 2, FRAME_SIZE-skip_group_delay, fout); - skip_group_delay = 0; -#if 1 - fprintf (stderr, "Bits so far: %lu \n", bitCount); -#endif - } - fprintf (stderr, "Total encoded size: %lu bits\n", bitCount); - speex_encoder_destroy(st); - speex_decoder_destroy(dec); - -#ifdef CHECK_RESULT - rewind(fin); - rewind(fout); - - while ( FRAME_SIZE == fread(inout_byte, 2, FRAME_SIZE, fin)) - { - float s=0, e=0; - - byte2word(inout_byte, in_short, FRAME_SIZE); - fread(inout_byte, 2, FRAME_SIZE, fout); - byte2word(inout_byte, out_short, FRAME_SIZE); - - for (i=0;i -#include -#include -#include - -#undef DECODE_ONLY -#define CHECK_RESULT /* Compares original file with encoded/decoder file */ -#define TESTENC_BYTES_PER_FRAME 20 /* 8kbps */ -#define TESTENC_QUALITY 4 /* 8kbps */ -//#define TESTENC_BYTES_PER_FRAME 28 /* 11kbps */ -//#define TESTENC_QUALITY 5 /* 11 kbps */ - -/* For narrowband, QUALITY maps to these bit rates (see modes.c, manual.pdf) - * {1, 8, 2, 3, 3, 4, 4, 5, 5, 6, 7} - * 0 -> 2150 - * 1 -> 3950 - * 2 -> 5950 - * 3 -> 8000 - * 4 -> 8000 - * 5 -> 11000 - * 6 -> 11000 - * 7 -> 15000 - * 8 -> 15000 - * 9 -> 18200 - *10 -> 26400 */ - -#ifdef FIXED_DEBUG -extern long long spx_mips; -#endif - -#ifdef MANUAL_ALLOC -/* Take all Speex space from this private heap */ -/* This is useful for multichannel applications */ -#pragma DATA_SECTION(spxHeap, ".myheap"); -static char spxHeap[SPEEX_PERSIST_STACK_SIZE]; - -#pragma DATA_SECTION(spxScratch, ".myheap"); -static char spxScratch[SPEEX_SCRATCH_STACK_SIZE]; - -char *spxGlobalHeapPtr, *spxGlobalHeapEnd; -char *spxGlobalScratchPtr, *spxGlobalScratchEnd; -#endif /* MANUAL_ALLOC */ - -#include -void main() -{ - char *outFile, *bitsFile; - FILE *fout, *fbits=NULL; -#if !defined(DECODE_ONLY) || defined(CHECK_RESULT) - char *inFile; - FILE *fin; - short in_short[FRAME_SIZE]; -#endif - short out_short[FRAME_SIZE]; -#ifndef DECODE_ONLY - int nbBits; -#endif -#ifdef CHECK_RESULT - float sigpow,errpow,snr, seg_snr=0; - int snr_frames = 0; - int i; -#endif - char cbits[200]; - void *st; - void *dec; - SpeexBits bits; - spx_int32_t tmp; - unsigned long bitCount=0; - spx_int32_t skip_group_delay; - SpeexCallback callback; - -#ifdef CHECK_RESULT - sigpow = 0; - errpow = 0; -#endif - -#ifdef MANUAL_ALLOC - spxGlobalHeapPtr = spxHeap; - spxGlobalHeapEnd = spxHeap + sizeof(spxHeap); - - spxGlobalScratchPtr = spxScratch; - spxGlobalScratchEnd = spxScratch + sizeof(spxScratch); -#endif - st = speex_encoder_init(&speex_nb_mode); -#ifdef MANUAL_ALLOC - spxGlobalScratchPtr = spxScratch; /* Reuse scratch for decoder */ -#endif - dec = speex_decoder_init(&speex_nb_mode); - - callback.callback_id = SPEEX_INBAND_CHAR; - callback.func = speex_std_char_handler; - callback.data = stderr; - speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback); - - callback.callback_id = SPEEX_INBAND_MODE_REQUEST; - callback.func = speex_std_mode_request_handler; - callback.data = st; - speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback); - - tmp=0; - speex_decoder_ctl(dec, SPEEX_SET_ENH, &tmp); - tmp=0; - speex_encoder_ctl(st, SPEEX_SET_VBR, &tmp); - tmp=TESTENC_QUALITY; - speex_encoder_ctl(st, SPEEX_SET_QUALITY, &tmp); - tmp=1; /* Lowest */ - speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &tmp); - -#ifdef DISABLE_HIGHPASS - /* Turn this off if you want to measure SNR (on by default) */ - tmp=0; - speex_encoder_ctl(st, SPEEX_SET_HIGHPASS, &tmp); - speex_decoder_ctl(dec, SPEEX_SET_HIGHPASS, &tmp); -#endif - - speex_encoder_ctl(st, SPEEX_GET_LOOKAHEAD, &skip_group_delay); - speex_decoder_ctl(dec, SPEEX_GET_LOOKAHEAD, &tmp); - skip_group_delay += tmp; - fprintf (stderr, "decoder lookahead = %d\n", skip_group_delay); - -#ifdef DECODE_ONLY - bitsFile = "c:\\speextrunktest\\samples\\malebitsin.dat"; - fbits = fopen(bitsFile, "rb"); -#else - bitsFile = "c:\\speextrunktest\\samples\\malebits6x.dat"; - fbits = fopen(bitsFile, "wb"); -#endif -#if !defined(DECODE_ONLY) || defined(CHECK_RESULT) - inFile = "c:\\speextrunktest\\samples\\male.snd"; - fin = fopen(inFile, "rb"); -#endif - outFile = "c:\\speextrunktest\\samples\\maleout6x.snd"; - fout = fopen(outFile, "wb+"); - - speex_bits_init(&bits); -#ifndef DECODE_ONLY - while (!feof(fin)) - { - fread(in_short, sizeof(short), FRAME_SIZE, fin); - if (feof(fin)) - break; - speex_bits_reset(&bits); - - speex_encode_int(st, in_short, &bits); - nbBits = speex_bits_write(&bits, cbits, 200); - bitCount+=bits.nbBits; - - fwrite(cbits, 1, nbBits, fbits); - speex_bits_rewind(&bits); - -#else /* DECODE_ONLY */ - while (!feof(fbits)) - { - fread(cbits, 1, TESTENC_BYTES_PER_FRAME, fbits); - - if (feof(fbits)) - break; - - speex_bits_read_from(&bits, cbits, TESTENC_BYTES_PER_FRAME); -// bitCount+=160; /* only correct for 8kbps, but just for the printf */ - bitCount+=bits.nbBits; -#endif - - speex_decode_int(dec, &bits, out_short); - speex_bits_reset(&bits); - - fwrite(&out_short[skip_group_delay], sizeof(short), FRAME_SIZE-skip_group_delay, fout); - skip_group_delay = 0; -#if 1 - fprintf (stderr, "Bits so far: %lu \n", bitCount); -#endif - } - fprintf (stderr, "Total encoded size: %lu bits\n", bitCount); - speex_encoder_destroy(st); - speex_decoder_destroy(dec); - -#ifdef CHECK_RESULT - rewind(fin); - rewind(fout); - - while ( FRAME_SIZE == fread(in_short, sizeof(short), FRAME_SIZE, fin) - && - FRAME_SIZE == fread(out_short, sizeof(short), FRAME_SIZE,fout) ) - { - float s=0, e=0; - for (i=0;i - -#ifdef FIXED_POINT - -#undef sround -#define sround(x) sex16(((x) + (1<<(FRACBITS-1)) ) >> FRACBITS) - -#undef MIN -#undef MAX -#define MIN(a,b) imin(a,b) -#define MAX(a,b) imax(a,b) - -#define TM_MUL(res,a,b) \ - { register int a0, a1, b0, b1; \ - \ - a0 = sex16((a)); \ - a1 = asri(16,(a)); \ - b0 = sex16((b)); \ - b1 = asri(16,(b)); \ - (res)= pack16lsb( \ - sround(ifir16((a),funshift2((b),(b)))), \ - sround(a0*b0-a1*b1)); \ - } \ - -#define TM_ADD(res,a,b) \ - { (res)=dspidualadd((a),(b)); \ - } \ - -#define TM_SUB(res,a,b) \ - { (res)=dspidualsub((a),(b)); \ - } \ - -#define TM_SHR(res,a,shift) \ - { (res)=dualasr((a),(shift)); \ - } \ - -#define TM_DIV(res,c,frac) \ - { register int c1, c0; \ - \ - c1 = asri(16,(c)); \ - c0 = sex16((c)); \ - (res) = pack16lsb(sround(c1 * (32767/(frac))), sround(c0 * (32767/(frac))));\ - } \ - -#define TM_NEGMSB(res, a) \ - { (res) = pack16lsb((ineg(asri(16,(a)))), (a)); \ - } \ - -#else - -#undef MIN -#undef MAX -#define MIN(a,b) fmin(a,b) -#define MAX(a,b) fmax(a,b) - -#endif -#endif - -#undef CHECKBUF -#define CHECKBUF(buf,nbuf,n) \ - { \ - if ( nbuf < (size_t)(n) ) { \ - speex_free(buf); \ - buf = (kiss_fft_cpx*)KISS_FFT_MALLOC(sizeof(kiss_fft_cpx)*(n)); \ - nbuf = (size_t)(n); \ - } \ - } \ - -#undef C_ADD -#define C_ADD( res, a,b) \ - { \ - CHECK_OVERFLOW_OP((a).r,+,(b).r) \ - CHECK_OVERFLOW_OP((a).i,+,(b).i) \ - (res).r=(a).r+(b).r; (res).i=(a).i+(b).i; \ - } \ - - -#undef C_SUB -#define C_SUB( res, a,b) \ - { \ - CHECK_OVERFLOW_OP((a).r,-,(b).r) \ - CHECK_OVERFLOW_OP((a).i,-,(b).i) \ - (res).r=(a).r-(b).r; (res).i=(a).i-(b).i; \ - } \ - -#undef C_ADDTO -#define C_ADDTO( res , a) \ - { \ - CHECK_OVERFLOW_OP((res).r,+,(a).r) \ - CHECK_OVERFLOW_OP((res).i,+,(a).i) \ - (res).r += (a).r; (res).i += (a).i; \ - } \ - -#undef C_SUBFROM -#define C_SUBFROM( res, a) \ - { \ - CHECK_OVERFLOW_OP((res).r,-,(a).r) \ - CHECK_OVERFLOW_OP((res).i,-,(a).i) \ - (res).r -= (a).r; (res).i -= (a).i; \ - } \ - -#undef kf_cexp -#define kf_cexp(x,phase) \ - { (x)->r = KISS_FFT_COS(phase); \ - (x)->i = KISS_FFT_SIN(phase); } \ - -#undef kf_cexp2 -#define kf_cexp2(x,phase) \ - { (x)->r = spx_cos_norm((phase)); \ - (x)->i = spx_cos_norm((phase)-32768); } \ - - -#ifdef FIXED_POINT - -#undef C_MUL -#define C_MUL(m,a,b) \ - { (m).r = sround( smul((a).r,(b).r) - smul((a).i,(b).i) ); \ - (m).i = sround( smul((a).r,(b).i) + smul((a).i,(b).r) ); } \ - -#undef C_FIXDIV -#define C_FIXDIV(c,div) \ - { DIVSCALAR( (c).r , div); \ - DIVSCALAR( (c).i , div); } \ - -#undef C_MULBYSCALAR -#define C_MULBYSCALAR( c, s ) \ - { (c).r = sround( smul( (c).r , s ) ) ; \ - (c).i = sround( smul( (c).i , s ) ) ; } \ - -#else - -#undef C_MUL -#define C_MUL(m,a,b) \ - { (m).r = (a).r*(b).r - (a).i*(b).i; \ - (m).i = (a).r*(b).i + (a).i*(b).r; } \ - - -#undef C_MULBYSCALAR -#define C_MULBYSCALAR( c, s ) \ - { (c).r *= (s); \ - (c).i *= (s); } \ - - - -#endif - -#endif - diff --git a/Engine/lib/speex/tmv/cb_search_tm.h b/Engine/lib/speex/tmv/cb_search_tm.h deleted file mode 100644 index 05ec7111e..000000000 --- a/Engine/lib/speex/tmv/cb_search_tm.h +++ /dev/null @@ -1,149 +0,0 @@ -/* Copyright (C) 2007 Hong Zhiqian */ -/** - @file cb_search_tm.h - @author Hong Zhiqian - @brief Various compatibility routines for Speex (TriMedia version) -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include "profile_tm.h" - -#ifdef FIXED_POINT - -#define OVERRIDE_COMPUTE_WEIGHTED_CODEBOOK -static void compute_weighted_codebook( - const signed char * restrict shape_cb, - const Int16 * restrict r, - Int16 * restrict resp, - Int16 * restrict resp2, - Int32 * restrict E, - int shape_cb_size, int subvect_size, char *stack) -{ - register int i, j; - register int quadsize; - - TMDEBUG_ALIGNMEM(r); - TMDEBUG_ALIGNMEM(resp); - TMDEBUG_ALIGNMEM(resp2); - - COMPUTEWEIGHTEDCODEBOOK_START(); - - quadsize = subvect_size << 2; - - for ( i=0 ; i>= 13; - resj1 >>= 13; - resj2 >>= 13; - resj3 >>= 13; - - e0 += resj0 * resj0; - e1 += resj1 * resj1; - e2 += resj2 * resj2; - e3 += resj3 * resj3; - - resp[j] = resj0; - resp[j+subvect_size] = resj1; - resp[j+2*subvect_size] = resj2; - resp[j+3*subvect_size] = resj3; - } - - E[i] = e0; - E[i+1] = e1; - E[i+2] = e2; - E[i+3] = e3; - - resp += quadsize; - shape_cb += quadsize; - } - -#ifndef REMARK_ON - (void)resp2; - (void)stack; -#endif - - COMPUTEWEIGHTEDCODEBOOK_STOP(); -} - -#define OVERRIDE_TARGET_UPDATE -static inline void target_update(Int16 * restrict t, Int16 g, Int16 * restrict r, int len) -{ - register int n; - register int gr1, gr2, t1, t2, r1, r2; - register int quadsize; - - TARGETUPDATE_START(); - - quadsize = len & 0xFFFFFFFC; - - for ( n=0; n -#include "profile_tm.h" - -#ifdef FIXED_POINT - -#define OVERRIDE_MAXIMIZE_RANGE -static int maximize_range(Int16 *in, Int16 *out, int bound, int len) -{ - register int max_val=0; - register int shift=0; - register int i, j; - - TMDEBUG_ALIGNMEM(in); - TMDEBUG_ALIGNMEM(out); - - MAXIMIZERANGE_START(); - - len >>= 1; - - for ( i=0 ; i>1) && max_val != 0 ) - { max_val <<= 1; - shift++; - } - - if ( shift != 0 ) - { - for ( i=0,j=0 ; i>1); - s = pack16lsb(s,s); - - len >>= 1; - l = len & (int)0xFFFFFFFE; - - for ( i=0,j=0 ; i>= 1; - - for( i=1 ; i -#include "profile_tm.h" - -#ifdef FIXED_POINT - -#define OVERRIDE_FILTERBANK_COMPUTE_BANK32 -void filterbank_compute_bank32(FilterBank * restrict bank, spx_word32_t * restrict ps, spx_word32_t * restrict mel) -{ - register int i, j, k, banks, len, zero, s; - register int * restrict left; - register int * restrict right; - register int * restrict bleft; - register int * restrict bright; - - left = (int*)bank->filter_left; - right = (int*)bank->filter_right; - bleft = (int*)bank->bank_left; - bright = (int*)bank->bank_right; - - TMDEBUG_ALIGNMEM(ps); - TMDEBUG_ALIGNMEM(mel); - TMDEBUG_ALIGNMEM(left); - TMDEBUG_ALIGNMEM(right); - TMDEBUG_ALIGNMEM(bleft); - TMDEBUG_ALIGNMEM(bright); - - FILTERBANKCOMPUTEBANK32_START(); - - banks = bank->nb_banks << 2; - zero = 0; - len = bank->len; - s = (1<<((15))>>1); - -#if (TM_UNROLL && TM_UNROLL_FILTERBANKCOMPUTEBANK32) -#pragma TCS_unroll=2 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i> 15; - ps0_lsb = ps0 & 0x00007fff; - left0 = sex16(left10); - right0 = sex16(right10); - - _mel += left0 * ps0_msb + ((left0 * ps0_lsb + s ) >> 15); - mel[il0]= _mel; - _mel = ld32x(mel,ir0); - _mel += right0 * ps0_msb + ((right0 * ps0_lsb + s ) >> 15); - mel[ir0]= _mel; - - ps1 = ld32x(ps,j); - il1 = ld32x(bleft,j); - _mel = ld32x(mel,il1); - ir1 = ld32x(bright,j); - - left1 = asri(16,left10); - right1 = asri(16,right10); - ps1_msb = ps1 >> 15; - ps1_lsb = ps1 & 0x00007fff; - - _mel += left1 * ps1_msb + ((left1 * ps1_lsb + s ) >> 15); - mel[il1]= _mel; - _mel = ld32x(mel,ir1); - _mel += right1 * ps1_msb + ((right1 * ps1_lsb + s ) >> 15); - mel[ir1]= _mel; - } -#if (TM_UNROLL && TM_UNROLL_FILTERBANKCOMPUTEBANK32) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - - FILTERBANKCOMPUTEBANK32_STOP(); -} - -#define OVERRIDE_FILTERBANK_COMPUTE_PSD16 -void filterbank_compute_psd16(FilterBank * restrict bank, spx_word16_t * restrict mel, spx_word16_t * restrict ps) -{ - register int i, j, k, len, s; - register int * restrict left; - register int * restrict right; - register int * restrict bleft; - register int * restrict bright; - - left = (int*)bank->filter_left; - right = (int*)bank->filter_right; - bleft = (int*)bank->bank_left; - bright = (int*)bank->bank_right; - - TMDEBUG_ALIGNMEM(ps); - TMDEBUG_ALIGNMEM(mel); - TMDEBUG_ALIGNMEM(left); - TMDEBUG_ALIGNMEM(right); - TMDEBUG_ALIGNMEM(bleft); - TMDEBUG_ALIGNMEM(bright); - - FILTERBANKCOMPUTEPSD16_START(); - - len = bank->len; - s = (1<<((15))>>1); - -#if (TM_UNROLL && TM_UNROLL_FILTERBANKCOMPUTEPSD16) -#pragma TCS_unroll=2 -#pragma TCS_unrollexact=1 -#endif - for ( i=0,j=0,k=0 ; i>= 15; - - il1 = ld32x(bleft, i+1); - ir1 = ld32x(bright,i+1); - mell1 = mel[il1]; - melr1 = mel[ir1]; - mel1 = pack16lsb(mell1, melr1); - lr1 = pack16msb(left10, right10); - - acc1 += ifir16(mel1, lr1); - acc1 >>= 15; - - ps10 = pack16lsb(acc1, acc0); - - st32d(j, ps, ps10); - } -#if (TM_UNROLL && TM_UNROLL_FILTERBANKCOMPUTEPSD16) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - - FILTERBANKCOMPUTEPSD16_STOP(); -} - -#else - -#define OVERRIDE_FILTERBANK_COMPUTE_BANK32 -void filterbank_compute_bank32(FilterBank * restrict bank, float * restrict ps, float * restrict mel) -{ - register int i, banks, len; - register int * restrict bleft, * restrict bright; - register float * restrict left, * restrict right; - - banks = bank->nb_banks; - len = bank->len; - bleft = bank->bank_left; - bright= bank->bank_right; - left = bank->filter_left; - right = bank->filter_right; - - FILTERBANKCOMPUTEBANK32_START(); - - memset(mel, 0, banks * sizeof(float)); - -#if (TM_UNROLL && TM_UNROLL_FILTERBANKCOMPUTEBANK32) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; ilen; - bleft = bank->bank_left; - bright= bank->bank_right; - left = bank->filter_left; - right = bank->filter_right; - - FILTERBANKCOMPUTEPSD16_START(); - -#if (TM_UNROLL && TM_UNROLL_FILTERBANKCOMPUTEPSD16) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i -#include "profile_tm.h" - -#ifdef FIXED_POINT - -#define iadd(a,b) ((a) + (b)) - -#define OVERRIDE_BW_LPC -void bw_lpc(Int16 gamma, const Int16 *lpc_in, Int16 *lpc_out, int order) -{ - register int tmp, g, i; - - TMDEBUG_ALIGNMEM(lpc_in); - TMDEBUG_ALIGNMEM(lpc_out); - - BWLPC_START(); - - tmp = g = gamma; - for ( i=0 ; i<4 ; i+=2,lpc_out+=4 ) - { register int in10, y1, y0, y10; - register int in32, y3, y2, y32; - - in10 = ld32x(lpc_in,i); - y0 = ((tmp * sex16(in10)) + 16384) >> 15; - tmp = ((tmp * g) + 16384) >> 15; - y1 = ((tmp * asri(16,in10)) + 16384) >> 15; - tmp = ((tmp * g) + 16384) >> 15; - y10 = pack16lsb(y1,y0); - st32(lpc_out,y10); - - in32 = ld32x(lpc_in,i+1); - y2 = ((tmp * sex16(in32)) + 16384) >> 15; - tmp = ((tmp * g) + 16384) >> 15; - y3 = ((tmp * asri(16,in32)) + 16384) >> 15; - tmp = ((tmp * g) + 16384) >> 15; - y32 = pack16lsb(y3,y2); - st32d(4,lpc_out,y32); - } - - if ( order == 10 ) - { register int in10, y1, y0, y10; - - in10 = ld32x(lpc_in,i); - y0 = ((tmp * sex16(in10)) + 16384) >> 15; - tmp = ((tmp * g) + 16384) >> 15; - y1 = ((tmp * asri(16,in10)) + 16384) >> 15; - tmp = ((tmp * g) + 16384) >> 15; - y10 = pack16lsb(y1,y0); - st32(lpc_out,y10); - } - - BWLPC_STOP(); -} - - -#define OVERRIDE_HIGHPASS -void highpass(const Int16 *x, Int16 *y, int len, int filtID, Int32 *mem) -{ - const Int16 Pcoef[5][3] = {{16384, -31313, 14991}, {16384, -31569, 15249}, {16384, -31677, 15328}, {16384, -32313, 15947}, {16384, -22446, 6537}}; - const Int16 Zcoef[5][3] = {{15672, -31344, 15672}, {15802, -31601, 15802}, {15847, -31694, 15847}, {16162, -32322, 16162}, {14418, -28836, 14418}}; - register int i; - register int den1, den2, num0, num1, num2, den11, den22, mem0, mem1; - - TMDEBUG_ALIGNMEM(mem); - - HIGHPASS_START(); - - filtID = imin(4, filtID); - - den1 = -Pcoef[filtID][1]; - den2 = -Pcoef[filtID][2]; - num0 = Zcoef[filtID][0]; - num1 = Zcoef[filtID][1]; - num2 = Zcoef[filtID][2]; - den11 = den1 << 1; - den22 = den2 << 1; - mem0 = mem[0]; - mem1 = mem[1]; - -#if (TM_UNROLL && TM_UNROLL_HIGHPASS) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i> 15; - vout_d = vout & 0x7FFF; - yi = iclipi(PSHR32(vout,14),32767); - mem0 = (mem1 + num1 * xi) + (den11 * vout_i) + (((den1 * vout_d) >> 15) << 1); - mem1 = (num2 * xi) + (den22 * vout_i) + (((den2 * vout_d) >> 15) << 1); - - y[i] = yi; - } -#if (TM_UNROLL && TM_UNROLL_HIGHPASS) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - - mem[0] = mem0; - mem[1] = mem1; - - HIGHPASS_STOP(); -} - - -#define OVERRIDE_SIGNALMUL -void signal_mul(const Int32 *x, Int32 *y, Int32 scale, int len) -{ - register int i, scale_i, scale_d; - - SIGNALMUL_START(); - - scale_i = scale >> 14; - scale_d = scale & 0x3FFF; - -#if (TM_UNROLL && TM_UNROLL_SIGNALMUL) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i> 7; - - y[i] = ((xi * scale_i + ((xi * scale_d) >> 14)) << 7); - - } -#if (TM_UNROLL && TM_UNROLL_SIGNALMUL) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - - SIGNALMUL_STOP(); -} - -#define OVERRIDE_SIGNALDIV -void signal_div(const Int16 *x, Int16 *y, Int32 scale, int len) -{ - register int i; - - SIGNALDIV_START(); - - if (scale > SHL32(EXTEND32(SIG_SCALING), 8)) - { - register int scale_1; - scale = PSHR32(scale, SIG_SHIFT); - scale_1 = DIV32_16(SHL32(EXTEND32(SIG_SCALING),7),scale); -#if (TM_UNROLL && TM_UNROLL_SIGNALDIV) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i SHR32(EXTEND32(SIG_SCALING), 2)) { - - register int scale_1; - scale = PSHR32(scale, SIG_SHIFT-5); - scale_1 = DIV32_16(SHL32(EXTEND32(SIG_SCALING),3),scale); -#if (TM_UNROLL && TM_UNROLL_SIGNALDIV) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for (i=0;i16383 ) - { sig_shift++; - max_val >>= 1; - } - - - for ( i=0 ; i> sig_shift, ld32x(x,i+1) >> sig_shift); - acc1 = pack16lsb(ld32x(x,i+2) >> sig_shift, ld32x(x,i+3) >> sig_shift); - acc2 = ifir16(acc0,acc0) + ifir16(acc1, acc1); - sum += acc2 >> 6; - } - - return EXTRACT16(PSHR32(SHL32(EXTEND32(spx_sqrt(DIV32(sum,len))),(sig_shift+3)),SIG_SHIFT)); -} - -#define OVERRIDE_COMPUTE_RMS16 -Int16 compute_rms16(const Int16 *x, int len) -{ - register int max_val, i; - - COMPUTERMS16_START(); - - max_val = 10; - -#if 0 - - { - register int len2 = len >> 1; -#if (TM_UNROLL && TM_UNROLL_COMPUTERMS16) -#pragma TCS_unroll=2 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i16383) - { - register int sum = 0; -#if (TM_UNROLL && TM_UNROLL_COMPUTERMS16) -#pragma TCS_unroll=2 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i> 6; - } -#if (TM_UNROLL && TM_UNROLL_COMPUTERMS16) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - COMPUTERMS16_STOP(); - return spx_sqrt(sum/len) << 4; - } else - { - register int sig_shift; - register int sum=0; - - sig_shift = mux(max_val < 8192, 1, 0); - sig_shift = mux(max_val < 4096, 2, sig_shift); - sig_shift = mux(max_val < 2048, 3, sig_shift); - -#if (TM_UNROLL && TM_UNROLL_COMPUTERMS16) -#pragma TCS_unroll=2 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i> 6; - } -#if (TM_UNROLL && TM_UNROLL_COMPUTERMS16) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - COMPUTERMS16_STOP(); - return spx_sqrt(sum/len) << (3 - sig_shift); - } - } - -#else - { -#if (TM_UNROLL && TM_UNROLL_COMPUTERMS16) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i16383) - { - register int sum = 0; -#if (TM_UNROLL && TM_UNROLL_COMPUTERMS16) -#pragma TCS_unroll=2 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i> 6; - } -#if (TM_UNROLL && TM_UNROLL_COMPUTERMS16) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - COMPUTERMS16_STOP(); - return spx_sqrt(sum/len) << 4; - } else { - register int sig_shift; - register int sum=0; - - sig_shift = mux(max_val < 8192, 1, 0); - sig_shift = mux(max_val < 4096, 2, sig_shift); - sig_shift = mux(max_val < 2048, 3, sig_shift); - -#if (TM_UNROLL && TM_UNROLL_COMPUTERMS16) -#pragma TCS_unroll=2 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i> 6; - } -#if (TM_UNROLL && TM_UNROLL_COMPUTERMS16) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - COMPUTERMS16_STOP(); - return spx_sqrt(sum/len) << (3 - sig_shift); - } - } -#endif -} - -int normalize16_9(const Int32* restrict x, Int16 * restrict y, Int32 max_scale) -{ - register int x0, x1, x2, x3, x4, x5, x6, x7, x8; - register int max_val, m0, m1, m2, m3, m4; - register int sig_shift; - register int y10, y32, y54, y76; - - TMDEBUG_ALIGNMEM(x); - - x0 = ld32(x); - x1 = ld32x(x,1); x2 = ld32x(x,2); x3 = ld32x(x,3); x4 = ld32x(x,4); - x5 = ld32x(x,5); x6 = ld32x(x,6); x7 = ld32x(x,7); x8 = ld32x(x,8); - - m0 = imax(iabs(x0), iabs(x1)); - m1 = imax(iabs(x2), iabs(x3)); - m2 = imax(iabs(x4), iabs(x5)); - m3 = imax(iabs(x6), iabs(x7)); - m4 = imax(m0, iabs(x8)); - m1 = imax(m1, m2); - m3 = imax(m3, m4); - max_val = imax(1,imax(m1,m3)); - - sig_shift=0; - while (max_val>max_scale) - { sig_shift++; - max_val >>= 1; - } - - if ( sig_shift != 0 ) - { - y10 = pack16lsb(x1 >> sig_shift, x0 >> sig_shift); - y32 = pack16lsb(x3 >> sig_shift, x2 >> sig_shift); - y54 = pack16lsb(x5 >> sig_shift, x4 >> sig_shift); - y76 = pack16lsb(x7 >> sig_shift, x6 >> sig_shift); - - y[8] = x8 >> sig_shift; - st32(y,y10); - st32d(4,y,y32); - st32d(8,y,y54); - st32d(12,y,y76); - } - return sig_shift; -} - -int normalize16_mod8(const Int32 * restrict x, Int16 * restrict y, Int32 max_scale,int len) -{ - register int i, max_val, sig_shift; - - TMDEBUG_ALIGNMEM(x); - - max_val = 1; - - for ( i=0 ; imax_scale) - { sig_shift++; - max_val >>= 1; - } - - if ( sig_shift != 0 ) - { - for ( i=0 ; i> sig_shift, x0 >> sig_shift); - y32 = pack16lsb(x3 >> sig_shift, x2 >> sig_shift); - y54 = pack16lsb(x5 >> sig_shift, x4 >> sig_shift); - y76 = pack16lsb(x7 >> sig_shift, x6 >> sig_shift); - - st32(y,y10); - st32d(4,y,y32); - st32d(8,y,y54); - st32d(12,y,y76); - } - } - return sig_shift; -} - - -#define OVERRIDE_NORMALIZE16 -int normalize16(const Int32 *x, Int16 *y, Int32 max_scale, int len) -{ - TMDEBUG_ALIGNMEM(x); - TMDEBUG_ALIGNMEM(y); - - NORMALIZE16_START(); - - if ( len == 9 ) - { NORMALIZE16_STOP(); - return normalize16_9(x,y,max_scale); - } else - { NORMALIZE16_STOP(); - return normalize16_mod8(x,y,max_scale,len); - } -} - - -void filter_mem16_10(const Int16 *x, const Int16 *num, const Int16 *den, Int16 *y, int N, Int32 *mem) -{ - register int i; - register int c9, c8, c7, c6, c5; - register int c4, c3, c2, c1, c0; - register int input; - register int output_0, output_1, output_2, output_3, output_4; - register int output_5, output_6, output_7, output_8, output_9; - register Int16 xi, yi; - - c9 = pack16lsb(-den[9],num[9]); - c8 = pack16lsb(-den[8],num[8]); - c7 = pack16lsb(-den[7],num[7]); - c6 = pack16lsb(-den[6],num[6]); - c5 = pack16lsb(-den[5],num[5]); - c4 = pack16lsb(-den[4],num[4]); - c3 = pack16lsb(-den[3],num[3]); - c2 = pack16lsb(-den[2],num[2]); - c1 = pack16lsb(-den[1],num[1]); - c0 = pack16lsb(-den[0],num[0]); - - output_0 = mem[0]; - output_1 = mem[1]; - output_2 = mem[2]; - output_3 = mem[3]; - output_4 = mem[4]; - output_5 = mem[5]; - output_6 = mem[6]; - output_7 = mem[7]; - output_8 = mem[8]; - output_9 = mem[9]; - -#if (TM_UNROLL && TM_UNROLL_FILTER) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - - for ( i=0 ; i> 1; - - c67 = ld32x(num,3); - c45 = ld32x(num,2); - c23 = ld32x(num,1); - c01 = ld32x(num,0); - - c67 = funshift2(c67,c67); - c45 = funshift2(c45,c45); - c23 = funshift2(c23,c23); - c01 = funshift2(c01,c01); - - b3 = x76 = ld32x(x,N_2-1); - b2 = x54 = ld32x(x,N_2-2); - b1 = x32 = ld32x(x,N_2-3); - b0 = x10 = ld32x(x,N_2-4); - -#if (TM_UNROLL && TM_UNROLL_FILTER > 0) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - - for ( i=N-1 ; i >= 8 ; --i ) - { - xi = asri(16,x76); - x76 = funshift2(x76, x54); - x54 = funshift2(x54, x32); - x32 = funshift2(x32, x10); - x10 = pack16lsb(x10, (int)x[i-8]); - - r2 = iadd(ifir16(x10,c67),ifir16(x32,c45)); - r3 = iadd(ifir16(x54,c23),ifir16(x76,c01)); - r1 = iadd(r2,r3); - - y[i] = iclipi(iadd(xi,PSHR32(r1,LPC_SHIFT)),32767); - } - for ( i=7, a=(Int16*)mem ; i>=0 ; --i ) - { - xi = asri(16,x76); - x76 = funshift2(x76, x54); - x54 = funshift2(x54, x32); - x32 = funshift2(x32, x10); - x10 = pack16lsb(x10, (int)a[i]); - - r2 = iadd(ifir16(x10,c67),ifir16(x32,c45)); - r3 = iadd(ifir16(x54,c23),ifir16(x76,c01)); - r1 = iadd(r2,r3); - - y[i] = iclipi(iadd(xi,PSHR32(r1,LPC_SHIFT)),32767); - } - -#if (TM_UNROLL && TM_UNROLL_FILTER > 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - - mem[0] = b0; - mem[1] = b1; - mem[2] = b2; - mem[3] = b3; -} - -void fir_mem16_10(const Int16 *x, const Int16 *num, Int16 *y, int N, Int32 *mem) -{ - register int N_2, i; - register int c89, c67, c45, c23, c01; - register int b0, b1, b2, b3, b4; - register int r1, r2, r3, r4, r5; - register int x10, x32, x54, x76, x98, xi; - register Int16 *a; - - N_2 = N >> 1; - - c89 = ld32x(num,4); - c67 = ld32x(num,3); - c45 = ld32x(num,2); - c23 = ld32x(num,1); - c01 = ld32x(num,0); - - c89 = funshift2(c89,c89); - c67 = funshift2(c67,c67); - c45 = funshift2(c45,c45); - c23 = funshift2(c23,c23); - c01 = funshift2(c01,c01); - - b4 = x98 = ld32x(x,N_2-1); - b3 = x76 = ld32x(x,N_2-2); - b2 = x54 = ld32x(x,N_2-3); - b1 = x32 = ld32x(x,N_2-4); - b0 = x10 = ld32x(x,N_2-5); - -#if (TM_UNROLL && TM_UNROLL_FIR > 0) -#pragma TCS_unroll=5 -#pragma TCS_unrollexact=1 -#endif - - for ( i=N-1 ; i >= 10 ; --i ) - { - xi = asri(16,x98); - x98 = funshift2(x98, x76); - x76 = funshift2(x76, x54); - x54 = funshift2(x54, x32); - x32 = funshift2(x32, x10); - x10 = pack16lsb(x10, (int)(x[i-10])); - - r2 = iadd(ifir16(x10,c89),ifir16(x32,c67)); - r3 = iadd(ifir16(x54,c45),ifir16(x76,c23)); - r4 = ifir16(x98,c01); - r5 = iadd(r2,r3); - r1 = iadd(r4,r5); - - y[i] = iclipi(iadd(xi,PSHR32(r1,LPC_SHIFT)),32767); - } - - for ( i=9,a =(Int16*)mem ; i>=0 ; --i ) - { - xi = asri(16,x98); - x98 = funshift2(x98, x76); - x76 = funshift2(x76, x54); - x54 = funshift2(x54, x32); - x32 = funshift2(x32, x10); - x10 = pack16lsb(x10, (int)(a[i])); - - r2 = iadd(ifir16(x10,c89),ifir16(x32,c67)); - r3 = iadd(ifir16(x54,c45),ifir16(x76,c23)); - r4 = ifir16(x98,c01); - r5 = iadd(r2,r3); - r1 = iadd(r4,r5); - - y[i] = iclipi(iadd(xi,PSHR32(r1,LPC_SHIFT)),32767); - } - -#if (TM_UNROLL && TM_UNROLL_FIR > 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - - mem[0] = b0; - mem[1] = b1; - mem[2] = b2; - mem[3] = b3; - mem[4] = b4; - - -} - -#define OVERRIDE_FIR_MEM16 -void fir_mem16(const spx_word16_t *x, const Int16 *num, spx_word16_t *y, int N, int ord, Int32 *mem, char *stack) -{ - TMDEBUG_ALIGNMEM(x); - TMDEBUG_ALIGNMEM(y); - TMDEBUG_ALIGNMEM(num); - - FIRMEM16_START(); - - if(ord==10) - fir_mem16_10(x, num, y, N, mem); - else if (ord==8) - fir_mem16_8(x, num, y, N, mem); - -#ifndef REMARK_ON - (void)stack; -#endif - - FIRMEM16_STOP(); -} - - - -#define OVERRIDE_SYN_PERCEP_ZERO16 -void syn_percep_zero16(const Int16 *xx, const Int16 *ak, const Int16 *awk1, const Int16 *awk2, Int16 *y, int N, int ord, char *stack) -{ - register int i,j; - VARDECL(Int32 *mem); - ALLOC(mem, ord, Int32); - - TMDEBUG_ALIGNMEM(mem); - - for ( i=0,j=0 ; i 0) -#pragma TCS_unroll=2 -#pragma TCS_unrollexact=1 -#endif - for ( i=24 ; i 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - y10 = y32 = y54 = y76 = y98 = 0; - awk_01 = ld32(awk2); - awk_23 = ld32x(awk2,1); - awk_45 = ld32x(awk2,2); - awk_67 = ld32x(awk2,3); - awk_89 = ld32x(awk2,4); - - awk_01 = funshift2(awk_01, awk_01); - awk_23 = funshift2(awk_23, awk_23); - awk_45 = funshift2(awk_45, awk_45); - awk_67 = funshift2(awk_67, awk_67); - awk_89 = funshift2(awk_89, awk_89); - -#if (TM_UNROLL && TM_UNROLL_COMPUTEIMPULSERESPONSE > 0) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - y10 = y32 = y54 = y76 = y98 = 0; - awk_01 = ld32(ak); - awk_23 = ld32x(ak,1); - awk_45 = ld32x(ak,2); - awk_67 = ld32x(ak,3); - awk_89 = ld32x(ak,4); - awk_01 = funshift2(awk_01, awk_01); - awk_23 = funshift2(awk_23, awk_23); - awk_45 = funshift2(awk_45, awk_45); - awk_67 = funshift2(awk_67, awk_67); - awk_89 = funshift2(awk_89, awk_89); - -#if (TM_UNROLL && TM_UNROLL_COMPUTEIMPULSERESPONSE > 0) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif -} - -void compute_impulse_response_8(const Int16 *ak, const Int16 *awk1, const Int16 *awk2, Int16 *y, int N) -{ - register int awk_01, awk_23, awk_45, awk_67; - register int y10, y32, y54, y76, yi; - register int i, acc0, acc1, N_2; - - N_2 = N << 1; - - awk_01 = ld32(awk1); - awk_23 = ld32x(awk1,1); - awk_45 = ld32x(awk1,2); - awk_67 = ld32x(awk1,3); - - y10 = funshift2(awk_01, LPC_SCALING << 16); - st32d(0, y, y10); - y32 = funshift2(awk_23, awk_01); - st32d(4, y, y32); - y54 = funshift2(awk_45, awk_23); - st32d(8, y, y54); - y76 = funshift2(awk_67, awk_45); - st32d(12, y, y76); - y10 = funshift2(0, awk_67); - st32d(16, y, y10); - st32d(20, y, 0); - -#if (TM_UNROLL && TM_UNROLL_COMPUTEIMPULSERESPONSE > 0) -#pragma TCS_unroll=2 -#pragma TCS_unrollexact=1 -#endif - for ( i=24 ; i 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - y10 = y32 = y54 = y76 = 0; - awk_01 = ld32(awk2); - awk_23 = ld32x(awk2,1); - awk_45 = ld32x(awk2,2); - awk_67 = ld32x(awk2,3); - - awk_01 = funshift2(awk_01, awk_01); - awk_23 = funshift2(awk_23, awk_23); - awk_45 = funshift2(awk_45, awk_45); - awk_67 = funshift2(awk_67, awk_67); -#if (TM_UNROLL && TM_UNROLL_COMPUTEIMPULSERESPONSE > 0) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - y10 = y32 = y54 = y76 = 0; - awk_01 = ld32(ak); - awk_23 = ld32x(ak,1); - awk_45 = ld32x(ak,2); - awk_67 = ld32x(ak,3); - awk_01 = funshift2(awk_01, awk_01); - awk_23 = funshift2(awk_23, awk_23); - awk_45 = funshift2(awk_45, awk_45); - awk_67 = funshift2(awk_67, awk_67); -#if (TM_UNROLL && TM_UNROLL_COMPUTEIMPULSERESPONSE > 0) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif -} - - -#define OVERRIDE_COMPUTE_IMPULSE_RESPONSE -void compute_impulse_response(const Int16 *ak, const Int16 *awk1, const Int16 *awk2, Int16 *y, int N, int ord, char *stack) -{ - TMDEBUG_ALIGNMEM(ak); - TMDEBUG_ALIGNMEM(awk1); - TMDEBUG_ALIGNMEM(awk2); - TMDEBUG_ALIGNMEM(y); - - COMPUTEIMPULSERESPONSE_START(); - if ( ord == 10 ) - compute_impulse_response_10(ak,awk1,awk2,y,N); - else - compute_impulse_response_8(ak,awk1,awk2,y,N); - - (void)stack; - - COMPUTEIMPULSERESPONSE_STOP(); -} - - -#define OVERRIDE_QMFSYNTH -void qmf_synth(const Int16 *x1, const Int16 *x2, const Int16 *a, Int16 *y, int N, int M, Int32 *mem1, Int32 *mem2, char *stack) - /* assumptions: - all odd x[i] are zero -- well, actually they are left out of the array now - N and M are multiples of 4 */ -{ - register int i, j; - register int M2, N2; - VARDECL(int *x12); - M2 = M>>1; - N2 = N>>1; - ALLOC(x12, M2+N2, int); - - - TMDEBUG_ALIGNMEM(a); - TMDEBUG_ALIGNMEM(x12); - TMDEBUG_ALIGNMEM(mem1); - TMDEBUG_ALIGNMEM(mem2); - - QMFSYNTH_START(); - -#if (TM_UNROLL && TM_UNROLL_QMFSYNTH > 0) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - for (i = 0; i < N2; i += 2) - { - register int y0, y1, y2, y3; - register int x12_0; - - y0 = y1 = y2 = y3 = 0; - x12_0 = x12[N2-2-i]; - - for (j = 0; j < M2; j += 2) - { - register int x12_1; - register int a10, a11, a0_0; - register int _a10, _a11, _a0_0; - - a10 = ld32x(a,j); - a11 = pack16msb(a10,a10); - a0_0= pack16lsb(a10,ineg(sex16(a10))); - x12_1 = x12[N2-1+j-i]; - - y0 += ifir16(a0_0,x12_1); - y1 += ifir16(a11, x12_1); - y2 += ifir16(a0_0,x12_0); - y3 += ifir16(a11 ,x12_0); - - - _a10 = ld32x(a,j+1); - _a11 = pack16msb(_a10,_a10); - _a0_0 = pack16lsb(_a10,ineg(sex16(_a10))); - x12_0 = x12[N2+j-i]; - - y0 += ifir16(_a0_0,x12_0); - y1 += ifir16(_a11, x12_0); - y2 += ifir16(_a0_0,x12_1); - y3 += ifir16(_a11 ,x12_1); - - } - y[2*i] = EXTRACT16(SATURATE32(PSHR32(y0,15),32767)); - y[2*i+1] = EXTRACT16(SATURATE32(PSHR32(y1,15),32767)); - y[2*i+2] = EXTRACT16(SATURATE32(PSHR32(y2,15),32767)); - y[2*i+3] = EXTRACT16(SATURATE32(PSHR32(y3,15),32767)); - } - -#if (TM_UNROLL && TM_UNROLL_QMFSYNTH > 0) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for (i = 0; i < M2; ++i) - { mem1[2*i+1] = asri(16,x12[i]); - mem2[2*i+1] = sex16(x12[i]); - } -#if (TM_UNROLL && TM_UNROLL_QMFSYNTH > 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - - QMFSYNTH_STOP(); -} - - -#define OVERRIDE_QMFDECOMP -void qmf_decomp(const Int16 *xx, const Int16 *aa, Int16 *y1, Int16 *y2, int N, int M, Int16 *mem, char *stack) -{ - VARDECL(int *_a); - VARDECL(int *_x); - register int i, j, k, MM, M2, N2; - register int _xx10, _mm10; - register int *_x2; - - M2=M>>1; - N2=N>>1; - MM=(M-2)<<1; - - ALLOC(_a, M2, int); - ALLOC(_x, N2+M2, int); - _x2 = _x + M2 - 1; - - TMDEBUG_ALIGNMEM(xx); - TMDEBUG_ALIGNMEM(aa); - TMDEBUG_ALIGNMEM(y1); - TMDEBUG_ALIGNMEM(y2); - TMDEBUG_ALIGNMEM(mem); - TMDEBUG_ALIGNMEM(_a); - TMDEBUG_ALIGNMEM(_x); - - QMFDECOMP_START(); - - _xx10 = ld32(xx); - _xx10 = dualasr(_xx10,1); - _mm10 = ld32(mem); - _x2[0] = pack16lsb(_xx10,_mm10); - -#if (TM_UNROLL && TM_UNROLL_QMFSYNTH > 0) -#pragma TCS_unroll=2 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - mem[M-2] = xx[N-M+1] >> 1; - - - M2 >>= 1; - for ( i=0 ; i - - -#undef SATURATE -#undef SATURATE16 -#undef SATURATE32 -#define SATURATE(x,a) iclipi(x,a) -#define SATURATE16(x,a) iclipi(x,a) -#define SATURATE32(x,a) iclipi(x,a) - -#undef EXTEND32 -#define EXTEND32(x) sex16(x) - -#undef NEG16 -#undef NEG32 -#define NEG16(x) ineg((int)(x)) -#define NEG32(x) ineg(x) - -#undef ABS -#undef ABS16 -#undef ABS32 -#define ABS(x) iabs(x) -#define ABS32(x) iabs(x) -#define ABS16(x) iabs((int)(x)) - -#undef MIN16 -#undef MIN32 -#define MIN16(a,b) imin((int)(a),(int)(b)) -#define MIN32(a,b) imin(a,b) - -#undef MAX16 -#undef MAX32 -#define MAX16(a,b) imax((int)(a),(int)(b)) -#define MAX32(a,b) imax(a,b) - -#undef ADD16 -#undef SUB16 -#undef ADD32 -#undef SUB32 -#undef MULT16_16 -#undef MULT16_16_16 - -#define ADD16(a,b) ((int)(a) + (int)(b)) -#define SUB16(a,b) ((int)(a) - (int)(b)) -#define ADD32(a,b) ((int)(a) + (int)(b)) -#define SUB32(a,b) ((int)(a) - (int)(b)) -#define MULT16_16_16(a,b) ((int)(a) * (int)(b)) -#define MULT16_16(a,b) ((int)(a) * (int)(b)) - -#if TM_DEBUGMEM_ALIGNNMENT -#include -#define TMDEBUG_ALIGNMEM(x) \ - { if( ((int)(x) & (int)(0x00000003)) != 0 ) \ - { printf("memory not align. file: %s, line: %d\n", __FILE__, __LINE__); \ - } \ - } - -#else -#define TMDEBUG_ALIGNMEM(x) -#endif - -#endif - diff --git a/Engine/lib/speex/tmv/kiss_fft_tm.h b/Engine/lib/speex/tmv/kiss_fft_tm.h deleted file mode 100644 index 6f8b985c1..000000000 --- a/Engine/lib/speex/tmv/kiss_fft_tm.h +++ /dev/null @@ -1,599 +0,0 @@ -/* Copyright (C) 2007 Hong Zhiqian */ -/** - @file kiss_fft_tm.h - @author Hong Zhiqian - @brief Various compatibility routines for Speex (TriMedia version) -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "_kiss_fft_guts_tm.h" - -#ifdef TM_ASM - -#include "profile_tm.h" - -#ifdef FIXED_POINT - -#define OVERRIDE_KFBFLY2 -static void kf_bfly2( - kiss_fft_cpx *Fout, - const int fstride, - const kiss_fft_cfg st, - int m - ) -{ - register int * restrict Fout2; - register int * restrict tw1 = (int*)st->twiddles; - register int i, j; - register int _inv = !st->inverse; - - Fout2 = (int*)Fout + m; - - for ( i=0,j=0 ; iinverse; - - tw3 = tw2 = tw1 = (int*)st->twiddles; - fstride2 = fstride << 1; - fstride3 = fstride * 3; - - Fout1 = (int*)Fout + m; - Fout2 = (int*)Fout + (m << 1); - Fout3 = (int*)Fout + (m * 3); - - - for ( i=0,j=0 ; iinverse; - - tw1 = tw2 = (int*)st->twiddles; - Fout1 = (int*)Fout + m; - Fout2 = (int*)Fout + (m << 1); - epi = tw1[fstride*m]; - epi = pack16lsb(epi,epi); - fstride2 = fstride << 1; - - for ( i=0,j=0 ; iinverse; - - - Fout1=(int*)Fout+m; - Fout2=(int*)Fout+(m<<1); - Fout3=(int*)Fout+(3 *m); - Fout4=(int*)Fout+(m<<2); - - tw1 = tw2 = tw3 = tw4 = (int*)st->twiddles; - - i = tw1[fstride*m]; - yab_lsb = tw1[fstride*(m<<1)]; - yab_msb = pack16msb(i, yab_lsb); - yab_lsb = pack16lsb(i, yab_lsb); - yba_msb = funshift2(-sex16(yab_msb), yab_msb); - yba_lsb = funshift2(yab_lsb, yab_lsb); - - fstride2 = fstride << 1; - fstride3 = fstride * 3; - fstride4 = fstride << 2; - - for ( i=0,j=0 ; iinverse; - register int i, j, k, l; - register int * restrict twiddles = (int*)st->twiddles; - register int Norig = st->nfft; - - CHECKBUF(scratchbuf,nscratchbuf,p); - - for ( i=0; i=Norig ) - { twidx -= Norig; - } - - sc = ld32x(scratchbuf,l); - tw = ld32x(twiddles,twidx); - - TM_MUL(sc, sc, tw); - TM_ADD(f10, f10, sc); - } - st32d(k<<2, Fout, f10); - } - } -} - -#else - -#define OVERRIDE_KFBFLY2 -static void kf_bfly2( - kiss_fft_cpx * Fout, - const size_t fstride, - const kiss_fft_cfg st, - int m - ) -{ - register kiss_fft_cpx * restrict Fout2; - register kiss_fft_cpx * restrict tw1 = st->twiddles; - - Fout2 = Fout + m; - - do - { - register kiss_fft_cpx _fout2, _fout, t; - - _fout2 = *Fout2; - _fout = *Fout; - - C_MUL ( t, _fout2, *tw1); - C_SUB (_fout2, _fout, t); - C_ADD (_fout, _fout, t); - - *Fout2 = _fout2; - *Fout = _fout; - - tw1 += fstride; - ++Fout2; - ++Fout; - - } while ( --m ); -} - -#define OVERRIDE_KFBFLY4 -static void kf_bfly4( - kiss_fft_cpx * Fout, - const int fstride, - const kiss_fft_cfg st, - int m - ) -{ - register kiss_fft_cpx * restrict tw1,* restrict tw2,* restrict tw3; - register kiss_fft_cpx * restrict Fout1, * restrict Fout2, * restrict Fout3; - register int _inv = !st->inverse; - - tw3 = tw2 = tw1 = st->twiddles; - - Fout1 = Fout + m; - Fout2 = Fout + (m << 1); - Fout3 = Fout + (m * 3); - - do { - - register kiss_fft_cpx _fout; - register kiss_fft_cpx sc0, sc1, sc2, sc3, sc4, sc5; - - _fout = *Fout; - - C_MUL( sc0,*Fout1, *tw1); - C_MUL( sc1,*Fout2, *tw2); - C_MUL( sc2,*Fout3, *tw3); - C_SUB( sc5, _fout, sc1); - C_ADD( _fout, _fout, sc1); - C_ADD( sc3, sc0, sc2); - C_SUB( sc4, sc0, sc2); - C_SUB(*Fout2, _fout, sc3); - C_ADD( *Fout, _fout, sc3); - - tw1 += fstride; - tw2 += (fstride << 1); - tw3 += (fstride * 3); - - if ( _inv ) - { - Fout1->r = sc5.r + sc4.i; - Fout1->i = sc5.i - sc4.r; - Fout3->r = sc5.r - sc4.i; - Fout3->i = sc5.i + sc4.r; - } - else - { Fout1->r = sc5.r - sc4.i; - Fout1->i = sc5.i + sc4.r; - Fout3->r = sc5.r + sc4.i; - Fout3->i = sc5.i - sc4.r; - } - - - ++Fout; ++Fout1; ++Fout2; ++Fout3; - - } while(--m); -} - -#define OVERRIDE_KFBFLY3 -static void kf_bfly3( - kiss_fft_cpx * Fout, - const int fstride, - const kiss_fft_cfg st, - int m - ) -{ - register kiss_fft_cpx * restrict Fout1, * restrict Fout2; - register kiss_fft_cpx * restrict tw1,* restrict tw2; - register float epi; - - tw1 = tw2 = st->twiddles; - epi = st->twiddles[fstride*m].i; - Fout1 = Fout + m; - Fout2 = Fout + (m << 1); - - do { - - register kiss_fft_cpx _fout; - register kiss_fft_cpx sc0, sc1, sc2, sc3; - - _fout = *Fout; - - C_MUL( sc1, *Fout1, *tw1); - C_MUL( sc2, *Fout2, *tw2); - C_ADD( sc3, sc1, sc2); - C_SUB( sc0, sc1, sc2); - tw1 += fstride; - tw2 += (fstride << 1); - - sc1.r = _fout.r - HALF_OF(sc3.r); - sc1.i = _fout.i - HALF_OF(sc3.i); - - C_MULBYSCALAR(sc0, epi); - C_ADD(*Fout, _fout, sc3); - - Fout2->r = sc1.r + sc0.i; - Fout2->i = sc1.i - sc0.r; - - Fout1->r = sc1.i - sc0.i; - Fout1->i = sc1.r + sc0.r; - - ++Fout; ++Fout1; ++Fout2; - - } while(--m); -} - -#define OVERRIDE_KFBFLY5 -static void kf_bfly5( - kiss_fft_cpx * Fout, - const size_t fstride, - const kiss_fft_cfg st, - int m - ) -{ - register kiss_fft_cpx * restrict Fout1,* restrict Fout2,* restrict Fout3,* restrict Fout4; - register int u; - register kiss_fft_cpx *tw; - register float yar, yai, ybr, ybi; - - Fout1=Fout+m; - Fout2=Fout+(m<<1); - Fout3=Fout+(m*3); - Fout4=Fout+(m<<2); - - tw = st->twiddles; - yar = tw[fstride*m].r; - yai = tw[fstride*m].i; - ybr = tw[fstride*2*m].r; - ybi = tw[fstride*2*m].i; - - for ( u=0; ur = sc0.r + sc7.r + sc8.r; - Fout->i = sc0.i + sc7.i + sc8.i; - - sc5.r = sc0.r + S_MUL(sc7.r,yar) + S_MUL(sc8.r,ybr); - sc5.i = sc0.i + S_MUL(sc7.i,yar) + S_MUL(sc8.i,ybr); - - sc6.r = S_MUL(sc10.i,yai) + S_MUL(sc9.i,ybi); - sc6.i = -S_MUL(sc10.r,yai) - S_MUL(sc9.r,ybi); - - C_SUB(*Fout1,sc5,sc6); - C_ADD(*Fout4,sc5,sc6); - - sc11.r = sc0.r + S_MUL(sc7.r,ybr) + S_MUL(sc8.r,yar); - sc11.i = sc0.i + S_MUL(sc7.i,ybr) + S_MUL(sc8.i,yar); - sc12.r = - S_MUL(sc10.i,ybi) + S_MUL(sc9.i,yai); - sc12.i = S_MUL(sc10.r,ybi) - S_MUL(sc9.r,yai); - C_ADD(*Fout2,sc11,sc12); - C_SUB(*Fout3,sc11,sc12); - - ++Fout1; ++Fout2; ++Fout3; ++Fout4; - } -} - - -#endif - -#endif diff --git a/Engine/lib/speex/tmv/kiss_fftr_tm.h b/Engine/lib/speex/tmv/kiss_fftr_tm.h deleted file mode 100644 index 8005b22bd..000000000 --- a/Engine/lib/speex/tmv/kiss_fftr_tm.h +++ /dev/null @@ -1,235 +0,0 @@ -/* Copyright (C) 2007 Hong Zhiqian */ -/** - @file kiss_fftr_tm.h - @author Hong Zhiqian - @brief Various compatibility routines for Speex (TriMedia version) -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include "_kiss_fft_guts_tm.h" - -#ifdef TM_ASM - -#include "profile_tm.h" - -#ifdef FIXED_POINT - -#define TM_NDIV(res,c,frac) \ - { register int c1, c0; \ - \ - c1 = -asri(16,(c)); \ - c0 = sex16((c)); \ - (res) = pack16lsb(sround(c1 * (32767/(frac))), sround(c0 * (32767/(frac))));\ - } - - -#define OVERRIDE_KISS_FFTR -void kiss_fftr(kiss_fftr_cfg st,const kiss_fft_scalar * restrict timedata, kiss_fft_cpx * restrict freqdata) -{ - register int ncfft, ncfft2, k; - register int * restrict tmpbuf; - register int * restrict twiddles; - - ncfft = st->substate->nfft; - ncfft2 = ncfft >> 1; - tmpbuf = (int*)st->tmpbuf; - twiddles = (int*)st->super_twiddles; - - TMDEBUG_ALIGNMEM(timedata); - TMDEBUG_ALIGNMEM(freqdata); - TMDEBUG_ALIGNMEM(tmpbuf); - TMDEBUG_ALIGNMEM(twiddles); - - kiss_fft(st->substate , (const kiss_fft_cpx*)timedata, st->tmpbuf); - - { - register int tdcr, tdci; - tdcr = sround(st->tmpbuf[0].r * (32767/2)); - tdci = sround(st->tmpbuf[0].i * (32767/2)); - - freqdata[0].r = tdcr + tdci; - freqdata[ncfft].r = tdcr - tdci; - freqdata[ncfft].i = freqdata[0].i = 0; - } - - for ( k=1 ; k <= ncfft2 ; ++k ) - { - register int fpk, fpnk, i, tw, f1k, f2k; - register int fq1, fq2; - - i = ncfft-k; - - fpk = ld32x(tmpbuf,k); - tw = ld32x(twiddles,k); - fpnk = ld32x(tmpbuf,i); - - TM_DIV(fpk, fpk, 2); - TM_NDIV(fpnk,fpnk,2); - - TM_ADD( f1k, fpk , fpnk ); - TM_SUB( f2k, fpk , fpnk ); - TM_MUL( tw , f2k, tw ); - TM_ADD( fq1, f1k, tw ); - TM_SHR( fq1, fq1, 1 ); - TM_SUB( fq2, f1k, tw ); - TM_NEGMSB( fq2, fq2 ); - TM_SHR( fq2, fq2, 1 ); - - - st32d( k<<2, freqdata, fq1 ); - st32d( i<<2, freqdata, fq2 ); - } -} - -#define OVERRIDE_KISS_FFTRI -void kiss_fftri(kiss_fftr_cfg st,const kiss_fft_cpx * restrict freqdata,kiss_fft_scalar * restrict timedata) -{ - register int k, ncfft, ncfft2; - register int * restrict tmpbuf; - register int * restrict twiddles; - - ncfft = st->substate->nfft; - ncfft2 = ncfft >> 1; - tmpbuf = (int*)st->tmpbuf; - twiddles = (int*)st->super_twiddles; - - TMDEBUG_ALIGNMEM(freqdata); - TMDEBUG_ALIGNMEM(timedata); - TMDEBUG_ALIGNMEM(tmpbuf); - TMDEBUG_ALIGNMEM(twiddles); - - { - register int fqr, fqnr; - - fqr = freqdata[0].r; - fqnr = freqdata[ncfft].r; - - st->tmpbuf[0].r = fqr + fqnr; - st->tmpbuf[0].i = fqr - fqnr; - } - - for ( k=1 ; k <= ncfft2 ; ++k ) - { - register int fk, fnkc, i, tw, fek, fok, tmp; - register int tbk, tbn; - - i = ncfft-k; - - fk = ld32x(freqdata,k); - tw = ld32x(twiddles,k); - fnkc = pack16lsb(-freqdata[i].i, freqdata[i].r); - - TM_ADD (fek, fk, fnkc); - TM_SUB (tmp, fk, fnkc); - TM_MUL (fok, tmp, tw ); - TM_ADD (tbk, fek, fok); - TM_SUB (tbn, fek, fok); - TM_NEGMSB(tbn, tbn); - - st32d(k<<2, tmpbuf, tbk); - st32d(i<<2, tmpbuf, tbn); - } - kiss_fft (st->substate, st->tmpbuf, (kiss_fft_cpx *) timedata); -} - -#else - -#define OVERRIDE_KISS_FFTR -void kiss_fftr(kiss_fftr_cfg st,const kiss_fft_scalar * restrict timedata,kiss_fft_cpx * restrict freqdata) -{ - register kiss_fft_cpx fpnk, fpk, f1k, f2k, twk; - register int k, ncfft; - register kiss_fft_cpx * restrict tmpbuf, * restrict tw; - register float tdcr, tdci; - - ncfft = st->substate->nfft; - tmpbuf= st->tmpbuf; - tw = st->super_twiddles; - - kiss_fft( st->substate , (const kiss_fft_cpx*)timedata, tmpbuf ); - - tdcr = tmpbuf[0].r; - tdci = tmpbuf[0].i; - - freqdata[0].r = tdcr + tdci; - freqdata[ncfft].r = tdcr - tdci; - freqdata[ncfft].i = freqdata[0].i = 0; - - for ( k=1;k <= ncfft/2 ; ++k ) - { - fpk = tmpbuf[k]; - fpnk.r = tmpbuf[ncfft-k].r; - fpnk.i = -tmpbuf[ncfft-k].i; - - C_ADD( f1k, fpk , fpnk ); - C_SUB( f2k, fpk , fpnk ); - C_MUL( twk, f2k , tw[k]); - - freqdata[k].r = HALF_OF(f1k.r + twk.r); - freqdata[k].i = HALF_OF(f1k.i + twk.i); - freqdata[ncfft-k].r = HALF_OF(f1k.r - twk.r); - freqdata[ncfft-k].i = HALF_OF(twk.i - f1k.i); - } -} - -#define OVERRIDE_KISS_FFTRI -void kiss_fftri(kiss_fftr_cfg st,const kiss_fft_cpx * restrict freqdata,kiss_fft_scalar * restrict timedata) -{ - register int k, ncfft; - register kiss_fft_cpx * restrict tmpbuf, * restrict tw; - - - ncfft = st->substate->nfft; - tmpbuf= st->tmpbuf; - tw = st->super_twiddles; - - tmpbuf[0].r = freqdata[0].r + freqdata[ncfft].r; - tmpbuf[0].i = freqdata[0].r - freqdata[ncfft].r; - - for (k = 1; k <= ncfft / 2; ++k) - { - register kiss_fft_cpx fk, fnkc, fek, fok, tmp; - fk = freqdata[k]; - fnkc.r = freqdata[ncfft - k].r; - fnkc.i = -freqdata[ncfft - k].i; - - C_ADD (fek, fk, fnkc); - C_SUB (tmp, fk, fnkc); - C_MUL (fok,tmp,tw[k]); - C_ADD (tmpbuf[k],fek, fok); - C_SUB (tmp, fek, fok); - tmpbuf[ncfft - k].r = tmp.r; - tmpbuf[ncfft - k].i = -tmp.i; - } - kiss_fft (st->substate, st->tmpbuf, (kiss_fft_cpx *) timedata); -} - -#endif -#endif - diff --git a/Engine/lib/speex/tmv/lpc_tm.h b/Engine/lib/speex/tmv/lpc_tm.h deleted file mode 100644 index 05b0988a3..000000000 --- a/Engine/lib/speex/tmv/lpc_tm.h +++ /dev/null @@ -1,150 +0,0 @@ -/* Copyright (C) 2007 Hong Zhiqian */ -/** - @file lpc_tm.h - @author Hong Zhiqian - @brief Various compatibility routines for Speex (TriMedia version) -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include "profile_tm.h" - -#ifdef FIXED_POINT - -#define OVERRIDE_SPEEX_AUTOCORR -void _spx_autocorr(const Int16 *x, Int16 *ac, int lag, int n) -{ - register int i, j; - register int shift, ac_shift; - register int n_2; - register int ac0; - - TMDEBUG_ALIGNMEM(x); - TMDEBUG_ALIGNMEM(ac); - - _SPX_AUTOCORR_START(); - - n_2 = n >> 1; - ac0 = n + 1; - -#if (TM_UNROLL && TM_UNROLL__SPXAUTOCORR) -#pragma TCS_unroll=5 -#pragma TCS_unrollexact=1 -#endif - for ( j=0 ; j> 8; - ac0 += ifir16(x32, x32) >> 8; - ac0 += ifir16(x54, x54) >> 8; - ac0 += ifir16(x76, x76) >> 8; - } -#if (TM_UNROLL && TM_UNROLL__SPXAUTOCORR) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - - shift = 8; - while (shift && ac0<0x40000000) - { shift--; - ac0 <<= 1; - } - - ac_shift = 18; - while (ac_shift && ac0<0x40000000) - { ac_shift--; - ac0 <<= 1; - } - - if ( shift == 0 ) - { - for ( i=0 ; i> ac_shift; - } - } else - { - for ( i=0 ; i> shift; - } - - for ( k=16,l=8,m=16-i ; k> shift; - acc2 += ifir16(x32,y32) >> shift; - } - - ac[i] = (acc0 + acc1 + acc2) >> ac_shift; - } - } - - _SPX_AUTOCORR_STOP(); -} - -#endif diff --git a/Engine/lib/speex/tmv/lsp_tm.h b/Engine/lib/speex/tmv/lsp_tm.h deleted file mode 100644 index 879d37e81..000000000 --- a/Engine/lib/speex/tmv/lsp_tm.h +++ /dev/null @@ -1,310 +0,0 @@ -/* Copyright (C) 2007 Hong Zhiqian */ -/** - @file lsp_tm.h - @author Hong Zhiqian - @brief Various compatibility routines for Speex (TriMedia version) -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include "profile_tm.h" - - -#ifdef FIXED_POINT - -#define OVERRIDE_LSP_INTERPOLATE -void lsp_interpolate(Int16 *old_lsp, Int16 *new_lsp, Int16 *interp_lsp, int len, int subframe, int nb_subframes) -{ - register int tmp = DIV32_16(SHL32(EXTEND32(1 + subframe),14),nb_subframes); - register int tmp2 = 16384-tmp; - register int in_0, in_1, factor, out_1, out_2, olsp, nlsp, ilsp; - register int i; - - TMDEBUG_ALIGNMEM(old_lsp); - TMDEBUG_ALIGNMEM(new_lsp); - TMDEBUG_ALIGNMEM(interp_lsp); - - LSPINTERPOLATE_START(); - - factor = pack16lsb(tmp,tmp2); - - len >>= 1; - for ( i=0 ; i> 14, out_1 >> 14); - st32d(i << 2, interp_lsp, ilsp); - - } - - LSPINTERPOLATE_STOP(); -} - - -#define OVERRIDE_CHEB_POLY_EVA -static inline Int32 cheb_poly_eva(Int16 *coef, Int16 x, int m, char *stack) -{ - register int c10, c32, c54; - register int sum, b0, f0, f1, f2, f3; - register int xx, f32, f10; - - CHEBPOLYEVA_START(); - - xx = sex16(x); - b0 = iclipi(xx,16383); - -#if 0 - c10 = ld32(coef); - c32 = ld32x(coef,1); - c54 = ld32x(coef,2); -#else - c10 = pack16lsb(coef[1],coef[0]); - c32 = pack16lsb(coef[3],coef[2]); - c54 = pack16lsb(coef[5],coef[4]); -#endif - - f0 = ((xx * b0) >> 13) - 16384; - f1 = ((xx * f0) >> 13) - b0; - f2 = ((xx * f1) >> 13) - f0; - - if ( m == 4 ) - { sum = sex16(c54); - f32 = pack16lsb(xx,f0); - f10 = pack16lsb(f1,f2); - - } else - { sum = asri(16,c54); - sum += ((sex16(c54) * xx) + 8192) >> 14; - - f3 = ((xx * f2) >> 13) - f1; - f32 = pack16lsb(f0,f1); - f10 = pack16lsb(f2,f3); - } - - sum += (ifir16(c32,f32) + 8192) >> 14; - sum += (ifir16(c10,f10) + 8192) >> 14; - -#ifndef REMARK_ON - (void)stack; -#endif - - CHEBPOLYEVA_STOP(); - return sum; -} - - -#define OVERRIDE_LSP_ENFORCE_MARGIN -void lsp_enforce_margin(Int16 *lsp, int len, Int16 margin) -{ - register int i; - register int m = margin; - register int m2 = 25736-margin; - register int lsp0, lsp1, lsp2; - - TMDEBUG_ALIGNMEM(lsp); - - LSPENFORCEMARGIN_START(); - - lsp0 = ld32(lsp); - lsp1 = asri(16,lsp0); - lsp0 = sex16(lsp0); - lsp2 = lsp[len-1]; - - if ( lsp0 < m ) - { lsp0 = m; - lsp[0] = m; - } - - if ( lsp2 > m2 ) - { lsp2 = m2; - lsp[len-1] = m2; - } - - for ( i=1 ; i m2 ) - { lsp1 = (lsp1 >> 1) + (m2 >> 1); - lsp[i] = lsp1; - } - - lsp0 = lsp1; - lsp1 = lsp2; - } - - LSPENFORCEMARGIN_STOP(); -} - - -#define OVERRIDE_LSP_TO_LPC -void lsp_to_lpc(Int16 *freq, Int16 *ak,int lpcrdr, char *stack) -{ - VARDECL(Int16 *freqn); - VARDECL(int **xp); - VARDECL(int *xpmem); - VARDECL(int **xq); - VARDECL(int *xqmem); - - register int i, j, k; - register int xout1,xout2,xin; - register int m; - - LSPTOLPC_START(); - - m = lpcrdr>>1; - - /* - - Reconstruct P(z) and Q(z) by cascading second order polynomials - in form 1 - 2cos(w)z(-1) + z(-2), where w is the LSP frequency. - In the time domain this is: - - y(n) = x(n) - 2cos(w)x(n-1) + x(n-2) - - This is what the ALLOCS below are trying to do: - - int xp[m+1][lpcrdr+1+2]; // P matrix in QIMP - int xq[m+1][lpcrdr+1+2]; // Q matrix in QIMP - - These matrices store the output of each stage on each row. The - final (m-th) row has the output of the final (m-th) cascaded - 2nd order filter. The first row is the impulse input to the - system (not written as it is known). - - The version below takes advantage of the fact that a lot of the - outputs are zero or known, for example if we put an inpulse - into the first section the "clock" it 10 times only the first 3 - outputs samples are non-zero (it's an FIR filter). - */ - - ALLOC(xp, (m+1), int*); - ALLOC(xpmem, (m+1)*(lpcrdr+1+2), int); - - ALLOC(xq, (m+1), int*); - ALLOC(xqmem, (m+1)*(lpcrdr+1+2), int); - - for ( i=0; i<=m; i++ ) - { xp[i] = xpmem + i*(lpcrdr+1+2); - xq[i] = xqmem + i*(lpcrdr+1+2); - } - - /* work out 2cos terms in Q14 */ - - ALLOC(freqn, lpcrdr, Int16); - for ( j=0,k=0 ; j -#include "profile_tm.h" - -#ifdef FIXED_POINT - -#define OVERRIDE_INNER_PROD -Int32 inner_prod(const Int16 * restrict x, const Int16 * restrict y, int len) -{ - register int sum = 0; - - INNERPROD_START(); - - if ( (int)x & 0x03 == 0 && (int)y & 0x03 == 0 ) - { - register int i; - - len >>= 1; - for ( i=0 ; i> 6; - - x2 = ld32x(x,i+2); - y2 = ld32x(x,i+2); - x3 = ld32x(x,i+3); - y3 = ld32x(x,i+3); - sum += (ifir16(x2,y2) + ifir16(x3,y3)) >> 6; - - } - } else - { - len >>= 3; - while( len-- ) - { - register int x0, x1, x2, x3, y0, y1, y2, y3; - - x0 = pack16lsb(x[0],x[1]); - y0 = pack16lsb(y[0],y[1]); - x1 = pack16lsb(x[2],x[3]); - y1 = pack16lsb(y[2],y[3]); - sum += (ifir16(x0,y0) + ifir16(x1,y1)) >> 6; - - x2 = pack16lsb(x[4],x[5]); - y2 = pack16lsb(y[4],y[5]); - x3 = pack16lsb(x[6],x[7]); - y3 = pack16lsb(y[6],y[7]); - sum += (ifir16(x2,y2) + ifir16(x3,y3)) >> 6; - - x += 8; - y += 8; - } - } - - INNERPROD_STOP(); - return sum; -} - -#define OVERRIDE_PITCH_XCORR -void pitch_xcorr(const Int16 *_x, const Int16 *_y, Int32 *corr, int len, int nb_pitch, char *stack) -{ - register int sum_1, sum_2, sum_3, sum_4; - register int y10, y32, y54, y76, y21, y43, y65; - register int x10, x32; - register int i, j, k, limit; - - TMDEBUG_ALIGNMEM(_x); - TMDEBUG_ALIGNMEM(_y); - - PITCHXCORR_START(); - - limit = nb_pitch >> 1; - len >>= 1; - - for (i=0 ; i> 6; - sum_3 += (ifir16(x10,y32) + ifir16(x32,y54)) >> 6; - - y21 = funshift2(y32,y10); - y43 = funshift2(y54,y32); - y65 = funshift2(y76,y54); - - sum_2 += (ifir16(x10,y21) + ifir16(x32,y43)) >> 6; - sum_4 += (ifir16(x10,y43) + ifir16(x32,y65)) >> 6; - - y10 = y54; - y32 = y76; - - } - - k = i << 1; - corr[nb_pitch-1-k]=sum_1; - corr[nb_pitch-2-k]=sum_2; - corr[nb_pitch-3-k]=sum_3; - corr[nb_pitch-4-k]=sum_4; - } - -#ifndef REMARK_ON - (void)stack; -#endif - - PITCHXCORR_STOP(); -} - -#ifndef ttisim -#define OVERRIDE_PITCH_GAIN_SEARCH_3TAP_VQ -static int pitch_gain_search_3tap_vq -( - const signed char *gain_cdbk, - int gain_cdbk_size, - Int16 *C16, - Int16 max_gain -) -{ - register int pp = 0x00400040, p=64; - register int g10, g2, g20, g21, g02, g22, g01; - register int cb0, cb1, cb2, cb5432; - register int C10, C32, C54, C76, C98, C83, C2; - register int acc0, acc1, acc2, acc3, sum, gsum, bsum=-VERY_LARGE32; - register int i, best_cdbk=0; - register Int16 tmp; - - TMDEBUG_ALIGNMEM(C16); - TMDEBUG_ALIGNMEM(gain_cdbk+2); - - PITCHGAINSEARCH3TAPVQ_START(); - - tmp = ild16(gain_cdbk); - C98 = ld32x(C16,4); - C32 = ld32x(C16,1); - C10 = ld32(C16); - C54 = ld32x(C16,2); - C76 = ld32x(C16,3); - - cb0 = sex8(tmp); - cb1 = sex8(tmp>>8); - C83 = funshift2(C98,C32); - C2 = sex16(C32); - gain_cdbk += 2; - - -#if (TM_UNROLL && TM_UNROLL_PITCHGAINSEARCH3TAPVQ > 0) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for ( i=0 ; i>8); - sum = 0; - - g10 = pack16lsb(cb1 + 32, cb0 + 32); - g2 = cb2 + 32; - g02 = pack16lsb(g10, g2); - acc0 = dspidualmul(g10,pp); - sum += ifir16(acc0,C10); - sum += p * g2 * C2; - - g22 = pack16lsb(g02, g02); - g01 = funshift2(g10, g10); - - acc1 = dspidualmul(g22, g01); - sum -= ifir16(acc1, C54); - acc2 = dspidualmul(g10, g10); - sum -= ifir16(acc2, C76); - - g20 = pack16lsb(g2, g10); - g21 = funshift2(g2, g10); - acc3 = dspidualmul(g20, g21); - sum -= ifir16(acc3, C83); - - - if ( sum>bsum && gsum<=max_gain ) - { bsum = sum; - best_cdbk=i; - } - - cb0 = sex8(cb5432 >> 16); - cb1 = asri(24,cb5432); - } -#if (TM_UNROLL && TM_UNROLL_PITCHGAINSEARCH3TAPVQ > 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - - PITCHGAINSEARCH3TAPVQ_STOP(); - return best_cdbk; -} -#endif - -#define OVERRIDE_COMPUTE_PITCH_ERROR -#ifndef OVERRIDE_PITCH_GAIN_SEARCH_3TAP_VQ -inline Int32 compute_pitch_error(Int16 *C, Int16 *g, Int16 pitch_control) -{ - register int c10, c32, c54, c76, c98, c83; - register int g10, g32, g02, g22, g01, g21, g20; - register int pp, tmp0, tmp1, tmp2, tmp3; - register int sum = 0; - - - COMPUTEPITCHERROR_START(); - - g10 = ld32(g); - g32 = ld32x(g,1); - pp = pack16lsb(pitch_control,pitch_control); - c10 = ld32(C); - c32 = ld32x(C,1); - g02 = pack16lsb(g10,g32); - g22 = pack16lsb(g32,g32); - g01 = funshift2(g10,g10); - tmp0 = dspidualmul(g10,pp); - sum += ifir16(tmp0, c10); - sum += pitch_control * sex16(g32) * sex16(c32); - c54 = ld32x(C,2); - c76 = ld32x(C,3); - c98 = ld32x(C,4); - tmp1 = dspidualmul(g22,g01); - sum -= ifir16(tmp1, c54); - tmp2 = dspidualmul(g10,g10); - sum -= ifir16(tmp2,c76); - c83 = funshift2(c98,c32); - g20 = funshift2(g02,g02); - g21 = funshift2(g02,g10); - tmp3 = dspidualmul(g20,g21); - sum -= ifir16(tmp3,c83); - - COMPUTEPITCHERROR_STOP(); - return sum; -} -#endif - -#define OVERRIDE_OPEN_LOOP_NBEST_PITCH -void open_loop_nbest_pitch(Int16 *sw, int start, int end, int len, int *pitch, Int16 *gain, int N, char *stack) -{ - VARDECL(int *best_score); - VARDECL(int *best_ener); - VARDECL(Int32 *corr); - VARDECL(Int16 *corr16); - VARDECL(Int16 *ener16); - register int i, j, k, l, N4, N2; - register int _sw10, _sw32, _s0, _s2, limit; - register int *energy; - register int cshift=0, eshift=0; - register int scaledown = 0; - register int e0, _energy0; - - ALLOC(corr16, end-start+1, Int16); - ALLOC(ener16, end-start+1, Int16); - ALLOC(corr, end-start+1, Int32); - ALLOC(best_score, N, int); - ALLOC(best_ener, N, int); - energy = corr; - N4 = N << 2; - N2 = N >> 1; - - TMDEBUG_ALIGNMEM(sw); - TMDEBUG_ALIGNMEM(pitch); - TMDEBUG_ALIGNMEM(gain); - TMDEBUG_ALIGNMEM(best_score); - TMDEBUG_ALIGNMEM(best_ener); - TMDEBUG_ALIGNMEM(corr16); - TMDEBUG_ALIGNMEM(ener16); - - OPENLOOPNBESTPITCH_START(); - - for ( i=0 ; i> 6)) - ((_s2 * _s2) >> 6); - _energy0 = imax(0,_energy1); - energy[i] = _energy0; - __sw10 = ld32x(sw,j); - __sw32 = ld32x(sw,k); - __s0 = asri(16,__sw10); - __s2 = asri(16,__sw32); - _energy1 = (_energy0 + ((__s0 * __s0) >> 6)) - ((__s2 * __s2) >> 6); - _energy0 = imax(0,_energy1); - energy[i+1] = _energy0; - _sw10 = __sw10; - _sw32 = __sw32; - } - - _s0 = sex16(_sw10); - _s2 = sex16(_sw32); - _energy0 = imax(0,(_energy0 + ((_s0 * _s0) >> 6)) - ((_s2 * _s2) >> 6)); - energy[i] = _energy0; - - - eshift = normalize16(energy, ener16, 32766, end-start+1); - /* In fixed-point, this actually overrites the energy array (aliased to corr) */ - pitch_xcorr(sw, sw-end, corr, len, end-start+1, stack); - /* Normalize to 180 so we can square it and it still fits in 16 bits */ - cshift = normalize16(corr, corr16, 180, end-start+1); - /* If we scaled weighted input down, we need to scale it up again (OK, so we've just lost the LSB, who cares?) */ - - if ( scaledown ) - { - for ( j=asri(1,-end),k=asli(1,-end) ; j (best_score[N-1] * _e0) ) - { - best_score[N-1] = _c0; - best_ener[N-1] = _e0; - pitch[N-1] = i; - - for( j=0 ; j best_score[j] * _e0 ) - { for( k=N-1 ; k>j ; --k ) - { - best_score[k]=best_score[k-1]; - best_ener[k]=best_ener[k-1]; - pitch[k]=pitch[k-1]; - } - - best_score[j]=_c0; - best_ener[j]=_e0; - pitch[j]=i; - break; - } - } - } - - if ( (_c1 * best_ener[N-1]) > (best_score[N-1] * _e1) ) - { - best_score[N-1] = _c1; - best_ener[N-1] = _e1; - pitch[N-1] = i+1; - - for( j=0 ; j best_score[j] * _e1 ) - { for( k=N-1 ; k>j ; --k ) - { - best_score[k]=best_score[k-1]; - best_ener[k]=best_ener[k-1]; - pitch[k]=pitch[k-1]; - } - - best_score[j]=_c1; - best_ener[j]=_e1; - pitch[j]=i+1; - break; - } - } - } - } - - /* Compute open-loop gain if necessary */ - if (gain) - { - for (j=0;j - - -#if TM_PROFILE -int __profile_begin; -int __profile_end; -#endif - -#define OVERRIDE_SPEEX_ALLOC -void *speex_alloc (int size) -{ - void *ptr; - - if ( tmmlMalloc(0, size, (pVoid*)&ptr, tmmlMallocCacheAligned | tmmlMallocCleared) != TM_OK ) - { return NULL; - } - - return ptr; -} - - -#define OVERRIDE_SPEEX_ALLOC_SCRATCH -void *speex_alloc_scratch (int size) -{ - void *ptr; - - if ( tmmlMalloc(0, size, (pVoid*)&ptr, tmmlMallocCacheAligned | tmmlMallocCleared) != TM_OK ) - { return NULL; - } - - return ptr; -} - - -#define OVERRIDE_SPEEX_REALLOC -void *speex_realloc (void *ptr, int size) -{ - if ( tmmlRealloc(0, size, (pVoid)ptr, (pVoid*)&ptr, tmmlMallocCacheAligned | tmmlMallocCleared) != TM_OK ) - { return NULL; - } - - return ptr; -} - - -#define OVERRIDE_SPEEX_FREE -void speex_free (void *ptr) -{ - tmmlFree(ptr); -} - - -#define OVERRIDE_SPEEX_FREE_SCRATCH -void speex_free_scratch (void *ptr) -{ - tmmlFree(ptr); -} - diff --git a/Engine/lib/speex/tmv/profile_tm.h b/Engine/lib/speex/tmv/profile_tm.h deleted file mode 100644 index 2ecafb729..000000000 --- a/Engine/lib/speex/tmv/profile_tm.h +++ /dev/null @@ -1,407 +0,0 @@ -/* Copyright (C) 2007 Hong Zhiqian */ -/** - @file profile_tm.h - @author Hong Zhiqian - @brief Various compatibility routines for Speex (TriMedia version) -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/** -* @remarks This file provide some capabilities to measure clock cycles. -* Use this if unable to compile with TriMedia profile options -*/ - -extern int __profile_begin; -extern int __profile_end; - -#if TM_PROFILE -#define PROFILE_START() \ - { \ - __profile_begin = cycles(); \ - } \ - -#define PROFILE_STOP() \ - { \ - __profile_end = cycles(); \ - printf("%s\t%d\n", __FUNCTION__, end - begin); \ - } \ - -#else -#define PROFILE_START() -#define PROFILE_STOP() -#endif - -#if TM_PROFILE_SPXAUTOCORR -#define _SPX_AUTOCORR_START() PROFILE_START() -#define _SPX_AUTOCORR_STOP() PROFILE_STOP() -#else -#define _SPX_AUTOCORR_START() -#define _SPX_AUTOCORR_STOP() -#endif - -#if TM_PROFILE_INNERPROD -#define INNERPROD_START() PROFILE_START() -#define INNERPROD_STOP() PROFILE_STOP() -#else -#define INNERPROD_START() -#define INNERPROD_STOP() -#endif - -#if TM_PROFILE_PITCHXCORR -#define PITCHXCORR_START() PROFILE_START() -#define PITCHXCORR_STOP() PROFILE_STOP() -#else -#define PITCHXCORR_START() -#define PITCHXCORR_STOP() -#endif - -#if TM_PROFILE_COMPUTEPITCHERROR -#define COMPUTEPITCHERROR_START() PROFILE_START() -#define COMPUTEPITCHERROR_STOP() PROFILE_STOP() -#else -#define COMPUTEPITCHERROR_START() -#define COMPUTEPITCHERROR_STOP() -#endif - -#if TM_PROFILE_PITCHGAINSEARCH3TAPVQ -#define PITCHGAINSEARCH3TAPVQ_START() PROFILE_START() -#define PITCHGAINSEARCH3TAPVQ_STOP() PROFILE_STOP() -#else -#define PITCHGAINSEARCH3TAPVQ_START() -#define PITCHGAINSEARCH3TAPVQ_STOP() -#endif - -#if TM_PROFILE_OPENLOOPNBESTPITCH -#define OPENLOOPNBESTPITCH_START() PROFILE_START() -#define OPENLOOPNBESTPITCH_STOP() PROFILE_STOP() -#else -#define OPENLOOPNBESTPITCH_START() -#define OPENLOOPNBESTPITCH_STOP() -#endif - - -#if TM_PROFILE_LSP_INTERPOLATE -#define LSPINTERPOLATE_START() PROFILE_START() -#define LSPINTERPOLATE_STOP() PROFILE_STOP() -#else -#define LSPINTERPOLATE_START() -#define LSPINTERPOLATE_STOP() -#endif - -#if TM_PROFILE_CHEBPOLYEVA -#define CHEBPOLYEVA_START() PROFILE_START() -#define CHEBPOLYEVA_STOP() PROFILE_STOP() -#else -#define CHEBPOLYEVA_START() -#define CHEBPOLYEVA_STOP() -#endif - - -#if TM_PROFILE_COMPUTEQUANTWEIGHTS -#define COMPUTEQUANTWEIGHTS_START() PROFILE_START() -#define COMPUTEQUANTWEIGHTS_STOP() PROFILE_STOP() -#else -#define COMPUTEQUANTWEIGHTS_START() -#define COMPUTEQUANTWEIGHTS_STOP() -#endif - -#if TM_PROFILE_LSPQUANT -#define LSPQUANT_START() PROFILE_START() -#define LSPQUANT_STOP() PROFILE_STOP() -#else -#define LSPQUANT_START() -#define LSPQUANT_STOP() -#endif - -#if TM_PROFILE_LSPWEIGHTQUANT -#define LSPWEIGHTQUANT_START() PROFILE_START() -#define LSPWEIGHTQUANT_STOP() PROFILE_STOP() -#else -#define LSPWEIGHTQUANT_START() -#define LSPWEIGHTQUANT_STOP() -#endif - -#if TM_PROFILE_FIRMEM16 -#define FIRMEM16_START() PROFILE_START() -#define FIRMEM16_STOP() PROFILE_STOP() -#else -#define FIRMEM16_START() -#define FIRMEM16_STOP() -#endif - -#if TM_PROFILE_IIRMEM16 -#define IIRMEM16_START() PROFILE_START() -#define IIRMEM16_STOP() PROFILE_STOP() -#else -#define IIRMEM16_START() -#define IIRMEM16_STOP() -#endif - -#if TM_PROFILE_FILTERMEM16 -#define FILTERMEM16_START() PROFILE_START() -#define FILTERMEM16_STOP() PROFILE_STOP() -#else -#define FILTERMEM16_START() -#define FILTERMEM16_STOP() -#endif - -#if TM_PROFILE_COMPUTERMS16 -#define COMPUTERMS16_START() PROFILE_START() -#define COMPUTERMS16_STOP() PROFILE_STOP() -#else -#define COMPUTERMS16_START() -#define COMPUTERMS16_STOP() -#endif - -#if TM_PROFILE_NORMALIZE16 -#define NORMALIZE16_START() PROFILE_START() -#define NORMALIZE16_STOP() PROFILE_STOP() -#else -#define NORMALIZE16_START() -#define NORMALIZE16_STOP() -#endif - -#if TM_PROFILE_BWLPC -#define BWLPC_START() PROFILE_START() -#define BWLPC_STOP() PROFILE_STOP() -#else -#define BWLPC_START() -#define BWLPC_STOP() -#endif - -#if TM_PROFILE_HIGHPASS -#define HIGHPASS_START() PROFILE_START() -#define HIGHPASS_STOP() PROFILE_STOP() -#else -#define HIGHPASS_START() -#define HIGHPASS_STOP() -#endif - -#if TM_PROFILE_SIGNALMUL -#define SIGNALMUL_START() PROFILE_START() -#define SIGNALMUL_STOP() PROFILE_STOP() -#else -#define SIGNALMUL_START() -#define SIGNALMUL_STOP() -#endif - -#if TM_PROFILE_SIGNALDIV -#define SIGNALDIV_START() PROFILE_START() -#define SIGNALDIV_STOP() PROFILE_STOP() -#else -#define SIGNALDIV_START() -#define SIGNALDIV_STOP() -#endif - -#if TM_PROFILE_COMPUTEIMPULSERESPONSE -#define COMPUTEIMPULSERESPONSE_START() PROFILE_START() -#define COMPUTEIMPULSERESPONSE_STOP() PROFILE_STOP() -#else -#define COMPUTEIMPULSERESPONSE_START() -#define COMPUTEIMPULSERESPONSE_STOP() -#endif - -#if TM_PROFILE_COMPUTEWEIGHTEDCODEBOOK -#define COMPUTEWEIGHTEDCODEBOOK_START() PROFILE_START() -#define COMPUTEWEIGHTEDCODEBOOK_STOP() PROFILE_STOP() -#else -#define COMPUTEWEIGHTEDCODEBOOK_START() -#define COMPUTEWEIGHTEDCODEBOOK_STOP() -#endif - -#if TM_PROFILE_TARGETUPDATE -#define TARGETUPDATE_START() PROFILE_START() -#define TARGETUPDATE_STOP() PROFILE_STOP() -#else -#define TARGETUPDATE_START() -#define TARGETUPDATE_STOP() -#endif - - -#if TM_PROFILE_VQNBEST -#define VQNBEST_START() PROFILE_START() -#define VQNBEST_STOP() PROFILE_STOP() -#else -#define VQNBEST_START() -#define VQNBEST_STOP() -#endif - -#if TM_PROFILE_VQNBESTSIGN -#define VQNBESTSIGN_START() PROFILE_START() -#define VQNBESTSIGN_STOP() PROFILE_STOP() -#else -#define VQNBESTSIGN_START() -#define VQNBESTSIGN_STOP() -#endif - -#if TM_PROFILE_PREPROCESSANALYSIS -#define PREPROCESSANAYLSIS_START() PROFILE_START() -#define PREPROCESSANAYLSIS_STOP() PROFILE_STOP() -#else -#define PREPROCESSANAYLSIS_START() -#define PREPROCESSANAYLSIS_STOP() -#endif - -#if TM_PROFILE_UPDATENOISEPROB -#define UPDATENOISEPROB_START() PROFILE_START() -#define UPDATENOISEPROB_STOP() PROFILE_STOP() -#else -#define UPDATENOISEPROB_START() -#define UPDATENOISEPROB_STOP() -#endif - -#if TM_PROFILE_COMPUTEGAINFLOOR -#define COMPUTEGAINFLOOR_START() PROFILE_START() -#define COMPUTEGAINFLOOR_STOP() PROFILE_STOP() -#else -#define COMPUTEGAINFLOOR_START() -#define COMPUTEGAINFLOOR_STOP() -#endif - -#if TM_PROFILE_FILTERDCNOTCH16 -#define FILTERDCNOTCH16_START() PROFILE_START() -#define FILTERDCNOTCH16_STOP() PROFILE_STOP() -#else -#define FILTERDCNOTCH16_START() -#define FILTERDCNOTCH16_STOP() -#endif - -#if TM_PROFILE_MDFINNERPROD -#define MDFINNERPROD_START() PROFILE_START() -#define MDFINNERPROD_STOP() PROFILE_STOP() -#else -#define MDFINNERPROD_START() -#define MDFINNERPROD_STOP() -#endif - -#if TM_PROFILE_SPECTRALMULACCUM -#define SPECTRALMULACCUM_START() PROFILE_START() -#define SPECTRALMULACCUM_STOP() PROFILE_STOP() -#else -#define SPECTRALMULACCUM_START() -#define SPECTRALMULACCUM_STOP() -#endif - -#if TM_PROFILE_WEIGHTEDSPECTRALMULCONJ -#define WEIGHTEDSPECTRALMULCONJ_START() PROFILE_START() -#define WEIGHTEDSPECTRALMULCONJ_STOP() PROFILE_STOP() -#else -#define WEIGHTEDSPECTRALMULCONJ_START() -#define WEIGHTEDSPECTRALMULCONJ_STOP() -#endif - -#if TM_PROFILE_MDFADJUSTPROP -#define MDFADJUSTPROP_START() PROFILE_START() -#define MDFADJUSTPROP_STOP() PROFILE_STOP() -#else -#define MDFADJUSTPROP_START() -#define MDFADJUSTPROP_STOP() -#endif - -#if TM_PROFILE_SPEEXECHOGETRESIDUAL -#define SPEEXECHOGETRESIDUAL_START() PROFILE_START() -#define SPEEXECHOGETRESIDUAL_STOP() PROFILE_STOP() -#else -#define SPEEXECHOGETRESIDUAL_START() -#define SPEEXECHOGETRESIDUAL_STOP() -#endif - -#if TM_PROFILE_LSPENFORCEMARGIN -#define LSPENFORCEMARGIN_START() PROFILE_START() -#define LSPENFORCEMARGIN_STOP() PROFILE_STOP() -#else -#define LSPENFORCEMARGIN_START() -#define LSPENFORCEMARGIN_STOP() -#endif - -#if TM_PROFILE_LSPTOLPC -#define LSPTOLPC_START() PROFILE_START() -#define LSPTOLPC_STOP() PROFILE_STOP() -#else -#define LSPTOLPC_START() -#define LSPTOLPC_STOP() -#endif - -#if TM_PROFILE_MAXIMIZERANGE -#define MAXIMIZERANGE_START() PROFILE_START() -#define MAXIMIZERANGE_STOP() PROFILE_STOP() -#else -#define MAXIMIZERANGE_START() -#define MAXIMIZERANGE_STOP() -#endif - -#if TM_PROFILE_RENORMRANGE -#define RENORMRANGE_START() PROFILE_START() -#define RENORMRANGE_STOP() PROFILE_STOP() -#else -#define RENORMRANGE_START() -#define RENORMRANGE_STOP() -#endif - -#if TM_PROFILE_POWERSPECTRUM -#define POWERSPECTRUM_START() PROFILE_START() -#define POWERSPECTRUM_STOP() PROFILE_STOP() -#else -#define POWERSPECTRUM_START() -#define POWERSPECTRUM_STOP() -#endif - -#if TM_PROFILE_QMFSYNTH -#define QMFSYNTH_START() PROFILE_START() -#define QMFSYNTH_STOP() PROFILE_STOP() -#else -#define QMFSYNTH_START() -#define QMFSYNTH_STOP() -#endif - -#if TM_PROFILE_QMFDECOMP -#define QMFDECOMP_START() PROFILE_START() -#define QMFDECOMP_STOP() PROFILE_STOP() -#else -#define QMFDECOMP_START() -#define QMFDECOMP_STOP() -#endif - -#if TM_PROFILE_FILTERBANKCOMPUTEBANK32 -#define FILTERBANKCOMPUTEBANK32_START() PROFILE_START() -#define FILTERBANKCOMPUTEBANK32_STOP() PROFILE_STOP() -#else -#define FILTERBANKCOMPUTEBANK32_START() -#define FILTERBANKCOMPUTEBANK32_STOP() -#endif - -#if TM_PROFILE_FILTERBANKCOMPUTEPSD16 -#define FILTERBANKCOMPUTEPSD16_START() PROFILE_START() -#define FILTERBANKCOMPUTEPSD16_STOP() PROFILE_STOP() -#else -#define FILTERBANKCOMPUTEPSD16_START() -#define FILTERBANKCOMPUTEPSD16_STOP() -#endif - - diff --git a/Engine/lib/speex/tmv/quant_lsp_tm.h b/Engine/lib/speex/tmv/quant_lsp_tm.h deleted file mode 100644 index 9f49fca3c..000000000 --- a/Engine/lib/speex/tmv/quant_lsp_tm.h +++ /dev/null @@ -1,448 +0,0 @@ -/* Copyright (C) 2007 Hong Zhiqian */ -/** - @file quant_lsp_tm.h - @author Hong Zhiqian - @brief Various compatibility routines for Speex (TriMedia version) -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include -#include "profile_tm.h" - -#ifdef FIXED_POINT - -#define OVERRIDE_COMPUTE_QUANT_WEIGHTS -static void compute_quant_weights(Int16 *qlsp, Int16 *qw, int order) -{ - int qlspi, qlspii; - int w1, w2; - int i; - - TMDEBUG_ALIGNMEM(qlsp); - TMDEBUG_ALIGNMEM(qw); - - COMPUTEQUANTWEIGHTS_START(); - - --order; - - qlspi = (int)qlsp[0]; - qlspii = (int)qlsp[1]; - w1 = qlspi; - w2 = qlspii - qlspi; - - qw[0] = 81920 / (300 + imin(w1,w2)); - - for ( i=1 ; i>1); - cb0 = pack16lsb((int)ptr[1], (int)ptr[0]); - cb0 = dualasl(cb0,five); - cb0 = dspidualsub(xx,cb0); - dt0 += ifir16(cb0,cb0); - - cb1 = pack16lsb((int)ptr[nbDim+1], (int)ptr[nbDim]); - cb1 = dualasl(cb1,five); - cb1 = dspidualsub(xx,cb1); - dt1 += ifir16(cb1, cb1); - - cb2 = pack16lsb((int)ptr[nbDim*2+1], (int)ptr[nbDim*2]); - cb2 = dualasl(cb2,five); - cb2 = dspidualsub(xx,cb2); - dt2 += ifir16(cb2, cb2); - - cb3 = pack16lsb((int)ptr[nbDim*3+1], (int)ptr[nbDim*3]); - cb3 = dualasl(cb3,five); - cb3 = dspidualsub(xx,cb3); - dt3 += ifir16(cb3, cb3); - - ptr += 2; - } - - if ( dt0>1); - cb0 = pack16lsb((int)ptr[j+1], (int)ptr[j]); - cb0 = dualasl(cb0,five); - dt0 = dspidualsub(xx,cb0); - st32d(j<<1, x, dt0); - } - - LSPQUANT_STOP(); - return best_id; -} - - -#define OVERRIDE_LSP_WEIGHT_QUANT -static int lsp_weight_quant(Int16 *x, Int16 *weight, const signed char *cdbk, int nbVec, int nbDim) -{ - register int best_dist=VERY_LARGE32; - register int best_id=0; - register int i, j; - register int dt1, dt2, dt3, dt4; - register int cb1, cb2, cb3, cb4, wt, xx; - register int ptr_inc = nbDim * 3; - const signed char *ptr; - - LSPWEIGHTQUANT_START(); - - for ( i=0, ptr=cdbk ; i> 15)) + ((wt * (cb1 & 0x7fff)) >> 15); - dt2 += (wt * (cb2 >> 15)) + ((wt * (cb2 & 0x7fff)) >> 15); - dt3 += (wt * (cb3 >> 15)) + ((wt * (cb3 & 0x7fff)) >> 15); - dt4 += (wt * (cb4 >> 15)) + ((wt * (cb4 & 0x7fff)) >> 15); - - } - - if ( dt1 tmp2 ? tmp1 : tmp2; - }*/ - - for (i=0;i - - - -typedef Int16 spx_int16_t; -typedef UInt16 spx_uint16_t; -typedef Int32 spx_int32_t; -typedef UInt32 spx_uint32_t; - -#ifdef FIXED_POINT -#define VMUX(a,b,c) mux((a),(b),(c)) -#define VABS(a) iabs((a)) -#define VMAX(a,b) imax((a),(b)) -#define VMIN(a,b) imin((a),(b)) -#else -#define VMUX(a,b,c) fmux((a),(b),(c)) -#define VABS(a) fabs((a)) -#define VMAX(a,b) fmax((a),(b)) -#define VMIN(a,b) fmin((a),(b)) -#endif - -#endif - - -#endif - diff --git a/Engine/lib/speex/tmv/vq_tm.h b/Engine/lib/speex/tmv/vq_tm.h deleted file mode 100644 index 4f0e886e9..000000000 --- a/Engine/lib/speex/tmv/vq_tm.h +++ /dev/null @@ -1,494 +0,0 @@ -/* Copyright (C) 2007 Hong Zhiqian */ -/** - @file vq_tm.h - @author Hong Zhiqian - @brief Various compatibility routines for Speex (TriMedia version) -*/ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include -#include "profile_tm.h" - -#ifdef FIXED_POINT - -inline void vq_nbest_dist(int i, int N, int dist, int *used, int *nbest, Int32 *best_dist) -{ - register int k; - - if (i= 1) && (k > *used || dist < best_dist[k-1]); k--) - { best_dist[k]=best_dist[k-1]; - nbest[k] = nbest[k-1]; - } - - best_dist[k]=dist; - nbest[k]=i; - *used++; - } -} - -void vq_nbest_5(Int16 *in, const Int16 *codebook, int entries, Int32 *E, int N, int *nbest, Int32 *best_dist) -{ - register int i, j; - register int in10, in32, in4; - int used = 0; - - in10 = pack16lsb(in[1],in[0]); /* Note: memory is not align here */ - in32 = pack16lsb(in[3],in[2]); - in4 = sex16(in[4]); - -#if (TM_UNROLL && TM_UNROLL_VQNBEST > 0) -#pragma TCS_unroll=2 -#pragma TCS_unrollexact=1 -#endif - - for ( i=0,j=0 ; i> 1) - dist1; - - cb65 = funshift2(cb76,cb54); - cb87 = funshift2(cb98,cb76); - dist2 = asri(16,cb98) * in4; - dist2 += ifir16(in10,cb65) + ifir16(in32,cb87); - dist2 = (E[i+1] >> 1) - dist2; - - vq_nbest_dist(i,N,dist1,&used,nbest,best_dist); - vq_nbest_dist(i+1,N,dist2,&used,nbest,best_dist); - } - -#if (TM_UNROLL && TM_UNROLL_VQNBEST > 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif -} - - -void vq_nbest_8(Int16 *in, const Int16 *codebook, int entries, Int32 *E, int N, int *nbest, Int32 *best_dist) -{ - register int i, j; - register int in10, in32, in54, in76; - int used = 0; - - in10 = pack16lsb(in[1],in[0]); /* Note: memory is not align here */ - in32 = pack16lsb(in[3],in[2]); - in54 = pack16lsb(in[5],in[4]); - in76 = pack16lsb(in[7],in[6]); - -#if (TM_UNROLL && TM_UNROLL_VQNBEST > 0) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for ( i=0,j=0 ; i> 1) - dist; - - vq_nbest_dist(i,N,dist,&used,nbest,best_dist); - } -#if (TM_UNROLL && TM_UNROLL_VQNBEST > 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif - -} - - -void vq_nbest_10(Int16 *in, const Int16 *codebook, int entries, Int32 *E, int N, int *nbest, Int32 *best_dist) -{ - register int i, j; - register int in10, in32, in54, in76, in98; - int used = 0; - - in10 = pack16lsb(in[1],in[0]); - in32 = pack16lsb(in[3],in[2]); - in54 = pack16lsb(in[5],in[4]); - in76 = pack16lsb(in[7],in[6]); - in98 = pack16lsb(in[9],in[8]); - -#if (TM_UNROLL && TM_UNROLL_VQNBEST > 0) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for ( i=0,j=0 ; i> 1) - dist; - - vq_nbest_dist(i,N,dist,&used,nbest,best_dist); - } -#if (TM_UNROLL && TM_UNROLL_VQNBEST > 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif -} - -void vq_nbest_20(Int16 *in, const Int16 *codebook, int entries, Int32 *E, int N, int *nbest, Int32 *best_dist) -{ - register int i, j; - register int in10, in32, in54, in76, in98, in_10, in_32, in_54, in_76, in_98; - int used = 0; - - in10 = pack16lsb(in[1],in[0]); /* Note: memory is not align here */ - in32 = pack16lsb(in[3],in[2]); - in54 = pack16lsb(in[5],in[4]); - in76 = pack16lsb(in[6],in[6]); - in98 = pack16lsb(in[9],in[8]); - in_10 = pack16lsb(in[11],in[10]); - in_32 = pack16lsb(in[13],in[12]); - in_54 = pack16lsb(in[15],in[14]); - in_76 = pack16lsb(in[17],in[16]); - in_98 = pack16lsb(in[19],in[18]); - -#if (TM_UNROLL && TM_UNROLL_VQNBEST > 0) -#pragma TCS_unroll=2 -#pragma TCS_unrollexact=1 -#endif - for ( i=0,j=0 ; i> 1) - dist; - vq_nbest_dist(i,N,dist,&used,nbest,best_dist); - } -#if (TM_UNROLL && TM_UNROLL_VQNBEST > 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif -} - - -#define OVERRIDE_VQ_NBEST -void vq_nbest (Int16 *in, const Int16 *codebook, int len, int entries, Int32 *E, int N, int *nbest, Int32 *best_dist, char *stack) -{ - TMDEBUG_ALIGNMEM(codebook); - - VQNBEST_START(); - if( len==5 ) - vq_nbest_5(in,codebook,entries,E,N,nbest,best_dist); - else if ( len==8 ) - vq_nbest_8(in,codebook,entries,E,N,nbest,best_dist); - else if ( len==10 ) - vq_nbest_10(in,codebook,entries,E,N,nbest,best_dist); - else if ( len==20 ) - vq_nbest_20(in,codebook,entries,E,N,nbest,best_dist); - -#ifndef REMARK_ON - (void)stack; -#endif - - VQNBEST_STOP(); -} - -inline void vq_nbest_sign_dist(int i, int N, int dist, int sign, int entries, int *used, int *nbest, Int32 *best_dist) -{ - register int k; - - if (i= 1) && (k > *used || dist < best_dist[k-1]); k--) - { - best_dist[k]=best_dist[k-1]; - nbest[k] = nbest[k-1]; - } - - if ( sign ) i += entries; - best_dist[k]=dist; - *used++; - nbest[k] = i; - } -} - -void vq_nbest_sign_5(Int16 *in, const Int16 *codebook, int entries, Int32 *E, int N, int *nbest, Int32 *best_dist) -{ - register int i, j; - register int in10, in32, in4; - int used = 0; - - in10 = ld32(in); - in32 = ld32x(in,1); - in4 = sex16(in[4]); - -#if (TM_UNROLL && TM_UNROLL_VQSIGNNBEST > 0) -#pragma TCS_unroll=2 -#pragma TCS_unrollexact=1 -#endif - - for ( i=0,j=0 ; i0,0,1); - dist1 = iflip(dist1>0,dist1); - dist1 = (E[i] >> 1) + dist1; - - cb65 = funshift2(cb76,cb54); - cb87 = funshift2(cb98,cb76); - dist2 = asri(16,cb98) * in4; - dist2 += ifir16(in10,cb65) + ifir16(in32,cb87); - - sign2 = mux(dist2>0,0,1); - dist2 = iflip(dist2>0,dist2); - dist2 = (E[i] >> 1) + dist2; - - vq_nbest_sign_dist(i,N,dist1,sign1,entries,&used,nbest,best_dist); - vq_nbest_sign_dist(i+1,N,dist2,sign2,entries,&used,nbest,best_dist); - } -#if (TM_UNROLL && TM_UNROLL_VQSIGNNBEST > 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif -} - -void vq_nbest_sign_8(Int16 *in, const Int16 *codebook, int entries, Int32 *E, int N, int *nbest, Int32 *best_dist) -{ - register int i, j; - register int sign; - register int in10, in32, in54, in76; - int used = 0; - - in10 = ld32(in); - in32 = ld32x(in,1); - in54 = ld32x(in,2); - in76 = ld32x(in,3); - -#if (TM_UNROLL && TM_UNROLL_VQSIGNNBEST > 0) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - - for ( i=0,j=0 ; i0,0,1); - dist = iflip(dist>0,dist); - dist = (E[i] >> 1) + dist; - - vq_nbest_sign_dist(i,N,dist,sign,entries,&used,nbest,best_dist); - } -#if (TM_UNROLL && TM_UNROLL_VQSIGNNBEST > 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif -} - -void vq_nbest_sign_10(Int16 *in, const Int16 *codebook, int entries, Int32 *E, int N, int *nbest, Int32 *best_dist) -{ - register int i, j; - register int sign; - register int in10, in32, in54, in76, in98; - int used = 0; - - in10 = ld32(in); - in32 = ld32x(in,1); - in54 = ld32x(in,2); - in76 = ld32x(in,3); - in98 = ld32x(in,4); - -#if (TM_UNROLL && TM_UNROLL_VQSIGNNBEST > 0) -#pragma TCS_unroll=4 -#pragma TCS_unrollexact=1 -#endif - for ( i=0,j=0 ; i0,0,1); - dist = iflip(dist>0,dist); - dist = (E[i] >> 1) + dist; - - vq_nbest_sign_dist(i,N,dist,sign,entries,&used,nbest,best_dist); - } -#if (TM_UNROLL && TM_UNROLL_VQSIGNNBEST > 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif -} - -void vq_nbest_sign_20(Int16 *in, const Int16 *codebook, int entries, Int32 *E, int N, int *nbest, Int32 *best_dist) -{ - register int i, j; - register int sign; - register int in10, in32, in54, in76, in98, in_10, in_32, in_54, in_76, in_98; - int used = 0; - - in10 = ld32(in); - in32 = ld32x(in,1); - in54 = ld32x(in,2); - in76 = ld32x(in,3); - in98 = ld32x(in,4); - in_10 = ld32x(in,5); - in_32 = ld32x(in,6); - in_54 = ld32x(in,7); - in_76 = ld32x(in,8); - in_98 = ld32x(in,9); - -#if (TM_UNROLL && TM_UNROLL_VQSIGNNBEST > 0) -#pragma TCS_unroll=2 -#pragma TCS_unrollexact=1 -#endif - for ( i=0,j=0 ; i0,0,1); - dist = iflip(dist>0,dist); - dist = (E[i] >> 1) + dist; - - vq_nbest_sign_dist(i,N,dist,sign,entries,&used,nbest,best_dist); - } -#if (TM_UNROLL && TM_UNROLL_VQSIGNNBEST > 0) -#pragma TCS_unrollexact=0 -#pragma TCS_unroll=0 -#endif -} - -#define OVERRIDE_VQ_NBEST_SIGN -void vq_nbest_sign (Int16 *in, const Int16 *codebook, int len, int entries, Int32 *E, int N, int *nbest, Int32 *best_dist, char *stack) -{ - TMDEBUG_ALIGNMEM(in); - TMDEBUG_ALIGNMEM(codebook); - - VQNBESTSIGN_START(); - - if( len==5 ) - vq_nbest_sign_5(in,codebook,entries,E,N,nbest,best_dist); - else if ( len==8 ) - vq_nbest_sign_8(in,codebook,entries,E,N,nbest,best_dist); - else if ( len==10 ) - vq_nbest_sign_10(in,codebook,entries,E,N,nbest,best_dist); - else if ( len==20 ) - vq_nbest_sign_20(in,codebook,entries,E,N,nbest,best_dist); - -#ifndef REMARK_ON - (void)stack; -#endif - - VQNBESTSIGN_STOP(); -} - -#endif - diff --git a/Engine/lib/speex/win32/Makefile.am b/Engine/lib/speex/win32/Makefile.am deleted file mode 100644 index fa96e49f3..000000000 --- a/Engine/lib/speex/win32/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -SUBDIRS = libspeex speexenc speexdec VS2003 VS2005 VS2008 - -EXTRA_DIST = speex.iss config.h libspeex.def diff --git a/Engine/lib/speex/win32/VS2003/Makefile.am b/Engine/lib/speex/win32/VS2003/Makefile.am deleted file mode 100644 index bdec96ff1..000000000 --- a/Engine/lib/speex/win32/VS2003/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -SUBDIRS = libspeex speexenc speexdec tests - -EXTRA_DIST = libspeex.sln diff --git a/Engine/lib/speex/win32/VS2003/libspeex/Makefile.am b/Engine/lib/speex/win32/VS2003/libspeex/Makefile.am deleted file mode 100644 index 1ab120112..000000000 --- a/Engine/lib/speex/win32/VS2003/libspeex/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = libspeex.vcproj - - diff --git a/Engine/lib/speex/win32/VS2003/speexdec/Makefile.am b/Engine/lib/speex/win32/VS2003/speexdec/Makefile.am deleted file mode 100644 index c32b355cf..000000000 --- a/Engine/lib/speex/win32/VS2003/speexdec/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = speexdec.vcproj - - diff --git a/Engine/lib/speex/win32/VS2003/speexenc/Makefile.am b/Engine/lib/speex/win32/VS2003/speexenc/Makefile.am deleted file mode 100644 index 13530a7fa..000000000 --- a/Engine/lib/speex/win32/VS2003/speexenc/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = speexenc.vcproj - - diff --git a/Engine/lib/speex/win32/VS2003/tests/Makefile.am b/Engine/lib/speex/win32/VS2003/tests/Makefile.am deleted file mode 100644 index b44ac43df..000000000 --- a/Engine/lib/speex/win32/VS2003/tests/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = testenc.vcproj testenc_uwb.vcproj testenc_wb.vcproj - - diff --git a/Engine/lib/speex/win32/VS2005/Makefile.am b/Engine/lib/speex/win32/VS2005/Makefile.am deleted file mode 100644 index bdec96ff1..000000000 --- a/Engine/lib/speex/win32/VS2005/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -SUBDIRS = libspeex speexenc speexdec tests - -EXTRA_DIST = libspeex.sln diff --git a/Engine/lib/speex/win32/VS2005/libspeex/Makefile.am b/Engine/lib/speex/win32/VS2005/libspeex/Makefile.am deleted file mode 100644 index 1ab120112..000000000 --- a/Engine/lib/speex/win32/VS2005/libspeex/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = libspeex.vcproj - - diff --git a/Engine/lib/speex/win32/VS2005/speexdec/Makefile.am b/Engine/lib/speex/win32/VS2005/speexdec/Makefile.am deleted file mode 100644 index c32b355cf..000000000 --- a/Engine/lib/speex/win32/VS2005/speexdec/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = speexdec.vcproj - - diff --git a/Engine/lib/speex/win32/VS2005/speexenc/Makefile.am b/Engine/lib/speex/win32/VS2005/speexenc/Makefile.am deleted file mode 100644 index 13530a7fa..000000000 --- a/Engine/lib/speex/win32/VS2005/speexenc/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = speexenc.vcproj - - diff --git a/Engine/lib/speex/win32/VS2005/tests/Makefile.am b/Engine/lib/speex/win32/VS2005/tests/Makefile.am deleted file mode 100644 index b44ac43df..000000000 --- a/Engine/lib/speex/win32/VS2005/tests/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = testenc.vcproj testenc_uwb.vcproj testenc_wb.vcproj - - diff --git a/Engine/lib/speex/win32/VS2008/Makefile.am b/Engine/lib/speex/win32/VS2008/Makefile.am deleted file mode 100644 index bdec96ff1..000000000 --- a/Engine/lib/speex/win32/VS2008/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -SUBDIRS = libspeex speexenc speexdec tests - -EXTRA_DIST = libspeex.sln diff --git a/Engine/lib/speex/win32/VS2008/libspeex/Makefile.am b/Engine/lib/speex/win32/VS2008/libspeex/Makefile.am deleted file mode 100644 index 1ab120112..000000000 --- a/Engine/lib/speex/win32/VS2008/libspeex/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = libspeex.vcproj - - diff --git a/Engine/lib/speex/win32/VS2008/speexdec/Makefile.am b/Engine/lib/speex/win32/VS2008/speexdec/Makefile.am deleted file mode 100644 index c32b355cf..000000000 --- a/Engine/lib/speex/win32/VS2008/speexdec/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = speexdec.vcproj - - diff --git a/Engine/lib/speex/win32/VS2008/speexenc/Makefile.am b/Engine/lib/speex/win32/VS2008/speexenc/Makefile.am deleted file mode 100644 index 13530a7fa..000000000 --- a/Engine/lib/speex/win32/VS2008/speexenc/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = speexenc.vcproj - - diff --git a/Engine/lib/speex/win32/VS2008/tests/Makefile.am b/Engine/lib/speex/win32/VS2008/tests/Makefile.am deleted file mode 100644 index b44ac43df..000000000 --- a/Engine/lib/speex/win32/VS2008/tests/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = testenc.vcproj testenc_uwb.vcproj testenc_wb.vcproj - - diff --git a/Engine/lib/speex/win32/libspeex.def b/Engine/lib/speex/win32/libspeex.def deleted file mode 100644 index e5f815f7f..000000000 --- a/Engine/lib/speex/win32/libspeex.def +++ /dev/null @@ -1,75 +0,0 @@ -LIBRARY libspeex -EXPORTS - - -; -; speex.h -; -speex_encoder_init -speex_encoder_destroy -speex_encode -speex_encode_int -speex_encoder_ctl -speex_decoder_init -speex_decoder_destroy -speex_decode -speex_decode_int -speex_decoder_ctl -speex_mode_query -speex_lib_ctl -speex_lib_get_mode - -; -; speex_bits.h -; -speex_bits_init -speex_bits_init_buffer -speex_bits_set_bit_buffer -speex_bits_destroy -speex_bits_reset -speex_bits_rewind -speex_bits_read_from -speex_bits_read_whole_bytes -speex_bits_write -speex_bits_write_whole_bytes -speex_bits_pack -speex_bits_unpack_signed -speex_bits_unpack_unsigned -speex_bits_nbytes -speex_bits_peek_unsigned -speex_bits_peek -speex_bits_advance -speex_bits_remaining -speex_bits_insert_terminator - -; -; speex_callbacks.h -; -speex_inband_handler -speex_std_mode_request_handler -speex_std_high_mode_request_handler -speex_std_char_handler -speex_default_user_handler -speex_std_low_mode_request_handler -speex_std_vbr_request_handler -speex_std_enh_request_handler -speex_std_vbr_quality_request_handler - -; -; speex_header.h -; -speex_init_header -speex_header_to_packet -speex_packet_to_header - -; -; speex_stereo.h -; -speex_stereo_state_init -speex_stereo_state_reset -speex_stereo_state_destroy -speex_encode_stereo -speex_encode_stereo_int -speex_decode_stereo -speex_decode_stereo_int -speex_std_stereo_request_handler diff --git a/Engine/lib/speex/win32/libspeex/Makefile.am b/Engine/lib/speex/win32/libspeex/Makefile.am deleted file mode 100644 index 4d95004a2..000000000 --- a/Engine/lib/speex/win32/libspeex/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = libspeex.dsw libspeex.dsp libspeex_dynamic.dsp diff --git a/Engine/lib/speex/win32/libspeex/libspeex.dsp b/Engine/lib/speex/win32/libspeex/libspeex.dsp deleted file mode 100644 index 363de1387..000000000 --- a/Engine/lib/speex/win32/libspeex/libspeex.dsp +++ /dev/null @@ -1,332 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libspeex" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=libspeex - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libspeex.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libspeex.mak" CFG="libspeex - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libspeex - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "libspeex - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "Perforce Project" -# PROP Scc_LocalPath "..\.." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libspeex - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /GX- /O2 /Ob2 /I "../../include" /I "../" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_LIB" /D "HAVE_CONFIG_H" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\lib\libspeex.lib" - -!ELSEIF "$(CFG)" == "libspeex - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /GX- /Zi /Od /Ob2 /I "../../include" /I "../" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_LIB" /D "HAVE_CONFIG_H" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\lib\libspeex.lib" - -!ENDIF - -# Begin Target - -# Name "libspeex - Win32 Release" -# Name "libspeex - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\libspeex\bits.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\cb_search.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\exc_10_16_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\exc_10_32_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\exc_20_32_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\exc_5_256_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\exc_5_64_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\exc_8_128_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\filters.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\gain_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\gain_table_lbr.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\hexc_10_32_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\hexc_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\high_lsp_tables.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\lpc.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\lsp.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\lsp_tables_nb.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\ltp.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\modes.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\modes_wb.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\nb_celp.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\quant_lsp.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\sb_celp.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\speex.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\speex_callbacks.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\speex_header.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\stereo.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\vbr.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\vq.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\window.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\libspeex\arch.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\cb_search.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\cb_search_sse.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\filters.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\filters_sse.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\fixed_debug.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\fixed_generic.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\lpc.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\lsp.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\ltp.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\ltp_sse.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\math_approx.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\modes.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\nb_celp.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\os_support.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\quant_lsp.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\sb_celp.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\stack_alloc.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\vbr.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\vq.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\vq_sse.h -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "*.h" -# Begin Source File - -SOURCE=..\..\include\speex\speex.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\speex\speex_bits.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\speex\speex_callbacks.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\speex\speex_header.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\speex\speex_stereo.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\speex\speex_types.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\config.h -# End Source File -# End Target -# End Project diff --git a/Engine/lib/speex/win32/libspeex/libspeex.dsw b/Engine/lib/speex/win32/libspeex/libspeex.dsw deleted file mode 100644 index 5ebad5379..000000000 --- a/Engine/lib/speex/win32/libspeex/libspeex.dsw +++ /dev/null @@ -1,65 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "libspeex"=.\libspeex.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libspeex_dynamic"=.\libspeex_dynamic.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libspeexdsp"=.\libspeexdsp.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libspeexdsp_dynamic"=.\libspeexdsp_dynamic.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/Engine/lib/speex/win32/libspeex/libspeex_dynamic.dsp b/Engine/lib/speex/win32/libspeex/libspeex_dynamic.dsp deleted file mode 100644 index baca7c3c2..000000000 --- a/Engine/lib/speex/win32/libspeex/libspeex_dynamic.dsp +++ /dev/null @@ -1,341 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libspeex_dynamic" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=libspeex_dynamic - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libspeex_dynamic.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libspeex_dynamic.mak" CFG="libspeex_dynamic - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libspeex_dynamic - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libspeex_dynamic - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libspeex_dynamic - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "libspeex_dynamic___Win32_Release" -# PROP BASE Intermediate_Dir "libspeex_dynamic___Win32_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Dynamic_Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBSPEEX_DYNAMIC_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /I "../" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HAVE_CONFIG_H" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\bin\libspeex.dll" /implib:"..\..\lib\libspeex.lib" - -!ELSEIF "$(CFG)" == "libspeex_dynamic - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "libspeex_dynamic___Win32_Debug" -# PROP BASE Intermediate_Dir "libspeex_dynamic___Win32_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Dynamic_Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBSPEEX_DYNAMIC_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HAVE_CONFIG_H" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\bin\libspeex.dll" /implib:"..\..\lib\libspeex.lib" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "libspeex_dynamic - Win32 Release" -# Name "libspeex_dynamic - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\libspeex\bits.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\cb_search.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\exc_10_16_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\exc_10_32_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\exc_20_32_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\exc_5_256_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\exc_5_64_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\exc_8_128_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\filters.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\gain_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\gain_table_lbr.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\hexc_10_32_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\hexc_table.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\high_lsp_tables.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\lpc.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\lsp.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\lsp_tables_nb.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\ltp.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\modes.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\modes_wb.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\nb_celp.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\quant_lsp.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\sb_celp.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\speex.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\speex_callbacks.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\speex_header.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\stereo.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\vbr.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\vq.c -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\window.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\libspeex\arch.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\cb_search.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\cb_search_sse.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\filters.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\filters_sse.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\fixed_debug.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\fixed_generic.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\lpc.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\lsp.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\ltp.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\ltp_sse.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\math_approx.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\modes.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\nb_celp.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\os_support.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\quant_lsp.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\sb_celp.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\stack_alloc.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\vbr.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\vq.h -# End Source File -# Begin Source File - -SOURCE=..\..\libspeex\vq_sse.h -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "*.h" -# Begin Source File - -SOURCE=..\..\include\speex\speex.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\speex\speex_bits.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\speex\speex_callbacks.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\speex\speex_header.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\speex\speex_stereo.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\speex\speex_types.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\config.h -# End Source File -# Begin Source File - -SOURCE=..\libspeex.def -# End Source File -# End Target -# End Project diff --git a/Engine/lib/speex/win32/speex.iss b/Engine/lib/speex/win32/speex.iss deleted file mode 100644 index 998559b8a..000000000 --- a/Engine/lib/speex/win32/speex.iss +++ /dev/null @@ -1,44 +0,0 @@ -; Script generated by the Inno Setup Script Wizard. -; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! - -[Setup] -AppName=Speex -AppVerName=Speex V1.1.6 -AppPublisherURL=http://www.speex.org -AppSupportURL=http://www.speex.org -AppUpdatesURL=http://www.speex.org -DefaultDirName={pf}\Speex -DefaultGroupName=Speex -AllowNoIcons=yes -LicenseFile=..\COPYING -InfoAfterFile=..\README -OutputDir=. -OutputBaseFilename=speex_win32_1.1.6_setup -; uncomment the following line if you want your installation to run on NT 3.51 too. -; MinVersion=4,3.51 - -[Tasks] -;Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"; MinVersion: 4,4 - -[Dirs] -Name: "{app}" -Name: "{app}\doc" -Name: "{app}\html" -Name: "{app}\libspeex" -Name: "{app}\libspeex\include" - -[Files] -Source: "speexdec\Release\speexdec.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "speexenc\Release\speexenc.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "libspeex\Release\libspeex.lib"; DestDir: "{app}\libspeex"; Flags: ignoreversion -Source: "libspeex\Release\libspeex.exp"; DestDir: "{app}\libspeex"; Flags: ignoreversion -Source: "libspeex\Release\libspeex.dll"; DestDir: "{app}\libspeex"; Flags: ignoreversion -Source: "..\include\speex\speex.h"; DestDir: "{app}\libspeex\include"; Flags: ignoreversion -Source: "..\include\speex\speex_bits.h"; DestDir: "{app}\libspeex\include"; Flags: ignoreversion -Source: "..\include\speex\speex_callbacks.h"; DestDir: "{app}\libspeex\include"; Flags: ignoreversion -Source: "..\include\speex\speex_header.h"; DestDir: "{app}\libspeex\include"; Flags: ignoreversion -Source: "..\include\speex\speex_stereo.h"; DestDir: "{app}\libspeex\include"; Flags: ignoreversion -Source: "..\doc\manual.pdf"; DestDir: "{app}\doc"; Flags: ignoreversion - -[Run] - diff --git a/Engine/lib/speex/win32/speexdec/Makefile.am b/Engine/lib/speex/win32/speexdec/Makefile.am deleted file mode 100644 index 7c4792201..000000000 --- a/Engine/lib/speex/win32/speexdec/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = speexdec.dsp speexdec.dsw diff --git a/Engine/lib/speex/win32/speexdec/speexdec.dsp b/Engine/lib/speex/win32/speexdec/speexdec.dsp deleted file mode 100644 index ed66a54c8..000000000 --- a/Engine/lib/speex/win32/speexdec/speexdec.dsp +++ /dev/null @@ -1,130 +0,0 @@ -# Microsoft Developer Studio Project File - Name="speexdec" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=speexdec - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "speexdec.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "speexdec.mak" CFG="speexdec - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "speexdec - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "speexdec - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "speexdec - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /GX /O2 /I "../../../libogg/include" /I "../../include" /I "../" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /c -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBCMT.lib" /out:"../../bin/speexdec.exe" - -!ELSEIF "$(CFG)" == "speexdec - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../libogg/include" /I "../../include" /I "../" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /GZ /c -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /out:"../../bin/speexdec.exe" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "speexdec - Win32 Release" -# Name "speexdec - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\src\getopt.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\getopt1.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\speexdec.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\wav_io.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\wave_out.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\src\getopt_win.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\wav_io.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\wave_out.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/Engine/lib/speex/win32/speexdec/speexdec.dsw b/Engine/lib/speex/win32/speexdec/speexdec.dsw deleted file mode 100644 index 1b7e31929..000000000 --- a/Engine/lib/speex/win32/speexdec/speexdec.dsw +++ /dev/null @@ -1,59 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "libspeex"=..\libspeex\libspeex.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "ogg_static"="..\..\..\libogg\win32\ogg_static.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "speexdec"=.\speexdec.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libspeex - End Project Dependency - Begin Project Dependency - Project_Dep_Name ogg_static - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/Engine/lib/speex/win32/speexenc/Makefile.am b/Engine/lib/speex/win32/speexenc/Makefile.am deleted file mode 100644 index c15584f6f..000000000 --- a/Engine/lib/speex/win32/speexenc/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -## Process this file with automake to produce Makefile.in. -*-Makefile-*- - -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - -EXTRA_DIST = speexenc.dsp speexenc.dsw diff --git a/Engine/lib/speex/win32/speexenc/speexenc.dsp b/Engine/lib/speex/win32/speexenc/speexenc.dsp deleted file mode 100644 index 736a8028f..000000000 --- a/Engine/lib/speex/win32/speexenc/speexenc.dsp +++ /dev/null @@ -1,130 +0,0 @@ -# Microsoft Developer Studio Project File - Name="speexenc" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=speexenc - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "speexenc.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "speexenc.mak" CFG="speexenc - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "speexenc - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "speexenc - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "speexenc - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /GX /Ox /Ot /Og /Oi /Ob2 /I "../" /I "../../include" /I "../../../libogg/include" /D "HAVE_CONFIG_H" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBCMT.lib" /out:"../../bin/speexenc.exe" - -!ELSEIF "$(CFG)" == "speexenc - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../" /I "../../include" /I "../../../libogg/include" /D "HAVE_CONFIG_H" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../../bin/speexenc.exe" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "speexenc - Win32 Release" -# Name "speexenc - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\src\getopt.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\getopt1.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\skeleton.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\speexenc.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\wav_io.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\src\getopt_win.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\skeleton.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\wav_io.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/Engine/lib/speex/win32/speexenc/speexenc.dsw b/Engine/lib/speex/win32/speexenc/speexenc.dsw deleted file mode 100644 index 183f291f0..000000000 --- a/Engine/lib/speex/win32/speexenc/speexenc.dsw +++ /dev/null @@ -1,74 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "libspeex"=..\libspeex\libspeex.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libspeexdsp"=..\libspeex\libspeexdsp.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "ogg_static"=..\..\..\libogg\win32\ogg_static.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "speexenc"=.\speexenc.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libspeex - End Project Dependency - Begin Project Dependency - Project_Dep_Name ogg_static - End Project Dependency - Begin Project Dependency - Project_Dep_Name libspeexdsp - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/Tools/CMake/torque_configs.cmake b/Tools/CMake/torque_configs.cmake index 7b3dc8e10..0e7cf9521 100644 --- a/Tools/CMake/torque_configs.cmake +++ b/Tools/CMake/torque_configs.cmake @@ -15,7 +15,7 @@ set(TORQUE_COMPILE_DEFINITIONS ICE_NO_DLL PCRE_STATIC TORQUE_ADVANCED_LIGHTING T # All link libraries. Modules should append to this the path to specify additional link libraries (.a, .lib, .dylib, .so) set(TORQUE_LINK_LIBRARIES tinyxml collada squish opcode assimp FLAC FLAC++ ogg vorbis - vorbisfile vorbisenc opus speex sndfile SDL2 glad pcre convexDecomp zlib) + vorbisfile vorbisenc opus sndfile SDL2 glad pcre convexDecomp zlib) if(TORQUE_TESTING) set(TORQUE_LINK_LIBRARIES ${TORQUE_LINK_LIBRARIES} gtest gmock)