remove speex cpack

cpack was causing issues with compiling remove any references to it.

change all options being set for the new libs to use the advanced_option macro

remove speex, opus is better.
This commit is contained in:
marauder2k7 2024-03-25 00:17:54 +00:00
parent 7953064782
commit 8fc56dfd9c
250 changed files with 18 additions and 68070 deletions

View file

@ -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)

View file

@ -200,5 +200,3 @@ if(BUILD_TESTING)
add_test(NAME test_framing COMMAND $<TARGET_FILE:test_framing>)
endif()
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
include(CPack)

View file

@ -394,7 +394,7 @@ target_link_libraries (sndfile
$<$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>:Ogg::ogg>
$<$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>:vorbisenc>
$<$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>:FLAC::FLAC>
$<$<AND:$<BOOL:${ENABLE_EXPERIMENTAL}>,$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>,$<BOOL:${HAVE_SPEEX}>>:speex>
$<$<AND:$<BOOL:${ENABLE_EXPERIMENTAL}>,$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>,$<BOOL:${HAVE_SPEEX}>>:Speex::Speex>
$<$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>:Opus::opus>
$<$<BOOL:${HAVE_MPEG}>:MPG123::libmpg123>
$<$<BOOL:${HAVE_MPEG}>:mp3lame::mp3lame>

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1,18 +0,0 @@
Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
All the code except the following
David Rowe <david@rowetel.com>
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 <ymnk@jcraft.com>:
Patch to speexenc.c to add Vorbis comment format
Radim Kolar <hsn@cybermail.net>:
Patch to speexenc.c for supporting more input formats

View file

@ -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 <inttypes.h>")
else()
check_include_file(stdint.h HAVE_STDINT_H)
if(HAVE_STDINT_H)
set(INCLUDE_STDINT "#include <stdint.h>")
else()
check_include_file(sys/types.h INCLUDE_SYS_TYPES_H)
if(HAVE_SYS_TYPES_H)
set(INCLUDE_STDINT "#include <sys/types.h>")
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 $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include/speex>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
if(USE_GPL_FFTW3)
target_include_directories(speex
PRIVATE $<BUILD_INTERFACE:${FFTW3_INCLUDE_DIRS}>)
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
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${SPEEXDSP_INCLUDE_DIRS}>)
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
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${OGG_INCLUDE_DIRS}>)
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 $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
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 $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
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 $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
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()

View file

@ -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.

View file

@ -1,21 +0,0 @@
2005-09-07 Thomas Vander Stichele <thomas at apestaart dot org>
* 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 <jean-marc.valin@usherbrooke.ca>
Patch for compiling with mingw32 sent by j@thing.net
2004-02-18 Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Integrated IRIX patch (getopt stuff) from Michael Pruett <michael@68k.org>
2004-02-18 Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
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.

View file

@ -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

View file

@ -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

View file

@ -1,8 +0,0 @@
Installing Speex is as easy as:
% ./configure [--prefix=<install-path>]
% make
% make install
Note that if you are using the code from Git, you will need to run "autogen.sh"
and then "configure".

View file

@ -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

View file

@ -1 +0,0 @@
2002/02/13: Creation of the "Speex" project

View file

@ -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

View file

@ -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

View file

@ -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.

View file

@ -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)<variable> to remove warning on not referenced variable
-- #define REMARK_ON
-- (void)<variable>
-- #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

View file

@ -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

View file

@ -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/speex.h>. speex_lib_get_mode() was introduced
in libspeex 1.1.7 and is declared in <speex/speex.h>.

View file

@ -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.

View file

@ -1,201 +0,0 @@
<?xml version = '1.0'?>
<kdevelop>
<general>
<author>Jean-Marc Valin</author>
<email>jean-marc.valin@usherbrooke.ca</email>
<version>$VERSION$</version>
<projectmanagement>KDevAutoProject</projectmanagement>
<primarylanguage>C</primarylanguage>
<ignoreparts/>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
<description/>
<secondaryLanguages/>
<versioncontrol>kdevsubversion</versioncontrol>
<defaultencoding/>
<projectname>Speex</projectname>
</general>
<kdevautoproject>
<general>
<activetarget>libspeex/libspeex.la</activetarget>
<useconfiguration>float</useconfiguration>
</general>
<run>
<mainprogram>src/Speex</mainprogram>
<directoryradio>executable</directoryradio>
<customdirectory>/</customdirectory>
<programargs/>
<terminal>false</terminal>
<autocompile>true</autocompile>
<envvars/>
<autoinstall>false</autoinstall>
<autokdesu>false</autokdesu>
</run>
<configurations>
<float>
<builddir>float</builddir>
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevpgf77options</f77compiler>
<cflags>-O2 -g -Wall</cflags>
<envvars/>
<configargs>--disable-shared</configargs>
<topsourcedir/>
<cppflags/>
<ldflags/>
<ccompilerbinary/>
<cxxcompilerbinary/>
<f77compilerbinary/>
<cxxflags/>
<f77flags/>
</float>
<fixed>
<configargs>--enable-fixed-point --disable-shared</configargs>
<builddir>fixed</builddir>
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevpgf77options</f77compiler>
<cflags>-O2 -g -Wall</cflags>
<envvars/>
<topsourcedir/>
<cppflags/>
<ldflags/>
<ccompilerbinary/>
<cxxcompilerbinary/>
<f77compilerbinary/>
<cxxflags/>
<f77flags/>
</fixed>
<default>
<envvars/>
</default>
</configurations>
<make>
<envvars>
<envvar value="1" name="WANT_AUTOCONF_2_5" />
<envvar value="1" name="WANT_AUTOMAKE_1_6" />
</envvars>
<abortonerror>false</abortonerror>
<numberofjobs>4</numberofjobs>
<dontact>false</dontact>
<makebin/>
<runmultiplejobs>true</runmultiplejobs>
<prio>0</prio>
</make>
</kdevautoproject>
<kdevdebugger>
<general>
<dbgshell>libtool</dbgshell>
<programargs/>
<gdbpath/>
<configGdbScript/>
<runShellScript/>
<runGdbScript/>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
</general>
<display>
<staticmembers>false</staticmembers>
<demanglenames>true</demanglenames>
<outputradix>10</outputradix>
</display>
</kdevdebugger>
<kdevfilecreate>
<filetypes/>
<useglobaltypes>
<type ext="c" />
<type ext="h" />
</useglobaltypes>
</kdevfilecreate>
<kdevcppsupport>
<references/>
<codecompletion>
<includeGlobalFunctions>true</includeGlobalFunctions>
<includeTypes>true</includeTypes>
<includeEnums>true</includeEnums>
<includeTypedefs>false</includeTypedefs>
<automaticCodeCompletion>true</automaticCodeCompletion>
<automaticArgumentsHint>true</automaticArgumentsHint>
<automaticHeaderCompletion>true</automaticHeaderCompletion>
<codeCompletionDelay>350</codeCompletionDelay>
<argumentsHintDelay>400</argumentsHintDelay>
<headerCompletionDelay>250</headerCompletionDelay>
<showOnlyAccessibleItems>false</showOnlyAccessibleItems>
<completionBoxItemOrder>0</completionBoxItemOrder>
<howEvaluationContextMenu>true</howEvaluationContextMenu>
<showCommentWithArgumentHint>true</showCommentWithArgumentHint>
<statusBarTypeEvaluation>false</statusBarTypeEvaluation>
<namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx=std</namespaceAliases>
<processPrimaryTypes>true</processPrimaryTypes>
<processFunctionArguments>true</processFunctionArguments>
<preProcessAllHeaders>false</preProcessAllHeaders>
<parseMissingHeaders>false</parseMissingHeaders>
<resolveIncludePaths>true</resolveIncludePaths>
<alwaysParseInBackground>true</alwaysParseInBackground>
<usePermanentCaching>true</usePermanentCaching>
<alwaysIncludeNamespaces>true</alwaysIncludeNamespaces>
<includePaths>.;</includePaths>
<parseMissingHeadersExperimental>false</parseMissingHeadersExperimental>
<resolveIncludePathsUsingMakeExperimental>false</resolveIncludePathsUsingMakeExperimental>
</codecompletion>
<qt>
<used>false</used>
<version>3</version>
<root>/usr/share/qt3</root>
<includestyle>3</includestyle>
<designerintegration>EmbeddedKDevDesigner</designerintegration>
<qmake>/usr/share/qt3/bin/qmake</qmake>
<designer>/usr/bin/designer-qt3</designer>
<designerpluginpaths/>
</qt>
<creategettersetter>
<prefixGet/>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
<inlineGet>true</inlineGet>
<inlineSet>true</inlineSet>
</creategettersetter>
<splitheadersource>
<enabled>true</enabled>
<synchronize>true</synchronize>
<orientation>Horizontal</orientation>
</splitheadersource>
</kdevcppsupport>
<kdevfileview>
<groups>
<hidenonprojectfiles>false</hidenonprojectfiles>
<hidenonlocation>false</hidenonlocation>
</groups>
<tree>
<hidepatterns>*.o,*.lo,CVS</hidepatterns>
<hidenonprojectfiles>true</hidenonprojectfiles>
<showvcsfields>false</showvcsfields>
</tree>
</kdevfileview>
<kdevdoctreeview>
<projectdoc>
<userdocDir>html/</userdocDir>
<apidocDir>html/</apidocDir>
</projectdoc>
<ignoreqt_xml/>
<ignoredoxygen/>
<ignorekdocs/>
<ignoretocs/>
<ignoredevhelp/>
</kdevdoctreeview>
<cppsupportpart>
<filetemplates>
<interfacesuffix>.h</interfacesuffix>
<implementationsuffix>.cpp</implementationsuffix>
</filetemplates>
</cppsupportpart>
<kdevdocumentation>
<projectdoc>
<docsystem/>
<docurl/>
<usermanualurl/>
</projectdoc>
</kdevdocumentation>
</kdevelop>

View file

@ -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 <boost@users.sourceforge.net> 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

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -1 +0,0 @@
include (${CMAKE_CURRENT_LIST_DIR}/speex-targets.cmake)

View file

@ -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@

View file

@ -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 <alloca.h>
#endif
#include <stdlib.h>
], [
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 <xmmintrin.h>
__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 <mkl.h>
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 <stdint.h>"],
[test "$ac_cv_header_inttypes_h" = "yes"], [INCLUDE_STDINT="#include <inttypes.h>"],
[test "$ac_cv_header_sys_types_h" = "yes"], [INCLUDE_STDINT="#include <sys/types.h>"])
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";

View file

@ -1,2 +0,0 @@
Makefile
Makefile.in

View file

@ -1,3 +0,0 @@
doc_DATA = manual.pdf
EXTRA_DIST = $(doc_DATA)

View file

@ -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

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -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 <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>
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 <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.
10. Author's Address
Greg Herlein <gherlein@herlein.com>
2034 Filbert Street
San Francisco, CA
United States 94123
Jean-Marc Valin <jean-marc.valin@hermes.usherb.ca>
Department of Electrical and Computer Engineering
University of Sherbrooke
2500 blvd UniversitüÃü­üÃé
Sherbrooke, Quebec, Canada, J1K 2R1
Simon MORLAT <simon.morlat@linphone.org>
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 <roger@freebsd.org>
49 Nettleton Road
Cheltenham
Gloucestershire
GL51 6NR
England
Phil Kerr <philkerr@elec.gla.ac.uk>
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

View file

@ -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 <gherlein@herlein.com>
Jean-Marc Valin <jean-marc.valin@hermes.usherb.ca>
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 <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 [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
<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.
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]

File diff suppressed because it is too large Load diff

View file

