Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -196,6 +196,7 @@ #define FIX_1383_HEAD_TRACK_SANITIZER /* Nok: issue 1383: Fix head tracking struc values reading in renderer */ #define FIX_1411_IGF_CRASH_BW_SWITCHING /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/ #define NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG /* FhG: Fix MDCT-Stereo comfort noise for certain noise types */ #define NONBE_1344_REND_MASA_LOW_FS /* Nokia: Issue 1344: Fix sanitizer errors when using IVAS_rend to render MASA with lower sampling rates */ // object-editing feature porting #define FIX_HRTF_LOAD_API // solves API conflicts between HRTF and object-editing features Loading lib_rend/ivas_dirac_ana.c +8 −0 Original line number Diff line number Diff line Loading @@ -235,6 +235,14 @@ void ivas_dirac_ana( /* Estimate MASA parameters from the SBA signals */ ivas_dirac_param_est_ana( hDirAC, data_in_f, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, input_frame ); #ifdef NONBE_1344_REND_MASA_LOW_FS /* Add zeros to higher bands in case of lower sampling rates */ if ( hDirAC->nbands < MASA_FREQUENCY_BANDS ) { ivas_masa_zero_high_bands( hDirAC->nbands, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); } #endif /* Create MASA metadata buffer from the estimated values */ ivas_create_masa_out_meta( hDirAC->hMasaOut, hDirAC->sph_grid16, nchan_transport, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); Loading lib_rend/ivas_masa_merge.c +23 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,9 @@ #include "ivas_prot.h" #include "ivas_cnst.h" #include "prot.h" #ifdef NONBE_1344_REND_MASA_LOW_FS #include "ivas_rom_com.h" #endif #include "wmc_auto.h" Loading Loading @@ -326,6 +329,9 @@ ivas_error masaPrerendOpen( { MASA_PREREND_HANDLE hMasaPrerend; int16_t i; #ifdef NONBE_1344_REND_MASA_LOW_FS int16_t maxBin; #endif ivas_error error; error = IVAS_ERR_OK; Loading @@ -336,6 +342,23 @@ ivas_error masaPrerendOpen( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA prerenderer\n" ) ); } #ifdef NONBE_1344_REND_MASA_LOW_FS /* Determine the number of bands and band grouping */ hMasaPrerend->nbands = MASA_FREQUENCY_BANDS; mvs2s( MASA_band_grouping_24, hMasaPrerend->band_grouping, MASA_FREQUENCY_BANDS + 1 ); maxBin = (int16_t) ( input_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); for ( i = 1; i < hMasaPrerend->nbands + 1; i++ ) { if ( hMasaPrerend->band_grouping[i] >= maxBin ) { hMasaPrerend->band_grouping[i] = maxBin; hMasaPrerend->nbands = i; break; } } #endif hMasaPrerend->num_Cldfb_instances = numTransports; for ( i = 0; i < hMasaPrerend->num_Cldfb_instances; i++ ) { Loading lib_rend/ivas_mcmasa_ana.c +43 −0 Original line number Diff line number Diff line Loading @@ -393,6 +393,14 @@ void ivas_mcmasa_ana( /* Analysis */ ivas_mcmasa_param_est_ana( hMcMasa, data_f, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, input_frame, nchan_inp ); #ifdef NONBE_1344_REND_MASA_LOW_FS /* Add zeros to higher bands in case of lower sampling rates */ if ( hMcMasa->nbands < MASA_FREQUENCY_BANDS ) { ivas_masa_zero_high_bands( hMcMasa->nbands, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); } #endif /* Create MASA metadata buffer from the estimated values */ ivas_create_masa_out_meta( hMcMasa->hMasaOut, hMcMasa->sph_grid16, nchan_transport, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); Loading Loading @@ -1131,3 +1139,38 @@ void ivas_create_masa_out_meta( return; } #ifdef NONBE_1344_REND_MASA_LOW_FS /*------------------------------------------------------------------------- * ivas_masa_zero_high_bands() * * *------------------------------------------------------------------------*/ void ivas_masa_zero_high_bands( const int16_t nbands, /* i : Number of frequency bands with estimated values */ float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated elevation */ float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated azimuth */ float energyRatio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated direct-to-total ratio */ float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated spread coherence */ float surroundingCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] /* i/o : Estimated surround coherence */ ) { int16_t sf, band; for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) { for ( band = nbands; band < MASA_FREQUENCY_BANDS; band++ ) { elevation_m_values[sf][band] = 0.0f; azimuth_m_values[sf][band] = 0.0f; energyRatio[sf][band] = 0.0f; spreadCoherence[sf][band] = 0.0f; surroundingCoherence[sf][band] = 0.0f; } } return; } #endif lib_rend/ivas_omasa_ana.c +8 −0 Original line number Diff line number Diff line Loading @@ -261,6 +261,14 @@ void ivas_omasa_ana( /* Estimate MASA parameters from the objects */ ivas_omasa_param_est_ana( hOMasa, data_in_f, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, input_frame, nchan_ism ); #ifdef NONBE_1344_REND_MASA_LOW_FS /* Add zeros to higher bands in case of lower sampling rates */ if ( hOMasa->nbands < MASA_FREQUENCY_BANDS ) { ivas_masa_zero_high_bands( hOMasa->nbands, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); } #endif /* Create MASA metadata buffer from the estimated values */ ivas_create_masa_out_meta( hOMasa->hMasaOut, hOMasa->sph_grid16, nchan_transport, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); Loading Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -196,6 +196,7 @@ #define FIX_1383_HEAD_TRACK_SANITIZER /* Nok: issue 1383: Fix head tracking struc values reading in renderer */ #define FIX_1411_IGF_CRASH_BW_SWITCHING /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/ #define NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG /* FhG: Fix MDCT-Stereo comfort noise for certain noise types */ #define NONBE_1344_REND_MASA_LOW_FS /* Nokia: Issue 1344: Fix sanitizer errors when using IVAS_rend to render MASA with lower sampling rates */ // object-editing feature porting #define FIX_HRTF_LOAD_API // solves API conflicts between HRTF and object-editing features Loading
lib_rend/ivas_dirac_ana.c +8 −0 Original line number Diff line number Diff line Loading @@ -235,6 +235,14 @@ void ivas_dirac_ana( /* Estimate MASA parameters from the SBA signals */ ivas_dirac_param_est_ana( hDirAC, data_in_f, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, input_frame ); #ifdef NONBE_1344_REND_MASA_LOW_FS /* Add zeros to higher bands in case of lower sampling rates */ if ( hDirAC->nbands < MASA_FREQUENCY_BANDS ) { ivas_masa_zero_high_bands( hDirAC->nbands, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); } #endif /* Create MASA metadata buffer from the estimated values */ ivas_create_masa_out_meta( hDirAC->hMasaOut, hDirAC->sph_grid16, nchan_transport, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); Loading
lib_rend/ivas_masa_merge.c +23 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,9 @@ #include "ivas_prot.h" #include "ivas_cnst.h" #include "prot.h" #ifdef NONBE_1344_REND_MASA_LOW_FS #include "ivas_rom_com.h" #endif #include "wmc_auto.h" Loading Loading @@ -326,6 +329,9 @@ ivas_error masaPrerendOpen( { MASA_PREREND_HANDLE hMasaPrerend; int16_t i; #ifdef NONBE_1344_REND_MASA_LOW_FS int16_t maxBin; #endif ivas_error error; error = IVAS_ERR_OK; Loading @@ -336,6 +342,23 @@ ivas_error masaPrerendOpen( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA prerenderer\n" ) ); } #ifdef NONBE_1344_REND_MASA_LOW_FS /* Determine the number of bands and band grouping */ hMasaPrerend->nbands = MASA_FREQUENCY_BANDS; mvs2s( MASA_band_grouping_24, hMasaPrerend->band_grouping, MASA_FREQUENCY_BANDS + 1 ); maxBin = (int16_t) ( input_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); for ( i = 1; i < hMasaPrerend->nbands + 1; i++ ) { if ( hMasaPrerend->band_grouping[i] >= maxBin ) { hMasaPrerend->band_grouping[i] = maxBin; hMasaPrerend->nbands = i; break; } } #endif hMasaPrerend->num_Cldfb_instances = numTransports; for ( i = 0; i < hMasaPrerend->num_Cldfb_instances; i++ ) { Loading
lib_rend/ivas_mcmasa_ana.c +43 −0 Original line number Diff line number Diff line Loading @@ -393,6 +393,14 @@ void ivas_mcmasa_ana( /* Analysis */ ivas_mcmasa_param_est_ana( hMcMasa, data_f, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, input_frame, nchan_inp ); #ifdef NONBE_1344_REND_MASA_LOW_FS /* Add zeros to higher bands in case of lower sampling rates */ if ( hMcMasa->nbands < MASA_FREQUENCY_BANDS ) { ivas_masa_zero_high_bands( hMcMasa->nbands, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); } #endif /* Create MASA metadata buffer from the estimated values */ ivas_create_masa_out_meta( hMcMasa->hMasaOut, hMcMasa->sph_grid16, nchan_transport, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); Loading Loading @@ -1131,3 +1139,38 @@ void ivas_create_masa_out_meta( return; } #ifdef NONBE_1344_REND_MASA_LOW_FS /*------------------------------------------------------------------------- * ivas_masa_zero_high_bands() * * *------------------------------------------------------------------------*/ void ivas_masa_zero_high_bands( const int16_t nbands, /* i : Number of frequency bands with estimated values */ float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated elevation */ float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated azimuth */ float energyRatio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated direct-to-total ratio */ float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated spread coherence */ float surroundingCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] /* i/o : Estimated surround coherence */ ) { int16_t sf, band; for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) { for ( band = nbands; band < MASA_FREQUENCY_BANDS; band++ ) { elevation_m_values[sf][band] = 0.0f; azimuth_m_values[sf][band] = 0.0f; energyRatio[sf][band] = 0.0f; spreadCoherence[sf][band] = 0.0f; surroundingCoherence[sf][band] = 0.0f; } } return; } #endif
lib_rend/ivas_omasa_ana.c +8 −0 Original line number Diff line number Diff line Loading @@ -261,6 +261,14 @@ void ivas_omasa_ana( /* Estimate MASA parameters from the objects */ ivas_omasa_param_est_ana( hOMasa, data_in_f, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, input_frame, nchan_ism ); #ifdef NONBE_1344_REND_MASA_LOW_FS /* Add zeros to higher bands in case of lower sampling rates */ if ( hOMasa->nbands < MASA_FREQUENCY_BANDS ) { ivas_masa_zero_high_bands( hOMasa->nbands, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); } #endif /* Create MASA metadata buffer from the estimated values */ ivas_create_masa_out_meta( hOMasa->hMasaOut, hOMasa->sph_grid16, nchan_transport, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); Loading