aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Asteborg <maastebo@microsoft.com>2023-05-30 21:12:31 -0700
committerJean-Marc Valin <jmvalin@amazon.com>2023-06-16 13:02:23 -0400
commit75872236da501075db5411a29636018b2af6ac08 (patch)
tree525235b8bdbb660483efe86c307928c5e3703c07
parent4d8b52b8047b1702ea28aac4b07214bd20802c74 (diff)
downloadlibopus-75872236da501075db5411a29636018b2af6ac08.tar.gz
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>
-rw-r--r--CMakeLists.txt22
-rw-r--r--cmake/OpusSources.cmake2
2 files changed, 24 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4d2e1666..7105e0d0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -79,6 +79,10 @@ set(OPUS_INSTALL_CMAKE_CONFIG_MODULE_HELP_STR "install CMake package config modu
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 @@ if(NOT OPUS_ENABLE_FLOAT_API)
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 @@ if(BUILD_TESTING AND NOT BUILD_SHARED_LIBS)
-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()
diff --git a/cmake/OpusSources.cmake b/cmake/OpusSources.cmake
index cf8b8748..cb852c0a 100644
--- a/cmake/OpusSources.cmake
+++ b/cmake/OpusSources.cmake
@@ -52,3 +52,5 @@ 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)
+get_opus_sources(tests_test_opus_dred_SOURCES Makefile.am
+ test_opus_dred_sources)