diff --git a/lib_com/options.h b/lib_com/options.h index 9c2089633c8cf11a64666214a4c2cf5385e4022d..944b74e1b938699bacbc87c9651f1fe53ff75c98 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -198,7 +198,10 @@ #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 */ -#define FIX_658_SPLIT_REND_MASA /*Dlb : Fix for issue 658, uninitialized memory access in MASA in Split rendering 0DOF mode*/ +#define FIX_658_SPLIT_REND_MASA /*Dlb : Fix for issue 658, uninitialized memory access in MASA in Split rendering 0DOF mode*/ +#ifdef SBA_AND_OBJECTS +#define OSBA_SPLIT_RENDERING +#endif #endif #define FIX_594_STL_INCLUDE /* FhG: issue 594: Missing include of stl.h */ @@ -226,7 +229,6 @@ #define SBA_AND_OBJECTS #ifdef SBA_AND_OBJECTS #define OSBA_BR_SWITCHING -#define OSBA_SPLIT_RENDERING #endif #define TD_REND_TUNING_RENAME /* Eri: Tuning of TD renderer model as part of contribution 25 and renaming for default HRIR set */ diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index d9d348c167dd795554db04c0c8c7d4547c820dea..edc3e24aa73fe664441ccc8ad2807b854cab0d12 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -61,7 +61,7 @@ static void ps_pred_process( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, float qmf_m #ifdef JBM_PARAMUPMIX static void ps_pred_process_sf( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, DECODER_TC_BUFFER_HANDLE hTcBuffer, float qmf_mod_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_mod_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float *param_interpol, const int16_t ch, const int16_t slots_rendered ); -#ifdef PARAMUPMIX_BINAURAL_UPDATES +#if defined( PARAMUPMIX_BINAURAL_UPDATES ) && defined( SPLIT_REND_WITH_HEAD_ROT ) static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS], int16_t slot_index_start ); #else static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS] ); @@ -547,7 +547,7 @@ 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 PARAMUPMIX_BINAURAL_UPDATES +#if defined( PARAMUPMIX_BINAURAL_UPDATES ) && defined( SPLIT_REND_WITH_HEAD_ROT ) int16_t slot_index_start; #endif MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; @@ -599,14 +599,14 @@ void ivas_mc_paramupmix_dec_render( mvr2r( hMCParamUpmix->beta_prev[ch], hMCParamUpmix->beta_sf[ch], IVAS_MAX_NUM_BANDS ); } -#ifdef PARAMUPMIX_BINAURAL_UPDATES +#if defined( PARAMUPMIX_BINAURAL_UPDATES ) && defined( 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 PARAMUPMIX_BINAURAL_UPDATES +#if defined( PARAMUPMIX_BINAURAL_UPDATES ) && defined( 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 @@ -1031,7 +1031,7 @@ static void ps_pred_process_sf( static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ float *output_f[MAX_OUTPUT_CHANNELS] /* i/o: synthesized core-coder transport channels */ -#ifdef PARAMUPMIX_BINAURAL_UPDATES +#if defined( PARAMUPMIX_BINAURAL_UPDATES ) && defined( SPLIT_REND_WITH_HEAD_ROT ) , int16_t slot_index_start #endif diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 00cd2e73c7857351b6dbe10a548cd8c6dc97b2f4..62bdcd37c02c9b495bb27f5b21bb859fd3198486 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -104,7 +104,11 @@ 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] ); @@ -527,7 +531,11 @@ 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++ ) { @@ -699,7 +707,11 @@ 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++ ) { @@ -724,7 +736,9 @@ 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 ) { diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 990d36c8f04ac1a729f65848c72d612fc47a6bc9..e3a099f4b18e154bb8187c85189d8baa88f977a9 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -383,10 +383,12 @@ int16_t ivas_get_nchan_buffers_dec( } } +#ifdef SPLIT_REND_WITH_HEAD_ROT if ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { nchan_out_buff = max( nchan_out_buff, st_ivas->splitBinRend.splitrend.multiBinPoseData.num_poses * BINAURAL_CHANNELS ); } +#endif return nchan_out_buff; } diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index fe8fd63f0539b3e61c4b30e1831862de0c6efa73..7ae786d9cb7bf3933aa4ad06cdec7c7ef80e1d65 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -60,15 +60,14 @@ #define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) #define MAX_CLDFB_BUFFER_LENGTH ( MAX_CLDFB_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) #define MAX_BIN_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * BINAURAL_CHANNELS ) +#else +#define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) +#endif #ifdef FIX_194_LFE_DELAY_EXTREND #define MAX_BIN_DELAY_SAMPLES 50 /* Maximum supported rendering latency for binaural IRs */ #endif -#else -#define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) -#endif - /* Frame size required when rendering to binaural */ #define BINAURAL_RENDERING_FRAME_SIZE_MS 20 @@ -1454,7 +1453,7 @@ static ivas_error setRendInputActiveIsm( if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { #ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB - if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, &inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif @@ -6502,7 +6501,7 @@ static ivas_error renderLfeToBinaural( #ifdef FIX_194_LFE_DELAY_EXTREND for ( ear_idx = 0; ear_idx < BINAURAL_CHANNELS; ++ear_idx ) { - writePtr = getSmplPtr( outAudio, pose_idx * BINAURAL_CHANNELS + ear_idx, 0 ); + writePtr = getSmplPtr( outAudio, ear_idx, 0 ); v_add( writePtr, tmpLfeBuffer, writePtr, frame_size ); } #else @@ -8163,6 +8162,7 @@ static void renderMasaToBinaural( copyMasaMetadataToDiracRenderer( &masaInput->masaMetadata, masaInput->decDummy->hSpatParamRendCom ); ivas_dirac_dec_binaural( masaInput->decDummy, *masaInput->base.ctx.pCombinedOrientationData, tmpBuffer, masaInput->base.inputBuffer.config.numChannels ); +#ifdef SPLIT_REND_WITH_HEAD_ROT if ( is_split_rend_mode ) { accumulateCLDFBArrayToBuffer( @@ -8172,12 +8172,15 @@ static void renderMasaToBinaural( } else { +#endif #ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP accumulate2dArrayToBuffer( tmpBuffer_buff, &outAudio ); #else accumulate2dArrayToBuffer( tmpBuffer, &outAudio ); #endif +#ifdef SPLIT_REND_WITH_HEAD_ROT } +#endif return; } diff --git a/lib_util/render_config_reader.h b/lib_util/render_config_reader.h index f9491a0488124d6f87eed4c501ef5bc5dd6f5f50..33cac35e99bc8515e53605ebd3f766f963c32a0c 100644 --- a/lib_util/render_config_reader.h +++ b/lib_util/render_config_reader.h @@ -61,8 +61,8 @@ ivas_error RenderConfigReader_getAcousticEnvironment( #ifdef CONTROL_METADATA_DIRECTIVITY ivas_error RenderConfigReader_getDirectivity( RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ - uint16_t *pId, /* i : Directivity pattern ID */ - float *directivity /* o : Target directivity */ + uint16_t *pId, /* i : Directivity pattern ID */ + float *directivity /* o : Target directivity */ ); #endif /* Verifies configuration parameters */ @@ -75,11 +75,8 @@ ivas_error RenderConfigReader_checkValues( ivas_error RenderConfigReader_read( #ifdef CONTROL_METADATA_REVERB RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ - const char *pRenderConfigPath /* i : Renderer configuration file path */ -#if ( defined SPLIT_REND_WITH_HEAD_ROT ) || ( defined DEBUGGING ) - , - IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ -#endif + const char *pRenderConfigPath, /* i : Renderer configuration file path */ + IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ #else RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ diff --git a/scripts/find_unused_symbols.sh b/scripts/find_unused_symbols.sh index 090f6de4323eee8fb6628e2572227552f02b41d0..1a6d93745ff51cdb8a382f8b6f82fbb4df7a71db 100755 --- a/scripts/find_unused_symbols.sh +++ b/scripts/find_unused_symbols.sh @@ -33,7 +33,6 @@ options=$1 WORKDIR=.. OBJDIR=obj -EXECUTABLES="${WORKDIR}/IVAS_cod ${WORKDIR}/IVAS_dec ${WORKDIR}/IVAS_rend" evaluateTables=1 evaluateFunctions=1 @@ -43,7 +42,7 @@ help=0 while getopts ":ftnhd:" OPT; do case "$OPT" in d) - WORKDIR="${OPTARG}" + WORKDIR=$(realpath -s "${OPTARG}") ;; f) evaluateFunctions=1 @@ -77,18 +76,31 @@ fi # print C-code directory echo "C-code directory set to ${WORKDIR}" +WORKDIR_EXE=${WORKDIR//" "/"\ "} +EXECUTABLES="${WORKDIR_EXE}/IVAS_cod ${WORKDIR_EXE}/IVAS_dec ${WORKDIR_EXE}/IVAS_rend" # build if [ $compile -ne 0 ]; then - make -C ${WORKDIR} DEBUG=0 STRIP=1 clean all 1>&2 + make -C "${WORKDIR}" clean && make -j -C "${WORKDIR}" DEBUG=0 STRIP=1 all 1>&2 + echo "" fi +# check, whether executables exist +for i in $EXECUTABLES +do + if [ ! -f "$i" ]; then + echo "Executable $i not found. Aborting" + echo "" + exit + fi +done + if [ $evaluateFunctions != 0 ]; then # delete text files rm -f functions_obj.txt functions_exe.txt 1>&2 # find all functions in object files - nm ${WORKDIR}/${OBJDIR}/*.o | grep "^[0-9a-f]* T " | sed 's/^[0-9a-f]* T //' | sort -u > functions_obj.txt + nm "${WORKDIR}/${OBJDIR}/"*.o | grep "^[0-9a-f]* T " | sed 's/^[0-9a-f]* T //' | sort -u > functions_obj.txt # find all symbols in final executables nm ${EXECUTABLES} | grep "^[0-9a-f]* T " | sed 's/^[0-9a-f]* T //' | sort -u > functions_exe.txt @@ -104,7 +116,7 @@ if [ $evaluateTables -ne 0 ]; then rm -f tables_obj.txt tables_exe.txt 1>&2 # find all functions in object files - nm ${WORKDIR}/${OBJDIR}/*.o | grep "^[0-9a-f]* [RD] " | sed 's/^[0-9a-f]* [RD] //' | sort -u > tables_obj.txt + nm "${WORKDIR}/${OBJDIR}/"*.o | grep "^[0-9a-f]* [RD] " | sed 's/^[0-9a-f]* [RD] //' | sort -u > tables_obj.txt # find all symbols in final executables nm ${EXECUTABLES} | grep "^[0-9a-f]* [RD] " | sed 's/^[0-9a-f]* [RD] //' | sort -u > tables_exe.txt diff --git a/scripts/prepare_delivery.sh b/scripts/prepare_delivery.sh index 5f55895f58afffed29f4dfa69fce27d02ded4753..06c889f2402af667fdd7b8d973a0f72394708781 100755 --- a/scripts/prepare_delivery.sh +++ b/scripts/prepare_delivery.sh @@ -108,6 +108,8 @@ sed -i.bak -e '/lib_debug\\debug.[ch]/d' ${OUTDIR}/Workspace_msvc/lib_debug.vcxp sed -i.bak -e '/lib_debug\\sba_debug.[ch]/d' ${OUTDIR}/Workspace_msvc/lib_debug.vcxproj sed -i.bak -e '/lib_debug\\snr.c/d' ${OUTDIR}/Workspace_msvc/lib_debug.vcxproj rm -f ${OUTDIR}/Workspace_msvc/lib_debug.vcxproj.bak +rm -f ${OUTDIR}/lib_util/tsm_scale_file_reader.[ch] + # readme cp ${ROOT}/readme.txt ${OUTDIR}