@ -1,815 +0,0 @@
<?xml version='1.0'?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd'>
<?rfc toc="yes" ?>
<rfc ipr="full3667" docName="RTP Payload Format for the Speex Codec">
<front>
<title>draft-herlein-speex-rtp-profile-03</title>
<author initials="G" surname="Herlein" fullname="Greg Herlein">
<organization></organization>
<address>
<email>gherlein@herlein.com</email>
<postal>
<street>2034 Filbert Street</street>
<city>San Francisco</city>
<region>California</region>
<code>94123</code>
<country>United States</country>
</postal>
</address>
</author>
<author initials="S" surname="Morlat" fullname="Simon Morlat">
<address>
<email>simon.morlat@linphone.org</email>
<postal>
<street>35, av de Vizille App 42</street>
<city>Grenoble</city>
<code>38000</code>
<country>France</country>
</postal>
</address>
</author>
<author initials="J" surname="Jean-Marc" fullname="Jean-Marc Valin">
<address>
<email>jean-marc.valin@hermes.usherb.ca</email>
<postal>
<street>Department of Electrical and Computer Engineering</street>
<street>University of Sherbrooke</street>
<street>2500 blvd Universite</street>
<city>Sherbrooke</city>
<region>Quebec</region>
<code>J1K 2R1</code>
<country>Canada</country>
</postal>
</address>
</author>
<author initials="R" surname="Hardiman" fullname="Roger Hardiman">
<address>
<email>roger@freebsd.org</email>
<postal>
<street>49 Nettleton Road</street>
<city>Cheltenham</city>
<region>Gloucestershire</region>
<code>GL51 6NR</code>
<country>England</country>
</postal>
</address>
</author>
<author initials="P" surname="Kerr" fullname="Phil Kerr">
<address>
<email>phil@plus24.com</email>
<postal>
<country>England</country>
</postal>
</address>
</author>
<date day="01" month="January" year="2005" />
<area>General</area>
<workgroup>AVT Working Group</workgroup>
<keyword>I-D</keyword>
<keyword>Internet-Draft</keyword>
<keyword>Speex</keyword>
<keyword>RTP</keyword>
<abstract>
<t>
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.
</t>
</abstract>
</front>
<middle>
<section anchor="Conventions used in this document" title="Conventions used in this document">
<t>
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 <xref target="rfc2119"></xref>.
</t>
</section>
<section anchor="Overview of the Speex Codec" title="Overview of the Speex Codec">
<t>
Speex is based on the CELP <xref target="CELP"></xref> 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:
</t>
<t>
<list style="symbols">
<t>Free software/open-source</t>
<t>Integration of wideband and narrowband in the same bit-stream</t>
<t>Wide range of bit-rates available</t>
<t>Dynamic bit-rate switching and variable bit-rate (VBR)</t>
<t>Voice Activity Detection (VAD, integrated with VBR)</t>
<t>Variable complexity</t>
</list>
</t>
</section>
<section anchor="RTP payload format for Speex" title="RTP payload format for Speex">
<t>
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.
</t>
<artwork><![CDATA[
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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</section>
<section anchor="RTP Header" title="RTP Header">
<artwork><![CDATA[
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 |
| ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
<t>
The RTP header begins with an octet of fields (V, P, X, and CC) to
support specialized RTP uses (see <xref target="rfc3550"></xref> and <xref target="rfc3551"></xref> for details). For
Speex the following values are used.
</t>
<t>Version (V): 2 bits</t><t>
This field identifies the version of RTP. The version
used by this specification is two <xref target="rfc3550"></xref>.
</t>
<t>Padding (P): 1 bit</t><t>
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.
</t>
<t>Extension (X): 1 bit</t><t>
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 <xref target="rfc3550"></xref>.
</t>
<t>CSRC count (CC): 4 bits</t><t>
The CSRC count contains the number of CSRC identifiers.
</t>
<t>Marker (M): 1 bit</t><t>
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.
</t>
<t>Payload Type (PT): 7 bits</t><t>
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.
</t>
<t>Sequence number: 16 bits</t><t>
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
<xref target="rfc3550"></xref>.
</t>
<t>Timestamp: 32 bits</t><t>
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.
</t>
<t>SSRC/CSRC identifiers:</t><t>
These two fields, 32 bits each with one SSRC field and a maximum
of 16 CSRC fields, are as defined in <xref target="rfc3550"></xref>.
</t>
</section>
<section anchor="Speex payload" title="Speex payload">
<t>
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 <xref target="speexenc"></xref>, and present the same sequence to the decoder. The
payload format described here maintains this sequence.
</t>
<t>
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,
</t>
<t>
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.
</t>
<t>
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.
</t>
<t>
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.
</t>
<t>
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.
</t>
</section>
<section anchor="Example Speex packet" title="Example Speex packet">
<t>
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.
</t>
<artwork><![CDATA[
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|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</section>
<section anchor="Multiple Speex frames in a RTP packet" title="Multiple Speex frames in a RTP packet">
<t>
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.
</t>
<t>
Speex codecs <xref target="speexenc"></xref> are able to detect the the bitrate from the
payload and are responsible for detecting the 20 msec boundaries
between each frame.
</t>
<artwork><![CDATA[
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.. |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</section>
<section anchor="MIME registration of Speex" title="MIME registration of Speex">
<t>
Full definition of the MIME <xref target="rfc2045"></xref> type for Speex will be part of the Ogg
Vorbis MIME type definition application <xref target="rfc3534"></xref>.
</t>
<t>MIME media type name: audio</t>
<t>MIME subtype: speex</t>
<t>Optional parameters:</t>
<t>Required parameters: to be included in the Ogg MIME specification.</t>
<t>Encoding considerations:</t>
<t>Security Considerations:</t>
<t>See Section 6 of RFC 3047.</t>
<t>Interoperability considerations: none</t>
<t>Published specification: </t>
<t>Applications which use this media type:</t>
<t>Additional information: none</t>
<t>Person &amp; email address to contact for further information:<vspace blankLines="1" />
<list style="empty">
<t>Greg Herlein &lt;gherlein@herlein.com&gt;</t>
<t>Jean-Marc Valin &lt;jean-marc.valin@hermes.usherb.ca&gt;</t>
</list>
</t>
<t>Intended usage: COMMON</t>
<t>Author/Change controller:</t>
<t>
<list style="empty">
<t>Author: Greg Herlein &lt;gherlein@herlein.com&gt;</t>
<t>Change controller: Greg Herlein &lt;gherlein@herlein.com&gt;</t>
<t>Change controller: IETF AVT Working Group</t>
</list>
</t>
<t>
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 <xref target="rfc3534"></xref>, with the exception that the
content of the Ogg Stream may be assumed to be Speex audio and
Speex audio only.
</t>
</section>
<section anchor="SDP usage of Speex" title="SDP usage of Speex">
<t>
When conveying information by SDP <xref target="rfc2327"></xref>, 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:
</t>
<vspace blankLines="1" />
<list style="empty">
<t>m=audio 8088 RTP/AVP 97</t>
<t>a=rtpmap:97 speex/8000</t>
</list>
<t>
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).
</t>
<t>
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.
</t>
<t>
If for some reason the offerer has bandwidth limitations, the client
may use the "b=" header, as explained in SDP <xref target="rfc2327"></xref>. The following example
illustrates the case where the offerer cannot receive more than
10 kbit/s.
</t>
<vspace blankLines="1" />
<list style="empty">
<t>m=audio 8088 RTP/AVP 97</t>
<t>b=AS:10</t>
<t>a=rtmap:97 speex/8000</t>
</list>
<t>
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=").
</t>
<t>
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:
</t>
<vspace blankLines="1" />
<list style="empty">
<t>ptime: duration of each packet in milliseconds.<vspace blankLines="1" /></t>
<t>sr: actual sample rate in Hz.<vspace blankLines="1" /></t>
<t>ebw: encoding bandwidth - either 'narrow' or 'wide' or
'ultra' (corresponds to nominal 8000, 16000, and
32000 Hz sampling rates).<vspace blankLines="1" /></t>
<t>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.<vspace blankLines="1" /></t>
<t>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.<vspace blankLines="1" /></t>
<t>mode: Speex encoding mode. Can be {1,2,3,4,5,6,any}
defaults to 3 in narrowband, 6 in wide and ultra-wide.<vspace blankLines="1" /></t>
<t>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).<vspace blankLines="1" /></t>
</list>
<t>Examples:</t>
<vspace blankLines="1" />
<list style="empty">
<t>m=audio 8008 RTP/AVP 97</t>
<t>a=rtpmap:97 speex/8000</t>
<t>a=fmtp:97 mode=4</t>
</list>
<t>
This examples illustrate an offerer that wishes to receive
a Speex stream at 8000Hz, but only using speex mode 3.
</t>
<t>
The offerer may suggest to the remote decoder to activate
its perceptual enhancement filter like this:
</t>
<vspace blankLines="1" />
<list style="empty">
<t>m=audio 8088 RTP/AVP 97</t>
<t>a=rtmap:97 speex/8000</t>
<t>a=fmtp:97 penh=1 </t>
</list>
<t>
Several Speex specific parameters can be given in a single
a=fmtp line provided that they are separated by a semi-colon:
</t>
<vspace blankLines="1" />
<list style="empty">
<t>a=fmtp:97 mode=any;penh=1</t>
</list>
<t>
The offerer may indicate that it wishes to send variable bit rate
frames with comfort noise:
</t>
<vspace blankLines="1" />
<list style="empty">
<t>m=audio 8088 RTP/AVP 97</t>
<t>a=rtmap:97 speex/8000</t>
<t>a=fmtp:97 vbr=on;cng=on</t>
</list>
<t>
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.
</t>
<t>
In the example below the ptime value is set to 40, indicating that
there are 2 frames in each packet.
</t>
<vspace blankLines="1" />
<list style="empty">
<t>m=audio 8008 RTP/AVP 97</t>
<t>a=rtpmap:97 speex/8000</t>
<t>a=ptime:40</t>
</list>
<t>
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.
</t>
<t>
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.
</t>
<t>
Care must be taken when setting the value of ptime so that the
RTP packet size does not exceed the path MTU.
</t>
</section>
<section anchor="ITU H.323/H.245 Use of Speex" title="ITU H.323/H.245 Use of Speex">
<t>
Application is underway to make Speex a standard ITU codec.
However, until that is finalized, Speex MAY be used in H.323 <xref target="H323"></xref> by
using a non-standard codec block definition in the H.245 <xref target="H245"></xref> codec
capability negotiations.
</t>
</section>
<section anchor="NonStandardMessage format" title="NonStandardMessage format">
<t>
For Speex use in H.245 <xref target="H245"></xref> based systems, the fields in the
NonStandardMessage should be:
</t>
<vspace blankLines="1" />
<list style="empty">
<t>t35CountryCode = Hex: B5</t>
<t>t35Extension = Hex: 00</t>
<t>manufacturerCode = Hex: 0026</t>
<t>[Length of the Binary Sequence (8 bit number)]</t>
<t>[Binary Sequence consisting of an ASCII string, no NULL terminator]</t>
</list>
<t>
The binary sequence is an ascii string merely for ease of use.
The string is not null terminated. The format of this string is
</t>
<vspace blankLines="1" />
<list style="empty">
<t>speex [optional variables]</t>
</list>
<t>
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:
</t>
<vspace blankLines="1" />
<list style="empty">
<t>ebw=narrow;mode=3;vbr=off;cng=off;ptime=20;sr=8000;penh=no;</t>
</list>
<t>
The fifth octet of the block is the length of the binary sequence.
</t>
<t>
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.
</t>
</section>
<section anchor="RTP Payload Types" title="RTP Payload Types">
<t>
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.
</t>
</section>
<section anchor="Security Considerations" title="Security Considerations">
<t>
RTP packets using the payload format defined in this specification
are subject to the security considerations discussed in the RTP
specification <xref target="rfc3550"></xref>, 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.
</t>
<t>
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.
</t>
<t>
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.
</t>
</section>
<section anchor="Acknowledgments" title="Acknowledgments">
<t>
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 &lt;brian@streamcomm.com&gt; of StreamComm for his assistance in
developing the proposed standard for Speex use in H.323
applications.
</t>
<t>
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.
</t>
</section>
</middle>
<back>
<references title="Normative References">
<reference anchor="rfc2119">
<front>
<title>Key words for use in RFCs to Indicate Requirement Levels </title>
<author initials="S." surname="Bradner" fullname="Scott Bradner"></author>
</front>
<seriesInfo name="RFC" value="2119" />
</reference>
<reference anchor="rfc3550">
<front>
<title>RTP: A Transport Protocol for real-time applications</title>
<author initials="H." surname="Schulzrinne" fullname=""></author>
<author initials="S." surname="Casner" fullname=""></author>
<author initials="R." surname="Frederick" fullname=""></author>
<author initials="V." surname="Jacobson" fullname=""></author>
</front>
<seriesInfo name="RFC" value="3550" />
</reference>
<reference anchor="rfc2045">
<front>
<title>Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</title>
<author initials="" surname="" fullname=""></author>
</front>
<date month="November" year="1998" />
<seriesInfo name="RFC" value="2045" />
</reference>
<reference anchor="rfc2327">
<front>
<title>SDP: Session Description Protocol</title>
<author initials="V." surname="Jacobson" fullname=""></author>
<author initials="M." surname="Handley" fullname=""></author>
</front>
<date month="April" year="1998" />
<seriesInfo name="RFC" value="2327" />
</reference>
<reference anchor="H323">
<front>
<title>Packet-based Multimedia Communications Systems</title>
<author initials="" surname="" fullname=""></author>
</front>
<date month="" year="1998" />
<seriesInfo name="ITU-T Recommendation" value="H.323" />
</reference>
<reference anchor="H245">
<front>
<title>Control of communications between Visual Telephone Systems and Terminal Equipment</title>
<author initials="" surname="" fullname=""></author>
</front>
<date month="" year="1998" />
<seriesInfo name="ITU-T Recommendation" value="H.245" />
</reference>
<reference anchor="rfc3551">
<front>
<title>RTP Profile for Audio and Video Conferences with Minimal Control.</title>
<author initials="H." surname="Schulzrinne" fullname=""></author>
<author initials="S." surname="Casner" fullname=""></author>
</front>
<date month="July" year="2003" />
<seriesInfo name="RFC" value="3551" />
</reference>
<reference anchor="rfc3534">
<front>
<title>The application/ogg Media Type</title>
<author initials="L." surname="Walleij" fullname=""></author>
</front>
<date month="May" year="2003" />
<seriesInfo name="RFC" value="3534" />
</reference>
</references>
<references title="Informative References">
<reference anchor="speexenc">
<front>
<title>Speexenc/speexdec, reference command-line encoder/decoder</title>
</front>
<seriesInfo name="Speex website" value="http://www.speex.org/" />
</reference>
<reference anchor="CELP">
<front>
<title>CELP, U.S. Federal Standard 1016.</title>
<author initials="" surname="" fullname=""></author>
</front>
<seriesInfo name="National Technical Information Service (NTIS) website" value="http://www.ntis.gov/" />
</reference>
</references>
</back>
</rfc>

View file

@ -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 <gherlein@herlein.com>
Jean-Marc Valin <jean-marc.valin@usherbrooke.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 [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
<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.
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]

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -1,182 +0,0 @@
#include <math.h>
#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; i<NB_ORDER; i++)
st->old_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; i<NB_SUBFRAME_SIZE; i++) {
exc[i] = exc32[i] + innov[i];
}
}
SPEEX_COPY(out, &st->exc[-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; i<NB_ORDER; i++)
st->interp_qlpc[i] = ak[i];
}
/* Store the LSPs for interpolation in the next frame */
for (i=0; i<NB_ORDER; i++)
st->old_qlsp[i] = qlsp[i];
return 0;
}

View file

@ -1,125 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Speex Programming</title>
<meta http-equiv="content-type"
content="text/html; charset=ISO-8859-1">
</head>
<body>
<div align="center">
<h1>Speex Programming</h1>
<div align="left">
<h2>Encoding</h2>
In order to encode speech using Speex, you first need to:<br>
<blockquote>
<pre><big>#include &lt;speex.h&gt;</big></pre>
</blockquote>
You then need to declare a Speex bit-packing struct<br>
<blockquote>
<pre><big>SpeexBits bits;</big></pre>
</blockquote>
and a Speex encoder state<br>
<blockquote>
<pre><big>void *enc_state;</big></pre>
</blockquote>
The two are initialized by:<br>
<blockquote>
<pre><big>speex_bits_init(&amp;bits);</big></pre>
<pre><big>enc_state = speex_encoder_init(&amp;speex_nb_mode);</big></pre>
</blockquote>
For wideband coding, <i>speex_nb_mode</i> will be replaced by <i>speex_wb_mode</i>
. 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 <i>frame_size</i> variable with:<br>
<blockquote><big><tt>speex_encoder_ctl(enc_state, SPEEX_GET_FRAME_SIZE, &amp;frame_size);</tt></big><br>
</blockquote>
For every input frame:<br>
<blockquote>
<pre><big>speex_bits_reset(&amp;bits);</big></pre>
<pre><big>speex_encode(enc_state, input_frame, &amp;bits);</big></pre>
<pre><big>nbBytes = speex_bits_write(&amp;bits, byte_ptr, MAX_NB_BYTES);</big></pre>
</blockquote>
where <i>input_frame</i> is a <i>(float *)</i> pointing to the beginning
of a speech frame, byte_ptr is a <i>(char *)</i> where the encoded frame will
be written, <i>MAX_NB_BYTES</i> is the maximum number of bytes that can be
written to <i>byte_ptr</i> without causing an overflow and <i>nbBytes</i>
is the number of bytes actually written to <i>byte_ptr</i> (the encoded
size in bytes).<br>
<br>
After you're done with the encoding, free all resources with:<br>
<blockquote>
<pre><big>speex_bits_destroy(&amp;bits);</big></pre>
<pre><big>speex_encoder_destroy(&amp;enc_state);</big></pre>
</blockquote>
That's about it for the encoder.<br>
<h2>Decoding</h2>
In order to encode speech using Speex, you first need to:<br>
<blockquote>
<pre><big>#include &lt;speex.h&gt;</big></pre>
</blockquote>
You then need to declare a Speex bit-packing struct<br>
<blockquote>
<pre><big>SpeexBits bits;</big></pre>
</blockquote>
and a Speex encoder state<br>
<blockquote>
<pre><big>void *dec_state;</big></pre>
</blockquote>
The two are initialized by:<br>
<blockquote>
<pre><big>speex_bits_init(&amp;bits);</big></pre>
<pre><big>dec_state = speex_decoder_init(&amp;speex_nb_mode);</big></pre>
</blockquote>
For wideband decoding, <i>speex_nb_mode</i> will be replaced by <i>speex_wb_mode</i>
. You can get that value in the <i>frame_size</i> variable with:<br>
<blockquote><big><tt>speex_decoder_ctl(dec_state, SPEEX_GET_FRAME_SIZE, &amp;frame_size);</tt></big><br>
</blockquote>
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:<br>
<blockquote><big><tt>speex_decoder_ctl(dec_state, SPEEX_SET_PF, &amp;pf);</tt></big><br>
</blockquote>
where <i>pf</i> is an <i>int</i> that with value 0 to have the post-filter
disabled and 1 to have it enabled.<br>
<br>
For every input frame:<br>
<blockquote>
<pre><big>speex_bits_read_from(&amp;bits, input_bytes, nbBytes);</big></pre>
<pre><big>speex_decode(st, &amp;bits, output_frame, 0);</big></pre>
</blockquote>
where <i>input_bytes</i> is a <i>(char *)</i> containing the bit-stream
data received for a frame, <i>nbBytes</i> is the size (in bytes) of that
bit-stream, and <i>output_frame</i> is a <i>(float *)</i> 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.<br>
<br>
</div>
</div>
</body>
</html>

File diff suppressed because it is too large Load diff

View file

@ -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|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

View file

@ -1,65 +0,0 @@
#include <speex/speex.h>
#include <stdio.h>
/*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<FRAME_SIZE;i++)
out[i]=output[i];
/*Write the decoded audio to file*/
fwrite(out, sizeof(short), FRAME_SIZE, fout);
}
/*Destroy the decoder state*/
speex_decoder_destroy(state);
/*Destroy the bit-stream truct*/
speex_bits_destroy(&bits);
fclose(fout);
return 0;
}

View file

@ -1,64 +0,0 @@
#include <speex/speex.h>
#include <stdio.h>
/*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<FRAME_SIZE;i++)
input[i]=in[i];
/*Flush all the bits in the struct so we can encode a new frame*/
speex_bits_reset(&bits);
/*Encode the frame*/
speex_encode(state, input, &bits);
/*Copy the bits to an array of char that can be written*/
nbBytes = speex_bits_write(&bits, cbits, 200);
/*Write the size of the frame first. This is what sampledec expects but
it's likely to be different in your own application*/
fwrite(&nbBytes, sizeof(int), 1, stdout);
/*Write the compressed data*/
fwrite(cbits, 1, nbBytes, stdout);
}
/*Destroy the encoder state*/
speex_encoder_destroy(state);
/*Destroy the bit-packing struct*/
speex_bits_destroy(&bits);
fclose(fin);
return 0;
}

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -1,744 +0,0 @@
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 465 180
%%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.02832 0.02831 s
0 -6358 t
/tm matrix currentmatrix def
tm setmatrix
-700 -3000 t
1 1 s
50 lw 1 lj 0.000 c 3900 7000 m 3100 7000 l 3100 5500 l 4700 5500 l 4700 7000 l
3900 7000 l pc
gs
gs
pum
3293 6460 t
47 0 m 47 -455 l 107 -455 l 107 -54 l 330 -54 l 330 0 l 47 0 l p ef
400 0 m 400 0 400 0 400 -455 ct 400 -455 400 -455 571 -455 ct 602 -455 625 -454 641 -451 ct
663 -447 682 -440 697 -429 ct 712 -419 724 -404 733 -385 ct 742 -367 747 -346 747 -323 ct
747 -285 735 -252 710 -225 ct 685 -198 641 -185 577 -185 ct 577 -185 577 -185 460 -185 ct
460 -185 460 -185 460 0 ct 460 0 460 0 400 0 ct p
460 -239 m 460 -239 460 -239 578 -239 ct 617 -239 644 -246 660 -261 ct 677 -275 685 -295 685 -322 ct
685 -341 680 -357 671 -370 ct 661 -384 648 -393 633 -397 ct 622 -400 604 -401 576 -401 ct
576 -401 576 -401 460 -401 ct 460 -401 460 -401 460 -239 ct p ef
1149 -159 m 1149 -159 1149 -159 1209 -144 ct 1196 -95 1174 -57 1141 -31 ct
1108 -5 1068 8 1021 8 ct 972 8 932 -2 901 -22 ct 870 -42 847 -71 831 -109 ct 815 -147 807 -187 807 -231 ct
807 -278 816 -320 834 -355 ct 852 -390 878 -417 911 -436 ct 945 -454 981 -463 1022 -463 ct
1067 -463 1105 -451 1136 -428 ct 1167 -405 1189 -373 1201 -331 ct 1201 -331 1201 -331 1142 -317 ct
1131 -350 1116 -374 1096 -389 ct 1076 -404 1051 -412 1020 -412 ct 985 -412 956 -404 933 -387 ct
909 -370 893 -347 883 -319 ct 874 -291 869 -261 869 -231 ct 869 -192 875 -158 886 -129 ct
897 -101 915 -79 939 -65 ct 962 -50 988 -43 1016 -43 ct 1050 -43 1078 -53 1102 -72 ct
1125 -92 1141 -121 1149 -159 ct p ef
pom
gr
gr
gs
gs
pum
1170 3636 t
181 -260 m 181 -260 181 -260 181 -174 ct 181 -174 181 -174 171 -174 ct 164 -201 155 -220 145 -229 ct
134 -239 120 -244 103 -244 ct 91 -244 80 -241 73 -234 ct 65 -227 61 -219 61 -211 ct
61 -201 64 -192 70 -185 ct 75 -177 87 -169 104 -161 ct 104 -161 104 -161 144 -141 ct
181 -123 200 -99 200 -69 ct 200 -47 191 -28 174 -14 ct 157 0 138 7 116 7 ct 101 7 83 4 64 -1 ct
58 -2 53 -3 49 -3 ct 45 -3 41 -1 39 3 ct 39 3 39 3 29 3 ct 29 3 29 3 29 -87 ct 29 -87 29 -87 39 -87 ct
44 -61 54 -42 68 -29 ct 83 -16 99 -9 116 -9 ct 129 -9 139 -13 147 -20 ct 155 -28 159 -37 159 -47 ct
159 -60 155 -70 146 -79 ct 137 -88 119 -98 93 -111 ct 66 -124 48 -136 40 -147 ct
32 -157 28 -171 28 -187 ct 28 -208 35 -225 49 -239 ct 63 -253 82 -260 104 -260 ct
114 -260 126 -258 140 -254 ct 149 -251 155 -250 158 -250 ct 161 -250 164 -251 165 -252 ct
167 -253 169 -256 171 -260 ct 171 -260 171 -260 181 -260 ct p ef
220 -228 m 220 -228 220 -228 298 -259 ct 298 -259 298 -259 309 -259 ct 309 -259 309 -259 309 -201 ct
322 -223 335 -238 348 -247 ct 361 -256 375 -260 389 -260 ct 414 -260 435 -250 452 -230 ct
473 -206 483 -175 483 -136 ct 483 -92 471 -56 446 -28 ct 425 -5 400 7 369 7 ct
355 7 343 5 334 1 ct 326 -2 318 -7 309 -16 ct 309 -16 309 -16 309 63 ct 309 80 310 91 312 96 ct
314 100 318 104 323 107 ct 329 110 338 111 352 111 ct 352 111 352 111 352 121 ct
352 121 352 121 217 121 ct 217 121 217 121 217 111 ct 217 111 217 111 224 111 ct
234 111 243 109 251 105 ct 254 103 257 100 259 95 ct 261 91 262 79 262 61 ct 262 61 262 61 262 -179 ct
262 -195 261 -205 260 -209 ct 258 -213 256 -216 253 -219 ct 250 -221 245 -222 240 -222 ct
236 -222 230 -221 223 -218 ct 223 -218 223 -218 220 -228 ct p
309 -185 m 309 -185 309 -185 309 -90 ct 309 -70 310 -57 311 -50 ct 314 -40 320 -30 330 -22 ct
340 -14 353 -10 368 -10 ct 386 -10 401 -17 412 -31 ct 427 -50 434 -77 434 -111 ct
434 -149 426 -179 409 -200 ct 397 -214 383 -221 367 -221 ct 359 -221 350 -219 341 -214 ct
335 -211 324 -201 309 -185 ct p ef
564 -158 m 564 -121 573 -92 591 -71 ct 609 -50 630 -39 655 -39 ct 671 -39 686 -43 698 -52 ct
710 -61 720 -77 728 -99 ct 728 -99 728 -99 737 -94 ct 733 -68 722 -45 703 -24 ct
685 -3 662 7 634 7 ct 604 7 578 -5 556 -28 ct 535 -52 524 -83 524 -123 ct 524 -166 535 -200 557 -224 ct
579 -248 607 -260 640 -260 ct 668 -260 692 -251 710 -232 ct 728 -214 737 -189 737 -158 ct
737 -158 737 -158 564 -158 ct p
564 -174 m 564 -174 564 -174 680 -174 ct 679 -190 677 -201 674 -208 ct 670 -218 663 -226 654 -231 ct
645 -237 635 -240 626 -240 ct 610 -240 597 -234 585 -223 ct 573 -211 566 -195 564 -174 ct
p ef
814 -158 m 814 -121 823 -92 841 -71 ct 859 -50 880 -39 905 -39 ct 921 -39 936 -43 948 -52 ct
960 -61 970 -77 978 -99 ct 978 -99 978 -99 987 -94 ct 983 -68 972 -45 953 -24 ct
935 -3 912 7 884 7 ct 854 7 828 -5 806 -28 ct 785 -52 774 -83 774 -123 ct 774 -166 785 -200 807 -224 ct
829 -248 857 -260 890 -260 ct 918 -260 942 -251 960 -232 ct 978 -214 987 -189 987 -158 ct
987 -158 987 -158 814 -158 ct p
814 -174 m 814 -174 814 -174 930 -174 ct 929 -190 927 -201 924 -208 ct 920 -218 913 -226 904 -231 ct
895 -237 885 -240 876 -240 ct 860 -240 847 -234 835 -223 ct 823 -211 816 -195 814 -174 ct
p ef
1236 -95 m 1229 -62 1216 -37 1196 -19 ct 1176 -2 1154 7 1130 7 ct 1101 7 1076 -5 1055 -29 ct
1034 -53 1023 -85 1023 -126 ct 1023 -166 1035 -198 1058 -223 ct 1082 -248 1111 -260 1144 -260 ct
1169 -260 1189 -253 1205 -240 ct 1221 -227 1229 -214 1229 -199 ct 1229 -192 1227 -187 1222 -182 ct
1218 -178 1211 -176 1203 -176 ct 1193 -176 1185 -180 1179 -187 ct 1176 -190 1174 -198 1173 -209 ct
1172 -220 1168 -228 1161 -234 ct 1155 -239 1146 -242 1135 -242 ct 1116 -242 1102 -235 1090 -222 ct
1075 -204 1068 -180 1068 -150 ct 1068 -120 1075 -94 1090 -71 ct 1105 -48 1125 -36 1150 -36 ct
1168 -36 1184 -42 1199 -54 ct 1209 -62 1218 -77 1228 -99 ct 1228 -99 1228 -99 1236 -95 ct
p ef
1345 -392 m 1345 -392 1345 -392 1345 -208 ct 1365 -230 1381 -244 1393 -251 ct
1405 -257 1417 -260 1429 -260 ct 1443 -260 1456 -256 1466 -248 ct 1476 -240 1484 -228 1489 -211 ct
1492 -199 1494 -178 1494 -146 ct 1494 -146 1494 -146 1494 -57 ct 1494 -41 1495 -30 1498 -24 ct
1500 -20 1503 -16 1507 -14 ct 1511 -11 1519 -10 1531 -10 ct 1531 -10 1531 -10 1531 0 ct
1531 0 1531 0 1407 0 ct 1407 0 1407 0 1407 -10 ct 1407 -10 1407 -10 1413 -10 ct
1425 -10 1433 -12 1437 -15 ct 1442 -19 1445 -24 1447 -31 ct 1448 -34 1448 -43 1448 -57 ct
1448 -57 1448 -57 1448 -147 ct 1448 -174 1447 -192 1444 -201 ct 1441 -210 1436 -216 1430 -221 ct
1424 -225 1417 -227 1408 -227 ct 1399 -227 1389 -225 1380 -220 ct 1370 -215 1359 -205 1345 -191 ct
1345 -191 1345 -191 1345 -57 ct 1345 -40 1346 -29 1348 -25 ct 1350 -21 1353 -17 1359 -14 ct
1364 -11 1373 -10 1386 -10 ct 1386 -10 1386 -10 1386 0 ct 1386 0 1386 0 1262 0 ct
1262 0 1262 0 1262 -10 ct 1273 -10 1281 -12 1287 -15 ct 1291 -17 1294 -21 1296 -26 ct
1298 -31 1299 -41 1299 -57 ct 1299 -57 1299 -57 1299 -286 ct 1299 -314 1298 -332 1297 -338 ct
1296 -345 1294 -349 1291 -352 ct 1288 -354 1284 -355 1279 -355 ct 1276 -355 1269 -354 1261 -351 ct
1261 -351 1261 -351 1257 -361 ct 1257 -361 1257 -361 1332 -392 ct 1332 -392 1332 -392 1345 -392 ct
p ef
pom
gr
gs
pum
1286 4263 t
117 -233 m 117 -233 117 -233 117 -67 ct 117 -43 120 -28 125 -22 ct 132 -14 141 -10 152 -10 ct
152 -10 152 -10 175 -10 ct 175 -10 175 -10 175 0 ct 175 0 175 0 24 0 ct 24 0 24 0 24 -10 ct
24 -10 24 -10 35 -10 ct 43 -10 49 -12 55 -16 ct 61 -19 65 -24 68 -30 ct 70 -37 71 -49 71 -67 ct
71 -67 71 -67 71 -233 ct 71 -233 71 -233 22 -233 ct 22 -233 22 -233 22 -253 ct
22 -253 22 -253 71 -253 ct 71 -253 71 -253 71 -270 ct 71 -295 75 -316 83 -334 ct
91 -351 104 -365 120 -376 ct 137 -387 156 -392 177 -392 ct 196 -392 214 -386 230 -373 ct
241 -365 246 -355 246 -345 ct 246 -340 244 -334 239 -329 ct 234 -324 229 -322 223 -322 ct
219 -322 215 -324 210 -327 ct 205 -330 200 -336 193 -346 ct 186 -356 180 -363 174 -367 ct
168 -370 162 -372 155 -372 ct 147 -372 139 -370 134 -365 ct 128 -361 123 -354 121 -344 ct
118 -335 117 -310 117 -271 ct 117 -271 117 -271 117 -253 ct 117 -253 117 -253 182 -253 ct
182 -253 182 -253 182 -233 ct 182 -233 182 -233 117 -233 ct p ef
283 -260 m 283 -260 283 -260 283 -203 ct 304 -241 326 -260 348 -260 ct 358 -260 366 -257 373 -251 ct
380 -245 383 -238 383 -230 ct 383 -222 381 -216 376 -211 ct 371 -206 365 -204 359 -204 ct
352 -204 345 -207 337 -214 ct 329 -220 323 -223 319 -223 ct 316 -223 312 -221 309 -217 ct
300 -210 292 -198 283 -180 ct 283 -180 283 -180 283 -59 ct 283 -45 285 -34 288 -27 ct
291 -22 295 -18 301 -15 ct 307 -12 316 -10 328 -10 ct 328 -10 328 -10 328 0 ct
328 0 328 0 196 0 ct 196 0 196 0 196 -10 ct 209 -10 219 -12 226 -16 ct 230 -19 234 -24 236 -30 ct
237 -33 237 -42 237 -57 ct 237 -57 237 -57 237 -154 ct 237 -184 236 -201 235 -207 ct
234 -213 232 -217 229 -219 ct 226 -222 222 -223 217 -223 ct 211 -223 205 -222 198 -219 ct
198 -219 198 -219 195 -229 ct 195 -229 195 -229 271 -260 ct 271 -260 271 -260 283 -260 ct
p ef
538 -37 m 512 -17 496 -5 489 -2 ct 479 3 469 5 457 5 ct 440 5 425 -1 414 -13 ct
403 -25 397 -40 397 -60 ct 397 -72 400 -83 405 -92 ct 413 -104 426 -116 445 -127 ct
463 -138 495 -151 538 -167 ct 538 -167 538 -167 538 -177 ct 538 -202 534 -219 526 -228 ct
518 -237 507 -242 491 -242 ct 480 -242 471 -239 464 -233 ct 457 -226 453 -219 453 -211 ct
453 -211 453 -211 454 -195 ct 454 -187 452 -180 447 -176 ct 443 -171 437 -169 430 -169 ct
424 -169 418 -171 414 -176 ct 409 -181 407 -188 407 -196 ct 407 -212 415 -227 431 -240 ct
447 -253 470 -260 499 -260 ct 521 -260 540 -256 554 -249 ct 565 -243 573 -234 578 -222 ct
581 -214 583 -198 583 -174 ct 583 -174 583 -174 583 -89 ct 583 -65 583 -50 584 -45 ct
585 -39 587 -36 589 -34 ct 591 -32 593 -31 596 -31 ct 599 -31 602 -32 604 -33 ct
608 -35 615 -42 626 -53 ct 626 -53 626 -53 626 -38 ct 606 -10 586 4 568 4 ct 559 4 551 1 546 -5 ct
541 -11 538 -22 538 -37 ct p
538 -54 m 538 -54 538 -54 538 -149 ct 510 -138 492 -130 484 -126 ct 469 -118 459 -110 452 -101 ct
446 -92 443 -83 443 -72 ct 443 -59 447 -49 455 -40 ct 463 -31 472 -27 482 -27 ct
497 -27 515 -36 538 -54 ct p ef
720 -206 m 738 -225 749 -235 752 -238 ct 761 -245 769 -250 779 -254 ct 789 -258 798 -260 807 -260 ct
823 -260 837 -255 848 -246 ct 859 -237 867 -224 871 -206 ct 890 -228 906 -243 919 -250 ct
932 -257 945 -260 959 -260 ct 972 -260 984 -257 994 -250 ct 1005 -243 1013 -232 1019 -216 ct
1023 -205 1025 -188 1025 -166 ct 1025 -166 1025 -166 1025 -57 ct 1025 -41 1026 -30 1028 -25 ct
1030 -21 1034 -17 1038 -14 ct 1043 -11 1051 -10 1062 -10 ct 1062 -10 1062 -10 1062 0 ct
1062 0 1062 0 938 0 ct 938 0 938 0 938 -10 ct 938 -10 938 -10 943 -10 ct 954 -10 963 -12 969 -16 ct
973 -19 976 -24 978 -30 ct 979 -33 979 -42 979 -57 ct 979 -57 979 -57 979 -166 ct
979 -186 977 -201 972 -209 ct 964 -221 953 -227 937 -227 ct 928 -227 918 -225 908 -220 ct
898 -215 886 -206 873 -193 ct 873 -193 873 -193 872 -189 ct 872 -189 872 -189 873 -178 ct
873 -178 873 -178 873 -57 ct 873 -40 874 -29 876 -25 ct 878 -21 881 -17 887 -14 ct
892 -11 901 -10 914 -10 ct 914 -10 914 -10 914 0 ct 914 0 914 0 786 0 ct 786 0 786 0 786 -10 ct
800 -10 810 -12 815 -15 ct 820 -18 824 -23 826 -30 ct 827 -33 827 -42 827 -57 ct
827 -57 827 -57 827 -166 ct 827 -186 824 -201 818 -210 ct 810 -221 799 -227 784 -227 ct
774 -227 765 -224 755 -219 ct 740 -211 728 -202 720 -193 ct 720 -193 720 -193 720 -57 ct
720 -41 721 -30 723 -25 ct 726 -20 729 -16 734 -14 ct 738 -11 747 -10 761 -10 ct
761 -10 761 -10 761 0 ct 761 0 761 0 637 0 ct 637 0 637 0 637 -10 ct 648 -10 656 -11 660 -14 ct
665 -16 668 -20 671 -26 ct 673 -31 674 -41 674 -57 ct 674 -57 674 -57 674 -154 ct
674 -182 673 -199 672 -207 ct 670 -213 668 -217 666 -220 ct 663 -222 659 -223 654 -223 ct
649 -223 643 -222 636 -219 ct 636 -219 636 -219 632 -229 ct 632 -229 632 -229 708 -260 ct
708 -260 708 -260 720 -260 ct 720 -260 720 -260 720 -206 ct p ef
1114 -158 m 1114 -121 1123 -92 1141 -71 ct 1159 -50 1180 -39 1205 -39 ct 1221 -39 1236 -43 1248 -52 ct
1260 -61 1270 -77 1278 -99 ct 1278 -99 1278 -99 1287 -94 ct 1283 -68 1272 -45 1253 -24 ct
1235 -3 1212 7 1184 7 ct 1154 7 1128 -5 1106 -28 ct 1085 -52 1074 -83 1074 -123 ct
1074 -166 1085 -200 1107 -224 ct 1129 -248 1157 -260 1190 -260 ct 1218 -260 1242 -251 1260 -232 ct
1278 -214 1287 -189 1287 -158 ct 1287 -158 1287 -158 1114 -158 ct p
1114 -174 m 1114 -174 1114 -174 1230 -174 ct 1229 -190 1227 -201 1224 -208 ct
1220 -218 1213 -226 1204 -231 ct 1195 -237 1185 -240 1176 -240 ct 1160 -240 1147 -234 1135 -223 ct
1123 -211 1116 -195 1114 -174 ct p ef
pom
gr
gr
3100 6250 m 2538 6438 l 2538 6063 l 3100 6250 l p ef
1975 4500 m 1975 6250 l 1950 6250 l 1925 6250 l 1925 4500 l 1950 4500 l
1975 4500 l p ef
1950 6250 m 1950 6275 l 1946 6275 l 1941 6273 l 1938 6272 l 1934 6269 l
1931 6266 l 1928 6263 l 1927 6259 l 1925 6254 l 1925 6250 l 1925 6250 l
1950 6250 l p ef
1950 6225 m 2650 6225 l 2650 6250 l 2650 6275 l 1950 6275 l 1950 6250 l
1950 6225 l p ef
gs
4635 7681 m 6248 7681 l 6248 9206 l 4635 9206 l 4635 7681 l eoclip newpath
gs
tm setmatrix
3942 4683 t
1 1 s
gs
gs
0 0 m 1613 0 l 1613 1525 l 0 1525 l 0 0 l eoclip newpath
gs
pum
661 556 t
74 -379 m 74 -379 74 -379 176 -429 ct 176 -429 176 -429 186 -429 ct 186 -429 186 -429 186 -74 ct
186 -50 187 -36 189 -30 ct 191 -24 195 -19 201 -16 ct 207 -13 220 -11 239 -11 ct
239 -11 239 -11 239 0 ct 239 0 239 0 82 0 ct 82 0 82 0 82 -11 ct 101 -11 114 -13 120 -16 ct
125 -19 129 -23 132 -28 ct 134 -33 135 -49 135 -74 ct 135 -74 135 -74 135 -301 ct
135 -331 134 -351 132 -359 ct 130 -366 128 -371 124 -374 ct 120 -377 116 -379 110 -379 ct
103 -379 92 -375 79 -369 ct 79 -369 79 -369 74 -379 ct p ef
pom
gr
gs
132 741 m 1350 0 rl 0 31 rl 1350 neg 0 rl ef p ef
gr
gs
pum
238 1376 t
328 -430 m 328 -430 328 -430 296 -80 ct 294 -64 294 -53 294 -48 ct 294 -40 295 -33 298 -29 ct
302 -23 307 -18 314 -15 ct 321 -12 332 -11 348 -11 ct 348 -11 348 -11 345 0 ct
345 0 345 0 180 0 ct 180 0 180 0 184 -11 ct 184 -11 184 -11 191 -11 ct 204 -11 215 -14 224 -20 ct
230 -24 234 -30 238 -39 ct 240 -46 242 -61 244 -85 ct 244 -85 244 -85 249 -138 ct
249 -138 249 -138 128 -138 ct 128 -138 128 -138 86 -80 ct 76 -67 70 -57 67 -52 ct
65 -46 64 -41 64 -36 ct 64 -29 66 -24 72 -19 ct 77 -14 86 -11 98 -11 ct 98 -11 98 -11 95 0 ct
95 0 95 0 -30 0 ct -30 0 -30 0 -27 -11 ct -12 -12 2 -17 14 -26 ct 25 -36 43 -57 66 -88 ct
66 -88 66 -88 317 -430 ct 317 -430 317 -430 328 -430 ct p
268 -327 m 144 -159 l 251 -159 l 268 -327 l p ef
pom
gr
gs
pum
661 1376 t
168 131 m 127 98 96 50 75 -12 ct 56 -66 47 -123 47 -183 ct 47 -241 56 -298 75 -354 ct
98 -419 128 -467 168 -497 ct 168 -497 168 -497 168 -481 ct 139 -454 116 -408 101 -342 ct
89 -290 83 -237 83 -183 ct 83 -129 89 -76 101 -24 ct 116 43 139 89 168 116 ct 168 116 168 116 168 131 ct
p ef
pom
gr
gs
pum
953 1376 t
54 -273 m 54 -273 54 -273 249 -273 ct 249 -273 249 -273 249 -265 ct 249 -265 249 -265 35 -42 ct
35 -42 35 -42 125 -42 ct 147 -42 161 -43 166 -44 ct 172 -46 178 -50 183 -55 ct
187 -60 193 -70 199 -84 ct 199 -84 199 -84 210 -84 ct 210 -84 210 -84 183 0 ct
183 0 183 0 -18 0 ct -18 0 -18 0 -18 -9 ct -18 -9 -18 -9 196 -232 ct 196 -232 196 -232 109 -232 ct
90 -232 78 -232 74 -231 ct 68 -229 63 -226 57 -221 ct 51 -216 45 -208 39 -196 ct
39 -196 39 -196 28 -196 ct 28 -196 28 -196 54 -273 ct p ef
pom
gr
gs
pum
1270 1376 t
33 116 m 61 90 82 46 97 -18 ct 110 -70 117 -120 117 -170 ct 117 -229 111 -284 100 -335 ct
86 -404 63 -453 33 -481 ct 33 -481 33 -481 33 -497 ct 72 -468 103 -421 125 -354 ct
143 -299 153 -241 153 -183 ct 153 -123 144 -66 125 -11 ct 103 54 72 102 33 131 ct
33 131 33 131 33 116 ct p ef
pom
gr
gr
gr
gr
gr
5400 9300 m 4400 9300 l 4400 7500 l 6400 7500 l 6400 9300 l 5400 9300 l
pc
7700 7000 m 6800 7000 l 6800 5500 l 8600 5500 l 8600 7000 l 7700 7000 l
pc
gs
gs
pum
7102 6460 t
47 0 m 47 -455 l 107 -455 l 107 -54 l 330 -54 l 330 0 l 47 0 l p ef
380 -146 m 380 -146 380 -146 437 -151 ct 440 -128 446 -110 456 -95 ct 465 -80 481 -69 501 -60 ct
522 -51 545 -46 571 -46 ct 593 -46 614 -49 631 -56 ct 649 -63 662 -72 670 -84 ct
679 -96 683 -109 683 -123 ct 683 -138 679 -150 670 -161 ct 662 -171 648 -180 629 -187 ct
617 -192 590 -200 549 -210 ct 507 -220 478 -229 461 -238 ct 440 -249 424 -264 413 -280 ct
402 -297 397 -316 397 -337 ct 397 -360 404 -382 416 -402 ct 429 -422 448 -437 473 -447 ct
498 -458 526 -463 557 -463 ct 590 -463 620 -458 646 -447 ct 671 -436 691 -420 705 -399 ct
719 -378 726 -354 727 -327 ct 727 -327 727 -327 669 -323 ct 666 -351 656 -373 638 -387 ct
620 -402 594 -409 559 -409 ct 523 -409 496 -402 480 -389 ct 463 -376 455 -360 455 -341 ct
455 -324 461 -311 473 -300 ct 484 -290 514 -279 563 -268 ct 611 -257 645 -247 663 -239 ct
690 -227 709 -211 722 -193 ct 735 -174 741 -153 741 -128 ct 741 -104 734 -81 720 -60 ct
706 -38 687 -22 661 -10 ct 635 2 606 8 573 8 ct 532 8 498 2 470 -10 ct 442 -22 421 -40 405 -64 ct
389 -88 381 -116 380 -146 ct p ef
824 0 m 824 0 824 0 824 -455 ct 824 -455 824 -455 995 -455 ct 1026 -455 1049 -454 1065 -451 ct
1087 -447 1106 -440 1121 -429 ct 1136 -419 1148 -404 1157 -385 ct 1166 -367 1171 -346 1171 -323 ct
1171 -285 1159 -252 1134 -225 ct 1109 -198 1065 -185 1001 -185 ct 1001 -185 1001 -185 884 -185 ct
884 -185 884 -185 884 0 ct 884 0 884 0 824 0 ct p
884 -239 m 884 -239 884 -239 1002 -239 ct 1041 -239 1068 -246 1084 -261 ct
1101 -275 1109 -295 1109 -322 ct 1109 -341 1104 -357 1095 -370 ct 1085 -384 1072 -393 1057 -397 ct
1046 -400 1028 -401 1000 -401 ct 1000 -401 1000 -401 884 -401 ct 884 -401 884 -401 884 -239 ct
p ef
pom
gr
gr
6800 6250 m 6238 6438 l 6238 6063 l 6800 6250 l p ef
4700 6225 m 6350 6225 l 6350 6275 l 4700 6275 l 4700 6225 l p ef
4400 8400 m 3988 8538 l 3988 8263 l 4400 8400 l p ef
4070 8425 m 1950 8425 l 1950 8400 l 1950 8375 l 4070 8375 l 4070 8400 l
4070 8425 l p ef
1950 8400 m 1950 8425 l 1946 8425 l 1941 8423 l 1938 8422 l 1934 8419 l
1931 8416 l 1928 8413 l 1927 8409 l 1925 8404 l 1925 8400 l 1925 8400 l
1950 8400 l p ef
1925 8400 m 1925 4500 l 1950 4500 l 1975 4500 l 1975 8400 l 1950 8400 l
1925 8400 l p ef
1950 4500 m 1950 4500 l 1950 4500 l 1950 4500 l 1950 4500 l 1950 4500 l
1950 4500 l p ef
5400 7500 m 5213 6938 l 5588 6938 l 5400 7500 l p ef
4700 6225 m 5400 6225 l 5400 6250 l 5400 6275 l 4700 6275 l 4700 6250 l
4700 6225 l p ef
5400 6250 m 5400 6225 l 5404 6225 l 5409 6227 l 5412 6228 l 5416 6231 l
5419 6234 l 5422 6237 l 5423 6241 l 5425 6246 l 5425 6250 l 5425 6250 l
5400 6250 l p ef
5425 6250 m 5425 7050 l 5400 7050 l 5375 7050 l 5375 6250 l 5400 6250 l
5425 6250 l p ef
10600 7000 m 9700 7000 l 9700 5500 l 11500 5500 l 11500 7000 l 10600 7000 l
pc
gs
gs
pum
10153 6460 t
178 0 m 178 0 178 0 2 -455 ct 2 -455 2 -455 67 -455 ct 67 -455 67 -455 186 -124 ct
195 -98 203 -73 210 -50 ct 217 -74 225 -99 234 -124 ct 234 -124 234 -124 357 -455 ct
357 -455 357 -455 419 -455 ct 419 -455 419 -455 241 0 ct 241 0 241 0 178 0 ct p ef
817 -48 m 845 -29 870 -15 894 -6 ct 894 -6 894 -6 876 36 ct 843 24 811 5 778 -21 ct
745 -2 707 8 667 8 ct 625 8 588 -2 555 -22 ct 521 -42 495 -70 477 -106 ct 459 -142 450 -182 450 -227 ct
450 -272 459 -313 477 -350 ct 496 -387 521 -415 555 -434 ct 589 -453 626 -463 668 -463 ct
710 -463 748 -453 781 -433 ct 815 -413 841 -385 858 -349 ct 876 -313 885 -273 885 -227 ct
885 -190 879 -156 868 -126 ct 857 -96 839 -70 817 -48 ct p
684 -125 m 719 -115 747 -101 770 -82 ct 805 -114 823 -162 823 -227 ct 823 -264 817 -296 804 -324 ct
792 -352 773 -373 749 -388 ct 725 -403 698 -411 668 -411 ct 623 -411 586 -396 556 -365 ct
527 -334 512 -288 512 -227 ct 512 -168 527 -122 556 -91 ct 585 -59 623 -43 668 -43 ct
690 -43 710 -47 729 -55 ct 710 -67 690 -76 669 -81 ct 669 -81 669 -81 684 -125 ct
p ef
pom
gr
gr
9700 6250 m 9138 6438 l 9138 6063 l 9700 6250 l p ef
8600 6225 m 9250 6225 l 9250 6275 l 8600 6275 l 8600 6225 l p ef
gs
8135 7931 m 9830 7931 l 9830 8806 l 8135 8806 l 8135 7931 l eoclip newpath
gs
tm setmatrix
7435 4921 t
1 1 s
gs
gs
0 0 m 1695 0 l 1695 875 l 0 875 l 0 0 l eoclip newpath
gs
pum
106 741 t
650 93 m 650 93 650 93 56 93 ct 56 93 56 93 56 76 ct 56 76 56 76 359 -301 ct 359 -301 359 -301 56 -670 ct
56 -670 56 -670 56 -687 ct 56 -687 56 -687 634 -687 ct 634 -687 634 -687 646 -534 ct
646 -534 646 -534 627 -534 ct 620 -611 582 -650 516 -650 ct 516 -650 516 -650 181 -650 ct
181 -650 181 -650 435 -339 ct 435 -339 435 -339 150 13 ct 150 13 150 13 520 13 ct
595 13 642 -24 661 -98 ct 661 -98 661 -98 679 -96 ct 679 -96 679 -96 650 93 ct
p ef
pom
gr
gs
pum
953 661 t
168 131 m 127 98 96 50 75 -12 ct 56 -66 47 -123 47 -183 ct 47 -241 56 -298 75 -354 ct
98 -419 128 -467 168 -497 ct 168 -497 168 -497 168 -481 ct 139 -454 116 -408 101 -342 ct
89 -290 83 -237 83 -183 ct 83 -129 89 -76 101 -24 ct 116 43 139 89 168 116 ct 168 116 168 116 168 131 ct
p ef
pom
gr
gs
pum
1217 661 t
33 116 m 61 90 82 46 97 -18 ct 110 -70 117 -120 117 -170 ct 117 -229 111 -284 100 -335 ct
86 -404 63 -453 33 -481 ct 33 -481 33 -481 33 -497 ct 72 -468 103 -421 125 -354 ct
143 -299 153 -241 153 -183 ct 153 -123 144 -66 125 -11 ct 103 54 72 102 33 131 ct
33 131 33 131 33 116 ct p ef
pom
gr
gs
pum
1402 344 t
175 -48 m 175 -48 175 -48 157 0 ct 157 0 157 0 8 0 ct 8 0 8 0 8 -7 ct 52 -47 83 -79 101 -105 ct
119 -130 128 -153 128 -174 ct 128 -190 123 -204 113 -214 ct 103 -225 91 -230 78 -230 ct
65 -230 54 -226 44 -219 ct 34 -212 27 -202 22 -188 ct 22 -188 22 -188 15 -188 ct
18 -211 26 -228 39 -240 ct 52 -252 68 -258 88 -258 ct 108 -258 125 -251 139 -238 ct
153 -225 160 -209 160 -191 ct 160 -179 157 -166 151 -153 ct 142 -133 127 -112 106 -89 ct
75 -55 55 -35 48 -28 ct 48 -28 48 -28 114 -28 ct 127 -28 137 -29 142 -29 ct 147 -30 152 -32 157 -36 ct
161 -39 165 -43 168 -48 ct 168 -48 168 -48 175 -48 ct p ef
pom
gr
gr
gr
gr
gr
8950 9100 m 7900 9100 l 7900 7700 l 10000 7700 l 10000 9100 l 8950 9100 l
pc
7900 8400 m 7338 8588 l 7338 8213 l 7900 8400 l p ef
6400 8375 m 7450 8375 l 7450 8425 l 6400 8425 l 6400 8375 l p ef
13350 9100 m 12300 9100 l 12300 7700 l 14400 7700 l 14400 9100 l 13350 9100 l
pc
gs
gs
pum
12395 8584 t
242 -260 m 242 -260 242 -260 242 64 ct 242 81 243 91 245 96 ct 248 101 251 104 256 107 ct
260 110 269 111 283 111 ct 283 111 283 111 283 121 ct 283 121 283 121 156 121 ct
156 121 156 121 156 111 ct 156 111 156 111 161 111 ct 172 111 179 109 185 106 ct
189 104 191 101 194 95 ct 196 90 197 79 197 64 ct 197 64 197 64 197 -45 ct 180 -25 166 -11 153 -4 ct
141 3 128 7 114 7 ct 90 7 68 -4 49 -26 ct 30 -48 20 -78 20 -115 ct 20 -158 33 -193 58 -220 ct
83 -247 114 -260 149 -260 ct 160 -260 170 -259 178 -256 ct 187 -253 195 -248 202 -243 ct
213 -248 223 -253 233 -260 ct 233 -260 233 -260 242 -260 ct p
197 -62 m 197 -62 197 -62 197 -180 ct 197 -194 195 -205 192 -213 ct 188 -221 182 -227 172 -233 ct
163 -238 153 -241 141 -241 ct 121 -241 103 -232 88 -215 ct 73 -197 66 -171 66 -136 ct
66 -102 74 -76 89 -58 ct 104 -41 122 -32 143 -32 ct 154 -32 163 -34 172 -39 ct
181 -44 189 -51 197 -62 ct p ef
523 -253 m 523 -253 523 -253 523 -99 ct 523 -70 524 -53 525 -47 ct 526 -40 529 -36 532 -33 ct
535 -31 538 -29 542 -29 ct 548 -29 554 -31 561 -34 ct 561 -34 561 -34 565 -24 ct
565 -24 565 -24 490 7 ct 490 7 490 7 478 7 ct 478 7 478 7 478 -46 ct 456 -23 440 -8 428 -2 ct
417 4 405 7 392 7 ct 378 7 365 3 355 -5 ct 344 -14 337 -24 333 -37 ct 329 -50 327 -68 327 -92 ct
327 -92 327 -92 327 -205 ct 327 -217 326 -225 323 -229 ct 321 -234 317 -237 312 -240 ct
307 -242 297 -243 284 -243 ct 284 -243 284 -243 284 -253 ct 284 -253 284 -253 373 -253 ct
373 -253 373 -253 373 -84 ct 373 -60 377 -44 385 -37 ct 394 -30 403 -26 415 -26 ct
423 -26 432 -28 442 -33 ct 452 -38 464 -48 478 -62 ct 478 -62 478 -62 478 -205 ct
478 -220 475 -230 470 -235 ct 465 -240 454 -243 437 -243 ct 437 -243 437 -243 437 -253 ct
437 -253 437 -253 523 -253 ct p ef
728 -37 m 702 -17 686 -5 679 -2 ct 669 3 659 5 647 5 ct 630 5 615 -1 604 -13 ct
593 -25 587 -40 587 -60 ct 587 -72 590 -83 595 -92 ct 603 -104 616 -116 635 -127 ct
653 -138 685 -151 728 -167 ct 728 -167 728 -167 728 -177 ct 728 -202 724 -219 716 -228 ct
708 -237 697 -242 681 -242 ct 670 -242 661 -239 654 -233 ct 647 -226 643 -219 643 -211 ct
643 -211 643 -211 644 -195 ct 644 -187 642 -180 637 -176 ct 633 -171 627 -169 620 -169 ct
614 -169 608 -171 604 -176 ct 599 -181 597 -188 597 -196 ct 597 -212 605 -227 621 -240 ct
637 -253 660 -260 689 -260 ct 711 -260 730 -256 744 -249 ct 755 -243 763 -234 768 -222 ct
771 -214 773 -198 773 -174 ct 773 -174 773 -174 773 -89 ct 773 -65 773 -50 774 -45 ct
775 -39 777 -36 779 -34 ct 781 -32 783 -31 786 -31 ct 789 -31 792 -32 794 -33 ct
798 -35 805 -42 816 -53 ct 816 -53 816 -53 816 -38 ct 796 -10 776 4 758 4 ct 749 4 741 1 736 -5 ct
731 -11 728 -22 728 -37 ct p
728 -54 m 728 -54 728 -54 728 -149 ct 700 -138 682 -130 674 -126 ct 659 -118 649 -110 642 -101 ct
636 -92 633 -83 633 -72 ct 633 -59 637 -49 645 -40 ct 653 -31 662 -27 672 -27 ct
687 -27 705 -36 728 -54 ct p ef
909 -207 m 938 -242 966 -260 993 -260 ct 1007 -260 1019 -257 1028 -250 ct 1038 -243 1046 -231 1052 -216 ct
1056 -205 1058 -188 1058 -165 ct 1058 -165 1058 -165 1058 -57 ct 1058 -41 1059 -30 1062 -25 ct
1064 -20 1067 -16 1071 -14 ct 1075 -11 1083 -10 1095 -10 ct 1095 -10 1095 -10 1095 0 ct
1095 0 1095 0 971 0 ct 971 0 971 0 971 -10 ct 971 -10 971 -10 976 -10 ct 988 -10 996 -12 1001 -15 ct
1006 -19 1009 -24 1011 -31 ct 1012 -34 1012 -43 1012 -57 ct 1012 -57 1012 -57 1012 -161 ct
1012 -184 1009 -201 1003 -211 ct 997 -222 987 -227 973 -227 ct 952 -227 930 -215 909 -191 ct
909 -191 909 -191 909 -57 ct 909 -40 910 -29 912 -25 ct 915 -20 918 -16 923 -14 ct
927 -11 936 -10 950 -10 ct 950 -10 950 -10 950 0 ct 950 0 950 0 826 0 ct 826 0 826 0 826 -10 ct
826 -10 826 -10 831 -10 ct 844 -10 852 -13 856 -20 ct 861 -26 863 -39 863 -57 ct
863 -57 863 -57 863 -151 ct 863 -181 862 -200 861 -206 ct 860 -213 858 -217 855 -220 ct
852 -222 848 -223 843 -223 ct 838 -223 832 -222 825 -219 ct 825 -219 825 -219 821 -229 ct
821 -229 821 -229 897 -260 ct 897 -260 897 -260 909 -260 ct 909 -260 909 -260 909 -207 ct
p ef
1192 -337 m 1192 -337 1192 -337 1192 -253 ct 1192 -253 1192 -253 1251 -253 ct
1251 -253 1251 -253 1251 -234 ct 1251 -234 1251 -234 1192 -234 ct 1192 -234 1192 -234 1192 -70 ct
1192 -53 1194 -42 1199 -37 ct 1204 -31 1210 -28 1217 -28 ct 1223 -28 1229 -30 1235 -34 ct
1240 -37 1245 -43 1248 -50 ct 1248 -50 1248 -50 1259 -50 ct 1253 -32 1243 -19 1232 -10 ct
1220 -1 1207 4 1195 4 ct 1186 4 1178 2 1170 -3 ct 1162 -8 1156 -14 1152 -23 ct
1148 -32 1146 -45 1146 -64 ct 1146 -64 1146 -64 1146 -234 ct 1146 -234 1146 -234 1106 -234 ct
1106 -234 1106 -234 1106 -243 ct 1116 -247 1126 -254 1137 -264 ct 1148 -273 1157 -285 1165 -298 ct
1170 -305 1175 -318 1183 -337 ct 1183 -337 1183 -337 1192 -337 ct p ef
1339 -392 m 1347 -392 1353 -389 1359 -384 ct 1364 -378 1367 -372 1367 -364 ct
1367 -356 1364 -350 1359 -344 ct 1353 -339 1347 -336 1339 -336 ct 1331 -336 1325 -339 1319 -344 ct
1314 -350 1311 -356 1311 -364 ct 1311 -372 1314 -378 1319 -384 ct 1325 -389 1331 -392 1339 -392 ct
p
1362 -260 m 1362 -260 1362 -260 1362 -57 ct 1362 -41 1363 -31 1365 -26 ct 1368 -20 1371 -16 1375 -14 ct
1380 -11 1387 -10 1399 -10 ct 1399 -10 1399 -10 1399 0 ct 1399 0 1399 0 1279 0 ct
1279 0 1279 0 1279 -10 ct 1291 -10 1299 -11 1303 -14 ct 1307 -16 1310 -20 1312 -25 ct
1315 -31 1316 -41 1316 -57 ct 1316 -57 1316 -57 1316 -154 ct 1316 -181 1315 -199 1314 -207 ct
1312 -213 1310 -217 1308 -220 ct 1305 -222 1301 -223 1296 -223 ct 1291 -223 1285 -222 1278 -219 ct
1278 -219 1278 -219 1274 -229 ct 1274 -229 1274 -229 1350 -260 ct 1350 -260 1350 -260 1362 -260 ct
p ef
1651 -77 m 1651 -77 1651 -77 1648 0 ct 1648 0 1648 0 1425 0 ct 1425 0 1425 0 1425 -10 ct
1425 -10 1425 -10 1594 -234 ct 1594 -234 1594 -234 1509 -234 ct 1491 -234 1480 -233 1474 -231 ct
1469 -228 1464 -224 1461 -217 ct 1456 -208 1453 -197 1452 -183 ct 1452 -183 1452 -183 1442 -183 ct
1442 -183 1442 -183 1443 -253 ct 1443 -253 1443 -253 1655 -253 ct 1655 -253 1655 -253 1655 -243 ct
1655 -243 1655 -243 1486 -18 ct 1486 -18 1486 -18 1578 -18 ct 1597 -18 1610 -20 1617 -23 ct
1624 -26 1629 -32 1634 -40 ct 1637 -46 1639 -58 1641 -77 ct 1641 -77 1641 -77 1651 -77 ct
p ef
1724 -158 m 1724 -121 1733 -92 1751 -71 ct 1769 -50 1790 -39 1815 -39 ct 1831 -39 1846 -43 1858 -52 ct
1870 -61 1880 -77 1888 -99 ct 1888 -99 1888 -99 1897 -94 ct 1893 -68 1882 -45 1863 -24 ct
1845 -3 1822 7 1794 7 ct 1764 7 1738 -5 1716 -28 ct 1695 -52 1684 -83 1684 -123 ct
1684 -166 1695 -200 1717 -224 ct 1739 -248 1767 -260 1800 -260 ct 1828 -260 1852 -251 1870 -232 ct
1888 -214 1897 -189 1897 -158 ct 1897 -158 1897 -158 1724 -158 ct p
1724 -174 m 1724 -174 1724 -174 1840 -174 ct 1839 -190 1837 -201 1834 -208 ct
1830 -218 1823 -226 1814 -231 ct 1805 -237 1795 -240 1786 -240 ct 1770 -240 1757 -234 1745 -223 ct
1733 -211 1726 -195 1724 -174 ct p ef
pom
gr
gr
12300 8400 m 11738 8588 l 11738 8213 l 12300 8400 l p ef
10000 8375 m 11850 8375 l 11850 8425 l 10000 8425 l 10000 8375 l p ef
gs
10100 7500 m 11689 7500 l 11689 8295 l 10100 8295 l 10100 7500 l eoclip newpath
gs
tm setmatrix
9393 4498 t
1 1 s
gs
gs
0 0 m 1589 0 l 1589 795 l 0 795 l 0 0 l eoclip newpath
gs
pum
159 556 t
331 -261 m 331 -261 331 -261 322 -229 ct 322 -229 322 -229 270 -229 ct 274 -218 276 -207 276 -198 ct
276 -170 264 -146 241 -124 ct 217 -103 185 -91 144 -89 ct 122 -82 106 -75 95 -65 ct
91 -62 89 -59 89 -55 ct 89 -51 91 -47 95 -44 ct 98 -40 108 -37 123 -33 ct 123 -33 123 -33 183 -20 ct
216 -12 238 -3 248 8 ct 259 19 264 31 264 46 ct 264 63 258 78 245 92 ct 233 106 215 117 190 125 ct
166 133 140 137 111 137 ct 85 137 62 134 41 128 ct 20 122 5 114 -4 103 ct -13 93 -18 82 -18 71 ct
-18 63 -15 53 -9 44 ct -3 34 4 26 13 20 ct 19 16 35 7 61 -8 ct 52 -15 47 -23 47 -32 ct
47 -40 51 -49 59 -58 ct 67 -68 85 -78 111 -89 ct 89 -93 71 -103 58 -118 ct 45 -132 39 -149 39 -167 ct
39 -196 52 -222 78 -245 ct 104 -268 138 -280 181 -280 ct 196 -280 209 -278 219 -275 ct
229 -272 239 -268 248 -261 ct 248 -261 248 -261 331 -261 ct p
225 -211 m 225 -228 220 -240 211 -250 ct 201 -259 189 -264 173 -264 ct 149 -264 129 -252 114 -229 ct
98 -206 90 -182 90 -157 ct 90 -141 95 -128 105 -118 ct 115 -108 127 -103 142 -103 ct
153 -103 164 -106 174 -112 ct 185 -118 194 -126 201 -136 ct 209 -147 214 -160 219 -176 ct
223 -192 225 -204 225 -211 ct p
74 0 m 57 8 45 18 36 30 ct 27 42 23 53 23 65 ct 23 79 29 90 42 99 ct 59 112 85 118 120 118 ct
149 118 175 113 196 103 ct 217 93 227 80 227 64 ct 227 56 223 48 215 41 ct 208 34 193 28 170 24 ct
158 21 126 13 74 0 ct p ef
pom
gr
gs
pum
609 714 t
119 -164 m 119 -164 119 -164 116 -150 ct 116 -150 116 -150 88 -150 ct 88 -150 88 -150 65 -69 ct
55 -34 45 -6 36 13 ct 23 41 9 60 -6 70 ct -18 78 -29 82 -41 82 ct -49 82 -55 80 -60 75 ct
-64 72 -66 68 -66 63 ct -66 59 -64 55 -61 52 ct -58 49 -54 48 -50 48 ct -46 48 -44 49 -41 51 ct
-39 53 -38 56 -38 58 ct -38 61 -39 64 -41 66 ct -43 68 -44 69 -44 70 ct -44 71 -44 72 -43 73 ct
-42 74 -40 74 -38 74 ct -32 74 -27 72 -21 69 ct -15 66 -10 61 -5 54 ct -1 48 3 38 8 26 ct
9 21 14 4 22 -25 ct 22 -25 22 -25 59 -150 ct 59 -150 59 -150 22 -150 ct 22 -150 22 -150 25 -164 ct
36 -164 44 -165 49 -166 ct 53 -168 57 -170 61 -174 ct 65 -178 70 -186 75 -197 ct
82 -212 89 -224 95 -232 ct 104 -243 113 -251 123 -257 ct 132 -262 142 -265 150 -265 ct
159 -265 166 -263 172 -258 ct 177 -253 180 -248 180 -242 ct 180 -238 179 -234 176 -231 ct
173 -228 169 -227 165 -227 ct 161 -227 158 -228 156 -230 ct 153 -233 152 -235 152 -238 ct
152 -240 153 -243 155 -245 ct 157 -248 158 -250 158 -251 ct 158 -253 157 -254 156 -255 ct
155 -256 153 -257 150 -257 ct 143 -257 136 -254 130 -249 ct 122 -242 115 -232 109 -217 ct
106 -210 100 -192 92 -164 ct 92 -164 92 -164 119 -164 ct p ef
125 -158 m 125 -158 125 -158 189 -168 ct 189 -168 189 -168 163 -78 ct 185 -115 204 -141 222 -155 ct
232 -164 240 -168 247 -168 ct 251 -168 254 -167 256 -164 ct 259 -162 260 -158 260 -154 ct
260 -146 258 -138 254 -130 ct 251 -125 247 -122 241 -122 ct 238 -122 236 -123 234 -125 ct
232 -127 230 -130 230 -134 ct 230 -136 229 -138 228 -138 ct 227 -139 226 -140 225 -140 ct
223 -140 221 -140 219 -139 ct 216 -137 211 -132 204 -124 ct 194 -112 183 -96 171 -77 ct
166 -68 161 -59 158 -49 ct 153 -35 150 -26 149 -23 ct 149 -23 149 -23 142 0 ct
142 0 142 0 114 0 ct 114 0 114 0 147 -116 ct 151 -129 153 -139 153 -144 ct 153 -146 153 -148 151 -150 ct
148 -152 145 -153 141 -153 ct 139 -153 134 -152 128 -151 ct 128 -151 128 -151 125 -158 ct
p ef
443 -166 m 443 -166 443 -166 406 -40 ct 406 -40 406 -40 402 -23 ct 402 -21 401 -20 401 -19 ct
401 -17 402 -15 403 -14 ct 403 -13 404 -13 405 -13 ct 406 -13 408 -13 409 -15 ct
413 -18 417 -26 423 -37 ct 423 -37 423 -37 429 -33 ct 422 -20 415 -11 407 -5 ct
399 1 392 4 386 4 ct 382 4 378 3 376 0 ct 373 -3 372 -6 372 -11 ct 372 -17 373 -25 376 -35 ct
376 -35 376 -35 380 -50 ct 362 -29 346 -14 331 -5 ct 320 1 309 4 299 4 ct 289 4 280 0 273 -7 ct
266 -14 262 -25 262 -38 ct 262 -57 268 -77 281 -99 ct 294 -120 311 -138 331 -151 ct
346 -161 361 -166 374 -166 ct 383 -166 390 -164 395 -160 ct 401 -157 405 -151 408 -142 ct
408 -142 408 -142 413 -162 ct 413 -162 413 -162 443 -166 ct p
373 -157 m 365 -157 356 -153 346 -146 ct 332 -136 320 -120 309 -100 ct 298 -80 293 -61 293 -45 ct
293 -37 295 -30 300 -25 ct 305 -20 310 -18 317 -18 ct 332 -18 349 -28 367 -47 ct
389 -73 399 -100 398 -128 ct 398 -138 396 -145 392 -150 ct 387 -155 381 -157 373 -157 ct
p ef
528 -168 m 528 -168 528 -168 504 -84 ct 515 -104 524 -119 532 -129 ct 544 -144 555 -155 567 -162 ct
573 -166 580 -168 588 -168 ct 594 -168 599 -166 603 -162 ct 607 -158 609 -153 609 -147 ct
609 -141 608 -133 605 -123 ct 605 -123 605 -123 591 -76 ct 612 -114 632 -140 652 -155 ct
662 -164 673 -168 683 -168 ct 689 -168 694 -166 698 -162 ct 702 -158 704 -151 704 -143 ct
704 -135 703 -128 700 -120 ct 700 -120 700 -120 677 -48 ct 672 -33 669 -24 669 -22 ct
669 -21 670 -19 671 -18 ct 672 -17 673 -17 674 -17 ct 675 -17 677 -18 680 -20 ct
686 -25 692 -33 698 -42 ct 698 -42 698 -42 704 -38 ct 701 -33 696 -26 688 -18 ct
681 -9 674 -3 669 0 ct 663 3 658 4 654 4 ct 650 4 646 3 643 0 ct 641 -3 639 -7 639 -11 ct
639 -17 642 -29 648 -47 ct 648 -47 648 -47 668 -106 ct 672 -120 674 -128 675 -129 ct
675 -132 675 -134 675 -136 ct 675 -139 675 -142 673 -143 ct 671 -145 670 -146 668 -146 ct
662 -146 656 -143 650 -138 ct 631 -122 613 -100 597 -72 ct 586 -53 576 -29 567 0 ct
567 0 567 0 540 0 ct 540 0 540 0 574 -112 ct 578 -124 580 -132 580 -136 ct 580 -140 579 -142 577 -144 ct
576 -145 574 -146 572 -146 ct 568 -146 564 -145 559 -142 ct 551 -137 542 -126 530 -111 ct
518 -95 508 -80 502 -65 ct 499 -59 491 -37 479 0 ct 479 0 479 0 452 0 ct 452 0 452 0 487 -120 ct
487 -120 487 -120 491 -136 ct 492 -138 493 -140 493 -141 ct 493 -144 491 -146 489 -148 ct
486 -150 483 -151 479 -151 ct 478 -151 473 -150 466 -149 ct 466 -149 466 -149 464 -156 ct
464 -156 464 -156 528 -168 ct p ef
763 -70 m 762 -64 762 -59 762 -55 ct 762 -44 766 -35 774 -27 ct 782 -20 792 -16 803 -16 ct
812 -16 821 -18 830 -21 ct 838 -25 851 -33 867 -45 ct 867 -45 867 -45 871 -40 ct
841 -11 813 4 786 4 ct 768 4 754 -2 745 -13 ct 736 -24 731 -37 731 -51 ct 731 -69 737 -88 748 -107 ct
760 -126 774 -141 792 -152 ct 809 -163 827 -168 845 -168 ct 858 -168 868 -165 874 -160 ct
881 -155 884 -148 884 -141 ct 884 -131 880 -121 871 -112 ct 860 -99 844 -89 823 -82 ct
809 -77 789 -73 763 -70 ct p
764 -79 m 783 -81 799 -85 811 -90 ct 826 -97 838 -105 846 -114 ct 854 -124 858 -133 858 -141 ct
858 -147 856 -151 853 -154 ct 850 -157 845 -159 838 -159 ct 825 -159 811 -152 797 -139 ct
782 -125 771 -105 764 -79 ct p ef
pom
gr
gr
gr
gr
gr
gs
14601 7501 m 16190 7501 l 16190 8296 l 14601 8296 l 14601 7501 l eoclip newpath
gs
tm setmatrix
13891 4498 t
1 1 s
gs
gs
0 0 m 1590 0 l 1590 795 l 0 795 l 0 0 l eoclip newpath
gs
pum
212 556 t
208 -345 m 197 -344 l 113 -410 l 25 -342 l 11 -345 l 113 -462 l 208 -345 l
p ef
pom
gr
gs
pum
159 556 t
331 -261 m 331 -261 331 -261 322 -229 ct 322 -229 322 -229 270 -229 ct 274 -218 276 -207 276 -198 ct
276 -170 264 -146 241 -124 ct 217 -103 185 -91 144 -89 ct 122 -82 106 -75 95 -65 ct
91 -62 89 -59 89 -55 ct 89 -51 91 -47 95 -44 ct 98 -40 108 -37 123 -33 ct 123 -33 123 -33 183 -20 ct
216 -12 238 -3 248 8 ct 259 19 264 31 264 46 ct 264 63 258 78 245 92 ct 233 106 215 117 190 125 ct
166 133 140 137 111 137 ct 85 137 62 134 41 128 ct 20 122 5 114 -4 103 ct -13 93 -18 82 -18 71 ct
-18 63 -15 53 -9 44 ct -3 34 4 26 13 20 ct 19 16 35 7 61 -8 ct 52 -15 47 -23 47 -32 ct
47 -40 51 -49 59 -58 ct 67 -68 85 -78 111 -89 ct 89 -93 71 -103 58 -118 ct 45 -132 39 -149 39 -167 ct
39 -196 52 -222 78 -245 ct 104 -268 138 -280 181 -280 ct 196 -280 209 -278 219 -275 ct
229 -272 239 -268 248 -261 ct 248 -261 248 -261 331 -261 ct p
225 -211 m 225 -228 220 -240 211 -250 ct 201 -259 189 -264 173 -264 ct 149 -264 129 -252 114 -229 ct
98 -206 90 -182 90 -157 ct 90 -141 95 -128 105 -118 ct 115 -108 127 -103 142 -103 ct
153 -103 164 -106 174 -112 ct 185 -118 194 -126 201 -136 ct 209 -147 214 -160 219 -176 ct
223 -192 225 -204 225 -211 ct p
74 0 m 57 8 45 18 36 30 ct 27 42 23 53 23 65 ct 23 79 29 90 42 99 ct 59 112 85 118 120 118 ct
149 118 175 113 196 103 ct 217 93 227 80 227 64 ct 227 56 223 48 215 41 ct 208 34 193 28 170 24 ct
158 21 126 13 74 0 ct p ef
pom
gr
gs
pum
609 714 t
119 -164 m 119 -164 119 -164 116 -150 ct 116 -150 116 -150 88 -150 ct 88 -150 88 -150 65 -69 ct
55 -34 45 -6 36 13 ct 23 41 9 60 -6 70 ct -18 78 -29 82 -41 82 ct -49 82 -55 80 -60 75 ct
-64 72 -66 68 -66 63 ct -66 59 -64 55 -61 52 ct -58 49 -54 48 -50 48 ct -46 48 -44 49 -41 51 ct
-39 53 -38 56 -38 58 ct -38 61 -39 64 -41 66 ct -43 68 -44 69 -44 70 ct -44 71 -44 72 -43 73 ct
-42 74 -40 74 -38 74 ct -32 74 -27 72 -21 69 ct -15 66 -10 61 -5 54 ct -1 48 3 38 8 26 ct
9 21 14 4 22 -25 ct 22 -25 22 -25 59 -150 ct 59 -150 59 -150 22 -150 ct 22 -150 22 -150 25 -164 ct
36 -164 44 -165 49 -166 ct 53 -168 57 -170 61 -174 ct 65 -178 70 -186 75 -197 ct
82 -212 89 -224 95 -232 ct 104 -243 113 -251 123 -257 ct 132 -262 142 -265 150 -265 ct
159 -265 166 -263 172 -258 ct 177 -253 180 -248 180 -242 ct 180 -238 179 -234 176 -231 ct
173 -228 169 -227 165 -227 ct 161 -227 158 -228 156 -230 ct 153 -233 152 -235 152 -238 ct
152 -240 153 -243 155 -245 ct 157 -248 158 -250 158 -251 ct 158 -253 157 -254 156 -255 ct
155 -256 153 -257 150 -257 ct 143 -257 136 -254 130 -249 ct 122 -242 115 -232 109 -217 ct
106 -210 100 -192 92 -164 ct 92 -164 92 -164 119 -164 ct p ef
125 -158 m 125 -158 125 -158 189 -168 ct 189 -168 189 -168 163 -78 ct 185 -115 204 -141 222 -155 ct
232 -164 240 -168 247 -168 ct 251 -168 254 -167 256 -164 ct 259 -162 260 -158 260 -154 ct
260 -146 258 -138 254 -130 ct 251 -125 247 -122 241 -122 ct 238 -122 236 -123 234 -125 ct
232 -127 230 -130 230 -134 ct 230 -136 229 -138 228 -138 ct 227 -139 226 -140 225 -140 ct
223 -140 221 -140 219 -139 ct 216 -137 211 -132 204 -124 ct 194 -112 183 -96 171 -77 ct
166 -68 161 -59 158 -49 ct 153 -35 150 -26 149 -23 ct 149 -23 149 -23 142 0 ct
142 0 142 0 114 0 ct 114 0 114 0 147 -116 ct 151 -129 153 -139 153 -144 ct 153 -146 153 -148 151 -150 ct
148 -152 145 -153 141 -153 ct 139 -153 134 -152 128 -151 ct 128 -151 128 -151 125 -158 ct
p ef
443 -166 m 443 -166 443 -166 406 -40 ct 406 -40 406 -40 402 -23 ct 402 -21 401 -20 401 -19 ct
401 -17 402 -15 403 -14 ct 403 -13 404 -13 405 -13 ct 406 -13 408 -13 409 -15 ct
413 -18 417 -26 423 -37 ct 423 -37 423 -37 429 -33 ct 422 -20 415 -11 407 -5 ct
399 1 392 4 386 4 ct 382 4 378 3 376 0 ct 373 -3 372 -6 372 -11 ct 372 -17 373 -25 376 -35 ct
376 -35 376 -35 380 -50 ct 362 -29 346 -14 331 -5 ct 320 1 309 4 299 4 ct 289 4 280 0 273 -7 ct
266 -14 262 -25 262 -38 ct 262 -57 268 -77 281 -99 ct 294 -120 311 -138 331 -151 ct
346 -161 361 -166 374 -166 ct 383 -166 390 -164 395 -160 ct 401 -157 405 -151 408 -142 ct
408 -142 408 -142 413 -162 ct 413 -162 413 -162 443 -166 ct p
373 -157 m 365 -157 356 -153 346 -146 ct 332 -136 320 -120 309 -100 ct 298 -80 293 -61 293 -45 ct
293 -37 295 -30 300 -25 ct 305 -20 310 -18 317 -18 ct 332 -18 349 -28 367 -47 ct
389 -73 399 -100 398 -128 ct 398 -138 396 -145 392 -150 ct 387 -155 381 -157 373 -157 ct
p ef
528 -168 m 528 -168 528 -168 504 -84 ct 515 -104 524 -119 532 -129 ct 544 -144 555 -155 567 -162 ct
573 -166 580 -168 588 -168 ct 594 -168 599 -166 603 -162 ct 607 -158 609 -153 609 -147 ct
609 -141 608 -133 605 -123 ct 605 -123 605 -123 591 -76 ct 612 -114 632 -140 652 -155 ct
662 -164 673 -168 683 -168 ct 689 -168 694 -166 698 -162 ct 702 -158 704 -151 704 -143 ct
704 -135 703 -128 700 -120 ct 700 -120 700 -120 677 -48 ct 672 -33 669 -24 669 -22 ct
669 -21 670 -19 671 -18 ct 672 -17 673 -17 674 -17 ct 675 -17 677 -18 680 -20 ct
686 -25 692 -33 698 -42 ct 698 -42 698 -42 704 -38 ct 701 -33 696 -26 688 -18 ct
681 -9 674 -3 669 0 ct 663 3 658 4 654 4 ct 650 4 646 3 643 0 ct 641 -3 639 -7 639 -11 ct
639 -17 642 -29 648 -47 ct 648 -47 648 -47 668 -106 ct 672 -120 674 -128 675 -129 ct
675 -132 675 -134 675 -136 ct 675 -139 675 -142 673 -143 ct 671 -145 670 -146 668 -146 ct
662 -146 656 -143 650 -138 ct 631 -122 613 -100 597 -72 ct 586 -53 576 -29 567 0 ct
567 0 567 0 540 0 ct 540 0 540 0 574 -112 ct 578 -124 580 -132 580 -136 ct 580 -140 579 -142 577 -144 ct
576 -145 574 -146 572 -146 ct 568 -146 564 -145 559 -142 ct 551 -137 542 -126 530 -111 ct
518 -95 508 -80 502 -65 ct 499 -59 491 -37 479 0 ct 479 0 479 0 452 0 ct 452 0 452 0 487 -120 ct
487 -120 487 -120 491 -136 ct 492 -138 493 -140 493 -141 ct 493 -144 491 -146 489 -148 ct
486 -150 483 -151 479 -151 ct 478 -151 473 -150 466 -149 ct 466 -149 466 -149 464 -156 ct
464 -156 464 -156 528 -168 ct p ef
763 -70 m 762 -64 762 -59 762 -55 ct 762 -44 766 -35 774 -27 ct 782 -20 792 -16 803 -16 ct
812 -16 821 -18 830 -21 ct 838 -25 851 -33 867 -45 ct 867 -45 867 -45 871 -40 ct
841 -11 813 4 786 4 ct 768 4 754 -2 745 -13 ct 736 -24 731 -37 731 -51 ct 731 -69 737 -88 748 -107 ct
760 -126 774 -141 792 -152 ct 809 -163 827 -168 845 -168 ct 858 -168 868 -165 874 -160 ct
881 -155 884 -148 884 -141 ct 884 -131 880 -121 871 -112 ct 860 -99 844 -89 823 -82 ct
809 -77 789 -73 763 -70 ct p
764 -79 m 783 -81 799 -85 811 -90 ct 826 -97 838 -105 846 -114 ct 854 -124 858 -133 858 -141 ct
858 -147 856 -151 853 -154 ct 850 -157 845 -159 838 -159 ct 825 -159 811 -152 797 -139 ct
782 -125 771 -105 764 -79 ct p ef
pom
gr
gr
gr
gr
gr
16800 8400 m 16238 8588 l 16238 8213 l 16800 8400 l p ef
14400 8375 m 16350 8375 l 16350 8425 l 14400 8425 l 14400 8375 l p ef
13028 6249 m 12578 6399 l 12578 6099 l 13028 6249 l p ef
1 lw 0 lj 11500 6250 m 12527 6250 l 12527 6249 l 12668 6249 l ps
tm setmatrix
0 0 t
1 1 s
0 6358 t
pom
count op_count sub {pop} repeat countdictstack dict_count sub {end} repeat b4_inc_state restore
%%PageTrailer
%%Trailer
%%EOF

