diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 9662a4cf4bbe192b1bf527d22c405574c210cf8d..12f172f2a3ac607ddc21a65404a73e0d3ac5bcff 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -1974,11 +1974,7 @@ ivas_error preview_indices( st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( total_brate, st_ivas->sba_order ); -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT ivas_sba_config( total_brate, st_ivas->sba_analysis_order, -1, &( st_ivas->nchan_transport ), st_ivas->sba_planar, &( st_ivas->nSCE ), &( st_ivas->nCPE ), &( st_ivas->element_mode_init ) ); -#else - ivas_sba_config( total_brate, st_ivas->sba_analysis_order, -1, &( st_ivas->nchan_transport ), st_ivas->sba_planar, &( st_ivas->nSCE ), &( st_ivas->nCPE ), &( st_ivas->element_mode_init ), st_ivas->sba_mode ); -#endif } } diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 3c8e35c7c1446875326b4f4463f81ca6f9e766d0..fe9cb54a6920d00e5a780ec1f9ef6141a57f399d 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -165,9 +165,6 @@ typedef enum #define HEAD_ROTATION_HOA_ORDER 3 /* HOA 3rd order */ #define MAX_CICP_CHANNELS 16 /* max channels for loudspeaker layouts (16 for custom layouts)*/ #define MAX_OUTPUT_CHANNELS 16 /* Maximum number of output channels (HOA 3rd order) */ -#ifndef FIX_DIRAC_CHANNELS -#define IVAS_MAX_NUM_CH 16 /* == MAX_OUTPUT_CHANNELS */ -#endif #define BINAURAL_CHANNELS 2 /* number of channels for binaural output configuration */ #define CPE_CHANNELS 2 /* number of CPE (stereo) channels */ @@ -856,20 +853,7 @@ typedef enum * DirAC Constants *----------------------------------------------------------------------------------*/ -#ifdef FIX_DIRAC_CHANNELS #define DIRAC_MAX_ANA_CHANS FOA_CHANNELS /* Maximum number of channels for DirAC analysis */ -#else -#define DIRAC_MAX_ANA_CHANS 4 /* Maximum number of channels for DirAC analysis */ -#endif - -#ifndef HARMONIZE_SBA_NCHAN_TRANSPORT -#define DIRAC_MAX_TRANS_CHANS 8 /* Maximum number of transport channels for DirAC */ -#endif - -#define DIRAC_MIN_BITRATE_8_TRANS_CHAN IVAS_384k -#define DIRAC_MIN_BITRATE_6_TRANS_CHAN IVAS_256k -#define DIRAC_MIN_BITRATE_4_TRANS_CHAN IVAS_160k /* minimum bitrate for sending 4 transport channels (FOA) */ -#define DIRAC_MIN_BITRATE_2_TRANS_CHAN IVAS_48k /* minimum bitrate for sending 2 transport channels (Stereo) */ #define DIRAC_NUM_DIMS 3 /* number of directions to estimate (X,Y,Z) */ #define DIRAC_MAX_NBANDS 12 /* Maximum number of frequency bands for the DirAC Side Parameter decoding */ diff --git a/lib_com/ivas_dirac_com.c b/lib_com/ivas_dirac_com.c index 5acc473b6a69ea8b11332a455ea8213c8965f502..a3bfeabdb29871d17ae4d6f38ff9a326a6271755 100644 --- a/lib_com/ivas_dirac_com.c +++ b/lib_com/ivas_dirac_com.c @@ -60,11 +60,7 @@ ivas_error ivas_dirac_config( ) { IVAS_FORMAT ivas_format; -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT int16_t sba_order; -#else - int16_t sba_order, sba_planar; -#endif int16_t *nSCE, *nCPE, *element_mode, *nchan_transport; int32_t ivas_total_brate; DIRAC_CONFIG_DATA_HANDLE hConfig; @@ -87,9 +83,6 @@ ivas_error ivas_dirac_config( element_mode = &( (Encoder_Struct *) st_ivas )->hEncoderConfig->element_mode_init; nchan_transport = &( (Encoder_Struct *) st_ivas )->nchan_transport; sba_order = ( (Encoder_Struct *) st_ivas )->sba_analysis_order; -#ifndef HARMONIZE_SBA_NCHAN_TRANSPORT - sba_planar = ( (Encoder_Struct *) st_ivas )->hEncoderConfig->sba_planar; -#endif ivas_total_brate = ( (Encoder_Struct *) st_ivas )->hEncoderConfig->ivas_total_brate; Fs = ( (Encoder_Struct *) st_ivas )->hEncoderConfig->input_Fs; band_grouping = ( (Encoder_Struct *) st_ivas )->hDirAC->band_grouping; @@ -114,9 +107,6 @@ ivas_error ivas_dirac_config( element_mode = &( (Decoder_Struct *) st_ivas )->element_mode_init; nchan_transport = &( (Decoder_Struct *) st_ivas )->nchan_transport; sba_order = ( (Decoder_Struct *) st_ivas )->sba_analysis_order; -#ifndef HARMONIZE_SBA_NCHAN_TRANSPORT - sba_planar = ( (Decoder_Struct *) st_ivas )->sba_planar; -#endif ivas_total_brate = ( (Decoder_Struct *) st_ivas )->hDecoderConfig->ivas_total_brate; Fs = ( (Decoder_Struct *) st_ivas )->hDecoderConfig->output_Fs; band_grouping = ( (Decoder_Struct *) st_ivas )->hDirAC->band_grouping; @@ -150,12 +140,7 @@ ivas_error ivas_dirac_config( if ( ivas_format == SBA_FORMAT ) /* skip for MASA decoder */ { -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT if ( ( error = ivas_dirac_sba_config( hQMetaData, nchan_transport, nSCE, nCPE, element_mode, ivas_total_brate, sba_order, sba_mode, hConfig->nbands - spar_dirac_split_band ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_sba_config( hQMetaData, nchan_transport, nSCE, nCPE, element_mode, ivas_total_brate, sba_order, sba_planar, - sba_mode, hConfig->nbands - spar_dirac_split_band ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -319,11 +304,8 @@ ivas_error ivas_dirac_sba_config( int16_t *element_mode, /* i/o: element mode of the core coder */ int32_t sba_total_brate, /* i : SBA total bitrate */ const int16_t sba_order, /* i : Ambisonic (SBA) order */ -#ifndef HARMONIZE_SBA_NCHAN_TRANSPORT - const int16_t sba_planar, /* i : SBA planar flag */ -#endif - const SBA_MODE sba_mode, /* i : SBA mode */ - const int16_t nbands /* i : number of frequency bands */ + const SBA_MODE sba_mode, /* i : SBA mode */ + const int16_t nbands /* i : number of frequency bands */ ) { int16_t i; @@ -336,7 +318,7 @@ ivas_error ivas_dirac_sba_config( if ( sba_mode == SBA_MODE_SPAR ) { - /*map the bitrate for SID frame*/ + /* map the bitrate for SID frame */ if ( sba_total_brate == IVAS_SID_5k2 ) { if ( *element_mode == IVAS_SCE ) @@ -436,11 +418,7 @@ ivas_error ivas_dirac_sba_config( if ( sba_total_brate > IVAS_SID_5k2 ) { -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT *nchan_transport = ivas_get_sba_num_TCs( sba_total_brate, sba_order ); -#else - *nchan_transport = ivas_dirac_getNumTransportChannels( sba_total_brate, sba_order, sba_planar ); -#endif } else if ( sba_total_brate == IVAS_SID_5k2 ) { @@ -581,79 +559,6 @@ ivas_error ivas_dirac_sba_config( return error; } -#ifndef HARMONIZE_SBA_NCHAN_TRANSPORT -/*------------------------------------------------------------------------- - * ivas_dirac_getNumTransportChannels() - * - * - *------------------------------------------------------------------------*/ - -/*! r: number of IVAS transport channels */ -int16_t ivas_dirac_getNumTransportChannels( - const int32_t sba_total_brate, /* i : SBA total bitrate */ - const int16_t sba_order, /* i : SBA order */ - const int16_t sba_planar /* i : SBA planar flag */ -) -{ - int16_t num_channels; - - num_channels = 0; - - if ( sba_total_brate >= DIRAC_MIN_BITRATE_8_TRANS_CHAN ) - { - switch ( sba_order ) - { - case 3: - num_channels = sba_planar ? 7 : 8; - break; - case 2: - num_channels = sba_planar ? 5 : 6; - break; - case 1: - num_channels = sba_planar ? 3 : 4; - break; - default: - assert( 0 && "Order not supported!" ); - } - } - else if ( sba_total_brate >= DIRAC_MIN_BITRATE_6_TRANS_CHAN ) - { - switch ( sba_order ) - { - case 3: - case 2: - num_channels = sba_planar ? 5 : 6; - break; - case 1: - num_channels = sba_planar ? 3 : 4; - break; - default: - assert( 0 && "Order not supported!" ); - } - } - else if ( sba_total_brate >= DIRAC_MIN_BITRATE_4_TRANS_CHAN ) - { - if ( sba_planar ) - { - num_channels = 3; - } - else - { - num_channels = 4; - } - } - else if ( sba_total_brate >= DIRAC_MIN_BITRATE_2_TRANS_CHAN ) - { - num_channels = 2; - } - else - { - num_channels = 1; - } - - return num_channels; -} -#endif /*------------------------------------------------------------------------- * computeDirectionVectors() diff --git a/lib_com/ivas_pca_tools.c b/lib_com/ivas_pca_tools.c index 123bcb26b86444da820b7d62da31329b3ad365eb..21f3c0c1ecec0f0509d50a80db22aaec7094d582 100644 --- a/lib_com/ivas_pca_tools.c +++ b/lib_com/ivas_pca_tools.c @@ -136,11 +136,11 @@ static void house_refl( } else { - float _rcp = 1.f / ( *normu ); + float rcp = 1.f / ( *normu ); for ( i = 0; i < sizex; i++ ) { - pu[i] *= _rcp; + pu[i] *= rcp; } if ( pu[0] >= 0.f ) { @@ -152,15 +152,11 @@ static void house_refl( pu[0] -= 1; } -#ifdef FIX_I120_INV_SQRT - _rcp = inv_sqrt( fabsf( pu[0] ) ); -#else - _rcp = 1.f / sqrtf( fabsf( pu[0] ) ); -#endif + rcp = inv_sqrt( fabsf( pu[0] ) ); for ( i = 0; i < sizex; i++ ) { - pu[i] *= _rcp; + pu[i] *= rcp; } } @@ -649,11 +645,7 @@ static void norm_quat( norm_q = dotp( q, q, IVAS_PCA_INTERP ); -#ifdef FIX_I120_INV_SQRT norm_q = inv_sqrt( norm_q ); // VE: TBV: possible division by 0 -#else - norm_q = 1 / sqrtf( norm_q ); // VE: TBV: possible division by 0 -#endif for ( i = 0; i < IVAS_PCA_INTERP; i++ ) { diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index b1f03e2bf2afb7abdfed40dcb1d77c4c762a7b29..0c44e89b7e73a9e07a9071403f5f331486b7e819 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3025,9 +3025,6 @@ void ivas_sba_config( int16_t *nSCE, /* o : number of SCEs */ int16_t *nCPE, /* o : number of CPEs */ int16_t *element_mode /* o : element mode of the core coder */ -#ifndef HARMONIZE_SBA_NCHAN_TRANSPORT - ,const SBA_MODE sba_mode /* i : SBA mode */ -#endif ); ivas_error ivas_sba_dec_reconfigure( @@ -3166,21 +3163,10 @@ ivas_error ivas_dirac_sba_config( int16_t *element_mode, /* o : element mode of the core coder */ int32_t sba_total_brate, /* i : SBA total bitrate */ const int16_t sba_order, /* i : Ambisonic (SBA) order */ -#ifndef HARMONIZE_SBA_NCHAN_TRANSPORT - const int16_t sba_planar, /* i : SBA planar flag */ -#endif const SBA_MODE sba_mode, /* i : SBA mode */ const int16_t nbands /* i : number of frequency bands */ ); -#ifndef HARMONIZE_SBA_NCHAN_TRANSPORT -/*! r: number of IVAS transport channels */ -int16_t ivas_dirac_getNumTransportChannels( - const int32_t sba_total_brate, /* i : SBA total bitrate */ - const int16_t sba_order, /* i : SBA order */ - const int16_t sba_planar /* i : SBA Planar flag */ -); -#endif ivas_error ivas_dirac_dec_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); @@ -3227,7 +3213,6 @@ void ivas_dirac_dec_binaural( const int16_t nchan_transport /* i : number of transport channels */ ); -#ifdef SRAM_REDUCTION_BINRENDERER_ROOM ivas_error ivas_binaural_reverb_open( REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ const int16_t numBins, /* i : number of CLDFB bins */ @@ -3237,13 +3222,7 @@ ivas_error ivas_binaural_reverb_open( const int32_t sampling_rate, /* i : sampling rate */ const RENDERER_TYPE renderer_type /* i : renderer type */ ); -#else -ivas_error ivas_binaural_reverb_open( - REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ - const int16_t numBins, /* i : number of CLDFB bins */ - const int16_t numCldfbSlotsPerFrame /* i : number of CLDFB slots per frame */ -); -#endif + void ivas_binaural_reverb_close( REVERB_STRUCT_HANDLE *hReverb /* i/o: binaural reverb handle */ ); @@ -3834,12 +3813,8 @@ int16_t ivas_get_spar_table_idx( int16_t *ind /* o : indice */ ); -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT /*! r: number of transport channels */ int16_t ivas_get_sba_num_TCs( -#else -int16_t ivas_get_spar_num_TCs( -#endif const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int16_t sba_order /* i : IVAS SBA order */ ); diff --git a/lib_com/ivas_sba_config.c b/lib_com/ivas_sba_config.c index 58cd80bc3783a034b2df29eb99257df1c292d625..37d9e58accc657f0cb4c299e797a6eaed1ac8ed8 100644 --- a/lib_com/ivas_sba_config.c +++ b/lib_com/ivas_sba_config.c @@ -88,10 +88,6 @@ void ivas_sba_config( int16_t *nSCE, /* o : number of SCEs */ int16_t *nCPE, /* o : number of CPEs */ int16_t *element_mode /* o : element mode of the core coder */ -#ifndef HARMONIZE_SBA_NCHAN_TRANSPORT - , - const SBA_MODE sba_mode /* i : SBA mode */ -#endif ) { if ( ( sba_order < 0 ) && ( nb_channels < 0 ) ) @@ -120,18 +116,7 @@ void ivas_sba_config( if ( nchan_transport != NULL ) { -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT *nchan_transport = ivas_get_sba_num_TCs( sba_total_brate, sba_order ); -#else - if ( sba_mode == SBA_MODE_SPAR ) - { - *nchan_transport = ivas_get_spar_num_TCs( sba_total_brate, sba_order ); - } - else - { - *nchan_transport = ivas_dirac_getNumTransportChannels( sba_total_brate, sba_order, sba_planar ); - } -#endif } /* Configure core coder number of elements*/ diff --git a/lib_com/ivas_spar_com.c b/lib_com/ivas_spar_com.c index f7fc0e3e26813a0c54b9d3816a451e9faf4ffd5d..eec2e5f09a4bc5cd7dc4309dc367386a81f20942 100644 --- a/lib_com/ivas_spar_com.c +++ b/lib_com/ivas_spar_com.c @@ -324,11 +324,7 @@ void ivas_spar_config( } else { -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT *nchan_transport = ivas_get_sba_num_TCs( ivas_total_brate, sba_order ); -#else - *nchan_transport = ivas_get_spar_num_TCs( ivas_total_brate, sba_order ); -#endif } *nCPE = ( *nchan_transport > 1 ) ? ( *nchan_transport + 1 ) >> 1 : 0; @@ -412,7 +408,6 @@ int16_t ivas_get_spar_table_idx( } -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT /*-------------------------------------------------------------------* * ivas_get_sba_num_TCs() * @@ -421,16 +416,6 @@ int16_t ivas_get_spar_table_idx( /*! r: number of transport channels */ int16_t ivas_get_sba_num_TCs( -#else -/*-------------------------------------------------------------------* - * ivas_get_spar_num_TCs() - * - * Return number of TCs in SPAR - *-------------------------------------------------------------------*/ - -/*! r: number of transport channels */ -int16_t ivas_get_spar_num_TCs( -#endif const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int16_t sba_order /* i : Ambisonic (SBA) order */ ) @@ -441,12 +426,10 @@ int16_t ivas_get_spar_num_TCs( { nchan_transport = 1; } -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT else if ( ivas_sba_mode_select( ivas_total_brate ) == SBA_MODE_DIRAC ) { nchan_transport = 1; } -#endif else { table_idx = ivas_get_spar_table_idx( ivas_total_brate, sba_order, SPAR_CONFIG_BW, NULL, NULL ); diff --git a/lib_com/options.h b/lib_com/options.h index 5d0e0c6088a26df834fd7533d9484f5787f71352..f040d6b10d4eac75b63f3d468d951670c7502c96 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -146,15 +146,7 @@ #define FADE_TO_ZERO_FOR_TOO_LONG_FRAMELOSS /*#define FIX_I1_113*/ /* under review : MCT bit distribution optimization for SBA high bitrates*/ -#define SPAR_SCALING_HARMONIZATION /* Issue 80: Changes to harmonize scaling in spar */ -#define FIX_I98_HANDLES_TO_NULL /* Issue 98: do the setting of all handles to NULL in one place */ -#define FIX_I102_SWB_TBE_SWITCH /* Issue 102: avoid IO->SWB switching code for IVAS, generate SHB ACB mem with lerp in case of switch */ -#define FIX_DIRAC_CHANNELS /* Issue 71: lower number of DirAC analysis channels */ -#define HARMONIZE_SBA_NCHAN_TRANSPORT /* harmonize setting of number of transport channels in SBA */ #define FIX_I13_TCX_TNS_ISSUE /* Issue 13: Fix reported artifacts. Bug in TNS with TCX5 */ -#define SRAM_REDUCTION_BINRENDERER /* Issue 145: reduction of static RAM usage in fastconv binaural renderer */ -#define SRAM_REDUCTION_BINRENDERER_ROOM /* Issue 145: reduction of static RAM usage in fastconv binaural room renderer */ -#define FIX_I120_INV_SQRT /* Issue 120: inv_sqrt() shall be used instead of 1 / sqrt() to measure the correct complexity */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index ed91a78e0931c363182af6acc19dcd96836aceda..c108c8099874e82ddfe33015f52624f4c474fa7c 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -701,13 +701,13 @@ ivas_error acelp_core_dec( mvr2r( old_exc_s + st->L_frame - M, st->mem_syn2, M ); residu( Aq, M, old_exc_s, old_exc + L_EXC_MEM_DEC - st->L_frame, st->L_frame ); } -#ifdef FIX_I102_SWB_TBE_SWITCH + if ( st->last_core != ACELP_CORE && st->element_mode > EVS_MONO ) { /* Prepare ACB memory of old_bwe_exc */ lerp( old_exc, old_bwe_exc, L_EXC_MEM_DEC * HIBND_ACB_L_FAC, L_EXC_MEM_DEC ); } -#endif + /*-----------------------------------------------------------------* * FEC - first good frame after lost frame(s) (possibility to correct the ACB) *-----------------------------------------------------------------*/ diff --git a/lib_dec/ivas_binauralRenderer.c b/lib_dec/ivas_binauralRenderer.c index b3d298b562871e37dff930eb6e1ba59b8ab91829..45108a92faf37767b05a8bf481c28771e33ba406 100644 --- a/lib_dec/ivas_binauralRenderer.c +++ b/lib_dec/ivas_binauralRenderer.c @@ -186,7 +186,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( } } -#ifdef SRAM_REDUCTION_BINRENDERER /* allocate memory for filter states */ if ( ( hBinRenConvModule->filterTapsLeftReal = (float ***) count_malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) { @@ -266,7 +265,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( } } } -#endif /* set memories */ for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) @@ -308,13 +306,8 @@ static ivas_error ivas_binRenderer_convModuleOpen( if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && hRenderConfig->roomAcoustics.use_brir ) { /* set the memories to zero */ -#ifdef SRAM_REDUCTION_BINRENDERER set_zero( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] ); set_zero( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] ); -#else - set_zero( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx], hBinRenConvModule->numTaps ); - set_zero( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx], hBinRenConvModule->numTaps ); -#endif if ( isLoudspeaker ) { @@ -378,9 +371,7 @@ static void ivas_binaural_obtain_DMX( { int16_t chIdx, bandIdx, k; -#ifdef SRAM_REDUCTION_BINRENDERER_ROOM // ToDo: hBinRenderer->ivas_format is never set to ISM_FORMAT -> TBV -#endif if ( hBinRenderer->ivas_format == MC_FORMAT || hBinRenderer->ivas_format == ISM_FORMAT ) { /* Obtain the downmix */ @@ -496,10 +487,6 @@ ivas_error ivas_binRenderer_open( { BINAURAL_RENDERER_HANDLE hBinRenderer; int16_t convBand, chIdx, k; -#ifndef SRAM_REDUCTION_BINRENDERER_ROOM - float t60[CLDFB_NO_CHANNELS_MAX]; - float ene[CLDFB_NO_CHANNELS_MAX]; -#endif ivas_error error; error = IVAS_ERR_OK; @@ -593,31 +580,10 @@ ivas_error ivas_binRenderer_open( /* Allocate memories needed for reverb module */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->hRenderConfig->roomAcoustics.late_reverb_on ) { -#ifdef SRAM_REDUCTION_BINRENDERER_ROOM if ( ( error = ivas_binaural_reverb_open( &( hBinRenderer->hReverb ), hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hIntSetup.output_config, st_ivas->hDecoderConfig->output_Fs, RENDERER_BINAURAL_FASTCONV_ROOM ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( ( error = ivas_binaural_reverb_open( &( hBinRenderer->hReverb ), hBinRenderer->conv_band, hBinRenderer->timeSlots ) ) != IVAS_ERR_OK ) - { - return error; - } - - if ( !st_ivas->hRenderConfig->roomAcoustics.override ) - { - ivas_binaural_reverb_setReverbTimes( hBinRenderer->hReverb, st_ivas->hDecoderConfig->output_Fs, fastconvReverberationTimes, fastconvReverberationEneCorrections ); - ivas_binaural_reverb_setPreDelay( hBinRenderer->hReverb, 10 ); - } - else - { - ivas_reverb_prepare_cldfb_params( &st_ivas->hRenderConfig->roomAcoustics, st_ivas->hIntSetup.output_config, st_ivas->hRenderConfig->roomAcoustics.use_brir, st_ivas->hDecoderConfig->output_Fs, t60, ene ); - ivas_binaural_reverb_setReverbTimes( hBinRenderer->hReverb, st_ivas->hDecoderConfig->output_Fs, t60, ene ); - ivas_binaural_reverb_setPreDelay( hBinRenderer->hReverb, (int16_t) roundf( 48000.0f * st_ivas->hRenderConfig->roomAcoustics.acousticPreDelay / CLDFB_NO_CHANNELS_MAX ) ); - } - - hBinRenderer->hReverb->useBinauralCoherence = 1; -#endif /* initialize the dmx matrix */ for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) @@ -662,7 +628,7 @@ ivas_error ivas_binRenderer_open( return error; } -#ifdef SRAM_REDUCTION_BINRENDERER + /*------------------------------------------------------------------------- * ivas_binRenderer_convModuleClose() * @@ -741,7 +707,7 @@ static void ivas_binRenderer_convModuleClose( return; } -#endif + /*------------------------------------------------------------------------- * ivas_binRenderer_close() @@ -760,12 +726,7 @@ void ivas_binRenderer_close( if ( ( *hBinRenderer )->hBinRenConvModule != NULL ) { -#ifdef SRAM_REDUCTION_BINRENDERER ivas_binRenderer_convModuleClose( hBinRenderer ); -#else - count_free( ( *hBinRenderer )->hBinRenConvModule ); - ( *hBinRenderer )->hBinRenConvModule = NULL; -#endif } if ( ( *hBinRenderer )->hReverb != NULL ) diff --git a/lib_dec/ivas_binaural_reverb.c b/lib_dec/ivas_binaural_reverb.c index db552e538a22acbc4c06327a993f24b3bb11abc1..b03c8c005322f630cf0a91005ff99e96d0cd4909 100644 --- a/lib_dec/ivas_binaural_reverb.c +++ b/lib_dec/ivas_binaural_reverb.c @@ -36,9 +36,7 @@ #include "ivas_prot.h" #include "prot.h" #include "ivas_rom_com.h" -#ifdef SRAM_REDUCTION_BINRENDERER_ROOM #include "ivas_rom_binauralRenderer.h" -#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -315,13 +313,6 @@ void ivas_binaural_reverb_setReverbTimes( } hReverb->binauralCoherenceDirectGains[bin] = sqrtf( 1.0f - fabsf( tmpVal ) ); -#ifndef SRAM_REDUCTION_BINRENDERER_ROOM - /* Determine loop buffer length. The following formula is manually tuned to generate sufficiently long - * but not excessively long loops to generate reverberation. */ - /* Note: the resulted length is very sensitive to the precision of the constants below (e.g. 1.45 vs. 1.45f) */ - hReverb->loopBufLength[bin] = (int16_t) ( 1.45 * (int16_t) ( revTimes[bin] * 150.0 ) + 1 ); - hReverb->loopBufLength[bin] = min( hReverb->loopBufLength[bin], hReverb->loopBufLengthMax[bin] ); -#endif /* Determine attenuation factor that generates the appropriate energy decay according to reverberation time */ attenuationFactorPerSample = powf( 10.0f, -3.0f * ( 1.0f / ( (float) CLDFB_SLOTS_PER_SECOND * revTimes[bin] ) ) ); hReverb->loopAttenuationFactor[bin] = powf( attenuationFactorPerSample, hReverb->loopBufLength[bin] ); @@ -341,8 +332,10 @@ void ivas_binaural_reverb_setReverbTimes( for ( sample = 0; sample < hReverb->loopBufLength[bin]; sample++ ) { intendedEnergy += currentEnergy; + /* The randomization at the energy build up affects where the sparse taps are located */ energyBuildup += currentEnergy + 0.1f * ( (float) binRend_rand( hReverb ) / PCM16_TO_FLT_FAC - 0.5f ); + if ( energyBuildup >= 1.0f ) /* A new filter tap is added at this condition */ { /* Four efficient phase operations: n*pi/2, n=0,1,2,3 */ @@ -375,7 +368,6 @@ void ivas_binaural_reverb_setReverbTimes( * Allocate and initialize binaural room reverberator handle *------------------------------------------------------------------------*/ -#ifdef SRAM_REDUCTION_BINRENDERER_ROOM ivas_error ivas_binaural_reverb_open( REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ const int16_t numBins, /* i : number of CLDFB bins */ @@ -512,96 +504,7 @@ ivas_error ivas_binaural_reverb_open( return IVAS_ERR_OK; } -#else -ivas_error ivas_binaural_reverb_open( - REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ - const int16_t numBins, /* i : number of CLDFB bins */ - const int16_t numCldfbSlotsPerFrame /* i : number of CLDFB slots per frame, i.e., reverberator block size */ -) -{ - int16_t bin, chIdx, k, tmp; - REVERB_STRUCT_HANDLE hReverb; - - if ( ( *hReverbPr = (REVERB_STRUCT_HANDLE) count_malloc( sizeof( REVERB_STRUCT ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) ); - } - - hReverb = *hReverbPr; - hReverb->useBinauralCoherence = 0; - hReverb->preDelayBufferLength = 1; - hReverb->preDelayBufferIndex = 0; - - hReverb->numBins = numBins; - hReverb->blockSize = numCldfbSlotsPerFrame; - - for ( k = 0; k < REVERB_PREDELAY_MAX + 1; k++ ) - { - set_f( hReverb->preDelayBufferReal[k], 0.0f, hReverb->numBins ); - set_f( hReverb->preDelayBufferImag[k], 0.0f, hReverb->numBins ); - } - - for ( bin = 0; bin < hReverb->numBins; bin++ ) - { - /* Loop Buffer */ - hReverb->loopBufLengthMax[bin] = (int16_t) ( 500 / ( 1 + bin ) + ( CLDFB_NO_CHANNELS_MAX - bin ) ); - - tmp = hReverb->loopBufLengthMax[bin] + hReverb->blockSize; - if ( ( hReverb->loopBufReal[bin] = (float *) count_malloc( tmp * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) ); - } - - if ( ( hReverb->loopBufImag[bin] = (float *) count_malloc( tmp * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) ); - } - - set_f( hReverb->loopBufReal[bin], 0.0f, tmp ); - set_f( hReverb->loopBufImag[bin], 0.0f, tmp ); - - /* Sparse Filter Tap Locations */ - for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) - { - tmp = hReverb->loopBufLengthMax[bin]; - - if ( ( hReverb->tapPhaseShiftType[bin][chIdx] = (int16_t *) count_malloc( tmp * sizeof( int16_t ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) ); - } - - if ( ( hReverb->tapPointersReal[bin][chIdx] = (float **) count_malloc( tmp * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) ); - } - - if ( ( hReverb->tapPointersImag[bin][chIdx] = (float **) count_malloc( tmp * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) ); - } - - set_s( hReverb->tapPhaseShiftType[bin][chIdx], 0, tmp ); - - tmp = hReverb->blockSize; - if ( ( hReverb->outputBufferReal[bin][chIdx] = (float *) count_malloc( tmp * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) ); - } - - if ( ( hReverb->outputBufferImag[bin][chIdx] = (float *) count_malloc( tmp * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) ); - } - - set_f( hReverb->outputBufferReal[bin][chIdx], 0.0f, tmp ); - set_f( hReverb->outputBufferImag[bin][chIdx], 0.0f, tmp ); - } - } - - return IVAS_ERR_OK; -} -#endif /*------------------------------------------------------------------------- * ivas_binaural_reverb_close() diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 1af46684909d866cf85110ba4873ca833436fec5..ec9a712065419747d337522d6bc67e2d28a5754a 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -198,11 +198,7 @@ ivas_error ivas_dirac_dec_config( if ( flag_config == DIRAC_RECONFIGURE && st_ivas->ivas_format == SBA_FORMAT ) { int16_t tmp1, tmp2, tmp3; -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT ivas_sba_config( st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->sba_analysis_order, -1, &nchan_transport_old, st_ivas->sba_planar, &tmp1, &tmp2, &tmp3 ); -#else - ivas_sba_config( st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->sba_analysis_order, -1, &nchan_transport_old, st_ivas->sba_planar, &tmp1, &tmp2, &tmp3, SBA_MODE_DIRAC ); -#endif } /*-----------------------------------------------------------------* @@ -1813,13 +1809,9 @@ void ivas_dirac_dec( #ifdef DEBUG_MODE_DIRAC { -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT int16_t n, tmp[IVAS_SPAR_MAX_CH * L_FRAME48k]; -#else - int16_t n, tmp[DIRAC_MAX_TRANS_CHANS * L_FRAME48k]; -#endif char file_name[50] = { 0 }; - const int16_t output_frame = st_ivas->output_Fs / FRAMES_PER_SEC; + const int16_t output_frame = st_ivas->->hDecoderConfig->output_Fs / FRAMES_PER_SEC; for ( n = 0; n < nchan_transport; n++ ) { @@ -2544,11 +2536,7 @@ static void initDiffuseResponses( if ( output_config == AUDIO_CONFIG_MONO ) { diffuse_response_function[0] = 1.0f; -#ifdef FIX_I120_INV_SQRT diffuse_response_function[1] = inv_sqrt( 3.0f ); -#else - diffuse_response_function[1] = 1.0f / sqrtf( 3.0f ); -#endif } else if ( !( output_config == AUDIO_CONFIG_FOA || output_config == AUDIO_CONFIG_HOA2 || output_config == AUDIO_CONFIG_HOA3 ) ) { @@ -2630,11 +2618,7 @@ static void initDiffuseResponses( { for ( k = 0; k < ( 2 * l + 1 ); k++ ) { -#ifdef FIX_I120_INV_SQRT diffuse_response_function[idx++] = inv_sqrt( 2.0f * l + 1.0f ); -#else - diffuse_response_function[idx++] = 1.0f / sqrtf( 2.0f * l + 1.0f ); -#endif } } } diff --git a/lib_dec/ivas_dirac_dec_binaural_functions.c b/lib_dec/ivas_dirac_dec_binaural_functions.c index 94f504954200b3dc79052609fc50c561258a9ff8..ca9f0a4587a985e94d8fedb4b8372f09fb90fffb 100644 --- a/lib_dec/ivas_dirac_dec_binaural_functions.c +++ b/lib_dec/ivas_dirac_dec_binaural_functions.c @@ -150,7 +150,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( hBinaural->useTdDecorr = 1; } } - if ( st_ivas->ivas_format == MASA_FORMAT ) + else if ( st_ivas->ivas_format == MASA_FORMAT ) { if ( ( st_ivas->hDecoderConfig->ivas_total_brate < IVAS_48k && st_ivas->nchan_transport == 1 ) || st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE ) { @@ -188,7 +188,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( else if ( renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Indication of binaural rendering with room effect */ { mvr2r( parametricEarlyPartEneCorrection, hBinaural->earlyPartEneCorrection, nBins ); -#ifdef SRAM_REDUCTION_BINRENDERER_ROOM + if ( hBinaural->useSubframeMode ) { if ( ( error = ivas_binaural_reverb_open( &hBinaural->hReverb, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, NULL, st_ivas->hIntSetup.output_config, output_Fs, RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) != IVAS_ERR_OK ) @@ -203,26 +203,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( return error; } } -#else - if ( hBinaural->useSubframeMode ) - { - if ( ( error = ivas_binaural_reverb_open( &hBinaural->hReverb, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - if ( ( error = ivas_binaural_reverb_open( &hBinaural->hReverb, nBins, CLDFB_NO_COL_MAX ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - ivas_binaural_reverb_setReverbTimes( hBinaural->hReverb, output_Fs, parametricReverberationTimes, parametricReverberationEneCorrections ); - hBinaural->hReverb->useBinauralCoherence = 1; - ivas_binaural_reverb_setPreDelay( hBinaural->hReverb, 10 ); -#endif } else if ( renderer_type == RENDERER_STEREO_PARAMETRIC ) { @@ -264,6 +244,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( return IVAS_ERR_OK; } + /*------------------------------------------------------------------------- * ivas_dirac_dec_close_binaural_data() * @@ -433,6 +414,7 @@ static void ivas_dirac_dec_binaural_internal( Cldfb_ImagBuffer_in[0][slot][b] = INV_SQRT2 * ( Cldfb_ImagBuffer_in[0][slot][b] + Cldfb_ImagBuffer_in[2][slot][b] ); Cldfb_ImagBuffer_in[1][slot][b] = Cldfb_ImagBuffer_in[0][slot][b]; } + /* HB: Copy first channel to second channel and add HB-CNGs with different scalings*/ for ( ; b < nBins; b++ ) { @@ -449,13 +431,9 @@ static void ivas_dirac_dec_binaural_internal( { /* At mono input duplicate the channel to dual-mono, and apply gain correction to ensure same overall level as in stereo mode */ -#ifdef FIX_I120_INV_SQRT v_multc( Cldfb_RealBuffer_in[0][slot], INV_SQRT_2, Cldfb_RealBuffer_in[0][slot], nBins ); v_multc( Cldfb_ImagBuffer_in[0][slot], INV_SQRT_2, Cldfb_ImagBuffer_in[0][slot], nBins ); -#else - v_multc( Cldfb_RealBuffer_in[0][slot], 1.0f / SQRT2, Cldfb_RealBuffer_in[0][slot], nBins ); - v_multc( Cldfb_ImagBuffer_in[0][slot], 1.0f / SQRT2, Cldfb_ImagBuffer_in[0][slot], nBins ); -#endif + mvr2r( Cldfb_RealBuffer_in[0][slot], Cldfb_RealBuffer_in[1][slot], nBins ); mvr2r( Cldfb_ImagBuffer_in[0][slot], Cldfb_ImagBuffer_in[1][slot], nBins ); } @@ -470,15 +448,11 @@ static void ivas_dirac_dec_binaural_internal( Cldfb_RealBuffer_in[ch][slot], Cldfb_ImagBuffer_in[ch][slot], nBins, st_ivas->cldfbAnaDec[ch] ); + if ( st_ivas->nchan_transport == 1 && st_ivas->ivas_format == SBA_FORMAT ) { -#ifdef FIX_I120_INV_SQRT v_multc( Cldfb_RealBuffer_in[ch][slot], INV_SQRT_2, Cldfb_RealBuffer_in[ch][slot], nBins ); v_multc( Cldfb_ImagBuffer_in[ch][slot], INV_SQRT_2, Cldfb_ImagBuffer_in[ch][slot], nBins ); -#else - v_multc( Cldfb_RealBuffer_in[ch][slot], 1.0f / SQRT2, Cldfb_RealBuffer_in[ch][slot], nBins ); - v_multc( Cldfb_ImagBuffer_in[ch][slot], 1.0f / SQRT2, Cldfb_ImagBuffer_in[ch][slot], nBins ); -#endif } } } @@ -790,11 +764,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric { /* 0.5f <= spreadCoh < 1.0f */ centerMul = 2.0f - ( 2.0f * spreadCoh ); -#ifdef FIX_I120_INV_SQRT sidesMul = inv_sqrt( centerMul + 2.0f ); -#else - sidesMul = 1.0f / sqrtf( centerMul + 2.0f ); -#endif centerMul *= sidesMul; } diff --git a/lib_dec/ivas_dirac_output_synthesis_dec.c b/lib_dec/ivas_dirac_output_synthesis_dec.c index dfda59fde9ccea54a7acfff887652f7f4a375c16..79c04f824b6f86848acc0df1962ec1e35757d1fe 100644 --- a/lib_dec/ivas_dirac_output_synthesis_dec.c +++ b/lib_dec/ivas_dirac_output_synthesis_dec.c @@ -2078,11 +2078,8 @@ static void spreadCoherencePanningVbap( if ( hVBAPdata == NULL ) { /* Distribute signal to all channels if VBAP is not properly initialized. */ -#ifdef FIX_I120_INV_SQRT set_f( direct_response, inv_sqrt( num_channels_dir ), num_channels_dir ); -#else - set_f( direct_response, 1.0f / sqrtf( num_channels_dir ), num_channels_dir ); -#endif + return; } diff --git a/lib_dec/ivas_efap.c b/lib_dec/ivas_efap.c index 7999264eb3decbe24d989596725312b12662d821..602fd2416152a81bf52ae8b16197121e63513dd7 100644 --- a/lib_dec/ivas_efap.c +++ b/lib_dec/ivas_efap.c @@ -266,11 +266,7 @@ void efap_determine_gains( } normBuffer = normBuffer + hEFAPdata->bufferShort[j] * hEFAPdata->bufferShort[j]; } -#ifdef FIX_I120_INV_SQRT normBuffer = inv_sqrt( normBuffer ); -#else - normBuffer = 1.f / sqrtf( normBuffer ); -#endif for ( j = 0; j < hEFAPdata->numSpk; ++j ) { @@ -1632,11 +1628,7 @@ static float point_plane_distance( /* Dot Product */ tmpNorm = dotp( resultCross, resultCross, 3 ); -#ifdef FIX_I120_INV_SQRT tmpNorm = inv_sqrt( tmpNorm ); -#else - tmpNorm = 1.f / sqrtf( tmpNorm ); -#endif v_sub( X, P1, tmpDot1, 3 ); v_multc( resultCross, tmpNorm, tmpDot2, 3 ); dist = dotp( tmpDot1, tmpDot2, 3 ); diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 2ccf1efdce468f6fe9ced0e92f0df1d189cfa504..911de57d7ee910f73f738b75724b1772f077a414 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -135,11 +135,7 @@ ivas_error ivas_dec_setup( } else { -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT ivas_sba_config( ivas_total_brate, st_ivas->sba_analysis_order, -1, &( st_ivas->nchan_transport ), st_ivas->sba_planar, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init ); -#else - ivas_sba_config( ivas_total_brate, st_ivas->sba_analysis_order, -1, &( st_ivas->nchan_transport ), st_ivas->sba_planar, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, st_ivas->sba_mode ); -#endif } } else if ( st_ivas->ivas_format == MASA_FORMAT ) @@ -789,13 +785,7 @@ ivas_error ivas_init_decoder( } } -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_mode, IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) ) != IVAS_ERR_OK ) - -#else - if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_planar, - st_ivas->sba_mode, IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -825,11 +815,7 @@ ivas_error ivas_init_decoder( } else { -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_mode, -1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_planar, st_ivas->sba_mode, -1 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1034,11 +1020,7 @@ ivas_error ivas_init_decoder( if ( st_ivas->hVBAPdata == NULL ) { /* Distribute signal to all channels if VBAP is not properly initialized. */ -#ifdef FIX_I120_INV_SQRT set_f( st_ivas->hLsSetupCustom->separate_ch_gains, inv_sqrt( st_ivas->hLsSetupCustom->num_spk ), st_ivas->hLsSetupCustom->num_spk ); -#else - set_f( st_ivas->hLsSetupCustom->separate_ch_gains, 1 / sqrtf( st_ivas->hLsSetupCustom->num_spk ), st_ivas->hLsSetupCustom->num_spk ); -#endif } else { diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index a495aed93490ce04afaa30671ef49a8340ad44f1..7fe031f9d2ea84b6ca075e3dc87ac13508517f38 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -987,11 +987,7 @@ void ivas_mdct_core_reconstruct( xcorr += signal_outFB[0][i] * signal_outFB[1][i]; } -#ifdef FIX_I120_INV_SQRT hCPE->hStereoMdct->lastCoh = fabsf( xcorr ) * inv_sqrt( nrgL * nrgR ); -#else - hCPE->hStereoMdct->lastCoh = fabsf( xcorr ) / sqrtf( nrgL * nrgR ); -#endif hCPE->hStereoMdct->lastCoh = min( hCPE->hStereoMdct->lastCoh, 1.f ); } diff --git a/lib_dec/ivas_objectRenderer_vec.c b/lib_dec/ivas_objectRenderer_vec.c index 54f7c51727cb1276a35c8c7b24656f1aa8a2a7ff..11c5d31ea874dadc13d804a571619658d5e25d97 100644 --- a/lib_dec/ivas_objectRenderer_vec.c +++ b/lib_dec/ivas_objectRenderer_vec.c @@ -89,11 +89,7 @@ void TDREND_SPATIAL_VecNormalize( { float scaler; -#ifdef FIX_I120_INV_SQRT scaler = inv_sqrt( Vec_p[0] * Vec_p[0] + Vec_p[1] * Vec_p[1] + Vec_p[2] * Vec_p[2] ); -#else - scaler = 1.0f / sqrtf( Vec_p[0] * Vec_p[0] + Vec_p[1] * Vec_p[1] + Vec_p[2] * Vec_p[2] ); -#endif VecNorm_p[0] = scaler * Vec_p[0]; VecNorm_p[1] = scaler * Vec_p[1]; VecNorm_p[2] = scaler * Vec_p[2]; diff --git a/lib_dec/ivas_reverb.c b/lib_dec/ivas_reverb.c index 56ea9fc7e8a8a4393067310a8558a563c5bcf43d..c18d3940e6cacfd52da140bc1fbdab18840bdd27 100644 --- a/lib_dec/ivas_reverb.c +++ b/lib_dec/ivas_reverb.c @@ -156,11 +156,9 @@ static ivas_error compute_feedback_matrix( { return IVAS_ERR_INTERNAL; /* n must be 4, 6, 8 or 16, else ERROR */ } -#ifdef FIX_I120_INV_SQRT + u = inv_sqrt( n ); -#else - u = 1.0f / sqrtf( n ); -#endif + if ( n == 4 ) { u = -u; diff --git a/lib_dec/ivas_rom_binauralRenderer.h b/lib_dec/ivas_rom_binauralRenderer.h index ca3a527c4cfce2a4d004f8ae92c270b8bb7a8d00..c597847a0f90dc6651d7e35ac816494557ac14f9 100644 --- a/lib_dec/ivas_rom_binauralRenderer.h +++ b/lib_dec/ivas_rom_binauralRenderer.h @@ -44,7 +44,6 @@ /* Binaural rendering data set based on HRIRs */ extern const float FASTCONV_HRIR_latency_s; -#ifdef SRAM_REDUCTION_BINRENDERER extern float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][16][7]; extern float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][16][7]; extern float rightHRIRReal_HOA3[BINAURAL_CONVBANDS][16][7]; @@ -58,35 +57,14 @@ extern float rightHRIRImag[BINAURAL_CONVBANDS][15][7]; extern float FASTCONV_HOA3_latency_s; extern float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; extern float hrtfShCoeffsIm[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; -#else -extern const float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][16][7]; -extern const float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][16][7]; -extern const float rightHRIRReal_HOA3[BINAURAL_CONVBANDS][16][7]; -extern const float rightHRIRImag_HOA3[BINAURAL_CONVBANDS][16][7]; -extern const float leftHRIRReal[BINAURAL_CONVBANDS][15][7]; -extern const float leftHRIRImag[BINAURAL_CONVBANDS][15][7]; -extern const float rightHRIRReal[BINAURAL_CONVBANDS][15][7]; -extern const float rightHRIRImag[BINAURAL_CONVBANDS][15][7]; - -extern const float FASTCONV_HOA3_latency_s; -extern const float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; -extern const float hrtfShCoeffsIm[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; -#endif /* Binaural rendering data set based on BRIRs */ extern const float FASTCONV_BRIR_latency_s; -#ifdef SRAM_REDUCTION_BINRENDERER extern float leftBRIRReal[BINAURAL_CONVBANDS][15][BINAURAL_NTAPS_MAX]; extern float leftBRIRImag[BINAURAL_CONVBANDS][15][BINAURAL_NTAPS_MAX]; extern float rightBRIRReal[BINAURAL_CONVBANDS][15][BINAURAL_NTAPS_MAX]; extern float rightBRIRImag[BINAURAL_CONVBANDS][15][BINAURAL_NTAPS_MAX]; -#else -extern const float leftBRIRReal[BINAURAL_CONVBANDS][15][BINAURAL_NTAPS_MAX]; -extern const float leftBRIRImag[BINAURAL_CONVBANDS][15][BINAURAL_NTAPS_MAX]; -extern const float rightBRIRReal[BINAURAL_CONVBANDS][15][BINAURAL_NTAPS_MAX]; -extern const float rightBRIRImag[BINAURAL_CONVBANDS][15][BINAURAL_NTAPS_MAX]; -#endif /* Reverberation parameters based on BRIRs for fastconv */ extern float fastconvReverberationTimes[CLDFB_NO_CHANNELS_MAX]; diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index a17ae8a977fff1f125f0943eb0f1a0f2968c55de..ac056971e22fb1d6460d1ff03dc86c9f35eeb2c7 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -48,10 +48,6 @@ * Local function prototypes *-----------------------------------------------------------------------*/ -#ifndef HARMONIZE_SBA_NCHAN_TRANSPORT -static void ivas_sba_dmx_dec( float sba_data[][L_FRAME48k], const int16_t nchan_transport, const int16_t output_frame ); -#endif - #ifdef DEBUG_MODE_DIRAC static void debug_mode_dirac( float output[MAX_OUTPUT_CHANNELS][L_FRAME48k], const int16_t nchan_transport, const int16_t output_frame ); #endif @@ -248,7 +244,6 @@ int16_t ivas_sba_remapTCs( } } -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT if ( st_ivas->nchan_transport >= 3 ) { int16_t i = 0; @@ -266,36 +261,6 @@ int16_t ivas_sba_remapTCs( } } } -#else - if ( st_ivas->sba_mode == SBA_MODE_SPAR ) - { - int16_t i = 0; - float temp; - - if ( st_ivas->nchan_transport >= 3 ) - { - /*convert WYXZ downmix to WYZX*/ - for ( i = 0; i < output_frame; i++ ) - { - temp = sba_data[2][i]; - sba_data[2][i] = sba_data[3][i]; - sba_data[3][i] = temp; - if ( st_ivas->nchan_transport == 3 ) - { - sba_data[2][i] = 0; - } - } - } - } - else - { -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT - /* do nothing; simply use omni */ -#else - ivas_sba_dmx_dec( sba_data, nchan_remapped, output_frame ); -#endif - } -#endif if ( st_ivas->sba_mode != SBA_MODE_SPAR ) { @@ -306,102 +271,6 @@ int16_t ivas_sba_remapTCs( } -#ifndef HARMONIZE_SBA_NCHAN_TRANSPORT -/*-------------------------------------------------------------------* - * ivas_sba_dmx_dec() - * - * - *-------------------------------------------------------------------*/ - -static void ivas_sba_dmx_dec( - float sba_data[][L_FRAME48k], /* i : SBA signals */ - const int16_t nchan_transport, /* i : number of transport channels */ - const int16_t output_frame /* i : frame length */ -) -{ - int16_t i; - float tmp_f[DIRAC_MAX_TRANS_CHANS]; - - if ( nchan_transport >= 7 ) - { - for ( i = 0; i < output_frame; i++ ) - { - tmp_f[0] = 0.506415f * sba_data[0][i] + 0.506415f * sba_data[1][i] + 0.506415f * sba_data[2][i] + 0.506415f * sba_data[3][i] + 0.506415f * sba_data[4][i] + 0.506415f * sba_data[5][i] + 0.506415f * sba_data[6][i]; - tmp_f[1] = -0.000000f * sba_data[0][i] + 0.531020f * sba_data[1][i] + 0.662171f * sba_data[2][i] + 0.294694f * sba_data[3][i] + -0.294694f * sba_data[4][i] + -0.662171f * sba_data[5][i] + -0.531020f * sba_data[6][i]; - tmp_f[2] = 0.679200f * sba_data[0][i] + 0.423475f * sba_data[1][i] + -0.151136f * sba_data[2][i] + -0.611938f * sba_data[3][i] + -0.611938f * sba_data[4][i] + -0.151136f * sba_data[5][i] + 0.423475f * sba_data[6][i]; - tmp_f[3] = 0.000000f * sba_data[0][i] + 0.833385f * sba_data[1][i] + -0.370891f * sba_data[2][i] + -0.668323f * sba_data[3][i] + 0.668323f * sba_data[4][i] + 0.370891f * sba_data[5][i] + -0.833385f * sba_data[6][i]; - tmp_f[4] = 0.854817f * sba_data[0][i] + -0.190215f * sba_data[1][i] + -0.770164f * sba_data[2][i] + 0.532970f * sba_data[3][i] + 0.532970f * sba_data[4][i] + -0.770164f * sba_data[5][i] + -0.190215f * sba_data[6][i]; - tmp_f[5] = 0.000000f * sba_data[0][i] + 0.691125f * sba_data[1][i] + -1.245365f * sba_data[2][i] + 1.552944f * sba_data[3][i] + -1.552944f * sba_data[4][i] + 1.245365f * sba_data[5][i] + -0.691125f * sba_data[6][i]; - tmp_f[6] = 1.592881f * sba_data[0][i] + -1.435137f * sba_data[1][i] + 0.993145f * sba_data[2][i] + -0.354449f * sba_data[3][i] + -0.354449f * sba_data[4][i] + 0.993145f * sba_data[5][i] + -1.435137f * sba_data[6][i]; - - sba_data[0][i] = tmp_f[0]; - sba_data[1][i] = tmp_f[1]; - sba_data[2][i] = sba_data[7][i]; - sba_data[3][i] = tmp_f[2]; - sba_data[4][i] = tmp_f[3]; - sba_data[8][i] = tmp_f[4]; - sba_data[9][i] = tmp_f[5]; - sba_data[15][i] = tmp_f[6]; - } - - return; - } - else if ( nchan_transport >= 5 ) - { - for ( i = 0; i < output_frame; i++ ) - { - tmp_f[0] = 0.708982f * sba_data[0][i] + 0.708982f * sba_data[1][i] + 0.708982f * sba_data[2][i] + 0.708982f * sba_data[3][i] + 0.708982f * sba_data[4][i]; - tmp_f[1] = 0.000000f * sba_data[0][i] + 1.005966f * sba_data[1][i] + 0.621721f * sba_data[2][i] + -0.621721f * sba_data[3][i] + -1.005966f * sba_data[4][i]; - tmp_f[2] = 1.057735f * sba_data[0][i] + 0.326858f * sba_data[1][i] + -0.855726f * sba_data[2][i] + -0.855726f * sba_data[3][i] + 0.326858f * sba_data[4][i]; - tmp_f[3] = 0.000000f * sba_data[0][i] + 1.079884f * sba_data[1][i] + -1.747289f * sba_data[2][i] + 1.747289f * sba_data[3][i] + -1.079884f * sba_data[4][i]; - tmp_f[4] = 1.837208f * sba_data[0][i] + -1.486333f * sba_data[1][i] + 0.567729f * sba_data[2][i] + 0.567729f * sba_data[3][i] + -1.486333f * sba_data[4][i]; - - sba_data[0][i] = tmp_f[0]; - sba_data[1][i] = tmp_f[1]; - sba_data[2][i] = sba_data[5][i]; - sba_data[3][i] = tmp_f[2]; - sba_data[4][i] = tmp_f[3]; - sba_data[8][i] = tmp_f[4]; - } - - return; - } - else if ( nchan_transport >= 3 ) - { - - /*A-format to ACN/SN3D*/ - for ( i = 0; i < output_frame; i++ ) - { - tmp_f[0] = 0.5f * ( sba_data[0][i] + sba_data[1][i] + sba_data[2][i] + sba_data[3][i] ); - tmp_f[1] = sba_data[0][i] - sba_data[1][i]; - tmp_f[2] = sba_data[2][i] - sba_data[3][i]; - tmp_f[3] = sba_data[0][i] + sba_data[1][i] - sba_data[2][i] - sba_data[3][i]; - - sba_data[0][i] = tmp_f[0]; - sba_data[1][i] = tmp_f[1]; - sba_data[2][i] = tmp_f[2]; - sba_data[3][i] = tmp_f[3]; - } - - return; - } - else if ( nchan_transport == 2 ) - { - /* do nothing for stereo DMX, upmix done in DirAC*/ - return; - } - else if ( nchan_transport == 1 ) - { - /* do nothing; simply use omni */ - return; - } - else - { - assert( 0 && "SBA: number of transport channels not supported." ); - } -} -#endif - /*-------------------------------------------------------------------------* * ivas_ism2sba() * @@ -515,11 +384,8 @@ ivas_error ivas_sba_dec_reconfigure( st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, st_ivas->sba_order ); -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT ivas_sba_config( sba_total_brate, st_ivas->sba_analysis_order, -1, &nchan_transport, st_ivas->sba_planar, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init ); -#else - ivas_sba_config( sba_total_brate, st_ivas->sba_analysis_order, -1, &nchan_transport, st_ivas->sba_planar, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, st_ivas->sba_mode ); -#endif + st_ivas->nchan_transport = nchan_transport; /* renderer might have changed */ @@ -536,11 +402,7 @@ ivas_error ivas_sba_dec_reconfigure( { st_ivas->sba_dirac_stereo_flag = ( st_ivas->nchan_transport == 1 && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ); -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_mode, -1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_planar, st_ivas->sba_mode, -1 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -552,13 +414,7 @@ ivas_error ivas_sba_dec_reconfigure( sba_order_internal = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); ivas_spar_config( st_ivas->hDecoderConfig->ivas_total_brate, sba_order_internal, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->hSpar->core_nominal_brate, st_ivas->sid_format ); -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_mode, IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) ) != IVAS_ERR_OK ) - -#else - if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_planar, - st_ivas->sba_mode, IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 43a30693e60dd6310091aabf35e7da7d9b3cef33..9f36670a7d5c5e97e5f54afe8f277d78c974ce62 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1303,25 +1303,13 @@ typedef struct ivas_dirac_dec_binaural_data_structure typedef struct ivas_binaural_rendering_conv_module_struct { -#ifdef SRAM_REDUCTION_BINRENDERER float ***filterTapsLeftReal; float ***filterTapsLeftImag; float ***filterTapsRightReal; float ***filterTapsRightImag; -#else - const float *filterTapsLeftReal[CLDFB_NO_CHANNELS_MAX][MAX_OUTPUT_CHANNELS]; - const float *filterTapsLeftImag[CLDFB_NO_CHANNELS_MAX][MAX_OUTPUT_CHANNELS]; - const float *filterTapsRightReal[CLDFB_NO_CHANNELS_MAX][MAX_OUTPUT_CHANNELS]; - const float *filterTapsRightImag[CLDFB_NO_CHANNELS_MAX][MAX_OUTPUT_CHANNELS]; -#endif -#ifdef SRAM_REDUCTION_BINRENDERER float ***filterStatesLeftReal; float ***filterStatesLeftImag; -#else - float filterStatesLeftReal[BINAURAL_CONVBANDS][MAX_OUTPUT_CHANNELS][BINAURAL_NTAPS_MAX]; - float filterStatesLeftImag[BINAURAL_CONVBANDS][MAX_OUTPUT_CHANNELS][BINAURAL_NTAPS_MAX]; -#endif int16_t numTapsArray[BINAURAL_CONVBANDS]; int16_t numTaps; diff --git a/lib_dec/ivas_stereo_cng_dec.c b/lib_dec/ivas_stereo_cng_dec.c index 7ee63cd33c673127244543e209ce868a46290aac..ac7f942b2a7bfcaa8a09624b7e0e1b4b74c64d18 100644 --- a/lib_dec/ivas_stereo_cng_dec.c +++ b/lib_dec/ivas_stereo_cng_dec.c @@ -345,11 +345,7 @@ static void stereo_dft_generate_comfort_noise( ptr2 = ptr1 + 1; for ( i = 0; i < st->L_frame / 2 - 1; i++ ) { -#ifdef FIX_I120_INV_SQRT *ptr0++ = 2.0f * sqrtf( st->lp_ener / st->L_frame * 0.5f ) * inv_sqrt( *ptr1 * *ptr1 + *ptr2 * *ptr2 ); -#else - *ptr0++ = 2.0f * sqrtf( st->lp_ener / st->L_frame * 0.5f ) / sqrtf( *ptr1 * *ptr1 + *ptr2 * *ptr2 ); -#endif ptr1 += 2; ptr2 += 2; } @@ -775,11 +771,9 @@ void stereo_cng_compute_PScorr( enrS += *outputSptr * *outputSptr; dotPS += *outputPptr++ * *outputSptr++; } -#ifdef FIX_I120_INV_SQRT + c_PS = ( dotPS + EPSILON ) * inv_sqrt( enrP * enrS + EPSILON ); -#else - c_PS = ( dotPS + EPSILON ) / sqrtf( enrP * enrS + EPSILON ); -#endif + *c_PS_LT = STEREO_TD_PS_CORR_FILT * *c_PS_LT + ( 1 - STEREO_TD_PS_CORR_FILT ) * c_PS; return; @@ -816,11 +810,7 @@ static void stereo_cng_compute_LRcorr( dotLR += output[0][i] * output[1][i]; } -#ifdef FIX_I120_INV_SQRT c_LR = fabsf( dotLR + EPSILON ) * inv_sqrt( enrL * enrR + EPSILON ); -#else - c_LR = fabsf( dotLR + EPSILON ) / sqrtf( enrL * enrR + EPSILON ); -#endif c = ( enrL + DELTA ) / ( enrR + DELTA ); hCPE->hStereoTD->c_LR_LT = STEREO_TD_PS_CORR_FILT * hCPE->hStereoTD->c_LR_LT + ( 1 - STEREO_TD_PS_CORR_FILT ) * c_LR; hCPE->hStereoCng->c_LR_LT = hCPE->hStereoTD->c_LR_LT; @@ -944,11 +934,7 @@ void stereo_cna_update_params( } /* estimate L/R correlation factor and ILD in time domain */ -#ifdef FIX_I120_INV_SQRT c_LR = fabsf( dotLR + EPSILON ) * inv_sqrt( enrL * enrR + EPSILON ); -#else - c_LR = fabsf( dotLR + EPSILON ) / sqrtf( enrL * enrR + EPSILON ); -#endif c = ( enrL + DELTA ) / ( enrR + DELTA ); c_ILD = ( c - 1 ) / ( c + 1 ); } diff --git a/lib_dec/ivas_vbap.c b/lib_dec/ivas_vbap.c index 0417fd742f41d16abb6b0bff8da97a5c585a9dbf..2534854e8ba6894d621819411363a4312b00d9d7 100644 --- a/lib_dec/ivas_vbap.c +++ b/lib_dec/ivas_vbap.c @@ -436,11 +436,7 @@ void vbap_determine_gains( gain_ene += gain_triplet[ch] * gain_triplet[ch]; } -#ifdef FIX_I120_INV_SQRT norm_value = inv_sqrt( gain_ene ); -#else - norm_value = 1.0f / sqrtf( gain_ene ); -#endif for ( ch = 0; ch < 3; ch++ ) { diff --git a/lib_enc/acelp_core_enc.c b/lib_enc/acelp_core_enc.c index e4ce289a9efa003a1ae4c741de4f860396a73464..857099ed927bdd9976caa750bfdb3c407f0fb15d 100644 --- a/lib_enc/acelp_core_enc.c +++ b/lib_enc/acelp_core_enc.c @@ -472,13 +472,13 @@ ivas_error acelp_core_enc( mvr2r( hLPDmem->old_exc + st->L_frame - M, hLPDmem->mem_syn, M ); residu( Aq, M, hLPDmem->old_exc, old_exc, st->L_frame ); } -#ifdef FIX_I102_SWB_TBE_SWITCH + if ( st->last_core != ACELP_CORE && st->element_mode > EVS_MONO ) { /* Prepare ACB memory of old_bwe_exc */ lerp( old_exc, old_bwe_exc, L_EXC_MEM_DEC * HIBND_ACB_L_FAC, L_EXC_MEM_DEC ); } -#endif + /*---------------------------------------------------------------* * Calculation of LP residual (filtering through A[z] filter) diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index 6ac3cff6fe3d7dd9b11be1c532f8c46b28e021fc..9d3b6131e1de170103d09105a141b328522d41cd 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -122,29 +122,16 @@ ivas_error ivas_dirac_enc_open( if ( st_ivas->sba_mode == SBA_MODE_DIRAC ) { hDirAC->num_samples_synchro_delay = NS2SA( input_Fs, IVAS_FB_ENC_DELAY_NS ); -#ifdef FIX_DIRAC_CHANNELS + for ( i = 0; i < DIRAC_MAX_ANA_CHANS; i++ ) -#else - for ( i = 0; i < st_ivas->hEncoderConfig->nchan_inp; i++ ) -#endif { hDirAC->sba_synchro_buffer[i] = (float *) count_malloc( hDirAC->num_samples_synchro_delay * sizeof( float ) ); set_zero( hDirAC->sba_synchro_buffer[i], hDirAC->num_samples_synchro_delay ); } -#ifndef FIX_DIRAC_CHANNELS - for ( ; i < IVAS_MAX_NUM_CH; i++ ) - { - hDirAC->sba_synchro_buffer[i] = NULL; - } -#endif } else { -#ifdef FIX_DIRAC_CHANNELS for ( i = 0; i < DIRAC_MAX_ANA_CHANS; i++ ) -#else - for ( i = 0; i < IVAS_MAX_NUM_CH; i++ ) -#endif { hDirAC->sba_synchro_buffer[i] = NULL; } @@ -252,11 +239,7 @@ void ivas_dirac_enc_close( ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs ); } -#ifdef FIX_DIRAC_CHANNELS for ( i = 0; i < DIRAC_MAX_ANA_CHANS; i++ ) -#else - for ( i = 0; i < IVAS_MAX_NUM_CH; i++ ) -#endif { if ( hDirAC->sba_synchro_buffer[i] != NULL ) { @@ -470,11 +453,7 @@ void ivas_dirac_enc_spar_delay_synchro( int16_t ch_idx; float tmp_buffer[L_FRAME48k]; -#ifdef FIX_DIRAC_CHANNELS for ( ch_idx = 0; ch_idx < DIRAC_MAX_ANA_CHANS; ch_idx++ ) -#else - for ( ch_idx = 0; ch_idx < st_ivas->hEncoderConfig->nchan_inp; ch_idx++ ) -#endif { mvr2r( data_f[ch_idx], tmp_buffer, input_frame ); mvr2r( st_ivas->hDirAC->sba_synchro_buffer[ch_idx], data_f[ch_idx], st_ivas->hDirAC->num_samples_synchro_delay ); diff --git a/lib_enc/ivas_mct_enc.c b/lib_enc/ivas_mct_enc.c index 9aa5fe04c5ddb8843b918cd7853cb0aca8deb357..18c3b93fb91f2a1b60806cc9a1cd82e6a20494bd 100644 --- a/lib_enc/ivas_mct_enc.c +++ b/lib_enc/ivas_mct_enc.c @@ -193,26 +193,12 @@ ivas_error create_mct_enc( hMCT->nchan_out_woLFE = st_ivas->hEncoderConfig->nchan_inp - 1; /* LFE channel is coded separately */ hMCT->num_lfe = TRUE; } -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT else if ( ivas_format == SBA_FORMAT ) { hMCT->nchan_out_woLFE = ivas_get_sba_num_TCs( ivas_total_brate, st_ivas->sba_analysis_order ); hMCT->num_lfe = FALSE; } -#else - else if ( ivas_format == SBA_FORMAT && st_ivas->hSpar ) - { - hMCT->nchan_out_woLFE = ivas_get_spar_num_TCs( ivas_total_brate, st_ivas->sba_analysis_order ); - - hMCT->num_lfe = FALSE; - } - else if ( ivas_format == SBA_FORMAT && st_ivas->hDirAC ) - { - hMCT->nchan_out_woLFE = ivas_dirac_getNumTransportChannels( ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->hEncoderConfig->sba_planar ); - hMCT->num_lfe = FALSE; - } -#endif else if ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMMC ) { hMCT->nchan_out_woLFE = ivas_param_mc_getNumTransportChannels( ivas_total_brate, st_ivas->hEncoderConfig->mc_input_setup ); @@ -346,7 +332,6 @@ ivas_error mct_enc_reconfigure( hMCT->nchan_out_woLFE = st_ivas->hEncoderConfig->nchan_inp - 1; /* LFE channel is coded separately */ hMCT->num_lfe = TRUE; } -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT else if ( ivas_format == SBA_FORMAT && st_ivas->hDirAC ) // VE: this condition to be reviewed together with the following one { hMCT->nchan_out_woLFE = ivas_get_sba_num_TCs( ivas_total_brate, st_ivas->sba_analysis_order ); @@ -357,18 +342,6 @@ ivas_error mct_enc_reconfigure( hMCT->nchan_out_woLFE = ivas_sba_get_nchan( st_ivas->sba_analysis_order, st_ivas->hEncoderConfig->sba_planar ); hMCT->num_lfe = FALSE; } -#else - else if ( ivas_format == SBA_FORMAT && st_ivas->hDirAC ) - { - hMCT->nchan_out_woLFE = ivas_dirac_getNumTransportChannels( ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->hEncoderConfig->sba_planar ); - hMCT->num_lfe = FALSE; - } - else if ( ivas_format == SBA_FORMAT ) - { - hMCT->nchan_out_woLFE = ivas_sba_get_nchan( st_ivas->sba_analysis_order, st_ivas->hEncoderConfig->sba_planar ); - hMCT->num_lfe = FALSE; - } -#endif else { assert( !"IVAS format currently not supported for MCT" ); diff --git a/lib_enc/ivas_sba_enc.c b/lib_enc/ivas_sba_enc.c index 40b502fd70521afa0f1c79308f7b74760363d177..b8f06f72d2f74cfc30d152adc8cf8304b8c2ddce 100644 --- a/lib_enc/ivas_sba_enc.c +++ b/lib_enc/ivas_sba_enc.c @@ -45,13 +45,6 @@ #endif #include "wmops.h" -#ifndef HARMONIZE_SBA_NCHAN_TRANSPORT -/*-----------------------------------------------------------------------* - * Local function prototypes - *-----------------------------------------------------------------------*/ - -static void ivas_sba_dmx_enc( float sba_data[][L_FRAME48k], const int16_t nchan_transport, const int16_t input_frame ); -#endif /*-------------------------------------------------------------------* * ivas_sba_getTCs() @@ -67,7 +60,6 @@ void ivas_sba_getTCs( { ivas_sba_zero_vert_comp( sba_data, st_ivas->sba_analysis_order, st_ivas->hEncoderConfig->sba_planar, input_frame ); -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT st_ivas->nchan_transport = ivas_get_sba_num_TCs( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->sba_analysis_order ); if ( st_ivas->nchan_transport >= 3 ) @@ -83,34 +75,6 @@ void ivas_sba_getTCs( } } -#else - if ( st_ivas->sba_mode == SBA_MODE_SPAR ) - { - st_ivas->nchan_transport = ivas_get_spar_num_TCs( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->sba_analysis_order ); - if ( st_ivas->nchan_transport >= 3 ) - { - /*convert WYZX downmix to WYXZ*/ - int16_t i = 0; - float temp; - for ( i = 0; i < input_frame; i++ ) - { - temp = sba_data[2][i]; - sba_data[2][i] = sba_data[3][i]; - sba_data[3][i] = temp; - } - } - } - else - { - st_ivas->nchan_transport = ivas_dirac_getNumTransportChannels( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->hEncoderConfig->sba_planar ); -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT - /* do nothing; simply use omni */ -#else - ivas_sba_dmx_enc( sba_data, st_ivas->nchan_transport, input_frame ); -#endif - } -#endif - #ifdef DEBUG_MODE_DIRAC for ( int16_t n = 0; n < st_ivas->nchan_transport; n++ ) { @@ -130,107 +94,6 @@ void ivas_sba_getTCs( } -#ifndef HARMONIZE_SBA_NCHAN_TRANSPORT -/*-------------------------------------------------------------------* - * ivas_sba_dmx_enc() - * - * - *-------------------------------------------------------------------*/ - -static void ivas_sba_dmx_enc( - float sba_data[][L_FRAME48k], /* i : SBA signals */ - const int16_t nchan_transport, /* i : number of transport channels */ - const int16_t input_frame /* i : frame length */ -) -{ - int16_t i; - float dmx_l, dmx_r; - float a, b; - float tmp_f[DIRAC_MAX_TRANS_CHANS]; - - if ( nchan_transport >= 7 ) - { - for ( i = 0; i < input_frame; i++ ) - { - tmp_f[0] = 0.282095f * sba_data[0][i] + 0.000000f * sba_data[1][i] + 0.420663f * sba_data[3][i] + 0.000000f * sba_data[4][i] + 0.334240f * sba_data[8][i] + 0.000000f * sba_data[9][i] + 0.179369f * sba_data[15][i]; - tmp_f[1] = 0.282095f * sba_data[0][i] + 0.328887f * sba_data[1][i] + 0.262279f * sba_data[3][i] + 0.325860f * sba_data[4][i] + -0.074375f * sba_data[8][i] + 0.077825f * sba_data[9][i] + -0.161606f * sba_data[15][i]; - tmp_f[2] = 0.282095f * sba_data[0][i] + 0.410116f * sba_data[1][i] + -0.093606f * sba_data[3][i] + -0.145021f * sba_data[4][i] + -0.301140f * sba_data[8][i] + -0.140237f * sba_data[9][i] + 0.111835f * sba_data[15][i]; - tmp_f[3] = 0.282095f * sba_data[0][i] + 0.182519f * sba_data[1][i] + -0.379004f * sba_data[3][i] + -0.261320f * sba_data[4][i] + 0.208395f * sba_data[8][i] + 0.174872f * sba_data[9][i] + -0.039913f * sba_data[15][i]; - tmp_f[4] = 0.282095f * sba_data[0][i] + -0.182519f * sba_data[1][i] + -0.379004f * sba_data[3][i] + 0.261320f * sba_data[4][i] + 0.208395f * sba_data[8][i] + -0.174872f * sba_data[9][i] + -0.039913f * sba_data[15][i]; - tmp_f[5] = 0.282095f * sba_data[0][i] + -0.410116f * sba_data[1][i] + -0.093606f * sba_data[3][i] + 0.145021f * sba_data[4][i] + -0.301140f * sba_data[8][i] + 0.140237f * sba_data[9][i] + 0.111835f * sba_data[15][i]; - tmp_f[6] = 0.282095f * sba_data[0][i] + -0.328887f * sba_data[1][i] + 0.262279f * sba_data[3][i] + -0.325860f * sba_data[4][i] + -0.074375f * sba_data[8][i] + -0.077825f * sba_data[9][i] + -0.161606f * sba_data[15][i]; - sba_data[7][i] = sba_data[2][i]; /* will be dropped for planarSBA */ - sba_data[0][i] = tmp_f[0]; - sba_data[1][i] = tmp_f[1]; - sba_data[2][i] = tmp_f[2]; - sba_data[3][i] = tmp_f[3]; - sba_data[4][i] = tmp_f[4]; - sba_data[5][i] = tmp_f[5]; - sba_data[6][i] = tmp_f[6]; - } - - return; - } - else if ( nchan_transport >= 5 ) - { - for ( i = 0; i < input_frame; i++ ) - { - tmp_f[0] = 0.282095f * sba_data[0][i] + 0.000000f * sba_data[1][i] + 0.378166f * sba_data[3][i] + 0.000000f * sba_data[4][i] + 0.217722f * sba_data[8][i]; - tmp_f[1] = 0.282095f * sba_data[0][i] + 0.359658f * sba_data[1][i] + 0.116860f * sba_data[3][i] + 0.127974f * sba_data[4][i] + -0.176140f * sba_data[8][i]; - tmp_f[2] = 0.282095f * sba_data[0][i] + 0.222281f * sba_data[1][i] + -0.305943f * sba_data[3][i] + -0.207066f * sba_data[4][i] + 0.067280f * sba_data[8][i]; - tmp_f[3] = 0.282095f * sba_data[0][i] + -0.222281f * sba_data[1][i] + -0.305943f * sba_data[3][i] + 0.207066f * sba_data[4][i] + 0.067280f * sba_data[8][i]; - tmp_f[4] = 0.282095f * sba_data[0][i] + -0.359658f * sba_data[1][i] + 0.116860f * sba_data[3][i] + -0.127974f * sba_data[4][i] + -0.176140f * sba_data[8][i]; - sba_data[5][i] = sba_data[2][i]; /* will be dropped for planarSBA */ - sba_data[0][i] = tmp_f[0]; - sba_data[1][i] = tmp_f[1]; - sba_data[2][i] = tmp_f[2]; - sba_data[3][i] = tmp_f[3]; - sba_data[4][i] = tmp_f[4]; - } - - return; - } - else if ( nchan_transport >= 3 ) - { - for ( i = 0; i < input_frame; i++ ) - { - dmx_l = 0.5f * sba_data[1][i]; - dmx_r = 0.5f * sba_data[2][i]; - a = 0.5f * sba_data[0][i]; - b = 0.25f * sba_data[3][i]; - - sba_data[0][i] = a + b; - sba_data[1][i] = sba_data[0][i] - dmx_l; - sba_data[0][i] += dmx_l; - - sba_data[2][i] = a - b; - sba_data[3][i] = sba_data[2][i] - dmx_r; /* will be dropped for planarSBA & irrelevant*/ - sba_data[2][i] += dmx_r; /* irrelevant for planarSBA*/ - } - - return; - } - else if ( nchan_transport == 2 ) - { - for ( i = 0; i < input_frame; i++ ) - { - dmx_l = 0.5f * ( sba_data[0][i] + sba_data[1][i] ); /* cardioid_left = W + Y */ - sba_data[1][i] = 0.5f * ( sba_data[0][i] - sba_data[1][i] ); /* cardioid_right = W - Y */ - sba_data[0][i] = dmx_l; - } - - return; - } - else if ( nchan_transport == 1 ) - { - /* do nothing; simply use omni */ - return; - } - - return; -} -#endif - /*-------------------------------------------------------------------* * ivas_sba_enc_reconfigure() * diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 14f9f08a54d8d667999e0753559d871476d333fb..5c4e834e6136115fcf2e062bb14ec4e51c2f126b 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -84,11 +84,7 @@ ivas_error ivas_spar_enc_open( assert( nchan_inp <= hEncoderConfig->nchan_inp ); ivas_total_brate = hEncoderConfig->ivas_total_brate; -#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT nchan_transport = ivas_get_sba_num_TCs( hEncoderConfig->ivas_total_brate, sba_order_internal ); -#else - nchan_transport = ivas_get_spar_num_TCs( hEncoderConfig->ivas_total_brate, sba_order_internal ); -#endif // bw = ivas_get_bw_idx_from_sample_rate(pCfg->input_Fs); table_idx = ivas_get_spar_table_idx( ivas_total_brate, sba_order_internal, SPAR_CONFIG_BW, NULL, NULL ); diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index fd204e18c50194bd7e65fe2473095a2a241aa072..1dc541f0038aa1254256f3fbe3a88dc362b5aa71 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -572,11 +572,7 @@ typedef struct ivas_dirac_enc_data_structure PARAM_ISM_CONFIG_HANDLE hParamIsm; /* Parametric ISM handle */ IVAS_FB_MIXER_HANDLE hFbMixer; -#ifdef FIX_DIRAC_CHANNELS float *sba_synchro_buffer[DIRAC_MAX_ANA_CHANS]; -#else - float *sba_synchro_buffer[IVAS_MAX_NUM_CH]; // VE: all 16 buffers not needed ? -#endif int16_t num_samples_synchro_delay; /* DirAC parameter estimation */ diff --git a/lib_enc/ivas_stereo_dft_enc.c b/lib_enc/ivas_stereo_dft_enc.c index 80e05cc5cc472f53d02947a7c750732c0bb31146..de44362ddd9f223254290a944d0a15aa7255094a 100644 --- a/lib_enc/ivas_stereo_dft_enc.c +++ b/lib_enc/ivas_stereo_dft_enc.c @@ -1643,13 +1643,11 @@ void stereo_dft_enc_process( sum_nrg_R2 += pDFT_R[2 * j] * pDFT_R[2 * j] + pDFT_R[2 * j + 1] * pDFT_R[2 * j + 1]; dot_prod_real2 += pDFT_L[2 * j] * pDFT_R[2 * j] + pDFT_L[2 * j + 1] * pDFT_R[2 * j + 1]; } + sum_nrg_Mid = max( 0.f, sum_nrg_L2 + sum_nrg_R2 + 2.f * dot_prod_real2 ); -#ifdef FIX_I120_INV_SQRT wL = 0.5f * max( sqrtf( sum_nrg_L2 ) + sqrtf( sum_nrg_R2 ) - sqrtf( sum_nrg_Mid ), 0 ) * inv_sqrt( sum_nrg_L2 + EPSILON ); -#else - wL = 0.5f * max( sqrtf( sum_nrg_L2 ) + sqrtf( sum_nrg_R2 ) - sqrtf( sum_nrg_Mid ), 0 ) / sqrtf( sum_nrg_L2 + EPSILON ); -#endif wS = 1; + if ( hStereoDft->res_cod_sw_flag ) { wL *= ( 1 - hStereoDft->switch_fade_factor ); diff --git a/lib_enc/ivas_stereo_ica_enc.c b/lib_enc/ivas_stereo_ica_enc.c index 0e1b1a9af10fadd39c021f23ee7a4264724398ab..c178d05a91cd7a8008f9bb28bd38e71ac7e80e12 100644 --- a/lib_enc/ivas_stereo_ica_enc.c +++ b/lib_enc/ivas_stereo_ica_enc.c @@ -345,11 +345,7 @@ static void utilCrossCorr( temp = sum2_f( tempBuf1, len ); temp *= sum2_f( tempBuf2, len ); -#ifdef FIX_I120_INV_SQRT scale = ( temp == 0 ) ? 1.0f : inv_sqrt( temp ); -#else - scale = ( temp == 0 ) ? 1.0f : 1.0f / sqrtf( temp ); -#endif /* starting point of lag search range should be less than the ending point */ assert( lagSearchRange[0] <= lagSearchRange[1] ); diff --git a/lib_enc/ivas_tcx_core_enc.c b/lib_enc/ivas_tcx_core_enc.c index ed918a5ca7f2ab7de1e23fd8aae1e5a518b3ef58..4bd88cb00dff93373645e65bb3ba50b0a520b8e8 100644 --- a/lib_enc/ivas_tcx_core_enc.c +++ b/lib_enc/ivas_tcx_core_enc.c @@ -680,11 +680,7 @@ int16_t ivas_acelp_tcx20_switching( for ( i = 0; i < L_frame; i++ ) { -#ifdef FIX_I120_INV_SQRT x[i] *= (float) L_frame * inv_sqrt( 2 * NORM_MDCT_FACTOR ); -#else - x[i] *= (float) L_frame / sqrtf( 2 * NORM_MDCT_FACTOR ); -#endif y[i] = x[i]; } diff --git a/lib_enc/swb_pre_proc.c b/lib_enc/swb_pre_proc.c index 52d3099c41dd55b5672dffa9286bfe99b11b1c73..4d6eaf7836788e2484075243fa30722c18fe72f0 100644 --- a/lib_enc/swb_pre_proc.c +++ b/lib_enc/swb_pre_proc.c @@ -287,21 +287,15 @@ void swb_pre_proc( FD_BWE_ENC_HANDLE hBWE_FD; int32_t inner_Fs, input_Fs; float old_input[NS2SA( 48000, DELAY_FD_BWE_ENC_NS + DELAY_FIR_RESAMPL_NS ) + L_FRAME48k]; - float spchTmp[640]; -#ifdef FIX_I102_SWB_TBE_SWITCH - float spchTmp2[640]; - int16_t L_resamp; -#endif - int16_t i, j; + float spchTmp[L_FRAME32k], spchTmp2[L_FRAME32k]; + int16_t i, j, L_resamp; int16_t startB, endB; float *realBufferFlipped[CLDFB_NO_COL_MAX]; float *imagBufferFlipped[CLDFB_NO_COL_MAX]; float realBufferTmp[CLDFB_NO_COL_MAX][20]; float imagBufferTmp[CLDFB_NO_COL_MAX][20]; int16_t ts, nB, uB; - float sign; - float lbEner, v, t; - float regression; + float sign, lbEner, v, t, regression; const float *thr, *regV; int16_t Sample_Delay_SWB_BWE32k, lMemRecalc32k, dft_ovl32k; @@ -681,11 +675,7 @@ void swb_pre_proc( } else { -#ifdef FIX_I102_SWB_TBE_SWITCH if ( ( st->bwidth == FB || st->core == ACELP_CORE ) && ( st->element_mode == EVS_MONO ) ) -#else - if ( st->bwidth == FB || st->core == ACELP_CORE || ( st->element_mode == IVAS_CPE_DFT && input_Fs == 48000 ) ) -#endif { set_f( hBWE_TD->old_speech_shb, 0, L_LOOK_16k + L_SUBFR16k ); set_f( shb_speech, 0, L_FRAME16k ); /* shb_speech for FB/SWB BWE_HIGHRATE is not used at 64kbps */ @@ -697,16 +687,9 @@ void swb_pre_proc( st->hBWE_TD->prev_pow_exc16kWhtnd = 1.0f; st->hBWE_TD->prev_mix_factor = 1.0f; st->hBWE_TD->prev_Env_error = 0.0f; -#ifndef FIX_I102_SWB_TBE_SWITCH - if ( st->element_mode == IVAS_CPE_DFT ) - { - set_f( hCPE->hStereoDft->output_mem_dmx_16k_shb, 0, STEREO_DFT_OVL_16k ); - } -#endif } else { -#ifdef FIX_I102_SWB_TBE_SWITCH if ( st->element_mode == IVAS_CPE_DFT ) { if ( st->L_frame == L_FRAME ) @@ -742,15 +725,7 @@ void swb_pre_proc( spchTmp[i] = -spchTmp[i]; } } -#else - /* flip the spectrm */ - mvr2r( new_swb_speech, spchTmp, L_FRAME32k ); - for ( i = 0; i < L_FRAME32k; i = i + 2 ) - { - spchTmp[i] = -spchTmp[i]; - } -#endif Decimate_allpass_steep( spchTmp, hBWE_TD->state_ana_filt_shb, L_FRAME32k, shb_speech ); mvr2r( shb_speech + L_FRAME16k - ( L_LOOK_16k + L_SUBFR16k ), hBWE_TD->old_speech_shb, L_LOOK_16k + L_SUBFR16k ); @@ -770,23 +745,16 @@ void swb_pre_proc( /* Reset CLDFB synthesis buffer */ set_f( st->cldfbSynTd->cldfb_state, 0.0f, st->cldfbSynTd->p_filter_length ); } -#ifdef FIX_I102_SWB_TBE_SWITCH else { hCPE->hStereoDft->flip_sign = -hCPE->hStereoDft->flip_sign; /* Make sure sign is updated even if DFT SHB target is not generated */ } -#endif } /* Memory reset to compensate for 0.9375 ms offset when transitioning from IO to SWB */ /* When switching from n >1 to n = 1, we keep the enc/dec delay as 8.75/3.25 and below code not needed; only when n = 1 start, it will be 9.6875/2.3125 in that case this reset is needed for IO->BWE.*/ -#ifdef FIX_I102_SWB_TBE_SWITCH if ( st->last_extl == -1 && st->element_mode == EVS_MONO ) -#else - /* IVAS_fmToDo: revisit for IVAS (the condition is currently entered for both TD and DFT stereo - is it desirable?) */ - if ( st->last_extl == -1 ) -#endif { delay = NS2SA( input_Fs, DELAY_FIR_RESAMPL_NS ); for ( i = 0; i < delay; i++ )