diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2e1289ed36b869afb7284c788b2c9197a3ac9566..35216a43d1529395644c458aa97eec989b5f8057 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -121,6 +121,11 @@ stages: - git pull - cd - +.enable-split-rendering: &enable-split-rendering +# automatically enable #define SPLIT_REND_WITH_HEAD_ROT in options.h, handling both /**/-comment and //-comment + - sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*SPLIT_REND_WITH_HEAD_ROT\)[[:space:]]*\*\//\1/g" ./lib_com/options.h + - sed -i.bak -e "s/\/\/[[:space:]]*\(#define[[:space:]]*SPLIT_REND_WITH_HEAD_ROT\)/\1/g" ./lib_com/options.h + # --------------------------------------------------------------- # Job templates # --------------------------------------------------------------- @@ -309,6 +314,7 @@ build-codec-windows-msbuild: script: - *print-common-info-windows - $winoutdata = $null + - py .\scripts\strip_split_rendering.py - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug | tee -variable winoutdata - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8 - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression @@ -569,7 +575,8 @@ split-rendering-smoke-test: needs: ["build-codec-linux-make"] stage: test script: - - make -j + - *enable-split-rendering + - make -j INCLUDE_SPLIT=1 - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/split_rendering/test_split_rendering.py artifacts: name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" @@ -609,7 +616,8 @@ split-rendering-pytest-on-merge-request: - git checkout $target_commit # build reference binaries - - make -j + - *enable-split-rendering + - make -j INCLUDE_SPLIT=1 - mv IVAS_cod IVAS_cod_ref - mv IVAS_dec IVAS_dec_ref - mv IVAS_rend IVAS_rend_ref @@ -617,7 +625,8 @@ split-rendering-pytest-on-merge-request: # back to source branch - git checkout $source_branch_commit_sha - make clean - - make -j + - *enable-split-rendering + - make -j INCLUDE_SPLIT=1 # run test - exit_code=0 diff --git a/CMakeLists.txt b/CMakeLists.txt index d08135676c7f2b4005e1c6527b1578830fe03661..5035bd7088422d906060e8e347dc72c1271fa012 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,8 @@ # # or build on command line, e.g.: # cmake --build . --config Debug # cmake --build . --config Release - +# +# INCLUDE_SPLIT is not set by default. If split rendering is used, then add -D INCLUDE_SPLIT=1 to the build command cmake_minimum_required(VERSION 3.1) @@ -130,7 +131,10 @@ add_library(lib_com ${libComSrcs} ${libComHeaders}) if(UNIX) target_link_libraries(lib_com PRIVATE m) endif() -target_include_directories(lib_com PUBLIC lib_com PRIVATE lib_enc lib_dec lib_rend lib_debug lc3plus) +target_include_directories(lib_com PUBLIC lib_com PRIVATE lib_enc lib_dec lib_rend lib_debug) +if(INCLUDE_SPLIT) + target_include_directories(lib_com PRIVATE lc3plus) +endif() file(GLOB libDebugSrcs "lib_debug/*.c") file(GLOB libDebugHeaders "lib_debug/*.h") @@ -142,23 +146,52 @@ file(GLOB libEncSrcs "lib_enc/*.c") file(GLOB libEncHeaders "lib_enc/*.h") add_library(lib_enc ${libEncSrcs} ${libEncHeaders}) target_link_libraries(lib_enc lib_com lib_debug) -target_include_directories(lib_enc PUBLIC lib_enc PRIVATE lib_dec lib_rend lc3plus) +target_include_directories(lib_enc PUBLIC lib_enc PRIVATE lib_dec lib_rend) +if(INCLUDE_SPLIT) + target_include_directories(lib_enc PRIVATE lc3plus) +endif() -file(GLOB libLC3plusSrcs "lc3plus/*.c") -file(GLOB libLC3plusHeaders "lc3plus/*.h") -add_library(lc3plus ${libLC3plusSrcs} ${libLC3plusHeaders}) -target_include_directories(lc3plus PUBLIC lc3plus) -target_link_libraries(lc3plus lib_com) # For including options.h, which is needed for instrumentation to work correctly -if(WMOPS) - target_link_libraries(lc3plus lib_debug) +if(INCLUDE_SPLIT) + file(GLOB libLC3plusSrcs "lc3plus/*.c") + file(GLOB libLC3plusHeaders "lc3plus/*.h") + add_library(lc3plus ${libLC3plusSrcs} ${libLC3plusHeaders}) + target_include_directories(lc3plus PUBLIC lc3plus) + target_link_libraries(lc3plus lib_com) # For including options.h, which is needed for instrumentation to work correctly + if(WMOPS) + target_link_libraries(lc3plus lib_debug) + endif() endif() -file(GLOB libCldfbTransCodecSrcs "lib_rend/ivas_cldfb_trans_codec/*.c") -file(GLOB libCldfbTransCodecHeaders "lib_rend/ivas_cldfb_trans_codec/*.h") +if(INCLUDE_SPLIT) + file(GLOB libCldfbTransCodecSrcs "lib_rend/ivas_cldfb_trans_codec/*.c") + file(GLOB libCldfbTransCodecHeaders "lib_rend/ivas_cldfb_trans_codec/*.h") +endif() file(GLOB libRendSrcs "lib_rend/*.c") file(GLOB libRendHeaders "lib_rend/*.h") -add_library(lib_rend ${libRendSrcs} ${libCldfbTransCodecSrcs} ${libRendHeaders} ${libCldfbTransCodecHeaders}) -target_link_libraries(lib_rend lib_dec lib_com lib_debug lc3plus) # Todo refactor: This dependency on lib_dec should be removed. +if(NOT INCLUDE_SPLIT) + list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*lc3plus.*\.c$") + list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*ivas_cldfb_codec.*\.c$") + list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*splitRend.*\.c$") + list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*ivas_CQMF.*\.c$") + list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*ivas_Pred.*\.c$") + list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*ivas_RMSEnv.*\.c$") + list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*ivas_PerceptualModel.*\.c$") + list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*ivas_lcld_tables.*\.c$") + list(FILTER libRendHeaders EXCLUDE REGEX ".*lib_rend\/.*lc3plus.*\.h$") + list(FILTER libRendHeaders EXCLUDE REGEX ".*lib_rend\/.*splitRend.*\.h$") + list(FILTER libRendHeaders EXCLUDE REGEX ".*lib_rend\/.*ivas_cldfb_codec.*\.h$") + list(FILTER libRendHeaders EXCLUDE REGEX ".*lib_rend\/.*ivas_lcld_tables.*\.h$") +endif() + +if(INCLUDE_SPLIT) + add_library(lib_rend ${libRendSrcs} ${libCldfbTransCodecSrcs} ${libRendHeaders} ${libCldfbTransCodecHeaders}) +else() + add_library(lib_rend ${libRendSrcs} ${libRendHeaders}) +endif() +target_link_libraries(lib_rend lib_dec lib_com lib_debug) # Todo refactor: This dependency on lib_dec should be removed. +if(INCLUDE_SPLIT) + target_link_libraries(lib_rend lc3plus) +endif() target_include_directories(lib_rend PUBLIC lib_rend PRIVATE lib_enc) @@ -170,13 +203,21 @@ target_include_directories(lib_dec PUBLIC lib_dec lib_rend PRIVATE lib_enc) file(GLOB libUtilSrcs "lib_util/*.c") file(GLOB libUtilHeaders "lib_util/*.h") +if(NOT INCLUDE_SPLIT) + list(FILTER libUtilSrcs EXCLUDE REGEX ".*lib_util\/.*split_rend.*\.c$") +endif() add_library(lib_util ${libUtilSrcs} ${libUtilHeaders}) -target_include_directories(lib_util PUBLIC lib_util PRIVATE lib_com lib_enc lib_dec lib_rend lib_debug lc3plus) +target_include_directories(lib_util PUBLIC lib_util PRIVATE lib_com lib_enc lib_dec lib_rend lib_debug) +if(INCLUDE_SPLIT) + target_include_directories(lib_util PRIVATE lc3plus) +endif() -if(NOT WMOPS) - file(GLOB unitTestIvasLc3plusSrcs "scripts/split_rendering/lc3plus/*.c") - add_executable(ivas_lc3plus_unit_test ${unitTestIvasLc3plusSrcs}) - target_link_libraries(ivas_lc3plus_unit_test lib_rend lib_dec lib_util lib_com lib_debug) +if(INCLUDE_SPLIT) + if(NOT WMOPS) + file(GLOB unitTestIvasLc3plusSrcs "scripts/split_rendering/lc3plus/*.c") + add_executable(ivas_lc3plus_unit_test ${unitTestIvasLc3plusSrcs}) + target_link_libraries(ivas_lc3plus_unit_test lib_rend lib_dec lib_util lib_com lib_debug) + endif() endif() add_executable(IVAS_cod apps/encoder.c) @@ -200,8 +241,10 @@ if(COPY_EXECUTABLES_FROM_BUILD_DIR) add_custom_command(TARGET IVAS_cod POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$" "${CMAKE_CURRENT_SOURCE_DIR}/") add_custom_command(TARGET IVAS_dec POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$" "${CMAKE_CURRENT_SOURCE_DIR}/") add_custom_command(TARGET IVAS_rend POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$" "${CMAKE_CURRENT_SOURCE_DIR}/") - if (NOT WMOPS) - add_custom_command(TARGET ivas_lc3plus_unit_test POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$" "${CMAKE_CURRENT_SOURCE_DIR}/scripts/split_rendering/lc3plus") + if(INCLUDE_SPLIT) + if (NOT WMOPS) + add_custom_command(TARGET ivas_lc3plus_unit_test POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$" "${CMAKE_CURRENT_SOURCE_DIR}/scripts/split_rendering/lc3plus") + endif() endif() endif() diff --git a/Makefile b/Makefile index 138a4cdaedc7ebdf272d97059f115ab5daae8e72..36a32342fc394e0d7eb8c4240a1a961eaa1500b1 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,15 @@ CFLAGS += $(foreach DIR,$(SRC_DIRS),-I$(DIR)) # Source file search paths VPATH = $(SRC_DIRS) +# Split rendering files +SRCS_SPLIT_REND = ivas_CQMFDecoder.c ivas_CQMFEncoder.c ivas_PerceptualModel.c ivas_PredDecoder.c \ + ivas_PredEncoder.c ivas_RMSEnvGrouping.c ivas_MSPred.c ivas_NoiseGen.c \ + ivas_cldfb_codec_bitstream.c ivas_splitRend_lcld_dec.c ivas_splitRend_lcld_enc.c \ + ivas_splitRendererPLC.c ivas_splitRendererPost.c ivas_splitRendererPre.c \ + ivas_splitRenderer_utils.c split_rend_bfi_file_reader.c split_render_file_read_write.c \ + ivas_lcld_tables.c + + ############################################################################### SRCS_LIBCOM = $(foreach DIR,$(SRC_LIBCOM),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c))) @@ -124,8 +133,13 @@ SRCS_LIBDEBUG = $(foreach DIR,$(SRC_LIBDEBUG),$(patsubst $(DIR)/%,%,$(wildcard $ SRCS_LIBDEC = $(foreach DIR,$(SRC_LIBDEC),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c))) SRCS_LIBENC = $(foreach DIR,$(SRC_LIBENC),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c))) SRCS_LIBREND = $(foreach DIR,$(SRC_LIBREND),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c))) -SRCS_LC3PLUS = $(foreach DIR,$(SRC_LC3PLUS),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c))) SRCS_LIBUTIL = $(foreach DIR,$(SRC_LIBUTIL),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c))) +ifeq "$(INCLUDE_SPLIT)" "1" +SRCS_LC3PLUS = $(foreach DIR,$(SRC_LC3PLUS),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c))) +else +SRCS_LIBREND := $(filter-out $(SRCS_SPLIT_REND),$(SRCS_LIBREND)) +SRCS_LIBUTIL := $(filter-out $(SRCS_SPLIT_REND),$(SRCS_LIBUTIL)) +endif OBJS_LIBCOM = $(addprefix $(OBJDIR)/,$(SRCS_LIBCOM:.c=.o)) OBJS_LIBDEBUG = $(addprefix $(OBJDIR)/,$(SRCS_LIBDEBUG:.c=.o)) diff --git a/lib_com/options.h b/lib_com/options.h index 9769123af1eb563957e5d23250703a781305f4f7..fa70769baf56ef1e98a67d922c8015867e6b7122 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -150,8 +150,14 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ +#define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ -#define SPLIT_REND_WITH_HEAD_ROT /* Dlb,FhG: Split Rendering contributions 21 and 35 */ +#define SBA_AND_OBJECTS +#ifdef SBA_AND_OBJECTS +#define OSBA_BR_SWITCHING +#endif + +/*#define SPLIT_REND_WITH_HEAD_ROT*/ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #ifdef SPLIT_REND_WITH_HEAD_ROT #define SPLIT_REND_PRED_QUANT_63_PNTS #define SPLIT_REND_WITH_HEAD_ROT_PARAMBIN /* Nokia: Issue 623: Split rendering support for parambin renderer */ @@ -161,13 +167,6 @@ #endif #endif -#define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ - -#define SBA_AND_OBJECTS -#ifdef SBA_AND_OBJECTS -#define OSBA_BR_SWITCHING -#endif - #define FIX_264_AUDIO_CHANNELS_TO_HEAP /* VA: issue 243: Move audio channels memory from stack to heap */ #define FIX_691_OSBA_CRASH /* FhG: Fix for issue 691: Crash for OSBA Stereo out */ #define FIX_694_OMASA_EXTREME /* Nokia: fix for crash in OMASA on extreme sample */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index bd9c41cee27e806de9721062daf55318b25e6e82..4eefcc8835988ae350424dff72b5fd48e72bb2a6 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -1001,9 +1001,7 @@ ivas_error ivas_dec( ivas_mc_paramupmix_dec( st_ivas, output ); /* HP filtering */ -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV && st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM ) -#endif { for ( n = 0; n < st_ivas->nchan_transport; n++ ) { diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 35d48f2c63526ef50e926404b5d7fc4701fc828d..06751a67c521ed19b10c6caad7fa57aac93e2be3 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -531,7 +531,9 @@ void ivas_mc_paramupmix_dec_render( int16_t slots_to_render, first_sf, last_sf, subframe_idx; uint16_t slot_size, ch; float *output_f_local[MAX_OUTPUT_CHANNELS]; +#ifdef SPLIT_REND_WITH_HEAD_ROT int16_t slot_index_start; +#endif MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; hMCParamUpmix = st_ivas->hMCParamUpmix; @@ -573,17 +575,20 @@ void ivas_mc_paramupmix_dec_render( mvr2r( hMCParamUpmix->beta_prev[ch], hMCParamUpmix->beta_sf[ch], IVAS_MAX_NUM_BANDS ); } +#ifdef SPLIT_REND_WITH_HEAD_ROT slot_index_start = 0; +#endif for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { int16_t n_samples_sf = slot_size * st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; #ifdef SPLIT_REND_WITH_HEAD_ROT ivas_mc_paramupmix_dec_sf( st_ivas, output_f_local, slot_index_start ); + + slot_index_start += st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; #else ivas_mc_paramupmix_dec_sf( st_ivas, output_f_local ); #endif - slot_index_start += st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; for ( ch = 0; ch < MAX_OUTPUT_CHANNELS; ch++ ) { output_f_local[ch] += n_samples_sf; diff --git a/lib_rend/ivas_CQMFDecoder.c b/lib_rend/ivas_CQMFDecoder.c index cea424d3d715e8c21db4a01fd05a586fe78fd82c..bf6c7fa5181b1a5e041330b0f0bb3d78521ac814 100644 --- a/lib_rend/ivas_CQMFDecoder.c +++ b/lib_rend/ivas_CQMFDecoder.c @@ -38,7 +38,6 @@ Nations Convention on Contracts on the International Sales of Goods. #include "ivas_CQMFDecoder.h" #include "options.h" #ifdef SPLIT_REND_WITH_HEAD_ROT - #include "ivas_NoiseGen.h" #include "ivas_PerceptualModel.h" #include "ivas_lcld_tables.h" diff --git a/lib_rend/ivas_CQMFDecoder.h b/lib_rend/ivas_CQMFDecoder.h index f331ed20d38569c697e4c697328cbb479fb0fceb..753bc579da5e40b4ce7831ba8d64633cb0ef8516 100644 --- a/lib_rend/ivas_CQMFDecoder.h +++ b/lib_rend/ivas_CQMFDecoder.h @@ -40,7 +40,6 @@ extern "C" #include "options.h" #ifdef SPLIT_REND_WITH_HEAD_ROT - #include "lib_rend.h" #define DECODER_ERROR_NONE ( 0 ) #define DECODER_ERROR_FS_NOT_SUPPORTED ( -1 ) diff --git a/lib_rend/ivas_CQMFEncoder.h b/lib_rend/ivas_CQMFEncoder.h index e78aa4614d93347231bb5fff6706f504cbcf13e2..c4ac51ed8e7ab9c29c2168528d67c43380738206 100644 --- a/lib_rend/ivas_CQMFEncoder.h +++ b/lib_rend/ivas_CQMFEncoder.h @@ -37,6 +37,7 @@ extern "C" { #endif + #include "options.h" #ifdef SPLIT_REND_WITH_HEAD_ROT #include "lib_rend.h" diff --git a/lib_rend/ivas_PerceptualModel.c b/lib_rend/ivas_PerceptualModel.c index 131ca8af0dac6c82455f2bf2753589f4351a4971..8a86a0098d6fd52f32e251952fad655fd1a6d40f 100644 --- a/lib_rend/ivas_PerceptualModel.c +++ b/lib_rend/ivas_PerceptualModel.c @@ -29,6 +29,7 @@ the United Nations Convention on Contracts on the International Sales of Goods. *******************************************************************************************************/ + #include "options.h" #ifdef SPLIT_REND_WITH_HEAD_ROT #include "ivas_PerceptualModel.h" diff --git a/lib_rend/ivas_PredDecoder.c b/lib_rend/ivas_PredDecoder.c index 067232318c7bc7bf841fbeb559584e6aa674ff07..1e8adf2aed421352f23ff54abc14d266e011fd36 100644 --- a/lib_rend/ivas_PredDecoder.c +++ b/lib_rend/ivas_PredDecoder.c @@ -31,7 +31,6 @@ *******************************************************************************************************/ #include "options.h" - #ifdef SPLIT_REND_WITH_HEAD_ROT #include "ivas_PredDecoder.h" #include diff --git a/lib_rend/ivas_PredEncoder.c b/lib_rend/ivas_PredEncoder.c index 6381588ddac52e0462dfed9e70996fb9594e71a0..f8b26426fe730a8e6d5cda70d26dd50fadbef885 100644 --- a/lib_rend/ivas_PredEncoder.c +++ b/lib_rend/ivas_PredEncoder.c @@ -31,7 +31,6 @@ *******************************************************************************************************/ #include "options.h" - #ifdef SPLIT_REND_WITH_HEAD_ROT #include "ivas_PredEncoder.h" #include diff --git a/lib_rend/ivas_RMSEnvGrouping.c b/lib_rend/ivas_RMSEnvGrouping.c index d82fdb8943ba21e96730892c3f942e74dcb06c15..11b4a71accfed49e7e12e5225f22c4d888ae76d6 100644 --- a/lib_rend/ivas_RMSEnvGrouping.c +++ b/lib_rend/ivas_RMSEnvGrouping.c @@ -31,7 +31,6 @@ *******************************************************************************************************/ #include "options.h" - #ifdef SPLIT_REND_WITH_HEAD_ROT #include "ivas_RMSEnvGrouping.h" diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 847eba6e1cad4cd5dbf5c4faf371cad8002be34e..5b2001e64bc8ef7017f345d2983cc48cf1873fcb 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -102,11 +102,7 @@ typedef struct parambin_rend_config_data * Local function prototypes *------------------------------------------------------------------------*/ -#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN static void ivas_dirac_dec_binaural_internal( Decoder_Struct *st_ivas, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, float *output_f[], const int16_t nchan_transport, const int16_t subframe ); -#else -static void ivas_dirac_dec_binaural_internal( Decoder_Struct *st_ivas, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, const int16_t nchan_transport, const int16_t subframe ); -#endif static void ivas_dirac_dec_decorrelate_slot( DIRAC_DEC_BIN_HANDLE hDiracDecBin, const int16_t num_freq_bands, const int16_t slot, float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float decRe[][CLDFB_NO_CHANNELS_MAX], float decIm[][CLDFB_NO_CHANNELS_MAX] ); @@ -529,11 +525,7 @@ void ivas_dirac_dec_binaural_render( for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { int16_t n_samples_sf = slot_size * hSpatParamRendCom->subframe_nbslots[subframe_idx]; -#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN ivas_dirac_dec_binaural_internal( st_ivas, st_ivas->hCombinedOrientationData, output_f_local, nchan_transport, subframe_idx ); -#else - ivas_dirac_dec_binaural_internal( st_ivas, st_ivas->hCombinedOrientationData, nchan_transport, subframe_idx ); -#endif for ( ch = 0; ch < nchan_out; ch++ ) { @@ -703,11 +695,7 @@ void ivas_dirac_dec_binaural( { int16_t n_samples_sf = slot_size * hSpatParamRendCom->subframe_nbslots[subframe]; -#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN ivas_dirac_dec_binaural_internal( st_ivas, hCombinedOrientationData, p_output, nchan_transport, subframe ); -#else - ivas_dirac_dec_binaural_internal( st_ivas, hCombinedOrientationData, nchan_transport, subframe ); -#endif for ( ch = 0; ch < 2 * BINAURAL_CHANNELS; ch++ ) { @@ -732,9 +720,7 @@ void ivas_dirac_dec_binaural( static void ivas_dirac_dec_binaural_internal( Decoder_Struct *st_ivas, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, -#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN float *output_f[], -#endif const int16_t nchan_transport, const int16_t subframe ) { @@ -1054,6 +1040,8 @@ static void ivas_dirac_dec_binaural_internal( max_band_decorr, numInChannels, config_data.processReverb, subframe, NULL, NULL, reverbRe, reverbIm, decorrRe, decorrIm, 1 ); } +#else + ivas_dirac_dec_binaural_process_output( hDiracDecBin, hSpatParamRendCom, st_ivas->cldfbSynDec, output_f, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, max_band_decorr, numInChannels, config_data.processReverb, subframe ); #endif hDiracDecBin->hDiffuseDist = NULL; @@ -1895,21 +1883,31 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric } } +#ifdef SBA_AND_OBJECTS + if ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && nchan_transport == 2 ) +#else if ( ivas_format == SBA_FORMAT && nchan_transport == 2 ) +#endif { float tempRe, tempIm; + float subFrameSumEne[CLDFB_NO_CHANNELS_MAX]; - set_zero( subFrameTotalEne, CLDFB_NO_CHANNELS_MAX ); + v_multc( subFrameTotalEne, SBA_CARDI_TARGET_ENERGY_GAIN, subFrameTotalEne, nBins ); + set_zero( subFrameSumEne, CLDFB_NO_CHANNELS_MAX ); for ( slot = 0; slot < hSpatParamRendCom->subframe_nbslots[subframe]; slot++ ) { for ( bin = 0; bin < nBins; bin++ ) { tempRe = inRe[0][slot][bin] + inRe[1][slot][bin]; tempIm = inIm[0][slot][bin] + inIm[1][slot][bin]; - subFrameTotalEne[bin] += tempRe * tempRe + tempIm * tempIm; + subFrameSumEne[bin] += tempRe * tempRe + tempIm * tempIm; } } + for ( bin = 0; bin < nBins; bin++ ) + { + subFrameTotalEne[bin] = max( subFrameTotalEne[bin], subFrameSumEne[bin] ); + } } /* Determine target covariance matrix containing target binaural properties */ @@ -2199,7 +2197,11 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric } else /* When rendering binaural, ambience has frequency dependent ICC. */ { +#ifdef SBA_AND_OBJECTS + if ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && bin < BINAURAL_COHERENCE_DIFFERENCE_BINS ) +#else if ( ivas_format == SBA_FORMAT && bin < BINAURAL_COHERENCE_DIFFERENCE_BINS ) +#endif { float diffuseFieldCoherence; diffuseFieldCoherence = hDiracDecBin->hDiffuseDist->diffuseRatioX[bin] * hDiracDecBin->diffuseFieldCoherenceX[bin] + hDiracDecBin->hDiffuseDist->diffuseRatioY[bin] * hDiracDecBin->diffuseFieldCoherenceY[bin] + hDiracDecBin->hDiffuseDist->diffuseRatioZ[bin] * hDiracDecBin->diffuseFieldCoherenceZ[bin]; diff --git a/lib_rend/ivas_lcld_tables.c b/lib_rend/ivas_lcld_tables.c index 834e0536af61f07e43dd20d2b735b62f4c2cc87e..ae882a5e1b87cf240d6295beb270184c5da0860b 100644 --- a/lib_rend/ivas_lcld_tables.c +++ b/lib_rend/ivas_lcld_tables.c @@ -30,9 +30,10 @@ *******************************************************************************************************/ -#include "ivas_lcld_tables.h" + #include "options.h" #ifdef SPLIT_REND_WITH_HEAD_ROT +#include "ivas_lcld_tables.h" #include "ivas_prot_rend.h" #include "wmc_auto.h" #include diff --git a/lib_rend/ivas_lcld_tables.h b/lib_rend/ivas_lcld_tables.h index b50edae637df4d9a9df0e596057f818a6f5db406..4fec652e0214e0b442df135790164469ed5b7935 100644 --- a/lib_rend/ivas_lcld_tables.h +++ b/lib_rend/ivas_lcld_tables.h @@ -32,13 +32,11 @@ #ifndef _IVAS_TABLES_H_ #define _IVAS_TABLES_H_ -#ifdef __cplusplus -extern "C" -{ -#endif +#include "options.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT #include #include // For NULL -#include "options.h" + #ifndef M_PI @@ -53,7 +51,7 @@ extern "C" #define MAX_BANDS ( 23 ) #define MAX_BANDS_48 ( 23 ) - extern const int32_t c_aiBandwidths48[MAX_BANDS_48]; // move this +extern const int32_t c_aiBandwidths48[MAX_BANDS_48]; // move this #define ENV_MIN ( -64 ) @@ -107,7 +105,7 @@ extern "C" #define MAX_BANDS_48 ( 23 ) - //#define USE_DEMOD_TABLES +//#define USE_DEMOD_TABLES #ifndef HUFF_READ_SIZE #define HUFF_READ_SIZE ( 4 ) @@ -117,340 +115,340 @@ extern "C" #define HUFF_DEC_TABLE_SIZE ( 16 ) #endif - extern const float c_afRotRealImag[PRED_MAX_VAL - PRED_MIN_VAL + 1][2]; - extern const float c_afRotRealImagSimple[SIMPLE_PHASE_MAX_VAL + 1][2]; - extern const int32_t c_aiDefaultTheta48[MAX_BANDS_48]; +extern const float c_afRotRealImag[PRED_MAX_VAL - PRED_MIN_VAL + 1][2]; +extern const float c_afRotRealImagSimple[SIMPLE_PHASE_MAX_VAL + 1][2]; +extern const int32_t c_aiDefaultTheta48[MAX_BANDS_48]; - extern const float c_afScaleFactor[ALLOC_TABLE_SIZE]; +extern const float c_afScaleFactor[ALLOC_TABLE_SIZE]; - extern const float c_afInvScaleFactor[ALLOC_TABLE_SIZE]; +extern const float c_afInvScaleFactor[ALLOC_TABLE_SIZE]; - extern const float c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_SIZE]; +extern const float c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_SIZE]; - extern const int32_t c_aiQuantMaxValues[ALLOC_TABLE_SIZE]; +extern const int32_t c_aiQuantMaxValues[ALLOC_TABLE_SIZE]; - extern const int32_t c_aiHuffmanDim[ALLOC_TABLE_SIZE]; +extern const int32_t c_aiHuffmanDim[ALLOC_TABLE_SIZE]; - extern const int32_t c_aiHuffmanMod[ALLOC_TABLE_SIZE]; +extern const int32_t c_aiHuffmanMod[ALLOC_TABLE_SIZE]; - extern const int32_t c_aiHuffmanSize[ALLOC_TABLE_SIZE]; +extern const int32_t c_aiHuffmanSize[ALLOC_TABLE_SIZE]; #ifndef ROM_TO_RAM - extern const uint32_t c_aauiCQMFHuffEnc1[16][2]; +extern const uint32_t c_aauiCQMFHuffEnc1[16][2]; - extern const uint32_t c_aauiCQMFHuffDec1[3][16]; +extern const uint32_t c_aauiCQMFHuffDec1[3][16]; - extern const uint32_t c_aauiCQMFHuffEnc2[16][2]; +extern const uint32_t c_aauiCQMFHuffEnc2[16][2]; - extern const uint32_t c_aauiCQMFHuffDec2[3][16]; +extern const uint32_t c_aauiCQMFHuffDec2[3][16]; - extern const uint32_t c_aauiCQMFHuffEnc3[25][2]; +extern const uint32_t c_aauiCQMFHuffEnc3[25][2]; - extern const uint32_t c_aauiCQMFHuffDec3[10][16]; +extern const uint32_t c_aauiCQMFHuffDec3[10][16]; - extern const uint32_t c_aauiCQMFHuffEnc4[36][2]; +extern const uint32_t c_aauiCQMFHuffEnc4[36][2]; - extern const uint32_t c_aauiCQMFHuffDec4[5][16]; +extern const uint32_t c_aauiCQMFHuffDec4[5][16]; - extern const uint32_t c_aauiCQMFHuffEnc5[36][2]; +extern const uint32_t c_aauiCQMFHuffEnc5[36][2]; - extern const uint32_t c_aauiCQMFHuffDec5[10][16]; +extern const uint32_t c_aauiCQMFHuffDec5[10][16]; - extern const uint32_t c_aauiCQMFHuffEnc6[49][2]; +extern const uint32_t c_aauiCQMFHuffEnc6[49][2]; - extern const uint32_t c_aauiCQMFHuffDec6[7][16]; +extern const uint32_t c_aauiCQMFHuffDec6[7][16]; - extern const uint32_t c_aauiCQMFHuffEnc7[64][2]; +extern const uint32_t c_aauiCQMFHuffEnc7[64][2]; - extern const uint32_t c_aauiCQMFHuffDec7[25][16]; +extern const uint32_t c_aauiCQMFHuffDec7[25][16]; - extern const uint32_t c_aauiCQMFHuffEnc8[81][2]; +extern const uint32_t c_aauiCQMFHuffEnc8[81][2]; - extern const uint32_t c_aauiCQMFHuffDec8[16][16]; +extern const uint32_t c_aauiCQMFHuffDec8[16][16]; - extern const uint32_t c_aauiCQMFHuffEnc9[100][2]; +extern const uint32_t c_aauiCQMFHuffEnc9[100][2]; - extern const uint32_t c_aauiCQMFHuffDec9[22][16]; +extern const uint32_t c_aauiCQMFHuffDec9[22][16]; - extern const uint32_t c_aauiCQMFHuffEnc10[169][2]; +extern const uint32_t c_aauiCQMFHuffEnc10[169][2]; - extern const uint32_t c_aauiCQMFHuffDec10[45][16]; +extern const uint32_t c_aauiCQMFHuffDec10[45][16]; - extern const uint32_t c_aauiCQMFHuffEnc11[196][2]; +extern const uint32_t c_aauiCQMFHuffEnc11[196][2]; - extern const uint32_t c_aauiCQMFHuffDec11[50][16]; +extern const uint32_t c_aauiCQMFHuffDec11[50][16]; - extern const uint32_t c_aauiCQMFHuffEnc12[289][2]; +extern const uint32_t c_aauiCQMFHuffEnc12[289][2]; - extern const uint32_t c_aauiCQMFHuffDec12[76][16]; +extern const uint32_t c_aauiCQMFHuffDec12[76][16]; - extern const uint32_t c_aauiCQMFHuffEnc13[324][2]; +extern const uint32_t c_aauiCQMFHuffEnc13[324][2]; - extern const uint32_t c_aauiCQMFHuffDec13[89][16]; +extern const uint32_t c_aauiCQMFHuffDec13[89][16]; - extern const uint32_t c_aauiCQMFHuffEnc14[400][2]; +extern const uint32_t c_aauiCQMFHuffEnc14[400][2]; - extern const uint32_t c_aauiCQMFHuffDec14[53][16]; +extern const uint32_t c_aauiCQMFHuffDec14[53][16]; - extern const uint32_t c_aauiCQMFHuffEnc15[576][2]; +extern const uint32_t c_aauiCQMFHuffEnc15[576][2]; - extern const uint32_t c_aauiCQMFHuffDec15[73][16]; +extern const uint32_t c_aauiCQMFHuffDec15[73][16]; - extern const uint32_t c_aauiCQMFHuffEnc16[729][2]; +extern const uint32_t c_aauiCQMFHuffEnc16[729][2]; - extern const uint32_t c_aauiCQMFHuffDec16[85][16]; +extern const uint32_t c_aauiCQMFHuffDec16[85][16]; - extern const uint32_t c_aauiCQMFHuffEnc17[729][2]; +extern const uint32_t c_aauiCQMFHuffEnc17[729][2]; - extern const uint32_t c_aauiCQMFHuffDec17[93][16]; +extern const uint32_t c_aauiCQMFHuffDec17[93][16]; - extern const uint32_t c_aauiCQMFHuffEnc18[28][2]; +extern const uint32_t c_aauiCQMFHuffEnc18[28][2]; - extern const uint32_t c_aauiCQMFHuffDec18[6][16]; +extern const uint32_t c_aauiCQMFHuffDec18[6][16]; - extern const uint32_t c_aauiCQMFHuffEnc19[29][2]; +extern const uint32_t c_aauiCQMFHuffEnc19[29][2]; - extern const uint32_t c_aauiCQMFHuffDec19[6][16]; +extern const uint32_t c_aauiCQMFHuffDec19[6][16]; - extern const uint32_t c_aauiCQMFHuffEnc20[32][2]; +extern const uint32_t c_aauiCQMFHuffEnc20[32][2]; - extern const uint32_t c_aauiCQMFHuffDec20[6][16]; +extern const uint32_t c_aauiCQMFHuffDec20[6][16]; - extern const uint32_t c_aauiCQMFHuffEnc21[37][2]; +extern const uint32_t c_aauiCQMFHuffEnc21[37][2]; - extern const uint32_t c_aauiCQMFHuffDec21[7][16]; +extern const uint32_t c_aauiCQMFHuffDec21[7][16]; - extern const uint32_t c_aauiCQMFHuffEnc22[39][2]; +extern const uint32_t c_aauiCQMFHuffEnc22[39][2]; - extern const uint32_t c_aauiCQMFHuffDec22[9][16]; +extern const uint32_t c_aauiCQMFHuffDec22[9][16]; - extern const uint32_t c_aauiCQMFHuffEnc23[46][2]; +extern const uint32_t c_aauiCQMFHuffEnc23[46][2]; - extern const uint32_t c_aauiCQMFHuffDec23[12][16]; +extern const uint32_t c_aauiCQMFHuffDec23[12][16]; - extern const uint32_t c_aauiCQMFHuffEnc24[55][2]; +extern const uint32_t c_aauiCQMFHuffEnc24[55][2]; - extern const uint32_t c_aauiCQMFHuffDec24[17][16]; +extern const uint32_t c_aauiCQMFHuffDec24[17][16]; - extern const uint32_t c_aauiCQMFHuffEnc25[65][2]; +extern const uint32_t c_aauiCQMFHuffEnc25[65][2]; - extern const uint32_t c_aauiCQMFHuffDec25[19][16]; +extern const uint32_t c_aauiCQMFHuffDec25[19][16]; - extern const uint32_t c_aauiCQMFHuffEnc26[77][2]; +extern const uint32_t c_aauiCQMFHuffEnc26[77][2]; - extern const uint32_t c_aauiCQMFHuffDec26[26][16]; +extern const uint32_t c_aauiCQMFHuffDec26[26][16]; - extern const uint32_t c_aauiCQMFHuffEnc27[91][2]; +extern const uint32_t c_aauiCQMFHuffEnc27[91][2]; - extern const uint32_t c_aauiCQMFHuffDec27[28][16]; +extern const uint32_t c_aauiCQMFHuffDec27[28][16]; - extern const uint32_t c_aauiCQMFHuffEnc28[109][2]; +extern const uint32_t c_aauiCQMFHuffEnc28[109][2]; - extern const uint32_t c_aauiCQMFHuffDec28[30][16]; +extern const uint32_t c_aauiCQMFHuffDec28[30][16]; - extern const uint32_t c_aauiCQMFHuffEnc29[129][2]; +extern const uint32_t c_aauiCQMFHuffEnc29[129][2]; - extern const uint32_t c_aauiCQMFHuffDec29[34][16]; +extern const uint32_t c_aauiCQMFHuffDec29[34][16]; - extern const uint32_t c_aauiCQMFHuffEnc30[153][2]; +extern const uint32_t c_aauiCQMFHuffEnc30[153][2]; - extern const uint32_t c_aauiCQMFHuffDec30[39][16]; +extern const uint32_t c_aauiCQMFHuffDec30[39][16]; - extern const uint32_t c_aauiCQMFHuffEnc31[181][2]; +extern const uint32_t c_aauiCQMFHuffEnc31[181][2]; - extern const uint32_t c_aauiCQMFHuffDec31[43][16]; +extern const uint32_t c_aauiCQMFHuffDec31[43][16]; - extern const uint32_t c_aauiCQMFHuffEnc33[16][2]; +extern const uint32_t c_aauiCQMFHuffEnc33[16][2]; - extern const uint32_t c_aauiCQMFHuffDec33[2][16]; +extern const uint32_t c_aauiCQMFHuffDec33[2][16]; - extern const uint32_t c_aauiCQMFHuffEnc34[16][2]; +extern const uint32_t c_aauiCQMFHuffEnc34[16][2]; - extern const uint32_t c_aauiCQMFHuffDec34[2][16]; +extern const uint32_t c_aauiCQMFHuffDec34[2][16]; - extern const uint32_t c_aauiCQMFHuffEnc35[25][2]; +extern const uint32_t c_aauiCQMFHuffEnc35[25][2]; - extern const uint32_t c_aauiCQMFHuffDec35[9][16]; +extern const uint32_t c_aauiCQMFHuffDec35[9][16]; - extern const uint32_t c_aauiCQMFHuffEnc36[36][2]; +extern const uint32_t c_aauiCQMFHuffEnc36[36][2]; - extern const uint32_t c_aauiCQMFHuffDec36[7][16]; +extern const uint32_t c_aauiCQMFHuffDec36[7][16]; - extern const uint32_t c_aauiCQMFHuffEnc37[36][2]; +extern const uint32_t c_aauiCQMFHuffEnc37[36][2]; - extern const uint32_t c_aauiCQMFHuffDec37[4][16]; +extern const uint32_t c_aauiCQMFHuffDec37[4][16]; - extern const uint32_t c_aauiCQMFHuffEnc38[49][2]; +extern const uint32_t c_aauiCQMFHuffEnc38[49][2]; - extern const uint32_t c_aauiCQMFHuffDec38[22][16]; +extern const uint32_t c_aauiCQMFHuffDec38[22][16]; - extern const uint32_t c_aauiCQMFHuffEnc39[64][2]; +extern const uint32_t c_aauiCQMFHuffEnc39[64][2]; - extern const uint32_t c_aauiCQMFHuffDec39[12][16]; +extern const uint32_t c_aauiCQMFHuffDec39[12][16]; - extern const uint32_t c_aauiCQMFHuffEnc40[81][2]; +extern const uint32_t c_aauiCQMFHuffEnc40[81][2]; - extern const uint32_t c_aauiCQMFHuffDec40[36][16]; +extern const uint32_t c_aauiCQMFHuffDec40[36][16]; - extern const uint32_t c_aauiCQMFHuffEnc41[100][2]; +extern const uint32_t c_aauiCQMFHuffEnc41[100][2]; - extern const uint32_t c_aauiCQMFHuffDec41[16][16]; +extern const uint32_t c_aauiCQMFHuffDec41[16][16]; - extern const uint32_t c_aauiCQMFHuffEnc42[169][2]; +extern const uint32_t c_aauiCQMFHuffEnc42[169][2]; - extern const uint32_t c_aauiCQMFHuffDec42[28][16]; +extern const uint32_t c_aauiCQMFHuffDec42[28][16]; - extern const uint32_t c_aauiCQMFHuffEnc43[196][2]; +extern const uint32_t c_aauiCQMFHuffEnc43[196][2]; - extern const uint32_t c_aauiCQMFHuffDec43[32][16]; +extern const uint32_t c_aauiCQMFHuffDec43[32][16]; - extern const uint32_t c_aauiCQMFHuffEnc44[289][2]; +extern const uint32_t c_aauiCQMFHuffEnc44[289][2]; - extern const uint32_t c_aauiCQMFHuffDec44[27][16]; +extern const uint32_t c_aauiCQMFHuffDec44[27][16]; - extern const uint32_t c_aauiCQMFHuffEnc45[324][2]; +extern const uint32_t c_aauiCQMFHuffEnc45[324][2]; - extern const uint32_t c_aauiCQMFHuffDec45[50][16]; +extern const uint32_t c_aauiCQMFHuffDec45[50][16]; - extern const uint32_t c_aauiCQMFHuffEnc46[400][2]; +extern const uint32_t c_aauiCQMFHuffEnc46[400][2]; - extern const uint32_t c_aauiCQMFHuffDec46[61][16]; +extern const uint32_t c_aauiCQMFHuffDec46[61][16]; - extern const uint32_t c_aauiCQMFHuffEnc47[576][2]; +extern const uint32_t c_aauiCQMFHuffEnc47[576][2]; - extern const uint32_t c_aauiCQMFHuffDec47[87][16]; +extern const uint32_t c_aauiCQMFHuffDec47[87][16]; - extern const uint32_t c_aauiCQMFHuffEnc48[729][2]; +extern const uint32_t c_aauiCQMFHuffEnc48[729][2]; - extern const uint32_t c_aauiCQMFHuffDec48[110][16]; +extern const uint32_t c_aauiCQMFHuffDec48[110][16]; - extern const uint32_t c_aauiCQMFHuffEnc49[729][2]; +extern const uint32_t c_aauiCQMFHuffEnc49[729][2]; - extern const uint32_t c_aauiCQMFHuffDec49[113][16]; +extern const uint32_t c_aauiCQMFHuffDec49[113][16]; - extern const uint32_t c_aauiCQMFHuffEnc50[28][2]; +extern const uint32_t c_aauiCQMFHuffEnc50[28][2]; - extern const uint32_t c_aauiCQMFHuffDec50[6][16]; +extern const uint32_t c_aauiCQMFHuffDec50[6][16]; - extern const uint32_t c_aauiCQMFHuffEnc51[29][2]; +extern const uint32_t c_aauiCQMFHuffEnc51[29][2]; - extern const uint32_t c_aauiCQMFHuffDec51[6][16]; +extern const uint32_t c_aauiCQMFHuffDec51[6][16]; - extern const uint32_t c_aauiCQMFHuffEnc52[32][2]; +extern const uint32_t c_aauiCQMFHuffEnc52[32][2]; - extern const uint32_t c_aauiCQMFHuffDec52[7][16]; +extern const uint32_t c_aauiCQMFHuffDec52[7][16]; - extern const uint32_t c_aauiCQMFHuffEnc53[37][2]; +extern const uint32_t c_aauiCQMFHuffEnc53[37][2]; - extern const uint32_t c_aauiCQMFHuffDec53[9][16]; +extern const uint32_t c_aauiCQMFHuffDec53[9][16]; - extern const uint32_t c_aauiCQMFHuffEnc54[39][2]; +extern const uint32_t c_aauiCQMFHuffEnc54[39][2]; - extern const uint32_t c_aauiCQMFHuffDec54[9][16]; +extern const uint32_t c_aauiCQMFHuffDec54[9][16]; - extern const uint32_t c_aauiCQMFHuffEnc55[46][2]; +extern const uint32_t c_aauiCQMFHuffEnc55[46][2]; - extern const uint32_t c_aauiCQMFHuffDec55[10][16]; +extern const uint32_t c_aauiCQMFHuffDec55[10][16]; - extern const uint32_t c_aauiCQMFHuffEnc56[55][2]; +extern const uint32_t c_aauiCQMFHuffEnc56[55][2]; - extern const uint32_t c_aauiCQMFHuffDec56[12][16]; +extern const uint32_t c_aauiCQMFHuffDec56[12][16]; - extern const uint32_t c_aauiCQMFHuffEnc57[65][2]; +extern const uint32_t c_aauiCQMFHuffEnc57[65][2]; - extern const uint32_t c_aauiCQMFHuffDec57[14][16]; +extern const uint32_t c_aauiCQMFHuffDec57[14][16]; - extern const uint32_t c_aauiCQMFHuffEnc58[77][2]; +extern const uint32_t c_aauiCQMFHuffEnc58[77][2]; - extern const uint32_t c_aauiCQMFHuffDec58[17][16]; +extern const uint32_t c_aauiCQMFHuffDec58[17][16]; - extern const uint32_t c_aauiCQMFHuffEnc59[91][2]; +extern const uint32_t c_aauiCQMFHuffEnc59[91][2]; - extern const uint32_t c_aauiCQMFHuffDec59[20][16]; +extern const uint32_t c_aauiCQMFHuffDec59[20][16]; - extern const uint32_t c_aauiCQMFHuffEnc60[109][2]; +extern const uint32_t c_aauiCQMFHuffEnc60[109][2]; - extern const uint32_t c_aauiCQMFHuffDec60[24][16]; +extern const uint32_t c_aauiCQMFHuffDec60[24][16]; - extern const uint32_t c_aauiCQMFHuffEnc61[129][2]; +extern const uint32_t c_aauiCQMFHuffEnc61[129][2]; - extern const uint32_t c_aauiCQMFHuffDec61[33][16]; +extern const uint32_t c_aauiCQMFHuffDec61[33][16]; - extern const uint32_t c_aauiCQMFHuffEnc62[153][2]; +extern const uint32_t c_aauiCQMFHuffEnc62[153][2]; - extern const uint32_t c_aauiCQMFHuffDec62[41][16]; +extern const uint32_t c_aauiCQMFHuffDec62[41][16]; - extern const uint32_t c_aauiCQMFHuffEnc63[181][2]; +extern const uint32_t c_aauiCQMFHuffEnc63[181][2]; - extern const uint32_t c_aauiCQMFHuffDec63[39][16]; +extern const uint32_t c_aauiCQMFHuffDec63[39][16]; - extern const uint32_t ( *c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE] )[2]; +extern const uint32_t ( *c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE] )[2]; - extern const uint32_t ( *c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE] )[HUFF_DEC_TABLE_SIZE]; +extern const uint32_t ( *c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE] )[HUFF_DEC_TABLE_SIZE]; #else extern const uint16_t c_aauiCQMFHuffEnc1[16][2]; extern const uint16_t c_aauiCQMFHuffEnc2[16][2]; @@ -519,49 +517,47 @@ extern const uint32_t num_row_aauiCQMFHuff[2 * ALLOC_TABLE_SIZE]; #endif #ifdef USE_DEMOD_TABLES - extern const int32_t c_aaiHuffDemod1[16][2]; +extern const int32_t c_aaiHuffDemod1[16][2]; - extern const int32_t c_aaiHuffDemod2[16][2]; +extern const int32_t c_aaiHuffDemod2[16][2]; - extern const int32_t c_aaiHuffDemod3[25][2]; +extern const int32_t c_aaiHuffDemod3[25][2]; - extern const int32_t c_aaiHuffDemod4[36][2]; +extern const int32_t c_aaiHuffDemod4[36][2]; - extern const int32_t c_aaiHuffDemod5[36][2]; +extern const int32_t c_aaiHuffDemod5[36][2]; - extern const int32_t c_aaiHuffDemod6[49][2]; +extern const int32_t c_aaiHuffDemod6[49][2]; - extern const int32_t c_aaiHuffDemod7[64][2]; +extern const int32_t c_aaiHuffDemod7[64][2]; - extern const int32_t c_aaiHuffDemod8[81][2]; +extern const int32_t c_aaiHuffDemod8[81][2]; - extern const int32_t c_aaiHuffDemod9[100][2]; +extern const int32_t c_aaiHuffDemod9[100][2]; - extern const int32_t c_aaiHuffDemod10[169][2]; +extern const int32_t c_aaiHuffDemod10[169][2]; - extern const int32_t c_aaiHuffDemod11[196][2]; +extern const int32_t c_aaiHuffDemod11[196][2]; - extern const int32_t c_aaiHuffDemod12[289][2]; +extern const int32_t c_aaiHuffDemod12[289][2]; - extern const int32_t c_aaiHuffDemod13[324][2]; +extern const int32_t c_aaiHuffDemod13[324][2]; - extern const int32_t c_aaiHuffDemod14[400][2]; +extern const int32_t c_aaiHuffDemod14[400][2]; - extern const int32_t c_aaiHuffDemod15[576][2]; +extern const int32_t c_aaiHuffDemod15[576][2]; - extern const int32_t c_aaiHuffDemod16[729][2]; +extern const int32_t c_aaiHuffDemod16[729][2]; - extern const int32_t c_aaiHuffDemod17[729][2]; +extern const int32_t c_aaiHuffDemod17[729][2]; - extern const int32_t ( *c_apaiDemodTables[ALLOC_TABLE_SIZE] )[2]; +extern const int32_t ( *c_apaiDemodTables[ALLOC_TABLE_SIZE] )[2]; #endif - extern const uint32_t c_aaiRMSEnvHuffEnc[64][2]; +extern const uint32_t c_aaiRMSEnvHuffEnc[64][2]; - extern const uint32_t c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE]; +extern const uint32_t c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE]; -#ifdef __cplusplus -} #endif #endif /* _TABLES_H_ */ diff --git a/lib_rend/ivas_splitRend_lcld_dec.c b/lib_rend/ivas_splitRend_lcld_dec.c index 49987f18f214a721452c031b3d5490c3b7e5ade0..93489d19b889a28c11ce33441f0bbc0b76a03cac 100644 --- a/lib_rend/ivas_splitRend_lcld_dec.c +++ b/lib_rend/ivas_splitRend_lcld_dec.c @@ -36,7 +36,6 @@ Nations Convention on Contracts on the International Sales of Goods. *******************************************************************************************************/ #include "options.h" - #ifdef SPLIT_REND_WITH_HEAD_ROT #include "cnst.h" #include "ivas_cnst.h" diff --git a/lib_rend/ivas_splitRend_lcld_enc.c b/lib_rend/ivas_splitRend_lcld_enc.c index bb960645292b5917877007d0f1d6fbbd2dd37f77..a0b3e86d9829c26df1938d115c3b3d6d85ef1401 100644 --- a/lib_rend/ivas_splitRend_lcld_enc.c +++ b/lib_rend/ivas_splitRend_lcld_enc.c @@ -36,7 +36,6 @@ Nations Convention on Contracts on the International Sales of Goods. *******************************************************************************************************/ #include "options.h" - #ifdef SPLIT_REND_WITH_HEAD_ROT #include "cnst.h" #include "ivas_cnst.h" diff --git a/lib_rend/ivas_splitRendererPLC.c b/lib_rend/ivas_splitRendererPLC.c index dfa5e71a23c612bef11e59a98ed87ec76ec09784..3d5ad64824a7f2a84b1f200040524f02024f2ad7 100644 --- a/lib_rend/ivas_splitRendererPLC.c +++ b/lib_rend/ivas_splitRendererPLC.c @@ -31,7 +31,6 @@ *******************************************************************************************************/ #include "options.h" - #ifdef SPLIT_REND_WITH_HEAD_ROT #include #include diff --git a/lib_rend/ivas_splitRendererPost.c b/lib_rend/ivas_splitRendererPost.c index 1adf9774961a1e5ab303b391eea2e0eef878adf9..48d957993f49a600a51842aef5e54f640b9682f1 100644 --- a/lib_rend/ivas_splitRendererPost.c +++ b/lib_rend/ivas_splitRendererPost.c @@ -31,7 +31,6 @@ *******************************************************************************************************/ #include "options.h" - #ifdef SPLIT_REND_WITH_HEAD_ROT #include #include diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index a087efee6ff79cbe400d1b1275b32ef34859cb63..ef5b29f0b9414f60da8f916b165376e9396b47c4 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -31,7 +31,6 @@ *******************************************************************************************************/ #include "options.h" - #ifdef SPLIT_REND_WITH_HEAD_ROT #include #include diff --git a/lib_rend/ivas_splitRenderer_utils.c b/lib_rend/ivas_splitRenderer_utils.c index f5a9791b14e04cab87caa465d008ae408689d98e..a6e5720e30ab6f4b8de112ea3f1c11242e44a9cd 100644 --- a/lib_rend/ivas_splitRenderer_utils.c +++ b/lib_rend/ivas_splitRenderer_utils.c @@ -31,7 +31,6 @@ *******************************************************************************************************/ #include "options.h" - #ifdef SPLIT_REND_WITH_HEAD_ROT #include #include diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 7949e0faa9a4c04a4992470f50321f4996a9b1fe..abe380e8c319a92cd10c6c3b47be2bde3018207f 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8045,7 +8045,7 @@ static void renderMasaToBinaural( static void renderMasaToMasa( input_masa *masaInput, - const IVAS_REND_AudioBuffer outAudio ) + IVAS_REND_AudioBuffer outAudio ) { int16_t sf, band, dir, numDirs; float ratioSum; diff --git a/lib_util/split_rend_bfi_file_reader.c b/lib_util/split_rend_bfi_file_reader.c index 40767f6828943afa051d1ca08b60b7c57dd06353..1eab6652674ef9a38c4d4f8a93df494f626cd2a6 100644 --- a/lib_util/split_rend_bfi_file_reader.c +++ b/lib_util/split_rend_bfi_file_reader.c @@ -31,7 +31,6 @@ *******************************************************************************************************/ #include "options.h" - #ifdef SPLIT_REND_WITH_HEAD_ROT #include "split_rend_bfi_file_reader.h" #include diff --git a/lib_util/split_render_file_read_write.c b/lib_util/split_render_file_read_write.c index 5a7929e28c04f231389c3baedca053e5b50bffd5..36902b91ec2163adee2a247c873a5f506b8e71b3 100644 --- a/lib_util/split_render_file_read_write.c +++ b/lib_util/split_render_file_read_write.c @@ -31,7 +31,6 @@ *******************************************************************************************************/ #include "options.h" - #ifdef SPLIT_REND_WITH_HEAD_ROT #include "split_render_file_read_write.h" #include diff --git a/scripts/prepare_instrumentation.sh b/scripts/prepare_instrumentation.sh index 4052b8a10e6a674b0e9758789132f9fd8af834c0..1636d7802a9d7e1d3d4375c46253c02134bfc3ee 100755 --- a/scripts/prepare_instrumentation.sh +++ b/scripts/prepare_instrumentation.sh @@ -30,6 +30,24 @@ # the United Nations Convention on Contracts on the International Sales of Goods. # +function usage { + echo + echo "Usage:" + echo " prepare_instrumentation.sh [MODE]" + echo + echo " MODE - sr_off (default) or sr_on" + exit +} + +if [ -z "$1" ] || [ "$1" == "sr_off" ]; then + INCLUDE_SPLIT=0 +elif [ "$1" == "sr_on" ]; then + INCLUDE_SPLIT=1 +else + usage +fi + + system=`uname -s` if [[ ($system == "Linux") && (`uname -a` =~ (microsoft|Microsoft|wsl|WSL) ) ]]; then system="Linux" @@ -68,6 +86,9 @@ cp -R ../apps $targetdir cp -R ../Makefile $targetdir cp -R ../CMakeLists.txt $targetdir cp -R ../Workspace_msvc $targetdir +if [ $INCLUDE_SPLIT -eq 0 ]; then + strip_split_rendering.sh $targetdir +fi # back up #ifdef-list rm -f $ifdef_list @@ -106,7 +127,9 @@ find $targetdir -name "*.[ch]" -exec sed -i.bak -e "s/\(0x[0-9a-fA-F]*\)UL/\(\(u # run wmc_tool "tools/$system/wmc_tool" -m "$targetdir/apps/encoder.c" "$targetdir/lib_enc/*.c" "$targetdir/lib_com/*.c" >> /dev/null "tools/$system/wmc_tool" -m "$targetdir/apps/decoder.c" "$targetdir/lib_dec/*.c" "$targetdir/lib_rend/*.c" >> /dev/null -"tools/$system/wmc_tool" -m "$targetdir/apps/renderer.c" "$targetdir/lib_rend/*.c" "$targetdir/lc3plus/*.c" "$targetdir/lc3plus/fft/*.c" >> /dev/null +if [ $INCLUDE_SPLIT -eq 1 ]; then + "tools/$system/wmc_tool" -m "$targetdir/apps/renderer.c" "$targetdir/lib_rend/*.c" "$targetdir/lc3plus/*.c" "$targetdir/lc3plus/fft/*.c" >> /dev/null +fi # automatically enable #define WMOPS in options.h sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*WMOPS\)[[:space:]]*\*\//\1/g" $targetdir/lib_com/options.h diff --git a/scripts/strip_split_rendering.py b/scripts/strip_split_rendering.py new file mode 100644 index 0000000000000000000000000000000000000000..fd286ced901aa820d7b8964ab36ac7147ed3b680 --- /dev/null +++ b/scripts/strip_split_rendering.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python3 + +# +# (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, +# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +# contributors to this repository. All Rights Reserved. +# +# This software is protected by copyright law and by international treaties. +# The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, +# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +# contributors to this repository retain full ownership rights in their respective contributions in +# the software. This notice grants no license of any kind, including but not limited to patent +# license, nor is any license granted by implication, estoppel or otherwise. +# +# Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +# contributions. +# +# This software is provided "AS IS", without any express or implied warranties. The software is in the +# development stage. It is intended exclusively for experts who have experience with such software and +# solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +# and fitness for a particular purpose are hereby disclaimed and excluded. +# +# Any dispute, controversy or claim arising under or in relation to providing this software shall be +# submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +# accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +# the United Nations Convention on Contracts on the International Sales of Goods. +# + +# remove other split rendering files +sr_files_rend=[ + "lib_rend\\ivas_CQMFDecoder.c" + "lib_rend\\ivas_CQMFDecoder.h", + "lib_rend\\ivas_CQMFDecoder.c", + "lib_rend\\ivas_CQMFDecoder.h", + "lib_rend\\ivas_CQMFEncoder.c", + "lib_rend\\ivas_CQMFEncoder.h", + "lib_rend\\ivas_MSPred.c", + "lib_rend\\ivas_MSPred.h", + "lib_rend\\ivas_NoiseGen.c", + "lib_rend\\ivas_NoiseGen.h", + "lib_rend\\ivas_PerceptualModel.c", + "lib_rend\\ivas_PerceptualModel.h", + "lib_rend\\ivas_PredDecoder.c", + "lib_rend\\ivas_PredDecoder.h", + "lib_rend\\ivas_PredEncoder.c", + "lib_rend\\ivas_PredEncoder.h", + "lib_rend\\ivas_PredTables.h", + "lib_rend\\ivas_RMSEnvGrouping.c", + "lib_rend\\ivas_RMSEnvGrouping.h", + "lib_rend\\ivas_cldfb_codec_bitstream.c", + "lib_rend\\ivas_cldfb_codec_bitstream.h", + "lib_rend\\ivas_lc3plus_common.c", + "lib_rend\\ivas_lc3plus_common.h", + "lib_rend\\ivas_lc3plus_dec.c", + "lib_rend\\ivas_lc3plus_dec.h", + "lib_rend\\ivas_lc3plus_enc.c", + "lib_rend\\ivas_lc3plus_enc.h", + "lib_rend\\ivas_lcld_tables.c", + "lib_rend\\ivas_lcld_tables.h", + "lib_rend\\ivas_splitRend_lcld_dec.c", + "lib_rend\\ivas_splitRend_lcld_enc.c", + "lib_rend\\ivas_splitRendererPLC.c", + "lib_rend\\ivas_splitRendererPost.c", + "lib_rend\\ivas_splitRendererPre.c", + "lib_rend\\ivas_splitRenderer_utils.c" +] + +sr_files_util=[ + "lib_util\\split_rend_bfi_file_reader.c", + "lib_util\\split_rend_bfi_file_reader.h", + "lib_util\\split_render_file_read_write.c", + "lib_util\\split_render_file_read_write.h" +] + +if __name__ == "__main__": + + rendproj = '.\Workspace_msvc\lib_rend.vcxproj' + utilproj = '.\Workspace_msvc\lib_util.vcxproj' + + with open(rendproj,'r') as f: + lines = f.readlines() + with open(rendproj,'w') as f: + for line in lines: + if not any([x in line for x in sr_files_rend]): + f.write(line) + + with open(utilproj,'r') as f: + lines = f.readlines() + with open(utilproj,'w') as f: + for line in lines: + if not any([x in line for x in sr_files_util]): + f.write(line) + \ No newline at end of file diff --git a/scripts/strip_split_rendering.sh b/scripts/strip_split_rendering.sh new file mode 100644 index 0000000000000000000000000000000000000000..f202d837e3d55bcca4cf6bf3ee867eb0993c02b0 --- /dev/null +++ b/scripts/strip_split_rendering.sh @@ -0,0 +1,93 @@ +#!/bin/bash + +# +# (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, +# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +# contributors to this repository. All Rights Reserved. +# +# This software is protected by copyright law and by international treaties. +# The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, +# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +# contributors to this repository retain full ownership rights in their respective contributions in +# the software. This notice grants no license of any kind, including but not limited to patent +# license, nor is any license granted by implication, estoppel or otherwise. +# +# Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +# contributions. +# +# This software is provided "AS IS", without any express or implied warranties. The software is in the +# development stage. It is intended exclusively for experts who have experience with such software and +# solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +# and fitness for a particular purpose are hereby disclaimed and excluded. +# +# Any dispute, controversy or claim arising under or in relation to providing this software shall be +# submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +# accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +# the United Nations Convention on Contracts on the International Sales of Goods. +# + +OUTDIR=$1 + + +# remove complete lc3plus folder +rm -R $OUTDIR/lc3plus + +# remove other split rendering files +declare -a sr_files_rend=( + "lib_rend/ivas_CQMFDecoder.c" + "lib_rend/ivas_CQMFDecoder.h" + "lib_rend/ivas_CQMFEncoder.c" + "lib_rend/ivas_CQMFEncoder.h" + "lib_rend/ivas_MSPred.c" + "lib_rend/ivas_MSPred.h" + "lib_rend/ivas_NoiseGen.c" + "lib_rend/ivas_NoiseGen.h" + "lib_rend/ivas_PerceptualModel.c" + "lib_rend/ivas_PerceptualModel.h" + "lib_rend/ivas_PredDecoder.c" + "lib_rend/ivas_PredDecoder.h" + "lib_rend/ivas_PredEncoder.c" + "lib_rend/ivas_PredEncoder.h" + "lib_rend/ivas_PredTables.h" + "lib_rend/ivas_RMSEnvGrouping.c" + "lib_rend/ivas_RMSEnvGrouping.h" + "lib_rend/ivas_cldfb_codec_bitstream.c" + "lib_rend/ivas_cldfb_codec_bitstream.h" + "lib_rend/ivas_lc3plus_common.c" + "lib_rend/ivas_lc3plus_common.h" + "lib_rend/ivas_lc3plus_dec.c" + "lib_rend/ivas_lc3plus_dec.h" + "lib_rend/ivas_lc3plus_enc.c" + "lib_rend/ivas_lc3plus_enc.h" + "lib_rend/ivas_lcld_tables.c" + "lib_rend/ivas_lcld_tables.h" + "lib_rend/ivas_splitRend_lcld_dec.c" + "lib_rend/ivas_splitRend_lcld_enc.c" + "lib_rend/ivas_splitRendererPLC.c" + "lib_rend/ivas_splitRendererPost.c" + "lib_rend/ivas_splitRendererPre.c" + "lib_rend/ivas_splitRenderer_utils.c" +) + +for file in ${sr_files_rend[@]}; do + rm $OUTDIR/$file + file_windows=${file//\//'\\'} + sed -i.bak -e "/${file_windows}/d" ${OUTDIR}/Workspace_msvc/lib_rend.vcxproj +done + +declare -a sr_files_util=( + "lib_util/split_rend_bfi_file_reader.c" + "lib_util/split_rend_bfi_file_reader.h" + "lib_util/split_render_file_read_write.c" + "lib_util/split_render_file_read_write.h" +) + +for file in ${sr_files_util[@]}; do + rm $OUTDIR/$file + file_windows=${file//\//'\\'} + sed -i.bak -e "/${file_windows}/d" ${OUTDIR}/Workspace_msvc/lib_util.vcxproj +done \ No newline at end of file