Skip to content

Commit

Permalink
Merge branch 'main' into dr-eoo-data
Browse files Browse the repository at this point in the history
  • Loading branch information
drowe67 committed Nov 25, 2024
2 parents d851f8f + d05ed99 commit 0ab0061
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ add_test(NAME radae_rx_embed_c

# C Port of Core Encoder/decoder ------------------------------------------------------------------------------------

if (NOT WIN32)
# we test by comparing loss of features_in/features_out, can all happen at rate Rs. We load model05.bin weights as
# compiled-in weights are for model19_check3
add_test(NAME c_encoder_model5
Expand Down Expand Up @@ -534,6 +535,7 @@ add_test(NAME c_decoder_model19_check3
cat z_hat.f32 | ${CMAKE_CURRENT_BINARY_DIR}/src/test_rade_dec 1 > features_c.f32; \
python3 loss.py features_in.f32 features_out.f32 --features_hat2 features_c.f32 --compare")
set_tests_properties(c_decoder_model19_check3 PROPERTIES PASS_REGULAR_EXPRESSION "PASS")
endif(NOT WIN32)

# Test embedded data (--auxdata) use for false sync detection, with C core decoder, with C callable embedded Python API.
# --foff_err forces a false sync state after first sync. See also "radae_rx_aux_mpp" above. Tests uw_errors are being passed
Expand Down
2 changes: 1 addition & 1 deletion cmake/BuildOpus.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ add_custom_target(
libopus.a
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/libopus${CMAKE_STATIC_LIBRARY_SUFFIX})

include_directories(${SOURCE_DIR}/dnn ${SOURCE_DIR}/celt ${SOURCE_DIR}/include)
include_directories(${SOURCE_DIR}/dnn ${SOURCE_DIR}/celt ${SOURCE_DIR}/include ${SOURCE_DIR})

add_library(opus STATIC IMPORTED)
add_dependencies(opus libopus.a)
Expand Down
15 changes: 15 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ add_executable(lpcnet_demo lpcnet_demo.c)
target_link_libraries(lpcnet_demo opus m)

add_library(rade rade_api.c rade_enc.c rade_dec.c rade_enc_data.c rade_dec_data.c)
if(APPLE OR WIN32)
target_link_libraries(rade Python3::Python opus)
else(APPLE OR WIN32)
target_link_libraries(rade Python3::Python)
endif(APPLE OR WIN32)
target_include_directories(rade PRIVATE
"$<TARGET_PROPERTY:Python3::NumPy,INTERFACE_INCLUDE_DIRECTORIES>")
target_compile_definitions(rade PRIVATE -DIS_BUILDING_RADE_API=1)
Expand All @@ -23,11 +27,22 @@ target_link_libraries(radae_rx rade opus m Python3::Python)
target_include_directories(radae_rx PRIVATE
"$<TARGET_PROPERTY:Python3::NumPy,INTERFACE_INCLUDE_DIRECTORIES>")

if (NOT WIN32)
add_executable(test_rade_enc test_rade_enc.c)
target_link_libraries(test_rade_enc rade opus m)

add_executable(test_rade_dec test_rade_dec.c)
target_link_libraries(test_rade_dec rade opus m)
endif (NOT WIN32)

add_executable(write_rade_weights write_rade_weights.c)
target_link_libraries(write_rade_weights rade opus m)

if(APPLE AND BUILD_OSX_UNIVERSAL)
add_dependencies(rade build_opus_x86)
add_dependencies(rade build_opus_arm)
else(APPLE AND BUILD_OSX_UNIVERSAL)
add_dependencies(rade build_opus)
endif(APPLE AND BUILD_OSX_UNIVERSAL)


5 changes: 3 additions & 2 deletions src/opus-nnet.h.diff
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
30a31,32
30a31,33
> #ifndef RADE_EXPORT
> #define RADE_EXPORT __attribute__((visibility("default")))
>
> #endif /* RADE_EXPORT */
88,93c90,95
< void compute_generic_dense(const LinearLayer *layer, float *output, const float *input, int activation, int arch);
< void compute_generic_gru(const LinearLayer *input_weights, const LinearLayer *recurrent_weights, float *state, const float *in, int arch);
Expand Down

0 comments on commit 0ab0061

Please sign in to comment.