View file

@ -1,215 +0,0 @@
<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en"><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.78 [fr] (X11; U; Linux 2.4.17 i686) [Netscape]">
<meta name="Author" content="Jean-Marc Valin">
<title>The Speex Speech Codec</title>
</head>
<body text="#000000" bgcolor="#ffffff" link="#0000ef" vlink="#59188e" alink="#ff0000">
<center>
<img src="speex.png" alt="Speex">
</center>
<br>
<br>
<a href="http://sourceforge.net/projects/speex">The Speex project</a>
aims to build an open-source (LGPL) <A href="patents.html">patent-free</A> voice codec. Unlike
other codecs like MP3 and <a href="http://www.vorbis.org/">Ogg Vorbis</a>,
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.
<p>If you are interested in participating to the project, contact us at <a href="mailto:speex-devel@lists.sourceforge.net">
speex-devel@lists.sourceforge.net</a> or <a href="http://lists.sourceforge.net/lists/listinfo/speex-devel">
join our mailing list</a>. 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
<A href="http://sourceforge.net/pm/task.php?group_project_id=19556&group_id=46651&func=browse">task list</A> for more details about what's left to do in Speex<br>
</p>
<h2>Download</h2>
You can download Speex from <a href="http://sourceforge.net/project/showfiles.php?group_id=46651">
here</a>.<br>
<h2>Documentation</h2>
This Speex manual includes information about the
algorithms used in Speex, the bit-stream, the API and more.
<br>
<A href="manual.pdf">Speex manual (PDF)</A>
<br>
<A href="manual.ps">Speex manual (Postscript)</A>
<br>
<A href="manual/">Speex manual (HTML online)</A>
<br>
<A href="manual.tar.gz">Speex manual (HTML tarball)</A>
<br><br>
There is also some API documentation generated by Doxygen directly from the header files
<br>
<A href="refman.pdf">Speex API (PDF)</A>
<h2>Samples</h2>
You can listen to samples encoded with Speex <A href="/audio/samples/">here</A>
<h2>Who uses Speex</h2>
<A href="http://www.linphone.org">LinPhone</a>: A SIP-based VoIP phone written for GNOME
<br>
<A href="http://jzb.rapanden.dk/speex/">Speex XMMS plugin</a> written by <a href="mailto:jzb@rapanden.dk">Jens Burkal</a>
<br>
<A href="http://www.openh323.org">OpenH323</a>: An open-source H.323 stack
<br>
<A href="http://www.gnomemeeting.org">GnomeMeeting</A>: A H323 Video Conferencing Program
<br><br>
In development:
<br>
<A href="http://www.asteriskpbx.org">Asterisk</a>: An open-source PBX
<h2>News</h2>
<h3>2002/09/04</h3>
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.
<h3>2002/08/24</h3>
Speex 0.8.0 released. The speex_decode() function no longer uses the
'lost' parameter. Applications will need
to be updated.
<h3>2002/08/09</h3>
Speex 0.7.0 released. The format of the bit stream has changed once again
and the bandwidth required has been
reduced slightly.
<h3>2002/08/01</h3>
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.
<h3>2002/07/26</h3>
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!
<h3>2002/07/17</h3>
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.
<h3>2002/07/08</h3>
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.
<h3>2002/06/23</h3>
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).
<h3>2002/06/12</h3>
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.
<h3>2002/06/07</h3>
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.
<h3>2002/06/04</h3>
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.
<h3>2002/05/15</h3>
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.
<hr width="100%" size="2">
<div align="right"><a href="http://uk.eurorights.org/issues/cd/quick/"><img
border="0" width="160" height="40" src="badcd002.png"
alt="Say NO to corrupt audio discs" /></a>
<br>
<img src="http://sourceforge.net/sflogo.php?group_id=46651&amp;amp;type=5" alt="SourceForge Logo">
<br>
<a href="mailto:jean-marc.valin@hermes.usherb.ca">Jean-Mrc Valin</a> <br>
$Date: 2002/09/16 00:59:10 $</div>
</body></html>

