diff --git a/lib_com/options.h b/lib_com/options.h index a7c73cd8175e762e674177fba25779ccb3d7cce0..96f7e047406befd221c8cac73daefcb6c376234a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,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 MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ @@ -163,7 +166,6 @@ #define SBA_AND_OBJECTS #ifdef SBA_AND_OBJECTS #define OSBA_BR_SWITCHING -#define OSBA_SPLIT_RENDERING #endif #define FIX_264_AUDIO_CHANNELS_TO_HEAP /* VA: issue 243: Move audio channels memory from stack to heap */ diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index cb8380846eedf0c1a5daaa77a50a28905a0a73a7..d9be291edbf1cff21379a1622e3fe7ca51ad9624 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -60,7 +60,11 @@ static void ps_pred_process( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, float qmf_m 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 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] ); +#endif static void ivas_param_upmix_dec_decorr_subframes( Decoder_Struct *st_ivas, const int16_t nSamplesForRendering ); @@ -562,7 +566,11 @@ void ivas_mc_paramupmix_dec_render( { 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 ); +#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++ ) { @@ -973,9 +981,13 @@ 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 */ - int16_t slot_index_start ) + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + float *output_f[MAX_OUTPUT_CHANNELS] /* i/o: synthesized core-coder transport channels */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + int16_t slot_index_start +#endif +) { int16_t i, ch, slot_idx, k; float *pPcm_temp[MC_PARAMUPMIX_COMBINATIONS * 2]; /* decorrelated and undecorrelated*/ diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 249edadc8cc7c5f505f99640ff02134e4d205240..847eba6e1cad4cd5dbf5c4faf371cad8002be34e 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -102,7 +102,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] ); @@ -525,7 +529,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++ ) { @@ -695,7 +703,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++ ) { @@ -720,7 +732,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 74ca4b9489eaff1e90123e185ff609572951bc6f..8e17dfe0a37a2626e8172c26a2f51a5d139d6481 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -60,13 +60,12 @@ #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 ) - -#define MAX_BIN_DELAY_SAMPLES 50 /* Maximum supported rendering latency for binaural IRs */ - #else #define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) #endif +#define MAX_BIN_DELAY_SAMPLES 50 /* Maximum supported rendering latency for binaural IRs */ + /* Frame size required when rendering to binaural */ #define BINAURAL_RENDERING_FRAME_SIZE_MS 20 @@ -1445,7 +1444,7 @@ static ivas_error setRendInputActiveIsm( } if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_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 ) { return error; } @@ -6414,7 +6413,7 @@ static ivas_error renderLfeToBinaural( /* Copy LFE to left and right ears */ 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 ); } #endif /* SPLIT_REND_WITH_HEAD_ROT */ @@ -8054,6 +8053,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( @@ -8063,12 +8063,15 @@ static void renderMasaToBinaural( } else { +#endif #ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP accumulate2dArrayToBuffer( tmpBuffer_buff, &outAudio ); #else - accumulate2dArrayToBuffer( tmpBuffer, &outAudio ); + 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 725b7399126e06f4696be923a3f5cfc697c5a0be..2e929643282ebc55dfdaff5c25f5c50cf0a26356 100644 --- a/lib_util/render_config_reader.h +++ b/lib_util/render_config_reader.h @@ -59,8 +59,8 @@ ivas_error RenderConfigReader_getAcousticEnvironment( ); 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 */ ); /* Verifies configuration parameters */ ivas_error RenderConfigReader_checkValues( @@ -70,11 +70,8 @@ ivas_error RenderConfigReader_checkValues( /* Reads a configuration */ ivas_error RenderConfigReader_read( 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 */ ); /* Closes the renderer configuration reader and deallocates memory */