ref: 75872236da501075db5411a29636018b2af6ac08
parent: 4d8b52b8047b1702ea28aac4b07214bd20802c74
author: Marcus Asteborg <maastebo@microsoft.com>
date: Tue May 30 17:12:31 EDT 2023
add option for neural fec and add dred test Signed-off-by: Marcus Asteborg <maastebo@microsoft.com> Signed-off-by: Jean-Marc Valin <jmvalin@amazon.com>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -79,6 +79,10 @@
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})
+set(OPUS_NEURAL_FEC_HELP_STR "enable neural FEC.")
+option(OPUS_NEURAL_FEC ${OPUS_NEURAL_FEC_HELP_STR} OFF)
+add_feature_info(OPUS_NEURAL_FEC OPUS_NEURAL_FEC ${OPUS_NEURAL_FEC_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)
@@ -367,6 +371,13 @@
target_compile_definitions(opus PRIVATE DISABLE_FLOAT_API)
endif()
+if (OPUS_NEURAL_FEC)
+ target_compile_definitions(opus PRIVATE ENABLE_NEURAL_FEC)
+ if(NOT OPUS_NEURAL_PLC)
+ target_compile_definitions(opus PRIVATE NEURAL_PLC)
+ endif()
+endif()
+
if(NOT OPUS_DISABLE_INTRINSICS)
if(((OPUS_X86_MAY_HAVE_SSE AND NOT OPUS_X86_PRESUME_SSE) OR
(OPUS_X86_MAY_HAVE_SSE2 AND NOT OPUS_X86_PRESUME_SSE2) OR
@@ -655,4 +666,15 @@
-DTEST_EXECUTABLE=$<TARGET_FILE:test_opus_extensions>
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-P "${PROJECT_SOURCE_DIR}/cmake/RunTest.cmake")
+ if(OPUS_NEURAL_FEC)
+ add_executable(test_opus_dred ${test_opus_dred_sources})
+ target_include_directories(test_opus_dred
+ PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+ target_link_libraries(test_opus_dred PRIVATE opus)
+ target_compile_definitions(test_opus_dred PRIVATE OPUS_BUILD)
+ add_test(NAME test_opus_dred COMMAND ${CMAKE_COMMAND}
+ -DTEST_EXECUTABLE=$<TARGET_FILE:test_opus_dred>
+ -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ -P "${PROJECT_SOURCE_DIR}/cmake/RunTest.cmake")
+ endif()
endif()
--- a/cmake/OpusSources.cmake
+++ b/cmake/OpusSources.cmake
@@ -52,3 +52,5 @@
test_opus_decode_sources)
get_opus_sources(tests_test_opus_padding_SOURCES Makefile.am
test_opus_padding_sources)
+get_opus_sources(tests_test_opus_dred_SOURCES Makefile.am
+ test_opus_dred_sources)
--
⑨