View file

@ -1,39 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Speex and patents</title>
<meta name="author" content="Jean-Marc Valin">
</head>
<body>
<div align="center">
<h1>Position regarding patents</h1>
<div align="left">The goal of Speex is to provide a codec that is open-source
(released under the <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a>)
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.<br>
<br>
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 <a
href="mailto:speex-devel@lists.sourceforge.net">let us know</a>.<br>
<br>
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 <a
href="http://www.mp3-tech.org/patents.html">MP3</a>, <a
href="http://kbs.cs.tu-berlin.de/%7Ejutta/toast.html">GSM</a> and probably
others), not to mention the risks of a previously unknown patent holder claiming
rights on a standardized codec long after standardization (<a href="http://lpf.ai.mit.edu/Patents/Gif/Gif.html">GIF</a>, <a href="http://www.itworld.com/Man/2687/020719jpegpatent/">JPEG</a>).<br>
</div>
</div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

View file

@ -1,7 +0,0 @@
<!DOCTYPE webproject ><webproject>
<project usePreviewPrefix="0" previewPrefix="" type="Local" name="speex" >
<upload/>
<author></author>
<email></email>
</project>
</webproject>

Binary file not shown.

View file

@ -1,2 +0,0 @@
SUBDIRS = speex

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 <sys/types.h>
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 <sys/types.h>
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 <inttypes.h>
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 */

