diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 67158d6e18f5017a60f9fb6d205d523da6e3334e..70ae03053914d1825c171bc05a84482283b8a329 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -299,6 +299,13 @@ ivas_error ivas_init_decoder_front( ivas_error ivas_init_decoder( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); +#ifdef IVAS_FLOAT_FIXED +ivas_error ivas_output_buff_dec_fx( + Word32 *p_output_f[], /* i/o: output audio buffers */ + const Word16 nchan_out_buff_old, /* i : previous frame number of output channels */ + const Word16 nchan_out_buff /* i : number of output channels */ +); +#endif // IVAS_FLOAT_FIXED ivas_error ivas_output_buff_dec( float *p_output_f[], /* i/o: output audio buffers */ diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 206d43755b3acd82cd973abf70c4663ee87bec48..c60b3e63dca52e3b713f43aeb9db7948d57d89c7 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -349,12 +349,32 @@ static ivas_error ivas_ism_bitrate_switching_dec( if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { +#ifdef IVAS_FLOAT_FIXED /* open the parametric binaural renderer */ + if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs_fx( &st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) + { + return error; + } +#if 1/*Cleanup Changes for ivas_dirac_dec_binaural_copy_hrtfs_fx*/ + FOR(Word16 i = 0; i < BINAURAL_CHANNELS; i++ ) + { + FOR(Word16 j = 0; j < HRTF_SH_CHANNELS; j++ ) + { + fixedToFloat_arr(st_ivas->hHrtfParambin->hrtfShCoeffsRe_fx[i][j], st_ivas->hHrtfParambin->hrtfShCoeffsRe[i][j], 15, HRTF_NUM_BINS ); + fixedToFloat_arr(st_ivas->hHrtfParambin->hrtfShCoeffsIm_fx[i][j], st_ivas->hHrtfParambin->hrtfShCoeffsIm[i][j], 14, HRTF_NUM_BINS ); + } + } + fixedToFloat_arrL(st_ivas->hHrtfParambin->parametricReverberationTimes_fx, st_ivas->hHrtfParambin->parametricReverberationTimes, 31, CLDFB_NO_CHANNELS_MAX ); + fixedToFloat_arrL(st_ivas->hHrtfParambin->parametricReverberationEneCorrections_fx, st_ivas->hHrtfParambin->parametricReverberationEneCorrections, 31, CLDFB_NO_CHANNELS_MAX ); + fixedToFloat_arrL(st_ivas->hHrtfParambin->parametricEarlyPartEneCorrection_fx, st_ivas->hHrtfParambin->parametricEarlyPartEneCorrection, 31, CLDFB_NO_CHANNELS_MAX ); +#endif +#else if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) { return error; } +#endif // IVAS_FLOAT_FIXED if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) { return error; @@ -363,7 +383,11 @@ static ivas_error ivas_ism_bitrate_switching_dec( /* Close the TD Binaural renderer */ if ( st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == TRUE ) { +#ifdef IVAS_FLOAT_FIXED + ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd ); +#else ivas_td_binaural_close( &st_ivas->hBinRendererTd ); +#endif // IVAS_FLOAT_FIXED st_ivas->hHrtfTD = NULL; if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) @@ -412,6 +436,12 @@ static ivas_error ivas_ism_bitrate_switching_dec( { nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); +#ifdef IVAS_FLOAT_FIXED + IF( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif // IVAS_FLOAT_FIXED if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 3097ce03aedbdbcadd6e799c40a4edd60c2be19f..da9d95c8032dd29c30f1585855c91c48e87f494c 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -353,6 +353,42 @@ void ivas_dirac_dec_close_binaural_data( * Temporary function for copying HRTF data from rom tables if no binary * file was given. *------------------------------------------------------------------------*/ +#ifdef IVAS_FLOAT_FIXED +ivas_error ivas_dirac_dec_binaural_copy_hrtfs_fx( + HRTFS_PARAMBIN_HANDLE *hHrtfParambin /* i/o: HRTF structure for rendering */ +) +{ + Word16 i, j; + IF ( hHrtfParambin != NULL && *hHrtfParambin != NULL ) + { + /* Tables already loaded from file */ + return IVAS_ERR_OK; + } + ELSE + { + /* Initialise tables from ROM */ + HRTFS_PARAMBIN *hrtfParambin; + IF ( ( hrtfParambin = (HRTFS_PARAMBIN *) malloc( sizeof( HRTFS_PARAMBIN ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for parametric binauralizer HRTF tables" ); + } + FOR ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + FOR ( j = 0; j < HRTF_SH_CHANNELS; j++ ) + { + Copy( hrtfShCoeffsRe_fx[i][j], hrtfParambin->hrtfShCoeffsRe_fx[i][j], HRTF_NUM_BINS ); + Copy( hrtfShCoeffsIm_fx[i][j], hrtfParambin->hrtfShCoeffsIm_fx[i][j], HRTF_NUM_BINS ); + } + } + Copy32( parametricReverberationTimes_fx, hrtfParambin->parametricReverberationTimes_fx, CLDFB_NO_CHANNELS_MAX ); + Copy32( parametricReverberationEneCorrections_fx, hrtfParambin->parametricReverberationEneCorrections_fx, CLDFB_NO_CHANNELS_MAX ); + Copy32( parametricEarlyPartEneCorrection_fx, hrtfParambin->parametricEarlyPartEneCorrection_fx, CLDFB_NO_CHANNELS_MAX ); + *hHrtfParambin = hrtfParambin; + } + + return IVAS_ERR_OK; +} +#endif // IVAS_FLOAT_FIXED ivas_error ivas_dirac_dec_binaural_copy_hrtfs( HRTFS_PARAMBIN_HANDLE *hHrtfParambin /* i/o: HRTF structure for rendering */ diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 07ee948293ae0346c7183a4de943f9f012fd098d..e9cf45bd1375e16ba98d48ac2312f622b3a91cc6 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -205,7 +205,6 @@ ivas_error ivas_td_binaural_open_unwrap_fx( move16(); TDREND_SRC_SPATIAL_t *SrcSpatial_p = pBinRendTd->Sources[nS]->SrcSpatial_p; - // floatToFixed_arr( SrcSpatial_p->Pos_p, SrcSpatial_p->Pos_p_fx, 15, 3 ); IF( ( error = TDREND_MIX_SRC_SetPos_fx( pBinRendTd, nS, Pos_fx ) ) != IVAS_ERR_OK ) { return error; @@ -455,6 +454,23 @@ ivas_error ivas_td_binaural_open_unwrap( * * Close TD Object binaural renderer *---------------------------------------------------------------------*/ +#ifdef IVAS_FLOAT_FIXED +void ivas_td_binaural_close_fx( + BINAURAL_TD_OBJECT_RENDERER_HANDLE *hBinRendererTd /* i/o: TD binaural object renderer handle */ +) +{ + IF ( hBinRendererTd == NULL || *hBinRendererTd == NULL ) + { + return; + } + free( ( *hBinRendererTd )->TdRend_MixSpatSpec_p ); + free( ( *hBinRendererTd )->DirAtten_p ); + TDREND_MIX_Dealloc_fx( *hBinRendererTd ); + free( *hBinRendererTd ); + *hBinRendererTd = NULL; + return; +} +#endif // IVAS_FLOAT_FIXED void ivas_td_binaural_close( BINAURAL_TD_OBJECT_RENDERER_HANDLE *hBinRendererTd /* i/o: TD binaural object renderer handle */ @@ -1030,11 +1046,11 @@ static void angles_to_vec_fx( ) { Word16 elevation_fx, azimuth_fx; - elevation_fx =(Word16)L_shr( Mult_32_16( elevation, 91 ), 22 ); - azimuth_fx = (Word16)L_shr( Mult_32_16( azimuth, 91 ), 22 ); - vec[0] = mult( radius, mult( getCosWord16R2( imult1616( elevation_fx, 91 ) ), getCosWord16R2( imult1616( azimuth_fx, 91 ) ) ) ); - vec[1] = mult( radius, mult( getCosWord16R2( imult1616( elevation_fx, 91 ) ), getSineWord16R2( imult1616( azimuth_fx, 91 ) ) ) ); - vec[2] = mult( radius, getSineWord16R2( imult1616( elevation_fx, 91 ) ) ); + elevation_fx =(Word16)L_shr( Mult_32_16( elevation, 91 ), 7 ); + azimuth_fx = (Word16)L_shr( Mult_32_16( azimuth, 91 ), 7 ); + vec[0] = mult( radius, mult( getCosWord16R2( elevation_fx ), getCosWord16R2( azimuth_fx ) ) ); + vec[1] = mult( radius, mult( getCosWord16R2( elevation_fx ), getSineWord16R2( azimuth_fx ) ) ); + vec[2] = mult( radius, getSineWord16R2( elevation_fx ) ); return; } #endif // IVAS_FLOAT_FIXED diff --git a/lib_rend/ivas_objectRenderer_hrFilt.c b/lib_rend/ivas_objectRenderer_hrFilt.c index fbb2ad2539cd316ae3a57d905ab78fa02d522ed5..3a40e870029650a9c2e49d4d2f6dc89f0eb1826d 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt.c +++ b/lib_rend/ivas_objectRenderer_hrFilt.c @@ -528,6 +528,45 @@ void HRTF_model_precalc( * * Deallocate BSpline HR Filter model --------------------------------------------------------------------*/ +#ifdef IVAS_FLOAT_FIXED +void BSplineModelEvalDealloc_fx( + ModelParams_t *model, /* i : Model parameters */ + ModelEval_t *modelEval /* i : Model evaluation structure */ +) +{ + /* Allocated in LoadBSplineBinary() */ + Word16 i; + + IF ( model->modelROM ) + { +#if 1 //To be removed later :Floating point memory release + free( (void *) model->azimBsShape ); /* void* cast needed to please both gcc and Visual studio compilers. Deallocating const float** should be fine and gcc agrees, but Visual studio complains. */ + FOR ( i = 0; i < model->elevDim3; i++ ) + { + free( model->azimKSeq[i] ); + } + free( model->azimKSeq ); + IF ( modelEval != NULL ) + { + free( modelEval->hrfModL ); + free( modelEval->hrfModR ); + } +#endif + free( (void *) model->azimBsShape_fx ); /* void* cast needed to please both gcc and Visual studio compilers. Deallocating const float** should be fine and gcc agrees, but Visual studio complains. */ + FOR ( i = 0; i < model->elevDim3; i++ ) + { + free( model->azimKSeq_fx[i] ); + } + free( model->azimKSeq_fx); + IF ( modelEval != NULL ) + { + free( modelEval->hrfModL_fx); + free( modelEval->hrfModR_fx); + } + } + return; +} +#endif // IVAS_FLOAT_FIXED void BSplineModelEvalDealloc( ModelParams_t *model, /* i : Model parameters */ diff --git a/lib_rend/ivas_objectRenderer_mix.c b/lib_rend/ivas_objectRenderer_mix.c index 5fc52e8177e7201452e33e2aa3ce6c8eb7c6cf52..aad557cd1e28d5a42fe3f74eac76f3dc0e37ce95 100644 --- a/lib_rend/ivas_objectRenderer_mix.c +++ b/lib_rend/ivas_objectRenderer_mix.c @@ -129,6 +129,81 @@ ivas_error TDREND_MIX_LIST_SetOrient( * Deallocates the TDREND_MIX_t variable --------------------------------------------------------------------*/ +#ifdef IVAS_FLOAT_FIXED +void TDREND_MIX_Dealloc_fx( + BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd /* i/o: TD renderer handle */ +) +{ + Word16 i; + /* Deallocate source list */ + FOR ( i = 0; i < hBinRendererTd->NumOfSrcs; i++ ) + { + TDREND_SRC_Dealloc( hBinRendererTd->Sources[i] ); + } + /* Deallocate Listener and RendListener */ + IF ( hBinRendererTd->Listener_p != NULL ) + { + free( hBinRendererTd->Listener_p ); + hBinRendererTd->Listener_p = NULL; + } + /* Dealloc HR filter set */ + IF ( hBinRendererTd->HrFiltSet_p != NULL ) + { + IF ( EQ_16(hBinRendererTd->HrFiltSet_p->FilterMethod , TDREND_HRFILT_Method_BSplineModel) ) + { + BSplineModelEvalDealloc_fx( &hBinRendererTd->HrFiltSet_p->ModelParams, &hBinRendererTd->HrFiltSet_p->ModelEval ); + } + ELSE + { +#if 1 + IF( hBinRendererTd->HrFiltSet_p->Elev_p != NULL ) + { + free( hBinRendererTd->HrFiltSet_p->Elev_p ); + hBinRendererTd->HrFiltSet_p->Elev_p = NULL; + } + IF( hBinRendererTd->HrFiltSet_p->Azim_p != NULL ) + { + free( hBinRendererTd->HrFiltSet_p->Azim_p ); + hBinRendererTd->HrFiltSet_p->Azim_p = NULL; + } + IF( hBinRendererTd->HrFiltSet_p->LeftFiltSet_p != NULL ) + { + free( hBinRendererTd->HrFiltSet_p->LeftFiltSet_p ); + hBinRendererTd->HrFiltSet_p->LeftFiltSet_p = NULL; + } + IF( hBinRendererTd->HrFiltSet_p->RightFiltSet_p != NULL ) + { + free( hBinRendererTd->HrFiltSet_p->RightFiltSet_p ); + hBinRendererTd->HrFiltSet_p->RightFiltSet_p = NULL; + } +#endif // 1 + IF ( hBinRendererTd->HrFiltSet_p->Elev_p_fx != NULL ) + { + free( hBinRendererTd->HrFiltSet_p->Elev_p_fx); + hBinRendererTd->HrFiltSet_p->Elev_p_fx = NULL; + } + IF ( hBinRendererTd->HrFiltSet_p->Azim_p_fx != NULL ) + { + free( hBinRendererTd->HrFiltSet_p->Azim_p_fx); + hBinRendererTd->HrFiltSet_p->Azim_p_fx = NULL; + } + IF( hBinRendererTd->HrFiltSet_p->LeftFiltSet_p_fx != NULL ) + { + free( hBinRendererTd->HrFiltSet_p->LeftFiltSet_p_fx); + hBinRendererTd->HrFiltSet_p->LeftFiltSet_p_fx = NULL; + } + IF( hBinRendererTd->HrFiltSet_p->RightFiltSet_p_fx != NULL ) + { + free( hBinRendererTd->HrFiltSet_p->RightFiltSet_p_fx ); + hBinRendererTd->HrFiltSet_p->RightFiltSet_p_fx = NULL; + } + } + free( hBinRendererTd->HrFiltSet_p ); + hBinRendererTd->HrFiltSet_p = NULL; + } + return; +} +#endif // IVAS_FLOAT_FIXED void TDREND_MIX_Dealloc( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd /* i/o: TD renderer handle */ ) @@ -525,6 +600,16 @@ static ivas_error BSplineModelEvalAlloc( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) ); } +#ifdef IVAS_FLOAT_FIXED + IF ( ( modelEval->hrfModL_fx = (Word16 *) malloc( model->K * sizeof(Word16) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) ); + } + IF ( ( modelEval->hrfModR_fx = (Word16 *) malloc( model->K * sizeof(Word16) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) ); + } +#endif // DEBUG return IVAS_ERR_OK; } @@ -929,6 +1014,12 @@ static ivas_error DefaultBSplineModel( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) ); } +#ifdef IVAS_FLOAT_FIXED + IF ( ( model->azimBsShape_fx = (const UWord32 **) malloc( model->num_unique_azim_splines * sizeof(UWord32 * ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) ); + } +#endif // IVAS_FLOAT_FIXED model->azimBsShape[0] = (const float *) defaultHRIR_rom_azimBsShape; if ( ( model->azimKSeq = (float **) malloc( 18 * sizeof( float * ) ) ) == NULL ) @@ -943,6 +1034,20 @@ static ivas_error DefaultBSplineModel( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) ); } +#ifdef IVAS_FLOAT_FIXED + IF ( ( model->azimKSeq_fx = (Word32 **) malloc( 18 * sizeof(Word32 * ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) ); + } + IF ( ( model->azimKSeq_fx[0] = (Word32 *) malloc( 2 * sizeof(Word32 * ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) ); + } + IF ( ( model->azimKSeq_fx[model->elevDim3 - 1] = (Word32 *) malloc( 2 * sizeof(Word32 * ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) ); + } +#endif // IVAS_FLOAT_FIXED model->azimKSeq[0][0] = 0.0f; model->azimKSeq[model->elevDim3 - 1][0] = 0.0f; model->azimKSeq[0][1] = 360.0f; @@ -954,6 +1059,12 @@ static ivas_error DefaultBSplineModel( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) ); } +#ifdef IVAS_FLOAT_FIXED + IF ( ( model->azimKSeq_fx[i] = (Word32 *) malloc( model->azimDim2[i] * sizeof(Word32 * ) ) ) == NULL ) /* azimDim2[i] = 91, i=2..15 */ + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) ); + } +#endif for ( j = 0; j < model->azimDim2[i]; j++ ) { model->azimKSeq[i][j] = (float) defaultHRIR_rom_azimSegSamples[0] * j; diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 997a5f8227cb30bcb76cbbe540ab65c1bf77f28a..0b1d1fd13ee9de33a0d5b19f9076796d8bb81357 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -534,6 +534,21 @@ static ivas_error TDREND_SRC_SPATIAL_Alloc( * Deallocate spatial properties of a source. --------------------------------------------------------------------*/ +#ifdef IVAS_FLOAT_FIXED +static void TDREND_SRC_SPATIAL_Dealloc( + TDREND_SRC_SPATIAL_t *SrcSpatial_p /* i/o: Source spatial parameters */ +) +{ + IF( SrcSpatial_p == NULL ) + { + return; + } + /* Free the SrcSpatial_p variable */ + free( SrcSpatial_p ); + SrcSpatial_p = NULL; + return; +} +#else static void TDREND_SRC_SPATIAL_Dealloc( TDREND_SRC_SPATIAL_t *SrcSpatial_p /* i/o: Source spatial parameters */ ) @@ -549,6 +564,7 @@ static void TDREND_SRC_SPATIAL_Dealloc( return; } +#endif // IVAS_FLOAT_FIXED /*-------------------------------------------------------------------* * TDREND_SRC_SPATIAL_Init() @@ -572,10 +588,10 @@ static void TDREND_SRC_SPATIAL_Init_fx( FOR( nC = 0; nC < SPAT_BIN_MAX_INPUT_CHANNELS; nC++ ) { /* Source position */ - TDREND_SPATIAL_VecInit_fx( SrcSpatial_p->Pos_p_fx + nC * 3, 0, 0, 0 );/*Q15*/ + TDREND_SPATIAL_VecInit_fx( SrcSpatial_p->Pos_p_fx + nC * 3, 0, 0, 0 );/*Assuming Q15*/ /* Source direction */ - TDREND_SPATIAL_VecInit_fx( SrcSpatial_p->Front_p_fx + nC * 3, 0, 0, 32767);/*Q15*/ + TDREND_SPATIAL_VecInit_fx( SrcSpatial_p->Front_p_fx + nC * 3, 0, 0, 32767);/*Assuming Q15*/ } @@ -823,6 +839,25 @@ ivas_error TDREND_SRC_Alloc( * Deallocate a source. --------------------------------------------------------------------*/ +#ifdef IVAS_FLOAT_FIXED +void TDREND_SRC_Dealloc( + TDREND_SRC_t *Src_p ) +{ + IF ( Src_p == NULL ) + { + return; + } + /* Delloc the TDREND_SRC_Spatial_t variable */ + TDREND_SRC_SPATIAL_Dealloc( Src_p->SrcSpatial_p ); + /* Delloc the TDREND_SRC_REND__t variable */ + free( Src_p->SrcRend_p ); + Src_p->SrcRend_p = NULL; + /* Free the Src_p variable */ + free( Src_p ); + Src_p = NULL; + return; +} +#else // IVAS_FLOAT_FIXED void TDREND_SRC_Dealloc( TDREND_SRC_t *Src_p ) { @@ -846,6 +881,7 @@ void TDREND_SRC_Dealloc( } +#endif /*-------------------------------------------------------------------* * TDREND_SRC_Init() * diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 370409e5a6558e49ed89e21f51da5bc3845e5828..c92778f807736f4f212d9b05cbe6fb1c7afefffb 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -674,6 +674,36 @@ Word16 ivas_get_nchan_buffers_dec( * * Allocate/reallocate output audio buffers *-------------------------------------------------------------------*/ +#ifdef IVAS_FLOAT_FIXED +ivas_error ivas_output_buff_dec_fx( + Word32 *p_output_f[], /* i/o: output audio buffers */ + const Word16 nchan_out_buff_old, /* i : previous frame number of output channels */ + const Word16 nchan_out_buff /* i : number of output channels */ +) +{ + Word16 ch; + IF ( GT_16(nchan_out_buff , nchan_out_buff_old) ) + { + FOR ( ch = nchan_out_buff_old; ch < nchan_out_buff; ch++ ) + { + /* note: these are intra-frame heap memories */ + IF ( ( p_output_f[ch] = (Word32 *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof(Word32) ) ) == NULL ) /* note: 32000 == max internal sampling rate */ + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point output audio buffer!\n" ) ); + } + } + } + ELSE + { + FOR ( ch = nchan_out_buff; ch < nchan_out_buff_old; ch++ ) + { + free( p_output_f[ch] ); + p_output_f[ch] = NULL; + } + } + return IVAS_ERR_OK; +} +#endif // IVAS_FLOAT_FIXED ivas_error ivas_output_buff_dec( float *p_output_f[], /* i/o: output audio buffers */ diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 6d19d88a3d470e622c42762142948833508d7eb6..70020c15222984f7e1b8ca11566159fe7323fc67 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -336,6 +336,11 @@ ivas_error ivas_dirac_dec_init_binaural_data( void ivas_dirac_dec_close_binaural_data( DIRAC_DEC_BIN_HANDLE *hBinaural /* i/o: decoder DirAC binaural data handle */ ); +#ifdef IVAS_FLOAT_FIXED +ivas_error ivas_dirac_dec_binaural_copy_hrtfs_fx( + HRTFS_PARAMBIN_HANDLE *hHrtfParambin /* i/o: HRTF structure for rendering */ +); +#endif // IVAS_FLOAT_FIXED ivas_error ivas_dirac_dec_binaural_copy_hrtfs( HRTFS_PARAMBIN_HANDLE *hHrtfParambin /* i/o: HRTF structure for rendering */ @@ -781,6 +786,11 @@ ivas_error ivas_td_binaural_open_ext( LSSETUP_CUSTOM_STRUCT *customLsInput, const int32_t output_Fs ); +#ifdef IVAS_FLOAT_FIXED +void ivas_td_binaural_close_fx( + BINAURAL_TD_OBJECT_RENDERER_HANDLE *hBinRendererTd /* i/o: TD binaural object renderer handle */ +); +#endif // IVAS_FLOAT_FIXED void ivas_td_binaural_close( BINAURAL_TD_OBJECT_RENDERER_HANDLE *hBinRendererTd /* i/o: TD binaural object renderer handle */ @@ -807,6 +817,12 @@ ivas_error TDREND_Update_object_positions( const IVAS_FORMAT in_format, /* i : Format of input sources */ const ISM_METADATA_HANDLE *hIsmMetaData /* i : Input metadata for ISM objects */ ); +#ifdef IVAS_FLOAT_FIXED +void BSplineModelEvalDealloc_fx( + ModelParams_t *model, /* i : Model parameters */ + ModelEval_t *modelEval /* i : Model evaluation structure */ +); +#endif // IVAS_FLOAT_FIXED void BSplineModelEvalDealloc( ModelParams_t *model, /* i : Model parameters */ @@ -1015,6 +1031,11 @@ ivas_error TDREND_MIX_LIST_SetOrient( const float *FrontVec_p, /* i : Listener's orientation front vector */ const float *UpVec_p /* i : Listener's orientation up vector */ ); +#ifdef IVAS_FLOAT_FIXED +void TDREND_MIX_Dealloc_fx( + BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd /* i/o: TD renderer handle */ +); +#endif // IVAS_FLOAT_FIXED void TDREND_MIX_Dealloc( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd /* i/o: TD renderer handle */ diff --git a/lib_rend/ivas_rom_binauralRenderer.c b/lib_rend/ivas_rom_binauralRenderer.c index cc77cc46c4c8199883d3284272a8c698c2011c4d..a04d4316acb66d9c20cef0188e560c112cc0c445 100644 --- a/lib_rend/ivas_rom_binauralRenderer.c +++ b/lib_rend/ivas_rom_binauralRenderer.c @@ -10525,6 +10525,111 @@ const float rightHRIRImag[BINAURAL_CONVBANDS][HRTF_LS_CHANNELS][BINAURAL_NTAPS]= {-0.195200f, +0.041315f, -0.080091f} } }; +#ifdef IVAS_FLOAT_FIXED +const Word16 hrtfShCoeffsRe_fx[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS] /*Q-15*/= +{ +{ +{ +30525, 19316, 7802, -2837, -12416, 30083, 29763, 29321, 28409, 27406, 26838, 26491, 26190, 25722, 25023, 24866, 25465, 26164, 26457, 26206, 25714, 25348, 25071, 24773, 24489, 24309, 24446, 24860, 25155, 25139, 24881, 24470, 23998, 23549, 23170, 22859, 22652, 22619, 22731, 22849, 22875, 22843, 22877, 23069, 23406, 23823, 24256, 24614, 24856, 25014, 25121, 15606, 706, 466, 371, 318, 282, 258, 240, 228, +}, +{ +5025,14146,7327,-9865,-23665,18251,18517,18003,19099,21384,23781,25198,25788,26065,26211,26288,26561,26861,26860,26589,26549,26990,27781,28932,30026,30247,29397,27932,26462,25512,25060,24715,24319,23987,23748,23548,23517,23876,24644,25554,26302,26765,27026,27227,27405,27524,27605,27673,27722,27736,27709,17018,448,138,20,-57,-114,-156,-187,-207, +}, +{ +3819,982,-2980,-3625,-3879,5391,5144,4626,4236,3669,4844,6687,9405,13117,16329,17051,14808,10480,5373,1060,-1394,-1970,-1335,-452,4,-176,-918,-1855,-2495,-2351,-1184,728,2618,3841,4356,4501,4484,4308,4002,3696,3501,3341,2977,2264,1235,-51,-1514,-2920,-4088,-5011,-5666,-3822,-134,-52,-17,2,16,25,32,37, +}, +{ +2705,1499,-3290,-5394,-7278,7044,9475,12017,15303,17573,17685,17065,15861,13994,12999,12353,11073,9346,7116,4325,1518,-730,-2299,-3023,-2536,-584,2696,6573,10026,12584,14324,15637,16892,18107,18902,18877,18112,17082,16223,15741,15605,15670,15783,15803,15601,15067,14195,13184,12241,11452,10878,6442,289,200,164,143,129,120,113,108, +}, +{ +115,-1514,-5543,-8070,-8474,4049,6348,9097,11747,13532,12304,10981,10277,9576,9491,9813,9974,9410,7736,4719,1075,-2305,-4899,-6142,-5899,-4727,-3349,-2044,-779,490,1694,2945,4492,6087,6891,6434,5242,4327,4324,5203,6509,7777,8753,9457,10029,10516,10822,10892,10773,10512,10186,6140,179,62,14,-16,-38,-53,-65,-72, +}, +{ +-455,671,-5804,-5041,-4039,1187,398,-1949,-3889,-4338,-2744,-944,342,2413,4951,5873,4003,-177,-5616,-10482,-13314,-14112,-13500,-11650,-8244,-3747,231,2459,2971,2660,2440,2653,2963,2766,1969,998,198,-363,-674,-627,-122,675,1362,1607,1322,542,-584,-1762,-2777,-3601,-4203,-2874,-176,-120,-97,-83,-73,-66,-60,-56, +}, +{ +-362,2237,5637,7369,6683,-4641,-5829,-5683,-5078,-5818,-6328,-6575,-6756,-7039,-6194,-3118,1346,5276,7328,7128,4730,647,-4206,-8656,-11224,-11214,-9658,-8205,-8020,-9318,-11368,-13293,-14805,-16120,-17196,-17685,-17418,-16616,-15656,-14795,-14091,-13434,-12636,-11580,-10286,-8860,-7493,-6399,-5644,-5149,-4837,-2904,-88,-24,-3,10,20,27,33,36, +}, +{ +417,-4011,-5314,-1604,-389,-205,-1937,-2467,-1292,-446,1489,2625,3389,4141,4708,4739,4956,6091,7811,9622,10657,10172,8136,4122,-2149,-9158,-14600,-17331,-17463,-15757,-13181,-10425,-7650,-4789,-2061,113,1547,2473,3266,4073,4787,5268,5494,5589,5744,6088,6575,7047,7412,7651,7745,4800,210,116,76,51,34,21,12,6, +}, +{ +964,8360,12714,10633,5887,5580,6523,8098,7052,3518,273,-1492,-2405,-3340,-4779,-6166,-7161,-7533,-7442,-7009,-6487,-6133,-5837,-6005,-7006,-7964,-7246,-4447,-732,2510,4974,7015,8827,10314,11279,11634,11354,10531,9373,8115,6967,6067,5462,5100,4881,4698,4450,4115,3753,3422,3201,1768,143,163,167,172,176,180,183,185, +}, +{ +-1347,-8079,-14864,-18954,-15938,2788,2547,3444,3178,1486,682,532,1079,1396,1106,537,-249,-981,-1624,-2359,-3011,-3030,-2244,-1545,-1928,-3225,-4324,-4302,-3167,-1482,528,2910,5543,7946,9433,9752,9330,8906,8993,9578,10329,10944,11332,11622,11957,12354,12659,12731,12591,12271,11816,7084,122,-47,-114,-158,-191,-215,-234,-246, +}, +{ +-51,1127,-3246,-1874,195,286,93,-777,76,1543,2337,2032,1851,2488,3140,3661,4266,5199,6305,7494,8610,9341,9034,6701,2476,-2023,-5452,-7588,-8656,-8991,-8945,-8758,-8352,-7612,-6725,-6056,-5820,-5797,-5488,-4562,-3035,-1209,524,1874,2788,3455,4137,4914,5702,6449,7076,4714,213,120,81,58,42,30,21,15, +}, +{ +-929,-5189,-12693,-6859,-4537,817,2492,2253,2847,741,-1537,-3233,-5172,-7101,-7552,-5830,-1859,3257,7538,9603,9000,6188,1776,-3937,-9662,-12915,-12389,-9197,-5601,-3037,-1631,-1194,-1720,-3078,-4672,-5756,-6045,-5821,-5590,-5689,-6115,-6562,-6649,-6177,-5212,-3960,-2682,-1649,-948,-525,-349,-153,-49,-81,-95,-105,-114,-121,-127,-130, +}, +{ +-410,-803,875,3285,988,-623,-64,1750,2055,1402,1230,1408,1069,-208,-2292,-4280,-4743,-3141,641,5426,9429,11770,12135,10255,6792,3387,1122,86,20,564,1451,2295,2518,1647,-473,-3383,-6227,-8382,-9745,-10550,-11062,-11400,-11545,-11445,-11104,-10550,-9734,-8723,-7698,-6742,-5941,-3273,-144,-100,-78,-64,-55,-49,-45,-42, +}, +{ +-1171,-927,1849,4728,2888,-1743,-2912,-2581,-2745,-2322,-1444,-2112,-2752,-2284,-2161,-2153,-939,1348,3314,4898,5840,6205,6894,8484,10745,12128,10932,7228,2475,-2159,-6157,-9328,-11461,-12361,-11947,-10471,-8586,-6929,-5789,-5094,-4531,-3758,-2631,-1334,-243,365,485,350,169,55,46,33,-28,-14,-7,-2,1,4,7,8, +}, +{ +217,-943,-3629,1776,1627,-2683,-1036,88,2582,3327,2462,1489,1797,2350,2265,1984,2306,3567,5646,7830,9315,10067,10491,10105,7511,2265,-4065,-9415,-12757,-14021,-13668,-12245,-9921,-6437,-2006,2402,5870,8151,9499,10143,10078,9305,7982,6383,4839,3630,2831,2373,2140,2027,1955,1125,59,42,36,31,27,23,21,18, +}, +{ +2,465,-1031,-409,551,-748,-2652,-4332,-4323,-4502,-3094,-1393,-1079,-1513,-1590,-1958,-2778,-2909,-2000,-463,1323,3262,5119,6331,6329,5423,4850,5384,6509,7532,8340,9012,9404,9620,10246,11546,12992,13693,13157,11582,9559,7654,6203,5166,4193,2987,1542,119,-1057,-1925,-2451,-1745,-73,-25,0,15,25,33,39,42, +}, +}, +{ +{ +30525,19316,7802,-2837,-12416,30083,29763,29321,28409,27406,26838,26491,26190,25722,25023,24866,25465,26164,26457,26206,25714,25348,25071,24773,24489,24309,24446,24860,25155,25139,24881,24470,23998,23549,23170,22859,22652,22619,22731,22849,22875,22843,22877,23069,23406,23823,24256,24614,24856,25014,25121,15606,706,466,371,318,282,258,240,228, +}, +{ +-5025,-14146,-7327,9865,23665,-18251,-18517,-18003,-19099,-21384,-23781,-25198,-25788,-26065,-26211,-26288,-26561,-26861,-26860,-26589,-26549,-26990,-27781,-28932,-30026,-30247,-29397,-27932,-26462,-25512,-25060,-24715,-24319,-23987,-23748,-23548,-23517,-23876,-24644,-25554,-26302,-26765,-27026,-27227,-27405,-27524,-27605,-27673,-27722,-27736,-27709,-17018,-448,-138,-20,57,114,156,187,207, +}, +{ +3819,982,-2980,-3625,-3879,5391,5144,4626,4236,3669,4844,6687,9405,13117,16329,17051,14808,10480,5373,1060,-1394,-1970,-1335,-452,4,-176,-918,-1855,-2495,-2351,-1184,728,2618,3841,4356,4501,4484,4308,4002,3696,3501,3341,2977,2264,1235,-51,-1514,-2920,-4088,-5011,-5666,-3822,-134,-52,-17,2,16,25,32,37, +}, +{ +2705,1499,-3290,-5394,-7278,7044,9475,12017,15303,17573,17685,17065,15861,13994,12999,12353,11073,9346,7116,4325,1518,-730,-2299,-3023,-2536,-584,2696,6573,10026,12584,14324,15637,16892,18107,18902,18877,18112,17082,16223,15741,15605,15670,15783,15803,15601,15067,14195,13184,12241,11452,10878,6442,289,200,164,143,129,120,113,108, +}, +{ +-115,1514,5543,8070,8474,-4049,-6348,-9097,-11747,-13532,-12304,-10981,-10277,-9576,-9491,-9813,-9974,-9410,-7736,-4719,-1075,2305,4899,6142,5899,4727,3349,2044,779,-490,-1694,-2945,-4492,-6087,-6891,-6434,-5242,-4327,-4324,-5203,-6509,-7777,-8753,-9457,-10029,-10516,-10822,-10892,-10773,-10512,-10186,-6140,-179,-62,-14,16,38,53,65,72, +}, +{ +455,-671,5804,5041,4039,-1187,-398,1949,3889,4338,2744,944,-342,-2413,-4951,-5873,-4003,177,5616,10482,13314,14112,13500,11650,8244,3747,-231,-2459,-2971,-2660,-2440,-2653,-2963,-2766,-1969,-998,-198,363,674,627,122,-675,-1362,-1607,-1322,-542,584,1762,2777,3601,4203,2874,176,120,97,83,73,66,60,56, +}, +{ +-362,2237,5637,7369,6683,-4641,-5829,-5683,-5078,-5818,-6328,-6575,-6756,-7039,-6194,-3118,1346,5276,7328,7128,4730,647,-4206,-8656,-11224,-11214,-9658,-8205,-8020,-9318,-11368,-13293,-14805,-16120,-17196,-17685,-17418,-16616,-15656,-14795,-14091,-13434,-12636,-11580,-10286,-8860,-7493,-6399,-5644,-5149,-4837,-2904,-88,-24,-3,10,20,27,33,36, +}, +{ +417,-4011,-5314,-1604,-389,-205,-1937,-2467,-1292,-446,1489,2625,3389,4141,4708,4739,4956,6091,7811,9622,10657,10172,8136,4122,-2149,-9158,-14600,-17331,-17463,-15757,-13181,-10425,-7650,-4789,-2061,113,1547,2473,3266,4073,4787,5268,5494,5589,5744,6088,6575,7047,7412,7651,7745,4800,210,116,76,51,34,21,12,6, +}, +{ +964,8360,12714,10633,5887,5580,6523,8098,7052,3518,273,-1492,-2405,-3340,-4779,-6166,-7161,-7533,-7442,-7009,-6487,-6133,-5837,-6005,-7006,-7964,-7246,-4447,-732,2510,4974,7015,8827,10314,11279,11634,11354,10531,9373,8115,6967,6067,5462,5100,4881,4698,4450,4115,3753,3422,3201,1768,143,163,167,172,176,180,183,185, +}, +{ +1347,8079,14864,18954,15938,-2788,-2547,-3444,-3178,-1486,-682,-532,-1079,-1396,-1106,-537,249,981,1624,2359,3011,3030,2244,1545,1928,3225,4324,4302,3167,1482,-528,-2910,-5543,-7946,-9433,-9752,-9330,-8906,-8993,-9578,-10329,-10944,-11332,-11622,-11957,-12354,-12659,-12731,-12591,-12271,-11816,-7084,-122,47,114,158,191,215,234,246, +}, +{ +51,-1127,3246,1874,-195,-286,-93,777,-76,-1543,-2337,-2032,-1851,-2488,-3140,-3661,-4266,-5199,-6305,-7494,-8610,-9341,-9034,-6701,-2476,2023,5452,7588,8656,8991,8945,8758,8352,7612,6725,6056,5820,5797,5488,4562,3035,1209,-524,-1874,-2788,-3455,-4137,-4914,-5702,-6449,-7076,-4714,-213,-120,-81,-58,-42,-30,-21,-15, +}, +{ +929,5189,12693,6859,4537,-817,-2492,-2253,-2847,-741,1537,3233,5172,7101,7552,5830,1859,-3257,-7538,-9603,-9000,-6188,-1776,3937,9662,12915,12389,9197,5601,3037,1631,1194,1720,3078,4672,5756,6045,5821,5590,5689,6115,6562,6649,6177,5212,3960,2682,1649,948,525,349,153,49,81,95,105,114,121,127,130, +}, +{ +-410,-803,875,3285,988,-623,-64,1750,2055,1402,1230,1408,1069,-208,-2292,-4280,-4743,-3141,641,5426,9429,11770,12135,10255,6792,3387,1122,86,20,564,1451,2295,2518,1647,-473,-3383,-6227,-8382,-9745,-10550,-11062,-11400,-11545,-11445,-11104,-10550,-9734,-8723,-7698,-6742,-5941,-3273,-144,-100,-78,-64,-55,-49,-45,-42, +}, +{ +-1171,-927,1849,4728,2888,-1743,-2912,-2581,-2745,-2322,-1444,-2112,-2752,-2284,-2161,-2153,-939,1348,3314,4898,5840,6205,6894,8484,10745,12128,10932,7228,2475,-2159,-6157,-9328,-11461,-12361,-11947,-10471,-8586,-6929,-5789,-5094,-4531,-3758,-2631,-1334,-243,365,485,350,169,55,46,33,-28,-14,-7,-2,1,4,7,8, +}, +{ +217,-943,-3629,1776,1627,-2683,-1036,88,2582,3327,2462,1489,1797,2350,2265,1984,2306,3567,5646,7830,9315,10067,10491,10105,7511,2265,-4065,-9415,-12757,-14021,-13668,-12245,-9921,-6437,-2006,2402,5870,8151,9499,10143,10078,9305,7982,6383,4839,3630,2831,2373,2140,2027,1955,1125,59,42,36,31,27,23,21,18, +}, +{ +2,465,-1031,-409,551,-748,-2652,-4332,-4323,-4502,-3094,-1393,-1079,-1513,-1590,-1958,-2778,-2909,-2000,-463,1323,3262,5119,6331,6329,5423,4850,5384,6509,7532,8340,9012,9404,9620,10246,11546,12992,13693,13157,11582,9559,7654,6203,5166,4193,2987,1542,119,-1057,-1925,-2451,-1745,-73,-25,0,15,25,33,39,42, +} +} +}; +#endif // IVAS_FLOAT_FIXED const float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]= { @@ -10789,6 +10894,111 @@ const float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]= } } }; +#ifdef IVAS_FLOAT_FIXED +const int hrtfShCoeffsIm_fx[2][16][60]/*Q-14*/ = +{ +{ +{ +973,5300,9536,10289,7948,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}, +{ +9151,18404,17553,15119,10744,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}, +{ +-81,957,1575,-249,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}, +{ +-172,152,-4254,-6571,-4169,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}, +{ +106,894,1364,326,-1185,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}, +{ +278,1694,2518,1214,519,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}, +{ +13,-146,1965,2096,179,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}, +{ +41,30,104,1304,1210,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}, +}, +}; +#endif // IVAS_FLOAT_FIXED const float hrtfShCoeffsIm[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]= { @@ -47485,6 +47695,17 @@ const float fastconvReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX] = 0.000584f, 0.000210f, 0.000233f, 0.000212f, 0.000257f, 0.001518f, 0.001154f, 0.001097f, 0.001265f, 0.001298f, 0.002320f, 0.002432f, 0.002686f, 0.002702f, 0.002632f, 0.002564f, 0.002732f, 0.002727f, 0.002609f, 0.002524f, 0.003417f, 0.001783f, 0.000987f, 0.000699f, 0.000606f, 0.000536f, 0.000511f, 0.000569f, 0.000600f, 0.000543f, 0.001257f, 0.001209f, 0.000957f, 0.000601f, 0.000274f, 0.000106f, 0.000072f, 0.000051f, 0.000040f, 0.000030f, 0.000024f, 0.000018f, 0.000014f, 0.000013f, 0.000012f, 0.000011f, 0.000009f, 0.000009f, 0.000008f, 0.000008f, 0.000007f, 0.000006f, 0.000005f, 0.000003f, 0.000002f, 0.000002f, 0.000001f, 0.000001f, 0.000000f, 0.000000f, }; +#ifdef IVAS_FLOAT_FIXED +const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX] /*Q-31*/= +{ +-741942720,-686022272,-715028288,-775076224,-803800960,-796237568,-770141312,-747545472,-736820992,-711570880, +-679682880,-654928832,-633196288,-617506752,-601123648,-580415424,-567025856,-550623424,-536654016,-519776928, +-504817568,-493163168,-480456512,-469858688,-456552864,-446008736,-433967776,-425403616,-416412096,-399234400, +-392295872,-390756128,-386091776,-384573504,-379121056,-370071552,-367440896,-360672032,-360721408,-363373568, +-359359904,-356323360,-351253152,-346943168,-340172160,-336405472,-333613728,-329810528,-325506976,-322043104, +-318265664,-314490400,-310715104,-306939840,-303164576,-299389280,-295611872,-291836576,-288061312,-284286048 +}; +#endif // IVAS_FLOAT_FIXED const float parametricReverberationTimes[CLDFB_NO_CHANNELS_MAX] = { @@ -47496,6 +47717,16 @@ const float parametricReverberationTimes[CLDFB_NO_CHANNELS_MAX] = 0.148204f, 0.146446f, 0.144688f, 0.142930f, 0.141172f, 0.139414f, 0.137655f, 0.135897f, 0.134139f, 0.132381f }; +#ifdef IVAS_FLOAT_FIXED +const Word32 parametricReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX] /*Q-31*/= +{ + -412276064,-308677152,-243799520,-201511280,-193589216,-171714944,-143009520,-156122064,-164263168,-176233248, + -183105200,-201571408,-218830736,-244229024,-252642864,-243726512,-270851360,-271235776,-266133360,-249251984, + -211587264,-110556752,-64317136,-54165980,-45404248,-41570988,-35878008,-34847216,-39548060,-39554500,-36715528, + -32682554,-30524332,-20815560,-8581345,-3463891,-2072321,-1380832,-1069446,-895500,-652835,-388694,-249108,-242665, + -219043,-167503,-137438,-128849,-135291,-133143,-130996,-111669,-85899,-64424,-30064,-15032,-6442,-2147,0,0, +}; +#endif // IVAS_FLOAT_FIXED const float parametricReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX] = { @@ -47507,6 +47738,18 @@ const float parametricReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX] = 0.000061f, 0.000052f, 0.000040f, 0.000030f, 0.000014f, 0.000007f, 0.000003f, 0.000001f, 0.000000f, 0.000000f }; +#ifdef IVAS_FLOAT_FIXED +const Word32 parametricEarlyPartEneCorrection_fx[CLDFB_NO_CHANNELS_MAX]/*Q-31*/ = +{ + -1278914560, -1469108608, -2147483648, -1890004608, -1560359424, -1136244352, -980880320, -822859904, -712393344, + -709882944, -937310016, -1272336768, -1647858688, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, + -2147483648, -2147483648, -2147483648, -2147483648, -808619904, -378908448, -321778944, -279832160, -294396384, + -628592064, -1246109568, -1574331008, -1577608064, -1642900096, -1631784832, -1183766016, -553299136, -195307200, + -112115824, -117877528, -108836616, -76572824, -47888884, -34220152, -27120570, -22909356, -19503446, -16683800, + -17248588, -23562190, -31726924, -36056252, -35111356, -91716880, -166079936, -142245024, -90293096, -42986180, + -16956530, -6328634, -2001454, -326417 +}; +#endif // IVAS_FLOAT_FIXED const float parametricEarlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX] = { diff --git a/lib_rend/ivas_rom_binauralRenderer.h b/lib_rend/ivas_rom_binauralRenderer.h index 656bc44b8599b785f46c918329a4c42e2669d6e2..d0419254bad0c34e9ebf8d58642ac32b20b89097 100644 --- a/lib_rend/ivas_rom_binauralRenderer.h +++ b/lib_rend/ivas_rom_binauralRenderer.h @@ -64,6 +64,10 @@ extern float FASTCONV_HOA2_latency_s; extern float FASTCONV_FOA_latency_s; extern float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; extern float hrtfShCoeffsIm[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; +#ifdef IVAS_FLOAT_FIXED +extern Word16 hrtfShCoeffsRe_fx[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS];/*Q-15*/ +extern Word16 hrtfShCoeffsIm_fx[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS];/*Q-14*/ +#endif // IVAS_FLOAT_FIXED /* Binaural rendering data set based on BRIRs */ @@ -80,6 +84,11 @@ extern float fastconvReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX]; /* Binaural rendering data set based on BRIRs, to be used in a combined manner * with the above binaural rendering data set based on HRIRs for parametric * renderer */ +#ifdef IVAS_FLOAT_FIXED +extern const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX];/*Q-31*/ +extern const Word32 parametricReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX];/*Q-31*/ +extern const Word32 parametricEarlyPartEneCorrection_fx[CLDFB_NO_CHANNELS_MAX];/*Q-31*/ +#endif // IVAS_FLOAT_FIXED extern const float parametricReverberationTimes[CLDFB_NO_CHANNELS_MAX]; extern const float parametricReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX]; extern const float parametricEarlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX]; diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 66dfaa374c5a18705e2a6d333587845ea23ce504..127697edc94b5caf62ff1bdaee06d8c5b5b73abc 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1426,6 +1426,10 @@ typedef struct TDREND_HRFILT_FiltSet_struct float latency_s; const float *lr_energy_and_iac[3]; /* left/right energy and interaural coherence for late reverb */ #ifdef IVAS_FLOAT_FIXED + Word16 *Azim_p_fx; + Word16 *Elev_p_fx; + Word16 *LeftFiltSet_p_fx; + Word16 *RightFiltSet_p_fx; const UWord16 *lr_energy_and_iac_fx[3]; /* left/right energy and interaural coherence for late reverb *//*Q-15*/ Word32 latency_s_fx;/*Q-31*/ #endif // IVAS_FLOAT_FIXED @@ -1746,6 +1750,13 @@ typedef struct ivas_hrtfs_parambin_struct { float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; float hrtfShCoeffsIm[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; +#ifdef IVAS_FLOAT_FIXED + Word16 hrtfShCoeffsRe_fx[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS];/*Q-15*/ + Word16 hrtfShCoeffsIm_fx[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS];/*Q-14*/ + Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX];/*Q-31*/ + Word32 parametricReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX];/*Q-31*/ + Word32 parametricEarlyPartEneCorrection_fx[CLDFB_NO_CHANNELS_MAX];/*Q-31*/ +#endif // IVAS_FLOAT_FIXED float parametricReverberationTimes[CLDFB_NO_CHANNELS_MAX]; float parametricReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX];