Projects
openEuler:Mainline
opus
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 7
View file
_service:tar_scm:opus.spec
Changed
@@ -1,6 +1,6 @@ Name: opus -Version: 1.3.1 -Release: 4 +Version: 1.4 +Release: 1 Summary: An audio codec for use in low-delay speech and audio communication License: BSD URL: https://www.opus-codec.org/ @@ -63,6 +63,9 @@ %{_datadir}/man/man3/opus_*.3.gz %changelog +* Thu Jul 13 2023 chenzixuan <chenzixuan@kylinos.cn> - 1.4-1 +- Updated to 1.4 version. + * Fri Oct 14 2022 Qingqing Li <liqingqing3@huawei.com> - 1.3.1-4 - rebuild package
View file
_service:tar_scm:opus-1.3.1.tar.gz/OpusConfig.cmake.in
Deleted
@@ -1,19 +0,0 @@ -set(OPUS_VERSION @PROJECT_VERSION@) -set(OPUS_VERSION_STRING @PROJECT_VERSION@) -set(OPUS_VERSION_MAJOR @PROJECT_VERSION_MAJOR@) -set(OPUS_VERSION_MINOR @PROJECT_VERSION_MINOR@) -set(OPUS_VERSION_PATCH @PROJECT_VERSION_PATCH@) - -@PACKAGE_INIT@ - -set_and_check(OPUS_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") -set_and_check(OPUS_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@") - -include(${CMAKE_CURRENT_LIST_DIR}/OpusTargets.cmake) - -set(OPUS_LIBRARY Opus::opus) -set(OPUS_LIBRARIES Opus::opus) - -check_required_components(Opus) - -set(OPUS_FOUND 1)
View file
_service:tar_scm:opus-1.3.1.tar.gz/opus_config.cmake
Deleted
@@ -1,43 +0,0 @@ -include(opus_functions.cmake) - -configure_file(config.h.cmake.in config.h @ONLY) -add_definitions(-DHAVE_CONFIG_H) - -set_property(GLOBAL PROPERTY USE_FOLDERS ON) -set_property(GLOBAL PROPERTY C_STANDARD 99) - -if(MSVC) - add_definitions(-D_CRT_SECURE_NO_WARNINGS) -endif() - -include(CheckLibraryExists) -check_library_exists(m floor "" HAVE_LIBM) -if(HAVE_LIBM) - list(APPEND OPUS_REQUIRED_LIBRARIES m) -endif() - -if(CMAKE_SYSTEM_PROCESSOR MATCHES "(i0-986|x86|X86|amd64|AMD64|x86_64)") - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(OPUS_CPU_X64 1) - else() - set(OPUS_CPU_X86 1) - endif() -elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") - set(OPUS_CPU_ARM 1) -endif() - -opus_supports_cpu_detection(RUNTIME_CPU_CAPABILITY_DETECTION) - -if(OPUS_CPU_X86 OR OPUS_CPU_X64) - opus_detect_sse(COMPILER_SUPPORT_SIMD) -elseif(OPUS_CPU_ARM) - opus_detect_neon(COMPILER_SUPPORT_NEON) - if(COMPILER_SUPPORT_NEON) - option(OPUS_USE_NEON "Option to turn off SSE" ON) - option(OPUS_MAY_SUPPORT_NEON "Does runtime check for neon support" ON) - option(OPUS_PRESUME_NEON "Assume target CPU has NEON support" OFF) - if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") - set(OPUS_PRESUME_NEON ON) - endif() - endif() -endif()
View file
_service:tar_scm:opus-1.3.1.tar.gz/opus_functions.cmake
Deleted
@@ -1,262 +0,0 @@ -#Cmake helper function to parse source files from make files -this is to avoid breaking existing make and auto make support -but still have the option to use CMake with only lists at one place - -cmake_minimum_required(VERSION 3.1) - -function(get_library_version OPUS_LIBRARY_VERSION OPUS_LIBRARY_VERSION_MAJOR) - file(STRINGS configure.ac opus_lt_current_string - LIMIT_COUNT 1 - REGEX "OPUS_LT_CURRENT=") - string(REGEX MATCH - "OPUS_LT_CURRENT=(0-9*)" - _ - ${opus_lt_current_string}) - set(OPUS_LT_CURRENT ${CMAKE_MATCH_1}) - - file(STRINGS configure.ac opus_lt_revision_string - LIMIT_COUNT 1 - REGEX "OPUS_LT_REVISION=") - string(REGEX MATCH - "OPUS_LT_REVISION=(0-9*)" - _ - ${opus_lt_revision_string}) - set(OPUS_LT_REVISION ${CMAKE_MATCH_1}) - - file(STRINGS configure.ac opus_lt_age_string - LIMIT_COUNT 1 - REGEX "OPUS_LT_AGE=") - string(REGEX MATCH - "OPUS_LT_AGE=(0-9*)" - _ - ${opus_lt_age_string}) - set(OPUS_LT_AGE ${CMAKE_MATCH_1}) - - math(EXPR OPUS_LIBRARY_VERSION_MAJOR "${OPUS_LT_CURRENT} - ${OPUS_LT_AGE}") - set(OPUS_LIBRARY_VERSION_MINOR ${OPUS_LT_AGE}) - set(OPUS_LIBRARY_VERSION_PATCH ${OPUS_LT_REVISION}) - set( - OPUS_LIBRARY_VERSION - "${OPUS_LIBRARY_VERSION_MAJOR}.${OPUS_LIBRARY_VERSION_MINOR}.${OPUS_LIBRARY_VERSION_PATCH}" - PARENT_SCOPE) - set(OPUS_LIBRARY_VERSION_MAJOR ${OPUS_LIBRARY_VERSION_MAJOR} PARENT_SCOPE) -endfunction() - -function(get_package_version PACKAGE_VERSION) - find_package(Git) - if(GIT_FOUND) - execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --match "v*" - OUTPUT_VARIABLE OPUS_PACKAGE_VERSION) - if(OPUS_PACKAGE_VERSION) - string(STRIP ${OPUS_PACKAGE_VERSION}, OPUS_PACKAGE_VERSION) - string(REPLACE \n - "" - OPUS_PACKAGE_VERSION - ${OPUS_PACKAGE_VERSION}) - string(REPLACE , - "" - OPUS_PACKAGE_VERSION - ${OPUS_PACKAGE_VERSION}) - - string(SUBSTRING ${OPUS_PACKAGE_VERSION} - 1 - -1 - OPUS_PACKAGE_VERSION) - set(PACKAGE_VERSION ${OPUS_PACKAGE_VERSION} PARENT_SCOPE) - return() - endif() - endif() - - if(EXISTS "${CMAKE_SOURCE_DIR}/package_version") - # Not a git repo, lets' try to parse it from package_version file if exists - file(STRINGS package_version opus_package_version_string - LIMIT_COUNT 1 - REGEX "PACKAGE_VERSION=") - string(REPLACE "PACKAGE_VERSION=" - "" - opus_package_version_string - ${opus_package_version_string}) - string(REPLACE "\"" - "" - opus_package_version_string - ${opus_package_version_string}) - set(PACKAGE_VERSION ${opus_package_version_string} PARENT_SCOPE) - return() - endif() - - # if all else fails set to 0 - set(PACKAGE_VERSION 0 PARENT_SCOPE) -endfunction() - -function(check_and_set_flag NAME FLAG) - include(CheckCCompilerFlag) - check_c_compiler_flag(${FLAG} ${NAME}_SUPPORTED) - if(${NAME}_SUPPORTED) - add_definitions(${FLAG}) - endif() -endfunction() - -function(check_flag NAME FLAG) - include(CheckCCompilerFlag) - check_c_compiler_flag(${FLAG} ${NAME}_SUPPORTED) -endfunction() - -include(CheckIncludeFile) -# function to check if compiler supports SSE, SSE2, SSE4.1 and AVX if target -# systems may not have SSE support then use OPUS_MAY_HAVE_SSE option if target -# system is guaranteed to have SSE support then OPUS_PRESUME_SSE can be used to -# skip SSE runtime check -function(opus_detect_sse COMPILER_SUPPORT_SIMD) - message(STATUS "Check SIMD support by compiler") - check_include_file(xmmintrin.h HAVE_XMMINTRIN_H) # SSE1 - if(HAVE_XMMINTRIN_H) - if(MSVC) - # different arch options for 32 and 64 bit target for MSVC - if(CMAKE_SIZEOF_VOID_P EQUAL 4) - check_flag(SSE1 /arch:SSE) - else() - set(SSE1_SUPPORTED 1 PARENT_SCOPE) - endif() - else() - check_and_set_flag(SSE1 -msse) - endif() - else() - set(SSE1_SUPPORTED 0 PARENT_SCOPE) - endif() - - check_include_file(emmintrin.h HAVE_EMMINTRIN_H) # SSE2 - if(HAVE_EMMINTRIN_H) - if(MSVC) - if(CMAKE_SIZEOF_VOID_P EQUAL 4) - check_flag(SSE2 /arch:SSE2) - else() - set(SSE2_SUPPORTED 1 PARENT_SCOPE) - endif() - else() - check_and_set_flag(SSE2 -msse2) - endif() - else() - set(SSE2_SUPPORTED 0 PARENT_SCOPE) - endif() - - check_include_file(smmintrin.h HAVE_SMMINTRIN_H) # SSE4.1 - if(HAVE_SMMINTRIN_H) - if(MSVC) - if(CMAKE_SIZEOF_VOID_P EQUAL 4) - check_flag(SSE4_1 /arch:SSE2) # SSE2 and above - else() - set(SSE4_1_SUPPORTED 1 PARENT_SCOPE) - endif() - else() - check_and_set_flag(SSE4_1 -msse4.1) - endif() - else() - set(SSE4_1_SUPPORTED 0 PARENT_SCOPE) - endif() - - check_include_file(immintrin.h HAVE_IMMINTRIN_H) # AVX - if(HAVE_IMMINTRIN_H) - if(MSVC) - check_flag(AVX /arch:AVX) - else() - check_and_set_flag(AVX -mavx) - endif() - else() - set(AVX_SUPPORTED 0 PARENT_SCOPE) - endif() - - if(MSVC) # To avoid warning D9025 of overriding compiler options - if(AVX_SUPPORTED) # on 64 bit and 32 bits - add_definitions(/arch:AVX) - elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) # if AVX not supported then set SSE flag - if(SSE4_1_SUPPORTED OR SSE2_SUPPORTED) - add_definitions(/arch:SSE2) - elseif(SSE1_SUPPORTED) - add_definitions(/arch:SSE) - endif() - endif() - endif() - - if(SSE1_SUPPORTED OR SSE2_SUPPORTED OR SSE4_1_SUPPORTED OR AVX_SUPPORTED) - set(COMPILER_SUPPORT_SIMD 1 PARENT_SCOPE) - else() - message(STATUS "No SIMD support in compiler") - endif() -endfunction() - -function(opus_detect_neon COMPILER_SUPPORT_NEON) - if(CMAKE_SYSTEM_PROCESSOR MATCHES "(armv7-a|aarch64)") - message(STATUS "Check NEON support by compiler") - check_include_file(arm_neon.h HAVE_ARM_NEON_H) - if(HAVE_ARM_NEON_H) - set(COMPILER_SUPPORT_NEON ${HAVE_ARM_NEON_H} PARENT_SCOPE) - endif() - endif() -endfunction() - -function(opus_supports_cpu_detection RUNTIME_CPU_CAPABILITY_DETECTION) - if(MSVC) - check_include_file(intrin.h HAVE_INTRIN_H)
View file
_service:tar_scm:opus-1.3.1.tar.gz/opus_sources.cmake
Deleted
@@ -1,38 +0,0 @@ -include(opus_functions.cmake) - -get_opus_sources(SILK_SOURCES silk_sources.mk silk_sources) -get_opus_sources(SILK_SOURCES_FLOAT silk_sources.mk silk_sources_float) -get_opus_sources(SILK_SOURCES_FIXED silk_sources.mk silk_sources_fixed) -get_opus_sources(SILK_SOURCES_SSE4_1 silk_sources.mk silk_sources_sse4_1) -get_opus_sources(SILK_SOURCES_FIXED_SSE4_1 silk_sources.mk - silk_sources_fixed_sse4_1) -get_opus_sources(SILK_SOURCES_ARM_NEON_INTR silk_sources.mk - silk_sources_arm_neon_intr) -get_opus_sources(SILK_SOURCES_FIXED_ARM_NEON_INTR silk_sources.mk - silk_sources_fixed_arm_neon_intr) - -get_opus_sources(OPUS_SOURCES opus_sources.mk opus_sources) -get_opus_sources(OPUS_SOURCES_FLOAT opus_sources.mk opus_sources_float) - -get_opus_sources(CELT_SOURCES celt_sources.mk celt_sources) -get_opus_sources(CELT_SOURCES_SSE celt_sources.mk celt_sources_sse) -get_opus_sources(CELT_SOURCES_SSE2 celt_sources.mk celt_sources_sse2) -get_opus_sources(CELT_SOURCES_SSE4_1 celt_sources.mk celt_sources_sse4_1) -get_opus_sources(CELT_SOURCES_ARM celt_sources.mk celt_sources_arm) -get_opus_sources(CELT_SOURCES_ARM_ASM celt_sources.mk celt_sources_arm_asm) -get_opus_sources(CELT_AM_SOURCES_ARM_ASM celt_sources.mk - celt_am_sources_arm_asm) -get_opus_sources(CELT_SOURCES_ARM_NEON_INTR celt_sources.mk - celt_sources_arm_neon_intr) -get_opus_sources(CELT_SOURCES_ARM_NE10 celt_sources.mk celt_sources_arm_ne10) - -get_opus_sources(opus_demo_SOURCES Makefile.am opus_demo_sources) -get_opus_sources(opus_custom_demo_SOURCES Makefile.am opus_custom_demo_sources) -get_opus_sources(opus_compare_SOURCES Makefile.am opus_compare_sources) -get_opus_sources(tests_test_opus_api_SOURCES Makefile.am test_opus_api_sources) -get_opus_sources(tests_test_opus_encode_SOURCES Makefile.am - test_opus_encode_sources) -get_opus_sources(tests_test_opus_decode_SOURCES Makefile.am - test_opus_decode_sources) -get_opus_sources(tests_test_opus_padding_SOURCES Makefile.am - test_opus_padding_sources)
View file
_service:tar_scm:opus-1.3.1.tar.gz/CMakeLists.txt -> _service:tar_scm:opus-1.4.tar.gz/CMakeLists.txt
Changed
@@ -1,110 +1,236 @@ cmake_minimum_required(VERSION 3.1) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -include(opus_functions.cmake) - -get_library_version(OPUS_LIBRARY_VERSION OPUS_LIBRARY_VERSION_MAJOR) -message(STATUS "Opus library version: ${OPUS_LIBRARY_VERSION}") - -get_package_version(PACKAGE_VERSION) -message(STATUS "Opus package version: ${PACKAGE_VERSION}") - -string(REGEX - REPLACE "^(0-9+.0-9+\\.?(0-9+)?).*" - "\\1" - PROJECT_VERSION - ${PACKAGE_VERSION}) -message(STATUS "Opus project version: ${PROJECT_VERSION}") +include(OpusPackageVersion) +get_package_version(PACKAGE_VERSION PROJECT_VERSION) project(Opus LANGUAGES C VERSION ${PROJECT_VERSION}) -include(opus_buildtype.cmake) - -option(OPUS_STACK_PROTECTOR "Use stack protection" ON) -option(OPUS_USE_ALLOCA "Use alloca for stack arrays (on non-C99 compilers)" OFF) -option(OPUS_CUSTOM_MODES "Enable non-Opus modes, e.g. 44.1 kHz & 2^n frames" - OFF) -option(OPUS_BUILD_PROGRAMS "Build programs" OFF) -option(OPUS_FIXED_POINT - "Compile as fixed-point (for machines without a fast enough FPU)" OFF) -option(OPUS_ENABLE_FLOAT_API - "Compile with the floating point API (for machines with float library" - ON) -option(OPUS_INSTALL_PKG_CONFIG_MODULE "Install PkgConfig module" ON) -option(OPUS_INSTALL_CMAKE_CONFIG_MODULE "Install CMake package config module" - ON) - -include(opus_config.cmake) -include(opus_sources.cmake) + +include(OpusFunctions) +include(OpusBuildtype) +include(OpusConfig) +include(OpusSources) include(GNUInstallDirs) include(CMakeDependentOption) include(FeatureSummary) -if(OPUS_STACK_PROTECTOR) - if(NOT MSVC) # GC on by default on MSVC - check_and_set_flag(STACK_PROTECTION_STRONG -fstack-protector-strong) - endif() -else() - if(MSVC) - check_and_set_flag(BUFFER_SECURITY_CHECK /GS-) - endif() +set(OPUS_BUILD_SHARED_LIBRARY_HELP_STR "build shared library.") +option(OPUS_BUILD_SHARED_LIBRARY ${OPUS_BUILD_SHARED_LIBRARY_HELP_STR} OFF) +if(OPUS_BUILD_SHARED_LIBRARY OR BUILD_SHARED_LIBS OR OPUS_BUILD_FRAMEWORK) + # Global flag to cause add_library() to create shared libraries if on. + set(BUILD_SHARED_LIBS ON) + set(OPUS_BUILD_SHARED_LIBRARY ON) +endif() +add_feature_info(OPUS_BUILD_SHARED_LIBRARY OPUS_BUILD_SHARED_LIBRARY ${OPUS_BUILD_SHARED_LIBRARY_HELP_STR}) + +set(OPUS_BUILD_TESTING_HELP_STR "build tests.") +option(OPUS_BUILD_TESTING ${OPUS_BUILD_TESTING_HELP_STR} OFF) +if(OPUS_BUILD_TESTING OR BUILD_TESTING) + set(OPUS_BUILD_TESTING ON) + set(BUILD_TESTING ON) +endif() +add_feature_info(OPUS_BUILD_TESTING OPUS_BUILD_TESTING ${OPUS_BUILD_TESTING_HELP_STR}) + +set(OPUS_CUSTOM_MODES_HELP_STR "enable non-Opus modes, e.g. 44.1 kHz & 2^n frames.") +option(OPUS_CUSTOM_MODES ${OPUS_CUSTOM_MODES_HELP_STR} OFF) +add_feature_info(OPUS_CUSTOM_MODES OPUS_CUSTOM_MODES ${OPUS_CUSTOM_MODES_HELP_STR}) + +set(OPUS_BUILD_PROGRAMS_HELP_STR "build programs.") +option(OPUS_BUILD_PROGRAMS ${OPUS_BUILD_PROGRAMS_HELP_STR} OFF) +add_feature_info(OPUS_BUILD_PROGRAMS OPUS_BUILD_PROGRAMS ${OPUS_BUILD_PROGRAMS_HELP_STR}) + +set(OPUS_DISABLE_INTRINSICS_HELP_STR "disable all intrinsics optimizations.") +option(OPUS_DISABLE_INTRINSICS ${OPUS_DISABLE_INTRINSICS_HELP_STR} OFF) +add_feature_info(OPUS_DISABLE_INTRINSICS OPUS_DISABLE_INTRINSICS ${OPUS_DISABLE_INTRINSICS_HELP_STR}) + +set(OPUS_FIXED_POINT_HELP_STR "compile as fixed-point (for machines without a fast enough FPU).") +option(OPUS_FIXED_POINT ${OPUS_FIXED_POINT_HELP_STR} OFF) +add_feature_info(OPUS_FIXED_POINT OPUS_FIXED_POINT ${OPUS_FIXED_POINT_HELP_STR}) + +set(OPUS_ENABLE_FLOAT_API_HELP_STR "compile with the floating point API (for machines with float library).") +option(OPUS_ENABLE_FLOAT_API ${OPUS_ENABLE_FLOAT_API_HELP_STR} ON) +add_feature_info(OPUS_ENABLE_FLOAT_API OPUS_ENABLE_FLOAT_API ${OPUS_ENABLE_FLOAT_API_HELP_STR}) + +set(OPUS_FLOAT_APPROX_HELP_STR "enable floating point approximations (Ensure your platform supports IEEE 754 before enabling).") +option(OPUS_FLOAT_APPROX ${OPUS_FLOAT_APPROX_HELP_STR} OFF) +add_feature_info(OPUS_FLOAT_APPROX OPUS_FLOAT_APPROX ${OPUS_FLOAT_APPROX_HELP_STR}) + +set(OPUS_ASSERTIONS_HELP_STR "additional software error checking.") +option(OPUS_ASSERTIONS ${OPUS_ASSERTIONS_HELP_STR} OFF) +add_feature_info(OPUS_ASSERTIONS OPUS_ASSERTIONS ${OPUS_ASSERTIONS_HELP_STR}) + +set(OPUS_HARDENING_HELP_STR "run-time checks that are cheap and safe for use in production.") +option(OPUS_HARDENING ${OPUS_HARDENING_HELP_STR} ON) +add_feature_info(OPUS_HARDENING OPUS_HARDENING ${OPUS_HARDENING_HELP_STR}) + +set(OPUS_FUZZING_HELP_STR "causes the encoder to make random decisions (do not use in production).") +option(OPUS_FUZZING ${OPUS_FUZZING_HELP_STR} OFF) +add_feature_info(OPUS_FUZZING OPUS_FUZZING ${OPUS_FUZZING_HELP_STR}) + +set(OPUS_CHECK_ASM_HELP_STR "enable bit-exactness checks between optimized and c implementations.") +option(OPUS_CHECK_ASM ${OPUS_CHECK_ASM_HELP_STR} OFF) +add_feature_info(OPUS_CHECK_ASM OPUS_CHECK_ASM ${OPUS_CHECK_ASM_HELP_STR}) + +set(OPUS_INSTALL_PKG_CONFIG_MODULE_HELP_STR "install pkg-config module.") +option(OPUS_INSTALL_PKG_CONFIG_MODULE ${OPUS_INSTALL_PKG_CONFIG_MODULE_HELP_STR} ON) +add_feature_info(OPUS_INSTALL_PKG_CONFIG_MODULE OPUS_INSTALL_PKG_CONFIG_MODULE ${OPUS_INSTALL_PKG_CONFIG_MODULE_HELP_STR}) + +set(OPUS_INSTALL_CMAKE_CONFIG_MODULE_HELP_STR "install CMake package config module.") +option(OPUS_INSTALL_CMAKE_CONFIG_MODULE ${OPUS_INSTALL_CMAKE_CONFIG_MODULE_HELP_STR} ON) +add_feature_info(OPUS_INSTALL_CMAKE_CONFIG_MODULE OPUS_INSTALL_CMAKE_CONFIG_MODULE ${OPUS_INSTALL_CMAKE_CONFIG_MODULE_HELP_STR}) + +if(APPLE) + set(OPUS_BUILD_FRAMEWORK_HELP_STR "build Framework bundle for Apple systems.") + option(OPUS_BUILD_FRAMEWORK ${OPUS_BUILD_FRAMEWORK_HELP_STR} OFF) + add_feature_info(OPUS_BUILD_FRAMEWORK OPUS_BUILD_FRAMEWORK ${OPUS_BUILD_FRAMEWORK_HELP_STR}) +endif() + +set(OPUS_FIXED_POINT_DEBUG_HELP_STR "debug fixed-point implementation.") +cmake_dependent_option(OPUS_FIXED_POINT_DEBUG + ${OPUS_FIXED_POINT_DEBUG_HELP_STR} + ON + "OPUS_FIXED_POINT; OPUS_FIXED_POINT_DEBUG" + OFF) +add_feature_info(OPUS_FIXED_POINT_DEBUG OPUS_FIXED_POINT_DEBUG ${OPUS_FIXED_POINT_DEBUG_HELP_STR}) + +set(OPUS_VAR_ARRAYS_HELP_STR "use variable length arrays for stack arrays.") +cmake_dependent_option(OPUS_VAR_ARRAYS + ${OPUS_VAR_ARRAYS_HELP_STR} + ON + "VLA_SUPPORTED; NOT OPUS_USE_ALLOCA; NOT OPUS_NONTHREADSAFE_PSEUDOSTACK" + OFF) +add_feature_info(OPUS_VAR_ARRAYS OPUS_VAR_ARRAYS ${OPUS_VAR_ARRAYS_HELP_STR}) + +set(OPUS_USE_ALLOCA_HELP_STR "use alloca for stack arrays (on non-C99 compilers).") +cmake_dependent_option(OPUS_USE_ALLOCA + ${OPUS_USE_ALLOCA_HELP_STR} + ON + "USE_ALLOCA_SUPPORTED; NOT OPUS_VAR_ARRAYS; NOT OPUS_NONTHREADSAFE_PSEUDOSTACK" + OFF) +add_feature_info(OPUS_USE_ALLOCA OPUS_USE_ALLOCA ${OPUS_USE_ALLOCA_HELP_STR}) + +set(OPUS_NONTHREADSAFE_PSEUDOSTACK_HELP_STR "use a non threadsafe pseudostack when neither variable length arrays or alloca is supported.") +cmake_dependent_option(OPUS_NONTHREADSAFE_PSEUDOSTACK + ${OPUS_NONTHREADSAFE_PSEUDOSTACK_HELP_STR} + ON + "NOT OPUS_VAR_ARRAYS; NOT OPUS_USE_ALLOCA" + OFF) +add_feature_info(OPUS_NONTHREADSAFE_PSEUDOSTACK OPUS_NONTHREADSAFE_PSEUDOSTACK ${OPUS_NONTHREADSAFE_PSEUDOSTACK_HELP_STR}) + +set(OPUS_FAST_MATH_HELP_STR "enable fast math (unsupported and discouraged use, as code is not well tested with this build option).") +cmake_dependent_option(OPUS_FAST_MATH + ${OPUS_FAST_MATH_HELP_STR} + ON + "OPUS_FLOAT_APPROX; OPUS_FAST_MATH; FAST_MATH_SUPPORTED" + OFF) +add_feature_info(OPUS_FAST_MATH OPUS_FAST_MATH ${OPUS_FAST_MATH_HELP_STR}) + +set(OPUS_STACK_PROTECTOR_HELP_STR "use stack protection.") +cmake_dependent_option(OPUS_STACK_PROTECTOR + ${OPUS_STACK_PROTECTOR_HELP_STR} + ON + "STACK_PROTECTOR_SUPPORTED" + OFF) +add_feature_info(OPUS_STACK_PROTECTOR OPUS_STACK_PROTECTOR ${OPUS_STACK_PROTECTOR_HELP_STR}) + +if(NOT MSVC) + set(OPUS_FORTIFY_SOURCE_HELP_STR "add protection against buffer overflows.") + cmake_dependent_option(OPUS_FORTIFY_SOURCE + ${OPUS_FORTIFY_SOURCE_HELP_STR} + ON + "FORTIFY_SOURCE_SUPPORTED" + OFF) + add_feature_info(OPUS_FORTIFY_SOURCE OPUS_FORTIFY_SOURCE ${OPUS_FORTIFY_SOURCE_HELP_STR}) +endif() + +if(MINGW AND (OPUS_FORTIFY_SOURCE OR OPUS_STACK_PROTECTOR)) + # ssp lib is needed for security features for MINGW + list(APPEND OPUS_REQUIRED_LIBRARIES ssp) endif() if(OPUS_CPU_X86 OR OPUS_CPU_X64) + set(OPUS_X86_MAY_HAVE_SSE_HELP_STR "does runtime check for SSE1 support.") cmake_dependent_option(OPUS_X86_MAY_HAVE_SSE - "Does runtime check for SSE1 support" + ${OPUS_X86_MAY_HAVE_SSE_HELP_STR} ON - "SSE1_SUPPORTED" + "SSE1_SUPPORTED; NOT OPUS_DISABLE_INTRINSICS" OFF)
View file
_service:tar_scm:opus-1.3.1.tar.gz/Makefile.am -> _service:tar_scm:opus-1.4.tar.gz/Makefile.am
Changed
@@ -36,6 +36,11 @@ OPUS_SOURCES += $(OPUS_SOURCES_FLOAT) endif +if CPU_X86 +if HAVE_RTCD +CELT_SOURCES += $(CELT_SOURCES_X86_RTCD) +SILK_SOURCES += $(SILK_SOURCES_X86_RTCD) +endif if HAVE_SSE CELT_SOURCES += $(CELT_SOURCES_SSE) endif @@ -45,10 +50,13 @@ if HAVE_SSE4_1 CELT_SOURCES += $(CELT_SOURCES_SSE4_1) endif +endif if CPU_ARM -CELT_SOURCES += $(CELT_SOURCES_ARM) -SILK_SOURCES += $(SILK_SOURCES_ARM) +if HAVE_RTCD +CELT_SOURCES += $(CELT_SOURCES_ARM_RTCD) +SILK_SOURCES += $(SILK_SOURCES_ARM_RTCD) +endif if HAVE_ARM_NEON_INTR CELT_SOURCES += $(CELT_SOURCES_ARM_NEON_INTR) @@ -103,7 +111,8 @@ tests/test_opus_decode \ tests/test_opus_encode \ tests/test_opus_padding \ - tests/test_opus_projection + tests/test_opus_projection \ + trivial_example TESTS = celt/tests/test_unit_cwrs32 \ celt/tests/test_unit_dft \ @@ -131,6 +140,9 @@ opus_compare_SOURCES = src/opus_compare.c opus_compare_LDADD = $(LIBM) +trivial_example_SOURCES = doc/trivial_example.c +trivial_example_LDADD = libopus.la $(LIBM) + tests_test_opus_api_SOURCES = tests/test_opus_api.c tests/test_opus_common.h tests_test_opus_api_LDADD = libopus.la $(NE10_LIBS) $(LIBM) @@ -211,11 +223,30 @@ Makefile.mips \ Makefile.unix \ CMakeLists.txt \ - config.h.cmake.in \ - opus_config.cmake \ - opus_functions.cmake \ - opus_sources.cmake \ - OpusConfig.cmake.in \ + cmake/CFeatureCheck.cmake \ + cmake/OpusBuildtype.cmake \ + cmake/OpusConfig.cmake \ + cmake/OpusConfig.cmake.in \ + cmake/OpusFunctions.cmake \ + cmake/OpusPackageVersion.cmake \ + cmake/OpusSources.cmake \ + cmake/RunTest.cmake \ + cmake/config.h.cmake.in \ + cmake/vla.c \ + cmake/cpu_info_by_asm.c \ + cmake/cpu_info_by_c.c \ + meson/get-version.py \ + meson/read-sources-list.py \ + meson.build \ + meson_options.txt \ + include/meson.build \ + celt/meson.build \ + celt/tests/meson.build \ + silk/meson.build \ + silk/tests/meson.build \ + src/meson.build \ + tests/meson.build \ + doc/meson.build \ tests/run_vectors.sh \ celt/arm/arm2gnu.pl \ celt/arm/celt_pitch_xcorr_arm.s \
View file
_service:tar_scm:opus-1.3.1.tar.gz/Makefile.in -> _service:tar_scm:opus-1.4.tar.gz/Makefile.in
Changed
@@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -97,15 +97,17 @@ @FIXED_POINT_FALSE@am__append_4 = $(SILK_SOURCES_FLOAT) @FIXED_POINT_FALSE@@HAVE_SSE4_1_TRUE@am__append_5 = $(SILK_SOURCES_SSE4_1) @DISABLE_FLOAT_API_FALSE@am__append_6 = $(OPUS_SOURCES_FLOAT) -@HAVE_SSE_TRUE@am__append_7 = $(CELT_SOURCES_SSE) -@HAVE_SSE2_TRUE@am__append_8 = $(CELT_SOURCES_SSE2) -@HAVE_SSE4_1_TRUE@am__append_9 = $(CELT_SOURCES_SSE4_1) -@CPU_ARM_TRUE@am__append_10 = $(CELT_SOURCES_ARM) -@CPU_ARM_TRUE@am__append_11 = $(SILK_SOURCES_ARM) -@CPU_ARM_TRUE@@HAVE_ARM_NEON_INTR_TRUE@am__append_12 = $(CELT_SOURCES_ARM_NEON_INTR) -@CPU_ARM_TRUE@@HAVE_ARM_NEON_INTR_TRUE@am__append_13 = $(SILK_SOURCES_ARM_NEON_INTR) -@CPU_ARM_TRUE@@HAVE_ARM_NE10_TRUE@am__append_14 = $(CELT_SOURCES_ARM_NE10) -@OPUS_ARM_EXTERNAL_ASM_TRUE@am__append_15 = libarmasm.la +@CPU_X86_TRUE@@HAVE_RTCD_TRUE@am__append_7 = $(CELT_SOURCES_X86_RTCD) +@CPU_X86_TRUE@@HAVE_RTCD_TRUE@am__append_8 = $(SILK_SOURCES_X86_RTCD) +@CPU_X86_TRUE@@HAVE_SSE_TRUE@am__append_9 = $(CELT_SOURCES_SSE) +@CPU_X86_TRUE@@HAVE_SSE2_TRUE@am__append_10 = $(CELT_SOURCES_SSE2) +@CPU_X86_TRUE@@HAVE_SSE4_1_TRUE@am__append_11 = $(CELT_SOURCES_SSE4_1) +@CPU_ARM_TRUE@@HAVE_RTCD_TRUE@am__append_12 = $(CELT_SOURCES_ARM_RTCD) +@CPU_ARM_TRUE@@HAVE_RTCD_TRUE@am__append_13 = $(SILK_SOURCES_ARM_RTCD) +@CPU_ARM_TRUE@@HAVE_ARM_NEON_INTR_TRUE@am__append_14 = $(CELT_SOURCES_ARM_NEON_INTR) +@CPU_ARM_TRUE@@HAVE_ARM_NEON_INTR_TRUE@am__append_15 = $(SILK_SOURCES_ARM_NEON_INTR) +@CPU_ARM_TRUE@@HAVE_ARM_NE10_TRUE@am__append_16 = $(CELT_SOURCES_ARM_NE10) +@OPUS_ARM_EXTERNAL_ASM_TRUE@am__append_17 = libarmasm.la @EXTRA_PROGRAMS_TRUE@noinst_PROGRAMS = \ @EXTRA_PROGRAMS_TRUE@ celt/tests/test_unit_cwrs32$(EXEEXT) \ @EXTRA_PROGRAMS_TRUE@ celt/tests/test_unit_dft$(EXEEXT) \ @@ -123,7 +125,7 @@ @EXTRA_PROGRAMS_TRUE@ tests/test_opus_encode$(EXEEXT) \ @EXTRA_PROGRAMS_TRUE@ tests/test_opus_padding$(EXEEXT) \ @EXTRA_PROGRAMS_TRUE@ tests/test_opus_projection$(EXEEXT) \ -@EXTRA_PROGRAMS_TRUE@ $(am__EXEEXT_1) +@EXTRA_PROGRAMS_TRUE@ trivial_example$(EXEEXT) $(am__EXEEXT_1) @EXTRA_PROGRAMS_TRUE@TESTS = celt/tests/test_unit_cwrs32$(EXEEXT) \ @EXTRA_PROGRAMS_TRUE@ celt/tests/test_unit_dft$(EXEEXT) \ @EXTRA_PROGRAMS_TRUE@ celt/tests/test_unit_entropy$(EXEEXT) \ @@ -138,14 +140,14 @@ @EXTRA_PROGRAMS_TRUE@ tests/test_opus_encode$(EXEEXT) \ @EXTRA_PROGRAMS_TRUE@ tests/test_opus_padding$(EXEEXT) \ @EXTRA_PROGRAMS_TRUE@ tests/test_opus_projection$(EXEEXT) -@EXTRA_PROGRAMS_TRUE@@OPUS_ARM_EXTERNAL_ASM_TRUE@am__append_16 = libarmasm.la -@EXTRA_PROGRAMS_TRUE@@OPUS_ARM_EXTERNAL_ASM_TRUE@am__append_17 = libarmasm.la @EXTRA_PROGRAMS_TRUE@@OPUS_ARM_EXTERNAL_ASM_TRUE@am__append_18 = libarmasm.la @EXTRA_PROGRAMS_TRUE@@OPUS_ARM_EXTERNAL_ASM_TRUE@am__append_19 = libarmasm.la @EXTRA_PROGRAMS_TRUE@@OPUS_ARM_EXTERNAL_ASM_TRUE@am__append_20 = libarmasm.la @EXTRA_PROGRAMS_TRUE@@OPUS_ARM_EXTERNAL_ASM_TRUE@am__append_21 = libarmasm.la -@CUSTOM_MODES_TRUE@am__append_22 = include/opus_custom.h -@CUSTOM_MODES_TRUE@@EXTRA_PROGRAMS_TRUE@am__append_23 = opus_custom_demo +@EXTRA_PROGRAMS_TRUE@@OPUS_ARM_EXTERNAL_ASM_TRUE@am__append_22 = libarmasm.la +@EXTRA_PROGRAMS_TRUE@@OPUS_ARM_EXTERNAL_ASM_TRUE@am__append_23 = libarmasm.la +@CUSTOM_MODES_TRUE@am__append_24 = include/opus_custom.h +@CUSTOM_MODES_TRUE@@EXTRA_PROGRAMS_TRUE@am__append_25 = opus_custom_demo subdir = . SUBDIRS = ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -166,6 +168,8 @@ CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = opus.pc opus-uninstalled.pc celt/arm/armopts.s CONFIG_CLEAN_VPATH_FILES = +@CUSTOM_MODES_TRUE@@EXTRA_PROGRAMS_TRUE@am__EXEEXT_1 = opus_custom_demo$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -210,7 +214,7 @@ @CPU_ARM_TRUE@@OPUS_ARM_EXTERNAL_ASM_TRUE@am_libarmasm_la_rpath = am__DEPENDENCIES_1 = libopus_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__append_15) + $(am__append_17) am__libopus_la_SOURCES_DIST = celt/bands.c celt/celt.c \ celt/celt_encoder.c celt/celt_decoder.c celt/cwrs.c \ celt/entcode.c celt/entdec.c celt/entenc.c celt/kiss_fft.c \ @@ -269,8 +273,8 @@ silk/fixed/k2a_Q16_FIX.c silk/fixed/pitch_analysis_core_FIX.c \ silk/fixed/vector_ops_FIX.c silk/fixed/schur64_FIX.c \ silk/fixed/schur_FIX.c silk/x86/NSQ_sse4_1.c \ - silk/x86/NSQ_del_dec_sse4_1.c silk/x86/x86_silk_map.c \ - silk/x86/VAD_sse4_1.c silk/x86/VQ_WMat_EC_sse4_1.c \ + silk/x86/NSQ_del_dec_sse4_1.c silk/x86/VAD_sse4_1.c \ + silk/x86/VQ_WMat_EC_sse4_1.c \ silk/fixed/x86/vector_ops_FIX_sse4_1.c \ silk/fixed/x86/burg_modified_FIX_sse4_1.c \ silk/fixed/arm/warped_autocorrelation_FIX_neon_intr.c \ @@ -293,8 +297,8 @@ silk/float/pitch_analysis_core_FLP.c \ silk/float/scale_copy_vector_FLP.c \ silk/float/scale_vector_FLP.c silk/float/schur_FLP.c \ - silk/float/sort_FLP.c silk/arm/arm_silk_map.c \ - silk/arm/biquad_alt_neon_intr.c \ + silk/float/sort_FLP.c silk/x86/x86_silk_map.c \ + silk/arm/arm_silk_map.c silk/arm/biquad_alt_neon_intr.c \ silk/arm/LPC_inv_pred_gain_neon_intr.c \ silk/arm/NSQ_del_dec_neon_intr.c silk/arm/NSQ_neon.c \ src/opus.c src/opus_decoder.c src/opus_encoder.c \ @@ -302,29 +306,31 @@ src/opus_multistream_decoder.c src/repacketizer.c \ src/opus_projection_encoder.c src/opus_projection_decoder.c \ src/mapping_matrix.c src/analysis.c src/mlp.c src/mlp_data.c -am__objects_2 = celt/x86/x86cpu.lo celt/x86/x86_celt_map.lo \ - celt/x86/pitch_sse.lo -@HAVE_SSE_TRUE@am__objects_3 = $(am__objects_2) -am__objects_4 = celt/x86/pitch_sse2.lo celt/x86/vq_sse2.lo -@HAVE_SSE2_TRUE@am__objects_5 = $(am__objects_4) -am__objects_6 = celt/x86/celt_lpc_sse4_1.lo celt/x86/pitch_sse4_1.lo -@HAVE_SSE4_1_TRUE@am__objects_7 = $(am__objects_6) -am__objects_8 = celt/arm/armcpu.lo celt/arm/arm_celt_map.lo -@CPU_ARM_TRUE@am__objects_9 = $(am__objects_8) -am__objects_10 = celt/arm/celt_neon_intr.lo \ +am__objects_2 = celt/x86/x86cpu.lo celt/x86/x86_celt_map.lo +@CPU_X86_TRUE@@HAVE_RTCD_TRUE@am__objects_3 = $(am__objects_2) +am__objects_4 = celt/x86/pitch_sse.lo +@CPU_X86_TRUE@@HAVE_SSE_TRUE@am__objects_5 = $(am__objects_4) +am__objects_6 = celt/x86/pitch_sse2.lo celt/x86/vq_sse2.lo +@CPU_X86_TRUE@@HAVE_SSE2_TRUE@am__objects_7 = $(am__objects_6) +am__objects_8 = celt/x86/celt_lpc_sse4_1.lo celt/x86/pitch_sse4_1.lo +@CPU_X86_TRUE@@HAVE_SSE4_1_TRUE@am__objects_9 = $(am__objects_8) +am__objects_10 = celt/arm/armcpu.lo celt/arm/arm_celt_map.lo +@CPU_ARM_TRUE@@HAVE_RTCD_TRUE@am__objects_11 = $(am__objects_10) +am__objects_12 = celt/arm/celt_neon_intr.lo \ celt/arm/pitch_neon_intr.lo -@CPU_ARM_TRUE@@HAVE_ARM_NEON_INTR_TRUE@am__objects_11 = \ -@CPU_ARM_TRUE@@HAVE_ARM_NEON_INTR_TRUE@ $(am__objects_10) -am__objects_12 = celt/arm/celt_fft_ne10.lo celt/arm/celt_mdct_ne10.lo -@CPU_ARM_TRUE@@HAVE_ARM_NE10_TRUE@am__objects_13 = $(am__objects_12) -am__objects_14 = celt/bands.lo celt/celt.lo celt/celt_encoder.lo \ +@CPU_ARM_TRUE@@HAVE_ARM_NEON_INTR_TRUE@am__objects_13 = \ +@CPU_ARM_TRUE@@HAVE_ARM_NEON_INTR_TRUE@ $(am__objects_12) +am__objects_14 = celt/arm/celt_fft_ne10.lo celt/arm/celt_mdct_ne10.lo +@CPU_ARM_TRUE@@HAVE_ARM_NE10_TRUE@am__objects_15 = $(am__objects_14) +am__objects_16 = celt/bands.lo celt/celt.lo celt/celt_encoder.lo \ celt/celt_decoder.lo celt/cwrs.lo celt/entcode.lo \ celt/entdec.lo celt/entenc.lo celt/kiss_fft.lo celt/laplace.lo \ celt/mathops.lo celt/mdct.lo celt/modes.lo celt/pitch.lo \ celt/celt_lpc.lo celt/quant_bands.lo celt/rate.lo celt/vq.lo \ $(am__objects_3) $(am__objects_5) $(am__objects_7) \ - $(am__objects_9) $(am__objects_11) $(am__objects_13) -am__objects_15 = silk/fixed/LTP_analysis_filter_FIX.lo \ + $(am__objects_9) $(am__objects_11) $(am__objects_13) \ + $(am__objects_15) +am__objects_17 = silk/fixed/LTP_analysis_filter_FIX.lo \ silk/fixed/LTP_scale_ctrl_FIX.lo silk/fixed/corrMatrix_FIX.lo \ silk/fixed/encode_frame_FIX.lo silk/fixed/find_LPC_FIX.lo \ silk/fixed/find_LTP_FIX.lo silk/fixed/find_pitch_lags_FIX.lo \ @@ -341,20 +347,19 @@ silk/fixed/pitch_analysis_core_FIX.lo \ silk/fixed/vector_ops_FIX.lo silk/fixed/schur64_FIX.lo \ silk/fixed/schur_FIX.lo -@FIXED_POINT_TRUE@am__objects_16 = $(am__objects_15) -am__objects_17 = silk/x86/NSQ_sse4_1.lo silk/x86/NSQ_del_dec_sse4_1.lo \ - silk/x86/x86_silk_map.lo silk/x86/VAD_sse4_1.lo \ - silk/x86/VQ_WMat_EC_sse4_1.lo -am__objects_18 = silk/fixed/x86/vector_ops_FIX_sse4_1.lo \ +@FIXED_POINT_TRUE@am__objects_18 = $(am__objects_17) +am__objects_19 = silk/x86/NSQ_sse4_1.lo silk/x86/NSQ_del_dec_sse4_1.lo \ + silk/x86/VAD_sse4_1.lo silk/x86/VQ_WMat_EC_sse4_1.lo +am__objects_20 = silk/fixed/x86/vector_ops_FIX_sse4_1.lo \ silk/fixed/x86/burg_modified_FIX_sse4_1.lo -@FIXED_POINT_TRUE@@HAVE_SSE4_1_TRUE@am__objects_19 = \ -@FIXED_POINT_TRUE@@HAVE_SSE4_1_TRUE@ $(am__objects_17) \ -@FIXED_POINT_TRUE@@HAVE_SSE4_1_TRUE@ $(am__objects_18) -am__objects_20 = \ +@FIXED_POINT_TRUE@@HAVE_SSE4_1_TRUE@am__objects_21 = \ +@FIXED_POINT_TRUE@@HAVE_SSE4_1_TRUE@ $(am__objects_19) \ +@FIXED_POINT_TRUE@@HAVE_SSE4_1_TRUE@ $(am__objects_20) +am__objects_22 = \ silk/fixed/arm/warped_autocorrelation_FIX_neon_intr.lo -@FIXED_POINT_TRUE@@HAVE_ARM_NEON_INTR_TRUE@am__objects_21 = \ -@FIXED_POINT_TRUE@@HAVE_ARM_NEON_INTR_TRUE@ $(am__objects_20) -am__objects_22 = silk/float/apply_sine_window_FLP.lo \ +@FIXED_POINT_TRUE@@HAVE_ARM_NEON_INTR_TRUE@am__objects_23 = \ +@FIXED_POINT_TRUE@@HAVE_ARM_NEON_INTR_TRUE@ $(am__objects_22) +am__objects_24 = silk/float/apply_sine_window_FLP.lo \ silk/float/corrMatrix_FLP.lo silk/float/encode_frame_FLP.lo \ silk/float/find_LPC_FLP.lo silk/float/find_LTP_FLP.lo \ silk/float/find_pitch_lags_FLP.lo \ @@ -375,17 +380,19 @@ silk/float/scale_copy_vector_FLP.lo \ silk/float/scale_vector_FLP.lo silk/float/schur_FLP.lo \ silk/float/sort_FLP.lo -@FIXED_POINT_FALSE@am__objects_23 = $(am__objects_22) -@FIXED_POINT_FALSE@@HAVE_SSE4_1_TRUE@am__objects_24 = \ -@FIXED_POINT_FALSE@@HAVE_SSE4_1_TRUE@ $(am__objects_17) -am__objects_25 = -am__objects_26 = silk/arm/arm_silk_map.lo \ - silk/arm/biquad_alt_neon_intr.lo \ +@FIXED_POINT_FALSE@am__objects_25 = $(am__objects_24) +@FIXED_POINT_FALSE@@HAVE_SSE4_1_TRUE@am__objects_26 = \ +@FIXED_POINT_FALSE@@HAVE_SSE4_1_TRUE@ $(am__objects_19) +am__objects_27 = silk/x86/x86_silk_map.lo
View file
_service:tar_scm:opus-1.3.1.tar.gz/README -> _service:tar_scm:opus-1.4.tar.gz/README
Changed
@@ -35,7 +35,7 @@ Ogg encapsulated Opus files and includes a number of useful features. Opus-tools can be found at: - https://git.xiph.org/?p=opus-tools.git + https://gitlab.xiph.org/xiph/opus-tools.git or on the main Opus website: https://opus-codec.org/ @@ -68,7 +68,7 @@ 1) Clone the repository: - % git clone https://git.xiph.org/opus.git + % git clone https://gitlab.xiph.org/xiph/opus.git % cd opus 2) Compiling the source
View file
_service:tar_scm:opus-1.3.1.tar.gz/aclocal.m4 -> _service:tar_scm:opus-1.4.tar.gz/aclocal.m4
Changed
@@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.)) -# Copyright (C) 2002-2017 Free Software Foundation, Inc. +# Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN(AM_AUTOMAKE_VERSION, -am__api_version='1.15' +am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if($1, 1.15.1, , +m4_if($1, 1.16.1, , AC_FATAL(Do not call $0, use AM_INIT_AUTOMAKE($1).))dnl ) @@ -51,14 +51,14 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN(AM_SET_CURRENT_AUTOMAKE_VERSION, -AM_AUTOMAKE_VERSION(1.15.1)dnl +AM_AUTOMAKE_VERSION(1.16.1)dnl m4_ifndef(AC_AUTOCONF_VERSION, m4_copy(m4_PACKAGE_VERSION, AC_AUTOCONF_VERSION))dnl _AM_AUTOCONF_VERSION(m4_defn(AC_AUTOCONF_VERSION))) # Figure out how to run the assembler. -*- Autoconf -*- -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -78,7 +78,7 @@ # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -130,7 +130,7 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2017 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -161,7 +161,7 @@ Usually this means the macro was only invoked conditionally.) fi)) -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -352,13 +352,12 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. - # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN(_AM_OUTPUT_DEPENDENCY_COMMANDS, @@ -366,49 +365,41 @@ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE($CONFIG_FILES, + *\'*, eval set x "$CONFIG_FILES", + *, set x $CONFIG_FILES) shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`AS_ECHO("$am_mf") | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME("$file")` - AS_MKDIR_P($dirpart/$fdir) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME("$am_mf")` + am_filepart=`AS_BASENAME("$am_mf")` + AM_RUN_LOG(cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) || am_rc=$? done + if test $am_rc -ne 0; then + AC_MSG_FAILURE(Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).) + fi + AS_UNSET(am_dirpart) + AS_UNSET(am_filepart) + AS_UNSET(am_mf) + AS_UNSET(am_rc) + rm -f conftest-deps.mk } )# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -417,18 +408,17 @@ # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. AC_DEFUN(AM_OUTPUT_DEPENDENCY_COMMANDS, AC_CONFIG_COMMANDS(depfiles, test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS, - AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir") -) + AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}")) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -515,8 +505,8 @@ AC_REQUIRE(AC_PROG_MKDIR_P)dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> -# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/arch.h -> _service:tar_scm:opus-1.4.tar.gz/celt/arch.h
Changed
@@ -73,6 +73,9 @@ void celt_fatal(const char *str, const char *file, int line) { fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str); +#if defined(_MSC_VER) + _set_abort_behavior( 0, _WRITE_ABORT_MSG); +#endif abort(); } #endif
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/arm/armcpu.c -> _service:tar_scm:opus-1.4.tar.gz/celt/arm/armcpu.c
Changed
@@ -93,6 +93,8 @@ #elif defined(__linux__) /* Linux based */ +#include <stdio.h> + opus_uint32 opus_cpu_capabilities(void) { opus_uint32 flags = 0; @@ -154,7 +156,7 @@ "your platform. Reconfigure with --disable-rtcd (or send patches)." #endif -int opus_select_arch(void) +static int opus_select_arch_impl(void) { opus_uint32 flags = opus_cpu_capabilities(); int arch = 0; @@ -182,4 +184,11 @@ return arch; } +int opus_select_arch(void) { + int arch = opus_select_arch_impl(); +#ifdef FUZZING + arch = rand()%(arch+1); +#endif + return arch; +} #endif
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/arm/pitch_neon_intr.c -> _service:tar_scm:opus-1.4.tar.gz/celt/arm/pitch_neon_intr.c
Changed
@@ -137,22 +137,27 @@ /* celt_inner_prod_neon_float_c_simulation() simulates the floating-point */ /* operations of celt_inner_prod_neon(), and both functions should have bit */ /* exact output. */ -static opus_val32 celt_inner_prod_neon_float_c_simulation(const opus_val16 *x, const opus_val16 *y, int N) +static opus_val32 celt_inner_prod_neon_float_c_simulation(const opus_val16 *x, const opus_val16 *y, float *err, int N) { int i; + *err = 0; opus_val32 xy, xy0 = 0, xy1 = 0, xy2 = 0, xy3 = 0; for (i = 0; i < N - 3; i += 4) { xy0 = MAC16_16(xy0, xi + 0, yi + 0); xy1 = MAC16_16(xy1, xi + 1, yi + 1); xy2 = MAC16_16(xy2, xi + 2, yi + 2); xy3 = MAC16_16(xy3, xi + 3, yi + 3); + *err += ABS32(xy0)+ABS32(xy1)+ABS32(xy2)+ABS32(xy3); } xy0 += xy2; xy1 += xy3; xy = xy0 + xy1; + *err += ABS32(xy1)+ABS32(xy0)+ABS32(xy); for (; i < N; i++) { xy = MAC16_16(xy, xi, yi); + *err += ABS32(xy); } + *err = *err*2e-7 + N*1e-37; return xy; } @@ -160,32 +165,10 @@ /* operations of dual_inner_prod_neon(), and both functions should have bit */ /* exact output. */ static void dual_inner_prod_neon_float_c_simulation(const opus_val16 *x, const opus_val16 *y01, const opus_val16 *y02, - int N, opus_val32 *xy1, opus_val32 *xy2) + int N, opus_val32 *xy1, opus_val32 *xy2, float *err) { - int i; - opus_val32 xy01, xy02, xy01_0 = 0, xy01_1 = 0, xy01_2 = 0, xy01_3 = 0, xy02_0 = 0, xy02_1 = 0, xy02_2 = 0, xy02_3 = 0; - for (i = 0; i < N - 3; i += 4) { - xy01_0 = MAC16_16(xy01_0, xi + 0, y01i + 0); - xy01_1 = MAC16_16(xy01_1, xi + 1, y01i + 1); - xy01_2 = MAC16_16(xy01_2, xi + 2, y01i + 2); - xy01_3 = MAC16_16(xy01_3, xi + 3, y01i + 3); - xy02_0 = MAC16_16(xy02_0, xi + 0, y02i + 0); - xy02_1 = MAC16_16(xy02_1, xi + 1, y02i + 1); - xy02_2 = MAC16_16(xy02_2, xi + 2, y02i + 2); - xy02_3 = MAC16_16(xy02_3, xi + 3, y02i + 3); - } - xy01_0 += xy01_2; - xy02_0 += xy02_2; - xy01_1 += xy01_3; - xy02_1 += xy02_3; - xy01 = xy01_0 + xy01_1; - xy02 = xy02_0 + xy02_1; - for (; i < N; i++) { - xy01 = MAC16_16(xy01, xi, y01i); - xy02 = MAC16_16(xy02, xi, y02i); - } - *xy1 = xy01; - *xy2 = xy02; + *xy1 = celt_inner_prod_neon_float_c_simulation(x, y01, &err0, N); + *xy2 = celt_inner_prod_neon_float_c_simulation(x, y02, &err1, N); } #endif /* OPUS_CHECK_ASM */ @@ -225,7 +208,12 @@ } #ifdef OPUS_CHECK_ASM - celt_assert(ABS32(celt_inner_prod_neon_float_c_simulation(x, y, N) - xy) <= VERY_SMALL); + { + float err, res; + res = celt_inner_prod_neon_float_c_simulation(x, y, &err, N); + /*if (ABS32(res - xy) > err) fprintf(stderr, "%g %g %g\n", res, xy, err);*/ + celt_assert(ABS32(res - xy) <= err); + } #endif return xy; @@ -280,9 +268,12 @@ #ifdef OPUS_CHECK_ASM { opus_val32 xy1_c, xy2_c; - dual_inner_prod_neon_float_c_simulation(x, y01, y02, N, &xy1_c, &xy2_c); - celt_assert(ABS32(xy1_c - *xy1) <= VERY_SMALL); - celt_assert(ABS32(xy2_c - *xy2) <= VERY_SMALL); + float err2; + dual_inner_prod_neon_float_c_simulation(x, y01, y02, N, &xy1_c, &xy2_c, err); + /*if (ABS32(xy1_c - *xy1) > err0) fprintf(stderr, "dual1 fail: %g %g %g\n", xy1_c, *xy1, err0); + if (ABS32(xy2_c - *xy2) > err1) fprintf(stderr, "dual2 fail: %g %g %g\n", xy2_c, *xy2, err1);*/ + celt_assert(ABS32(xy1_c - *xy1) <= err0); + celt_assert(ABS32(xy2_c - *xy2) <= err1); } #endif }
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/bands.c -> _service:tar_scm:opus-1.4.tar.gz/celt/bands.c
Changed
@@ -901,7 +901,7 @@ sctx->itheta = itheta; sctx->qalloc = qalloc; } -static unsigned quant_band_n1(struct band_ctx *ctx, celt_norm *X, celt_norm *Y, int b, +static unsigned quant_band_n1(struct band_ctx *ctx, celt_norm *X, celt_norm *Y, celt_norm *lowband_out) { int c; @@ -926,7 +926,6 @@ sign = ec_dec_bits(ec, 1); } ctx->remaining_bits -= 1<<BITRES; - b-=1<<BITRES; } if (ctx->resynth) x0 = sign ? -NORM_SCALING : NORM_SCALING; @@ -1134,7 +1133,7 @@ /* Special case for one sample */ if (N==1) { - return quant_band_n1(ctx, X, NULL, b, lowband_out); + return quant_band_n1(ctx, X, NULL, lowband_out); } if (tf_change>0) @@ -1256,7 +1255,7 @@ /* Special case for one sample */ if (N==1) { - return quant_band_n1(ctx, X, Y, b, lowband_out); + return quant_band_n1(ctx, X, Y, lowband_out); } orig_fill = fill; @@ -1381,6 +1380,7 @@ return cm; } +#ifndef DISABLE_UPDATE_DRAFT static void special_hybrid_folding(const CELTMode *m, celt_norm *norm, celt_norm *norm2, int start, int M, int dual_stereo) { int n1, n2; @@ -1393,6 +1393,7 @@ if (dual_stereo) OPUS_COPY(&norm2n1, &norm22*n1 - n2, n2-n1); } +#endif void quant_all_bands(int encode, const CELTMode *m, int start, int end, celt_norm *X_, celt_norm *Y_, unsigned char *collapse_masks,
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/celt_decoder.c -> _service:tar_scm:opus-1.4.tar.gz/celt/celt_decoder.c
Changed
@@ -90,7 +90,7 @@ opus_uint32 rng; int error; int last_pitch_index; - int loss_count; + int loss_duration; int skip_plc; int postfilter_period; int postfilter_period_old; @@ -117,13 +117,19 @@ #ifndef CUSTOM_MODES celt_assert(st->mode == opus_custom_mode_create(48000, 960, NULL)); celt_assert(st->overlap == 120); + celt_assert(st->end <= 21); +#else +/* From Section 4.3 in the spec: "The normal CELT layer uses 21 of those bands, + though Opus Custom (see Section 6.2) may use a different number of bands" + + Check if it's within the maximum number of Bark frequency bands instead */ + celt_assert(st->end <= 25); #endif celt_assert(st->channels == 1 || st->channels == 2); celt_assert(st->stream_channels == 1 || st->stream_channels == 2); celt_assert(st->downsample > 0); celt_assert(st->start == 0 || st->start == 17); celt_assert(st->start < st->end); - celt_assert(st->end <= 21); #ifdef OPUS_ARCHMASK celt_assert(st->arch >= 0); celt_assert(st->arch <= OPUS_ARCHMASK); @@ -506,7 +512,7 @@ int nbEBands; int overlap; int start; - int loss_count; + int loss_duration; int noise_based; const opus_int16 *eBands; SAVE_STACK; @@ -526,9 +532,9 @@ oldLogE2 = oldLogE + 2*nbEBands; backgroundLogE = oldLogE2 + 2*nbEBands; - loss_count = st->loss_count; + loss_duration = st->loss_duration; start = st->start; - noise_based = loss_count >= 5 || start != 0 || st->skip_plc; + noise_based = loss_duration >= 40 || start != 0 || st->skip_plc; if (noise_based) { /* Noise-based PLC/CNG */ @@ -551,9 +557,13 @@ #else ALLOC(X, C*N, celt_norm); /**< Interleaved normalised MDCTs */ #endif + c=0; do { + OPUS_MOVE(decode_memc, decode_memc+N, + DECODE_BUFFER_SIZE-N+(overlap>>1)); + } while (++c<C); /* Energy decay */ - decay = loss_count==0 ? QCONST16(1.5f, DB_SHIFT) : QCONST16(.5f, DB_SHIFT); + decay = loss_duration==0 ? QCONST16(1.5f, DB_SHIFT) : QCONST16(.5f, DB_SHIFT); c=0; do { for (i=start;i<end;i++) @@ -579,11 +589,6 @@ } st->rng = seed; - c=0; do { - OPUS_MOVE(decode_memc, decode_memc+N, - DECODE_BUFFER_SIZE-N+(overlap>>1)); - } while (++c<C); - celt_synthesis(mode, X, out_syn, oldBandE, start, effEnd, C, C, 0, LM, st->downsample, 0, st->arch); } else { int exc_length; @@ -596,7 +601,7 @@ VARDECL(opus_val16, _exc); VARDECL(opus_val16, fir_tmp); - if (loss_count == 0) + if (loss_duration == 0) { st->last_pitch_index = pitch_index = celt_plc_pitch_search(decode_mem, C, st->arch); } else { @@ -624,9 +629,9 @@ buf = decode_memc; for (i=0;i<MAX_PERIOD+LPC_ORDER;i++) - exci-LPC_ORDER = ROUND16(bufDECODE_BUFFER_SIZE-MAX_PERIOD-LPC_ORDER+i, SIG_SHIFT); + exci-LPC_ORDER = SROUND16(bufDECODE_BUFFER_SIZE-MAX_PERIOD-LPC_ORDER+i, SIG_SHIFT); - if (loss_count == 0) + if (loss_duration == 0) { opus_val32 acLPC_ORDER+1; /* Compute LPC coefficients for the last MAX_PERIOD samples before @@ -726,7 +731,7 @@ excextrapolation_offset+j)), SIG_SHIFT); /* Compute the energy of the previously decoded signal whose excitation we're copying. */ - tmp = ROUND16( + tmp = SROUND16( bufDECODE_BUFFER_SIZE-MAX_PERIOD-N+extrapolation_offset+j, SIG_SHIFT); S1 += SHR32(MULT16_16(tmp, tmp), 10); @@ -736,7 +741,7 @@ /* Copy the last decoded samples (prior to the overlap region) to synthesis filter memory so we can have a continuous signal. */ for (i=0;i<LPC_ORDER;i++) - lpc_memi = ROUND16(bufDECODE_BUFFER_SIZE-N-1-i, SIG_SHIFT); + lpc_memi = SROUND16(bufDECODE_BUFFER_SIZE-N-1-i, SIG_SHIFT); /* Apply the synthesis filter to convert the excitation back into the signal domain. */ celt_iir(buf+DECODE_BUFFER_SIZE-N, lpc+c*LPC_ORDER, @@ -755,7 +760,7 @@ opus_val32 S2=0; for (i=0;i<extrapolation_len;i++) { - opus_val16 tmp = ROUND16(bufDECODE_BUFFER_SIZE-N+i, SIG_SHIFT); + opus_val16 tmp = SROUND16(bufDECODE_BUFFER_SIZE-N+i, SIG_SHIFT); S2 += SHR32(MULT16_16(tmp, tmp), 10); } /* This checks for an "explosion" in the synthesis. */ @@ -806,7 +811,8 @@ } while (++c<C); } - st->loss_count = loss_count+1; + /* Saturate to soemthing large to avoid wrap-around. */ + st->loss_duration = IMIN(10000, loss_duration+(1<<LM)); RESTORE_STACK; } @@ -862,6 +868,7 @@ int nbEBands; int overlap; const opus_int16 *eBands; + opus_val16 max_background_increase; ALLOC_STACK; VALIDATE_CELT_DECODER(st); @@ -936,7 +943,7 @@ /* Check if there are at least two packets received consecutively before * turning on the pitch-based PLC */ - st->skip_plc = st->loss_count != 0; + st->skip_plc = st->loss_duration != 0; if (dec == NULL) { @@ -1134,25 +1141,21 @@ if (C==1) OPUS_COPY(&oldBandEnbEBands, oldBandE, nbEBands); - /* In case start or end were to change */ if (!isTransient) { - opus_val16 max_background_increase; OPUS_COPY(oldLogE2, oldLogE, 2*nbEBands); OPUS_COPY(oldLogE, oldBandE, 2*nbEBands); - /* In normal circumstances, we only allow the noise floor to increase by - up to 2.4 dB/second, but when we're in DTX, we allow up to 6 dB - increase for each update.*/ - if (st->loss_count < 10) - max_background_increase = M*QCONST16(0.001f,DB_SHIFT); - else - max_background_increase = QCONST16(1.f,DB_SHIFT); - for (i=0;i<2*nbEBands;i++) - backgroundLogEi = MIN16(backgroundLogEi + max_background_increase, oldBandEi); } else { for (i=0;i<2*nbEBands;i++) oldLogEi = MIN16(oldLogEi, oldBandEi); } + /* In normal circumstances, we only allow the noise floor to increase by + up to 2.4 dB/second, but when we're in DTX we give the weight of + all missing packets to the update packet. */ + max_background_increase = IMIN(160, st->loss_duration+M)*QCONST16(0.001f,DB_SHIFT); + for (i=0;i<2*nbEBands;i++) + backgroundLogEi = MIN16(backgroundLogEi + max_background_increase, oldBandEi); + /* In case start or end were to change */ c=0; do { for (i=0;i<start;i++) @@ -1169,7 +1172,7 @@ st->rng = dec->rng; deemphasis(out_syn, pcm, N, CC, st->downsample, mode->preemph, st->preemph_memD, accum); - st->loss_count = 0; + st->loss_duration = 0; RESTORE_STACK; if (ec_tell(dec) > 8*len) return OPUS_INTERNAL_ERROR;
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/celt_encoder.c -> _service:tar_scm:opus-1.4.tar.gz/celt/celt_encoder.c
Changed
@@ -1571,7 +1571,7 @@ (tmp+4*mode->Fs)/(8*mode->Fs)-!!st->signalling)); effectiveBytes = nbCompressedBytes - nbFilledBytes; } - equiv_rate = ((opus_int32)nbCompressedBytes*8*50 >> (3-LM)) - (40*C+20)*((400>>LM) - 50); + equiv_rate = ((opus_int32)nbCompressedBytes*8*50 << (3-LM)) - (40*C+20)*((400>>LM) - 50); if (st->bitrate != OPUS_BITRATE_MAX) equiv_rate = IMIN(equiv_rate, st->bitrate - (40*C+20)*((400>>LM) - 50)); @@ -1719,8 +1719,11 @@ compute_mdcts(mode, 0, in, freq, C, CC, LM, st->upsample, st->arch); compute_band_energies(mode, freq, bandE, effEnd, C, LM, st->arch); amp2Log2(mode, effEnd, end, bandE, bandLogE2, C); - for (i=0;i<C*nbEBands;i++) - bandLogE2i += HALF16(SHL16(LM, DB_SHIFT)); + for (c=0;c<C;c++) + { + for (i=0;i<end;i++) + bandLogE2nbEBands*c+i += HALF16(SHL16(LM, DB_SHIFT)); + } } compute_mdcts(mode, shortBlocks, in, freq, C, CC, LM, st->upsample, st->arch); @@ -1856,8 +1859,11 @@ compute_band_energies(mode, freq, bandE, effEnd, C, LM, st->arch); amp2Log2(mode, effEnd, end, bandE, bandLogE, C); /* Compensate for the scaling of short vs long mdcts */ - for (i=0;i<C*nbEBands;i++) - bandLogE2i += HALF16(SHL16(LM, DB_SHIFT)); + for (c=0;c<C;c++) + { + for (i=0;i<end;i++) + bandLogE2nbEBands*c+i += HALF16(SHL16(LM, DB_SHIFT)); + } tf_estimate = QCONST16(.2f,14); } }
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/celt_lpc.c -> _service:tar_scm:opus-1.4.tar.gz/celt/celt_lpc.c
Changed
@@ -50,17 +50,21 @@ #endif OPUS_CLEAR(lpc, p); +#ifdef FIXED_POINT if (ac0 != 0) +#else + if (ac0 > 1e-10f) +#endif { for (i = 0; i < p; i++) { /* Sum up this iteration's reflection coefficient */ opus_val32 rr = 0; for (j = 0; j < i; j++) rr += MULT32_32_Q31(lpcj,aci - j); - rr += SHR32(aci + 1,3); - r = -frac_div32(SHL32(rr,3), error); + rr += SHR32(aci + 1,6); + r = -frac_div32(SHL32(rr,6), error); /* Update LPC coefficients and total error */ - lpci = SHR32(r,3); + lpci = SHR32(r,6); for (j = 0; j < (i+1)>>1; j++) { opus_val32 tmp1, tmp2; @@ -73,17 +77,61 @@ error = error - MULT32_32_Q31(MULT32_32_Q31(r,r),error); /* Bail out once we get 30 dB gain */ #ifdef FIXED_POINT - if (error<SHR32(ac0,10)) + if (error<=SHR32(ac0,10)) break; #else - if (error<.001f*ac0) + if (error<=.001f*ac0) break; #endif } } #ifdef FIXED_POINT - for (i=0;i<p;i++) - _lpci = ROUND16(lpci,16); + { + /* Convert the int32 lpcs to int16 and ensure there are no wrap-arounds. + This reuses the logic in silk_LPC_fit() and silk_bwexpander_32(). Any bug + fixes should also be applied there. */ + int iter, idx = 0; + opus_val32 maxabs, absval, chirp_Q16, chirp_minus_one_Q16; + + for (iter = 0; iter < 10; iter++) { + maxabs = 0; + for (i = 0; i < p; i++) { + absval = ABS32(lpci); + if (absval > maxabs) { + maxabs = absval; + idx = i; + } + } + maxabs = PSHR32(maxabs, 13); /* Q25->Q12 */ + + if (maxabs > 32767) { + maxabs = MIN32(maxabs, 163838); + chirp_Q16 = QCONST32(0.999, 16) - DIV32(SHL32(maxabs - 32767, 14), + SHR32(MULT32_32_32(maxabs, idx + 1), 2)); + chirp_minus_one_Q16 = chirp_Q16 - 65536; + + /* Apply bandwidth expansion. */ + for (i = 0; i < p - 1; i++) { + lpci = MULT32_32_Q16(chirp_Q16, lpci); + chirp_Q16 += PSHR32(MULT32_32_32(chirp_Q16, chirp_minus_one_Q16), 16); + } + lpcp - 1 = MULT32_32_Q16(chirp_Q16, lpcp - 1); + } else { + break; + } + } + + if (iter == 10) { + /* If the coeffs still do not fit into the 16 bit range after 10 iterations, + fall back to the A(z)=1 filter. */ + OPUS_CLEAR(lpc, p); + _lpc0 = 4096; /* Q12 */ + } else { + for (i = 0; i < p; i++) { + _lpci = EXTRACT16(PSHR32(lpci, 13)); /* Q25->Q12 */ + } + } + } #endif } @@ -111,17 +159,17 @@ sum2 = SHL32(EXTEND32(xi+2), SIG_SHIFT); sum3 = SHL32(EXTEND32(xi+3), SIG_SHIFT); xcorr_kernel(rnum, x+i-ord, sum, ord, arch); - yi = ROUND16(sum0, SIG_SHIFT); - yi+1 = ROUND16(sum1, SIG_SHIFT); - yi+2 = ROUND16(sum2, SIG_SHIFT); - yi+3 = ROUND16(sum3, SIG_SHIFT); + yi = SROUND16(sum0, SIG_SHIFT); + yi+1 = SROUND16(sum1, SIG_SHIFT); + yi+2 = SROUND16(sum2, SIG_SHIFT); + yi+3 = SROUND16(sum3, SIG_SHIFT); } for (;i<N;i++) { opus_val32 sum = SHL32(EXTEND32(xi), SIG_SHIFT); for (j=0;j<ord;j++) sum = MAC16_16(sum,rnumj,xi+j-ord); - yi = ROUND16(sum, SIG_SHIFT); + yi = SROUND16(sum, SIG_SHIFT); } RESTORE_STACK; }
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/cpu_support.h -> _service:tar_scm:opus-1.4.tar.gz/celt/cpu_support.h
Changed
@@ -43,10 +43,11 @@ */ #define OPUS_ARCHMASK 3 -#elif (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(OPUS_X86_PRESUME_SSE)) || \ +#elif defined(OPUS_HAVE_RTCD) && \ + ((defined(OPUS_X86_MAY_HAVE_SSE) && !defined(OPUS_X86_PRESUME_SSE)) || \ (defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(OPUS_X86_PRESUME_SSE2)) || \ (defined(OPUS_X86_MAY_HAVE_SSE4_1) && !defined(OPUS_X86_PRESUME_SSE4_1)) || \ - (defined(OPUS_X86_MAY_HAVE_AVX) && !defined(OPUS_X86_PRESUME_AVX)) + (defined(OPUS_X86_MAY_HAVE_AVX) && !defined(OPUS_X86_PRESUME_AVX))) #include "x86/x86cpu.h" /* We currently support 5 x86 variants:
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/ecintrin.h -> _service:tar_scm:opus-1.4.tar.gz/celt/ecintrin.h
Changed
@@ -49,7 +49,11 @@ This macro should only be used for implementing ec_ilog(), if it is defined. All other code should use EC_ILOG() instead.*/ #if defined(_MSC_VER) && (_MSC_VER >= 1400) +#if defined(_MSC_VER) && (_MSC_VER >= 1910) +# include <intrin0.h> /* Improve compiler throughput. */ +#else # include <intrin.h> +#endif /*In _DEBUG mode this is not an intrinsic by default.*/ # pragma intrinsic(_BitScanReverse)
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/fixed_debug.h -> _service:tar_scm:opus-1.4.tar.gz/celt/fixed_debug.h
Changed
@@ -167,7 +167,7 @@ #define SHL16(a, shift) SHL16_(a, shift, __FILE__, __LINE__) static OPUS_INLINE short SHL16_(int a, int shift, char *file, int line) { - int res; + opus_int32 res; if (!VERIFY_SHORT(a) || !VERIFY_SHORT(shift)) { fprintf (stderr, "SHL16: inputs are not short: %d %d in %s: line %d\n", a, shift, file, line); @@ -175,7 +175,7 @@ celt_assert(0); #endif } - res = a<<shift; + res = (opus_int32)((opus_uint32)a<<shift); if (!VERIFY_SHORT(res)) { fprintf (stderr, "SHL16: output is not short: %d in %s: line %d\n", res, file, line); @@ -214,15 +214,15 @@ opus_int64 res; if (!VERIFY_INT(a) || !VERIFY_SHORT(shift)) { - fprintf (stderr, "SHL32: inputs are not int: %lld %d in %s: line %d\n", a, shift, file, line); + fprintf (stderr, "SHL32: inputs are not int: %lld %d in %s: line %d\n", (long long)a, shift, file, line); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif } - res = a<<shift; + res = (opus_int64)((opus_uint64)a<<shift); if (!VERIFY_INT(res)) { - fprintf (stderr, "SHL32: output is not int: %lld<<%d = %lld in %s: line %d\n", a, shift, res, file, line); + fprintf (stderr, "SHL32: output is not int: %lld<<%d = %lld in %s: line %d\n", (long long)a, shift, (long long)res, file, line); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif @@ -339,7 +339,7 @@ opus_uint64 res; if (!VERIFY_UINT(a) || !VERIFY_UINT(b)) { - fprintf (stderr, "UADD32: inputs are not uint32: %llu %llu in %s: line %d\n", a, b, file, line); + fprintf (stderr, "UADD32: inputs are not uint32: %llu %llu in %s: line %d\n", (unsigned long long)a, (unsigned long long)b, file, line); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif @@ -347,7 +347,7 @@ res = a+b; if (!VERIFY_UINT(res)) { - fprintf (stderr, "UADD32: output is not uint32: %llu in %s: line %d\n", res, file, line); + fprintf (stderr, "UADD32: output is not uint32: %llu in %s: line %d\n", (unsigned long long)res, file, line); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif @@ -363,14 +363,14 @@ opus_uint64 res; if (!VERIFY_UINT(a) || !VERIFY_UINT(b)) { - fprintf (stderr, "USUB32: inputs are not uint32: %llu %llu in %s: line %d\n", a, b, file, line); + fprintf (stderr, "USUB32: inputs are not uint32: %llu %llu in %s: line %d\n", (unsigned long long)a, (unsigned long long)b, file, line); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif } if (a<b) { - fprintf (stderr, "USUB32: inputs underflow: %llu < %llu in %s: line %d\n", a, b, file, line); + fprintf (stderr, "USUB32: inputs underflow: %llu < %llu in %s: line %d\n", (unsigned long long)a, (unsigned long long)b, file, line); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif @@ -378,7 +378,7 @@ res = a-b; if (!VERIFY_UINT(res)) { - fprintf (stderr, "USUB32: output is not uint32: %llu - %llu = %llu in %s: line %d\n", a, b, res, file, line); + fprintf (stderr, "USUB32: output is not uint32: %llu - %llu = %llu in %s: line %d\n", (unsigned long long)a, (unsigned long long)b, (unsigned long long)res, file, line); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif @@ -410,6 +410,51 @@ return res; } +/* result fits in 32 bits */ +static OPUS_INLINE int MULT32_32_32(opus_int64 a, opus_int64 b) +{ + opus_int64 res; + if (!VERIFY_INT(a) || !VERIFY_INT(b)) + { + fprintf (stderr, "MULT32_32_32: inputs are not int: %lld %lld\n", (long long)a, (long long)b); +#ifdef FIXED_DEBUG_ASSERT + celt_assert(0); +#endif + } + res = a*b; + if (!VERIFY_INT(res)) + { + fprintf (stderr, "MULT32_32_32: output is not int: %lld\n", (long long)res); +#ifdef FIXED_DEBUG_ASSERT + celt_assert(0); +#endif + } + celt_mips+=5; + return res; +} + +static OPUS_INLINE int MULT32_32_Q16(opus_int64 a, opus_int64 b) +{ + opus_int64 res; + if (!VERIFY_INT(a) || !VERIFY_INT(b)) + { + fprintf (stderr, "MULT32_32_Q16: inputs are not int: %lld %lld\n", (long long)a, (long long)b); +#ifdef FIXED_DEBUG_ASSERT + celt_assert(0); +#endif + } + res = ((opus_int64)(a)*(opus_int64)(b)) >> 16; + if (!VERIFY_INT(res)) + { + fprintf (stderr, "MULT32_32_Q16: output is not int: %lld*%lld=%lld\n", (long long)a, (long long)b, (long long)res); +#ifdef FIXED_DEBUG_ASSERT + celt_assert(0); +#endif + } + celt_mips+=5; + return res; +} + #define MULT16_16(a, b) MULT16_16_(a, b, __FILE__, __LINE__) static OPUS_INLINE int MULT16_16_(int a, int b, char *file, int line) { @@ -446,7 +491,7 @@ celt_assert(0); #endif } - if (ABS32(b)>=((opus_val32)(1)<<(15+Q))) + if (ABS32(b)>=((opus_int64)(1)<<(16+Q))) { fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d in %s: line %d\n", Q, (int)a, (int)b, file, line); #ifdef FIXED_DEBUG_ASSERT @@ -479,7 +524,7 @@ celt_assert(0); #endif } - if (ABS32(b)>=((opus_int64)(1)<<(15+Q))) + if (ABS32(b)>=((opus_int64)(1)<<(16+Q))) { fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d in %s: line %d\n\n", Q, (int)a, (int)b,file, line); #ifdef FIXED_DEBUG_ASSERT @@ -786,6 +831,6 @@ #undef PRINT_MIPS -#define PRINT_MIPS(file) do {fprintf (file, "total complexity = %llu MIPS\n", celt_mips);} while (0); +#define PRINT_MIPS(file) do {fprintf (file, "total complexity = %llu MIPS\n", (unsigned long long)celt_mips);} while (0); #endif
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/fixed_generic.h -> _service:tar_scm:opus-1.4.tar.gz/celt/fixed_generic.h
Changed
@@ -57,6 +57,13 @@ #define MULT16_32_Q15(a,b) ADD32(SHL(MULT16_16((a),SHR((b),16)),1), SHR(MULT16_16SU((a),((b)&0x0000ffff)),15)) #endif +/** 32x32 multiplication, followed by a 16-bit shift right. Results fits in 32 bits */ +#if OPUS_FAST_INT64 +#define MULT32_32_Q16(a,b) ((opus_val32)SHR((opus_int64)(a)*(opus_int64)(b),16)) +#else +#define MULT32_32_Q16(a,b) (ADD32(ADD32(ADD32((opus_val32)(SHR32(((opus_uint32)((a)&0x0000ffff)*(opus_uint32)((b)&0x0000ffff)),16)), MULT16_16SU(SHR32(a,16),((b)&0x0000ffff))), MULT16_16SU(SHR32(b,16),((a)&0x0000ffff))), SHL32(MULT16_16(SHR32(a,16),SHR32(b,16)),16))) +#endif + /** 32x32 multiplication, followed by a 31-bit shift right. Results fits in 32 bits */ #if OPUS_FAST_INT64 #define MULT32_32_Q31(a,b) ((opus_val32)SHR((opus_int64)(a)*(opus_int64)(b),31)) @@ -102,9 +109,9 @@ #define SATURATE16(x) (EXTRACT16((x)>32767 ? 32767 : (x)<-32768 ? -32768 : (x))) -/** Shift by a and round-to-neareast 32-bit value. Result is a 16-bit value */ +/** Shift by a and round-to-nearest 32-bit value. Result is a 16-bit value */ #define ROUND16(x,a) (EXTRACT16(PSHR32((x),(a)))) -/** Shift by a and round-to-neareast 32-bit value. Result is a saturated 16-bit value */ +/** Shift by a and round-to-nearest 32-bit value. Result is a saturated 16-bit value */ #define SROUND16(x,a) EXTRACT16(SATURATE(PSHR32(x,a), 32767)); /** Divide by two */ @@ -131,6 +138,9 @@ /** 16x16 multiplication where the result fits in 16 bits */ #define MULT16_16_16(a,b) ((((opus_val16)(a))*((opus_val16)(b)))) +/** 32x32 multiplication where the result fits in 32 bits */ +#define MULT32_32_32(a,b) ((((opus_val32)(a))*((opus_val32)(b)))) + /* (opus_val32)(opus_val16) gives TI compiler a hint that it's 16x16->32 multiply */ /** 16x16 multiplication where the result fits in 32 bits */ #define MULT16_16(a,b) (((opus_val32)(opus_val16)(a))*((opus_val32)(opus_val16)(b)))
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/float_cast.h -> _service:tar_scm:opus-1.4.tar.gz/celt/float_cast.h
Changed
@@ -67,7 +67,39 @@ #include <xmmintrin.h> static OPUS_INLINE opus_int32 float2int(float x) {return _mm_cvt_ss2si(_mm_set_ss(x));} -#elif defined(HAVE_LRINTF) +#elif (defined(_MSC_VER) && _MSC_VER >= 1400) && (defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 1)) + + #include <xmmintrin.h> + static OPUS_INLINE opus_int32 float2int(float value) + { + /* _mm_load_ss will generate same code as _mm_set_ss + ** in _MSC_VER >= 1914 /02 so keep __mm_load__ss + ** for backward compatibility. + */ + return _mm_cvtss_si32(_mm_load_ss(&value)); + } + +#elif (defined(_MSC_VER) && _MSC_VER >= 1400) && defined (_M_IX86) + + #include <math.h> + + /* Win32 doesn't seem to have these functions. + ** Therefore implement OPUS_INLINE versions of these functions here. + */ + + static OPUS_INLINE opus_int32 + float2int (float flt) + { int intgr; + + _asm + { fld flt + fistp intgr + } ; + + return intgr ; + } + +#elif defined(HAVE_LRINTF) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* These defines enable functionality introduced with the 1999 ISO C ** standard. They must be defined before the inclusion of math.h to @@ -85,7 +117,7 @@ #include <math.h> #define float2int(x) lrintf(x) -#elif (defined(HAVE_LRINT)) +#elif defined(HAVE_LRINT) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define _ISOC9X_SOURCE 1 #define _ISOC99_SOURCE 1 @@ -96,32 +128,6 @@ #include <math.h> #define float2int(x) lrint(x) -#elif (defined(_MSC_VER) && _MSC_VER >= 1400) && (defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 1)) - #include <xmmintrin.h> - - static __inline long int float2int(float value) - { - return _mm_cvtss_si32(_mm_load_ss(&value)); - } -#elif (defined(_MSC_VER) && _MSC_VER >= 1400) && defined (_M_IX86) - #include <math.h> - - /* Win32 doesn't seem to have these functions. - ** Therefore implement OPUS_INLINE versions of these functions here. - */ - - static __inline long int - float2int (float flt) - { int intgr; - - _asm - { fld flt - fistp intgr - } ; - - return intgr ; - } - #else #if (defined(__GNUC__) && defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L)
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/kiss_fft.h -> _service:tar_scm:opus-1.4.tar.gz/celt/kiss_fft.h
Changed
@@ -52,6 +52,10 @@ # define kiss_fft_scalar opus_int32 # define kiss_twiddle_scalar opus_int16 +/* Some 32-bit CPUs would load/store a kiss_twiddle_cpx with a single memory + * access, and could benefit from additional alignment. + */ +# define KISS_TWIDDLE_CPX_ALIGNMENT (sizeof(opus_int32)) #else # ifndef kiss_fft_scalar @@ -62,6 +66,12 @@ # endif #endif +#if defined(__GNUC__) && defined(KISS_TWIDDLE_CPX_ALIGNMENT) +#define KISS_TWIDDLE_CPX_ALIGNED __attribute__((aligned(KISS_TWIDDLE_CPX_ALIGNMENT))) +#else +#define KISS_TWIDDLE_CPX_ALIGNED +#endif + typedef struct { kiss_fft_scalar r; kiss_fft_scalar i; @@ -70,7 +80,7 @@ typedef struct { kiss_twiddle_scalar r; kiss_twiddle_scalar i; -}kiss_twiddle_cpx; +} KISS_TWIDDLE_CPX_ALIGNED kiss_twiddle_cpx; #define MAXFACTORS 8 /* e.g. an fft of length 128 has 4 factors
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/mathops.h -> _service:tar_scm:opus-1.4.tar.gz/celt/mathops.h
Changed
@@ -137,7 +137,7 @@ } in; in.f = x; integer = (in.i>>23)-127; - in.i -= integer<<23; + in.i -= (opus_uint32)integer<<23; frac = in.f - 1.5f; frac = -0.41445418f + frac*(0.95909232f + frac*(-0.33951290f + frac*0.16541097f)); @@ -153,14 +153,14 @@ float f; opus_uint32 i; } res; - integer = floor(x); + integer = (int)floor(x); if (integer < -50) return 0; frac = x-integer; /* K0 = 1, K1 = log(2), K2 = 3-4*log(2), K3 = 3*log(2) - 2 */ res.f = 0.99992522f + frac * (0.69583354f + frac * (0.22606716f + 0.078024523f*frac)); - res.i = (res.i + (integer<<23)) & 0x7fffffff; + res.i = (res.i + ((opus_uint32)integer<<23)) & 0x7fffffff; return res.f; }
View file
_service:tar_scm:opus-1.4.tar.gz/celt/meson.build
Added
@@ -0,0 +1,69 @@ +celt_sources = sources'CELT_SOURCES' + +celt_sse_sources = sources'CELT_SOURCES_SSE' + +celt_sse2_sources = sources'CELT_SOURCES_SSE2' + +celt_sse4_1_sources = sources'CELT_SOURCES_SSE4_1' + +celt_neon_intr_sources = sources'CELT_SOURCES_ARM_NEON_INTR' + +celt_static_libs = + +if host_cpu_family in 'x86', 'x86_64' and opus_conf.has('OPUS_HAVE_RTCD') + celt_sources += sources'CELT_SOURCES_X86_RTCD' +endif + +foreach intr_name : 'sse', 'sse2', 'sse4_1', 'neon_intr' + have_intr = get_variable('have_' + intr_name) + if not have_intr + continue + endif + + intr_sources = get_variable('celt_@0@_sources'.format(intr_name)) + intr_args = get_variable('opus_@0@_args'.format(intr_name), ) + celt_static_libs += static_library('celt_' + intr_name, intr_sources, + c_args: intr_args, + include_directories: opus_includes, + install: false) +endforeach + +have_arm_intrinsics_or_asm = have_arm_ne10 +if (intrinsics_support.length() + asm_optimization.length() + inline_optimization.length()) > 0 + have_arm_intrinsics_or_asm = true +endif + +if host_cpu_family in 'arm', 'aarch64' and have_arm_intrinsics_or_asm + if opus_conf.has('OPUS_HAVE_RTCD') + celt_sources += sources'CELT_SOURCES_ARM_RTCD' + endif + if have_arm_ne10 + celt_sources += sources'CELT_SOURCES_ARM_NE10' + endif + if opus_arm_external_asm + arm2gnu = find_program('arm/arm2gnu.pl') + arm2gnu_args + celt_sources_arm_asm = configure_file(input: 'arm/celt_pitch_xcorr_arm.s', + output: '@BASENAME@-gnu.S', + command: arm2gnu + '@INPUT@', + capture: true) + celt_arm_armopts_s = configure_file(input: 'arm/armopts.s.in', + output: 'arm/armopts.s', + configuration: opus_conf) + celt_static_libs += static_library('celt-armasm', + celt_arm_armopts_s, celt_sources_arm_asm, + install: false) + endif +endif + +celt_c_args = +if host_system == 'windows' + celt_c_args += '-DDLL_EXPORT' +endif + +celt_lib = static_library('opus-celt', + celt_sources, + c_args: celt_c_args, + include_directories: opus_includes, + link_whole: celt_static_libs, + dependencies: libm, + install: false)
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/modes.c -> _service:tar_scm:opus-1.4.tar.gz/celt/modes.c
Changed
@@ -173,7 +173,10 @@ mode->nbAllocVectors = BITALLOC_SIZE; allocVectors = opus_alloc(sizeof(unsigned char)*(BITALLOC_SIZE*mode->nbEBands)); if (allocVectors==NULL) + { + mode->allocVectors = NULL; return; + } /* Check for standard mode */ if (mode->Fs == 400*(opus_int32)mode->shortMdctSize)
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/os_support.h -> _service:tar_scm:opus-1.4.tar.gz/celt/os_support.h
Changed
@@ -39,7 +39,6 @@ #include "opus_defines.h" #include <string.h> -#include <stdio.h> #include <stdlib.h> /** Opus wrapper for malloc(). To do your own dynamic allocation, all you need to do is replace this function and opus_free */
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/pitch.c -> _service:tar_scm:opus-1.4.tar.gz/celt/pitch.c
Changed
@@ -161,17 +161,26 @@ shift=0; if (C==2) shift++; -#endif for (i=1;i<len>>1;i++) - x_lpi = SHR32(HALF32(HALF32(x0(2*i-1)+x0(2*i+1))+x02*i), shift); - x_lp0 = SHR32(HALF32(HALF32(x01)+x00), shift); + x_lpi = SHR32(x0(2*i-1), shift+2) + SHR32(x0(2*i+1), shift+2) + SHR32(x02*i, shift+1); + x_lp0 = SHR32(x01, shift+2) + SHR32(x00, shift+1); if (C==2) { for (i=1;i<len>>1;i++) - x_lpi += SHR32(HALF32(HALF32(x1(2*i-1)+x1(2*i+1))+x12*i), shift); - x_lp0 += SHR32(HALF32(HALF32(x11)+x10), shift); + x_lpi += SHR32(x1(2*i-1), shift+2) + SHR32(x1(2*i+1), shift+2) + SHR32(x12*i, shift+1); + x_lp0 += SHR32(x11, shift+2) + SHR32(x10, shift+1); } - +#else + for (i=1;i<len>>1;i++) + x_lpi = .25f*x0(2*i-1) + .25f*x0(2*i+1) + .5f*x02*i; + x_lp0 = .25f*x01 + .5f*x00; + if (C==2) + { + for (i=1;i<len>>1;i++) + x_lpi += .25f*x1(2*i-1) + .25f*x1(2*i+1) + .5f*x12*i; + x_lp0 += .25f*x11 + .5f*x10; + } +#endif _celt_autocorr(x_lp, ac, NULL, 0, 4, len>>1, arch); @@ -249,7 +258,7 @@ opus_val32 maxcorr=1; #endif celt_assert(max_pitch>0); - celt_sig_assert((((unsigned char *)_x-(unsigned char *)NULL)&3)==0); + celt_sig_assert(((size_t)_x&3)==0); for (i=0;i<max_pitch-3;i+=4) { opus_val32 sum4={0,0,0,0};
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/rate.c -> _service:tar_scm:opus-1.4.tar.gz/celt/rate.c
Changed
@@ -356,6 +356,8 @@ else depth_threshold = 0; #ifdef FUZZING + (void)signalBandwidth; + (void)depth_threshold; if ((rand()&0x1) == 0) #else if (codedBands<=start+2 || (band_bits > (depth_threshold*band_width<<LM<<BITRES)>>4 && j<=signalBandwidth))
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/stack_alloc.h -> _service:tar_scm:opus-1.4.tar.gz/celt/stack_alloc.h
Changed
@@ -40,7 +40,7 @@ #endif #ifdef USE_ALLOCA -# ifdef WIN32 +# ifdef _WIN32 # include <malloc.h> # else # ifdef HAVE_ALLOCA_H @@ -102,7 +102,7 @@ #define VARDECL(type, var) type *var -# ifdef WIN32 +# ifdef _WIN32 # define ALLOC(var, size, type) var = ((type*)_alloca(sizeof(type)*(size))) # else # define ALLOC(var, size, type) var = ((type*)alloca(sizeof(type)*(size)))
View file
_service:tar_scm:opus-1.4.tar.gz/celt/tests/meson.build
Added
@@ -0,0 +1,19 @@ +tests = + 'test_unit_types', + 'test_unit_mathops', + 'test_unit_entropy', + 'test_unit_laplace', + 'test_unit_dft', + 'test_unit_mdct', + 'test_unit_rotation', + 'test_unit_cwrs32', + + +foreach test_name : tests + exe = executable(test_name, '@0@.c'.format(test_name), + include_directories : opus_includes, + link_with : celt_lib, celt_static_libs, + dependencies : libm, + install : false) + test(test_name, exe) +endforeach
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/tests/test_unit_dft.c -> _service:tar_scm:opus-1.4.tar.gz/celt/tests/test_unit_dft.c
Changed
@@ -144,8 +144,9 @@ int main(int argc,char ** argv) { + int arch; ALLOC_STACK; - int arch = opus_select_arch(); + arch = opus_select_arch(); if (argc>1) { int k;
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/tests/test_unit_entropy.c -> _service:tar_scm:opus-1.4.tar.gz/celt/tests/test_unit_entropy.c
Changed
@@ -104,7 +104,7 @@ nbits=ec_tell_frac(&enc); ec_enc_done(&enc); fprintf(stderr, - "Encoded %0.2lf bits of entropy to %0.2lf bits (%0.3lf%% wasted).\n", + "Encoded %0.2f bits of entropy to %0.2f bits (%0.3f%% wasted).\n", entropy,ldexp(nbits,-3),100*(nbits-ldexp(entropy,3))/nbits); fprintf(stderr,"Packed to %li bytes.\n",(long)ec_range_bytes(&enc)); ec_dec_init(&dec,ptr,DATA_SIZE); @@ -129,7 +129,7 @@ nbits2=ec_tell_frac(&dec); if(nbits!=nbits2){ fprintf(stderr, - "Reported number of bits used was %0.2lf, should be %0.2lf.\n", + "Reported number of bits used was %0.2f, should be %0.2f.\n", ldexp(nbits2,-3),ldexp(nbits,-3)); ret=-1; }
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/tests/test_unit_mathops.c -> _service:tar_scm:opus-1.4.tar.gz/celt/tests/test_unit_mathops.c
Changed
@@ -143,7 +143,7 @@ void testlog2(void) { float x; - for (x=0.001;x<1677700.0;x+=(x/8.0)) + for (x=0.001f;x<1677700.0;x+=(x/8.0)) { float error = fabs((1.442695040888963387*log(x))-celt_log2(x)); if (error>0.0009) @@ -157,7 +157,7 @@ void testexp2(void) { float x; - for (x=-11.0;x<24.0;x+=0.0007) + for (x=-11.0;x<24.0;x+=0.0007f) { float error = fabs(x-(1.442695040888963387*log(celt_exp2(x)))); if (error>0.0002) @@ -171,7 +171,7 @@ void testexp2log2(void) { float x; - for (x=-11.0;x<24.0;x+=0.0007) + for (x=-11.0;x<24.0;x+=0.0007f) { float error = fabs(x-(celt_log2(celt_exp2(x)))); if (error>0.001)
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/tests/test_unit_mdct.c -> _service:tar_scm:opus-1.4.tar.gz/celt/tests/test_unit_mdct.c
Changed
@@ -184,8 +184,9 @@ int main(int argc,char ** argv) { + int arch; ALLOC_STACK; - int arch = opus_select_arch(); + arch = opus_select_arch(); if (argc>1) { int k;
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/x86/celt_lpc_sse.h -> _service:tar_scm:opus-1.4.tar.gz/celt/x86/celt_lpc_sse.h
Changed
@@ -33,7 +33,6 @@ #endif #if defined(OPUS_X86_MAY_HAVE_SSE4_1) && defined(FIXED_POINT) -#define OVERRIDE_CELT_FIR void celt_fir_sse4_1( const opus_val16 *x, @@ -44,10 +43,11 @@ int arch); #if defined(OPUS_X86_PRESUME_SSE4_1) +#define OVERRIDE_CELT_FIR #define celt_fir(x, num, y, N, ord, arch) \ ((void)arch, celt_fir_sse4_1(x, num, y, N, ord, arch)) -#else +#elif defined(OPUS_HAVE_RTCD) extern void (*const CELT_FIR_IMPLOPUS_ARCHMASK + 1)( const opus_val16 *x, @@ -57,6 +57,7 @@ int ord, int arch); +#define OVERRIDE_CELT_FIR # define celt_fir(x, num, y, N, ord, arch) \ ((*CELT_FIR_IMPL(arch) & OPUS_ARCHMASK)(x, num, y, N, ord, arch))
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/x86/pitch_sse.h -> _service:tar_scm:opus-1.4.tar.gz/celt/x86/pitch_sse.h
Changed
@@ -63,7 +63,7 @@ #define xcorr_kernel(x, y, sum, len, arch) \ ((void)arch, xcorr_kernel_sse(x, y, sum, len)) -#elif (defined(OPUS_X86_MAY_HAVE_SSE4_1) && defined(FIXED_POINT)) || (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(FIXED_POINT)) +#elif defined(OPUS_HAVE_RTCD) && ((defined(OPUS_X86_MAY_HAVE_SSE4_1) && defined(FIXED_POINT)) || (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(FIXED_POINT))) extern void (*const XCORR_KERNEL_IMPLOPUS_ARCHMASK + 1)( const opus_val16 *x, @@ -91,7 +91,7 @@ int N); #endif -#if defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(FIXED_POINT) +#if defined(OPUS_X86_MAY_HAVE_SSE) && !defined(FIXED_POINT) opus_val32 celt_inner_prod_sse( const opus_val16 *x, const opus_val16 *y, @@ -115,8 +115,8 @@ ((void)arch, celt_inner_prod_sse(x, y, N)) -#elif ((defined(OPUS_X86_MAY_HAVE_SSE4_1) || defined(OPUS_X86_MAY_HAVE_SSE2)) && defined(FIXED_POINT)) || \ - (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(FIXED_POINT)) +#elif defined(OPUS_HAVE_RTCD) && (((defined(OPUS_X86_MAY_HAVE_SSE4_1) || defined(OPUS_X86_MAY_HAVE_SSE2)) && defined(FIXED_POINT)) || \ + (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(FIXED_POINT))) extern opus_val32 (*const CELT_INNER_PROD_IMPLOPUS_ARCHMASK + 1)( const opus_val16 *x,
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/x86/pitch_sse4_1.c -> _service:tar_scm:opus-1.4.tar.gz/celt/x86/pitch_sse4_1.c
Changed
@@ -117,6 +117,14 @@ __m128i sum0, sum1, sum2, sum3, vecSum; __m128i initSum; +#ifdef OPUS_CHECK_ASM + opus_val32 sum_c4; + for (j=0;j<4;j++) { + sum_cj = sumj; + } + xcorr_kernel_c(x, y, sum_c, len); +#endif + celt_assert(len >= 3); sum0 = _mm_setzero_si128(); @@ -177,19 +185,56 @@ vecSum = _mm_add_epi32(vecSum, sum2); } - for (;j<len;j++) + vecX = OP_CVTEPI16_EPI32_M64(&xlen - 4); + if (len - j == 3) { - vecX = OP_CVTEPI16_EPI32_M64(&xj + 0); - vecX0 = _mm_shuffle_epi32(vecX, 0x00); + vecX0 = _mm_shuffle_epi32(vecX, 0x55); + vecX1 = _mm_shuffle_epi32(vecX, 0xaa); + vecX2 = _mm_shuffle_epi32(vecX, 0xff); vecY0 = OP_CVTEPI16_EPI32_M64(&yj + 0); + vecY1 = OP_CVTEPI16_EPI32_M64(&yj + 1); + vecY2 = OP_CVTEPI16_EPI32_M64(&yj + 2); sum0 = _mm_mullo_epi32(vecX0, vecY0); + sum1 = _mm_mullo_epi32(vecX1, vecY1); + sum2 = _mm_mullo_epi32(vecX2, vecY2); + + vecSum = _mm_add_epi32(vecSum, sum0); + vecSum = _mm_add_epi32(vecSum, sum1); + vecSum = _mm_add_epi32(vecSum, sum2); + } + else if (len - j == 2) + { + vecX0 = _mm_shuffle_epi32(vecX, 0xaa); + vecX1 = _mm_shuffle_epi32(vecX, 0xff); + + vecY0 = OP_CVTEPI16_EPI32_M64(&yj + 0); + vecY1 = OP_CVTEPI16_EPI32_M64(&yj + 1); + + sum0 = _mm_mullo_epi32(vecX0, vecY0); + sum1 = _mm_mullo_epi32(vecX1, vecY1); + + vecSum = _mm_add_epi32(vecSum, sum0); + vecSum = _mm_add_epi32(vecSum, sum1); + } + else if (len - j == 1) + { + vecX0 = _mm_shuffle_epi32(vecX, 0xff); + + vecY0 = OP_CVTEPI16_EPI32_M64(&yj + 0); + + sum0 = _mm_mullo_epi32(vecX0, vecY0); + vecSum = _mm_add_epi32(vecSum, sum0); } initSum = _mm_loadu_si128((__m128i *)(&sum0)); initSum = _mm_add_epi32(initSum, vecSum); _mm_storeu_si128((__m128i *)sum, initSum); + +#ifdef OPUS_CHECK_ASM + celt_assert(!memcmp(sum_c, sum, sizeof(sum_c))); +#endif } #endif
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/x86/x86cpu.c -> _service:tar_scm:opus-1.4.tar.gz/celt/x86/x86cpu.c
Changed
@@ -35,11 +35,11 @@ #include "pitch.h" #include "x86cpu.h" -#if (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(OPUS_X86_PRESUME_SSE)) || \ +#if defined(OPUS_HAVE_RTCD) && \ + ((defined(OPUS_X86_MAY_HAVE_SSE) && !defined(OPUS_X86_PRESUME_SSE)) || \ (defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(OPUS_X86_PRESUME_SSE2)) || \ (defined(OPUS_X86_MAY_HAVE_SSE4_1) && !defined(OPUS_X86_PRESUME_SSE4_1)) || \ - (defined(OPUS_X86_MAY_HAVE_AVX) && !defined(OPUS_X86_PRESUME_AVX)) - + (defined(OPUS_X86_MAY_HAVE_AVX) && !defined(OPUS_X86_PRESUME_AVX))) #if defined(_MSC_VER) @@ -68,7 +68,8 @@ "=r" (CPUInfo1), "=c" (CPUInfo2), "=d" (CPUInfo3) : - "0" (InfoType) + /* We clear ECX to avoid a valgrind false-positive prior to v3.17.0. */ + "0" (InfoType), "2" (0) ); #else __asm__ __volatile__ ( @@ -77,11 +78,22 @@ "=b" (CPUInfo1), "=c" (CPUInfo2), "=d" (CPUInfo3) : - "0" (InfoType) + /* We clear ECX to avoid a valgrind false-positive prior to v3.17.0. */ + "0" (InfoType), "2" (0) ); #endif #elif defined(CPU_INFO_BY_C) - __get_cpuid(InfoType, &(CPUInfo0), &(CPUInfo1), &(CPUInfo2), &(CPUInfo3)); + /* We use __get_cpuid_count to clear ECX to avoid a valgrind false-positive + prior to v3.17.0.*/ + if (!__get_cpuid_count(InfoType, 0, &(CPUInfo0), &(CPUInfo1), &(CPUInfo2), &(CPUInfo3))) { + /* Our function cannot fail, but __get_cpuid{_count} can. + Returning all zeroes will effectively disable all SIMD, which is + what we want on CPUs that don't support CPUID. */ + CPUInfo3 = CPUInfo2 = CPUInfo1 = CPUInfo0 = 0; + } +#else +# error "Configured to use x86 RTCD, but no CPU detection method available. " \ + "Reconfigure with --disable-rtcd (or send patches)." #endif } @@ -98,7 +110,7 @@ static void opus_cpu_feature_check(CPU_Feature *cpu_feature) { - unsigned int info4 = {0}; + unsigned int info4; unsigned int nIds = 0; cpuid(info, 0); @@ -119,7 +131,7 @@ } } -int opus_select_arch(void) +static int opus_select_arch_impl(void) { CPU_Feature cpu_feature; int arch; @@ -154,4 +166,13 @@ return arch; } +int opus_select_arch(void) { + int arch = opus_select_arch_impl(); +#ifdef FUZZING + /* Randomly downgrade the architecture. */ + arch = rand()%(arch+1); +#endif + return arch; +} + #endif
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt/x86/x86cpu.h -> _service:tar_scm:opus-1.4.tar.gz/celt/x86/x86cpu.h
Changed
@@ -56,40 +56,18 @@ int opus_select_arch(void); # endif -/*gcc appears to emit MOVDQA's to load the argument of an _mm_cvtepi8_epi32() - or _mm_cvtepi16_epi32() when optimizations are disabled, even though the - actual PMOVSXWD instruction takes an m32 or m64. Unlike a normal memory - reference, these require 16-byte alignment and load a full 16 bytes (instead - of 4 or 8), possibly reading out of bounds. - - We can insert an explicit MOVD or MOVQ using _mm_cvtsi32_si128() or - _mm_loadl_epi64(), which should have the same semantics as an m32 or m64 - reference in the PMOVSXWD instruction itself, but gcc is not smart enough to - optimize this out when optimizations ARE enabled. - - Clang, in contrast, requires us to do this always for _mm_cvtepi8_epi32 - (which is fair, since technically the compiler is always allowed to do the - dereference before invoking the function implementing the intrinsic). - However, it is smart enough to eliminate the extra MOVD instruction. - For _mm_cvtepi16_epi32, it does the right thing, though does *not* optimize out - the extra MOVQ if it's specified explicitly */ - -# if defined(__clang__) || !defined(__OPTIMIZE__) -# define OP_CVTEPI8_EPI32_M32(x) \ - (_mm_cvtepi8_epi32(_mm_cvtsi32_si128(*(int *)(x)))) -# else -# define OP_CVTEPI8_EPI32_M32(x) \ - (_mm_cvtepi8_epi32(*(__m128i *)(x))) -#endif - -/* similar reasoning about the instruction sequence as in the 32-bit macro above, - */ -# if defined(__clang__) || !defined(__OPTIMIZE__) -# define OP_CVTEPI16_EPI32_M64(x) \ +/*MOVD should not impose any alignment restrictions, but the C standard does, + and UBSan will report errors if we actually make unaligned accesses. + Use this to work around those restrictions (which should hopefully all get + optimized to a single MOVD instruction).*/ +#define OP_LOADU_EPI32(x) \ + (int)((*(unsigned char *)(x) | *((unsigned char *)(x) + 1) << 8U |\ + *((unsigned char *)(x) + 2) << 16U | (opus_uint32)*((unsigned char *)(x) + 3) << 24U)) + +#define OP_CVTEPI8_EPI32_M32(x) \ + (_mm_cvtepi8_epi32(_mm_cvtsi32_si128(OP_LOADU_EPI32(x)))) + +#define OP_CVTEPI16_EPI32_M64(x) \ (_mm_cvtepi16_epi32(_mm_loadl_epi64((__m128i *)(x)))) -# else -# define OP_CVTEPI16_EPI32_M64(x) \ - (_mm_cvtepi16_epi32(*(__m128i *)(x))) -# endif #endif
View file
_service:tar_scm:opus-1.3.1.tar.gz/celt_sources.mk -> _service:tar_scm:opus-1.4.tar.gz/celt_sources.mk
Changed
@@ -18,9 +18,11 @@ celt/rate.c \ celt/vq.c -CELT_SOURCES_SSE = \ +CELT_SOURCES_X86_RTCD = \ celt/x86/x86cpu.c \ -celt/x86/x86_celt_map.c \ +celt/x86/x86_celt_map.c + +CELT_SOURCES_SSE = \ celt/x86/pitch_sse.c CELT_SOURCES_SSE2 = \ @@ -31,7 +33,7 @@ celt/x86/celt_lpc_sse4_1.c \ celt/x86/pitch_sse4_1.c -CELT_SOURCES_ARM = \ +CELT_SOURCES_ARM_RTCD = \ celt/arm/armcpu.c \ celt/arm/arm_celt_map.c
View file
_service:tar_scm:opus-1.4.tar.gz/cmake
Added
+(directory)
View file
_service:tar_scm:opus-1.4.tar.gz/cmake/CFeatureCheck.cmake
Added
@@ -0,0 +1,39 @@ +# - Compile and run code to check for C features +# +# This functions compiles a source file under the `cmake` folder +# and adds the corresponding `HAVE_FILENAME` flag to the CMake +# environment +# +# c_feature_check(<FLAG> <VARIANT>) +# +# - Example +# +# include(CFeatureCheck) +# c_feature_check(VLA) + +if(__c_feature_check) + return() +endif() +set(__c_feature_check INCLUDED) + +function(c_feature_check FILE) + string(TOLOWER ${FILE} FILE) + string(TOUPPER ${FILE} VAR) + string(TOUPPER "${VAR}_SUPPORTED" FEATURE) + if (DEFINED ${VAR}_SUPPORTED) + set(${VAR}_SUPPORTED 1 PARENT_SCOPE) + return() + endif() + + if (NOT DEFINED COMPILE_${FEATURE}) + message(STATUS "Performing Test ${FEATURE}") + try_compile(COMPILE_${FEATURE} ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/cmake/${FILE}.c) + endif() + + if(COMPILE_${FEATURE}) + message(STATUS "Performing Test ${FEATURE} -- success") + set(${VAR}_SUPPORTED 1 PARENT_SCOPE) + else() + message(STATUS "Performing Test ${FEATURE} -- failed to compile") + endif() +endfunction()
View file
_service:tar_scm:opus-1.4.tar.gz/cmake/OpusBuildtype.cmake
Added
@@ -0,0 +1,27 @@ +# Set a default build type if none was specified +if(__opus_buildtype) + return() +endif() +set(__opus_buildtype INCLUDED) + +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + if(CMAKE_C_FLAGS) + message(STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS}) + else() + set(default_build_type "Release") + message( + STATUS + "Setting build type to '${default_build_type}' as none was specified and no CFLAGS was exported." + ) + set(CMAKE_BUILD_TYPE "${default_build_type}" + CACHE STRING "Choose the type of build." + FORCE) + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE + PROPERTY STRINGS + "Debug" + "Release" + "MinSizeRel" + "RelWithDebInfo") + endif() +endif()
View file
_service:tar_scm:opus-1.4.tar.gz/cmake/OpusConfig.cmake
Added
@@ -0,0 +1,115 @@ +if(__opus_config) + return() +endif() +set(__opus_config INCLUDED) + +include(OpusFunctions) + +configure_file(cmake/config.h.cmake.in config.h @ONLY) +add_definitions(-DHAVE_CONFIG_H) + +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +if(MSVC) + # For compilers that have no notion of a C standard level, + # such as Microsoft Visual C++ before VS 16.7, + # this property has no effect. + set(CMAKE_C_STANDARD 11) +else() + set(CMAKE_C_STANDARD 99) +endif() + +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +endif() + +include(CFeatureCheck) +c_feature_check(VLA) + +include(CheckIncludeFile) +check_include_file(alloca.h HAVE_ALLOCA_H) + +include(CheckSymbolExists) +if(HAVE_ALLOCA_H) + add_definitions(-DHAVE_ALLOCA_H) + check_symbol_exists(alloca "alloca.h" USE_ALLOCA_SUPPORTED) +else() + check_symbol_exists(alloca "stdlib.h;malloc.h" USE_ALLOCA_SUPPORTED) +endif() + +include(CMakePushCheckState) +cmake_push_check_state(RESET) +include(CheckLibraryExists) +check_library_exists(m floor "" HAVE_LIBM) +if(HAVE_LIBM) + list(APPEND OPUS_REQUIRED_LIBRARIES m) + set(CMAKE_REQUIRED_LIBRARIES m) +endif() + +check_symbol_exists(lrintf "math.h" HAVE_LRINTF) +check_symbol_exists(lrint "math.h" HAVE_LRINT) +cmake_pop_check_state() + +if(CMAKE_SYSTEM_PROCESSOR MATCHES "(i0-986|x86|X86|amd64|AMD64|x86_64)") + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(OPUS_CPU_X64 1) + else() + set(OPUS_CPU_X86 1) + endif() +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(arm|aarch64)") + set(OPUS_CPU_ARM 1) +endif() + +if(NOT OPUS_DISABLE_INTRINSICS) + opus_supports_cpu_detection(RUNTIME_CPU_CAPABILITY_DETECTION) +endif() + +if(OPUS_CPU_X86 OR OPUS_CPU_X64 AND NOT OPUS_DISABLE_INTRINSICS) + opus_detect_sse(COMPILER_SUPPORT_SIMD) +elseif(OPUS_CPU_ARM AND NOT OPUS_DISABLE_INTRINSICS) + opus_detect_neon(COMPILER_SUPPORT_NEON) + if(COMPILER_SUPPORT_NEON) + option(OPUS_USE_NEON "Option to enable NEON" ON) + option(OPUS_MAY_HAVE_NEON "Does runtime check for neon support" ON) + option(OPUS_PRESUME_NEON "Assume target CPU has NEON support" OFF) + if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + set(OPUS_PRESUME_NEON ON) + elseif(CMAKE_SYSTEM_NAME MATCHES "iOS") + set(OPUS_PRESUME_NEON ON) + endif() + endif() +endif() + +if(MSVC) + check_flag(FAST_MATH /fp:fast) + check_flag(STACK_PROTECTOR /GS) + check_flag(STACK_PROTECTOR_DISABLED /GS-) +else() + check_flag(FAST_MATH -ffast-math) + check_flag(STACK_PROTECTOR -fstack-protector-strong) + check_flag(HIDDEN_VISIBILITY -fvisibility=hidden) + set(FORTIFY_SOURCE_SUPPORTED 1) +endif() + +if(MINGW) + # For MINGW we need to link ssp lib for security features such as + # stack protector and fortify_sources + check_library_exists(ssp __stack_chk_fail "" HAVE_LIBSSP) + if(NOT HAVE_LIBSSP) + message(WARNING "Could not find libssp in MinGW, disabling STACK_PROTECTOR and FORTIFY_SOURCE") + set(STACK_PROTECTOR_SUPPORTED 0) + set(FORTIFY_SOURCE_SUPPORTED 0) + endif() +endif() + +if(NOT MSVC) + set(WARNING_LIST -Wall -W -Wstrict-prototypes -Wextra -Wcast-align -Wnested-externs -Wshadow) + include(CheckCCompilerFlag) + foreach(WARNING_FLAG ${WARNING_LIST}) + string(REPLACE - "" WARNING_VAR ${WARNING_FLAG}) + check_c_compiler_flag(${WARNING_FLAG} ${WARNING_VAR}_SUPPORTED) + if(${WARNING_VAR}_SUPPORTED) + add_compile_options(${WARNING_FLAG}) + endif() + endforeach() +endif()
View file
_service:tar_scm:opus-1.4.tar.gz/cmake/OpusConfig.cmake.in
Added
@@ -0,0 +1,20 @@ +set(OPUS_VERSION @PROJECT_VERSION@) +set(OPUS_VERSION_STRING @PROJECT_VERSION@) +set(OPUS_VERSION_MAJOR @PROJECT_VERSION_MAJOR@) +set(OPUS_VERSION_MINOR @PROJECT_VERSION_MINOR@) +set(OPUS_VERSION_PATCH @PROJECT_VERSION_PATCH@) + +@PACKAGE_INIT@ + +set_and_check(OPUS_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") +set(OPUS_INCLUDE_DIR ${OPUS_INCLUDE_DIR};${OPUS_INCLUDE_DIR}/opus) +set(OPUS_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@;@PACKAGE_INCLUDE_INSTALL_DIR@/opus") + +include(${CMAKE_CURRENT_LIST_DIR}/OpusTargets.cmake) + +set(OPUS_LIBRARY Opus::opus) +set(OPUS_LIBRARIES Opus::opus) + +check_required_components(Opus) + +set(OPUS_FOUND 1)
View file
_service:tar_scm:opus-1.4.tar.gz/cmake/OpusFunctions.cmake
Added
@@ -0,0 +1,229 @@ +if(__opus_functions) + return() +endif() +set(__opus_functions INCLUDED) + +function(get_library_version OPUS_LIBRARY_VERSION OPUS_LIBRARY_VERSION_MAJOR) + file(STRINGS configure.ac opus_lt_current_string + LIMIT_COUNT 1 + REGEX "OPUS_LT_CURRENT=") + string(REGEX MATCH + "OPUS_LT_CURRENT=(0-9*)" + _ + ${opus_lt_current_string}) + set(OPUS_LT_CURRENT ${CMAKE_MATCH_1}) + + file(STRINGS configure.ac opus_lt_revision_string + LIMIT_COUNT 1 + REGEX "OPUS_LT_REVISION=") + string(REGEX MATCH + "OPUS_LT_REVISION=(0-9*)" + _ + ${opus_lt_revision_string}) + set(OPUS_LT_REVISION ${CMAKE_MATCH_1}) + + file(STRINGS configure.ac opus_lt_age_string + LIMIT_COUNT 1 + REGEX "OPUS_LT_AGE=") + string(REGEX MATCH + "OPUS_LT_AGE=(0-9*)" + _ + ${opus_lt_age_string}) + set(OPUS_LT_AGE ${CMAKE_MATCH_1}) + + math(EXPR OPUS_LIBRARY_VERSION_MAJOR "${OPUS_LT_CURRENT} - ${OPUS_LT_AGE}") + set(OPUS_LIBRARY_VERSION_MINOR ${OPUS_LT_AGE}) + set(OPUS_LIBRARY_VERSION_PATCH ${OPUS_LT_REVISION}) + set( + OPUS_LIBRARY_VERSION + "${OPUS_LIBRARY_VERSION_MAJOR}.${OPUS_LIBRARY_VERSION_MINOR}.${OPUS_LIBRARY_VERSION_PATCH}" + PARENT_SCOPE) + set(OPUS_LIBRARY_VERSION_MAJOR ${OPUS_LIBRARY_VERSION_MAJOR} PARENT_SCOPE) +endfunction() + +function(check_flag NAME FLAG) + include(CheckCCompilerFlag) + check_c_compiler_flag(${FLAG} ${NAME}_SUPPORTED) +endfunction() + +include(CheckIncludeFile) +# function to check if compiler supports SSE, SSE2, SSE4.1 and AVX if target +# systems may not have SSE support then use OPUS_MAY_HAVE_SSE option if target +# system is guaranteed to have SSE support then OPUS_PRESUME_SSE can be used to +# skip SSE runtime check +function(opus_detect_sse COMPILER_SUPPORT_SIMD) + message(STATUS "Check SIMD support by compiler") + check_include_file(xmmintrin.h HAVE_XMMINTRIN_H) # SSE1 + if(HAVE_XMMINTRIN_H) + if(MSVC) + # different arch options for 32 and 64 bit target for MSVC + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + check_flag(SSE1 /arch:SSE) + else() + set(SSE1_SUPPORTED + 1 + PARENT_SCOPE) + endif() + else() + check_flag(SSE1 -msse) + endif() + else() + set(SSE1_SUPPORTED + 0 + PARENT_SCOPE) + endif() + + check_include_file(emmintrin.h HAVE_EMMINTRIN_H) # SSE2 + if(HAVE_EMMINTRIN_H) + if(MSVC) + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + check_flag(SSE2 /arch:SSE2) + else() + set(SSE2_SUPPORTED + 1 + PARENT_SCOPE) + endif() + else() + check_flag(SSE2 -msse2) + endif() + else() + set(SSE2_SUPPORTED + 0 + PARENT_SCOPE) + endif() + + check_include_file(smmintrin.h HAVE_SMMINTRIN_H) # SSE4.1 + if(HAVE_SMMINTRIN_H) + if(MSVC) + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + check_flag(SSE4_1 /arch:SSE2) # SSE2 and above + else() + set(SSE4_1_SUPPORTED + 1 + PARENT_SCOPE) + endif() + else() + check_flag(SSE4_1 -msse4.1) + endif() + else() + set(SSE4_1_SUPPORTED + 0 + PARENT_SCOPE) + endif() + + check_include_file(immintrin.h HAVE_IMMINTRIN_H) # AVX + if(HAVE_IMMINTRIN_H) + if(MSVC) + check_flag(AVX /arch:AVX) + else() + check_flag(AVX -mavx) + endif() + else() + set(AVX_SUPPORTED + 0 + PARENT_SCOPE) + endif() + + if(SSE1_SUPPORTED OR SSE2_SUPPORTED OR SSE4_1_SUPPORTED OR AVX_SUPPORTED) + set(COMPILER_SUPPORT_SIMD 1 PARENT_SCOPE) + else() + message(STATUS "No SIMD support in compiler") + endif() +endfunction() + +function(opus_detect_neon COMPILER_SUPPORT_NEON) + if(CMAKE_SYSTEM_PROCESSOR MATCHES "(arm|aarch64)") + message(STATUS "Check NEON support by compiler") + check_include_file(arm_neon.h HAVE_ARM_NEON_H) + if(HAVE_ARM_NEON_H) + set(COMPILER_SUPPORT_NEON ${HAVE_ARM_NEON_H} PARENT_SCOPE) + endif() + endif() +endfunction() + +function(opus_supports_cpu_detection RUNTIME_CPU_CAPABILITY_DETECTION) + set(RUNTIME_CPU_CAPABILITY_DETECTION 0 PARENT_SCOPE) + if(OPUS_CPU_X86 OR OPUS_CPU_X64) + if(MSVC) + check_include_file(intrin.h HAVE_INTRIN_H) + if(HAVE_INTRIN_H) + # if intrin.h is available we assume __cpuid is there + set(RUNTIME_CPU_CAPABILITY_DETECTION 1 PARENT_SCOPE) + endif() + else() + include(CFeatureCheck) + c_feature_check(CPU_INFO_BY_ASM) + set(CPU_INFO_BY_ASM_SUPPORTED ${CPU_INFO_BY_ASM_SUPPORTED} PARENT_SCOPE) + check_include_file(cpuid.h HAVE_CPUID_H) + if(HAVE_CPUID_H) + c_feature_check(CPU_INFO_BY_C) + set(CPU_INFO_BY_C_SUPPORTED ${CPU_INFO_BY_C_SUPPORTED} PARENT_SCOPE) + endif() + if(CPU_INFO_BY_ASM_SUPPORTED OR CPU_INFO_BY_C_SUPPORTED) + set(RUNTIME_CPU_CAPABILITY_DETECTION 1 PARENT_SCOPE) + endif() + endif() + elseif(OPUS_CPU_ARM) + # ARM cpu detection is implemented for Windows and anything + # using a Linux kernel (such as Android). + if (CMAKE_SYSTEM_NAME MATCHES "(Windows|Linux|Android)") + set(RUNTIME_CPU_CAPABILITY_DETECTION 1 PARENT_SCOPE) + endif () + else() + set(RUNTIME_CPU_CAPABILITY_DETECTION 0 PARENT_SCOPE) + endif() +endfunction() + +function(add_sources_group target group) + target_sources(${target} PRIVATE ${ARGN}) + source_group(${group} FILES ${ARGN}) +endfunction() + +function(get_opus_sources SOURCE_GROUP MAKE_FILE SOURCES) + # read file, each item in list is one group + file(STRINGS ${MAKE_FILE} opus_sources) + + # add wildcard for regex match + string(CONCAT SOURCE_GROUP ${SOURCE_GROUP} ".*$") + + # find group + foreach(val IN LISTS opus_sources) + if(val MATCHES ${SOURCE_GROUP}) + list(LENGTH val list_length) + if(${list_length} EQUAL 1) + # for tests split by '=' and clean up the rest into a list + string(FIND ${val} "=" index) + math(EXPR index "${index} + 1") + string(SUBSTRING ${val} + ${index} + -1
View file
_service:tar_scm:opus-1.4.tar.gz/cmake/OpusPackageVersion.cmake
Added
@@ -0,0 +1,70 @@ +if(__opus_version) + return() +endif() +set(__opus_version INCLUDED) + +function(get_package_version PACKAGE_VERSION PROJECT_VERSION) + + find_package(Git) + if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/.git") + execute_process(COMMAND ${GIT_EXECUTABLE} + --git-dir=${CMAKE_CURRENT_LIST_DIR}/.git describe + --tags --match "v*" OUTPUT_VARIABLE OPUS_PACKAGE_VERSION) + if(OPUS_PACKAGE_VERSION) + string(STRIP ${OPUS_PACKAGE_VERSION}, OPUS_PACKAGE_VERSION) + string(REPLACE \n + "" + OPUS_PACKAGE_VERSION + ${OPUS_PACKAGE_VERSION}) + string(REPLACE , + "" + OPUS_PACKAGE_VERSION + ${OPUS_PACKAGE_VERSION}) + + string(SUBSTRING ${OPUS_PACKAGE_VERSION} + 1 + -1 + OPUS_PACKAGE_VERSION) + message(STATUS "Opus package version from git repo: ${OPUS_PACKAGE_VERSION}") + endif() + + elseif(EXISTS "${CMAKE_CURRENT_LIST_DIR}/package_version" + AND NOT OPUS_PACKAGE_VERSION) + # Not a git repo, lets' try to parse it from package_version file if exists + file(STRINGS package_version OPUS_PACKAGE_VERSION + LIMIT_COUNT 1 + REGEX "PACKAGE_VERSION=") + string(REPLACE "PACKAGE_VERSION=" + "" + OPUS_PACKAGE_VERSION + ${OPUS_PACKAGE_VERSION}) + string(REPLACE "\"" + "" + OPUS_PACKAGE_VERSION + ${OPUS_PACKAGE_VERSION}) + # In case we have a unknown dist here we just replace it with 0 + string(REPLACE "unknown" + "0" + OPUS_PACKAGE_VERSION + ${OPUS_PACKAGE_VERSION}) + message(STATUS "Opus package version from package_version file: ${OPUS_PACKAGE_VERSION}") + endif() + + if(OPUS_PACKAGE_VERSION) + string(REGEX + REPLACE "^(0-9+.0-9+\\.?(0-9+)?).*" + "\\1" + OPUS_PROJECT_VERSION + ${OPUS_PACKAGE_VERSION}) + else() + # fail to parse version from git and package version + message(WARNING "Could not get package version.") + set(OPUS_PACKAGE_VERSION 0) + set(OPUS_PROJECT_VERSION 0) + endif() + + message(STATUS "Opus project version: ${OPUS_PROJECT_VERSION}") + + set(PACKAGE_VERSION ${OPUS_PACKAGE_VERSION} PARENT_SCOPE) + set(PROJECT_VERSION ${OPUS_PROJECT_VERSION} PARENT_SCOPE) +endfunction()
View file
_service:tar_scm:opus-1.4.tar.gz/cmake/OpusSources.cmake
Added
@@ -0,0 +1,49 @@ +if(__opus_sources) + return() +endif() +set(__opus_sources INCLUDED) + +include(OpusFunctions) + +get_opus_sources(SILK_HEAD silk_headers.mk silk_headers) +get_opus_sources(SILK_SOURCES silk_sources.mk silk_sources) +get_opus_sources(SILK_SOURCES_FLOAT silk_sources.mk silk_sources_float) +get_opus_sources(SILK_SOURCES_FIXED silk_sources.mk silk_sources_fixed) +get_opus_sources(SILK_SOURCES_X86_RTCD silk_sources.mk silk_sources_x86_rtcd) +get_opus_sources(SILK_SOURCES_SSE4_1 silk_sources.mk silk_sources_sse4_1) +get_opus_sources(SILK_SOURCES_FIXED_SSE4_1 silk_sources.mk + silk_sources_fixed_sse4_1) +get_opus_sources(SILK_SOURCES_ARM_RTCD silk_sources.mk silk_sources_arm_rtcd) +get_opus_sources(SILK_SOURCES_ARM_NEON_INTR silk_sources.mk + silk_sources_arm_neon_intr) +get_opus_sources(SILK_SOURCES_FIXED_ARM_NEON_INTR silk_sources.mk + silk_sources_fixed_arm_neon_intr) + +get_opus_sources(OPUS_HEAD opus_headers.mk opus_headers) +get_opus_sources(OPUS_SOURCES opus_sources.mk opus_sources) +get_opus_sources(OPUS_SOURCES_FLOAT opus_sources.mk opus_sources_float) + +get_opus_sources(CELT_HEAD celt_headers.mk celt_headers) +get_opus_sources(CELT_SOURCES celt_sources.mk celt_sources) +get_opus_sources(CELT_SOURCES_X86_RTCD celt_sources.mk celt_sources_x86_rtcd) +get_opus_sources(CELT_SOURCES_SSE celt_sources.mk celt_sources_sse) +get_opus_sources(CELT_SOURCES_SSE2 celt_sources.mk celt_sources_sse2) +get_opus_sources(CELT_SOURCES_SSE4_1 celt_sources.mk celt_sources_sse4_1) +get_opus_sources(CELT_SOURCES_ARM_RTCD celt_sources.mk celt_sources_arm_rtcd) +get_opus_sources(CELT_SOURCES_ARM_ASM celt_sources.mk celt_sources_arm_asm) +get_opus_sources(CELT_AM_SOURCES_ARM_ASM celt_sources.mk + celt_am_sources_arm_asm) +get_opus_sources(CELT_SOURCES_ARM_NEON_INTR celt_sources.mk + celt_sources_arm_neon_intr) +get_opus_sources(CELT_SOURCES_ARM_NE10 celt_sources.mk celt_sources_arm_ne10) + +get_opus_sources(opus_demo_SOURCES Makefile.am opus_demo_sources) +get_opus_sources(opus_custom_demo_SOURCES Makefile.am opus_custom_demo_sources) +get_opus_sources(opus_compare_SOURCES Makefile.am opus_compare_sources) +get_opus_sources(tests_test_opus_api_SOURCES Makefile.am test_opus_api_sources) +get_opus_sources(tests_test_opus_encode_SOURCES Makefile.am + test_opus_encode_sources) +get_opus_sources(tests_test_opus_decode_SOURCES Makefile.am + test_opus_decode_sources) +get_opus_sources(tests_test_opus_padding_SOURCES Makefile.am + test_opus_padding_sources)
View file
_service:tar_scm:opus-1.4.tar.gz/cmake/RunTest.cmake
Added
@@ -0,0 +1,61 @@ +if(NOT EXISTS ${TEST_EXECUTABLE}) + message(FATAL_ERROR "Error could not find ${TEST_EXECUTABLE}, ensure that you built the test binary") +endif() + +if(CMAKE_SYSTEM_NAME STREQUAL "Android") + + # support to run plain old binary on android devices + # requires android debug bridge to be installed + + find_program(adb_executable adb) + if(NOT adb_executable) + message(FATAL_ERROR "Error could not find adb") + endif() + + # check if any device emulator is attached + execute_process(COMMAND ${adb_executable} shell echo RESULT_VARIABLE CMD_RESULT) + if(CMD_RESULT) + message(FATAL_ERROR "Error adb: no devices/emulators found") + endif() + + # push binary + set(android_path /data/local/tmp) + execute_process(COMMAND ${adb_executable} push ${TEST_EXECUTABLE} ${android_path} RESULT_VARIABLE CMD_RESULT) + if(CMD_RESULT) + message(FATAL_ERROR "Error running ${adb_executable} push ${TEST_EXECUTABLE} ${android_path} failed with result ${CMD_RESULT}") + endif() + + # set permissions + get_filename_component(test_executable ${TEST_EXECUTABLE} NAME) + set(test_executable_on_android /data/local/tmp/${test_executable}) + execute_process(COMMAND ${adb_executable} shell chmod 555 ${test_executable_on_android} RESULT_VARIABLE CMD_RESULT) + if(CMD_RESULT) + message(FATAL_ERROR "Error running ${adb_executable} shell chmod 555 ${test_executable_on_android} failed with result ${CMD_RESULT}") + endif() + + # run executable + execute_process(COMMAND ${adb_executable} shell ${test_executable_on_android} RESULT_VARIABLE CMD_RESULT) + if(CMD_RESULT) + message(FATAL_ERROR "Error running ${adb_executable} shell ${test_executable_on_android} failed with result ${CMD_RESULT}") + endif() + + # clean up binary + execute_process(COMMAND ${adb_executable} shell rm ${test_executable_on_android} RESULT_VARIABLE CMD_RESULT) + if(CMD_RESULT) + message(FATAL_ERROR "Error running ${adb_executable} shell rm ${test_executable_on_android} failed with result ${CMD_RESULT}") + endif() + +elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS") + # CTest doesn't support iOS + + message(FATAL_ERROR "Error CTest is not supported on iOS") + +else() + # for other platforms just execute test binary on host + + execute_process(COMMAND ${TEST_EXECUTABLE} RESULT_VARIABLE CMD_RESULT) + if(CMD_RESULT) + message(FATAL_ERROR "Error running ${TEST_EXECUTABLE} failed with result ${CMD_RESULT}") + endif() + +endif() \ No newline at end of file
View file
_service:tar_scm:opus-1.4.tar.gz/cmake/config.h.cmake.in
Changed
(renamed from config.h.cmake.in)
View file
_service:tar_scm:opus-1.4.tar.gz/cmake/cpu_info_by_asm.c
Added
@@ -0,0 +1,31 @@ +#include <stdio.h> +int main() { + unsigned int CPUInfo0; + unsigned int CPUInfo1; + unsigned int CPUInfo2; + unsigned int CPUInfo3; + unsigned int InfoType; +#if defined(__i386__) && defined(__PIC__) +/* %ebx is PIC register in 32-bit, so mustn't clobber it. */ + __asm__ __volatile__ ( + "xchg %%ebx, %1\n" + "cpuid\n" + "xchg %%ebx, %1\n": + "=a" (CPUInfo0), + "=r" (CPUInfo1), + "=c" (CPUInfo2), + "=d" (CPUInfo3) : + "0" (InfoType), "2" (0) + ); +#else + __asm__ __volatile__ ( + "cpuid": + "=a" (CPUInfo0), + "=b" (CPUInfo1), + "=c" (CPUInfo2), + "=d" (CPUInfo3) : + "0" (InfoType), "2" (0) + ); +#endif + return 0; +}
View file
_service:tar_scm:opus-1.4.tar.gz/cmake/cpu_info_by_c.c
Added
@@ -0,0 +1,9 @@ +#include <cpuid.h> +int main() { + unsigned int CPUInfo0; + unsigned int CPUInfo1; + unsigned int CPUInfo2; + unsigned int CPUInfo3; + unsigned int InfoType; + return __get_cpuid_count(InfoType, 0, &CPUInfo0, &CPUInfo1, &CPUInfo2, &CPUInfo3); +}
View file
_service:tar_scm:opus-1.4.tar.gz/cmake/vla.c
Added
@@ -0,0 +1,7 @@ +int main() { + static int x; + char a++x; + asizeof a - 1 = 0; + int N; + return a0; +} \ No newline at end of file
View file
_service:tar_scm:opus-1.3.1.tar.gz/compile -> _service:tar_scm:opus-1.4.tar.gz/compile
Changed
@@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey <tromey@cygnus.com>. # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -340,7 +340,7 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0"
View file
_service:tar_scm:opus-1.3.1.tar.gz/config.guess -> _service:tar_scm:opus-1.4.tar.gz/config.guess
Changed
@@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2017 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2017-08-08' +timestamp='2018-02-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. +# along with this program; if not, see <https://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,7 +27,7 @@ # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to <config-patches@gnu.org>. @@ -39,7 +39,7 @@ Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2017 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -107,9 +107,9 @@ dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; + ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; @@ -132,14 +132,14 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu - eval $set_cc_for_build - cat <<-EOF > $dummy.c + eval "$set_cc_for_build" + cat <<-EOF > "$dummy.c" #include <features.h> #if defined(__UCLIBC__) LIBC=uclibc @@ -149,13 +149,20 @@ LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -169,30 +176,30 @@ # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - /sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv0-9\).*$,\1,'` - endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` - machine=${arch}${endian}-unknown + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv0-9\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -208,10 +215,10 @@ ;; esac # Determine ABI tags. - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv0-9/-eabi/;s/eb$//' - abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release @@ -219,49 +226,55 @@ # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE} | sed -e 's/-_.*//' | cut -d. -f1,2` + release=`echo "$UNAME_RELEASE" | sed -e 's/-_.*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}${abi}" + echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*)
View file
_service:tar_scm:opus-1.3.1.tar.gz/config.sub -> _service:tar_scm:opus-1.4.tar.gz/config.sub
Changed
@@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2017 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2017-04-02' +timestamp='2018-02-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. +# along with this program; if not, see <https://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -33,7 +33,7 @@ # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -57,7 +57,7 @@ Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -67,7 +67,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2017 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -94,7 +94,7 @@ *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -112,7 +112,7 @@ # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\(^-*-^-*\)$/\2/'` +maybe_os=`echo "$1" | sed 's/^\(.*\)-\(^-*-^-*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ @@ -120,16 +120,16 @@ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\(^-*-^-*\)$/\1/'` + basic_machine=`echo "$1" | sed 's/^\(.*\)-\(^-*-^-*\)$/\1/'` ;; android-linux) os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\(^-*-^-*\)$/\1/'`-unknown + basic_machine=`echo "$1" | sed 's/^\(.*\)-\(^-*-^-*\)$/\1/'`-unknown ;; *) - basic_machine=`echo $1 | sed 's/-^-*$//'` - if $basic_machine != $1 - then os=`echo $1 | sed 's/.*-/-/'` + basic_machine=`echo "$1" | sed 's/-^-*$//'` + if "$basic_machine" != "$1" + then os=`echo "$1" | sed 's/.*-/-/'` else os=; fi ;; esac @@ -178,44 +178,44 @@ ;; -sco6) os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.4-9*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v4-9*) # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 @@ -227,10 +227,7 @@ os=-lynxos ;; -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` ;; -psos*) os=-psos @@ -299,7 +296,7 @@ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ + | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ @@ -316,7 +313,6 @@ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ - | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown @@ -337,7 +333,7 @@ basic_machine=$basic_machine-unknown os=-none ;; - m88110 | m680123460 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + m88110 | m680123460 | m683?2 | m68360 | m5200 | v70 | w65) ;; ms1) basic_machine=mt-unknown @@ -366,7 +362,7 @@ ;; # Object if more than one company name word. *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. @@ -461,7 +457,7 @@ # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) - basic_machine=i386-unknown + basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) @@ -495,7 +491,7 @@ basic_machine=x86_64-pc
View file
_service:tar_scm:opus-1.3.1.tar.gz/configure -> _service:tar_scm:opus-1.4.tar.gz/configure
Changed
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for opus 1.3.1. +# Generated by GNU Autoconf 2.69 for opus 1.4. # # Report bugs to <opus@xiph.org>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='opus' PACKAGE_TARNAME='opus' -PACKAGE_VERSION='1.3.1' -PACKAGE_STRING='opus 1.3.1' +PACKAGE_VERSION='1.4' +PACKAGE_STRING='opus 1.4' PACKAGE_BUGREPORT='opus@xiph.org' PACKAGE_URL='' @@ -644,6 +644,10 @@ HAVE_DOT HAVE_DOXYGEN OPUS_HAVE_RTCD +HAVE_RTCD_FALSE +HAVE_RTCD_TRUE +CPU_X86_FALSE +CPU_X86_TRUE HAVE_ARM_NE10_FALSE HAVE_ARM_NE10_TRUE HAVE_ARM_NEON_INTR_FALSE @@ -721,7 +725,6 @@ AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE -am__quote am__include DEPDIR OBJEXT @@ -792,6 +795,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -810,7 +814,8 @@ PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR -SHELL' +SHELL +am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking @@ -900,6 +905,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1152,6 +1158,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1289,7 +1304,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1402,7 +1417,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures opus 1.3.1 to adapt to many kinds of systems. +\`configure' configures opus 1.4 to adapt to many kinds of systems. Usage: $0 OPTION... VAR=VALUE... @@ -1442,6 +1457,7 @@ --sysconfdir=DIR read-only single-machine data PREFIX/etc --sharedstatedir=DIR modifiable architecture-independent data PREFIX/com --localstatedir=DIR modifiable single-machine data PREFIX/var + --runstatedir=DIR modifiable per-process data LOCALSTATEDIR/run --libdir=DIR object code libraries EPREFIX/lib --includedir=DIR C header files PREFIX/include --oldincludedir=DIR C header files for non-gcc /usr/include @@ -1472,7 +1488,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of opus 1.3.1:";; + short | recursive ) echo "Configuration of opus 1.4:";; esac cat <<\_ACEOF @@ -1629,7 +1645,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -opus configure 1.3.1 +opus configure 1.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1998,7 +2014,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by opus $as_me 1.3.1, which was +It was created by opus $as_me 1.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2391,15 +2407,15 @@ # For libtool. -OPUS_LT_CURRENT=8 +OPUS_LT_CURRENT=9 OPUS_LT_REVISION=0 -OPUS_LT_AGE=8 +OPUS_LT_AGE=9 -am__api_version='1.15' +am__api_version='1.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -2875,7 +2891,7 @@ # Define the identity of the package. PACKAGE='opus' - VERSION='1.3.1' + VERSION='1.4' # Some tools Automake needs. @@ -2896,8 +2912,8 @@ # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> -# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> +# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> +# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The @@ -2948,7 +2964,7 @@ Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: <http://www.gnu.org/software/coreutils/>. +that behaves properly: <https://www.gnu.org/software/coreutils/>. If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -3158,45 +3174,45 @@ ac_config_commands="$ac_config_commands depfiles" - -am_make=${MAKE-make} -cat > confinc << 'END' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#"
View file
_service:tar_scm:opus-1.3.1.tar.gz/configure.ac -> _service:tar_scm:opus-1.4.tar.gz/configure.ac
Changed
@@ -22,9 +22,9 @@ # For libtool. dnl Please update these for releases. -OPUS_LT_CURRENT=8 +OPUS_LT_CURRENT=9 OPUS_LT_REVISION=0 -OPUS_LT_AGE=8 +OPUS_LT_AGE=9 AC_SUBST(OPUS_LT_CURRENT) AC_SUBST(OPUS_LT_REVISION) @@ -195,6 +195,7 @@ rtcd_support=no cpu_arm=no +cpu_x86=no AS_IF(test x"${enable_asm}" = x"yes", inline_optimization="No inline ASM for your platform, please send patches" @@ -535,6 +536,7 @@ , i?86|x86_64, + cpu_x86=yes OPUS_CHECK_INTRINSICS( SSE, $X86_SSE_CFLAGS, @@ -691,6 +693,18 @@ unsigned int CPUInfo2; unsigned int CPUInfo3; unsigned int InfoType; + #if defined(__i386__) && defined(__PIC__) + __asm__ __volatile__ ( + "xchg %%ebx, %1\n" + "cpuid\n" + "xchg %%ebx, %1\n": + "=a" (CPUInfo0), + "=r" (CPUInfo1), + "=c" (CPUInfo2), + "=d" (CPUInfo3) : + "a" (InfoType), "c" (0) + ); + #else __asm__ __volatile__ ( "cpuid": "=a" (CPUInfo0), @@ -699,6 +713,7 @@ "=d" (CPUInfo3) : "a" (InfoType), "c" (0) ); + #endif ), get_cpuid_by_asm="yes" AC_MSG_RESULT(Inline Assembly) @@ -711,7 +726,7 @@ unsigned int CPUInfo2; unsigned int CPUInfo3; unsigned int InfoType; - __get_cpuid(InfoType, &CPUInfo0, &CPUInfo1, &CPUInfo2, &CPUInfo3); + __get_cpuid_count(InfoType, 0, &CPUInfo0, &CPUInfo1, &CPUInfo2, &CPUInfo3); ), AC_MSG_RESULT(C method) AC_DEFINE(CPU_INFO_BY_C, 1, Get CPU Info by c method), @@ -731,6 +746,7 @@ test x"$OPUS_ARM_MAY_HAVE_NEON_INTR" = x"1") AM_CONDITIONAL(HAVE_ARM_NE10, test x"$HAVE_ARM_NE10" = x"1") +AM_CONDITIONAL(CPU_X86, test "$cpu_x86" = "yes") AM_CONDITIONAL(HAVE_SSE, test x"$OPUS_X86_MAY_HAVE_SSE" = x"1") AM_CONDITIONAL(HAVE_SSE2, @@ -740,6 +756,8 @@ AM_CONDITIONAL(HAVE_AVX, test x"$OPUS_X86_MAY_HAVE_AVX" = x"1") +AM_CONDITIONAL(HAVE_RTCD, + test x"$enable_rtcd" = x"yes" -a x"$rtcd_support" != x"no") AS_IF(test x"$enable_rtcd" = x"yes", AS_IF(test x"$rtcd_support" != x"no", AC_DEFINE(OPUS_HAVE_RTCD, 1,
View file
_service:tar_scm:opus-1.3.1.tar.gz/depcomp -> _service:tar_scm:opus-1.4.tar.gz/depcomp
Changed
@@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -783,7 +783,7 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0"
View file
_service:tar_scm:opus-1.3.1.tar.gz/doc/Doxyfile.in -> _service:tar_scm:opus-1.4.tar.gz/doc/Doxyfile.in
Changed
@@ -1,4 +1,4 @@ -# Doxyfile 1.8.10 +# Doxyfile 1.8.18 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -101,7 +101,7 @@ # names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. +# (including Cygwin) ands Mac users are advised to set this option to NO. # The default value is: system dependent. CASE_SENSE_NAMES = YES @@ -248,8 +248,8 @@ # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = https://www.mathjax.org/mathjax @@ -326,10 +326,15 @@ # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz (see: # http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent -# Bell Labs. +# Bell Labs. The other options in this section have no effect if this option is +# set to NO +# The default value is: NO. # Debian defaults to YES here, while Fedora and Homebrew default to NO. # So we set this based on whether the graphviz package is available at # configure time. # -HAVE_DOT = @HAVE_DOT@ +HAVE_DOT = @HAVE_DOT@ + +# move docs to the correct place +OUTPUT_DIRECTORY = @top_builddir@/doc
View file
_service:tar_scm:opus-1.3.1.tar.gz/doc/Makefile.in -> _service:tar_scm:opus-1.4.tar.gz/doc/Makefile.in
Changed
@@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -261,6 +261,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -301,8 +302,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -328,7 +329,10 @@ cscope cscopelist: -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/.^$$\\*/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/.^$$\\*/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -393,9 +397,9 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@HAVE_DOXYGEN_FALSE@install-data-local: @HAVE_DOXYGEN_FALSE@uninstall-local: @HAVE_DOXYGEN_FALSE@clean-local: +@HAVE_DOXYGEN_FALSE@install-data-local: clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am
View file
_service:tar_scm:opus-1.3.1.tar.gz/doc/footer.html -> _service:tar_scm:opus-1.4.tar.gz/doc/footer.html
Changed
@@ -1,6 +1,10 @@ +<!-- HTML footer for doxygen 1.8.18--> +<!-- start footer part --> <!--BEGIN GENERATE_TREEVIEW--> +<div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> + <ul> <li class="footer">Generated by - <a href="https://www.stack.nl/~dimitri/doxygen/"> + <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> $doxygenversion </li> </ul> </div> @@ -16,7 +20,7 @@ <td> <address class="footer"><small> Generated by - <a href="https://www.stack.nl/~dimitri/doxygen/">doxygen</a> + <a href="http://www.doxygen.org/index.html">doxygen</a> $doxygenversion </small></address> </td>
View file
_service:tar_scm:opus-1.3.1.tar.gz/doc/header.html -> _service:tar_scm:opus-1.4.tar.gz/doc/header.html
Changed
@@ -1,18 +1,24 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<!-- HTML header for doxygen 1.8.18--> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> +<meta name="generator" content="Doxygen $doxygenversion"/> +<meta name="viewport" content="width=device-width, initial-scale=1"/> <!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME--> <!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME--> -<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/> -<link href="$relpath$customdoxygen.css" rel="stylesheet" type="text/css" /> +<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/> +<script type="text/javascript" src="$relpath^jquery.js"></script> +<script type="text/javascript" src="$relpath^dynsections.js"></script> $treeview $search $mathjax +<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" /> +$extrastylesheet </head> <body> -<div id="top"><!-- do not remove this div! --> +<div id="top"><!-- do not remove this div, it is closed by doxygen! --> <!--BEGIN TITLEAREA--> <div id="titlearea"> @@ -20,7 +26,7 @@ <tbody> <tr style="height: 64px;"> <!--BEGIN PROJECT_LOGO--> - <td id="projectlogo"><img alt="Logo" src="$relpath$$projectlogo"/></td> + <td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td> <!--END PROJECT_LOGO--> <!--BEGIN PROJECT_NAME--> <td style="padding-left: 0.5em;"> @@ -52,3 +58,4 @@ </table> </div> <!--END TITLEAREA--> +<!-- end header part -->
View file
_service:tar_scm:opus-1.4.tar.gz/doc/meson.build
Added
@@ -0,0 +1,33 @@ +have_dot = find_program('dot', required: false).found() + +doxyfile_conf = configuration_data() +doxyfile_conf.set('VERSION', opus_version) +doxyfile_conf.set('HAVE_DOT', have_dot) +doxyfile_conf.set('top_srcdir', top_srcdir) +doxyfile_conf.set('top_builddir', top_builddir) + +doxyfile = configure_file(input: 'Doxyfile.in', + output: 'Doxyfile', + configuration: doxyfile_conf, + install: false) + +docdir = join_paths(get_option('datadir'), get_option('docdir')) + +doc_inputs = + 'customdoxygen.css', + 'footer.html', + 'header.html', + 'opus_logo.svg', + top_srcdir + '/include/opus.h', + top_srcdir + '/include/opus_multistream.h', + top_srcdir + '/include/opus_defines.h', + top_srcdir + '/include/opus_types.h', + top_srcdir + '/include/opus_custom.h', + + +custom_target('doc', + input: doxyfile + doc_inputs, + output: 'html' , + command: doxygen, doxyfile , + install_dir: docdir, + install: true)
View file
_service:tar_scm:opus-1.3.1.tar.gz/doc/trivial_example.c -> _service:tar_scm:opus-1.4.tar.gz/doc/trivial_example.c
Changed
@@ -85,7 +85,7 @@ return EXIT_FAILURE; } inFile = argv1; - fin = fopen(inFile, "r"); + fin = fopen(inFile, "rb"); if (fin==NULL) { fprintf(stderr, "failed to open input file: %s\n", strerror(errno)); @@ -101,7 +101,7 @@ return EXIT_FAILURE; } outFile = argv2; - fout = fopen(outFile, "w"); + fout = fopen(outFile, "wb"); if (fout==NULL) { fprintf(stderr, "failed to open output file: %s\n", strerror(errno)); @@ -113,14 +113,25 @@ int i; unsigned char pcm_bytesMAX_FRAME_SIZE*CHANNELS*2; int frame_size; + size_t samples; /* Read a 16 bits/sample audio frame. */ - fread(pcm_bytes, sizeof(short)*CHANNELS, FRAME_SIZE, fin); - if (feof(fin)) + samples = fread(pcm_bytes, sizeof(short)*CHANNELS, FRAME_SIZE, fin); + + /* For simplicity, only read whole frames. In a real application, + * we'd pad the final partial frame with zeroes, record the exact + * duration, and trim the decoded audio to match. + */ + if (samples != FRAME_SIZE) + { break; + } + /* Convert from little-endian ordering. */ for (i=0;i<CHANNELS*FRAME_SIZE;i++) + { ini=pcm_bytes2*i+1<<8|pcm_bytes2*i; + } /* Encode the frame. */ nbBytes = opus_encode(encoder, in, FRAME_SIZE, cbits, MAX_PACKET_SIZE);
View file
_service:tar_scm:opus-1.4.tar.gz/include/meson.build
Added
@@ -0,0 +1,13 @@ +opus_headers = + 'opus.h', + 'opus_multistream.h', + 'opus_projection.h', + 'opus_types.h', + 'opus_defines.h', + + +if opt_custom_modes + opus_headers += 'opus_custom.h' +endif + +install_headers(opus_headers, subdir: 'opus')
View file
_service:tar_scm:opus-1.3.1.tar.gz/include/opus.h -> _service:tar_scm:opus-1.4.tar.gz/include/opus.h
Changed
@@ -198,7 +198,7 @@ * This must be one of 8000, 12000, 16000, * 24000, or 48000. * @param in channels <tt>int</tt>: Number of channels (1 or 2) in input signal - * @param in application <tt>int</tt>: Coding mode (@ref OPUS_APPLICATION_VOIP/@ref OPUS_APPLICATION_AUDIO/@ref OPUS_APPLICATION_RESTRICTED_LOWDELAY) + * @param in application <tt>int</tt>: Coding mode (one of @ref OPUS_APPLICATION_VOIP, @ref OPUS_APPLICATION_AUDIO, or @ref OPUS_APPLICATION_RESTRICTED_LOWDELAY) * @param out error <tt>int*</tt>: @ref opus_errorcodes * @note Regardless of the sampling rate and number channels selected, the Opus encoder * can switch to a lower audio bandwidth or number of channels if the bitrate @@ -222,7 +222,7 @@ * This must be one of 8000, 12000, 16000, * 24000, or 48000. * @param in channels <tt>int</tt>: Number of channels (1 or 2) in input signal - * @param in application <tt>int</tt>: Coding mode (OPUS_APPLICATION_VOIP/OPUS_APPLICATION_AUDIO/OPUS_APPLICATION_RESTRICTED_LOWDELAY) + * @param in application <tt>int</tt>: Coding mode (one of OPUS_APPLICATION_VOIP, OPUS_APPLICATION_AUDIO, or OPUS_APPLICATION_RESTRICTED_LOWDELAY) * @retval #OPUS_OK Success or @ref opus_errorcodes */ OPUS_EXPORT int opus_encoder_init(
View file
_service:tar_scm:opus-1.3.1.tar.gz/include/opus_custom.h -> _service:tar_scm:opus-1.4.tar.gz/include/opus_custom.h
Changed
@@ -104,7 +104,8 @@ /** The mode contains all the information necessary to create an encoder. Both the encoder and decoder need to be initialized with exactly the same mode, otherwise the output will be - corrupted. + corrupted. The mode MUST NOT BE DESTROYED until the encoders and + decoders that use it are destroyed as well. @brief Mode configuration */ typedef struct OpusCustomMode OpusCustomMode; @@ -178,7 +179,7 @@ ) OPUS_ARG_NONNULL(1); -/** Destroys a an encoder state. +/** Destroys an encoder state. * @paramin st <tt>OpusCustomEncoder*</tt>: State to be freed. */ OPUS_CUSTOM_EXPORT void opus_custom_encoder_destroy(OpusCustomEncoder *st); @@ -286,7 +287,7 @@ int *error ) OPUS_ARG_NONNULL(1); -/** Destroys a an decoder state. +/** Destroys a decoder state. * @paramin st <tt>OpusCustomDecoder*</tt>: State to be freed. */ OPUS_CUSTOM_EXPORT void opus_custom_decoder_destroy(OpusCustomDecoder *st);
View file
_service:tar_scm:opus-1.3.1.tar.gz/include/opus_defines.h -> _service:tar_scm:opus-1.4.tar.gz/include/opus_defines.h
Changed
@@ -64,7 +64,7 @@ /**Export control for opus functions */ #ifndef OPUS_EXPORT -# if defined(WIN32) +# if defined(_WIN32) # if defined(OPUS_BUILD) && defined(DLL_EXPORT) # define OPUS_EXPORT __declspec(dllexport) # else @@ -482,7 +482,8 @@ * @paramin x <tt>opus_int32</tt>: Allowed values: * <dl> * <dt>0</dt><dd>Disable inband FEC (default).</dd> - * <dt>1</dt><dd>Enable inband FEC.</dd> + * <dt>1</dt><dd>Inband FEC enabled. If the packet loss rate is sufficiently high, Opus will automatically switch to SILK even at high rates to enable use of that FEC.</dd> + * <dt>2</dt><dd>Inband FEC enabled, but does not necessarily switch to SILK if we have music.</dd> * </dl> * @hideinitializer */ #define OPUS_SET_INBAND_FEC(x) OPUS_SET_INBAND_FEC_REQUEST, __opus_check_int(x) @@ -491,7 +492,8 @@ * @paramout x <tt>opus_int32 *</tt>: Returns one of the following values: * <dl> * <dt>0</dt><dd>Inband FEC disabled (default).</dd> - * <dt>1</dt><dd>Inband FEC enabled.</dd> + * <dt>1</dt><dd>Inband FEC enabled. If the packet loss rate is sufficiently high, Opus will automatically switch to SILK even at high rates to enable use of that FEC.</dd> + * <dt>2</dt><dd>Inband FEC enabled, but does not necessarily switch to SILK if we have music.</dd> * </dl> * @hideinitializer */ #define OPUS_GET_INBAND_FEC(x) OPUS_GET_INBAND_FEC_REQUEST, __opus_check_int_ptr(x)
View file
_service:tar_scm:opus-1.3.1.tar.gz/install-sh -> _service:tar_scm:opus-1.4.tar.gz/install-sh
Changed
@@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -271,15 +271,18 @@ fi dst=$dst_arg - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. + # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst - dst=$dstdir/`basename "$src"` + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac dstdir_status=0 else dstdir=`dirname "$dst"` @@ -288,6 +291,11 @@ fi fi + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + obsolete_mkdir_used=false if test $dstdir_status != 0; then @@ -324,34 +332,43 @@ # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) + # Note that $RANDOM variable is not portable (e.g. dash); Use it + # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p' feature. if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi - rmdir "$tmpdir/d" "$tmpdir" + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; @@ -427,8 +444,8 @@ else # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 @@ -493,7 +510,7 @@ done # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0"
View file
_service:tar_scm:opus-1.3.1.tar.gz/ltmain.sh -> _service:tar_scm:opus-1.4.tar.gz/ltmain.sh
Changed
@@ -31,7 +31,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.6 +VERSION="2.4.6 Debian-2.4.6-14" package_revision=2.4.6 @@ -387,7 +387,7 @@ # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # -# debug_cmd='eval echo "${FUNCNAME0} $*" >&2' bash your-script-name +# debug_cmd='echo "${FUNCNAME0} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: @@ -1370,7 +1370,7 @@ #! /bin/sh # Set a version string for this script. -scriptversion=2014-01-07.03; # UTC +scriptversion=2015-10-07.11; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 @@ -1530,6 +1530,8 @@ { $debug_cmd + _G_rc_run_hooks=false + case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; @@ -1538,16 +1540,16 @@ eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift + if eval $_G_hook '"$@"'; then + # store returned options list back into positional + # parameters for next 'cmd' execution. + eval _G_hook_result=\$${_G_hook}_result + eval set dummy "$_G_hook_result"; shift + _G_rc_run_hooks=: + fi done - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result + $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result } @@ -1557,10 +1559,16 @@ ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed +# full positional parameter list in your hook function, you may remove/edit +# any options that you action, and then pass back the remaining unprocessed # options in '<hooked_function_name>_result', escaped suitably for -# 'eval'. Like this: +# 'eval'. In this case you also must return $EXIT_SUCCESS to let the +# hook's caller know that it should pay attention to +# '<hooked_function_name>_result'. Returning $EXIT_FAILURE signalizes that +# arguments are left untouched by the hook and therefore caller will ignore the +# result variable. +# +# Like this: # # my_options_prep () # { @@ -1570,9 +1578,11 @@ # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result +# # No change in '$@' (ignored completely by this hook). There is +# # no need to do the equivalent (but slower) action: +# # func_quote_for_eval ${1+"$@"} +# # my_options_prep_result=$func_quote_for_eval_result +# false # } # func_add_hook func_options_prep my_options_prep # @@ -1581,25 +1591,37 @@ # { # $debug_cmd # +# args_changed=false +# # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in -# --silent|-s) opt_silent=: ;; +# --silent|-s) opt_silent=: +# args_changed=: +# ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift +# args_changed=: # ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@", we could need that later +# # if $args_changed is true. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# if $args_changed; then +# func_quote_for_eval ${1+"$@"} +# my_silent_option_result=$func_quote_for_eval_result +# fi +# +# $args_changed # } # func_add_hook func_parse_options my_silent_option # @@ -1611,16 +1633,32 @@ # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result +# false # } # func_add_hook func_validate_options my_option_validation # -# You'll alse need to manually amend $usage_message to reflect the extra +# You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. +# func_options_finish ARG... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + _G_func_options_finish_exit=false + if func_run_hooks func_options ${1+"$@"}; then + func_options_finish_result=$func_run_hooks_result + _G_func_options_finish_exit=: + fi + + $_G_func_options_finish_exit +} + + # func_options ARG... # --------------------- # All the functions called inside func_options are hookable. See the @@ -1630,17 +1668,28 @@ { $debug_cmd - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} + _G_rc_options=false + + for my_func in options_prep parse_options validate_options options_finish + do + if eval func_$my_func '${1+"$@"}'; then + eval _G_res_var='$'"func_${my_func}_result" + eval set dummy "$_G_res_var" ; shift + _G_rc_options=: + fi + done - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} + # Save modified positional parameters for caller. As a top-level + # options-parser function we always need to set the 'func_options_result' + # variable (regardless the $_G_rc_options value). + if $_G_rc_options; then
View file
_service:tar_scm:opus-1.3.1.tar.gz/m4/libtool.m4 -> _service:tar_scm:opus-1.4.tar.gz/m4/libtool.m4
Changed
@@ -728,7 +728,6 @@ cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. @@ -1042,8 +1041,8 @@ _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$AR cr libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cr libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF @@ -1493,7 +1492,7 @@ m4_defun(_LT_PROG_AR, AC_CHECK_TOOLS(AR, ar, false) : ${AR=ar} -: ${AR_FLAGS=cru} +: ${AR_FLAGS=cr} _LT_DECL(, AR, 1, The archiver) _LT_DECL(, AR_FLAGS, 1, Flags to create an archive) @@ -2867,9 +2866,6 @@ # before this can be enabled. hardcode_into_libs=yes - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command @@ -2878,7 +2874,7 @@ # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^ *hwcap /d;s/:, / /g;s/=^=*$//;s/=^= * / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -2890,6 +2886,18 @@ dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -3549,7 +3557,7 @@ lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib^/+(\.so\.0-9+\.0-9+|_pic\.a)$' else @@ -4055,7 +4063,8 @@ if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -4427,7 +4436,7 @@ ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -4695,6 +4704,12 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) @@ -4939,6 +4954,9 @@ ;; esac ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -5001,6 +5019,9 @@ openbsd* | bitrig*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes @@ -5255,7 +5276,7 @@ fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -5776,6 +5797,7 @@ if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi + _LT_TAGVAR(link_all_deplibs, $1)=no else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' @@ -5797,7 +5819,7 @@ esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -6423,7 +6445,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else GXX=no @@ -6798,7 +6820,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -6863,7 +6885,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -7202,7 +7224,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # FIXME: insert proper C++ library support @@ -7286,7 +7308,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. @@ -7297,7 +7319,7 @@ # Commands to make compiler produce verbose output that lists
View file
_service:tar_scm:opus-1.4.tar.gz/meson
Added
+(directory)
View file
_service:tar_scm:opus-1.4.tar.gz/meson.build
Added
@@ -0,0 +1,675 @@ +project('opus', 'c', + version: run_command('meson/get-version.py', '--package-version', check: true).stdout().strip(), + meson_version: '>=0.54.0', + default_options: 'warning_level=2', + 'c_std=gnu99', + 'buildtype=debugoptimized') + +libversion = run_command('meson/get-version.py', '--libtool-version', check: true).stdout().strip() +macosversion = run_command('meson/get-version.py', '--darwin-version', check: true).stdout().strip() + +cc = meson.get_compiler('c') +host_system = host_machine.system() +host_cpu_family = host_machine.cpu_family() +top_srcdir = meson.current_source_dir() +top_builddir = meson.current_build_dir() + +opus_includes = include_directories('.', 'include', 'celt', 'silk') +opus_public_includes = include_directories('include') + +add_project_arguments('-DOPUS_BUILD', language: 'c') +add_project_arguments('-DHAVE_CONFIG_H', language: 'c') + +if host_system == 'windows' + if cc.get_argument_syntax() == 'msvc' + add_project_arguments('-D_CRT_SECURE_NO_WARNINGS', language: 'c') + endif +endif + +if cc.get_argument_syntax() == 'gnu' + add_project_arguments('-D_FORTIFY_SOURCE=2', language: 'c') +endif + +# Check for extra compiler args +additional_c_args = +if cc.get_argument_syntax() != 'msvc' + additional_c_args += + '-fvisibility=hidden', + '-Wcast-align', + '-Wnested-externs', + '-Wshadow', + '-Wstrict-prototypes', + + + # On Windows, -fstack-protector-strong adds a libssp-0.dll dependency and + # prevents static linking + if host_system != 'windows' + additional_c_args += '-fstack-protector-strong' + endif +endif + +foreach arg : additional_c_args + if cc.has_argument(arg) + add_project_arguments(arg, language: 'c') + endif +endforeach + +# Windows MSVC warnings +if cc.get_id() == 'msvc' + # Ignore several spurious warnings. + # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it + # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once + # NOTE: Only add warnings here if you are sure they're spurious + add_project_arguments('/wd4035', '/wd4715', '/wd4116', '/wd4046', '/wd4068', + '/wd4820', '/wd4244', '/wd4255', '/wd4668', + language : 'c') +endif + +opus_version = meson.project_version() + +opus_conf = configuration_data() +opus_conf.set('PACKAGE_BUGREPORT', '"opus@xiph.org"') +opus_conf.set('PACKAGE_NAME', '"opus"') +opus_conf.set('PACKAGE_STRING', '"opus @0@"'.format(opus_version)) +opus_conf.set('PACKAGE_TARNAME', '"opus"') +opus_conf.set('PACKAGE_URL', '""') +opus_conf.set('PACKAGE_VERSION', '"@0@"'.format(opus_version)) + +# FIXME: optional Ne10 dependency +have_arm_ne10 = false + +libm = cc.find_library('m', required : false) + +opus_conf.set('HAVE_LRINTF', cc.has_function('lrintf', prefix: '#include <math.h>', dependencies: libm)) +opus_conf.set('HAVE_LRINT', cc.has_function('lrint', prefix: '#include <math.h>', dependencies: libm)) +opus_conf.set('HAVE___MALLOC_HOOK', cc.has_function('__malloc_hook', prefix: '#include <malloc.h>')) +opus_conf.set('HAVE_STDINT_H', cc.check_header('stdint.h')) + +# Check for restrict keyword +restrict_tmpl = ''' +typedef int * int_ptr; +int foo (int_ptr @0@ ip, int * @0@ baz) { + return ip0; +} +int main (int argc, char ** argv) { + int s1; + int * @0@ t = s; + t0 = 0; + return foo(t, (void *)0); +}''' +# Define restrict to the equivalent of the C99 restrict keyword, or to +# nothing if this is not supported. Do not define if restrict is +# supported directly. +if not cc.compiles(restrict_tmpl.format('restrict'), name : 'restrict keyword') + if cc.compiles(restrict_tmpl.format('__restrict'), name : '__restrict') + opus_conf.set('restrict', '__restrict') + elif cc.compiles(restrict_tmpl.format('__restrict__'), name : '__restrict__') + opus_conf.set('restrict', '__restrict') + elif cc.compiles(restrict_tmpl.format('_Restrict'), name : '_Restrict') + opus_conf.set('restrict', '_Restrict') + else + opus_conf.set('restrict', '/**/') + endif +endif + +# Check for C99 variable-size arrays, or alloca() as fallback +msg_use_alloca = false +if cc.compiles('''static int x; + char some_func (void) { + char a++x; + asizeof a - 1 = 0; + int N; + return a0; + }''', name : 'C99 variable-size arrays') + opus_conf.set('VAR_ARRAYS', 1) + msg_use_alloca = 'NO (using C99 variable-size arrays instead)' +elif cc.compiles('''#include <alloca.h> + void some_func (void) { + int foo=10; + int * array = alloca(foo); + }''', name : 'alloca (alloca.h)') + opus_conf.set('USE_ALLOCA', true) + opus_conf.set('HAVE_ALLOCA_H', true) + msg_use_alloca = true +elif cc.compiles('''#include <malloc.h> + #include <stdlib.h> + void some_func (void) { + int foo=10; + int * array = alloca(foo); + }''', name : 'alloca (std)') + opus_conf.set('USE_ALLOCA', true) + msg_use_alloca = true +endif + +opts = + 'fixed-point', 'FIXED_POINT' , + 'fixed-point-debug', 'FIXED_DEBUG' , + 'custom-modes', 'CUSTOM_MODES' , + 'float-approx', 'FLOAT_APPROX' , + 'assertions', 'ENABLE_ASSERTIONS' , + 'hardening', 'ENABLE_HARDENING' , + 'fuzzing', 'FUZZING' , + 'check-asm', 'OPUS_CHECK_ASM' , + + +foreach opt : opts + # we assume these are all boolean options + opt_foo = get_option(opt0) + if opt_foo + opus_conf.set(opt1, 1) + endif + set_variable('opt_' + opt0.underscorify(), opt_foo) +endforeach + +opt_asm = get_option('asm') +opt_rtcd = get_option('rtcd') +opt_intrinsics = get_option('intrinsics') +extra_programs = get_option('extra-programs') +opt_tests = get_option('tests') + +disable_float_api = not get_option('float-api') +if disable_float_api + opus_conf.set('DISABLE_FLOAT_API', 1) +endif + +# This is for the description in the pkg-config .pc file +if opt_fixed_point + pc_build = 'fixed-point' +else + pc_build = 'floating-point' +endif +if opt_custom_modes + pc_build = pc_build + ', custom modes' +endif + +rtcd_support = +# With GCC, Clang, ICC, etc, we differentiate between 'may support this SIMD' +# and 'presume we have this SIMD' by checking whether the SIMD / intrinsics can +# be compiled by the compiler as-is (presume) or with SIMD cflags (may have). +# With MSVC, the compiler will always build SIMD/intrinsics targeting all +# specific instruction sets supported by that version of the compiler. No +# special arguments are ever needed. If runtime CPU detection is not disabled, +# we must always assume that we only 'may have' it. +opus_can_presume_simd = true +if cc.get_argument_syntax() == 'msvc' + if opt_rtcd.disabled() + warning('Building with an MSVC-like compiler and runtime CPU detection is disabled. Outputs may not run on all @0@ CPUs.'.format(host_cpu_family)) + else + opus_can_presume_simd = false + endif
View file
_service:tar_scm:opus-1.4.tar.gz/meson/get-version.py
Added
@@ -0,0 +1,86 @@ +#!/usr/bin/env python3 +# +# Opus get-version.py +# +# Extracts versions for build: +# - Opus package version based on 'git describe' or $srcroot/package_version +# - libtool version based on configure.ac +# - macos lib version based on configure.ac +# +# Usage: +# get-version.py --package-version | --libtool-version | --darwin-version +import argparse +import subprocess +import os +import sys +import shutil + +if __name__ == '__main__': + arg_parser = argparse.ArgumentParser(description='Extract Opus package version or libtool version') + group = arg_parser.add_mutually_exclusive_group(required=True) + group.add_argument('--libtool-version', action='store_true') + group.add_argument('--package-version', action='store_true') + group.add_argument('--darwin-version', action='store_true') + args = arg_parser.parse_args() + + srcroot = os.path.normpath(os.path.join(os.path.dirname(__file__), '..')) + + # package version + if args.package_version: + package_version = None + + # check if git checkout + git_dir = os.path.join(srcroot, '.git') + is_git = os.path.isdir(git_dir) or os.path.isfile(git_dir) + have_git = shutil.which('git') is not None + + if is_git and have_git: + git_cmd = subprocess.run('git', '--git-dir=' + git_dir, 'describe', 'HEAD', stdout=subprocess.PIPE) + if git_cmd.returncode: + print('ERROR: Could not extract package version via `git describe` in', srcroot, file=sys.stderr) + sys.exit(-1) + package_version = git_cmd.stdout.decode('ascii').strip().lstrip('v') + else: + with open(os.path.join(srcroot, 'package_version'), 'r') as f: + for line in f: + if line.startswith('PACKAGE_VERSION="'): + package_version = line17:.strip().lstrip('v').rstrip('"') + if package_version: + break + + if not package_version: + print('ERROR: Could not extract package version from package_version file in', srcroot, file=sys.stderr) + sys.exit(-1) + + print(package_version) + sys.exit(0) + + # libtool version + darwin version + elif args.libtool_version or args.darwin_version: + opus_lt_cur = None + opus_lt_rev = None + opus_lt_age = None + + with open(os.path.join(srcroot, 'configure.ac'), 'r') as f: + for line in f: + if line.strip().startswith('OPUS_LT_CURRENT='): + opus_lt_cur = line16:.strip() + elif line.strip().startswith('OPUS_LT_REVISION='): + opus_lt_rev = line17:.strip() + elif line.strip().startswith('OPUS_LT_AGE='): + opus_lt_age = line12:.strip() + + if opus_lt_cur and opus_lt_rev and opus_lt_age: + opus_lt_cur = int(opus_lt_cur) + opus_lt_rev = int(opus_lt_rev) + opus_lt_age = int(opus_lt_age) + if args.libtool_version: + print('{}.{}.{}'.format(opus_lt_cur - opus_lt_age, opus_lt_age, opus_lt_rev)) + elif args.darwin_version: + print('{}.{}.{}'.format(opus_lt_cur + 1, 0, 0)) + sys.exit(0) + else: + print('ERROR: Could not extract libtool version from configure.ac file in', srcroot, file=sys.stderr) + sys.exit(-1) + else: + sys.exit(-1)
View file
_service:tar_scm:opus-1.4.tar.gz/meson/read-sources-list.py
Added
@@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +# +# opus/read-sources-list.py +# +# Parses .mk files and extracts list of source files. +# Prints one line per source file list, with filenames space-separated. + +import sys + +if len(sys.argv) < 2: + sys.exit('Usage: {} sources_foo.mk sources_bar.mk...'.format(sys.argv0)) + +for input_fn in sys.argv1:: + with open(input_fn, 'r', encoding='utf8') as f: + text = f.read() + text = text.replace('\\\n', '') + + # Remove empty lines + lines = line for line in text.split('\n') if line.strip() + + # Print SOURCES_XYZ = file1.c file2.c + for line in lines: + values = line.strip().split('=', maxsplit=2) + if len(values) != 2: + raise RuntimeError('Unable to parse line "{}" from file "{}"'.format(line, input_fn)) + var, files = values + sources_list = f for f in files.split(' ') if f + print(var.strip(), '=', ' '.join(sources_list))
View file
_service:tar_scm:opus-1.4.tar.gz/meson_options.txt
Added
@@ -0,0 +1,22 @@ +# Optimizations +option('fixed-point', type : 'boolean', value : false, description : 'Compile without floating point (for machines without a fast enough FPU') +option('fixed-point-debug', type : 'boolean', value : false, description : 'Debug fixed-point implementation') +option('float-api', type : 'boolean', value : true, description : 'Compile with or without the floating point API (for machines with no float library') +option('float-approx', type : 'boolean', value : false, description : 'Enable fast approximations for floating point (not supported on all platforms)') +option('rtcd', type : 'feature', value : 'auto', description : 'Run-time CPU capabilities detection') +option('asm', type : 'feature', value : 'auto', description : 'Assembly optimizations for ARM (fixed-point)') +option('intrinsics', type : 'feature', value : 'auto', description : 'Intrinsics optimizations for ARM NEON or x86') + +option('custom-modes', type : 'boolean', value : false, description : 'Enable non-Opus modes, e.g. 44.1 kHz & 2^n frames') +option('extra-programs', type : 'feature', value : 'auto', description : 'Extra programs (demo and tests)') +option('assertions', type : 'boolean', value : false, description : 'Additional software error checking') +option('hardening', type : 'boolean', value : true, description : 'Run-time checks that are cheap and safe for use in production') +option('fuzzing', type : 'boolean', value : false, description : 'Causes the encoder to make random decisions') +option('check-asm', type : 'boolean', value : false, description : 'Run bit-exactness checks between optimized and c implementations') + +# common feature options +option('tests', type : 'feature', value : 'auto', description : 'Build tests') +option('docs', type: 'feature', value: 'auto', description: 'Build API documentation') + +# other options +option('docdir', type: 'string', value: 'doc/opus', description: 'Directory to install documentation into (default: DATADIR/doc/opus')
View file
_service:tar_scm:opus-1.3.1.tar.gz/missing -> _service:tar_scm:opus-1.4.tar.gz/missing
Changed
@@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ exit $st fi -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software program_details () { @@ -207,7 +207,7 @@ exit $st # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0"
View file
_service:tar_scm:opus-1.3.1.tar.gz/opus.m4 -> _service:tar_scm:opus-1.4.tar.gz/opus.m4
Changed
@@ -63,7 +63,7 @@ #include <string.h> #include <opus.h> -int main () +int main (void) { system("touch conf.opustest"); return 0;
View file
_service:tar_scm:opus-1.3.1.tar.gz/package_version -> _service:tar_scm:opus-1.4.tar.gz/package_version
Changed
@@ -1,1 +1,1 @@ -PACKAGE_VERSION="1.3.1" +PACKAGE_VERSION="1.4"
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/CNG.c -> _service:tar_scm:opus-1.4.tar.gz/silk/CNG.c
Changed
@@ -118,6 +118,10 @@ /* Smooth gains */ for( i = 0; i < psDec->nb_subfr; i++ ) { psCNG->CNG_smth_Gain_Q16 += silk_SMULWB( psDecCtrl->Gains_Q16 i - psCNG->CNG_smth_Gain_Q16, CNG_GAIN_SMTH_Q16 ); + /* If the smoothed gain is 3 dB greater than this subframe's gain, use this subframe's gain to adapt faster. */ + if( silk_SMULWW( psCNG->CNG_smth_Gain_Q16, CNG_GAIN_SMTH_THRESHOLD_Q16 ) > psDecCtrl->Gains_Q16 i ) { + psCNG->CNG_smth_Gain_Q16 = psDecCtrl->Gains_Q16 i ; + } } }
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/LPC_fit.c -> _service:tar_scm:opus-1.4.tar.gz/silk/LPC_fit.c
Changed
@@ -31,7 +31,8 @@ #include "SigProc_FIX.h" -/* Convert int32 coefficients to int16 coefs and make sure there's no wrap-around */ +/* Convert int32 coefficients to int16 coefs and make sure there's no wrap-around. + This logic is reused in _celt_lpc(). Any bug fixes should also be applied there. */ void silk_LPC_fit( opus_int16 *a_QOUT, /* O Output signal */ opus_int32 *a_QIN, /* I/O Input signal */
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/MacroCount.h -> _service:tar_scm:opus-1.4.tar.gz/silk/MacroCount.h
Changed
@@ -27,9 +27,9 @@ #ifndef SIGPROCFIX_API_MACROCOUNT_H #define SIGPROCFIX_API_MACROCOUNT_H -#include <stdio.h> #ifdef silk_MACRO_COUNT +#include <stdio.h> #define varDefine opus_int64 ops_count = 0; extern opus_int64 ops_count;
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/MacroDebug.h -> _service:tar_scm:opus-1.4.tar.gz/silk/MacroDebug.h
Changed
@@ -55,7 +55,7 @@ static OPUS_INLINE opus_int32 silk_ADD32_(opus_int32 a, opus_int32 b, char *file, int line){ opus_int32 ret; - ret = a + b; + ret = (opus_int32)((opus_uint32)a + (opus_uint32)b); if ( ret != silk_ADD_SAT32( a, b ) ) { fprintf (stderr, "silk_ADD32(%d, %d) in %s: line %d\n", a, b, file, line); @@ -101,9 +101,9 @@ #undef silk_SUB32 #define silk_SUB32(a,b) silk_SUB32_((a), (b), __FILE__, __LINE__) static OPUS_INLINE opus_int32 silk_SUB32_(opus_int32 a, opus_int32 b, char *file, int line){ - opus_int32 ret; + opus_int64 ret; - ret = a - b; + ret = a - (opus_int64)b; if ( ret != silk_SUB_SAT32( a, b ) ) { fprintf (stderr, "silk_SUB32(%d, %d) in %s: line %d\n", a, b, file, line); @@ -257,7 +257,7 @@ static OPUS_INLINE opus_int32 silk_MUL_(opus_int32 a32, opus_int32 b32, char *file, int line){ opus_int32 ret; opus_int64 ret64; - ret = a32 * b32; + ret = (opus_int32)((opus_uint32)a32 * (opus_uint32)b32); ret64 = (opus_int64)a32 * (opus_int64)b32; if ( (opus_int64)ret != ret64 ) { @@ -333,8 +333,8 @@ #define silk_SMLAWB(a,b,c) silk_SMLAWB_((a), (b), (c), __FILE__, __LINE__) static OPUS_INLINE opus_int32 silk_SMLAWB_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){ opus_int32 ret; - ret = silk_ADD32( a32, silk_SMULWB( b32, c32 ) ); - if ( silk_ADD32( a32, silk_SMULWB( b32, c32 ) ) != silk_ADD_SAT32( a32, silk_SMULWB( b32, c32 ) ) ) + ret = silk_ADD32_ovflw( a32, silk_SMULWB( b32, c32 ) ); + if ( ret != silk_ADD_SAT32( a32, silk_SMULWB( b32, c32 ) ) ) { fprintf (stderr, "silk_SMLAWB(%d, %d, %d) in %s: line %d\n", a32, b32, c32, file, line); #ifdef FIXED_DEBUG_ASSERT @@ -465,7 +465,7 @@ if ( fail ) { - fprintf (stderr, "silk_SMULWT(%d, %d) in %s: line %d\n", a32, b32, file, line); + fprintf (stderr, "silk_SMULWW(%d, %d) in %s: line %d\n", a32, b32, file, line); #ifdef FIXED_DEBUG_ASSERT silk_assert( 0 ); #endif @@ -491,12 +491,6 @@ return ret; } -/* Multiply-accumulate macros that allow overflow in the addition (ie, no asserts in debug mode) */ -#undef silk_MLA_ovflw -#define silk_MLA_ovflw(a32, b32, c32) ((a32) + ((b32) * (c32))) -#undef silk_SMLABB_ovflw -#define silk_SMLABB_ovflw(a32, b32, c32) ((a32) + ((opus_int32)((opus_int16)(b32))) * (opus_int32)((opus_int16)(c32))) - /* no checking needed for silk_SMULL no checking needed for silk_SMLAL no checking needed for silk_SMLALBB @@ -546,10 +540,10 @@ static OPUS_INLINE opus_int8 silk_LSHIFT8_(opus_int8 a, opus_int32 shift, char *file, int line){ opus_int8 ret; int fail = 0; - ret = a << shift; + ret = (opus_int8)((opus_uint8)a << shift); fail |= shift < 0; fail |= shift >= 8; - fail |= (opus_int64)ret != ((opus_int64)a) << shift; + fail |= (opus_int64)ret != (opus_int64)(((opus_uint64)a) << shift); if ( fail ) { fprintf (stderr, "silk_LSHIFT8(%d, %d) in %s: line %d\n", a, shift, file, line); @@ -565,10 +559,10 @@ static OPUS_INLINE opus_int16 silk_LSHIFT16_(opus_int16 a, opus_int32 shift, char *file, int line){ opus_int16 ret; int fail = 0; - ret = a << shift; + ret = (opus_int16)((opus_uint16)a << shift); fail |= shift < 0; fail |= shift >= 16; - fail |= (opus_int64)ret != ((opus_int64)a) << shift; + fail |= (opus_int64)ret != (opus_int64)(((opus_uint64)a) << shift); if ( fail ) { fprintf (stderr, "silk_LSHIFT16(%d, %d) in %s: line %d\n", a, shift, file, line); @@ -584,10 +578,10 @@ static OPUS_INLINE opus_int32 silk_LSHIFT32_(opus_int32 a, opus_int32 shift, char *file, int line){ opus_int32 ret; int fail = 0; - ret = a << shift; + ret = (opus_int32)((opus_uint32)a << shift); fail |= shift < 0; fail |= shift >= 32; - fail |= (opus_int64)ret != ((opus_int64)a) << shift; + fail |= (opus_int64)ret != (opus_int64)(((opus_uint64)a) << shift); if ( fail ) { fprintf (stderr, "silk_LSHIFT32(%d, %d) in %s: line %d\n", a, shift, file, line); @@ -603,7 +597,7 @@ static OPUS_INLINE opus_int64 silk_LSHIFT64_(opus_int64 a, opus_int shift, char *file, int line){ opus_int64 ret; int fail = 0; - ret = a << shift; + ret = (opus_int64)((opus_uint64)a << shift); fail |= shift < 0; fail |= shift >= 64; fail |= (ret>>shift) != ((opus_int64)a); @@ -714,8 +708,8 @@ #define silk_ADD_LSHIFT(a,b,c) silk_ADD_LSHIFT_((a), (b), (c), __FILE__, __LINE__) static OPUS_INLINE int silk_ADD_LSHIFT_(int a, int b, int shift, char *file, int line){ opus_int16 ret; - ret = a + (b << shift); - if ( (shift < 0) || (shift>15) || ((opus_int64)ret != (opus_int64)a + (((opus_int64)b) << shift)) ) + ret = a + (opus_int16)((opus_uint16)b << shift); + if ( (shift < 0) || (shift>15) || ((opus_int64)ret != (opus_int64)a + (opus_int64)(((opus_uint64)b) << shift)) ) { fprintf (stderr, "silk_ADD_LSHIFT(%d, %d, %d) in %s: line %d\n", a, b, shift, file, line); #ifdef FIXED_DEBUG_ASSERT @@ -729,8 +723,8 @@ #define silk_ADD_LSHIFT32(a,b,c) silk_ADD_LSHIFT32_((a), (b), (c), __FILE__, __LINE__) static OPUS_INLINE opus_int32 silk_ADD_LSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){ opus_int32 ret; - ret = a + (b << shift); - if ( (shift < 0) || (shift>31) || ((opus_int64)ret != (opus_int64)a + (((opus_int64)b) << shift)) ) + ret = silk_ADD32_ovflw(a, (opus_int32)((opus_uint32)b << shift)); + if ( (shift < 0) || (shift>31) || ((opus_int64)ret != (opus_int64)a + (opus_int64)(((opus_uint64)b) << shift)) ) { fprintf (stderr, "silk_ADD_LSHIFT32(%d, %d, %d) in %s: line %d\n", a, b, shift, file, line); #ifdef FIXED_DEBUG_ASSERT @@ -774,7 +768,7 @@ #define silk_ADD_RSHIFT32(a,b,c) silk_ADD_RSHIFT32_((a), (b), (c), __FILE__, __LINE__) static OPUS_INLINE opus_int32 silk_ADD_RSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){ opus_int32 ret; - ret = a + (b >> shift); + ret = silk_ADD32_ovflw(a, (b >> shift)); if ( (shift < 0) || (shift>31) || ((opus_int64)ret != (opus_int64)a + (((opus_int64)b) >> shift)) ) { fprintf (stderr, "silk_ADD_RSHIFT32(%d, %d, %d) in %s: line %d\n", a, b, shift, file, line); @@ -804,8 +798,8 @@ #define silk_SUB_LSHIFT32(a,b,c) silk_SUB_LSHIFT32_((a), (b), (c), __FILE__, __LINE__) static OPUS_INLINE opus_int32 silk_SUB_LSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){ opus_int32 ret; - ret = a - (b << shift); - if ( (shift < 0) || (shift>31) || ((opus_int64)ret != (opus_int64)a - (((opus_int64)b) << shift)) ) + ret = silk_SUB32_ovflw(a, (opus_int32)((opus_uint32)b << shift)); + if ( (shift < 0) || (shift>31) || ((opus_int64)ret != (opus_int64)a - (opus_int64)(((opus_uint64)b) << shift)) ) { fprintf (stderr, "silk_SUB_LSHIFT32(%d, %d, %d) in %s: line %d\n", a, b, shift, file, line); #ifdef FIXED_DEBUG_ASSERT @@ -819,7 +813,7 @@ #define silk_SUB_RSHIFT32(a,b,c) silk_SUB_RSHIFT32_((a), (b), (c), __FILE__, __LINE__) static OPUS_INLINE opus_int32 silk_SUB_RSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){ opus_int32 ret; - ret = a - (b >> shift); + ret = silk_SUB32_ovflw(a, (b >> shift)); if ( (shift < 0) || (shift>31) || ((opus_int64)ret != (opus_int64)a - (((opus_int64)b) >> shift)) ) { fprintf (stderr, "silk_SUB_RSHIFT32(%d, %d, %d) in %s: line %d\n", a, b, shift, file, line); @@ -835,7 +829,7 @@ static OPUS_INLINE opus_int32 silk_RSHIFT_ROUND_(opus_int32 a, opus_int32 shift, char *file, int line){ opus_int32 ret; ret = shift == 1 ? (a >> 1) + (a & 1) : ((a >> (shift - 1)) + 1) >> 1; - /* the marco definition can't handle a shift of zero */ + /* the macro definition can't handle a shift of zero */ if ( (shift <= 0) || (shift>31) || ((opus_int64)ret != ((opus_int64)a + ((opus_int64)1 << (shift - 1))) >> shift) ) { fprintf (stderr, "silk_RSHIFT_ROUND(%d, %d) in %s: line %d\n", a, shift, file, line); @@ -850,7 +844,7 @@ #define silk_RSHIFT_ROUND64(a,b) silk_RSHIFT_ROUND64_((a), (b), __FILE__, __LINE__) static OPUS_INLINE opus_int64 silk_RSHIFT_ROUND64_(opus_int64 a, opus_int32 shift, char *file, int line){ opus_int64 ret; - /* the marco definition can't handle a shift of zero */ + /* the macro definition can't handle a shift of zero */ if ( (shift <= 0) || (shift>=64) ) { fprintf (stderr, "silk_RSHIFT_ROUND64(%lld, %d) in %s: line %d\n", (long long)a, shift, file, line);
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/NSQ.c -> _service:tar_scm:opus-1.4.tar.gz/silk/NSQ.c
Changed
@@ -75,21 +75,21 @@ void silk_NSQ_c ( - const silk_encoder_state *psEncC, /* I Encoder State */ - silk_nsq_state *NSQ, /* I/O NSQ state */ - SideInfoIndices *psIndices, /* I/O Quantization Indices */ + const silk_encoder_state *psEncC, /* I Encoder State */ + silk_nsq_state *NSQ, /* I/O NSQ state */ + SideInfoIndices *psIndices, /* I/O Quantization Indices */ const opus_int16 x16, /* I Input */ - opus_int8 pulses, /* O Quantized pulse signal */ - const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ - const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ - const opus_int16 AR_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ - const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ - const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ - const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ - const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ - const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ - const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ - const opus_int LTP_scale_Q14 /* I LTP state scaling */ + opus_int8 pulses, /* O Quantized pulse signal */ + const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ + const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ + const opus_int16 AR_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ + const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ + const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ + const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ + const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ + const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ + const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ + const opus_int LTP_scale_Q14 /* I LTP state scaling */ ) { opus_int k, lag, start_idx, LSF_interpolation_flag; @@ -173,9 +173,9 @@ RESTORE_STACK; } -/***********************************/ -/* silk_noise_shape_quantizer */ -/***********************************/ +/******************************/ +/* silk_noise_shape_quantizer */ +/******************************/ #if !defined(OPUS_X86_MAY_HAVE_SSE4_1) static OPUS_INLINE @@ -262,7 +262,7 @@ tmp1 = silk_SUB32( tmp1, n_LF_Q12 ); /* Q12 */ if( lag > 0 ) { /* Symmetric, packed FIR coefficients */ - n_LTP_Q13 = silk_SMULWB( silk_ADD32( shp_lag_ptr 0 , shp_lag_ptr -2 ), HarmShapeFIRPacked_Q14 ); + n_LTP_Q13 = silk_SMULWB( silk_ADD_SAT32( shp_lag_ptr 0 , shp_lag_ptr -2 ), HarmShapeFIRPacked_Q14 ); n_LTP_Q13 = silk_SMLAWT( n_LTP_Q13, shp_lag_ptr -1 , HarmShapeFIRPacked_Q14 ); n_LTP_Q13 = silk_LSHIFT( n_LTP_Q13, 1 ); shp_lag_ptr++;
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/NSQ_del_dec.c -> _service:tar_scm:opus-1.4.tar.gz/silk/NSQ_del_dec.c
Changed
@@ -115,21 +115,21 @@ ); void silk_NSQ_del_dec_c( - const silk_encoder_state *psEncC, /* I Encoder State */ - silk_nsq_state *NSQ, /* I/O NSQ state */ - SideInfoIndices *psIndices, /* I/O Quantization Indices */ + const silk_encoder_state *psEncC, /* I Encoder State */ + silk_nsq_state *NSQ, /* I/O NSQ state */ + SideInfoIndices *psIndices, /* I/O Quantization Indices */ const opus_int16 x16, /* I Input */ - opus_int8 pulses, /* O Quantized pulse signal */ - const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ - const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ - const opus_int16 AR_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ - const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ - const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ - const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ - const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ - const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ - const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ - const opus_int LTP_scale_Q14 /* I LTP state scaling */ + opus_int8 pulses, /* O Quantized pulse signal */ + const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ + const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ + const opus_int16 AR_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ + const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ + const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ + const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ + const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ + const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ + const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ + const opus_int LTP_scale_Q14 /* I LTP state scaling */ ) { opus_int i, k, lag, start_idx, LSF_interpolation_flag, Winner_ind, subfr; @@ -394,8 +394,8 @@ /* Long-term shaping */ if( lag > 0 ) { /* Symmetric, packed FIR coefficients */ - n_LTP_Q14 = silk_SMULWB( silk_ADD32( shp_lag_ptr 0 , shp_lag_ptr -2 ), HarmShapeFIRPacked_Q14 ); - n_LTP_Q14 = silk_SMLAWT( n_LTP_Q14, shp_lag_ptr -1 , HarmShapeFIRPacked_Q14 ); + n_LTP_Q14 = silk_SMULWB( silk_ADD_SAT32( shp_lag_ptr 0 , shp_lag_ptr -2 ), HarmShapeFIRPacked_Q14 ); + n_LTP_Q14 = silk_SMLAWT( n_LTP_Q14, shp_lag_ptr -1 , HarmShapeFIRPacked_Q14 ); n_LTP_Q14 = silk_SUB_LSHIFT32( LTP_pred_Q14, n_LTP_Q14, 2 ); /* Q12 -> Q14 */ shp_lag_ptr++; } else { @@ -451,9 +451,9 @@ /* Input minus prediction plus noise feedback */ /* r = x i - LTP_pred - LPC_pred + n_AR + n_Tilt + n_LF + n_LTP */ - tmp1 = silk_ADD32( n_AR_Q14, n_LF_Q14 ); /* Q14 */ + tmp1 = silk_ADD_SAT32( n_AR_Q14, n_LF_Q14 ); /* Q14 */ tmp2 = silk_ADD32( n_LTP_Q14, LPC_pred_Q14 ); /* Q13 */ - tmp1 = silk_SUB32( tmp2, tmp1 ); /* Q13 */ + tmp1 = silk_SUB_SAT32( tmp2, tmp1 ); /* Q13 */ tmp1 = silk_RSHIFT_ROUND( tmp1, 4 ); /* Q10 */ r_Q10 = silk_SUB32( x_Q10 i , tmp1 ); /* residual error Q10 */ @@ -535,7 +535,7 @@ /* Update states */ psSS 0 .Diff_Q14 = silk_SUB_LSHIFT32( xq_Q14, x_Q10 i , 4 ); sLF_AR_shp_Q14 = silk_SUB32( psSS 0 .Diff_Q14, n_AR_Q14 ); - psSS 0 .sLTP_shp_Q14 = silk_SUB32( sLF_AR_shp_Q14, n_LF_Q14 ); + psSS 0 .sLTP_shp_Q14 = silk_SUB_SAT32( sLF_AR_shp_Q14, n_LF_Q14 ); psSS 0 .LF_AR_Q14 = sLF_AR_shp_Q14; psSS 0 .LPC_exc_Q14 = LPC_exc_Q14; psSS 0 .xq_Q14 = xq_Q14; @@ -555,7 +555,7 @@ /* Update states */ psSS 1 .Diff_Q14 = silk_SUB_LSHIFT32( xq_Q14, x_Q10 i , 4 ); sLF_AR_shp_Q14 = silk_SUB32( psSS 1 .Diff_Q14, n_AR_Q14 ); - psSS 1 .sLTP_shp_Q14 = silk_SUB32( sLF_AR_shp_Q14, n_LF_Q14 ); + psSS 1 .sLTP_shp_Q14 = silk_SUB_SAT32( sLF_AR_shp_Q14, n_LF_Q14 ); psSS 1 .LF_AR_Q14 = sLF_AR_shp_Q14; psSS 1 .LPC_exc_Q14 = LPC_exc_Q14; psSS 1 .xq_Q14 = xq_Q14;
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/PLC.c -> _service:tar_scm:opus-1.4.tar.gz/silk/PLC.c
Changed
@@ -328,10 +328,8 @@ for( j = 0; j < LTP_ORDER; j++ ) { B_Q14 j = silk_RSHIFT( silk_SMULBB( harm_Gain_Q15, B_Q14 j ), 15 ); } - if ( psDec->indices.signalType != TYPE_NO_VOICE_ACTIVITY ) { - /* Gradually reduce excitation gain */ - rand_scale_Q14 = silk_RSHIFT( silk_SMULBB( rand_scale_Q14, rand_Gain_Q15 ), 15 ); - } + /* Gradually reduce excitation gain */ + rand_scale_Q14 = silk_RSHIFT( silk_SMULBB( rand_scale_Q14, rand_Gain_Q15 ), 15 ); /* Slowly increase pitch lag */ psPLC->pitchL_Q8 = silk_SMLAWB( psPLC->pitchL_Q8, psPLC->pitchL_Q8, PITCH_DRIFT_FAC_Q16 );
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/SigProc_FIX.h -> _service:tar_scm:opus-1.4.tar.gz/silk/SigProc_FIX.h
Changed
@@ -381,7 +381,7 @@ const opus_int len /* I vector lengths */ ); -opus_int64 silk_inner_prod16_aligned_64_c( +opus_int64 silk_inner_prod16_c( const opus_int16 *inVec1, /* I input vector 1 */ const opus_int16 *inVec2, /* I input vector 2 */ const opus_int len /* I vector lengths */ @@ -609,12 +609,14 @@ /* the following seems faster on x86 */ #define silk_SMMUL(a32, b32) (opus_int32)silk_RSHIFT64(silk_SMULL((a32), (b32)), 32) -#if !defined(OPUS_X86_MAY_HAVE_SSE4_1) +#if !defined(OVERRIDE_silk_burg_modified) #define silk_burg_modified(res_nrg, res_nrg_Q, A_Q16, x, minInvGain_Q30, subfr_length, nb_subfr, D, arch) \ ((void)(arch), silk_burg_modified_c(res_nrg, res_nrg_Q, A_Q16, x, minInvGain_Q30, subfr_length, nb_subfr, D, arch)) +#endif -#define silk_inner_prod16_aligned_64(inVec1, inVec2, len, arch) \ - ((void)(arch),silk_inner_prod16_aligned_64_c(inVec1, inVec2, len)) +#if !defined(OVERRIDE_silk_inner_prod16) +#define silk_inner_prod16(inVec1, inVec2, len, arch) \ + ((void)(arch),silk_inner_prod16_c(inVec1, inVec2, len)) #endif #include "Inlines.h"
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/VQ_WMat_EC.c -> _service:tar_scm:opus-1.4.tar.gz/silk/VQ_WMat_EC.c
Changed
@@ -64,7 +64,7 @@ *rate_dist_Q8 = silk_int32_MAX; *res_nrg_Q15 = silk_int32_MAX; cb_row_Q7 = cb_Q7; - /* In things go really bad, at least *ind is set to something safe. */ + /* If things go really bad, at least *ind is set to something safe. */ *ind = 0; for( k = 0; k < L; k++ ) { opus_int32 penalty; @@ -115,7 +115,7 @@ if( sum1_Q15 >= 0 ) { /* Translate residual energy to bits using high-rate assumption (6 dB ==> 1 bit/sample) */ bits_res_Q8 = silk_SMULBB( subfr_len, silk_lin2log( sum1_Q15 + penalty) - (15 << 7) ); - /* In the following line we reduce the codelength component by half ("-1"); seems to slghtly improve quality */ + /* In the following line we reduce the codelength component by half ("-1"); seems to slightly improve quality */ bits_tot_Q8 = silk_ADD_LSHIFT32( bits_res_Q8, cl_Q5 k , 3-1 ); if( bits_tot_Q8 <= *rate_dist_Q8 ) { *rate_dist_Q8 = bits_tot_Q8;
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/arm/LPC_inv_pred_gain_neon_intr.c -> _service:tar_scm:opus-1.4.tar.gz/silk/arm/LPC_inv_pred_gain_neon_intr.c
Changed
@@ -210,19 +210,23 @@ /* Increase Q domain of the AR coefficients */ t0_s16x8 = vld1q_s16( A_Q12 + 0 ); t1_s16x8 = vld1q_s16( A_Q12 + 8 ); - t2_s16x8 = vld1q_s16( A_Q12 + 16 ); + if ( order > 16 ) { + t2_s16x8 = vld1q_s16( A_Q12 + 16 ); + } t0_s32x4 = vpaddlq_s16( t0_s16x8 ); switch( order - leftover ) { case 24: t0_s32x4 = vpadalq_s16( t0_s32x4, t2_s16x8 ); + vst1q_s32( Atmp_QA + 16, vshll_n_s16( vget_low_s16 ( t2_s16x8 ), QA - 12 ) ); + vst1q_s32( Atmp_QA + 20, vshll_n_s16( vget_high_s16( t2_s16x8 ), QA - 12 ) ); /* FALLTHROUGH */ case 16: t0_s32x4 = vpadalq_s16( t0_s32x4, t1_s16x8 ); - vst1q_s32( Atmp_QA + 16, vshll_n_s16( vget_low_s16 ( t2_s16x8 ), QA - 12 ) ); - vst1q_s32( Atmp_QA + 20, vshll_n_s16( vget_high_s16( t2_s16x8 ), QA - 12 ) ); + vst1q_s32( Atmp_QA + 8, vshll_n_s16( vget_low_s16 ( t1_s16x8 ), QA - 12 ) ); + vst1q_s32( Atmp_QA + 12, vshll_n_s16( vget_high_s16( t1_s16x8 ), QA - 12 ) ); /* FALLTHROUGH */ case 8: @@ -230,8 +234,8 @@ const int32x2_t t_s32x2 = vpadd_s32( vget_low_s32( t0_s32x4 ), vget_high_s32( t0_s32x4 ) ); const int64x1_t t_s64x1 = vpaddl_s32( t_s32x2 ); DC_resp = vget_lane_s32( vreinterpret_s32_s64( t_s64x1 ), 0 ); - vst1q_s32( Atmp_QA + 8, vshll_n_s16( vget_low_s16 ( t1_s16x8 ), QA - 12 ) ); - vst1q_s32( Atmp_QA + 12, vshll_n_s16( vget_high_s16( t1_s16x8 ), QA - 12 ) ); + vst1q_s32( Atmp_QA + 0, vshll_n_s16( vget_low_s16 ( t0_s16x8 ), QA - 12 ) ); + vst1q_s32( Atmp_QA + 4, vshll_n_s16( vget_high_s16( t0_s16x8 ), QA - 12 ) ); } break; @@ -246,16 +250,22 @@ case 6: DC_resp += (opus_int32)A_Q12 5 ; DC_resp += (opus_int32)A_Q12 4 ; + Atmp_QA order - leftover + 5 = silk_LSHIFT32( (opus_int32)A_Q12 5 , QA - 12 ); + Atmp_QA order - leftover + 4 = silk_LSHIFT32( (opus_int32)A_Q12 4 , QA - 12 ); /* FALLTHROUGH */ case 4: DC_resp += (opus_int32)A_Q12 3 ; DC_resp += (opus_int32)A_Q12 2 ; + Atmp_QA order - leftover + 3 = silk_LSHIFT32( (opus_int32)A_Q12 3 , QA - 12 ); + Atmp_QA order - leftover + 2 = silk_LSHIFT32( (opus_int32)A_Q12 2 , QA - 12 ); /* FALLTHROUGH */ case 2: DC_resp += (opus_int32)A_Q12 1 ; DC_resp += (opus_int32)A_Q12 0 ; + Atmp_QA order - leftover + 1 = silk_LSHIFT32( (opus_int32)A_Q12 1 , QA - 12 ); + Atmp_QA order - leftover + 0 = silk_LSHIFT32( (opus_int32)A_Q12 0 , QA - 12 ); /* FALLTHROUGH */ default: @@ -266,8 +276,6 @@ if( DC_resp >= 4096 ) { invGain_Q30 = 0; } else { - vst1q_s32( Atmp_QA + 0, vshll_n_s16( vget_low_s16 ( t0_s16x8 ), QA - 12 ) ); - vst1q_s32( Atmp_QA + 4, vshll_n_s16( vget_high_s16( t0_s16x8 ), QA - 12 ) ); invGain_Q30 = LPC_inverse_pred_gain_QA_neon( Atmp_QA, order ); } }
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/bwexpander_32.c -> _service:tar_scm:opus-1.4.tar.gz/silk/bwexpander_32.c
Changed
@@ -31,7 +31,8 @@ #include "SigProc_FIX.h" -/* Chirp (bandwidth expand) LP AR filter */ +/* Chirp (bandwidth expand) LP AR filter. + This logic is reused in _celt_lpc(). Any bug fixes should also be applied there. */ void silk_bwexpander_32( opus_int32 *ar, /* I/O AR filter to be expanded (without leading 1) */ const opus_int d, /* I Length of ar */
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/control_codec.c -> _service:tar_scm:opus-1.4.tar.gz/silk/control_codec.c
Changed
@@ -415,7 +415,7 @@ /* Previous packet did not have LBRR, and was therefore coded at a higher bitrate */ psEncC->LBRR_GainIncreases = 7; } else { - psEncC->LBRR_GainIncreases = silk_max_int( 7 - silk_SMULWB( (opus_int32)psEncC->PacketLoss_perc, SILK_FIX_CONST( 0.4, 16 ) ), 2 ); + psEncC->LBRR_GainIncreases = silk_max_int( 7 - silk_SMULWB( (opus_int32)psEncC->PacketLoss_perc, SILK_FIX_CONST( 0.2, 16 ) ), 3 ); } }
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/debug.c -> _service:tar_scm:opus-1.4.tar.gz/silk/debug.c
Changed
@@ -29,19 +29,23 @@ #include "config.h" #endif +typedef int prevent_empty_translation_unit_warning; + #include "debug.h" + +#if SILK_DEBUG || SILK_TIC_TOC #include "SigProc_FIX.h" +#endif #if SILK_TIC_TOC -#ifdef _WIN32 - #if (defined(_WIN32) || defined(_WINCE)) #include <windows.h> /* timer */ #else /* Linux or Mac*/ #include <sys/time.h> #endif +#ifdef _WIN32 unsigned long silk_GetHighResolutionTime(void) /* O time in usec*/ { /* Returns a time counter in microsec */ @@ -65,7 +69,7 @@ int silk_Timer_nTimers = 0; int silk_Timer_depth_ctr = 0; char silk_Timer_tagssilk_NUM_TIMERS_MAXsilk_NUM_TIMERS_MAX_TAG_LEN; -#ifdef WIN32 +#ifdef _WIN32 LARGE_INTEGER silk_Timer_startsilk_NUM_TIMERS_MAX; #else unsigned long silk_Timer_startsilk_NUM_TIMERS_MAX; @@ -76,7 +80,7 @@ opus_int64 silk_Timer_maxsilk_NUM_TIMERS_MAX; opus_int64 silk_Timer_depthsilk_NUM_TIMERS_MAX; -#ifdef WIN32 +#ifdef _WIN32 void silk_TimerSave(char *file_name) { if( silk_Timer_nTimers > 0 )
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/debug.h -> _service:tar_scm:opus-1.4.tar.gz/silk/debug.h
Changed
@@ -28,28 +28,29 @@ #ifndef SILK_DEBUG_H #define SILK_DEBUG_H -#include "typedef.h" -#include <stdio.h> /* file writing */ -#include <string.h> /* strcpy, strcmp */ - -#ifdef __cplusplus -extern "C" -{ -#endif - -unsigned long GetHighResolutionTime(void); /* O time in usec*/ - /* Set to 1 to enable DEBUG_STORE_DATA() macros for dumping * intermediate signals from the codec. */ #define SILK_DEBUG 0 /* Flag for using timers */ -#define SILK_TIC_TOC 0 +#define SILK_TIC_TOC 0 +#if SILK_DEBUG || SILK_TIC_TOC +#include "typedef.h" +#include <string.h> /* strcpy, strcmp */ +#include <stdio.h> /* file writing */ +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif #if SILK_TIC_TOC +unsigned long GetHighResolutionTime(void); /* O time in usec*/ + #if (defined(_WIN32) || defined(_WINCE)) #include <windows.h> /* timer */ #else /* Linux or Mac*/
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/decode_frame.c -> _service:tar_scm:opus-1.4.tar.gz/silk/decode_frame.c
Changed
@@ -97,7 +97,6 @@ psDec->first_frame_after_reset = 0; } else { /* Handle packet loss by extrapolation */ - psDec->indices.signalType = psDec->prevSignalType; silk_PLC( psDec, psDecCtrl, pOut, 1, arch ); }
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/define.h -> _service:tar_scm:opus-1.4.tar.gz/silk/define.h
Changed
@@ -225,6 +225,7 @@ /* Defines for CN generation */ #define CNG_BUF_MASK_MAX 255 /* 2^floor(log2(MAX_FRAME_LENGTH))-1 */ #define CNG_GAIN_SMTH_Q16 4634 /* 0.25^(1/4) */ +#define CNG_GAIN_SMTH_THRESHOLD_Q16 46396 /* -3 dB */ #define CNG_NLSF_SMTH_Q16 16348 /* 0.25 */ #ifdef __cplusplus
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/enc_API.c -> _service:tar_scm:opus-1.4.tar.gz/silk/enc_API.c
Changed
@@ -270,6 +270,7 @@ psEnc->state_Fxx 0 .sCmn.fs_kHz * 1000 ); ALLOC( buf, nSamplesFromInputMax, opus_int16 ); while( 1 ) { + int curr_nBitsUsedLBRR = 0; nSamplesToBuffer = psEnc->state_Fxx 0 .sCmn.frame_length - psEnc->state_Fxx 0 .sCmn.inputBufIx; nSamplesToBuffer = silk_min( nSamplesToBuffer, nSamplesToBufferMax ); nSamplesFromInput = silk_DIV32_16( nSamplesToBuffer * psEnc->state_Fxx 0 .sCmn.API_fs_Hz, psEnc->state_Fxx 0 .sCmn.fs_kHz * 1000 ); @@ -342,6 +343,7 @@ opus_uint8 iCDF 2 = { 0, 0 }; iCDF 0 = 256 - silk_RSHIFT( 256, ( psEnc->state_Fxx 0 .sCmn.nFramesPerPacket + 1 ) * encControl->nChannelsInternal ); ec_enc_icdf( psRangeEnc, 0, iCDF, 8 ); + curr_nBitsUsedLBRR = ec_tell( psRangeEnc ); /* Encode any LBRR data from previous packet */ /* Encode LBRR flags */ @@ -386,8 +388,7 @@ for( n = 0; n < encControl->nChannelsInternal; n++ ) { silk_memset( psEnc->state_Fxx n .sCmn.LBRR_flags, 0, sizeof( psEnc->state_Fxx n .sCmn.LBRR_flags ) ); } - - psEnc->nBitsUsedLBRR = ec_tell( psRangeEnc ); + curr_nBitsUsedLBRR = ec_tell( psRangeEnc ) - curr_nBitsUsedLBRR; } silk_HP_variable_cutoff( psEnc->state_Fxx ); @@ -396,6 +397,16 @@ nBits = silk_DIV32_16( silk_MUL( encControl->bitRate, encControl->payloadSize_ms ), 1000 ); /* Subtract bits used for LBRR */ if( !prefillFlag ) { + /* psEnc->nBitsUsedLBRR is an exponential moving average of the LBRR usage, + except that for the first LBRR frame it does no averaging and for the first + frame after after LBRR, it goes back to zero immediately. */ + if ( curr_nBitsUsedLBRR < 10 ) { + psEnc->nBitsUsedLBRR = 0; + } else if ( psEnc->nBitsUsedLBRR < 10) { + psEnc->nBitsUsedLBRR = curr_nBitsUsedLBRR; + } else { + psEnc->nBitsUsedLBRR = ( psEnc->nBitsUsedLBRR + curr_nBitsUsedLBRR ) / 2; + } nBits -= psEnc->nBitsUsedLBRR; } /* Divide by number of uncoded frames left in packet */
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/fixed/LTP_scale_ctrl_FIX.c -> _service:tar_scm:opus-1.4.tar.gz/silk/fixed/LTP_scale_ctrl_FIX.c
Changed
@@ -42,9 +42,14 @@ if( condCoding == CODE_INDEPENDENTLY ) { /* Only scale if first frame in packet */ - round_loss = psEnc->sCmn.PacketLoss_perc + psEnc->sCmn.nFramesPerPacket; - psEnc->sCmn.indices.LTP_scaleIndex = (opus_int8)silk_LIMIT( - silk_SMULWB( silk_SMULBB( round_loss, psEncCtrl->LTPredCodGain_Q7 ), SILK_FIX_CONST( 0.1, 9 ) ), 0, 2 ); + round_loss = psEnc->sCmn.PacketLoss_perc * psEnc->sCmn.nFramesPerPacket; + if ( psEnc->sCmn.LBRR_flag ) { + /* LBRR reduces the effective loss. In practice, it does not square the loss because + losses aren't independent, but that still seems to work best. We also never go below 2%. */ + round_loss = 2 + silk_SMULBB( round_loss, round_loss ) / 100; + } + psEnc->sCmn.indices.LTP_scaleIndex = silk_SMULBB( psEncCtrl->LTPredCodGain_Q7, round_loss ) > silk_log2lin( 128*7 + 2900-psEnc->sCmn.SNR_dB_Q7 ); + psEnc->sCmn.indices.LTP_scaleIndex += silk_SMULBB( psEncCtrl->LTPredCodGain_Q7, round_loss ) > silk_log2lin( 128*7 + 3900-psEnc->sCmn.SNR_dB_Q7 ); } else { /* Default is minimum scaling */ psEnc->sCmn.indices.LTP_scaleIndex = 0;
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/fixed/arm/warped_autocorrelation_FIX_neon_intr.c -> _service:tar_scm:opus-1.4.tar.gz/silk/fixed/arm/warped_autocorrelation_FIX_neon_intr.c
Changed
@@ -84,7 +84,9 @@ silk_assert( ( order & 1 ) == 0 ); silk_assert( 2 * QS - QC >= 0 ); - ALLOC( input_QST, length + 2 * MAX_SHAPE_LPC_ORDER, opus_int32 ); + /* The additional +4 is to ensure a later vld1q_s32 call does not overflow. */ + /* Strictly, only +3 is needed but +4 simplifies initialization using the 4x32 neon load. */ + ALLOC( input_QST, length + 2 * MAX_SHAPE_LPC_ORDER + 4, opus_int32 ); input_QS = input_QST; /* input_QS has zero paddings in the beginning and end. */ @@ -121,6 +123,8 @@ vst1q_s32( input_QS, vdupq_n_s32( 0 ) ); input_QS += 4; vst1q_s32( input_QS, vdupq_n_s32( 0 ) ); + input_QS += 4; + vst1q_s32( input_QS, vdupq_n_s32( 0 ) ); input_QS = input_QST + MAX_SHAPE_LPC_ORDER - orderT; /* The following loop runs ( length + order ) times, with ( order ) extra epilogues. */ @@ -153,7 +157,8 @@ opus_int o = orderT; int32x4_t state_QS_s32x4 3 2 ; - ALLOC( state, length + orderT, opus_int32 ); + /* The additional +4 is to ensure a later vld1q_s32 call does not overflow. */ + ALLOC( state, length + order + 4, opus_int32 ); state_QS_s32x4 2 1 = vdupq_n_s32( 0 ); /* Calculate 8 taps of all inputs in each loop. */
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/fixed/burg_modified_FIX.c -> _service:tar_scm:opus-1.4.tar.gz/silk/fixed/burg_modified_FIX.c
Changed
@@ -68,7 +68,7 @@ celt_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE ); /* Compute autocorrelations, added over subframes */ - C0_64 = silk_inner_prod16_aligned_64( x, x, subfr_length*nb_subfr, arch ); + C0_64 = silk_inner_prod16( x, x, subfr_length*nb_subfr, arch ); lz = silk_CLZ64(C0_64); rshifts = 32 + 1 + N_BITS_HEAD_ROOM - lz; if (rshifts > MAX_RSHIFTS) rshifts = MAX_RSHIFTS; @@ -87,7 +87,7 @@ x_ptr = x + s * subfr_length; for( n = 1; n < D + 1; n++ ) { C_first_row n - 1 += (opus_int32)silk_RSHIFT64( - silk_inner_prod16_aligned_64( x_ptr, x_ptr + n, subfr_length - n, arch ), rshifts ); + silk_inner_prod16( x_ptr, x_ptr + n, subfr_length - n, arch ), rshifts ); } } } else { @@ -150,7 +150,7 @@ C_first_row k = silk_MLA( C_first_row k , x1, x_ptr n - k - 1 ); /* Q( -rshifts ) */ C_last_row k = silk_MLA( C_last_row k , x2, x_ptr subfr_length - n + k ); /* Q( -rshifts ) */ Atmp1 = silk_RSHIFT_ROUND( Af_QA k , QA - 17 ); /* Q17 */ - /* We sometimes have get overflows in the multiplications (even beyond +/- 2^32), + /* We sometimes get overflows in the multiplications (even beyond +/- 2^32), but they cancel each other and the real result seems to always fit in a 32-bit signed integer. This was determined experimentally, not theoretically (unfortunately). */ tmp1 = silk_MLA_ovflw( tmp1, x_ptr n - k - 1 , Atmp1 ); /* Q17 */ @@ -253,7 +253,7 @@ if( rshifts > 0 ) { for( s = 0; s < nb_subfr; s++ ) { x_ptr = x + s * subfr_length; - C0 -= (opus_int32)silk_RSHIFT64( silk_inner_prod16_aligned_64( x_ptr, x_ptr, D, arch ), rshifts ); + C0 -= (opus_int32)silk_RSHIFT64( silk_inner_prod16( x_ptr, x_ptr, D, arch ), rshifts ); } } else { for( s = 0; s < nb_subfr; s++ ) {
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/fixed/find_pred_coefs_FIX.c -> _service:tar_scm:opus-1.4.tar.gz/silk/fixed/find_pred_coefs_FIX.c
Changed
@@ -42,7 +42,8 @@ { opus_int i; opus_int32 invGains_Q16 MAX_NB_SUBFR , local_gains MAX_NB_SUBFR ; - opus_int16 NLSF_Q15 MAX_LPC_ORDER ; + /* Set to NLSF_Q15 to zero so we don't copy junk to the state. */ + opus_int16 NLSF_Q15 MAX_LPC_ORDER ={0}; const opus_int16 *x_ptr; opus_int16 *x_pre_ptr; VARDECL( opus_int16, LPC_in_pre );
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/fixed/vector_ops_FIX.c -> _service:tar_scm:opus-1.4.tar.gz/silk/fixed/vector_ops_FIX.c
Changed
@@ -87,7 +87,7 @@ #endif } -opus_int64 silk_inner_prod16_aligned_64_c( +opus_int64 silk_inner_prod16_c( const opus_int16 *inVec1, /* I input vector 1 */ const opus_int16 *inVec2, /* I input vector 2 */ const opus_int len /* I vector lengths */
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/fixed/x86/burg_modified_FIX_sse4_1.c -> _service:tar_scm:opus-1.4.tar.gz/silk/fixed/x86/burg_modified_FIX_sse4_1.c
Changed
@@ -1,5 +1,5 @@ -/* Copyright (c) 2014, Cisco Systems, INC - Written by XiangMingZhu WeiZhou MinPeng YanWang +/* Copyright (c) 2014-2020, Cisco Systems, INC + Written by XiangMingZhu WeiZhou MinPeng YanWang FrancisQuiers Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -42,7 +42,7 @@ #define MAX_FRAME_SIZE 384 /* subfr_length * nb_subfr = ( 0.005 * 16000 + 16 ) * 4 = 384 */ #define QA 25 -#define N_BITS_HEAD_ROOM 2 +#define N_BITS_HEAD_ROOM 3 #define MIN_RSHIFTS -16 #define MAX_RSHIFTS (32 - QA) @@ -59,7 +59,7 @@ int arch /* I Run-time architecture */ ) { - opus_int k, n, s, lz, rshifts, rshifts_extra, reached_max_gain; + opus_int k, n, s, lz, rshifts, reached_max_gain; opus_int32 C0, num, nrg, rc_Q31, invGain_Q30, Atmp_QA, Atmp1, tmp1, tmp2, x1, x2; const opus_int16 *x_ptr; opus_int32 C_first_row SILK_MAX_ORDER_LPC ; @@ -68,6 +68,7 @@ opus_int32 CAf SILK_MAX_ORDER_LPC + 1 ; opus_int32 CAb SILK_MAX_ORDER_LPC + 1 ; opus_int32 xcorr SILK_MAX_ORDER_LPC ; + opus_int64 C0_64; __m128i FIRST_3210, LAST_3210, ATMP_3210, TMP1_3210, TMP2_3210, T1_3210, T2_3210, PTR_3210, SUBFR_3210, X1_3210, X2_3210; __m128i CONST1 = _mm_set1_epi32(1); @@ -75,23 +76,18 @@ celt_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE ); /* Compute autocorrelations, added over subframes */ - silk_sum_sqr_shift( &C0, &rshifts, x, nb_subfr * subfr_length ); - if( rshifts > MAX_RSHIFTS ) { - C0 = silk_LSHIFT32( C0, rshifts - MAX_RSHIFTS ); - silk_assert( C0 > 0 ); - rshifts = MAX_RSHIFTS; + C0_64 = silk_inner_prod16( x, x, subfr_length*nb_subfr, arch ); + lz = silk_CLZ64(C0_64); + rshifts = 32 + 1 + N_BITS_HEAD_ROOM - lz; + if (rshifts > MAX_RSHIFTS) rshifts = MAX_RSHIFTS; + if (rshifts < MIN_RSHIFTS) rshifts = MIN_RSHIFTS; + + if (rshifts > 0) { + C0 = (opus_int32)silk_RSHIFT64(C0_64, rshifts ); } else { - lz = silk_CLZ32( C0 ) - 1; - rshifts_extra = N_BITS_HEAD_ROOM - lz; - if( rshifts_extra > 0 ) { - rshifts_extra = silk_min( rshifts_extra, MAX_RSHIFTS - rshifts ); - C0 = silk_RSHIFT32( C0, rshifts_extra ); - } else { - rshifts_extra = silk_max( rshifts_extra, MIN_RSHIFTS - rshifts ); - C0 = silk_LSHIFT32( C0, -rshifts_extra ); - } - rshifts += rshifts_extra; + C0 = silk_LSHIFT32((opus_int32)C0_64, -rshifts ); } + CAb 0 = CAf 0 = C0 + silk_SMMUL( SILK_FIX_CONST( FIND_LPC_COND_FAC, 32 ), C0 ) + 1; /* Q(-rshifts) */ silk_memset( C_first_row, 0, SILK_MAX_ORDER_LPC * sizeof( opus_int32 ) ); if( rshifts > 0 ) { @@ -99,7 +95,7 @@ x_ptr = x + s * subfr_length; for( n = 1; n < D + 1; n++ ) { C_first_row n - 1 += (opus_int32)silk_RSHIFT64( - silk_inner_prod16_aligned_64( x_ptr, x_ptr + n, subfr_length - n, arch ), rshifts ); + silk_inner_prod16( x_ptr, x_ptr + n, subfr_length - n, arch ), rshifts ); } } } else { @@ -203,8 +199,11 @@ C_first_row k = silk_MLA( C_first_row k , x1, x_ptr n - k - 1 ); /* Q( -rshifts ) */ C_last_row k = silk_MLA( C_last_row k , x2, x_ptr subfr_length - n + k ); /* Q( -rshifts ) */ Atmp1 = silk_RSHIFT_ROUND( Af_QA k , QA - 17 ); /* Q17 */ - tmp1 = silk_MLA( tmp1, x_ptr n - k - 1 , Atmp1 ); /* Q17 */ - tmp2 = silk_MLA( tmp2, x_ptr subfr_length - n + k , Atmp1 ); /* Q17 */ + /* We sometimes get overflows in the multiplications (even beyond +/- 2^32), + but they cancel each other and the real result seems to always fit in a 32-bit + signed integer. This was determined experimentally, not theoretically (unfortunately). */ + tmp1 = silk_MLA_ovflw( tmp1, x_ptr n - k - 1 , Atmp1 ); /* Q17 */ + tmp2 = silk_MLA_ovflw( tmp2, x_ptr subfr_length - n + k , Atmp1 ); /* Q17 */ } tmp1 = -tmp1; /* Q17 */ @@ -350,7 +349,7 @@ if( rshifts > 0 ) { for( s = 0; s < nb_subfr; s++ ) { x_ptr = x + s * subfr_length; - C0 -= (opus_int32)silk_RSHIFT64( silk_inner_prod16_aligned_64( x_ptr, x_ptr, D, arch ), rshifts ); + C0 -= (opus_int32)silk_RSHIFT64( silk_inner_prod16( x_ptr, x_ptr, D, arch ), rshifts ); } } else { for( s = 0; s < nb_subfr; s++ ) { @@ -374,4 +373,28 @@ *res_nrg = silk_SMLAWW( nrg, silk_SMMUL( SILK_FIX_CONST( FIND_LPC_COND_FAC, 32 ), C0 ), -tmp1 );/* Q( -rshifts ) */ *res_nrg_Q = -rshifts; } + +#ifdef OPUS_CHECK_ASM + { + opus_int32 res_nrg_c = 0; + opus_int res_nrg_Q_c = 0; + opus_int32 A_Q16_c MAX_LPC_ORDER = {0}; + + silk_burg_modified_c( + &res_nrg_c, + &res_nrg_Q_c, + A_Q16_c, + x, + minInvGain_Q30, + subfr_length, + nb_subfr, + D, + 0 + ); + + silk_assert( *res_nrg == res_nrg_c ); + silk_assert( *res_nrg_Q == res_nrg_Q_c ); + silk_assert( !memcmp( A_Q16, A_Q16_c, D * sizeof( *A_Q16 ) ) ); + } +#endif }
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/fixed/x86/vector_ops_FIX_sse4_1.c -> _service:tar_scm:opus-1.4.tar.gz/silk/fixed/x86/vector_ops_FIX_sse4_1.c
Changed
@@ -36,40 +36,38 @@ #include "SigProc_FIX.h" #include "pitch.h" +#include "celt/x86/x86cpu.h" -opus_int64 silk_inner_prod16_aligned_64_sse4_1( +opus_int64 silk_inner_prod16_sse4_1( const opus_int16 *inVec1, /* I input vector 1 */ const opus_int16 *inVec2, /* I input vector 2 */ const opus_int len /* I vector lengths */ ) { - opus_int i, dataSize8; + opus_int i, dataSize4; opus_int64 sum; - __m128i xmm_tempa; - __m128i inVec1_76543210, acc1; - __m128i inVec2_76543210, acc2; + __m128i xmm_prod_20, xmm_prod_31; + __m128i inVec1_3210, acc1; + __m128i inVec2_3210, acc2; sum = 0; - dataSize8 = len & ~7; + dataSize4 = len & ~3; acc1 = _mm_setzero_si128(); acc2 = _mm_setzero_si128(); - for( i = 0; i < dataSize8; i += 8 ) { - inVec1_76543210 = _mm_loadu_si128( (__m128i *)(&inVec1i + 0 ) ); - inVec2_76543210 = _mm_loadu_si128( (__m128i *)(&inVec2i + 0 ) ); + for( i = 0; i < dataSize4; i += 4 ) { + inVec1_3210 = OP_CVTEPI16_EPI32_M64( &inVec1i + 0 ); + inVec2_3210 = OP_CVTEPI16_EPI32_M64( &inVec2i + 0 ); + xmm_prod_20 = _mm_mul_epi32( inVec1_3210, inVec2_3210 ); - /* only when all 4 operands are -32768 (0x8000), this results in wrap around */ - inVec1_76543210 = _mm_madd_epi16( inVec1_76543210, inVec2_76543210 ); + inVec1_3210 = _mm_shuffle_epi32( inVec1_3210, _MM_SHUFFLE( 0, 3, 2, 1 ) ); + inVec2_3210 = _mm_shuffle_epi32( inVec2_3210, _MM_SHUFFLE( 0, 3, 2, 1 ) ); + xmm_prod_31 = _mm_mul_epi32( inVec1_3210, inVec2_3210 ); - xmm_tempa = _mm_cvtepi32_epi64( inVec1_76543210 ); - /* equal shift right 8 bytes */ - inVec1_76543210 = _mm_shuffle_epi32( inVec1_76543210, _MM_SHUFFLE( 0, 0, 3, 2 ) ); - inVec1_76543210 = _mm_cvtepi32_epi64( inVec1_76543210 ); - - acc1 = _mm_add_epi64( acc1, xmm_tempa ); - acc2 = _mm_add_epi64( acc2, inVec1_76543210 ); + acc1 = _mm_add_epi64( acc1, xmm_prod_20 ); + acc2 = _mm_add_epi64( acc2, xmm_prod_31 ); } acc1 = _mm_add_epi64( acc1, acc2 ); @@ -81,8 +79,15 @@ _mm_storel_epi64( (__m128i *)&sum, acc1 ); for( ; i < len; i++ ) { - sum = silk_SMLABB( sum, inVec1 i , inVec2 i ); + sum = silk_SMLALBB( sum, inVec1 i , inVec2 i ); + } + +#ifdef OPUS_CHECK_ASM + { + opus_int64 sum_c = silk_inner_prod16_c( inVec1, inVec2, len ); + silk_assert( sum == sum_c ); } +#endif return sum; }
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/float/LTP_scale_ctrl_FLP.c -> _service:tar_scm:opus-1.4.tar.gz/silk/float/LTP_scale_ctrl_FLP.c
Changed
@@ -41,8 +41,14 @@ if( condCoding == CODE_INDEPENDENTLY ) { /* Only scale if first frame in packet */ - round_loss = psEnc->sCmn.PacketLoss_perc + psEnc->sCmn.nFramesPerPacket; - psEnc->sCmn.indices.LTP_scaleIndex = (opus_int8)silk_LIMIT( round_loss * psEncCtrl->LTPredCodGain * 0.1f, 0.0f, 2.0f ); + round_loss = psEnc->sCmn.PacketLoss_perc * psEnc->sCmn.nFramesPerPacket; + if ( psEnc->sCmn.LBRR_flag ) { + /* LBRR reduces the effective loss. In practice, it does not square the loss because + losses aren't independent, but that still seems to work best. We also never go below 2%. */ + round_loss = 2 + silk_SMULBB( round_loss, round_loss) / 100; + } + psEnc->sCmn.indices.LTP_scaleIndex = silk_SMULBB( psEncCtrl->LTPredCodGain, round_loss ) > silk_log2lin( 2900 - psEnc->sCmn.SNR_dB_Q7 ); + psEnc->sCmn.indices.LTP_scaleIndex += silk_SMULBB( psEncCtrl->LTPredCodGain, round_loss ) > silk_log2lin( 3900 - psEnc->sCmn.SNR_dB_Q7 ); } else { /* Default is minimum scaling */ psEnc->sCmn.indices.LTP_scaleIndex = 0;
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/float/find_pred_coefs_FLP.c -> _service:tar_scm:opus-1.4.tar.gz/silk/float/find_pred_coefs_FLP.c
Changed
@@ -44,7 +44,8 @@ silk_float XXLTP MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ; silk_float xXLTP MAX_NB_SUBFR * LTP_ORDER ; silk_float invGains MAX_NB_SUBFR ; - opus_int16 NLSF_Q15 MAX_LPC_ORDER ; + /* Set to NLSF_Q15 to zero so we don't copy junk to the state. */ + opus_int16 NLSF_Q15 MAX_LPC_ORDER ={0}; const silk_float *x_ptr; silk_float *x_pre_ptr, LPC_in_pre MAX_NB_SUBFR * MAX_LPC_ORDER + MAX_FRAME_LENGTH ; silk_float minInvGain;
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/float/wrappers_FLP.c -> _service:tar_scm:opus-1.4.tar.gz/silk/float/wrappers_FLP.c
Changed
@@ -190,12 +190,14 @@ opus_int32 XX_Q17 MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ; opus_int32 xX_Q17 MAX_NB_SUBFR * LTP_ORDER ; - for( i = 0; i < nb_subfr * LTP_ORDER * LTP_ORDER; i++ ) { + i = 0; + do { XX_Q17 i = (opus_int32)silk_float2int( XX i * 131072.0f ); - } - for( i = 0; i < nb_subfr * LTP_ORDER; i++ ) { + } while ( ++i < nb_subfr * LTP_ORDER * LTP_ORDER ); + i = 0; + do { xX_Q17 i = (opus_int32)silk_float2int( xX i * 131072.0f ); - } + } while ( ++i < nb_subfr * LTP_ORDER ); silk_quant_LTP_gains( B_Q14, cbk_index, periodicity_index, sum_log_gain_Q7, &pred_gain_dB_Q7, XX_Q17, xX_Q17, subfr_len, nb_subfr, arch );
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/main.h -> _service:tar_scm:opus-1.4.tar.gz/silk/main.h
Changed
@@ -247,21 +247,21 @@ /************************************/ void silk_NSQ_c( - const silk_encoder_state *psEncC, /* I Encoder State */ - silk_nsq_state *NSQ, /* I/O NSQ state */ - SideInfoIndices *psIndices, /* I/O Quantization Indices */ - const opus_int16 x16, /* I Input */ - opus_int8 pulses, /* O Quantized pulse signal */ - const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ - const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ - const opus_int16 AR_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ - const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ - const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ - const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ - const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ - const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ - const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ - const opus_int LTP_scale_Q14 /* I LTP state scaling */ + const silk_encoder_state *psEncC, /* I Encoder State */ + silk_nsq_state *NSQ, /* I/O NSQ state */ + SideInfoIndices *psIndices, /* I/O Quantization Indices */ + const opus_int16 x16, /* I Input */ + opus_int8 pulses, /* O Quantized pulse signal */ + const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ + const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ + const opus_int16 AR_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ + const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ + const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ + const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ + const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ + const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ + const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ + const opus_int LTP_scale_Q14 /* I LTP state scaling */ ); #if !defined(OVERRIDE_silk_NSQ) @@ -273,21 +273,21 @@ /* Noise shaping using delayed decision */ void silk_NSQ_del_dec_c( - const silk_encoder_state *psEncC, /* I Encoder State */ - silk_nsq_state *NSQ, /* I/O NSQ state */ - SideInfoIndices *psIndices, /* I/O Quantization Indices */ - const opus_int16 x16, /* I Input */ - opus_int8 pulses, /* O Quantized pulse signal */ - const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ - const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ - const opus_int16 AR_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ - const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ - const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ - const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ - const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ - const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ - const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ - const opus_int LTP_scale_Q14 /* I LTP state scaling */ + const silk_encoder_state *psEncC, /* I Encoder State */ + silk_nsq_state *NSQ, /* I/O NSQ state */ + SideInfoIndices *psIndices, /* I/O Quantization Indices */ + const opus_int16 x16, /* I Input */ + opus_int8 pulses, /* O Quantized pulse signal */ + const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ + const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ + const opus_int16 AR_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ + const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ + const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ + const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ + const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ + const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ + const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ + const opus_int LTP_scale_Q14 /* I LTP state scaling */ ); #if !defined(OVERRIDE_silk_NSQ_del_dec)
View file
_service:tar_scm:opus-1.4.tar.gz/silk/meson.build
Added
@@ -0,0 +1,63 @@ +silk_sources = sources'SILK_SOURCES' + +silk_sources_sse4_1 = sources'SILK_SOURCES_SSE4_1' + +silk_sources_neon_intr = sources'SILK_SOURCES_ARM_NEON_INTR' + +silk_sources_fixed_neon_intr = sources'SILK_SOURCES_FIXED_ARM_NEON_INTR' + +silk_sources_fixed = sources'SILK_SOURCES_FIXED' + +silk_sources_fixed_sse4_1 = sources'SILK_SOURCES_FIXED_SSE4_1' + +silk_sources_float = sources'SILK_SOURCES_FLOAT' + +if opt_fixed_point + silk_sources += silk_sources_fixed +else + silk_sources += silk_sources_float +endif + +silk_includes = opus_includes, include_directories('float', 'fixed') +silk_static_libs = + +if host_cpu_family in 'x86', 'x86_64' and opus_conf.has('OPUS_HAVE_RTCD') + silk_sources += sources'SILK_SOURCES_X86_RTCD' +endif + +if host_cpu_family in 'arm', 'aarch64' and have_arm_intrinsics_or_asm + if opus_conf.has('OPUS_HAVE_RTCD') + silk_sources += sources'SILK_SOURCES_ARM_RTCD' + endif +endif + +foreach intr_name : 'sse4_1', 'neon_intr' + have_intr = get_variable('have_' + intr_name) + if not have_intr + continue + endif + + intr_sources = get_variable('silk_sources_' + intr_name) + if opt_fixed_point + intr_sources += get_variable('silk_sources_fixed_' + intr_name) + endif + + intr_args = get_variable('opus_@0@_args'.format(intr_name), ) + silk_static_libs += static_library('silk_' + intr_name, intr_sources, + c_args: intr_args, + include_directories: silk_includes, + install: false) +endforeach + +silk_c_args = +if host_machine.system() == 'windows' + silk_c_args += '-DDLL_EXPORT' +endif + +silk_lib = static_library('opus-silk', + silk_sources, + c_args: silk_c_args, + include_directories: silk_includes, + link_whole: silk_static_libs, + dependencies: libm, + install: false)
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/stereo_LR_to_MS.c -> _service:tar_scm:opus-1.4.tar.gz/silk/stereo_LR_to_MS.c
Changed
@@ -77,7 +77,7 @@ ALLOC( LP_mid, frame_length, opus_int16 ); ALLOC( HP_mid, frame_length, opus_int16 ); for( n = 0; n < frame_length; n++ ) { - sum = silk_RSHIFT_ROUND( silk_ADD_LSHIFT( mid n + (opus_int32)mid n + 2 , mid n + 1 , 1 ), 2 ); + sum = silk_RSHIFT_ROUND( silk_ADD_LSHIFT32( mid n + (opus_int32)mid n + 2 , mid n + 1 , 1 ), 2 ); LP_mid n = sum; HP_mid n = mid n + 1 - sum; } @@ -86,7 +86,7 @@ ALLOC( LP_side, frame_length, opus_int16 ); ALLOC( HP_side, frame_length, opus_int16 ); for( n = 0; n < frame_length; n++ ) { - sum = silk_RSHIFT_ROUND( silk_ADD_LSHIFT( side n + (opus_int32)side n + 2 , side n + 1 , 1 ), 2 ); + sum = silk_RSHIFT_ROUND( silk_ADD_LSHIFT32( side n + (opus_int32)side n + 2 , side n + 1 , 1 ), 2 ); LP_side n = sum; HP_side n = side n + 1 - sum; } @@ -207,7 +207,7 @@ pred0_Q13 += delta0_Q13; pred1_Q13 += delta1_Q13; w_Q24 += deltaw_Q24; - sum = silk_LSHIFT( silk_ADD_LSHIFT( mid n + (opus_int32)mid n + 2 , mid n + 1 , 1 ), 9 ); /* Q11 */ + sum = silk_LSHIFT( silk_ADD_LSHIFT32( mid n + (opus_int32)mid n + 2 , mid n + 1 , 1 ), 9 ); /* Q11 */ sum = silk_SMLAWB( silk_SMULWB( w_Q24, side n + 1 ), sum, pred0_Q13 ); /* Q8 */ sum = silk_SMLAWB( sum, silk_LSHIFT( (opus_int32)mid n + 1 , 11 ), pred1_Q13 ); /* Q8 */ x2 n - 1 = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( sum, 8 ) ); @@ -217,7 +217,7 @@ pred1_Q13 = -pred_Q13 1 ; w_Q24 = silk_LSHIFT( width_Q14, 10 ); for( n = STEREO_INTERP_LEN_MS * fs_kHz; n < frame_length; n++ ) { - sum = silk_LSHIFT( silk_ADD_LSHIFT( mid n + (opus_int32)mid n + 2 , mid n + 1 , 1 ), 9 ); /* Q11 */ + sum = silk_LSHIFT( silk_ADD_LSHIFT32( mid n + (opus_int32)mid n + 2 , mid n + 1 , 1 ), 9 ); /* Q11 */ sum = silk_SMLAWB( silk_SMULWB( w_Q24, side n + 1 ), sum, pred0_Q13 ); /* Q8 */ sum = silk_SMLAWB( sum, silk_LSHIFT( (opus_int32)mid n + 1 , 11 ), pred1_Q13 ); /* Q8 */ x2 n - 1 = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( sum, 8 ) );
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/stereo_MS_to_LR.c -> _service:tar_scm:opus-1.4.tar.gz/silk/stereo_MS_to_LR.c
Changed
@@ -59,7 +59,7 @@ for( n = 0; n < STEREO_INTERP_LEN_MS * fs_kHz; n++ ) { pred0_Q13 += delta0_Q13; pred1_Q13 += delta1_Q13; - sum = silk_LSHIFT( silk_ADD_LSHIFT( x1 n + x1 n + 2 , x1 n + 1 , 1 ), 9 ); /* Q11 */ + sum = silk_LSHIFT( silk_ADD_LSHIFT32( x1 n + (opus_int32)x1 n + 2 , x1 n + 1 , 1 ), 9 ); /* Q11 */ sum = silk_SMLAWB( silk_LSHIFT( (opus_int32)x2 n + 1 , 8 ), sum, pred0_Q13 ); /* Q8 */ sum = silk_SMLAWB( sum, silk_LSHIFT( (opus_int32)x1 n + 1 , 11 ), pred1_Q13 ); /* Q8 */ x2 n + 1 = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( sum, 8 ) ); @@ -67,7 +67,7 @@ pred0_Q13 = pred_Q13 0 ; pred1_Q13 = pred_Q13 1 ; for( n = STEREO_INTERP_LEN_MS * fs_kHz; n < frame_length; n++ ) { - sum = silk_LSHIFT( silk_ADD_LSHIFT( x1 n + x1 n + 2 , x1 n + 1 , 1 ), 9 ); /* Q11 */ + sum = silk_LSHIFT( silk_ADD_LSHIFT32( x1 n + (opus_int32)x1 n + 2 , x1 n + 1 , 1 ), 9 ); /* Q11 */ sum = silk_SMLAWB( silk_LSHIFT( (opus_int32)x2 n + 1 , 8 ), sum, pred0_Q13 ); /* Q8 */ sum = silk_SMLAWB( sum, silk_LSHIFT( (opus_int32)x1 n + 1 , 11 ), pred1_Q13 ); /* Q8 */ x2 n + 1 = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( sum, 8 ) );
View file
_service:tar_scm:opus-1.4.tar.gz/silk/tests/meson.build
Added
@@ -0,0 +1,8 @@ +exe = executable('test_unit_LPC_inv_pred_gain', + 'test_unit_LPC_inv_pred_gain.c', '../LPC_inv_pred_gain.c', + include_directories: opus_includes, + link_with: celt_lib, celt_static_libs, silk_lib, silk_static_libs, + dependencies: libm, + install: false) + +test(test_name, exe)
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/tests/test_unit_LPC_inv_pred_gain.c -> _service:tar_scm:opus-1.4.tar.gz/silk/tests/test_unit_LPC_inv_pred_gain.c
Changed
@@ -43,6 +43,7 @@ int i; int j; int sum_a, sum_abs_a; + double ySILK_MAX_ORDER_LPC = {0}; sum_a = sum_abs_a = 0; for( j = 0; j < order; j++ ) { sum_a += A_Q12 j ; @@ -57,7 +58,6 @@ if( sum_abs_a < 4096 ) { return 1; } - double ySILK_MAX_ORDER_LPC = {0}; y0 = 1; for( i = 0; i < 10000; i++ ) { double sum = 0;
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/typedef.h -> _service:tar_scm:opus-1.4.tar.gz/silk/typedef.h
Changed
@@ -67,6 +67,9 @@ static OPUS_INLINE void _silk_fatal(const char *str, const char *file, int line) { fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str); +#if defined(_MSC_VER) + _set_abort_behavior( 0, _WRITE_ABORT_MSG); +#endif abort(); } # define silk_assert(COND) {if (!(COND)) {silk_fatal("assertion failed: " #COND);}}
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/x86/NSQ_del_dec_sse4_1.c -> _service:tar_scm:opus-1.4.tar.gz/silk/x86/NSQ_del_dec_sse4_1.c
Changed
@@ -1,5 +1,5 @@ -/* Copyright (c) 2014, Cisco Systems, INC - Written by XiangMingZhu WeiZhou MinPeng YanWang +/* Copyright (c) 2014-2020, Cisco Systems, INC + Written by XiangMingZhu WeiZhou MinPeng YanWang FrancisQuiers Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -46,6 +46,7 @@ opus_int32 Shape_Q14 DECISION_DELAY ; opus_int32 sAR2_Q14 MAX_SHAPE_LPC_ORDER ; opus_int32 LF_AR_Q14; + opus_int32 Diff_Q14; opus_int32 Seed; opus_int32 SeedInit; opus_int32 RD_Q10; @@ -56,6 +57,7 @@ opus_int32 RD_Q10; opus_int32 xq_Q14; opus_int32 LF_AR_Q14; + opus_int32 Diff_Q14; opus_int32 sLTP_shp_Q14; opus_int32 LPC_exc_Q14; } NSQ_sample_struct; @@ -66,7 +68,7 @@ const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ NSQ_del_dec_struct psDelDec, /* I/O Delayed decision states */ - const opus_int32 x_Q3, /* I Input in Q3 */ + const opus_int16 x16, /* I Input */ opus_int32 x_sc_Q10, /* O Input scaled with 1/Gain in Q10 */ const opus_int16 sLTP, /* I Re-whitened LTP state in Q0 */ opus_int32 sLTP_Q15, /* O LTP state matching scaled input */ @@ -112,21 +114,21 @@ ); void silk_NSQ_del_dec_sse4_1( - const silk_encoder_state *psEncC, /* I Encoder State */ - silk_nsq_state *NSQ, /* I/O NSQ state */ - SideInfoIndices *psIndices, /* I/O Quantization Indices */ - const opus_int32 x_Q3, /* I Prefiltered input signal */ - opus_int8 pulses, /* O Quantized pulse signal */ - const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ - const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ - const opus_int16 AR2_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ - const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ - const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ - const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ - const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ - const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ - const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ - const opus_int LTP_scale_Q14 /* I LTP state scaling */ + const silk_encoder_state *psEncC, /* I Encoder State */ + silk_nsq_state *NSQ, /* I/O NSQ state */ + SideInfoIndices *psIndices, /* I/O Quantization Indices */ + const opus_int16 x16, /* I Input */ + opus_int8 pulses, /* O Quantized pulse signal */ + const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ + const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ + const opus_int16 AR_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ + const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ + const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ + const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ + const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ + const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ + const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ + const opus_int LTP_scale_Q14 /* I LTP state scaling */ ) { opus_int i, k, lag, start_idx, LSF_interpolation_flag, Winner_ind, subfr; @@ -142,8 +144,39 @@ VARDECL( opus_int32, delayedGain_Q10 ); VARDECL( NSQ_del_dec_struct, psDelDec ); NSQ_del_dec_struct *psDD; +#ifdef OPUS_CHECK_ASM + silk_nsq_state NSQ_c; + SideInfoIndices psIndices_c; + opus_int8 pulses_c MAX_FRAME_LENGTH ; + const opus_int8 *const pulses_a = pulses; +#endif SAVE_STACK; +#ifdef OPUS_CHECK_ASM + ( void )pulses_a; + silk_memcpy( &NSQ_c, NSQ, sizeof( NSQ_c ) ); + silk_memcpy( &psIndices_c, psIndices, sizeof( psIndices_c ) ); + silk_assert( psEncC->nb_subfr * psEncC->subfr_length <= MAX_FRAME_LENGTH ); + silk_memcpy( pulses_c, pulses, psEncC->nb_subfr * psEncC->subfr_length * sizeof( pulses0 ) ); + silk_NSQ_del_dec_c( + psEncC, + &NSQ_c, + &psIndices_c, + x16, + pulses_c, + PredCoef_Q12, + LTPCoef_Q14, + AR_Q13, + HarmShapeGain_Q14, + Tilt_Q14, + LF_shp_Q14, + Gains_Q16, + pitchL, + Lambda_Q10, + LTP_scale_Q14 + ); +#endif + /* Set unvoiced lag to the previous one, overwrite later for voiced */ lag = NSQ->lagPrev; @@ -158,6 +191,7 @@ psDD->SeedInit = psDD->Seed; psDD->RD_Q10 = 0; psDD->LF_AR_Q14 = NSQ->sLF_AR_shp_Q14; + psDD->Diff_Q14 = NSQ->sDiff_shp_Q14; psDD->Shape_Q14 0 = NSQ->sLTP_shp_Q14 psEncC->ltp_mem_length - 1 ; silk_memcpy( psDD->sLPC_Q14, NSQ->sLPC_Q14, NSQ_LPC_BUF_LENGTH * sizeof( opus_int32 ) ); silk_memcpy( psDD->sAR2_Q14, NSQ->sAR2_Q14, sizeof( NSQ->sAR2_Q14 ) ); @@ -185,8 +219,7 @@ LSF_interpolation_flag = 1; } - ALLOC( sLTP_Q15, - psEncC->ltp_mem_length + psEncC->frame_length, opus_int32 ); + ALLOC( sLTP_Q15, psEncC->ltp_mem_length + psEncC->frame_length, opus_int32 ); ALLOC( sLTP, psEncC->ltp_mem_length + psEncC->frame_length, opus_int16 ); ALLOC( x_sc_Q10, psEncC->subfr_length, opus_int32 ); ALLOC( delayedGain_Q10, DECISION_DELAY, opus_int32 ); @@ -198,7 +231,7 @@ for( k = 0; k < psEncC->nb_subfr; k++ ) { A_Q12 = &PredCoef_Q12 ( ( k >> 1 ) | ( 1 - LSF_interpolation_flag ) ) * MAX_LPC_ORDER ; B_Q14 = <PCoef_Q14 k * LTP_ORDER ; - AR_shp_Q13 = &AR2_Q13 k * MAX_SHAPE_LPC_ORDER ; + AR_shp_Q13 = &AR_Q13 k * MAX_SHAPE_LPC_ORDER ; /* Noise shape parameters */ silk_assert( HarmShapeGain_Q14 k >= 0 ); @@ -257,7 +290,7 @@ } } - silk_nsq_del_dec_scale_states_sse4_1( psEncC, NSQ, psDelDec, x_Q3, x_sc_Q10, sLTP, sLTP_Q15, k, + silk_nsq_del_dec_scale_states_sse4_1( psEncC, NSQ, psDelDec, x16, x_sc_Q10, sLTP, sLTP_Q15, k, psEncC->nStatesDelayedDecision, LTP_scale_Q14, Gains_Q16, pitchL, psIndices->signalType, decisionDelay ); silk_noise_shape_quantizer_del_dec_sse4_1( NSQ, psDelDec, psIndices->signalType, x_sc_Q10, pulses, pxq, sLTP_Q15, @@ -265,7 +298,7 @@ Gains_Q16 k , Lambda_Q10, offset_Q10, psEncC->subfr_length, subfr++, psEncC->shapingLPCOrder, psEncC->predictLPCOrder, psEncC->warping_Q16, psEncC->nStatesDelayedDecision, &smpl_buf_idx, decisionDelay ); - x_Q3 += psEncC->subfr_length; + x16 += psEncC->subfr_length; pulses += psEncC->subfr_length; pxq += psEncC->subfr_length; } @@ -288,6 +321,7 @@ for( i = 0; i < decisionDelay; i++ ) { last_smple_idx = ( last_smple_idx - 1 ) % DECISION_DELAY; if( last_smple_idx < 0 ) last_smple_idx += DECISION_DELAY; + pulses i - decisionDelay = (opus_int8)silk_RSHIFT_ROUND( psDD->Q_Q10 last_smple_idx , 10 ); pxq i - decisionDelay = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( silk_SMULWW( psDD->Xq_Q14 last_smple_idx , Gain_Q10 ), 8 ) ); @@ -298,11 +332,19 @@ /* Update states */ NSQ->sLF_AR_shp_Q14 = psDD->LF_AR_Q14; + NSQ->sDiff_shp_Q14 = psDD->Diff_Q14; NSQ->lagPrev = pitchL psEncC->nb_subfr - 1 ; /* Save quantized speech signal */ silk_memmove( NSQ->xq, &NSQ->xq psEncC->frame_length , psEncC->ltp_mem_length * sizeof( opus_int16 ) ); silk_memmove( NSQ->sLTP_shp_Q14, &NSQ->sLTP_shp_Q14 psEncC->frame_length , psEncC->ltp_mem_length * sizeof( opus_int32 ) ); + +#ifdef OPUS_CHECK_ASM + silk_assert( !memcmp( &NSQ_c, NSQ, sizeof( NSQ_c ) ) ); + silk_assert( !memcmp( &psIndices_c, psIndices, sizeof( psIndices_c ) ) ); + silk_assert( !memcmp( pulses_c, pulses_a, psEncC->nb_subfr * psEncC->subfr_length * sizeof( pulses0 ) ) ); +#endif + RESTORE_STACK; } @@ -345,6 +387,8 @@ opus_int32 q1_Q0, q1_Q10, q2_Q10, exc_Q14, LPC_exc_Q14, xq_Q14, Gain_Q10; opus_int32 tmp1, tmp2, sLF_AR_shp_Q14; opus_int32 *pred_lag_ptr, *shp_lag_ptr, *psLPC_Q14; + int rdo_offset; + VARDECL( NSQ_sample_pair, psSampleState ); NSQ_del_dec_struct *psDD; NSQ_sample_struct *psSS; @@ -356,6 +400,8 @@ celt_assert( nStatesDelayedDecision > 0 ); ALLOC( psSampleState, nStatesDelayedDecision, NSQ_sample_pair ); + rdo_offset = (Lambda_Q10 >> 1) - 512; + shp_lag_ptr = &NSQ->sLTP_shp_Q14 NSQ->sLTP_shp_buf_idx - lag + HARM_SHAPE_FIR_TAPS / 2 ; pred_lag_ptr = &sLTP_Q15 NSQ->sLTP_buf_idx - lag + LTP_ORDER / 2 ;
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/x86/NSQ_sse4_1.c -> _service:tar_scm:opus-1.4.tar.gz/silk/x86/NSQ_sse4_1.c
Changed
@@ -1,5 +1,5 @@ -/* Copyright (c) 2014, Cisco Systems, INC - Written by XiangMingZhu WeiZhou MinPeng YanWang +/* Copyright (c) 2014-2020, Cisco Systems, INC + Written by XiangMingZhu WeiZhou MinPeng YanWang FrancisQuiers Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -37,17 +37,17 @@ #include "stack_alloc.h" static OPUS_INLINE void silk_nsq_scale_states_sse4_1( - const silk_encoder_state *psEncC, /* I Encoder State */ - silk_nsq_state *NSQ, /* I/O NSQ state */ - const opus_int32 x_Q3, /* I input in Q3 */ - opus_int32 x_sc_Q10, /* O input scaled with 1/Gain */ - const opus_int16 sLTP, /* I re-whitened LTP state in Q0 */ - opus_int32 sLTP_Q15, /* O LTP state matching scaled input */ - opus_int subfr, /* I subframe number */ - const opus_int LTP_scale_Q14, /* I */ - const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I */ - const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lag */ - const opus_int signal_type /* I Signal type */ + const silk_encoder_state *psEncC, /* I Encoder State */ + silk_nsq_state *NSQ, /* I/O NSQ state */ + const opus_int16 x16, /* I input */ + opus_int32 x_sc_Q10, /* O input scaled with 1/Gain */ + const opus_int16 sLTP, /* I re-whitened LTP state in Q0 */ + opus_int32 sLTP_Q15, /* O LTP state matching scaled input */ + opus_int subfr, /* I subframe number */ + const opus_int LTP_scale_Q14, /* I */ + const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I */ + const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lag */ + const opus_int signal_type /* I Signal type */ ); static OPUS_INLINE void silk_noise_shape_quantizer_10_16_sse4_1( @@ -65,27 +65,28 @@ opus_int Tilt_Q14, /* I Spectral tilt */ opus_int32 LF_shp_Q14, /* I */ opus_int32 Gain_Q16, /* I */ + opus_int Lambda_Q10, /* I */ opus_int offset_Q10, /* I */ opus_int length, /* I Input length */ opus_int32 table4 /* I */ ); void silk_NSQ_sse4_1( - const silk_encoder_state *psEncC, /* I Encoder State */ - silk_nsq_state *NSQ, /* I/O NSQ state */ - SideInfoIndices *psIndices, /* I/O Quantization Indices */ - const opus_int32 x_Q3, /* I Prefiltered input signal */ - opus_int8 pulses, /* O Quantized pulse signal */ - const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ - const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ - const opus_int16 AR2_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ - const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ - const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ - const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ - const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ - const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ - const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ - const opus_int LTP_scale_Q14 /* I LTP state scaling */ + const silk_encoder_state *psEncC, /* I Encoder State */ + silk_nsq_state *NSQ, /* I/O NSQ state */ + SideInfoIndices *psIndices, /* I/O Quantization Indices */ + const opus_int16 x16, /* I Input */ + opus_int8 pulses, /* O Quantized pulse signal */ + const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ + const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ + const opus_int16 AR_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ + const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ + const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ + const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ + const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ + const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ + const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ + const opus_int LTP_scale_Q14 /* I LTP state scaling */ ) { opus_int k, lag, start_idx, LSF_interpolation_flag; @@ -101,8 +102,41 @@ opus_int32 tmp1; opus_int32 q1_Q10, q2_Q10, rd1_Q20, rd2_Q20; +#ifdef OPUS_CHECK_ASM + silk_nsq_state NSQ_c; + SideInfoIndices psIndices_c; + opus_int8 pulses_c MAX_FRAME_LENGTH ; + const opus_int8 *const pulses_a = pulses; +#endif + SAVE_STACK; +#ifdef OPUS_CHECK_ASM + ( void )pulses_a; + silk_memcpy( &NSQ_c, NSQ, sizeof( NSQ_c ) ); + silk_memcpy( &psIndices_c, psIndices, sizeof( psIndices_c ) ); + silk_assert( psEncC->nb_subfr * psEncC->subfr_length <= MAX_FRAME_LENGTH ); + silk_memcpy( pulses_c, pulses, psEncC->nb_subfr * psEncC->subfr_length * sizeof( pulses0 ) ); + + silk_NSQ_c( + psEncC, + &NSQ_c, + &psIndices_c, + x16, + pulses_c, + PredCoef_Q12, + LTPCoef_Q14, + AR_Q13, + HarmShapeGain_Q14, + Tilt_Q14, + LF_shp_Q14, + Gains_Q16, + pitchL, + Lambda_Q10, + LTP_scale_Q14 + ); +#endif + NSQ->rand_seed = psIndices->Seed; /* Set unvoiced lag to the previous one, overwrite later for voiced */ @@ -172,8 +206,7 @@ LSF_interpolation_flag = 1; } - ALLOC( sLTP_Q15, - psEncC->ltp_mem_length + psEncC->frame_length, opus_int32 ); + ALLOC( sLTP_Q15, psEncC->ltp_mem_length + psEncC->frame_length, opus_int32 ); ALLOC( sLTP, psEncC->ltp_mem_length + psEncC->frame_length, opus_int16 ); ALLOC( x_sc_Q10, psEncC->subfr_length, opus_int32 ); /* Set up pointers to start of sub frame */ @@ -183,7 +216,7 @@ for( k = 0; k < psEncC->nb_subfr; k++ ) { A_Q12 = &PredCoef_Q12 (( k >> 1 ) | ( 1 - LSF_interpolation_flag )) * MAX_LPC_ORDER ; B_Q14 = <PCoef_Q14 k * LTP_ORDER ; - AR_shp_Q13 = &AR2_Q13 k * MAX_SHAPE_LPC_ORDER ; + AR_shp_Q13 = &AR_Q13 k * MAX_SHAPE_LPC_ORDER ; /* Noise shape parameters */ silk_assert( HarmShapeGain_Q14 k >= 0 ); @@ -209,12 +242,12 @@ } } - silk_nsq_scale_states_sse4_1( psEncC, NSQ, x_Q3, x_sc_Q10, sLTP, sLTP_Q15, k, LTP_scale_Q14, Gains_Q16, pitchL, psIndices->signalType ); + silk_nsq_scale_states_sse4_1( psEncC, NSQ, x16, x_sc_Q10, sLTP, sLTP_Q15, k, LTP_scale_Q14, Gains_Q16, pitchL, psIndices->signalType ); if ( opus_likely( ( 10 == psEncC->shapingLPCOrder ) && ( 16 == psEncC->predictLPCOrder) ) ) { silk_noise_shape_quantizer_10_16_sse4_1( NSQ, psIndices->signalType, x_sc_Q10, pulses, pxq, sLTP_Q15, A_Q12, B_Q14, - AR_shp_Q13, lag, HarmShapeFIRPacked_Q14, Tilt_Q14 k , LF_shp_Q14 k , Gains_Q16 k , + AR_shp_Q13, lag, HarmShapeFIRPacked_Q14, Tilt_Q14 k , LF_shp_Q14 k , Gains_Q16 k , Lambda_Q10, offset_Q10, psEncC->subfr_length, &(table32) ); } else @@ -224,7 +257,7 @@ offset_Q10, psEncC->subfr_length, psEncC->shapingLPCOrder, psEncC->predictLPCOrder, psEncC->arch ); } - x_Q3 += psEncC->subfr_length; + x16 += psEncC->subfr_length; pulses += psEncC->subfr_length; pxq += psEncC->subfr_length; } @@ -235,12 +268,19 @@ /* Save quantized speech and noise shaping signals */ silk_memmove( NSQ->xq, &NSQ->xq psEncC->frame_length , psEncC->ltp_mem_length * sizeof( opus_int16 ) ); silk_memmove( NSQ->sLTP_shp_Q14, &NSQ->sLTP_shp_Q14 psEncC->frame_length , psEncC->ltp_mem_length * sizeof( opus_int32 ) ); + +#ifdef OPUS_CHECK_ASM + silk_assert( !memcmp( &NSQ_c, NSQ, sizeof( NSQ_c ) ) ); + silk_assert( !memcmp( &psIndices_c, psIndices, sizeof( psIndices_c ) ) ); + silk_assert( !memcmp( pulses_c, pulses_a, psEncC->nb_subfr * psEncC->subfr_length * sizeof( pulses0 ) ) ); +#endif + RESTORE_STACK; } -/***********************************/ -/* silk_noise_shape_quantizer_10_16 */ -/***********************************/ +/************************************/ +/* silk_noise_shape_quantizer_10_16 */ +/************************************/ static OPUS_INLINE void silk_noise_shape_quantizer_10_16_sse4_1( silk_nsq_state *NSQ, /* I/O NSQ state */ opus_int signalType, /* I Signal type */ @@ -256,6 +296,7 @@ opus_int Tilt_Q14, /* I Spectral tilt */ opus_int32 LF_shp_Q14, /* I */ opus_int32 Gain_Q16, /* I */ + opus_int Lambda_Q10, /* I */ opus_int offset_Q10, /* I */ opus_int length, /* I Input length */ opus_int32 table4 /* I */ @@ -264,7 +305,7 @@ opus_int i; opus_int32 LTP_pred_Q13, LPC_pred_Q10, n_AR_Q12, n_LTP_Q13;
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/x86/SigProc_FIX_sse.h -> _service:tar_scm:opus-1.4.tar.gz/silk/x86/SigProc_FIX_sse.h
Changed
@@ -26,13 +26,13 @@ */ #ifndef SIGPROC_FIX_SSE_H -#define SIGPROC_FIX_SSE_H +# define SIGPROC_FIX_SSE_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +# ifdef HAVE_CONFIG_H +# include "config.h" +# endif -#if defined(OPUS_X86_MAY_HAVE_SSE4_1) +# if defined(OPUS_X86_MAY_HAVE_SSE4_1) void silk_burg_modified_sse4_1( opus_int32 *res_nrg, /* O Residual energy */ opus_int *res_nrg_Q, /* O Residual energy Q value */ @@ -45,11 +45,13 @@ int arch /* I Run-time architecture */ ); -#if defined(OPUS_X86_PRESUME_SSE4_1) -#define silk_burg_modified(res_nrg, res_nrg_Q, A_Q16, x, minInvGain_Q30, subfr_length, nb_subfr, D, arch) \ - ((void)(arch), silk_burg_modified_sse4_1(res_nrg, res_nrg_Q, A_Q16, x, minInvGain_Q30, subfr_length, nb_subfr, D, arch)) +# if defined(OPUS_X86_PRESUME_SSE4_1) + +# define OVERRIDE_silk_burg_modified +# define silk_burg_modified(res_nrg, res_nrg_Q, A_Q16, x, minInvGain_Q30, subfr_length, nb_subfr, D, arch) \ + ((void)(arch), silk_burg_modified_sse4_1(res_nrg, res_nrg_Q, A_Q16, x, minInvGain_Q30, subfr_length, nb_subfr, D, arch)) -#else +# elif defined(OPUS_HAVE_RTCD) extern void (*const SILK_BURG_MODIFIED_IMPLOPUS_ARCHMASK + 1)( opus_int32 *res_nrg, /* O Residual energy */ @@ -62,33 +64,36 @@ const opus_int D, /* I Order */ int arch /* I Run-time architecture */); -# define silk_burg_modified(res_nrg, res_nrg_Q, A_Q16, x, minInvGain_Q30, subfr_length, nb_subfr, D, arch) \ - ((*SILK_BURG_MODIFIED_IMPL(arch) & OPUS_ARCHMASK)(res_nrg, res_nrg_Q, A_Q16, x, minInvGain_Q30, subfr_length, nb_subfr, D, arch)) +# define OVERRIDE_silk_burg_modified +# define silk_burg_modified(res_nrg, res_nrg_Q, A_Q16, x, minInvGain_Q30, subfr_length, nb_subfr, D, arch) \ + ((*SILK_BURG_MODIFIED_IMPL(arch) & OPUS_ARCHMASK)(res_nrg, res_nrg_Q, A_Q16, x, minInvGain_Q30, subfr_length, nb_subfr, D, arch)) -#endif +# endif -opus_int64 silk_inner_prod16_aligned_64_sse4_1( +opus_int64 silk_inner_prod16_sse4_1( const opus_int16 *inVec1, const opus_int16 *inVec2, const opus_int len ); -#if defined(OPUS_X86_PRESUME_SSE4_1) +# if defined(OPUS_X86_PRESUME_SSE4_1) -#define silk_inner_prod16_aligned_64(inVec1, inVec2, len, arch) \ - ((void)(arch),silk_inner_prod16_aligned_64_sse4_1(inVec1, inVec2, len)) +# define OVERRIDE_silk_inner_prod16 +# define silk_inner_prod16(inVec1, inVec2, len, arch) \ + ((void)(arch),silk_inner_prod16_sse4_1(inVec1, inVec2, len)) -#else +# elif defined(OPUS_HAVE_RTCD) -extern opus_int64 (*const SILK_INNER_PROD16_ALIGNED_64_IMPLOPUS_ARCHMASK + 1)( +extern opus_int64 (*const SILK_INNER_PROD16_IMPLOPUS_ARCHMASK + 1)( const opus_int16 *inVec1, const opus_int16 *inVec2, const opus_int len); -# define silk_inner_prod16_aligned_64(inVec1, inVec2, len, arch) \ - ((*SILK_INNER_PROD16_ALIGNED_64_IMPL(arch) & OPUS_ARCHMASK)(inVec1, inVec2, len)) +# define OVERRIDE_silk_inner_prod16 +# define silk_inner_prod16(inVec1, inVec2, len, arch) \ + ((*SILK_INNER_PROD16_IMPL(arch) & OPUS_ARCHMASK)(inVec1, inVec2, len)) -#endif -#endif +# endif +# endif #endif
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/x86/VAD_sse4_1.c -> _service:tar_scm:opus-1.4.tar.gz/silk/x86/VAD_sse4_1.c
Changed
@@ -1,5 +1,5 @@ -/* Copyright (c) 2014, Cisco Systems, INC - Written by XiangMingZhu WeiZhou MinPeng YanWang +/* Copyright (c) 2014-2020, Cisco Systems, INC + Written by XiangMingZhu WeiZhou MinPeng YanWang FrancisQuiers Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -63,6 +63,14 @@ SAVE_STACK; +#ifdef OPUS_CHECK_ASM + silk_encoder_state psEncC_c; + opus_int ret_c; + + silk_memcpy( &psEncC_c, psEncC, sizeof( psEncC_c ) ); + ret_c = silk_VAD_GetSA_Q8_c( &psEncC_c, pIn ); +#endif + /* Safety checks */ silk_assert( VAD_N_BANDS == 4 ); celt_assert( MAX_FRAME_LENGTH >= psEncC->frame_length ); @@ -233,15 +241,14 @@ speech_nrg += ( b + 1 ) * silk_RSHIFT( Xnrg b - psSilk_VAD->NL b , 4 ); } + if( psEncC->frame_length == 20 * psEncC->fs_kHz ) { + speech_nrg = silk_RSHIFT32( speech_nrg, 1 ); + } /* Power scaling */ if( speech_nrg <= 0 ) { SA_Q15 = silk_RSHIFT( SA_Q15, 1 ); - } else if( speech_nrg < 32768 ) { - if( psEncC->frame_length == 10 * psEncC->fs_kHz ) { - speech_nrg = silk_LSHIFT_SAT32( speech_nrg, 16 ); - } else { - speech_nrg = silk_LSHIFT_SAT32( speech_nrg, 15 ); - } + } else if( speech_nrg < 16384 ) { + speech_nrg = silk_LSHIFT32( speech_nrg, 16 ); /* square-root */ speech_nrg = silk_SQRT_APPROX( speech_nrg ); @@ -272,6 +279,11 @@ psEncC->input_quality_bands_Q15 b = silk_sigm_Q15( silk_RSHIFT( SNR_Q7 - 16 * 128, 4 ) ); } +#ifdef OPUS_CHECK_ASM + silk_assert( ret == ret_c ); + silk_assert( !memcmp( &psEncC_c, psEncC, sizeof( psEncC_c ) ) ); +#endif + RESTORE_STACK; return( ret ); }
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/x86/VQ_WMat_EC_sse4_1.c -> _service:tar_scm:opus-1.4.tar.gz/silk/x86/VQ_WMat_EC_sse4_1.c
Changed
@@ -1,5 +1,5 @@ -/* Copyright (c) 2014, Cisco Systems, INC - Written by XiangMingZhu WeiZhou MinPeng YanWang +/* Copyright (c) 2014-2020, Cisco Systems, INC + Written by XiangMingZhu WeiZhou MinPeng YanWang FrancisQuiers Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -38,105 +38,136 @@ /* Entropy constrained matrix-weighted VQ, hard-coded to 5-element vectors, for a single input data vector */ void silk_VQ_WMat_EC_sse4_1( opus_int8 *ind, /* O index of best codebook vector */ - opus_int32 *rate_dist_Q14, /* O best weighted quant error + mu * rate */ + opus_int32 *res_nrg_Q15, /* O best residual energy */ + opus_int32 *rate_dist_Q8, /* O best total bitrate */ opus_int *gain_Q7, /* O sum of absolute LTP coefficients */ - const opus_int16 *in_Q14, /* I input vector to be quantized */ - const opus_int32 *W_Q18, /* I weighting matrix */ + const opus_int32 *XX_Q17, /* I correlation matrix */ + const opus_int32 *xX_Q17, /* I correlation vector */ const opus_int8 *cb_Q7, /* I codebook */ const opus_uint8 *cb_gain_Q7, /* I codebook effective gain */ const opus_uint8 *cl_Q5, /* I code length for each codebook vector */ - const opus_int mu_Q9, /* I tradeoff betw. weighted error and rate */ + const opus_int subfr_len, /* I number of samples per subframe */ const opus_int32 max_gain_Q7, /* I maximum sum of absolute LTP coefficients */ - opus_int L /* I number of vectors in codebook */ + const opus_int L /* I number of vectors in codebook */ ) { opus_int k, gain_tmp_Q7; const opus_int8 *cb_row_Q7; - opus_int16 diff_Q14 5 ; - opus_int32 sum1_Q14, sum2_Q16; + opus_int32 neg_xX_Q24 5 ; + opus_int32 sum1_Q15, sum2_Q24; + opus_int32 bits_res_Q8, bits_tot_Q8; + __m128i v_XX_31_Q17, v_XX_42_Q17, v_cb_row_31_Q7, v_cb_row_42_Q7, v_acc1_Q24, v_acc2_Q24; + + /* Negate and convert to new Q domain */ + neg_xX_Q24 0 = -silk_LSHIFT32( xX_Q17 0 , 7 ); + neg_xX_Q24 1 = -silk_LSHIFT32( xX_Q17 1 , 7 ); + neg_xX_Q24 2 = -silk_LSHIFT32( xX_Q17 2 , 7 ); + neg_xX_Q24 3 = -silk_LSHIFT32( xX_Q17 3 , 7 ); + neg_xX_Q24 4 = -silk_LSHIFT32( xX_Q17 4 , 7 ); + + v_XX_31_Q17 = _mm_loadu_si128( (__m128i *)(&XX_Q17 1 ) ); + v_XX_42_Q17 = _mm_shuffle_epi32( v_XX_31_Q17, _MM_SHUFFLE( 0, 3, 2, 1 ) ); - __m128i C_tmp1, C_tmp2, C_tmp3, C_tmp4, C_tmp5; /* Loop over codebook */ - *rate_dist_Q14 = silk_int32_MAX; + *rate_dist_Q8 = silk_int32_MAX; + *res_nrg_Q15 = silk_int32_MAX; cb_row_Q7 = cb_Q7; + /* If things go really bad, at least *ind is set to something safe. */ + *ind = 0; for( k = 0; k < L; k++ ) { + opus_int32 penalty; gain_tmp_Q7 = cb_gain_Q7k; - - diff_Q14 0 = in_Q14 0 - silk_LSHIFT( cb_row_Q7 0 , 7 ); - - C_tmp1 = OP_CVTEPI16_EPI32_M64( &in_Q14 1 ); - C_tmp2 = OP_CVTEPI8_EPI32_M32( &cb_row_Q7 1 ); - C_tmp2 = _mm_slli_epi32( C_tmp2, 7 ); - C_tmp1 = _mm_sub_epi32( C_tmp1, C_tmp2 ); - - diff_Q14 1 = _mm_extract_epi16( C_tmp1, 0 ); - diff_Q14 2 = _mm_extract_epi16( C_tmp1, 2 ); - diff_Q14 3 = _mm_extract_epi16( C_tmp1, 4 ); - diff_Q14 4 = _mm_extract_epi16( C_tmp1, 6 ); - /* Weighted rate */ - sum1_Q14 = silk_SMULBB( mu_Q9, cl_Q5 k ); + /* Quantization error: 1 - 2 * xX * cb + cb' * XX * cb */ + sum1_Q15 = SILK_FIX_CONST( 1.001, 15 ); /* Penalty for too large gain */ - sum1_Q14 = silk_ADD_LSHIFT32( sum1_Q14, silk_max( silk_SUB32( gain_tmp_Q7, max_gain_Q7 ), 0 ), 10 ); - - silk_assert( sum1_Q14 >= 0 ); - - /* first row of W_Q18 */ - C_tmp3 = _mm_loadu_si128( (__m128i *)(&W_Q18 1 ) ); - C_tmp4 = _mm_mul_epi32( C_tmp3, C_tmp1 ); - C_tmp4 = _mm_srli_si128( C_tmp4, 2 ); - - C_tmp1 = _mm_shuffle_epi32( C_tmp1, _MM_SHUFFLE( 0, 3, 2, 1 ) ); /* shift right 4 bytes */ - C_tmp3 = _mm_shuffle_epi32( C_tmp3, _MM_SHUFFLE( 0, 3, 2, 1 ) ); /* shift right 4 bytes */ - - C_tmp5 = _mm_mul_epi32( C_tmp3, C_tmp1 ); - C_tmp5 = _mm_srli_si128( C_tmp5, 2 ); - - C_tmp5 = _mm_add_epi32( C_tmp4, C_tmp5 ); - C_tmp5 = _mm_slli_epi32( C_tmp5, 1 ); - - C_tmp5 = _mm_add_epi32( C_tmp5, _mm_shuffle_epi32( C_tmp5, _MM_SHUFFLE( 0, 0, 0, 2 ) ) ); - sum2_Q16 = _mm_cvtsi128_si32( C_tmp5 ); - - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18 0 , diff_Q14 0 ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14 0 ); - - /* second row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18 7 , diff_Q14 2 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18 8 , diff_Q14 3 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18 9 , diff_Q14 4 ); - sum2_Q16 = silk_LSHIFT( sum2_Q16, 1 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18 6 , diff_Q14 1 ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14 1 ); - - /* third row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18 13 , diff_Q14 3 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18 14 , diff_Q14 4 ); - sum2_Q16 = silk_LSHIFT( sum2_Q16, 1 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18 12 , diff_Q14 2 ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14 2 ); - - /* fourth row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18 19 , diff_Q14 4 ); - sum2_Q16 = silk_LSHIFT( sum2_Q16, 1 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18 18 , diff_Q14 3 ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14 3 ); - - /* last row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18 24 , diff_Q14 4 ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14 4 ); - - silk_assert( sum1_Q14 >= 0 ); + penalty = silk_LSHIFT32( silk_max( silk_SUB32( gain_tmp_Q7, max_gain_Q7 ), 0 ), 11 ); + + /* first row of XX_Q17 */ + v_cb_row_31_Q7 = OP_CVTEPI8_EPI32_M32( &cb_row_Q7 1 ); + v_cb_row_42_Q7 = _mm_shuffle_epi32( v_cb_row_31_Q7, _MM_SHUFFLE( 0, 3, 2, 1 ) ); + v_cb_row_31_Q7 = _mm_mul_epi32( v_XX_31_Q17, v_cb_row_31_Q7 ); + v_cb_row_42_Q7 = _mm_mul_epi32( v_XX_42_Q17, v_cb_row_42_Q7 ); + v_acc1_Q24 = _mm_add_epi64( v_cb_row_31_Q7, v_cb_row_42_Q7); + v_acc2_Q24 = _mm_shuffle_epi32( v_acc1_Q24, _MM_SHUFFLE( 1, 0, 3, 2 ) ); + v_acc1_Q24 = _mm_add_epi64( v_acc1_Q24, v_acc2_Q24); + sum2_Q24 = _mm_cvtsi128_si32( v_acc1_Q24 ); + sum2_Q24 = silk_ADD32( neg_xX_Q24 0 , sum2_Q24 ); + sum2_Q24 = silk_LSHIFT32( sum2_Q24, 1 ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17 0 , cb_row_Q7 0 ); + sum1_Q15 = silk_SMLAWB( sum1_Q15, sum2_Q24, cb_row_Q7 0 ); + + /* second row of XX_Q17 */ + sum2_Q24 = silk_MLA( neg_xX_Q24 1 , XX_Q17 7 , cb_row_Q7 2 ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17 8 , cb_row_Q7 3 ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17 9 , cb_row_Q7 4 ); + sum2_Q24 = silk_LSHIFT32( sum2_Q24, 1 ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17 6 , cb_row_Q7 1 ); + sum1_Q15 = silk_SMLAWB( sum1_Q15, sum2_Q24, cb_row_Q7 1 ); + + /* third row of XX_Q17 */ + sum2_Q24 = silk_MLA( neg_xX_Q24 2 , XX_Q17 13 , cb_row_Q7 3 ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17 14 , cb_row_Q7 4 ); + sum2_Q24 = silk_LSHIFT32( sum2_Q24, 1 ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17 12 , cb_row_Q7 2 ); + sum1_Q15 = silk_SMLAWB( sum1_Q15, sum2_Q24, cb_row_Q7 2 ); + + /* fourth row of XX_Q17 */ + sum2_Q24 = silk_MLA( neg_xX_Q24 3 , XX_Q17 19 , cb_row_Q7 4 ); + sum2_Q24 = silk_LSHIFT32( sum2_Q24, 1 ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17 18 , cb_row_Q7 3 ); + sum1_Q15 = silk_SMLAWB( sum1_Q15, sum2_Q24, cb_row_Q7 3 ); + + /* last row of XX_Q17 */ + sum2_Q24 = silk_LSHIFT32( neg_xX_Q24 4 , 1 ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17 24 , cb_row_Q7 4 ); + sum1_Q15 = silk_SMLAWB( sum1_Q15, sum2_Q24, cb_row_Q7 4 ); /* find best */ - if( sum1_Q14 < *rate_dist_Q14 ) { - *rate_dist_Q14 = sum1_Q14; - *ind = (opus_int8)k; - *gain_Q7 = gain_tmp_Q7; + if( sum1_Q15 >= 0 ) { + /* Translate residual energy to bits using high-rate assumption (6 dB ==> 1 bit/sample) */ + bits_res_Q8 = silk_SMULBB( subfr_len, silk_lin2log( sum1_Q15 + penalty) - (15 << 7) ); + /* In the following line we reduce the codelength component by half ("-1"); seems to slightly improve quality */ + bits_tot_Q8 = silk_ADD_LSHIFT32( bits_res_Q8, cl_Q5 k , 3-1 ); + if( bits_tot_Q8 <= *rate_dist_Q8 ) { + *rate_dist_Q8 = bits_tot_Q8; + *res_nrg_Q15 = sum1_Q15 + penalty; + *ind = (opus_int8)k; + *gain_Q7 = gain_tmp_Q7; + } } /* Go to next cbk vector */ cb_row_Q7 += LTP_ORDER; } + +#ifdef OPUS_CHECK_ASM + { + opus_int8 ind_c = 0; + opus_int32 res_nrg_Q15_c = 0; + opus_int32 rate_dist_Q8_c = 0; + opus_int gain_Q7_c = 0; +
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/x86/main_sse.h -> _service:tar_scm:opus-1.4.tar.gz/silk/x86/main_sse.h
Changed
@@ -26,171 +26,169 @@ */ #ifndef MAIN_SSE_H -#define MAIN_SSE_H +# define MAIN_SSE_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +# ifdef HAVE_CONFIG_H +# include "config.h" +# endif # if defined(OPUS_X86_MAY_HAVE_SSE4_1) -#if 0 /* FIXME: SSE disabled until silk_VQ_WMat_EC_sse4_1() gets updated. */ -# define OVERRIDE_silk_VQ_WMat_EC - void silk_VQ_WMat_EC_sse4_1( opus_int8 *ind, /* O index of best codebook vector */ - opus_int32 *rate_dist_Q14, /* O best weighted quant error + mu * rate */ + opus_int32 *res_nrg_Q15, /* O best residual energy */ + opus_int32 *rate_dist_Q8, /* O best total bitrate */ opus_int *gain_Q7, /* O sum of absolute LTP coefficients */ - const opus_int16 *in_Q14, /* I input vector to be quantized */ - const opus_int32 *W_Q18, /* I weighting matrix */ + const opus_int32 *XX_Q17, /* I correlation matrix */ + const opus_int32 *xX_Q17, /* I correlation vector */ const opus_int8 *cb_Q7, /* I codebook */ const opus_uint8 *cb_gain_Q7, /* I codebook effective gain */ const opus_uint8 *cl_Q5, /* I code length for each codebook vector */ - const opus_int mu_Q9, /* I tradeoff betw. weighted error and rate */ + const opus_int subfr_len, /* I number of samples per subframe */ const opus_int32 max_gain_Q7, /* I maximum sum of absolute LTP coefficients */ - opus_int L /* I number of vectors in codebook */ + const opus_int L /* I number of vectors in codebook */ ); -#if defined OPUS_X86_PRESUME_SSE4_1 +# if defined OPUS_X86_PRESUME_SSE4_1 -#define silk_VQ_WMat_EC(ind, rate_dist_Q14, gain_Q7, in_Q14, W_Q18, cb_Q7, cb_gain_Q7, cl_Q5, \ - mu_Q9, max_gain_Q7, L, arch) \ - ((void)(arch),silk_VQ_WMat_EC_sse4_1(ind, rate_dist_Q14, gain_Q7, in_Q14, W_Q18, cb_Q7, cb_gain_Q7, cl_Q5, \ - mu_Q9, max_gain_Q7, L)) +# define OVERRIDE_silk_VQ_WMat_EC +# define silk_VQ_WMat_EC(ind, res_nrg_Q15, rate_dist_Q8, gain_Q7, XX_Q17, xX_Q17, cb_Q7, cb_gain_Q7, cl_Q5, \ + subfr_len, max_gain_Q7, L, arch) \ + ((void)(arch),silk_VQ_WMat_EC_sse4_1(ind, res_nrg_Q15, rate_dist_Q8, gain_Q7, XX_Q17, xX_Q17, cb_Q7, cb_gain_Q7, cl_Q5, \ + subfr_len, max_gain_Q7, L)) -#else +# elif defined(OPUS_HAVE_RTCD) extern void (*const SILK_VQ_WMAT_EC_IMPLOPUS_ARCHMASK + 1)( opus_int8 *ind, /* O index of best codebook vector */ - opus_int32 *rate_dist_Q14, /* O best weighted quant error + mu * rate */ + opus_int32 *res_nrg_Q15, /* O best residual energy */ + opus_int32 *rate_dist_Q8, /* O best total bitrate */ opus_int *gain_Q7, /* O sum of absolute LTP coefficients */ - const opus_int16 *in_Q14, /* I input vector to be quantized */ - const opus_int32 *W_Q18, /* I weighting matrix */ + const opus_int32 *XX_Q17, /* I correlation matrix */ + const opus_int32 *xX_Q17, /* I correlation vector */ const opus_int8 *cb_Q7, /* I codebook */ const opus_uint8 *cb_gain_Q7, /* I codebook effective gain */ const opus_uint8 *cl_Q5, /* I code length for each codebook vector */ - const opus_int mu_Q9, /* I tradeoff betw. weighted error and rate */ + const opus_int subfr_len, /* I number of samples per subframe */ const opus_int32 max_gain_Q7, /* I maximum sum of absolute LTP coefficients */ - opus_int L /* I number of vectors in codebook */ + const opus_int L /* I number of vectors in codebook */ ); -# define silk_VQ_WMat_EC(ind, rate_dist_Q14, gain_Q7, in_Q14, W_Q18, cb_Q7, cb_gain_Q7, cl_Q5, \ - mu_Q9, max_gain_Q7, L, arch) \ - ((*SILK_VQ_WMAT_EC_IMPL(arch) & OPUS_ARCHMASK)(ind, rate_dist_Q14, gain_Q7, in_Q14, W_Q18, cb_Q7, cb_gain_Q7, cl_Q5, \ - mu_Q9, max_gain_Q7, L)) +# define OVERRIDE_silk_VQ_WMat_EC +# define silk_VQ_WMat_EC(ind, res_nrg_Q15, rate_dist_Q8, gain_Q7, XX_Q17, xX_Q17, cb_Q7, cb_gain_Q7, cl_Q5, \ + subfr_len, max_gain_Q7, L, arch) \ + ((*SILK_VQ_WMAT_EC_IMPL(arch) & OPUS_ARCHMASK)(ind, res_nrg_Q15, rate_dist_Q8, gain_Q7, XX_Q17, xX_Q17, cb_Q7, cb_gain_Q7, cl_Q5, \ + subfr_len, max_gain_Q7, L)) -#endif -#endif - -#if 0 /* FIXME: SSE disabled until the NSQ code gets updated. */ -# define OVERRIDE_silk_NSQ +# endif void silk_NSQ_sse4_1( - const silk_encoder_state *psEncC, /* I Encoder State */ - silk_nsq_state *NSQ, /* I/O NSQ state */ - SideInfoIndices *psIndices, /* I/O Quantization Indices */ - const opus_int32 x_Q3, /* I Prefiltered input signal */ - opus_int8 pulses, /* O Quantized pulse signal */ - const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ - const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ - const opus_int16 AR2_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ - const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ - const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ - const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ - const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ - const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ - const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ - const opus_int LTP_scale_Q14 /* I LTP state scaling */ + const silk_encoder_state *psEncC, /* I Encoder State */ + silk_nsq_state *NSQ, /* I/O NSQ state */ + SideInfoIndices *psIndices, /* I/O Quantization Indices */ + const opus_int16 x16, /* I Input */ + opus_int8 pulses, /* O Quantized pulse signal */ + const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ + const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ + const opus_int16 AR_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ + const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ + const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ + const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ + const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ + const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ + const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ + const opus_int LTP_scale_Q14 /* I LTP state scaling */ ); -#if defined OPUS_X86_PRESUME_SSE4_1 +# if defined OPUS_X86_PRESUME_SSE4_1 -#define silk_NSQ(psEncC, NSQ, psIndices, x_Q3, pulses, PredCoef_Q12, LTPCoef_Q14, AR2_Q13, \ - HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, pitchL, Lambda_Q10, LTP_scale_Q14, arch) \ +# define OVERRIDE_silk_NSQ +# define silk_NSQ(psEncC, NSQ, psIndices, x_Q3, pulses, PredCoef_Q12, LTPCoef_Q14, AR2_Q13, \ + HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, pitchL, Lambda_Q10, LTP_scale_Q14, arch) \ ((void)(arch),silk_NSQ_sse4_1(psEncC, NSQ, psIndices, x_Q3, pulses, PredCoef_Q12, LTPCoef_Q14, AR2_Q13, \ HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, pitchL, Lambda_Q10, LTP_scale_Q14)) -#else +# elif defined(OPUS_HAVE_RTCD) extern void (*const SILK_NSQ_IMPLOPUS_ARCHMASK + 1)( - const silk_encoder_state *psEncC, /* I Encoder State */ - silk_nsq_state *NSQ, /* I/O NSQ state */ - SideInfoIndices *psIndices, /* I/O Quantization Indices */ - const opus_int32 x_Q3, /* I Prefiltered input signal */ - opus_int8 pulses, /* O Quantized pulse signal */ - const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ - const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ - const opus_int16 AR2_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ - const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ - const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ - const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ - const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ - const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ - const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ - const opus_int LTP_scale_Q14 /* I LTP state scaling */ + const silk_encoder_state *psEncC, /* I Encoder State */ + silk_nsq_state *NSQ, /* I/O NSQ state */ + SideInfoIndices *psIndices, /* I/O Quantization Indices */ + const opus_int16 x16, /* I Input */ + opus_int8 pulses, /* O Quantized pulse signal */ + const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ + const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ + const opus_int16 AR_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ + const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ + const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ + const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ + const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ + const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ + const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ + const opus_int LTP_scale_Q14 /* I LTP state scaling */ ); -# define silk_NSQ(psEncC, NSQ, psIndices, x_Q3, pulses, PredCoef_Q12, LTPCoef_Q14, AR2_Q13, \ - HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, pitchL, Lambda_Q10, LTP_scale_Q14, arch) \ +# define OVERRIDE_silk_NSQ +# define silk_NSQ(psEncC, NSQ, psIndices, x_Q3, pulses, PredCoef_Q12, LTPCoef_Q14, AR2_Q13, \ + HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, pitchL, Lambda_Q10, LTP_scale_Q14, arch) \ ((*SILK_NSQ_IMPL(arch) & OPUS_ARCHMASK)(psEncC, NSQ, psIndices, x_Q3, pulses, PredCoef_Q12, LTPCoef_Q14, AR2_Q13, \ HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, pitchL, Lambda_Q10, LTP_scale_Q14)) -#endif - -# define OVERRIDE_silk_NSQ_del_dec +# endif void silk_NSQ_del_dec_sse4_1( - const silk_encoder_state *psEncC, /* I Encoder State */ - silk_nsq_state *NSQ, /* I/O NSQ state */ - SideInfoIndices *psIndices, /* I/O Quantization Indices */ - const opus_int32 x_Q3, /* I Prefiltered input signal */ - opus_int8 pulses, /* O Quantized pulse signal */ - const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ - const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ - const opus_int16 AR2_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ - const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ - const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ - const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ - const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ - const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ - const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk/x86/x86_silk_map.c -> _service:tar_scm:opus-1.4.tar.gz/silk/x86/x86_silk_map.c
Changed
@@ -35,22 +35,22 @@ #include "pitch.h" #include "main.h" -#if !defined(OPUS_X86_PRESUME_SSE4_1) +#if defined(OPUS_HAVE_RTCD) && !defined(OPUS_X86_PRESUME_SSE4_1) #if defined(FIXED_POINT) #include "fixed/main_FIX.h" -opus_int64 (*const SILK_INNER_PROD16_ALIGNED_64_IMPL OPUS_ARCHMASK + 1 )( +opus_int64 (*const SILK_INNER_PROD16_IMPL OPUS_ARCHMASK + 1 )( const opus_int16 *inVec1, const opus_int16 *inVec2, const opus_int len ) = { - silk_inner_prod16_aligned_64_c, /* non-sse */ - silk_inner_prod16_aligned_64_c, - silk_inner_prod16_aligned_64_c, - MAY_HAVE_SSE4_1( silk_inner_prod16_aligned_64 ), /* sse4.1 */ - MAY_HAVE_SSE4_1( silk_inner_prod16_aligned_64 ) /* avx */ + silk_inner_prod16_c, /* non-sse */ + silk_inner_prod16_c, + silk_inner_prod16_c, + MAY_HAVE_SSE4_1( silk_inner_prod16 ), /* sse4.1 */ + MAY_HAVE_SSE4_1( silk_inner_prod16 ) /* avx */ }; #endif @@ -66,23 +66,22 @@ MAY_HAVE_SSE4_1( silk_VAD_GetSA_Q8 ) /* avx */ }; -#if 0 /* FIXME: SSE disabled until the NSQ code gets updated. */ void (*const SILK_NSQ_IMPL OPUS_ARCHMASK + 1 )( - const silk_encoder_state *psEncC, /* I Encoder State */ - silk_nsq_state *NSQ, /* I/O NSQ state */ - SideInfoIndices *psIndices, /* I/O Quantization Indices */ - const opus_int32 x_Q3, /* I Prefiltered input signal */ - opus_int8 pulses, /* O Quantized pulse signal */ - const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ - const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ - const opus_int16 AR2_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ - const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ - const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ - const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ - const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ - const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ - const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ - const opus_int LTP_scale_Q14 /* I LTP state scaling */ + const silk_encoder_state *psEncC, /* I Encoder State */ + silk_nsq_state *NSQ, /* I/O NSQ state */ + SideInfoIndices *psIndices, /* I/O Quantization Indices */ + const opus_int16 x16, /* I Input */ + opus_int8 pulses, /* O Quantized pulse signal */ + const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ + const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ + const opus_int16 AR_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ + const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ + const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ + const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ + const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ + const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ + const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ + const opus_int LTP_scale_Q14 /* I LTP state scaling */ ) = { silk_NSQ_c, /* non-sse */ silk_NSQ_c, @@ -90,21 +89,20 @@ MAY_HAVE_SSE4_1( silk_NSQ ), /* sse4.1 */ MAY_HAVE_SSE4_1( silk_NSQ ) /* avx */ }; -#endif -#if 0 /* FIXME: SSE disabled until silk_VQ_WMat_EC_sse4_1() gets updated. */ void (*const SILK_VQ_WMAT_EC_IMPL OPUS_ARCHMASK + 1 )( opus_int8 *ind, /* O index of best codebook vector */ - opus_int32 *rate_dist_Q14, /* O best weighted quant error + mu * rate */ + opus_int32 *res_nrg_Q15, /* O best residual energy */ + opus_int32 *rate_dist_Q8, /* O best total bitrate */ opus_int *gain_Q7, /* O sum of absolute LTP coefficients */ - const opus_int16 *in_Q14, /* I input vector to be quantized */ - const opus_int32 *W_Q18, /* I weighting matrix */ + const opus_int32 *XX_Q17, /* I correlation matrix */ + const opus_int32 *xX_Q17, /* I correlation vector */ const opus_int8 *cb_Q7, /* I codebook */ const opus_uint8 *cb_gain_Q7, /* I codebook effective gain */ const opus_uint8 *cl_Q5, /* I code length for each codebook vector */ - const opus_int mu_Q9, /* I tradeoff betw. weighted error and rate */ + const opus_int subfr_len, /* I number of samples per subframe */ const opus_int32 max_gain_Q7, /* I maximum sum of absolute LTP coefficients */ - opus_int L /* I number of vectors in codebook */ + const opus_int L /* I number of vectors in codebook */ ) = { silk_VQ_WMat_EC_c, /* non-sse */ silk_VQ_WMat_EC_c, @@ -112,25 +110,23 @@ MAY_HAVE_SSE4_1( silk_VQ_WMat_EC ), /* sse4.1 */ MAY_HAVE_SSE4_1( silk_VQ_WMat_EC ) /* avx */ }; -#endif -#if 0 /* FIXME: SSE disabled until the NSQ code gets updated. */ void (*const SILK_NSQ_DEL_DEC_IMPL OPUS_ARCHMASK + 1 )( - const silk_encoder_state *psEncC, /* I Encoder State */ - silk_nsq_state *NSQ, /* I/O NSQ state */ - SideInfoIndices *psIndices, /* I/O Quantization Indices */ - const opus_int32 x_Q3, /* I Prefiltered input signal */ - opus_int8 pulses, /* O Quantized pulse signal */ - const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ - const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ - const opus_int16 AR2_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ - const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ - const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ - const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ - const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ - const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ - const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ - const opus_int LTP_scale_Q14 /* I LTP state scaling */ + const silk_encoder_state *psEncC, /* I Encoder State */ + silk_nsq_state *NSQ, /* I/O NSQ state */ + SideInfoIndices *psIndices, /* I/O Quantization Indices */ + const opus_int16 x16, /* I Input */ + opus_int8 pulses, /* O Quantized pulse signal */ + const opus_int16 PredCoef_Q12 2 * MAX_LPC_ORDER , /* I Short term prediction coefs */ + const opus_int16 LTPCoef_Q14 LTP_ORDER * MAX_NB_SUBFR , /* I Long term prediction coefs */ + const opus_int16 AR_Q13 MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER , /* I Noise shaping coefs */ + const opus_int HarmShapeGain_Q14 MAX_NB_SUBFR , /* I Long term shaping coefs */ + const opus_int Tilt_Q14 MAX_NB_SUBFR , /* I Spectral tilt */ + const opus_int32 LF_shp_Q14 MAX_NB_SUBFR , /* I Low frequency shaping coefs */ + const opus_int32 Gains_Q16 MAX_NB_SUBFR , /* I Quantization step sizes */ + const opus_int pitchL MAX_NB_SUBFR , /* I Pitch lags */ + const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ + const opus_int LTP_scale_Q14 /* I LTP state scaling */ ) = { silk_NSQ_del_dec_c, /* non-sse */ silk_NSQ_del_dec_c, @@ -138,7 +134,6 @@ MAY_HAVE_SSE4_1( silk_NSQ_del_dec ), /* sse4.1 */ MAY_HAVE_SSE4_1( silk_NSQ_del_dec ) /* avx */ }; -#endif #if defined(FIXED_POINT)
View file
_service:tar_scm:opus-1.3.1.tar.gz/silk_sources.mk -> _service:tar_scm:opus-1.4.tar.gz/silk_sources.mk
Changed
@@ -77,15 +77,19 @@ silk/stereo_quant_pred.c \ silk/LPC_fit.c -SILK_SOURCES_SSE4_1 = \ +SILK_SOURCES_X86_RTCD = \ +silk/x86/x86_silk_map.c + +SILK_SOURCES_SSE4_1 = \ silk/x86/NSQ_sse4_1.c \ silk/x86/NSQ_del_dec_sse4_1.c \ -silk/x86/x86_silk_map.c \ silk/x86/VAD_sse4_1.c \ silk/x86/VQ_WMat_EC_sse4_1.c +SILK_SOURCES_ARM_RTCD = \ +silk/arm/arm_silk_map.c + SILK_SOURCES_ARM_NEON_INTR = \ -silk/arm/arm_silk_map.c \ silk/arm/biquad_alt_neon_intr.c \ silk/arm/LPC_inv_pred_gain_neon_intr.c \ silk/arm/NSQ_del_dec_neon_intr.c \
View file
_service:tar_scm:opus-1.3.1.tar.gz/src/analysis.c -> _service:tar_scm:opus-1.4.tar.gz/src/analysis.c
Changed
@@ -31,7 +31,9 @@ #define ANALYSIS_C +#ifdef MLP_TRAINING #include <stdio.h> +#endif #include "mathops.h" #include "kiss_fft.h"
View file
_service:tar_scm:opus-1.4.tar.gz/src/meson.build
Added
@@ -0,0 +1,45 @@ +opus_sources = sources'OPUS_SOURCES' + +opus_sources_float = sources'OPUS_SOURCES_FLOAT' + +if not disable_float_api + opus_sources += opus_sources_float +endif + +opus_lib_c_args = +if host_machine.system() == 'windows' + opus_lib_c_args += '-DDLL_EXPORT' +endif + +opus_lib = library('opus', + opus_sources, + version: libversion, + darwin_versions: macosversion, + c_args: opus_lib_c_args, + include_directories: opus_includes, + link_with: celt_lib, silk_lib, + dependencies: libm, + install: true) + +opus_dep = declare_dependency(link_with: opus_lib, + include_directories: opus_public_includes) + +# Extra uninstalled Opus programs +if not extra_programs.disabled() + foreach prog : 'opus_compare', 'opus_demo', 'repacketizer_demo' + executable(prog, '@0@.c'.format(prog), + include_directories: opus_includes, + link_with: opus_lib, + dependencies: libm, + install: false) + endforeach + + if opt_custom_modes + executable('opus_custom_demo', '../celt/opus_custom_demo.c', + include_directories: opus_includes, + link_with: opus_lib, + dependencies: libm, + install: false) + endif + +endif
View file
_service:tar_scm:opus-1.3.1.tar.gz/src/opus_decoder.c -> _service:tar_scm:opus-1.4.tar.gz/src/opus_decoder.c
Changed
@@ -278,7 +278,8 @@ ec_dec_init(&dec,(unsigned char*)data,len); } else { audiosize = frame_size; - mode = st->prev_mode; + /* Run PLC using last used mode (CELT if we ended with CELT redundancy) */ + mode = st->prev_redundancy ? MODE_CELT_ONLY : st->prev_mode; bandwidth = 0; if (mode == 0) @@ -419,7 +420,7 @@ start_band = 0; if (!decode_fec && mode != MODE_CELT_ONLY && data != NULL - && ec_tell(&dec)+17+20*(st->mode == MODE_HYBRID) <= 8*len) + && ec_tell(&dec)+17+20*(mode == MODE_HYBRID) <= 8*len) { /* Check if we have a redundant 0-8 kHz band */ if (mode == MODE_HYBRID) @@ -499,6 +500,11 @@ /* 5 ms redundant frame for CELT->SILK*/ if (redundancy && celt_to_silk) { + /* If the previous frame did not use CELT (the first redundancy frame in + a transition from SILK may have been lost) then the CELT decoder is + stale at this point and the redundancy audio is not useful, however + the final range is still needed (for testing), so the redundancy is + always decoded but the decoded audio may not be used */ MUST_SUCCEED(celt_decoder_ctl(celt_dec, CELT_SET_START_BAND(0))); celt_decode_with_ec(celt_dec, data+len, redundancy_bytes, redundant_audio, F5, NULL, 0); @@ -561,7 +567,10 @@ smooth_fade(pcm+st->channels*(frame_size-F2_5), redundant_audio+st->channels*F2_5, pcm+st->channels*(frame_size-F2_5), F2_5, st->channels, window, st->Fs); } - if (redundancy && celt_to_silk) + /* 5ms redundant frame for CELT->SILK; ignore if the previous frame did not + use CELT (the first redundancy frame in a transition from SILK may have + been lost) */ + if (redundancy && celt_to_silk && (st->prev_mode != MODE_SILK_ONLY || st->prev_redundancy)) { for (c=0;c<st->channels;c++) {
View file
_service:tar_scm:opus-1.3.1.tar.gz/src/opus_encoder.c -> _service:tar_scm:opus-1.4.tar.gz/src/opus_encoder.c
Changed
@@ -87,6 +87,7 @@ int lfe; int arch; int use_dtx; /* general DTX for both SILK and CELT */ + int fec_config; #ifndef DISABLE_FLOAT_API TonalityAnalysisState analysis; #endif @@ -112,7 +113,7 @@ opus_val16 delay_bufferMAX_ENCODER_BUFFER*2; #ifndef DISABLE_FLOAT_API int detected_bandwidth; - int nb_no_activity_frames; + int nb_no_activity_ms_Q1; opus_val32 peak_signal_energy; #endif int nonfinal_frame; /* current frame is not the final in a packet */ @@ -892,44 +893,29 @@ #endif /* Decides if DTX should be turned on (=1) or off (=0) */ -static int decide_dtx_mode(float activity_probability, /* probability that current frame contains speech/music */ - int *nb_no_activity_frames, /* number of consecutive frames with no activity */ - opus_val32 peak_signal_energy, /* peak energy of desired signal detected so far */ - const opus_val16 *pcm, /* input pcm signal */ - int frame_size, /* frame size */ - int channels, - int is_silence, /* only digital silence detected in this frame */ - int arch - ) -{ - opus_val32 noise_energy; - - if (!is_silence) - { - if (activity_probability < DTX_ACTIVITY_THRESHOLD) /* is noise */ - { - noise_energy = compute_frame_energy(pcm, frame_size, channels, arch); +static int decide_dtx_mode(opus_int activity, /* indicates if this frame contains speech/music */ + int *nb_no_activity_ms_Q1, /* number of consecutive milliseconds with no activity, in Q1 */ + int frame_size_ms_Q1 /* number of miliseconds in this update, in Q1 */ + ) - /* but is sufficiently quiet */ - is_silence = peak_signal_energy >= (PSEUDO_SNR_THRESHOLD * noise_energy); - } - } - - if (is_silence) +{ + if (!activity) { - /* The number of consecutive DTX frames should be within the allowed bounds */ - (*nb_no_activity_frames)++; - - if (*nb_no_activity_frames > NB_SPEECH_FRAMES_BEFORE_DTX) + /* The number of consecutive DTX frames should be within the allowed bounds. + Note that the allowed bound is defined in the SILK headers and assumes 20 ms + frames. As this function can be called with any frame length, a conversion to + milliseconds is done before the comparisons. */ + (*nb_no_activity_ms_Q1) += frame_size_ms_Q1; + if (*nb_no_activity_ms_Q1 > NB_SPEECH_FRAMES_BEFORE_DTX*20*2) { - if (*nb_no_activity_frames <= (NB_SPEECH_FRAMES_BEFORE_DTX + MAX_CONSECUTIVE_DTX)) + if (*nb_no_activity_ms_Q1 <= (NB_SPEECH_FRAMES_BEFORE_DTX + MAX_CONSECUTIVE_DTX)*20*2) /* Valid frame for DTX! */ return 1; else - (*nb_no_activity_frames) = NB_SPEECH_FRAMES_BEFORE_DTX; + (*nb_no_activity_ms_Q1) = NB_SPEECH_FRAMES_BEFORE_DTX*20*2; } } else - (*nb_no_activity_frames) = 0; + (*nb_no_activity_ms_Q1) = 0; return 0; } @@ -1102,6 +1088,8 @@ int analysis_read_subframe_bak=-1; int is_silence = 0; #endif + opus_int activity = VAD_NO_DECISION; + VARDECL(opus_val16, tmp_prefill); ALLOC_STACK; @@ -1169,6 +1157,20 @@ if (!is_silence) st->voice_ratio = -1; + if (is_silence) + { + activity = !is_silence; + } else if (analysis_info.valid) + { + activity = analysis_info.activity_probability >= DTX_ACTIVITY_THRESHOLD; + if (!activity) + { + /* Mark as active if this noise frame is sufficiently loud */ + opus_val32 noise_energy = compute_frame_energy(pcm, frame_size, st->channels, st->arch); + activity = st->peak_signal_energy < (PSEUDO_SNR_THRESHOLD * noise_energy); + } + } + st->detected_bandwidth = 0; if (analysis_info.valid) { @@ -1313,6 +1315,8 @@ st->stream_channels = st->force_channels; } else { #ifdef FUZZING + (void)stereo_music_threshold; + (void)stereo_voice_threshold; /* Random mono/stereo decision */ if (st->channels == 2 && (rand()&0x1F)==0) st->stream_channels = 3-st->stream_channels; @@ -1351,6 +1355,8 @@ } else if (st->user_forced_mode == OPUS_AUTO) { #ifdef FUZZING + (void)stereo_width; + (void)mode_thresholds; /* Random mode switching */ if ((rand()&0xF)==0) { @@ -1388,8 +1394,9 @@ st->mode = (equiv_rate >= threshold) ? MODE_CELT_ONLY: MODE_SILK_ONLY; - /* When FEC is enabled and there's enough packet loss, use SILK */ - if (st->silk_mode.useInBandFEC && st->silk_mode.packetLossPercentage > (128-voice_est)>>4) + /* When FEC is enabled and there's enough packet loss, use SILK. + Unless the FEC is set to 2, in which case we don't switch to SILK if we're confident we have music. */ + if (st->silk_mode.useInBandFEC && st->silk_mode.packetLossPercentage > (128-voice_est)>>4 && (st->fec_config != 2 || voice_est > 25)) st->mode = MODE_SILK_ONLY; /* When encoding voice and DTX is enabled but the generalized DTX cannot be used, use SILK in order to make use of its DTX. */ @@ -1668,7 +1675,6 @@ if (st->mode != MODE_CELT_ONLY) { opus_int32 total_bitRate, celt_rate; - opus_int activity; #ifdef FIXED_POINT const opus_int16 *pcm_silk; #else @@ -1676,14 +1682,6 @@ ALLOC(pcm_silk, st->channels*frame_size, opus_int16); #endif - activity = VAD_NO_DECISION; -#ifndef DISABLE_FLOAT_API - if( analysis_info.valid ) { - /* Inform SILK about the Opus VAD decision */ - activity = ( analysis_info.activity_probability >= DTX_ACTIVITY_THRESHOLD ); - } -#endif - /* Distribute bits between SILK and CELT */ total_bitRate = 8 * bytes_target * frame_rate; if( st->mode == MODE_HYBRID ) { @@ -2144,8 +2142,7 @@ #ifndef DISABLE_FLOAT_API if (st->use_dtx && (analysis_info.valid || is_silence)) { - if (decide_dtx_mode(analysis_info.activity_probability, &st->nb_no_activity_frames, - st->peak_signal_energy, pcm, frame_size, st->channels, is_silence, st->arch)) + if (decide_dtx_mode(activity, &st->nb_no_activity_ms_Q1, 2*1000*frame_size/st->Fs)) { st->rangeFinal = 0; data0 = gen_toc(st->mode, st->Fs/frame_size, curr_bandwidth, st->stream_channels); @@ -2153,7 +2150,7 @@ return 1; } } else { - st->nb_no_activity_frames = 0; + st->nb_no_activity_ms_Q1 = 0; } #endif @@ -2448,11 +2445,12 @@ case OPUS_SET_INBAND_FEC_REQUEST: { opus_int32 value = va_arg(ap, opus_int32); - if(value<0 || value>1) + if(value<0 || value>2) { goto bad_arg; } - st->silk_mode.useInBandFEC = value; + st->fec_config = value; + st->silk_mode.useInBandFEC = (value != 0); } break; case OPUS_GET_INBAND_FEC_REQUEST: @@ -2462,7 +2460,7 @@ { goto bad_arg; } - *value = st->silk_mode.useInBandFEC; + *value = st->fec_config;
View file
_service:tar_scm:opus-1.3.1.tar.gz/src/opus_multistream_decoder.c -> _service:tar_scm:opus-1.4.tar.gz/src/opus_multistream_decoder.c
Changed
@@ -251,8 +251,11 @@ } packet_offset = 0; ret = opus_decode_native(dec, data, len, buf, frame_size, decode_fec, s!=st->layout.nb_streams-1, &packet_offset, soft_clip); - data += packet_offset; - len -= packet_offset; + if (!do_plc) + { + data += packet_offset; + len -= packet_offset; + } if (ret <= 0) { RESTORE_STACK;
View file
_service:tar_scm:opus-1.3.1.tar.gz/src/opus_multistream_encoder.c -> _service:tar_scm:opus-1.4.tar.gz/src/opus_multistream_encoder.c
Changed
@@ -443,7 +443,8 @@ char *ptr; if ((channels>255) || (channels<1) || (coupled_streams>streams) || - (streams<1) || (coupled_streams<0) || (streams>255-coupled_streams)) + (streams<1) || (coupled_streams<0) || (streams>255-coupled_streams) || + (streams+coupled_streams>channels)) return OPUS_BAD_ARG; st->arch = opus_select_arch(); @@ -459,8 +460,7 @@ st->layout.mappingi = mappingi; if (!validate_layout(&st->layout)) return OPUS_BAD_ARG; - if (mapping_type == MAPPING_TYPE_SURROUND && - !validate_encoder_layout(&st->layout)) + if (!validate_encoder_layout(&st->layout)) return OPUS_BAD_ARG; if (mapping_type == MAPPING_TYPE_AMBISONICS && !validate_ambisonics(st->layout.nb_channels, NULL, NULL)) @@ -595,7 +595,8 @@ int ret; OpusMSEncoder *st; if ((channels>255) || (channels<1) || (coupled_streams>streams) || - (streams<1) || (coupled_streams<0) || (streams>255-coupled_streams)) + (streams<1) || (coupled_streams<0) || (streams>255-coupled_streams) || + (streams+coupled_streams>channels)) { if (error) *error = OPUS_BAD_ARG;
View file
_service:tar_scm:opus-1.3.1.tar.gz/src/repacketizer_demo.c -> _service:tar_scm:opus-1.4.tar.gz/src/repacketizer_demo.c
Changed
@@ -119,7 +119,19 @@ for (i=0;i<nb_packets;i++) { unsigned char ch4; - err = fread(ch, 1, 4, fin); + if (fread(ch, 1, 4, fin)!=4) + { + if (feof(fin)) + { + eof = 1; + } else { + fprintf(stderr, "Error reading payload length.\n"); + fclose(fin); + fclose(fout); + return EXIT_FAILURE; + } + break; + } leni = char_to_int(ch); /*fprintf(stderr, "in len = %d\n", leni);*/ if (leni>1500 || leni<0) @@ -135,13 +147,31 @@ } break; } - err = fread(ch, 1, 4, fin); - rngi = char_to_int(ch); - err = fread(packetsi, 1, leni, fin); - if (feof(fin)) + if (fread(ch, 1, 4, fin)!=4) { - eof = 1; - break; + if (feof(fin)) + { + eof = 1; + } else { + fprintf(stderr, "Error reading.\n"); + fclose(fin); + fclose(fout); + return EXIT_FAILURE; + } + break; + } + rngi = char_to_int(ch); + if (fread(packetsi, leni, 1, fin)!=1) { + if (feof(fin)) + { + eof = 1; + } else { + fprintf(stderr, "Error reading packet of %u bytes.\n", leni); + fclose(fin); + fclose(fout); + return EXIT_FAILURE; + } + break; } err = opus_repacketizer_cat(rp, packetsi, leni); if (err!=OPUS_OK)
View file
_service:tar_scm:opus-1.3.1.tar.gz/test-driver -> _service:tar_scm:opus-1.4.tar.gz/test-driver
Changed
@@ -1,9 +1,9 @@ #! /bin/sh # test-driver - basic testsuite driver script. -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2017 Free Software Foundation, Inc. +# Copyright (C) 2011-2018 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -140,7 +140,7 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0"
View file
_service:tar_scm:opus-1.4.tar.gz/tests/meson.build
Added
@@ -0,0 +1,34 @@ +# Tests that link to libopus +opus_tests = + 'test_opus_api', + 'test_opus_decode', , 60, + 'test_opus_encode', 'opus_encode_regressions.c', 120, + 'test_opus_padding', + 'test_opus_projection', + + +foreach t : opus_tests + test_name = t.get(0) + extra_srcs = t.get(1, ) + + test_kwargs = {} + if t.length() > 2 + test_kwargs += {'timeout': t2} + endif + + exe_kwargs = {} + # This test uses private symbols + if test_name == 'test_opus_projection' + exe_kwargs = { + 'link_with': celt_lib, silk_lib, + 'objects': opus_lib.extract_all_objects(), + } + endif + + exe = executable(test_name, '@0@.c'.format(test_name), extra_srcs, + include_directories: opus_includes, + dependencies: libm, opus_dep, + install: false, + kwargs: exe_kwargs) + test(test_name, exe, kwargs: test_kwargs) +endforeach
View file
_service:tar_scm:opus-1.3.1.tar.gz/tests/opus_encode_regressions.c -> _service:tar_scm:opus-1.4.tar.gz/tests/opus_encode_regressions.c
Changed
@@ -35,7 +35,6 @@ #include <stdint.h> #include <math.h> #include <string.h> -#include <assert.h> #include "opus_multistream.h" #include "opus.h" #include "test_opus_common.h" @@ -106,7 +105,7 @@ 1799, 1799, 1799, 1799, -9721 }; err = opus_multistream_encode(enc, pcm, 320, data, 2460); - assert(err > 0); + opus_test_assert(err > 0); } opus_multistream_encoder_ctl(enc, OPUS_SET_SIGNAL(OPUS_SIGNAL_MUSIC)); opus_multistream_encoder_ctl(enc, OPUS_SET_VBR(0)); @@ -144,7 +143,7 @@ -9510, -9510, -9510, -9510, -9510, -9510, -9510 }; err = opus_multistream_encode(enc, pcm, 160, data, 2460); - assert(err > 0); + opus_test_assert(err > 0); } opus_multistream_encoder_ctl(enc, OPUS_SET_SIGNAL(OPUS_SIGNAL_MUSIC)); opus_multistream_encoder_ctl(enc, OPUS_SET_VBR(0)); @@ -182,7 +181,7 @@ -9510, -9510, -9510, -9510, -9510, -9510, -9510 }; err = opus_multistream_encode(enc, pcm, 160, data, 2460); - assert(err > 0); + opus_test_assert(err > 0); } opus_multistream_encoder_ctl(enc, OPUS_SET_SIGNAL(OPUS_SIGNAL_MUSIC)); opus_multistream_encoder_ctl(enc, OPUS_SET_VBR(0)); @@ -220,7 +219,7 @@ -9510, -9510, -9510, -9510, -9510, -9510, -9510 }; err = opus_multistream_encode(enc, pcm, 160, data, 2460); - assert(err > 0); + opus_test_assert(err > 0); } opus_multistream_encoder_ctl(enc, OPUS_SET_SIGNAL(OPUS_SIGNAL_MUSIC)); opus_multistream_encoder_ctl(enc, OPUS_SET_VBR(0)); @@ -256,7 +255,7 @@ 5632 }; err = opus_multistream_encode(enc, pcm, 160, data, 2460); - assert(err > 0); + opus_test_assert(err > 0); } opus_multistream_encoder_ctl(enc, OPUS_SET_SIGNAL(OPUS_SIGNAL_VOICE)); opus_multistream_encoder_ctl(enc, OPUS_SET_VBR(0)); @@ -281,7 +280,7 @@ 0, 0, -256, 226 }; err = opus_multistream_encode(enc, pcm, 40, data, 2460); - assert(err > 0); + opus_test_assert(err > 0); /* returns -3 */ } opus_multistream_encoder_destroy(enc); @@ -334,7 +333,7 @@ 0 }; err = opus_multistream_encode(enc, pcm, 20, data, 627300); - assert(err > 0); + opus_test_assert(err > 0); /* returns -1 */ } opus_multistream_encoder_destroy(enc); @@ -384,7 +383,7 @@ 0 }; err = opus_multistream_encode(enc, pcm, 20, data, 472320); - assert(err > 0); + opus_test_assert(err > 0); /* returns -1 */ } opus_multistream_encoder_destroy(enc); @@ -740,7 +739,7 @@ -20992, 25859, 5372, 12040, 13307, -4355,-30213, -9, -6019 }; err = opus_multistream_encode(enc, pcm, 960, data, 7380); - assert(err > 0); + opus_test_assert(err > 0); } opus_multistream_encoder_ctl(enc, OPUS_SET_SIGNAL(OPUS_SIGNAL_MUSIC)); opus_multistream_encoder_ctl(enc, OPUS_SET_VBR(1)); @@ -885,7 +884,7 @@ }; err = opus_multistream_encode(enc, pcm, 1440, data, 7380); /* reads uninitialized data at src/opus_multistream_encoder.c:293 */ - assert(err > 0); + opus_test_assert(err > 0); } opus_multistream_encoder_destroy(enc); return 0; @@ -935,7 +934,7 @@ opus_encoder_ctl(enc, OPUS_SET_PACKET_LOSS_PERC(6)); opus_encoder_ctl(enc, OPUS_SET_BITRATE(6000)); data_len = opus_encode(enc, pcm1, 960, data, 2000); - assert(data_len > 0); + opus_test_assert(data_len > 0); opus_encoder_ctl(enc, OPUS_SET_SIGNAL(OPUS_SIGNAL_VOICE)); opus_encoder_ctl(enc, OPUS_SET_PREDICTION_DISABLED(1)); @@ -943,12 +942,12 @@ opus_encoder_ctl(enc, OPUS_SET_INBAND_FEC(1)); opus_encoder_ctl(enc, OPUS_SET_BITRATE(15600)); data_len = opus_encode(enc, pcm2, 2880, data, 122); - assert(data_len > 0); + opus_test_assert(data_len > 0); opus_encoder_ctl(enc, OPUS_SET_SIGNAL(OPUS_SIGNAL_MUSIC)); opus_encoder_ctl(enc, OPUS_SET_BITRATE(27000)); data_len = opus_encode(enc, pcm3, 2880, data, 122); /* assertion failure */ - assert(data_len > 0); + opus_test_assert(data_len > 0); opus_encoder_destroy(enc); return 0; @@ -970,7 +969,7 @@ { static const short pcm960 = { 0 }; data_len = opus_encode(enc, pcm, 960, data, 2000); - assert(data_len > 0); + opus_test_assert(data_len > 0); } opus_encoder_ctl(enc, OPUS_SET_SIGNAL(OPUS_SIGNAL_MUSIC)); { @@ -980,7 +979,7 @@ -32768, -32768, 0, 0, -32768, -32768, 0, 0, -32768, -32768 }; data_len = opus_encode(enc, pcm, 480, data, 19); - assert(data_len > 0); + opus_test_assert(data_len > 0); } opus_encoder_destroy(enc); return 0; @@ -1009,14 +1008,14 @@ opus_encoder_ctl(enc, OPUS_SET_MAX_BANDWIDTH(OPUS_BANDWIDTH_NARROWBAND)); opus_encoder_ctl(enc, OPUS_SET_BITRATE(6000)); data_len = opus_encode(enc, pcm1, 160, data, 1000); - assert(data_len > 0); + opus_test_assert(data_len > 0); opus_encoder_ctl(enc, OPUS_SET_VBR(0)); opus_encoder_ctl(enc, OPUS_SET_COMPLEXITY(0)); opus_encoder_ctl(enc, OPUS_SET_MAX_BANDWIDTH(OPUS_BANDWIDTH_MEDIUMBAND)); opus_encoder_ctl(enc, OPUS_SET_BITRATE(2867)); data_len = opus_encode(enc, pcm2, 960, data, 1000); - assert(data_len > 0); + opus_test_assert(data_len > 0); opus_encoder_destroy(enc); return 0;
View file
_service:tar_scm:opus-1.3.1.tar.gz/tests/test_opus_api.c -> _service:tar_scm:opus-1.4.tar.gz/tests/test_opus_api.c
Changed
@@ -1298,7 +1298,7 @@ err=opus_encoder_ctl(enc,OPUS_GET_INBAND_FEC(null_int_ptr)); if(err!=OPUS_BAD_ARG)test_failed(); cfgs++; - CHECK_SETGET(OPUS_SET_INBAND_FEC(i),OPUS_GET_INBAND_FEC(&i),-1,2, + CHECK_SETGET(OPUS_SET_INBAND_FEC(i),OPUS_GET_INBAND_FEC(&i),-1,3, 1,0, " OPUS_SET_INBAND_FEC .......................... OK.\n", " OPUS_GET_INBAND_FEC .......................... OK.\n")
View file
_service:tar_scm:opus-1.3.1.tar.gz/tests/test_opus_common.h -> _service:tar_scm:opus-1.4.tar.gz/tests/test_opus_common.h
Changed
@@ -75,8 +75,11 @@ fprintf(stderr,"Please report this failure and include\n"); fprintf(stderr,"'make check SEED=%u fails %s at line %d for %s'\n",iseed,file,line,opus_get_version_string()); fprintf(stderr,"and any relevant details about your system.\n\n"); +#if defined(_MSC_VER) + _set_abort_behavior( 0, _WRITE_ABORT_MSG); +#endif abort(); } #define test_failed() _test_failed(__FILE__, __LINE__); - +#define opus_test_assert(cond) {if (!(cond)) {test_failed();}} void regression_test(void);
View file
_service:tar_scm:opus-1.3.1.tar.gz/tests/test_opus_decode.c -> _service:tar_scm:opus-1.4.tar.gz/tests/test_opus_decode.c
Changed
@@ -36,7 +36,7 @@ #include <math.h> #include <string.h> #include <time.h> -#if (!defined WIN32 && !defined _WIN32) || defined(__MINGW32__) +#ifndef _WIN32 #include <unistd.h> #else #include <process.h>
View file
_service:tar_scm:opus-1.3.1.tar.gz/tests/test_opus_encode.c -> _service:tar_scm:opus-1.4.tar.gz/tests/test_opus_encode.c
Changed
@@ -297,6 +297,7 @@ /*FIXME: encoder api tests, fs!=48k, mono, VBR*/ fprintf(stdout," Encode+Decode tests.\n"); + fflush(stdout); enc = opus_encoder_create(48000, 2, OPUS_APPLICATION_VOIP, &err); if(err != OPUS_OK || enc==NULL)test_failed(); @@ -466,6 +467,7 @@ count++; }while(i<(SSAMPLES-MAX_FRAME_SAMP)); fprintf(stdout," Mode %s FB encode %s, %6d bps OK.\n",mstringsmodesj,rc==0?" VBR":rc==1?"CVBR":" CBR",rate); + fflush(stdout); } } @@ -543,6 +545,7 @@ count++; }while(i<(SSAMPLES/12-MAX_FRAME_SAMP)); fprintf(stdout," Mode %s NB dual-mono MS encode %s, %6d bps OK.\n",mstringsmodesj,rc==0?" VBR":rc==1?"CVBR":" CBR",rate); + fflush(stdout); } } @@ -612,6 +615,7 @@ i+=frame_size; }while(i<SAMPLES*4); fprintf(stdout," All framesize pairs switching encode, %d frames OK.\n",count); + fflush(stdout); if(opus_encoder_ctl(enc, OPUS_RESET_STATE)!=OPUS_OK)test_failed(); opus_encoder_destroy(enc);
View file
_service:tar_scm:opus-1.3.1.tar.gz/tests/test_opus_padding.c -> _service:tar_scm:opus-1.4.tar.gz/tests/test_opus_padding.c
Changed
@@ -39,7 +39,7 @@ #define CHANNELS 2 #define FRAMESIZE 5760 -int test_overflow(void) +void test_overflow(void) { OpusDecoder *decoder; int result; @@ -51,7 +51,7 @@ fprintf(stderr, " Checking for padding overflow... "); if (!in || !out) { fprintf(stderr, "FAIL (out of memory)\n"); - return -1; + test_failed(); } in0 = 0xff; in1 = 0x41; @@ -71,21 +71,18 @@ } fprintf(stderr, "OK.\n"); - - return 1; } int main(void) { const char *oversion; - int tests = 0;; iseed = 0; oversion = opus_get_version_string(); if (!oversion) test_failed(); fprintf(stderr, "Testing %s padding.\n", oversion); - tests += test_overflow(); + test_overflow(); fprintf(stderr, "All padding tests passed.\n");
View file
_service:tar_scm:opus-1.3.1.tar.gz/tests/test_opus_projection.c -> _service:tar_scm:opus-1.4.tar.gz/tests/test_opus_projection.c
Changed
@@ -29,7 +29,6 @@ #include "config.h" #endif -#include <assert.h> #include <stdio.h> #include <stdlib.h> #include <stdint.h>
View file
_service:tar_scm:opus-1.3.1.tar.gz/win32/VS2015/common.props -> _service:tar_scm:opus-1.4.tar.gz/win32/VS2015/common.props
Changed
@@ -23,7 +23,7 @@ <CompileAsManaged>false</CompileAsManaged> <CompileAsWinRT>false</CompileAsWinRT> <AdditionalIncludeDirectories>..\..;..\..\include;..\..\silk;..\..\celt;..\..\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeTypeInfo>false</RuntimeTypeInfo> <OpenMPSupport>false</OpenMPSupport> </ClCompile>
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2