View file

@ -1,11 +0,0 @@
.deps
.libs
*.la
*.lo
*.o
Makefile
Makefile.in
testdenoise
testenc
testenc_uwb
testenc_wb

View file

@ -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

View file

@ -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) )

View file

@ -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

View file

@ -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

View file

@ -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<<LOG2_BITS_PER_CHAR;
bits->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;i<nchars;i++)
bits->chars[i]=HTOLS(chars[i]);
bits->nbBits=nchars<<LOG2_BITS_PER_CHAR;
bits->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<<LOG2_BITS_PER_CHAR;
bits->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;i<nchars;i++)
bits->chars[pos+i]=HTOLS(chars[i]);
bits->nbBits+=nchars<<LOG2_BITS_PER_CHAR;
}
EXPORT int speex_bits_write(SpeexBits *bits, char *chars, int max_nbytes)
{
int i;
int max_nchars = max_nbytes/BYTES_PER_CHAR;
int charPtr, bitPtr, nbBits;
/* Insert terminator, but save the data so we can put it back after */
bitPtr=bits->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;i<max_nchars;i++)
chars[i]=HTOLS(bits->chars[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;i<max_nchars;i++)
chars[i]=HTOLS(bits->chars[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)<<nbBits;
}
return d;
}
EXPORT unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits)
{
unsigned int d=0;
if ((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->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<<LOG2_BITS_PER_CHAR)+bits->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<<LOG2_BITS_PER_CHAR)+bits->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<<LOG2_BITS_PER_CHAR)+bits->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<<LOG2_BITS_PER_CHAR)+bits->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);
}

View file

@ -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;i<shape_cb_size;i++)
{
spx_word16_t *res;
res = resp+i*subvect_size;
for (k=0;k<subvect_size;k++)
shape[k] = (spx_word16_t)shape_cb[i*subvect_size+k];
E[i]=0;
/* Compute codeword response using convolution with impulse response */
for(j=0;j<subvect_size;j++)
{
spx_word32_t resj=0;
spx_word16_t res16;
for (k=0;k<=j;k++)
resj = MAC16_16(resj,shape[k],r[j-k]);
#ifdef FIXED_POINT
res16 = EXTRACT16(SHR32(resj, 13));
#else
res16 = 0.03125f*resj;
#endif
/* Compute codeword energy */
E[i]=MAC16_16(E[i],res16,res16);
res[j] = res16;
/*printf ("%d\n", (int)res[j]);*/
}
}
}
#endif
#ifndef OVERRIDE_TARGET_UPDATE
static inline void target_update(spx_word16_t *t, spx_word16_t g, spx_word16_t *r, int len)
{
int n;
for (n=0;n<len;n++)
t[n] = SUB16(t[n],PSHR32(MULT16_16(g,r[n]),13));
}
#endif
static void split_cb_search_shape_sign_N1(
spx_word16_t target[], /* target vector */
spx_coef_t ak[], /* LPCs for this subframe */
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
const void *par, /* Codebook/search parameters*/
int p, /* number of LPC coeffs */
int nsf, /* number of samples in subframe */
spx_sig_t *exc,
spx_word16_t *r,
SpeexBits *bits,
char *stack,
int update_target
)
{
int i,j,m,q;
VARDECL(spx_word16_t *resp);
#ifdef _USE_SSE
VARDECL(__m128 *resp2);
VARDECL(__m128 *E);
#else
spx_word16_t *resp2;
VARDECL(spx_word32_t *E);
#endif
VARDECL(spx_word16_t *t);
VARDECL(spx_sig_t *e);
const signed char *shape_cb;
int shape_cb_size, subvect_size, nb_subvect;
const split_cb_params *params;
int best_index;
spx_word32_t best_dist;
int have_sign;
params = (const split_cb_params *) par;
subvect_size = params->subvect_size;
nb_subvect = params->nb_subvect;
shape_cb_size = 1<<params->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;i<nb_subvect;i++)
{
spx_word16_t *x=t+subvect_size*i;
/*Find new n-best based on previous n-best j*/
#ifndef DISABLE_WIDEBAND
if (have_sign)
vq_nbest_sign(x, resp2, subvect_size, shape_cb_size, E, 1, &best_index, &best_dist, stack);
else
#endif /* DISABLE_WIDEBAND */
vq_nbest(x, resp2, subvect_size, shape_cb_size, E, 1, &best_index, &best_dist, stack);
speex_bits_pack(bits,best_index,params->shape_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<subvect_size;m++)
t[subvect_size*i+m] = SUB16(t[subvect_size*i+m], res[m]);
else
for (m=0;m<subvect_size;m++)
t[subvect_size*i+m] = ADD16(t[subvect_size*i+m], res[m]);
#ifdef FIXED_POINT
if (sign==1)
{
for (j=0;j<subvect_size;j++)
e[subvect_size*i+j]=SHL32(EXTEND32(shape_cb[rind*subvect_size+j]),SIG_SHIFT-5);
} else {
for (j=0;j<subvect_size;j++)
e[subvect_size*i+j]=NEG32(SHL32(EXTEND32(shape_cb[rind*subvect_size+j]),SIG_SHIFT-5));
}
#else
for (j=0;j<subvect_size;j++)
e[subvect_size*i+j]=sign*0.03125*shape_cb[rind*subvect_size+j];
#endif
}
for (m=0;m<subvect_size;m++)
{
spx_word16_t g;
int rind;
spx_word16_t sign=1;
rind = best_index;
if (rind>=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;j<nsf;j++)
exc[j]=ADD32(exc[j],e[j]);
/* Update target: only update target if necessary */
if (update_target)
{
VARDECL(spx_word16_t *r2);
ALLOC(r2, nsf, spx_word16_t);
for (j=0;j<nsf;j++)
r2[j] = EXTRACT16(PSHR32(e[j] ,6));
syn_percep_zero16(r2, ak, awk1, awk2, r2, nsf,p, stack);
for (j=0;j<nsf;j++)
target[j]=SUB16(target[j],PSHR16(r2[j],2));
}
}
void split_cb_search_shape_sign(
spx_word16_t target[], /* target vector */
spx_coef_t ak[], /* LPCs for this subframe */
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
const void *par, /* Codebook/search parameters*/
int p, /* number of LPC coeffs */
int nsf, /* number of samples in subframe */
spx_sig_t *exc,
spx_word16_t *r,
SpeexBits *bits,
char *stack,
int complexity,
int update_target
)
{
int i,j,k,m,n,q;
VARDECL(spx_word16_t *resp);
#ifdef _USE_SSE
VARDECL(__m128 *resp2);
VARDECL(__m128 *E);
#else
spx_word16_t *resp2;
VARDECL(spx_word32_t *E);
#endif
VARDECL(spx_word16_t *t);
VARDECL(spx_sig_t *e);
VARDECL(spx_word16_t *tmp);
VARDECL(spx_word32_t *ndist);
VARDECL(spx_word32_t *odist);
VARDECL(int *itmp);
VARDECL(spx_word16_t **ot2);
VARDECL(spx_word16_t **nt2);
spx_word16_t **ot, **nt;
VARDECL(int **nind);
VARDECL(int **oind);
VARDECL(int *ind);
const signed char *shape_cb;
int shape_cb_size, subvect_size, nb_subvect;
const split_cb_params *params;
int N=2;
VARDECL(int *best_index);
VARDECL(spx_word32_t *best_dist);
VARDECL(int *best_nind);
VARDECL(int *best_ntarget);
int have_sign;
N=complexity;
if (N>10)
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<<params->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;i<N;i++)
{
ot2[i]=tmp+2*i*nsf;
nt2[i]=tmp+(2*i+1)*nsf;
}
ot=ot2;
nt=nt2;
ALLOC(best_index, N, int);
ALLOC(best_dist, N, spx_word32_t);
ALLOC(best_nind, N, int);
ALLOC(best_ntarget, N, int);
ALLOC(ndist, N, spx_word32_t);
ALLOC(odist, N, spx_word32_t);
ALLOC(itmp, 2*N*nb_subvect, int);
for (i=0;i<N;i++)
{
nind[i]=itmp+2*i*nb_subvect;
oind[i]=itmp+(2*i+1)*nb_subvect;
}
SPEEX_COPY(t, target, nsf);
for (j=0;j<N;j++)
SPEEX_COPY(&ot[j][0], t, nsf);
/* Pre-compute codewords response and energy */
compute_weighted_codebook(shape_cb, r, resp, resp2, E, shape_cb_size, subvect_size, stack);
for (j=0;j<N;j++)
odist[j]=0;
/*For all subvectors*/
for (i=0;i<nb_subvect;i++)
{
/*"erase" nbest list*/
for (j=0;j<N;j++)
ndist[j]=VERY_LARGE32;
/* This is not strictly necessary, but it provides an additonal safety
to prevent crashes in case something goes wrong in the previous
steps (e.g. NaNs) */
for (j=0;j<N;j++)
best_nind[j] = best_ntarget[j] = 0;
/*For all n-bests of previous subvector*/
for (j=0;j<N;j++)
{
spx_word16_t *x=ot[j]+subvect_size*i;
spx_word32_t tener = 0;
for (m=0;m<subvect_size;m++)
tener = MAC16_16(tener, x[m],x[m]);
#ifdef FIXED_POINT
tener = SHR32(tener,1);
#else
tener *= .5;
#endif
/*Find new n-best based on previous n-best j*/
#ifndef DISABLE_WIDEBAND
if (have_sign)
vq_nbest_sign(x, resp2, subvect_size, shape_cb_size, E, N, best_index, best_dist, stack);
else
#endif /* DISABLE_WIDEBAND */
vq_nbest(x, resp2, subvect_size, shape_cb_size, E, N, best_index, best_dist, stack);
/*For all new n-bests*/
for (k=0;k<N;k++)
{
/* Compute total distance (including previous sub-vectors */
spx_word32_t err = ADD32(ADD32(odist[j],best_dist[k]),tener);
/*update n-best list*/
if (err<ndist[N-1])
{
for (m=0;m<N;m++)
{
if (err < ndist[m])
{
for (n=N-1;n>m;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<N;j++)
{
/*previous target (we don't care what happened before*/
for (m=(i+1)*subvect_size;m<nsf;m++)
nt[j][m]=ot[best_ntarget[j]][m];
/* New code: update the rest of the target only if it's worth it */
for (m=0;m<subvect_size;m++)
{
spx_word16_t g;
int rind;
spx_word16_t sign=1;
rind = best_nind[j];
if (rind>=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;q<nb_subvect;q++)
nind[j][q]=oind[best_ntarget[j]][q];
nind[j][i]=best_nind[j];
}
/*update old-new data*/
/* just swap pointers instead of a long copy */
{
spx_word16_t **tmp2;
tmp2=ot;
ot=nt;
nt=tmp2;
}
for (j=0;j<N;j++)
for (m=0;m<nb_subvect;m++)
oind[j][m]=nind[j][m];
for (j=0;j<N;j++)
odist[j]=ndist[j];
}
/*save indices*/
for (i=0;i<nb_subvect;i++)
{
ind[i]=nind[0][i];
speex_bits_pack(bits,ind[i],params->shape_bits+have_sign);
}
/* Put everything back together */
for (i=0;i<nb_subvect;i++)
{
int rind;
spx_word16_t sign=1;
rind = ind[i];
if (rind>=shape_cb_size)
{
sign=-1;
rind-=shape_cb_size;
}
#ifdef FIXED_POINT
if (sign==1)
{
for (j=0;j<subvect_size;j++)
e[subvect_size*i+j]=SHL32(EXTEND32(shape_cb[rind*subvect_size+j]),SIG_SHIFT-5);
} else {
for (j=0;j<subvect_size;j++)
e[subvect_size*i+j]=NEG32(SHL32(EXTEND32(shape_cb[rind*subvect_size+j]),SIG_SHIFT-5));
}
#else
for (j=0;j<subvect_size;j++)
e[subvect_size*i+j]=sign*0.03125*shape_cb[rind*subvect_size+j];
#endif
}
/* Update excitation */
for (j=0;j<nsf;j++)
exc[j]=ADD32(exc[j],e[j]);
/* Update target: only update target if necessary */
if (update_target)
{
VARDECL(spx_word16_t *r2);
ALLOC(r2, nsf, spx_word16_t);
for (j=0;j<nsf;j++)
r2[j] = EXTRACT16(PSHR32(e[j] ,6));
syn_percep_zero16(r2, ak, awk1, awk2, r2, nsf,p, stack);
for (j=0;j<nsf;j++)
target[j]=SUB16(target[j],PSHR16(r2[j],2));
}
}
#endif /* DISABLE_ENCODER */
#ifndef DISABLE_DECODER
void split_cb_shape_sign_unquant(
spx_sig_t *exc,
const void *par, /* non-overlapping codebook */
int nsf, /* number of samples in subframe */
SpeexBits *bits,
char *stack,
spx_int32_t *seed
)
{
int i,j;
VARDECL(int *ind);
VARDECL(int *signs);
const signed char *shape_cb;
int subvect_size, nb_subvect;
const split_cb_params *params;
int have_sign;
params = (const split_cb_params *) par;
subvect_size = params->subvect_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;i<nb_subvect;i++)
{
if (have_sign)
signs[i] = speex_bits_unpack_unsigned(bits, 1);
else
signs[i] = 0;
ind[i] = speex_bits_unpack_unsigned(bits, params->shape_bits);
}
/* Compute decoded excitation */
for (i=0;i<nb_subvect;i++)
{
spx_word16_t s=1;
if (signs[i])
s=-1;
#ifdef FIXED_POINT
if (s==1)
{
for (j=0;j<subvect_size;j++)
exc[subvect_size*i+j]=SHL32(EXTEND32(shape_cb[ind[i]*subvect_size+j]),SIG_SHIFT-5);
} else {
for (j=0;j<subvect_size;j++)
exc[subvect_size*i+j]=NEG32(SHL32(EXTEND32(shape_cb[ind[i]*subvect_size+j]),SIG_SHIFT-5));
}
#else
for (j=0;j<subvect_size;j++)
exc[subvect_size*i+j]+=s*0.03125*shape_cb[ind[i]*subvect_size+j];
#endif
}
}
#endif /* DISABLE_DECODER */
#ifndef DISABLE_ENCODER
void noise_codebook_quant(
spx_word16_t target[], /* target vector */
spx_coef_t ak[], /* LPCs for this subframe */
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
const void *par, /* Codebook/search parameters*/
int p, /* number of LPC coeffs */
int nsf, /* number of samples in subframe */
spx_sig_t *exc,
spx_word16_t *r,
SpeexBits *bits,
char *stack,
int complexity,
int update_target
)
{
int i;
VARDECL(spx_word16_t *tmp);
ALLOC(tmp, nsf, spx_word16_t);
residue_percep_zero16(target, ak, awk1, awk2, tmp, nsf, p, stack);
for (i=0;i<nsf;i++)
exc[i]+=SHL32(EXTEND32(tmp[i]),8);
SPEEX_MEMSET(target, 0, nsf);
}
#endif /* DISABLE_ENCODER */
#ifndef DISABLE_DECODER
void noise_codebook_unquant(
spx_sig_t *exc,
const void *par, /* non-overlapping codebook */
int nsf, /* number of samples in subframe */
SpeexBits *bits,
char *stack,
spx_int32_t *seed
)
{
int i;
/* FIXME: This is bad, but I don't think the function ever gets called anyway */
for (i=0;i<nsf;i++)
exc[i]=SHL32(EXTEND32(speex_rand(1, seed)),SIG_SHIFT);
}
#endif /* DISABLE_DECODER */

View file

@ -1,103 +0,0 @@
/* Copyright (C) 2002 Jean-Marc Valin & David Rowe */
/**
@file cb_search.h
@brief Overlapped codebook search
*/
/*
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 CB_SEARCH_H
#define CB_SEARCH_H
#include "speex/speex_bits.h"
#include "arch.h"
/** Split codebook parameters. */
typedef struct split_cb_params {
int subvect_size;
int nb_subvect;
const signed char *shape_cb;
int shape_bits;
int have_sign;
} split_cb_params;
void split_cb_search_shape_sign(
spx_word16_t target[], /* target vector */
spx_coef_t ak[], /* LPCs for this subframe */
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
const void *par, /* Codebook/search parameters */
int p, /* number of LPC coeffs */
int nsf, /* number of samples in subframe */
spx_sig_t *exc,
spx_word16_t *r,
SpeexBits *bits,
char *stack,
int complexity,
int update_target
);
void split_cb_shape_sign_unquant(
spx_sig_t *exc,
const void *par, /* non-overlapping codebook */
int nsf, /* number of samples in subframe */
SpeexBits *bits,
char *stack,
spx_int32_t *seed
);
void noise_codebook_quant(
spx_word16_t target[], /* target vector */
spx_coef_t ak[], /* LPCs for this subframe */
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
const void *par, /* Codebook/search parameters */
int p, /* number of LPC coeffs */
int nsf, /* number of samples in subframe */
spx_sig_t *exc,
spx_word16_t *r,
SpeexBits *bits,
char *stack,
int complexity,
int update_target
);
void noise_codebook_unquant(
spx_sig_t *exc,
const void *par, /* non-overlapping codebook */
int nsf, /* number of samples in subframe */
SpeexBits *bits,
char *stack,
spx_int32_t *seed
);
#endif

View file

@ -1,137 +0,0 @@
/* Copyright (C) 2004 Jean-Marc Valin */
/**
@file cb_search_arm4.h
@brief Fixed codebook 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.
*/
/* This optimization is temporaly disabled until it is fixed to account for the fact
that "r" is now a 16-bit array */
#if 0
#define 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;
//const signed char *shape;
for (i=0;i<shape_cb_size;i+=4)
{
//shape = shape_cb;
E[0]=0;
E[1]=0;
E[2]=0;
E[3]=0;
/* Compute codeword response using convolution with impulse response */
for(j=0;j<subvect_size;j++)
{
#if 1
spx_word16_t *res;
res = resp+j;
spx_word32_t resj0,resj1,resj2,resj3;
spx_word32_t dead1, dead2, dead3, dead4, dead5, dead6, dead7, dead8;
__asm__ __volatile__ (
"mov %0, #0 \n\t"
"mov %1, #0 \n\t"
"mov %2, #0 \n\t"
"mov %3, #0 \n\t"
".weighted%=: \n\t"
"ldrsb %8, [%6] \n\t"
"ldr %10, [%5], #-4 \n\t"
"mov %9, %6 \n\t"
"ldrsb %11, [%9, %7]! \n\t"
"mla %0, %10, %8, %0 \n\t"
"ldrsb %8, [%9, %7]! \n\t"
"mla %1, %10, %11, %1 \n\t"
"ldrsb %11, [%9, %7]! \n\t"
"mla %2, %10, %8, %2 \n\t"
"subs %4, %4, #1 \n\t"
"mla %3, %10, %11, %3 \n\t"
"add %6, %6, #1 \n\t"
"bne .weighted%= \n\t"
: "=r" (resj0), "=r" (resj1), "=r" (resj2), "=r" (resj3),
"=r" (dead1), "=r" (dead2), "=r" (dead3), "=r" (dead4),
"=r" (dead5), "=r" (dead6), "=r" (dead7), "=r" (dead8)
: "4" (j+1), "5" (r+j), "6" (shape_cb), "7" (subvect_size)
: "cc", "memory");
#else
spx_word16_t *res;
res = resp+j;
spx_word32_t resj0=0;
spx_word32_t resj1=0;
spx_word32_t resj2=0;
spx_word32_t resj3=0;
for (k=0;k<=j;k++)
{
const signed char *shape=shape_cb+k;
resj0 = MAC16_16(resj0,*shape,r[j-k]);
shape += subvect_size;
resj1 = MAC16_16(resj1,*shape,r[j-k]);
shape += subvect_size;
resj2 = MAC16_16(resj2,*shape,r[j-k]);
shape += subvect_size;
resj3 = MAC16_16(resj3,*shape,r[j-k]);
shape += subvect_size;
}
#endif
#ifdef FIXED_POINT
resj0 = SHR(resj0, 11);
resj1 = SHR(resj1, 11);
resj2 = SHR(resj2, 11);
resj3 = SHR(resj3, 11);
#else
resj0 *= 0.03125;
resj1 *= 0.03125;
resj2 *= 0.03125;
resj3 *= 0.03125;
#endif
/* Compute codeword energy */
E[0]=ADD32(E[0],MULT16_16(resj0,resj0));
E[1]=ADD32(E[1],MULT16_16(resj1,resj1));
E[2]=ADD32(E[2],MULT16_16(resj2,resj2));
E[3]=ADD32(E[3],MULT16_16(resj3,resj3));
*res = resj0;
res += subvect_size;
*res = resj1;
res += subvect_size;
*res = resj2;
res += subvect_size;
*res = resj3;
res += subvect_size;
}
resp += subvect_size<<2;
shape_cb += subvect_size<<2;
E+=4;
}
}
#endif

View file

@ -1,111 +0,0 @@
/* Copyright (C) 2005 Analog Devices */
/**
@author Jean-Marc Valin
@file cb_search_bfin.h
@brief Fixed codebook functions (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_COMPUTE_WEIGHTED_CODEBOOK
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;
for (i=0;i<shape_cb_size;i++)
{
__asm__ __volatile__ (
"P0 = %0;\n\t"
"LC0 = P0;\n\t"
"P1 = %1;\n\t"
"P2 = %2;\n\t"
"P3 = %3;\n\t"
"P0 = 1;\n\t"
"L0 = 0;\n\t"
"L1 = 0;\n\t"
"R2 = 0;\n\t"
"A1 = 0;\n\t"
"LOOP outter%= LC0;\n\t"
"LOOP_BEGIN outter%=;\n\t"
"A0 = 0;\n\t"
"P4 = P1;\n\t"
"I1 = P2;\n\t"
"R0 = B[P4++] (X) || R1.L = W[I1--];\n\t"
"LOOP inner%= LC1 = P0;\n\t"
"LOOP_BEGIN inner%=;\n\t"
"A0 += R0.L*R1.L (IS) || R0 = B[P4++] (X) || R1.L = W[I1--];\n\t"
"LOOP_END inner%=;\n\t"
"R0 = A0;\n\t"
"R0 >>>= 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
);
}

View file

@ -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 <xmmintrin.h>
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<subvect_size;j++)
r[j] = _mm_load_ps1(_r+j);
for (i=0;i<shape_cb_size;i+=4)
{
float *_res = resp+i*subvect_size;
const signed char *_shape = shape_cb+i*subvect_size;
EE = _mm_setzero_ps();
for(j=0;j<subvect_size;j++)
{
shape[j] = _mm_setr_ps(0.03125*_shape[j], 0.03125*_shape[subvect_size+j], 0.03125*_shape[2*subvect_size+j], 0.03125*_shape[3*subvect_size+j]);
}
for(j=0;j<subvect_size;j++)
{
resj = _mm_setzero_ps();
for (k=0;k<=j;k++)
resj = _mm_add_ps(resj, _mm_mul_ps(shape[k],r[j-k]));
_spx_mm_getr_ps(resj, _res+j, _res+subvect_size+j, _res+2*subvect_size+j, _res+3*subvect_size+j);
*resp2++ = resj;
EE = _mm_add_ps(EE, _mm_mul_ps(resj, resj));
}
E[i>>2] = EE;
}
}

View file

@ -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};

View file

@ -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};

View file

@ -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};

View file

@ -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};

View file

@ -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};

View file

@ -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};

View file

@ -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;i<len;i++)
{
if (in[i]>max_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<len;i++)
{
out[i] = SHL16(in[i], shift);
}
return shift;
}
static void renorm_range(spx_word16_t *in, spx_word16_t *out, int shift, int len)
{
int i;
for (i=0;i<len;i++)
{
out[i] = PSHR16(in[i], shift);
}
}
#endif
#ifdef USE_SMALLFT
#include "smallft.h"
#include <math.h>
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 <mkl.h>
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 <ipps.h>
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 <fftw3.h>
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;i<N;++i)
iptr[i]=in[i] * m;
fftwf_execute(t->fft);
out[0] = optr[0];
for(i=1;i<N;++i)
out[i] = optr[i+1];
}
void spx_ifft(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;
iptr[0] = in[0];
iptr[1] = 0.0f;
for(i=1;i<N;++i)
iptr[i+1] = in[i];
iptr[N+1] = 0.0f;
fftwf_execute(t->ifft);
for(i=0;i<N;++i)
out[i] = optr[i];
}
#elif defined(USE_KISS_FFT)
#include "kiss_fftr.h"
#include "kiss_fft.h"
struct kiss_config {
kiss_fftr_cfg forward;
kiss_fftr_cfg backward;
int N;
};
void *spx_fft_init(int size)
{
struct kiss_config *table;
table = (struct kiss_config*)speex_alloc(sizeof(struct kiss_config));
table->forward = 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;i<t->N;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;i<N;i++)
_in[i] = (int)floor(.5+in[i]);
spx_fft(table, _in, _out);
for (i=0;i<N;i++)
out[i] = _out[i];
#if 0
if (!fixed_point)
{
float scale;
struct drft_lookup t;
spx_drft_init(&t, ((struct kiss_config *)table)->N);
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;i<N;i++)
_in[i] = (int)floor(.5+in[i]);
spx_ifft(table, _in, _out);
for (i=0;i<N;i++)
out[i] = _out[i];
#if 0
if (!fixed_point)
{
int i;
struct drft_lookup t;
spx_drft_init(&t, ((struct kiss_config *)table)->N);
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

View file

@ -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

View file

@ -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 <math.h>
#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<order;i++)
{
lpc_out[i] = MULT16_16_P15(tmp,lpc_in[i]);
tmp = MULT16_16_P15(tmp, gamma);
}
}
void sanitize_values32(spx_word32_t *vec, spx_word32_t min_val, spx_word32_t max_val, int len)
{
int i;
for (i=0;i<len;i++)
{
/* It's important we do the test that way so we can catch NaNs, which are neither greater nor smaller */
if (!(vec[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<len;i++)
{
spx_word16_t yi;
spx_word32_t vout = ADD32(MULT16_16(num[0], x[i]),mem[0]);
yi = EXTRACT16(SATURATE(PSHR32(vout,14),32767));
mem[0] = ADD32(MAC16_16(mem[1], num[1],x[i]), SHL32(MULT16_32_Q15(-den[1],vout),1));
mem[1] = ADD32(MULT16_16(num[2],x[i]), SHL32(MULT16_32_Q15(-den[2],vout),1));
y[i] = yi;
}
}
#ifdef FIXED_POINT
/* FIXME: These functions are ugly and probably introduce too much error */
void signal_mul(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len)
{
int i;
for (i=0;i<len;i++)
{
y[i] = SHL32(MULT16_32_Q14(EXTRACT16(SHR32(x[i],7)),scale),7);
}
}
#ifndef DISABLE_ENCODER
void signal_div(const spx_word16_t *x, spx_word16_t *y, spx_word32_t scale, int len)
{
int i;
if (scale > 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<len;i++)
{
y[i] = MULT16_16_P15(scale_1, x[i]);
}
} else if (scale > 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<len;i++)
{
y[i] = PSHR32(MULT16_16(scale_1, SHL16(x[i],2)),8);
}
} else {
spx_word16_t scale_1;
scale = PSHR32(scale, SIG_SHIFT-7);
if (scale < 5)
scale = 5;
scale_1 = DIV32_16(SHL32(EXTEND32(SIG_SCALING),3),scale);
for (i=0;i<len;i++)
{
y[i] = PSHR32(MULT16_16(scale_1, SHL16(x[i],2)),6);
}
}
}
#endif /* DISABLE_ENCODER */
#else /* FIXED_POINT */
void signal_mul(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len)
{
int i;
for (i=0;i<len;i++)
y[i] = scale*x[i];
}
#ifndef DISABLE_ENCODER
void signal_div(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len)
{
int i;
float scale_1 = 1/scale;
for (i=0;i<len;i++)
y[i] = scale_1*x[i];
}
#endif /* DISABLE_ENCODER */
#endif /* !FIXED_POINT */
#ifdef FIXED_POINT
#if !defined (DISABLE_WIDEBAND) && !defined (DISABLE_ENCODER)
spx_word16_t compute_rms(const spx_sig_t *x, int len)
{
int i;
spx_word32_t sum=0;
spx_sig_t max_val=1;
int sig_shift;
for (i=0;i<len;i++)
{
spx_sig_t tmp = x[i];
if (tmp<0)
tmp = -tmp;
if (tmp > max_val)
max_val = tmp;
}
sig_shift=0;
while (max_val>16383)
{
sig_shift++;
max_val >>= 1;
}
for (i=0;i<len;i+=4)
{
spx_word32_t sum2=0;
spx_word16_t tmp;
tmp = EXTRACT16(SHR32(x[i],sig_shift));
sum2 = MAC16_16(sum2,tmp,tmp);
tmp = EXTRACT16(SHR32(x[i+1],sig_shift));
sum2 = MAC16_16(sum2,tmp,tmp);
tmp = EXTRACT16(SHR32(x[i+2],sig_shift));
sum2 = MAC16_16(sum2,tmp,tmp);
tmp = EXTRACT16(SHR32(x[i+3],sig_shift));
sum2 = MAC16_16(sum2,tmp,tmp);
sum = ADD32(sum,SHR32(sum2,6));
}
return EXTRACT16(PSHR32(SHL32(EXTEND32(spx_sqrt(DIV32(sum,len))),(sig_shift+3)),SIG_SHIFT));
}
#endif /* !defined (DISABLE_WIDEBAND) && !defined (DISABLE_ENCODER) */
spx_word16_t compute_rms16(const spx_word16_t *x, int len)
{
int i;
spx_word16_t max_val=10;
for (i=0;i<len;i++)
{
spx_sig_t tmp = x[i];
if (tmp<0)
tmp = -tmp;
if (tmp > max_val)
max_val = tmp;
}
if (max_val>16383)
{
spx_word32_t sum=0;
for (i=0;i<len;i+=4)
{
spx_word32_t sum2=0;
sum2 = MAC16_16(sum2,SHR16(x[i],1),SHR16(x[i],1));
sum2 = MAC16_16(sum2,SHR16(x[i+1],1),SHR16(x[i+1],1));
sum2 = MAC16_16(sum2,SHR16(x[i+2],1),SHR16(x[i+2],1));
sum2 = MAC16_16(sum2,SHR16(x[i+3],1),SHR16(x[i+3],1));
sum = ADD32(sum,SHR32(sum2,6));
}
return SHL16(spx_sqrt(DIV32(sum,len)),4);
} else {
spx_word32_t sum=0;
int sig_shift=0;
if (max_val < 8192)
sig_shift=1;
if (max_val < 4096)
sig_shift=2;
if (max_val < 2048)
sig_shift=3;
for (i=0;i<len;i+=4)
{
spx_word32_t sum2=0;
sum2 = MAC16_16(sum2,SHL16(x[i],sig_shift),SHL16(x[i],sig_shift));
sum2 = MAC16_16(sum2,SHL16(x[i+1],sig_shift),SHL16(x[i+1],sig_shift));
sum2 = MAC16_16(sum2,SHL16(x[i+2],sig_shift),SHL16(x[i+2],sig_shift));
sum2 = MAC16_16(sum2,SHL16(x[i+3],sig_shift),SHL16(x[i+3],sig_shift));
sum = ADD32(sum,SHR32(sum2,6));
}
return SHL16(spx_sqrt(DIV32(sum,len)),3-sig_shift);
}
}
#ifndef OVERRIDE_NORMALIZE16
int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int len)
{
int i;
spx_sig_t max_val=1;
int sig_shift;
for (i=0;i<len;i++)
{
spx_sig_t tmp = x[i];
if (tmp<0)
tmp = NEG32(tmp);
if (tmp >= max_val)
max_val = tmp;
}
sig_shift=0;
while (max_val>max_scale)
{
sig_shift++;
max_val >>= 1;
}
for (i=0;i<len;i++)
y[i] = EXTRACT16(SHR32(x[i], sig_shift));
return sig_shift;
}
#endif
#else
spx_word16_t compute_rms(const spx_sig_t *x, int len)
{
int i;
float sum=0;
for (i=0;i<len;i++)
{
sum += x[i]*x[i];
}
return sqrt(.1+sum/len);
}
spx_word16_t compute_rms16(const spx_word16_t *x, int len)
{
return compute_rms(x, len);
}
#endif
#ifdef MERGE_FILTERS
const spx_word16_t zeros[10] = {0,0,0,0,0,0,0,0,0,0};
#endif /* MERGE_FILTERS */
#if !defined(OVERRIDE_FILTER_MEM16) && !defined(DISABLE_ENCODER)
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)
{
int i,j;
spx_word16_t xi,yi,nyi;
for (i=0;i<N;i++)
{
xi= x[i];
yi = EXTRACT16(SATURATE(ADD32(EXTEND32(x[i]),PSHR32(mem[0],LPC_SHIFT)),32767));
nyi = NEG16(yi);
for (j=0;j<ord-1;j++)
{
mem[j] = MAC16_16(MAC16_16(mem[j+1], num[j],xi), den[j],nyi);
}
mem[ord-1] = ADD32(MULT16_16(num[ord-1],xi), MULT16_16(den[ord-1],nyi));
y[i] = yi;
}
}
#endif /* !defined(OVERRIDE_FILTER_MEM16) && !defined(DISABLE_ENCODER) */
#ifndef OVERRIDE_IIR_MEM16
void iir_mem16(const spx_word16_t *x, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack)
{
int i,j;
spx_word16_t yi,nyi;
for (i=0;i<N;i++)
{
yi = EXTRACT16(SATURATE(ADD32(EXTEND32(x[i]),PSHR32(mem[0],LPC_SHIFT)),32767));
nyi = NEG16(yi);
for (j=0;j<ord-1;j++)
{
mem[j] = MAC16_16(mem[j+1],den[j],nyi);
}
mem[ord-1] = MULT16_16(den[ord-1],nyi);
y[i] = yi;
}
}
#endif
#if !defined(OVERRIDE_FIR_MEM16) && !defined(DISABLE_ENCODER)
void fir_mem16(const spx_word16_t *x, const spx_coef_t *num, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack)
{
int i,j;
spx_word16_t xi,yi;
for (i=0;i<N;i++)
{
xi=x[i];
yi = EXTRACT16(SATURATE(ADD32(EXTEND32(x[i]),PSHR32(mem[0],LPC_SHIFT)),32767));
for (j=0;j<ord-1;j++)
{
mem[j] = MAC16_16(mem[j+1], num[j],xi);
}
mem[ord-1] = MULT16_16(num[ord-1],xi);
y[i] = yi;
}
}
#endif /* !defined(OVERRIDE_FIR_MEM16) && !defined(DISABLE_ENCODER) */
#ifndef DISABLE_ENCODER
void syn_percep_zero16(const spx_word16_t *xx, 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;
VARDECL(spx_mem_t *mem);
ALLOC(mem, ord, spx_mem_t);
for (i=0;i<ord;i++)
mem[i]=0;
iir_mem16(xx, ak, y, N, ord, mem, stack);
for (i=0;i<ord;i++)
mem[i]=0;
filter_mem16(y, awk1, awk2, y, N, ord, mem, stack);
}
void residue_percep_zero16(const spx_word16_t *xx, 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;
VARDECL(spx_mem_t *mem);
ALLOC(mem, ord, spx_mem_t);
for (i=0;i<ord;i++)
mem[i]=0;
filter_mem16(xx, ak, awk1, y, N, ord, mem, stack);
for (i=0;i<ord;i++)
mem[i]=0;
fir_mem16(y, awk2, y, N, ord, mem, stack);
}
#endif /* DISABLE_ENCODER */
#if !defined(OVERRIDE_COMPUTE_IMPULSE_RESPONSE) && !defined(DISABLE_ENCODER)
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;
spx_word16_t y1, ny1i, ny2i;
VARDECL(spx_mem_t *mem1);
VARDECL(spx_mem_t *mem2);
ALLOC(mem1, ord, spx_mem_t);
ALLOC(mem2, ord, spx_mem_t);
y[0] = LPC_SCALING;
for (i=0;i<ord;i++)
y[i+1] = awk1[i];
i++;
for (;i<N;i++)
y[i] = VERY_SMALL;
for (i=0;i<ord;i++)
mem1[i] = mem2[i] = 0;
for (i=0;i<N;i++)
{
y1 = ADD16(y[i], EXTRACT16(PSHR32(mem1[0],LPC_SHIFT)));
ny1i = NEG16(y1);
y[i] = PSHR32(ADD32(SHL32(EXTEND32(y1),LPC_SHIFT+1),mem2[0]),LPC_SHIFT);
ny2i = NEG16(y[i]);
for (j=0;j<ord-1;j++)
{
mem1[j] = MAC16_16(mem1[j+1], awk2[j],ny1i);
mem2[j] = MAC16_16(mem2[j+1], ak[j],ny2i);
}
mem1[ord-1] = MULT16_16(awk2[ord-1],ny1i);
mem2[ord-1] = MULT16_16(ak[ord-1],ny2i);
}
}
#endif /* !defined(OVERRIDE_COMPUTE_IMPULSE_RESPONSE) && !defined(DISABLE_ENCODER) */
#ifndef DISABLE_WIDEBAND
/* Decomposes a signal into low-band and high-band using a QMF */
void qmf_decomp(const spx_word16_t *xx, const spx_word16_t *aa, spx_word16_t *y1, spx_word16_t *y2, int N, int M, spx_word16_t *mem, char *stack)
{
int i,j,k,M2;
VARDECL(spx_word16_t *a);
VARDECL(spx_word16_t *x);
spx_word16_t *x2;
ALLOC(a, M, spx_word16_t);
ALLOC(x, N+M-1, spx_word16_t);
x2=x+M-1;
M2=M>>1;
for (i=0;i<M;i++)
a[M-i-1]= aa[i];
for (i=0;i<M-1;i++)
x[i]=mem[M-i-2];
for (i=0;i<N;i++)
x[i+M-1]=SHR16(xx[i],1);
for (i=0;i<M-1;i++)
mem[i]=SHR16(xx[N-i-1],1);
for (i=0,k=0;i<N;i+=2,k++)
{
spx_word32_t y1k=0, y2k=0;
for (j=0;j<M2;j++)
{
y1k=ADD32(y1k,MULT16_16(a[j],ADD16(x[i+j],x2[i-j])));
y2k=SUB32(y2k,MULT16_16(a[j],SUB16(x[i+j],x2[i-j])));
j++;
y1k=ADD32(y1k,MULT16_16(a[j],ADD16(x[i+j],x2[i-j])));
y2k=ADD32(y2k,MULT16_16(a[j],SUB16(x[i+j],x2[i-j])));
}
y1[k] = EXTRACT16(SATURATE(PSHR32(y1k,15),32767));
y2[k] = EXTRACT16(SATURATE(PSHR32(y2k,15),32767));
}
}
/* Re-synthesised a signal from the QMF low-band and high-band signals */
void qmf_synth(const spx_word16_t *x1, const spx_word16_t *x2, const spx_word16_t *a, spx_word16_t *y, int N, int M, spx_word16_t *mem1, spx_word16_t *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 */
{
int i, j;
int M2, N2;
VARDECL(spx_word16_t *xx1);
VARDECL(spx_word16_t *xx2);
M2 = M>>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<i2;k++)
tmp += MULT16_32_Q15(shift_filt[i][k],corr[0][j+k-3]);
corr[i+1][j] = tmp;
}
}
maxi=maxj=0;
maxcorr = corr[0][0];
for (i=0;i<4;i++)
{
for (j=0;j<7;j++)
{
if (corr[i][j] > maxcorr)
{
maxcorr = corr[i][j];
maxi=i;
maxj=j;
}
}
}
for (i=0;i<len;i++)
{
spx_word32_t tmp = 0;
if (maxi>0)
{
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;i<nsf;i++)
{
if (ABS16(exc[i])>16383)
{
scaledown = 1;
break;
}
}
if (scaledown)
{
for (i=0;i<nsf;i++)
exc[i] = SHR16(exc[i],1);
for (i=0;i<2*nsf;i++)
iexc[i] = SHR16(iexc[i],1);
}
#endif
/*interp_pitch(exc, iexc+2*nsf, 2*corr_pitch, 80);*/
/*printf ("%d %d %f\n", pitch, corr_pitch, max_corr*ener_1);*/
iexc0_mag = spx_sqrt(1000+inner_prod(iexc,iexc,nsf));
iexc1_mag = spx_sqrt(1000+inner_prod(iexc+nsf,iexc+nsf,nsf));
exc_mag = spx_sqrt(1+inner_prod(exc,exc,nsf));
corr0 = inner_prod(iexc,exc,nsf);
if (corr0<0)
corr0=0;
corr1 = inner_prod(iexc+nsf,exc,nsf);
if (corr1<0)
corr1=0;
#ifdef FIXED_POINT
/* Doesn't cost much to limit the ratio and it makes the rest easier */
if (SHL32(EXTEND32(iexc0_mag),6) < EXTEND32(exc_mag))
iexc0_mag = ADD16(1,PSHR16(exc_mag,6));
if (SHL32(EXTEND32(iexc1_mag),6) < EXTEND32(exc_mag))
iexc1_mag = ADD16(1,PSHR16(exc_mag,6));
#endif
if (corr0 > 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 (g1<c1)
g1 = c1;
if (g2<c1)
g2 = c1;
g1 = (spx_word16_t)PDIV32_16(SHL32(EXTEND32(c1),14),(spx_word16_t)g1);
g2 = (spx_word16_t)PDIV32_16(SHL32(EXTEND32(c1),14),(spx_word16_t)g2);
if (corr_pitch>max_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<nsf;i++)
new_exc[i] = ADD16(exc[i], EXTRACT16(PSHR32(ADD32(MULT16_16(gain0,iexc[i]), MULT16_16(gain1,iexc[i+nsf])),8)));
/* FIXME: compute_rms16 is currently not quite accurate enough (but close) */
new_ener = compute_rms16(new_exc, nsf);
old_ener = compute_rms16(exc, nsf);
if (old_ener < 1)
old_ener = 1;
if (new_ener < 1)
new_ener = 1;
if (old_ener > new_ener)
old_ener = new_ener;
ngain = PDIV32_16(SHL32(EXTEND32(old_ener),14),new_ener);
for (i=0;i<nsf;i++)
new_exc[i] = MULT16_16_Q14(ngain, new_exc[i]);
#ifdef FIXED_POINT
if (scaledown)
{
for (i=0;i<nsf;i++)
exc[i] = SHL16(exc[i],1);
for (i=0;i<nsf;i++)
new_exc[i] = SHL16(SATURATE16(new_exc[i],16383),1);
}
#endif
}
#endif /* DISABLE_DECODER */

View file

@ -1,105 +0,0 @@
/* Copyright (C) 2002 Jean-Marc Valin */
/**
@file filters.h
@brief 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.
*/
#ifndef FILTERS_H
#define FILTERS_H
#include "arch.h"
spx_word16_t compute_rms(const spx_sig_t *x, int len);
spx_word16_t compute_rms16(const spx_word16_t *x, int len);
void signal_mul(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len);
void signal_div(const spx_word16_t *x, spx_word16_t *y, spx_word32_t scale, int len);
#ifdef FIXED_POINT
int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int len);
#endif
#define HIGHPASS_NARROWBAND 0
#define HIGHPASS_WIDEBAND 2
#define HIGHPASS_INPUT 0
#define HIGHPASS_OUTPUT 1
#define HIGHPASS_IRS 4
void highpass(const spx_word16_t *x, spx_word16_t *y, int len, int filtID, spx_mem_t *mem);
void qmf_decomp(const spx_word16_t *xx, const spx_word16_t *aa, spx_word16_t *, spx_word16_t *y2, int N, int M, spx_word16_t *mem, char *stack);
void qmf_synth(const spx_word16_t *x1, const spx_word16_t *x2, const spx_word16_t *a, spx_word16_t *y, int N, int M, spx_word16_t *mem1, spx_word16_t *mem2, char *stack);
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);
#ifdef MERGE_FILTERS
#define OVERRIDE_IIR_MEM16
#define OVERRIDE_FIR_MEM16
extern const spx_word16_t zeros[];
#define iir_mem16(x, den, y, N, ord, mem, stack) filter_mem16(x, zeros, den, y, N, ord, mem, stack)
#define fir_mem16(x, num, y, N, ord, mem, stack) filter_mem16(x, num, zeros, y, N, ord, mem, stack)
#else /* MERGE_FILTERS */
void iir_mem16(const spx_word16_t *x, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack);
void fir_mem16(const spx_word16_t *x, const spx_coef_t *num, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack);
#endif /* MERGE_FILTERS */
/* Apply bandwidth expansion on LPC coef */
void bw_lpc(spx_word16_t , const spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order);
void sanitize_values32(spx_word32_t *vec, spx_word32_t min_val, spx_word32_t max_val, int len);
void syn_percep_zero16(const spx_word16_t *xx, 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);
void residue_percep_zero16(const spx_word16_t *xx, 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);
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);
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, /*pitch gain (3-tap)*/
spx_word16_t comb_gain, /*gain of comb filter*/
char *stack
);
#define filter10(x, num, den, y, N, mem, stack) filter_mem16(x, num, den, y, N, 10, mem, stack)
#endif

View file

@ -1,96 +0,0 @@
/* Copyright (C) 2004 Jean-Marc Valin */
/**
@file filters_arm4.h
@brief Various analysis/synthesis filters (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_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;
int dead1, dead2, dead3, dead4, dead5, dead6;
__asm__ __volatile__ (
"\tmov %1, #1 \n"
"\tmov %3, #0 \n"
".normalize16loop1%=: \n"
"\tldr %4, [%0], #4 \n"
"\tcmp %4, %1 \n"
"\tmovgt %1, %4 \n"
"\tcmp %4, %3 \n"
"\tmovlt %3, %4 \n"
"\tsubs %2, %2, #1 \n"
"\tbne .normalize16loop1%=\n"
"\trsb %3, %3, #0 \n"
"\tcmp %1, %3 \n"
"\tmovlt %1, %3 \n"
: "=r" (dead1), "=r" (max_val), "=r" (dead3), "=r" (dead4),
"=r" (dead5), "=r" (dead6)
: "0" (x), "2" (len)
: "cc");
sig_shift=0;
while (max_val>max_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;
}

View file

@ -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<ord;i++)
{
numden[2*i] = num[i];
numden[2*i+1] = den[i];
}
__asm__ __volatile__
(
/* Register setup */
"R0 = %5;\n\t" /*ord */
"P0 = %3;\n\t"
"I0 = P0;\n\t"
"B0 = P0;\n\t" /* numden */
"L0 = 0;\n\t"
"P2 = %0;\n\t" /* Fused xy */
"I2 = P2;\n\t"
"L2 = 0;\n\t"
"P4 = %6;\n\t" /* mem */
"P0 = %1;\n\t" /* _x */
"P1 = %2;\n\t" /* _y */
/* First sample */
"R1 = [P4++];\n\t"
"R1 <<= 3;\n\t" /* shift mem */
"R1.L = R1 (RND);\n\t"
"R2 = W[P0++];\n\t" /* load x[0] */
"R1.L = R1.L + R2.L;\n\t"
"W[P1++] = R1;\n\t" /* store y[0] */
"R2 = PACK(R1.L, R2.L);\n\t" /* pack x16 and y16 */
"[P2] = R2;\n\t"
/* Samples 1 to ord-1 (using memory) */
"R0 += -1;\n\t"
"R3 = 0;\n\t"
"LC0 = R0;\n\t"
"LOOP filter_start%= LC0;\n\t"
"LOOP_BEGIN filter_start%=;\n\t"
"R3 += 1;\n\t"
"LC1 = R3;\n\t"
"R1 = [P4++];\n\t"
"A1 = R1;\n\t"
"A0 = 0;\n\t"
"I0 = B0;\n\t"
"I2 = P2;\n\t"
"P2 += 4;\n\t"
"R4 = [I0++] || R5 = [I2--];\n\t"
"LOOP filter_start_inner%= LC1;\n\t"
"LOOP_BEGIN filter_start_inner%=;\n\t"
"A1 -= R4.H*R5.H, A0 += R4.L*R5.L (IS) || R4 = [I0++] || R5 = [I2--];\n\t"
"LOOP_END filter_start_inner%=;\n\t"
"A0 += A1;\n\t"
"R4 = A0;\n\t"
"R4 <<= 3;\n\t" /* shift mem */
"R4.L = R4 (RND);\n\t"
"R2 = W[P0++];\n\t" /* load x */
"R4.L = R4.L + R2.L;\n\t"
"W[P1++] = R4;\n\t" /* store y */
//"R4 <<= 2;\n\t"
//"R2 <<= 2;\n\t"
"R2 = PACK(R4.L, R2.L);\n\t" /* pack x16 and y16 */
"[P2] = R2;\n\t"
"LOOP_END filter_start%=;\n\t"
/* Samples ord to N*/
"R0 = %5;\n\t"
"R0 <<= 1;\n\t"
"I0 = B0;\n\t" /* numden */
"R0 <<= 1;\n\t"
"L0 = R0;\n\t"
"R0 = %5;\n\t" /* org */
"R2 = %4;\n\t" /* N */
"R2 = R2 - R0;\n\t"
"R4 = [I0++];\n\t" /* numden */
"LC0 = R2;\n\t"
"P3 = R0;\n\t"
"R0 <<= 2;\n\t"
"R0 += 8;\n\t"
"I2 = P2;\n\t"
"M0 = R0;\n\t"
"A1 = A0 = 0;\n\t"
"R5 = [I2--];\n\t" /* load xy */
"LOOP filter_mid%= LC0;\n\t"
"LOOP_BEGIN filter_mid%=;\n\t"
"LOOP filter_mid_inner%= LC1=P3;\n\t"
"LOOP_BEGIN filter_mid_inner%=;\n\t"
"A1 -= R4.H*R5.H, A0 += R4.L*R5.L (IS) || R4 = [I0++] || R5 = [I2--];\n\t"
"LOOP_END filter_mid_inner%=;\n\t"
"R0 = (A0 += A1) || I2 += M0;\n\t"
"R0 = R0 << 3 || R5 = W[P0++];\n\t" /* load x */
"R0.L = R0 (RND);\n\t"
"R0.L = R0.L + R5.L;\n\t"
"R5 = PACK(R0.L, R5.L) || W[P1++] = R0;\n\t" /* shift y | store y */
"A1 = A0 = 0 || [I2--] = R5\n\t"
"LOOP_END filter_mid%=;\n\t"
"I2 += 4;\n\t"
"P2 = I2;\n\t"
/* Update memory */
"P4 = %6;\n\t"
"R0 = %5;\n\t"
"LC0 = R0;\n\t"
"P0 = B0;\n\t"
"A1 = A0 = 0;\n\t"
"LOOP mem_update%= LC0;\n\t"
"LOOP_BEGIN mem_update%=;\n\t"
"I2 = P2;\n\t"
"I0 = P0;\n\t"
"P0 += 4;\n\t"
"R0 = LC0;\n\t"
"LC1 = R0;\n\t"
"R5 = [I2--] || R4 = [I0++];\n\t"
"LOOP mem_accum%= LC1;\n\t"
"LOOP_BEGIN mem_accum%=;\n\t"
"A1 -= R4.H*R5.H, A0 += R4.L*R5.L (IS) || R4 = [I0++] || R5 = [I2--];\n\t"
"LOOP_END mem_accum%=;\n\t"
"R0 = (A0 += A1);\n\t"
"A1 = A0 = 0 || [P4++] = R0;\n\t"
"LOOP_END mem_update%=;\n\t"
"L0 = 0;\n\t"
: : "m" (xy), "m" (_x), "m" (_y), "m" (numden), "m" (N), "m" (ord), "m" (mem)
: "A0", "A1", "R0", "R1", "R2", "R3", "R4", "R5", "P0", "P1", "P2", "P3", "P4", "B0", "I0", "I2", "L0", "L2", "M0", "memory",
"ASTAT" BFIN_HWLOOP0_REGS BFIN_HWLOOP1_REGS
);
}
#define OVERRIDE_IIR_MEM16
void iir_mem16(const spx_word16_t *_x, const spx_coef_t *den, spx_word16_t *_y, int N, int ord, spx_mem_t *mem, char *stack)
{
VARDECL(spx_word16_t *y);
spx_word16_t *yy;
ALLOC(y, (N+2), spx_word16_t);
yy = y+2;
__asm__ __volatile__
(
/* Register setup */
"R0 = %5;\n\t" /*ord */
"P1 = %3;\n\t"
"I1 = P1;\n\t"
"B1 = P1;\n\t"
"L1 = 0;\n\t"
"P3 = %0;\n\t"
"I3 = P3;\n\t"
"L3 = 0;\n\t"
"P4 = %6;\n\t"
"P0 = %1;\n\t"
"P1 = %2;\n\t"
/* First sample */
"R1 = [P4++];\n\t"
"R1 = R1 << 3 (S);\n\t"
"R1.L = R1 (RND);\n\t"
"R2 = W[P0++];\n\t"
"R1 = R1 + R2;\n\t"
"W[P1++] = R1;\n\t"
"W[P3] = R1;\n\t"
/* Samples 1 to ord-1 (using memory) */
"R0 += -1;\n\t"
"R3 = 0;\n\t"
"LC0 = R0;\n\t"
"LOOP filter_start%= LC0;\n\t"
"LOOP_BEGIN filter_start%=;\n\t"
"R3 += 1;\n\t"
"LC1 = R3;\n\t"
"R1 = [P4++];\n\t"
"A1 = R1;\n\t"
"I1 = B1;\n\t"
"I3 = P3;\n\t"
"P3 += 2;\n\t"
"LOOP filter_start_inner%= LC1;\n\t"
"LOOP_BEGIN filter_start_inner%=;\n\t"
"R4.L = W[I1++];\n\t"
"R5.L = W[I3--];\n\t"
"A1 -= R4.L*R5.L (IS);\n\t"
"LOOP_END filter_start_inner%=;\n\t"
"R1 = A1;\n\t"
"R1 <<= 3;\n\t"
"R1.L = R1 (RND);\n\t"
"R2 = W[P0++];\n\t"
"R1 = R1 + R2;\n\t"
"W[P1++] = R1;\n\t"
"W[P3] = R1;\n\t"
"LOOP_END filter_start%=;\n\t"
/* Samples ord to N*/
"R0 = %5;\n\t"
"R0 <<= 1;\n\t"
"I1 = B1;\n\t"
"L1 = R0;\n\t"
"R0 = %5;\n\t"
"R2 = %4;\n\t"
"R2 = R2 - R0;\n\t"
"R4.L = W[I1++];\n\t"
"LC0 = R2;\n\t"
"LOOP filter_mid%= LC0;\n\t"
"LOOP_BEGIN filter_mid%=;\n\t"
"LC1 = R0;\n\t"
"A1 = 0;\n\t"
"I3 = P3;\n\t"
"P3 += 2;\n\t"
"R5.L = W[I3--];\n\t"
"LOOP filter_mid_inner%= LC1;\n\t"
"LOOP_BEGIN filter_mid_inner%=;\n\t"
"A1 -= R4.L*R5.L (IS) || R4.L = W[I1++] || R5.L = W[I3--];\n\t"
"LOOP_END filter_mid_inner%=;\n\t"
"R1 = A1;\n\t"
"R1 = R1 << 3 || R2 = W[P0++];\n\t"
"R1.L = R1 (RND);\n\t"
"R1 = R1 + R2;\n\t"
"W[P1++] = R1;\n\t"
"W[P3] = R1;\n\t"
"LOOP_END filter_mid%=;\n\t"
/* Update memory */
"P4 = %6;\n\t"
"R0 = %5;\n\t"
"LC0 = R0;\n\t"
"P1 = B1;\n\t"
"LOOP mem_update%= LC0;\n\t"
"LOOP_BEGIN mem_update%=;\n\t"
"A0 = 0;\n\t"
"I3 = P3;\n\t"
"I1 = P1;\n\t"
"P1 += 2;\n\t"
"R0 = LC0;\n\t"
"LC1=R0;\n\t"
"R5.L = W[I3--] || R4.L = W[I1++];\n\t"
"LOOP mem_accum%= LC1;\n\t"
"LOOP_BEGIN mem_accum%=;\n\t"
"A0 -= R4.L*R5.L (IS) || R4.L = W[I1++] || R5.L = W[I3--];\n\t"
"LOOP_END mem_accum%=;\n\t"
"R0 = A0;\n\t"
"[P4++] = R0;\n\t"
"LOOP_END mem_update%=;\n\t"
"L1 = 0;\n\t"
: : "m" (yy), "m" (_x), "m" (_y), "m" (den), "m" (N), "m" (ord), "m" (mem)
: "A0", "A1", "R0", "R1", "R2", "R3", "R4", "R5", "P0", "P1", "P2", "P3", "P4", "B1", "I1", "I3", "L1", "L3", "memory",
"ASTAT" BFIN_HWLOOP0_REGS BFIN_HWLOOP1_REGS
);
}
#define OVERRIDE_FIR_MEM16
void fir_mem16(const spx_word16_t *x, const spx_coef_t *num, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack)
{
int i;
spx_coef_t den2[12];
spx_coef_t *den;
den = (spx_coef_t*)((((int)den2)+4)&0xfffffffc);
for (i=0;i<10;i++)
den[i] = 0;
filter_mem16(x, num, den, y, N, ord, mem, stack);
}
#define OVERRIDE_COMPUTE_IMPULSE_RESPONSE
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;
VARDECL(spx_word16_t *ytmp);
ALLOC(ytmp, N, spx_word16_t);
spx_word16_t *ytmp2 = ytmp;
y[0] = LPC_SCALING;
for (i=0;i<ord;i++)
y[i+1] = awk1[i];
i++;
for (;i<N;i++)
y[i] = 0;
N-=1;
__asm__ __volatile__
(
"I0 = %0;\n\t"
"I1 = %1;\n\t"
"L0 = 0;\n\t"
"L1 = 0;\n\t"
"L2 = 0;\n\t"
"L3 = 0;\n\t"
"R0 = 1;\n\t"
"R0 <<= 13;\n\t"
"W[I0] = R0.L;\n\t"
"R0 <<= 1;\n\t"
"W[I1] = R0.L;\n\t"
"R0 = %5;\n\t"
"LC0 = R0;\n\t"
"R2 = 0;\n\t"
"LOOP samples%= LC0;\n\t"
"LOOP_BEGIN samples%=;\n\t"
"R2 += 1;\n\t"
"R2 = MIN(R2, %4);\n\t"
"I0 = %0;\n\t"
"I1 = %1;\n\t"
"I2 = %2;\n\t"
"I3 = %3;\n\t"
"%0 += 2;\n\t"
"%1 += 2;\n\t"
"A1 = A0 = 0;\n\t"
"R0.L = W[I0--] || R1.L = W[I2++];\n\t"
"LC1 = R2;\n\t"
"LOOP filter%= LC1;\n\t"
"LOOP_BEGIN filter%=;\n\t"
"A0 -= R0.L*R1.L (IS) || R0.L = W[I1--] || R1.L = W[I3++];\n\t"
"A1 -= R0.L*R1.L (IS) || R0.L = W[I0--] || R1.L = W[I2++];\n\t"
"LOOP_END filter%=;\n\t"
"R0 = A0, R1 = A1;\n\t"
"R3 = W[%1] (X);\n\t"
"R3 <<= 13;\n\t"
"R0 = R0 + R3;\n\t"
"R3 = R0 >>> 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<ord;i++)
y[i+1] = awk1[i];
i++;
for (;i<N;i++)
y[i] = 0;
for (i=0;i<N;i++)
{
spx_word32_t yi = SHL32(EXTEND32(y[i]),LPC_SHIFT);
spx_word32_t yi2 = 0;
for (j=0;j<min(i,ord);j++)
{
yi = MAC16_16(yi, awk2[j], -ytmp[i-j-1]);
yi2 = MAC16_16(yi2, ak[j], -y[i-j-1]);
}
ytmp[i] = EXTRACT16(SHR32(yi,LPC_SHIFT));
yi2 = ADD32(yi2,SHL32(yi,1));
y[i] = EXTRACT16(SHR32(yi2,LPC_SHIFT));
}
}
void filter_mem2(const spx_sig_t *_x, const spx_coef_t *num, const spx_coef_t *den, spx_sig_t *_y, int N, int ord, spx_mem_t *mem)
{
int i,j;
spx_word16_t xi,yi,nyi;
spx_word16_t x[N],y[N];
spx_word16_t *xx, *yy;
xx = x;
yy = y;
for (i=0;i<N;i++)
{
x[i] = EXTRACT16(SHR32(_x[i],SIG_SHIFT));
}
for (i=0;i<ord;i++)
{
spx_word32_t yi = mem[i];
for (j=0;j<i;j++)
{
yi = MAC16_16(yi, num[j], x[i-j-1]);
yi = MAC16_16(yi, den[j], -y[i-j-1]);
}
_y[i] = ADD32(_x[i],SHL32(yi,1));
y[i] = EXTRACT16(SHR32(_y[i],SIG_SHIFT));
}
for (i=ord;i<N;i++)
{
spx_word32_t yi = 0;
for (j=0;j<ord;j++)
{
yi = MAC16_16(yi, num[j], x[i-j-1]);
yi = MAC16_16(yi, den[j], -y[i-j-1]);
}
_y[i] = ADD32(_x[i],SHL32(yi,1));
y[i] = EXTRACT16(SHR32(_y[i],SIG_SHIFT));
}
for (i=0;i<ord;i++)
{
spx_mem_t m = 0;
for (j=0;j<ord-i;j++)
{
m = MAC16_16(m, x[N-1-j], num[j+i]);
m = MAC16_16(m, -y[N-1-j], den[j+i]);
}
mem[i] = m;
}
}
#endif

View file

@ -1,336 +0,0 @@
/* Copyright (C) 2002 Jean-Marc Valin */
/**
@file filters_sse.h
@brief Various analysis/synthesis filters (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 <xmmintrin.h>
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<N;i++)
{
__m128 xx;
__m128 yy;
/* Compute next filter result */
xx = _mm_load_ps1(x+i);
yy = _mm_add_ss(xx, mem[0]);
_mm_store_ss(y+i, yy);
yy = _mm_shuffle_ps(yy, yy, 0);
/* Update memory */
mem[0] = _mm_move_ss(mem[0], mem[1]);
mem[0] = _mm_shuffle_ps(mem[0], mem[0], 0x39);
mem[0] = _mm_add_ps(mem[0], _mm_mul_ps(xx, num[0]));
mem[0] = _mm_sub_ps(mem[0], _mm_mul_ps(yy, den[0]));
mem[1] = _mm_move_ss(mem[1], mem[2]);
mem[1] = _mm_shuffle_ps(mem[1], mem[1], 0x39);
mem[1] = _mm_add_ps(mem[1], _mm_mul_ps(xx, num[1]));
mem[1] = _mm_sub_ps(mem[1], _mm_mul_ps(yy, den[1]));
mem[2] = _mm_shuffle_ps(mem[2], mem[2], 0xfd);
mem[2] = _mm_add_ps(mem[2], _mm_mul_ps(xx, num[2]));
mem[2] = _mm_sub_ps(mem[2], _mm_mul_ps(yy, den[2]));
}
/* Put memory back in its place */
_mm_storeu_ps(_mem, mem[0]);
_mm_storeu_ps(_mem+4, mem[1]);
_mm_store_ss(_mem+8, mem[2]);
mem[2] = _mm_shuffle_ps(mem[2], mem[2], 0x55);
_mm_store_ss(_mem+9, mem[2]);
}
void filter_mem16_8(const float *x, const float *_num, const float *_den, float *y, int N, int ord, float *_mem)
{
__m128 num[2], den[2], mem[2];
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);
}
for (i=0;i<N;i++)
{
__m128 xx;
__m128 yy;
/* Compute next filter result */
xx = _mm_load_ps1(x+i);
yy = _mm_add_ss(xx, mem[0]);
_mm_store_ss(y+i, yy);
yy = _mm_shuffle_ps(yy, yy, 0);
/* Update memory */
mem[0] = _mm_move_ss(mem[0], mem[1]);
mem[0] = _mm_shuffle_ps(mem[0], mem[0], 0x39);
mem[0] = _mm_add_ps(mem[0], _mm_mul_ps(xx, num[0]));
mem[0] = _mm_sub_ps(mem[0], _mm_mul_ps(yy, den[0]));
mem[1] = _mm_sub_ss(mem[1], mem[1]);
mem[1] = _mm_shuffle_ps(mem[1], mem[1], 0x39);
mem[1] = _mm_add_ps(mem[1], _mm_mul_ps(xx, num[1]));
mem[1] = _mm_sub_ps(mem[1], _mm_mul_ps(yy, den[1]));
}
/* Put memory back in its place */
_mm_storeu_ps(_mem, mem[0]);
_mm_storeu_ps(_mem+4, mem[1]);
}
#define OVERRIDE_FILTER_MEM16
void filter_mem16(const float *x, const float *_num, const float *_den, float *y, int N, int ord, float *_mem, char *stack)
{
if(ord==10)
filter_mem16_10(x, _num, _den, y, N, ord, _mem);
else if (ord==8)
filter_mem16_8(x, _num, _den, y, N, ord, _mem);
}
void iir_mem16_10(const float *x, const float *_den, float *y, int N, int ord, float *_mem)
{
__m128 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);
den[i] = _mm_loadu_ps(_den+4*i);
}
mem[2] = _mm_setr_ps(_mem[8], _mem[9], 0, 0);
den[2] = _mm_setr_ps(_den[8], _den[9], 0, 0);
for (i=0;i<N;i++)
{
__m128 xx;
__m128 yy;
/* Compute next filter result */
xx = _mm_load_ps1(x+i);
yy = _mm_add_ss(xx, mem[0]);
_mm_store_ss(y+i, yy);
yy = _mm_shuffle_ps(yy, yy, 0);
/* Update memory */
mem[0] = _mm_move_ss(mem[0], mem[1]);
mem[0] = _mm_shuffle_ps(mem[0], mem[0], 0x39);
mem[0] = _mm_sub_ps(mem[0], _mm_mul_ps(yy, den[0]));
mem[1] = _mm_move_ss(mem[1], mem[2]);
mem[1] = _mm_shuffle_ps(mem[1], mem[1], 0x39);
mem[1] = _mm_sub_ps(mem[1], _mm_mul_ps(yy, den[1]));
mem[2] = _mm_shuffle_ps(mem[2], mem[2], 0xfd);
mem[2] = _mm_sub_ps(mem[2], _mm_mul_ps(yy, den[2]));
}
/* Put memory back in its place */
_mm_storeu_ps(_mem, mem[0]);
_mm_storeu_ps(_mem+4, mem[1]);
_mm_store_ss(_mem+8, mem[2]);
mem[2] = _mm_shuffle_ps(mem[2], mem[2], 0x55);
_mm_store_ss(_mem+9, mem[2]);
}
void iir_mem16_8(const float *x, const float *_den, float *y, int N, int ord, float *_mem)
{
__m128 den[2], mem[2];
int i;
/* Copy numerator, denominator and memory to aligned xmm */
for (i=0;i<2;i++)
{
mem[i] = _mm_loadu_ps(_mem+4*i);
den[i] = _mm_loadu_ps(_den+4*i);
}
for (i=0;i<N;i++)
{
__m128 xx;
__m128 yy;
/* Compute next filter result */
xx = _mm_load_ps1(x+i);
yy = _mm_add_ss(xx, mem[0]);
_mm_store_ss(y+i, yy);
yy = _mm_shuffle_ps(yy, yy, 0);
/* Update memory */
mem[0] = _mm_move_ss(mem[0], mem[1]);
mem[0] = _mm_shuffle_ps(mem[0], mem[0], 0x39);
mem[0] = _mm_sub_ps(mem[0], _mm_mul_ps(yy, den[0]));
mem[1] = _mm_sub_ss(mem[1], mem[1]);
mem[1] = _mm_shuffle_ps(mem[1], mem[1], 0x39);
mem[1] = _mm_sub_ps(mem[1], _mm_mul_ps(yy, den[1]));
}
/* Put memory back in its place */
_mm_storeu_ps(_mem, mem[0]);
_mm_storeu_ps(_mem+4, mem[1]);
}
#define OVERRIDE_IIR_MEM16
void iir_mem16(const float *x, const float *_den, float *y, int N, int ord, float *_mem, char *stack)
{
if(ord==10)
iir_mem16_10(x, _den, y, N, ord, _mem);
else if (ord==8)
iir_mem16_8(x, _den, y, N, ord, _mem);
}
void fir_mem16_10(const float *x, const float *_num, float *y, int N, int ord, float *_mem)
{
__m128 num[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);
}
mem[2] = _mm_setr_ps(_mem[8], _mem[9], 0, 0);
num[2] = _mm_setr_ps(_num[8], _num[9], 0, 0);
for (i=0;i<N;i++)
{
__m128 xx;
__m128 yy;
/* Compute next filter result */
xx = _mm_load_ps1(x+i);
yy = _mm_add_ss(xx, mem[0]);
_mm_store_ss(y+i, yy);
yy = _mm_shuffle_ps(yy, yy, 0);
/* Update memory */
mem[0] = _mm_move_ss(mem[0], mem[1]);
mem[0] = _mm_shuffle_ps(mem[0], mem[0], 0x39);
mem[0] = _mm_add_ps(mem[0], _mm_mul_ps(xx, num[0]));
mem[1] = _mm_move_ss(mem[1], mem[2]);
mem[1] = _mm_shuffle_ps(mem[1], mem[1], 0x39);
mem[1] = _mm_add_ps(mem[1], _mm_mul_ps(xx, num[1]));
mem[2] = _mm_shuffle_ps(mem[2], mem[2], 0xfd);
mem[2] = _mm_add_ps(mem[2], _mm_mul_ps(xx, num[2]));
}
/* Put memory back in its place */
_mm_storeu_ps(_mem, mem[0]);
_mm_storeu_ps(_mem+4, mem[1]);
_mm_store_ss(_mem+8, mem[2]);
mem[2] = _mm_shuffle_ps(mem[2], mem[2], 0x55);
_mm_store_ss(_mem+9, mem[2]);
}
void fir_mem16_8(const float *x, const float *_num, float *y, int N, int ord, float *_mem)
{
__m128 num[2], mem[2];
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);
}
for (i=0;i<N;i++)
{
__m128 xx;
__m128 yy;
/* Compute next filter result */
xx = _mm_load_ps1(x+i);
yy = _mm_add_ss(xx, mem[0]);
_mm_store_ss(y+i, yy);
yy = _mm_shuffle_ps(yy, yy, 0);
/* Update memory */
mem[0] = _mm_move_ss(mem[0], mem[1]);
mem[0] = _mm_shuffle_ps(mem[0], mem[0], 0x39);
mem[0] = _mm_add_ps(mem[0], _mm_mul_ps(xx, num[0]));
mem[1] = _mm_sub_ss(mem[1], mem[1]);
mem[1] = _mm_shuffle_ps(mem[1], mem[1], 0x39);
mem[1] = _mm_add_ps(mem[1], _mm_mul_ps(xx, num[1]));
}
/* Put memory back in its place */
_mm_storeu_ps(_mem, mem[0]);
_mm_storeu_ps(_mem+4, mem[1]);
}
#define OVERRIDE_FIR_MEM16
void fir_mem16(const float *x, const float *_num, float *y, int N, int ord, float *_mem, char *stack)
{
if(ord==10)
fir_mem16_10(x, _num, y, N, ord, _mem);
else if (ord==8)
fir_mem16_8(x, _num, y, N, ord, _mem);
}

View file

@ -1,148 +0,0 @@
/* Copyright (C) 2004 Jean-Marc Valin */
/**
@file fixed_arm4.h
@brief ARM4 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_ARM4_H
#define FIXED_ARM4_H
#undef MULT16_32_Q14
static inline spx_word32_t MULT16_32_Q14(spx_word16_t x, spx_word32_t y) {
int res;
int dummy;
asm (
"smull %0,%1,%2,%3 \n\t"
"mov %0, %0, lsr #14 \n\t"
"add %0, %0, %1, lsl #18 \n\t"
: "=&r"(res), "=&r" (dummy)
: "r"(y),"r"((int)x));
return(res);
}
#undef MULT16_32_Q15
static inline spx_word32_t MULT16_32_Q15(spx_word16_t x, spx_word32_t y) {
int res;
int dummy;
asm (
"smull %0,%1,%2,%3 \n\t"
"mov %0, %0, lsr #15 \n\t"
"add %0, %0, %1, lsl #17 \n\t"
: "=&r"(res), "=&r" (dummy)
: "r"(y),"r"((int)x));
return(res);
}
#undef DIV32_16
static inline short DIV32_16(int a, int b)
{
int res=0;
int dead1, dead2, dead3, dead4, dead5;
__asm__ __volatile__ (
"\teor %5, %0, %1\n"
"\tmovs %4, %0\n"
"\trsbmi %0, %0, #0 \n"
"\tmovs %4, %1\n"
"\trsbmi %1, %1, #0 \n"
"\tmov %4, #1\n"
"\tsubs %3, %0, %1, asl #14 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4, asl #14 \n"
"\tsubs %3, %0, %1, asl #13 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4, asl #13 \n"
"\tsubs %3, %0, %1, asl #12 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4, asl #12 \n"
"\tsubs %3, %0, %1, asl #11 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4, asl #11 \n"
"\tsubs %3, %0, %1, asl #10 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4, asl #10 \n"
"\tsubs %3, %0, %1, asl #9 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4, asl #9 \n"
"\tsubs %3, %0, %1, asl #8 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4, asl #8 \n"
"\tsubs %3, %0, %1, asl #7 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4, asl #7 \n"
"\tsubs %3, %0, %1, asl #6 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4, asl #6 \n"
"\tsubs %3, %0, %1, asl #5 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4, asl #5 \n"
"\tsubs %3, %0, %1, asl #4 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4, asl #4 \n"
"\tsubs %3, %0, %1, asl #3 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4, asl #3 \n"
"\tsubs %3, %0, %1, asl #2 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4, asl #2 \n"
"\tsubs %3, %0, %1, asl #1 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4, asl #1 \n"
"\tsubs %3, %0, %1 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4 \n"
"\tmovs %5, %5, lsr #31 \n"
"\trsbne %2, %2, #0 \n"
: "=r" (dead1), "=r" (dead2), "=r" (res),
"=r" (dead3), "=r" (dead4), "=r" (dead5)
: "0" (a), "1" (b), "2" (res)
: "cc"
);
return res;
}
#endif

Some files were not shown because too many files have changed in this diff Show more