diff --git a/lib_com/ivas_dirac_com_fx.c b/lib_com/ivas_dirac_com_fx.c index c814c3169ed52026e42689092b628f3b50d40b96..677c72860c3fb3f4f44caaa86a8c351354ccabec 100644 --- a/lib_com/ivas_dirac_com_fx.c +++ b/lib_com/ivas_dirac_com_fx.c @@ -223,19 +223,11 @@ ivas_error ivas_dirac_config_fx( IF( EQ_32( ivas_format, SBA_FORMAT ) || EQ_32( ivas_format, SBA_ISM_FORMAT ) ) { // 100861_dirac_dec -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING ivas_dirac_config_bands_fx( band_grouping, IVAS_MAX_NUM_BANDS, (Word16) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), dirac_to_spar_md_bands, hQMetaData->useLowerBandRes, hConfig->enc_param_start_band, hFbMdft, 1 ); -#else - ivas_dirac_config_bands_fx( band_grouping, IVAS_MAX_NUM_BANDS, (Word16) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), dirac_to_spar_md_bands, hQMetaData->useLowerBandRes, hConfig->enc_param_start_band, hFbMdft ); -#endif } ELSE { -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING ivas_dirac_config_bands_fx( band_grouping, hConfig->nbands, (Word16) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), NULL, 0, 0, hFbMdft, 1 ); -#else - ivas_dirac_config_bands_fx( band_grouping, hConfig->nbands, (Word16) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), NULL, 0, 0, hFbMdft ); -#endif } return error; @@ -248,26 +240,15 @@ ivas_error ivas_dirac_config_fx( * DirAC Configuration freq. band function; used also in MASA decoder *------------------------------------------------------------------------*/ -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING void ivas_dirac_config_bands_fx( - Word16 *band_grouping, /* o : band grouping */ - const Word16 nbands, /* i : number of bands */ - const Word16 max_band, /* i : maximal band index +1 */ - Word16 *dirac_to_spar_md_bands, /* o : mapping of DirAC parameter band index to SPAR FB band index */ - const Word8 useLowerBandRes, /* i : flag indicating lower band resolution for DirAC */ - const Word16 enc_param_start_band, /* i : band index of first DirAC parameter band */ + Word16 *band_grouping, /* o : band grouping */ + const Word16 nbands, /* i : number of bands */ + const Word16 max_band, /* i : maximal band index +1 */ + Word16 *dirac_to_spar_md_bands, /* o : mapping of DirAC parameter band index to SPAR FB band index */ + const Word8 useLowerBandRes, /* i : flag indicating lower band resolution for DirAC */ + const Word16 enc_param_start_band, /* i : band index of first DirAC parameter band */ IVAS_FB_MIXER_HANDLE hFbMdft, const Word8 BandGroupLowRes ) -#else -void ivas_dirac_config_bands_fx( - Word16 *band_grouping, /* o : band grouping */ - const Word16 nbands, /* i : number of bands */ - const Word16 max_band, /* i : maximal band index +1 */ - Word16 *dirac_to_spar_md_bands, - const Word8 useLowerBandRes, - const Word16 enc_param_start_band, - IVAS_FB_MIXER_HANDLE hFbMdft ) -#endif { Word16 i; { @@ -327,9 +308,8 @@ void ivas_dirac_config_bands_fx( Word16 step = DIRAC_LOW_BANDRES_STEP; move16(); Word16 reduced_band; -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + IF( BandGroupLowRes ) -#endif { FOR( ( band = enc_param_start_band + 2, reduced_band = enc_param_start_band + 1 ); band <= DIRAC_MAX_NBANDS; ( band += step, reduced_band++ ) ) { @@ -377,6 +357,8 @@ void ivas_dirac_config_bands_fx( return; } + + /*-------------------------------------------------------------------* * ivas_get_dirac_sba_max_md_bits() * diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index e02b5a4de447e03645e0540fbb98f6b6a7b1389d..890f4c8fa3d5e913d0b5e5e34b6845d2f5277a51 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -3903,13 +3903,6 @@ ivas_error ivas_td_binaural_open_fx( Word16 *SrcInd, /*Temporarily used to store the updated value of SrcInd*/ Word16 *num_src ); -#ifndef FIX_910_REMOVE_DUPLICATION_TD_REND -ivas_error ivas_td_binaural_renderer_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - Word32 *output[], /* i/o: SCE channels / Binaural synthesis */ - const Word16 output_frame /* i : output frame length */ -); -#endif ivas_error ivas_td_binaural_renderer_sf_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ @@ -5003,7 +4996,6 @@ void ivas_sba2mc_cldfb_fixed( const Word32 *hoa_dec_mtx /* i : HOA decoding mtx */ ); -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING void ivas_dirac_config_bands_fx( Word16 *band_grouping, /* o : band grouping */ const Word16 nbands, /* i : number of bands */ @@ -5013,16 +5005,6 @@ void ivas_dirac_config_bands_fx( const Word16 enc_param_start_band, /* i : band index of first DirAC parameter band */ IVAS_FB_MIXER_HANDLE hFbMdft, const Word8 BandGroupLowRes ); -#else -void ivas_dirac_config_bands_fx( - Word16 *band_grouping, /* o : band grouping */ - const Word16 nbands, /* i : number of bands */ - const Word16 max_band, /* i : maximal band index +1 */ - Word16 *dirac_to_spar_md_bands, /* o : mapping of DirAC parameter band index to SPAR FB band index */ - const Word8 useLowerBandRes, /* i : flag indicating lower band resolution for DirAC */ - const Word16 enc_param_start_band, /* i : band index of first DirAC parameter band */ - IVAS_FB_MIXER_HANDLE hFbMdft ); -#endif void ivas_dirac_dec_close_fx( DIRAC_DEC_HANDLE *hDirAC_out ); diff --git a/lib_com/options.h b/lib_com/options.h index 508049524424f56a56bf88655360629d3c8e71ff..a20bbcbc3d58b2edcead84c39eba283084e38a1c 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -183,12 +183,6 @@ #define FIX_1372_ISAR_POST_REND #endif #define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ -#define NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING /* Dlb: issue 907: fix for band mapping at VLBR */ -#define NONBE_FIX_869_MASA_PREREND_MERGE /* Nokia: issue: #869: MASA pre-rend not updating energy */ -#define FIX_910_REMOVE_DUPLICATION_TD_REND /* VA: issue 910: remove duplication of function ivas_td_binaural_renderer() */ -#define FIX_940_DEBUGGING_VARIABLE /* Nokia: issue #940: remove debugging variable */ -#define NONBE_FIX_931_IGF_STEREO_DEC_NOISE /* FhG: issue #931: fix noise substitution in the stereo IGF decoder */ -#define FIX_CRASH_LONG_BRIR /* Orange : port 1202 Fix crash when long BRIR is set */ #define NONBE_FIX_943_RECONFIG_IGF_AFTER_SETTING_BW /* FhG: issue 943: fix crash in BW switchin from WB in MDCT-Stereo core encoder */ #define FIX_911_REMOVE_CREND_DUPLICATION /* VA: issue 911: resolve duplication of CRend binaural external renderer function */ #define FIX_938_GCC_12_WARNINGS /* VA: issue #938: remove set_f(.,.,0) call in which length is always 0 to remove GCC 12.0 warning */ diff --git a/lib_dec/igf_dec_fx.c b/lib_dec/igf_dec_fx.c index c39c69752c872817795adfb58e2d11281467f17d..efb00234e7403de53c1953c094fb709103ba7be9 100644 --- a/lib_dec/igf_dec_fx.c +++ b/lib_dec/igf_dec_fx.c @@ -964,7 +964,6 @@ static void IGF_prepStereo( { IF( hPrivateDataL->n_noise_bands_off ) { -#ifdef NONBE_FIX_931_IGF_STEREO_DEC_NOISE IGF_replaceTCXNoise_2_new_ivas( src_specL_fx, src_specL_e, TCXNoiseL, @@ -974,17 +973,6 @@ static void IGF_prepStereo( hPrivateDataL->totalNoiseNrg_off_exp, hPrivateDataL->n_noise_bands_off, hInfoL->nfSeed ); -#else - IGF_replaceTCXNoise_2_new_ivas_with_var_shift( igf_specL_fx, - igf_specL_e_arr, - TCXNoiseL, - strt_cpy, - stop, - hPrivateDataL->totalNoiseNrg_off, - hPrivateDataL->totalNoiseNrg_off_exp, - hPrivateDataL->n_noise_bands_off, - hInfoL->nfSeed ); -#endif } selectionL = 1; move16(); @@ -1011,7 +999,6 @@ static void IGF_prepStereo( { IF( hPrivateDataR->n_noise_bands_off ) { -#ifdef NONBE_FIX_931_IGF_STEREO_DEC_NOISE IGF_replaceTCXNoise_2_new_ivas( src_specR_fx, src_specR_e, TCXNoiseR, @@ -1021,17 +1008,6 @@ static void IGF_prepStereo( hPrivateDataR->totalNoiseNrg_off_exp, hPrivateDataR->n_noise_bands_off, hInfoR->nfSeed ); -#else - IGF_replaceTCXNoise_2_new_ivas_with_var_shift( igf_specR_fx, - igf_specR_e_arr, - TCXNoiseR, - strt_cpy, - stop, - hPrivateDataR->totalNoiseNrg_off, - hPrivateDataR->totalNoiseNrg_off_exp, - hPrivateDataR->n_noise_bands_off, - hInfoR->nfSeed ); -#endif } selectionR = 1; move16(); @@ -1153,7 +1129,6 @@ static void IGF_prepStereo( { IF( hPrivateDataL->n_noise_bands_off ) { -#ifdef NONBE_FIX_931_IGF_STEREO_DEC_NOISE IGF_replaceTCXNoise_2_new_ivas( src_specL_fx, src_specL_e, TCXNoiseL, @@ -1163,17 +1138,6 @@ static void IGF_prepStereo( hPrivateDataL->totalNoiseNrg_off_exp, hPrivateDataL->n_noise_bands_off, hInfoL->nfSeed ); -#else - IGF_replaceTCXNoise_2_new_ivas_with_var_shift( igf_specL_fx, - igf_specL_e_arr, - TCXNoiseL, - strt_cpy, - stop, - hPrivateDataL->totalNoiseNrg_off, - hPrivateDataL->totalNoiseNrg_off_exp, - hPrivateDataL->n_noise_bands_off, - hInfoL->nfSeed ); -#endif } selectionL = 1; move16(); @@ -1200,7 +1164,6 @@ static void IGF_prepStereo( { IF( hPrivateDataR->n_noise_bands_off ) { -#ifdef NONBE_FIX_931_IGF_STEREO_DEC_NOISE IGF_replaceTCXNoise_2_new_ivas( src_specR_fx, src_specR_e, TCXNoiseR, @@ -1210,17 +1173,6 @@ static void IGF_prepStereo( hPrivateDataR->totalNoiseNrg_off_exp, hPrivateDataR->n_noise_bands_off, hInfoR->nfSeed ); -#else - IGF_replaceTCXNoise_2_new_ivas_with_var_shift( igf_specR_fx, - igf_specR_e_arr, - TCXNoiseR, - strt_cpy, - stop, - hPrivateDataR->totalNoiseNrg_off, - hPrivateDataR->totalNoiseNrg_off_exp, - hPrivateDataR->n_noise_bands_off, - hInfoR->nfSeed ); -#endif } selectionR = 1; move16(); diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index e113181570ea3a7df1b5df97d007dd4413e7420a..67af183d07d6c75bde50da560fa09eb4da61b6c1 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -1624,11 +1624,9 @@ void ivas_qmetadata_to_dirac_fx( move16(); hDirAC->hConfig->nbands = 5; move16(); -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + ivas_dirac_config_bands_fx( hDirAC->band_grouping, hDirAC->hConfig->nbands, nbands, NULL, 0, 0, NULL, 1 ); -#else - ivas_dirac_config_bands_fx( hDirAC->band_grouping, hDirAC->hConfig->nbands, nbands, NULL, 0, 0, NULL ); -#endif + nbands = 5; move16(); } @@ -1647,11 +1645,8 @@ void ivas_qmetadata_to_dirac_fx( move16(); } -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING ivas_dirac_config_bands_fx( hDirAC->band_grouping, hDirAC->hConfig->nbands, nbands, dirac_to_spar_md_bands, hQMetaData->useLowerBandRes, hDirAC->hConfig->enc_param_start_band, hDirAC->hFbMdft, 0 ); -#else - ivas_dirac_config_bands_fx( hDirAC->band_grouping, hDirAC->hConfig->nbands, nbands, dirac_to_spar_md_bands, hQMetaData->useLowerBandRes, hDirAC->hConfig->enc_param_start_band, hDirAC->hFbMdft ); -#endif + nbands = hDirAC->hConfig->nbands; move16(); if ( hQMetaData->q_direction[0].cfg.nblocks == 0 ) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 964b00ddc1c224b267d030463692235a56645b85..ed716f743231402ff7ea9a0403aa7f9144b7d0d3 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1560,6 +1560,7 @@ ivas_error ivas_init_decoder_fx( st_ivas->hSpar->enc_param_start_band = s_min( IVAS_MAX_NUM_BANDS, SPAR_DIRAC_SPLIT_START_BAND ); move16(); + IF( ivas_get_hodirac_flag_fx( ivas_total_brate, st_ivas->sba_analysis_order ) ) { st_ivas->hSpar->enc_param_start_band = 0; @@ -1569,16 +1570,13 @@ ivas_error ivas_init_decoder_fx( move16(); } -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING ivas_dirac_config_bands_fx( band_grouping, IVAS_MAX_NUM_BANDS, extract_l( Mpy_32_32_r( st_ivas->hDecoderConfig->output_Fs, INV_CLDFB_BANDWIDTH_Q31 ) ), st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0, 1 ); -#else - ivas_dirac_config_bands_fx( band_grouping, IVAS_MAX_NUM_BANDS, extract_l( Mpy_32_32_r( st_ivas->hDecoderConfig->output_Fs, INV_CLDFB_BANDWIDTH_Q31 ) ), - st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); -#endif } + st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas ); move16(); + FOR( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) { Word32 res_dec, res_frac; @@ -1764,13 +1762,8 @@ ivas_error ivas_init_decoder_fx( move16(); } -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING ivas_dirac_config_bands_fx( band_grouping, IVAS_MAX_NUM_BANDS, extract_l( Mpy_32_32_r( st_ivas->hDecoderConfig->output_Fs, INV_CLDFB_BANDWIDTH_Q31 ) ), st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0, 1 ); -#else - ivas_dirac_config_bands_fx( band_grouping, IVAS_MAX_NUM_BANDS, extract_l( Mpy_32_32_r( st_ivas->hDecoderConfig->output_Fs, INV_CLDFB_BANDWIDTH_Q31 ) ), - st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); -#endif } FOR( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 69bd07c0effbb53b7fdac3588bbadf365b79f682..f0c56503b8e0341fef2f79c497321efca5720916 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2495,17 +2495,6 @@ ivas_error ivas_jbm_dec_render_fx( { ivas_mc2sba_fx( st_ivas->hIntSetup, p_output_fx, p_output_fx, *nSamplesRendered, st_ivas->hOutSetup.ambisonics_order, 0 ); } -#ifndef FIX_910_REMOVE_DUPLICATION_TD_REND - ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) ) - { - IF( NE_32( ( error = ivas_td_binaural_renderer_fx( st_ivas, p_output_fx, *nSamplesRendered ) ), IVAS_ERR_OK ) ) - { - return error; - } - - ivas_binaural_add_LFE_fx( st_ivas, *nSamplesRendered, p_output_fx, p_output_fx ); - } -#endif } ELSE IF( EQ_32( st_ivas->mc_mode, MC_MODE_PARAMMC ) ) { diff --git a/lib_dec/ivas_objectRenderer_internal_fx.c b/lib_dec/ivas_objectRenderer_internal_fx.c index a13358597d6ca6ab6b678c34eea8bf4a5de23dc3..71b16a6c6f6b9c59b7a8e00ee6247e8889688d97 100644 --- a/lib_dec/ivas_objectRenderer_internal_fx.c +++ b/lib_dec/ivas_objectRenderer_internal_fx.c @@ -62,51 +62,6 @@ ivas_error ivas_td_binaural_open_fx( return ivas_td_binaural_open_unwrap_fx( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, *num_src, st_ivas->ivas_format, st_ivas->transport_config, st_ivas->hRenderConfig->directivity_fx, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns, SrcInd ); } -#ifndef FIX_910_REMOVE_DUPLICATION_TD_REND -/*---------------------------------------------------------------------* - * ivas_td_binaural_renderer() - * - * Receives the current frames for the object streams, updates metadata - * and renders the current frame. - *---------------------------------------------------------------------*/ - -ivas_error ivas_td_binaural_renderer_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - Word32 *output[], /* i/o: SCE channels / Binaural synthesis Q11*/ - const Word16 output_frame /* i : output frame length */ -) -{ - Word16 ism_md_subframe_update; - Word16 nchan_transport; - test(); - IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) || EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) ) - { - nchan_transport = st_ivas->nchan_ism; - } - ELSE - { - nchan_transport = st_ivas->nchan_transport; - } - move16(); - - IF( st_ivas->hDecoderConfig->Opt_delay_comp ) - { - ism_md_subframe_update = 1; - } - ELSE - { - ism_md_subframe_update = 2; - } - move16(); - - if ( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) - { - ism_md_subframe_update = 2; - move16(); - } - return ivas_td_binaural_renderer_unwrap_fx( st_ivas->hReverb, st_ivas->transport_config, st_ivas->hBinRendererTd, nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, st_ivas->hIsmMetaData, st_ivas->hCombinedOrientationData, ism_md_subframe_update, output, output_frame, MAX_PARAM_SPATIAL_SUBFRAMES ); -} -#endif /*---------------------------------------------------------------------* * ivas_td_binaural_renderer_sf() diff --git a/lib_dec/ivas_output_config_fx.c b/lib_dec/ivas_output_config_fx.c index ca6a9a700cb86b655c3a57be42c7127b6da6fb4d..9d8a592e0f0524766a6da4a77db6ea0474013d5e 100644 --- a/lib_dec/ivas_output_config_fx.c +++ b/lib_dec/ivas_output_config_fx.c @@ -247,12 +247,7 @@ void ivas_renderer_select( test(); test(); test(); -#ifdef FIX_910_REMOVE_DUPLICATION_TD_REND IF( ( EQ_32( st_ivas->transport_config, IVAS_AUDIO_CONFIG_5_1 ) || EQ_32( st_ivas->transport_config, IVAS_AUDIO_CONFIG_7_1 ) ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && EQ_32( st_ivas->mc_mode, MC_MODE_MCT ) ) -#else - test(); - IF( ( EQ_32( st_ivas->transport_config, IVAS_AUDIO_CONFIG_5_1 ) || EQ_32( st_ivas->transport_config, IVAS_AUDIO_CONFIG_7_1 ) ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && ( EQ_32( st_ivas->mc_mode, MC_MODE_MCT ) || EQ_32( st_ivas->mc_mode, MC_MODE_PARAMUPMIX ) ) ) -#endif { *renderer_type = RENDERER_BINAURAL_OBJECTS_TD; move16(); diff --git a/lib_dec/ivas_qmetadata_dec_fx.c b/lib_dec/ivas_qmetadata_dec_fx.c index e1c3ee726499c164ee36dcdba993491de1e0db5b..c9d9bc2cb2918d6248916e43353031b2b48804ea 100644 --- a/lib_dec/ivas_qmetadata_dec_fx.c +++ b/lib_dec/ivas_qmetadata_dec_fx.c @@ -4646,21 +4646,13 @@ static void read_stream_dct_coeffs_omasa_fx( Word16 *index, /*Q0*/ const Word16 first_line /*Q0*/ ) { -#ifdef FIX_940_DEBUGGING_VARIABLE Word16 sign; -#else - Word16 sign, nbits; -#endif Word16 i, j, i_min; - Word32 step; Word16 GR1, GR2; step = STEP_M2T_FX; move32(); -#ifndef FIX_940_DEBUGGING_VARIABLE - nbits = 0; -#endif move16(); sign = 1; move16(); @@ -4674,9 +4666,6 @@ static void read_stream_dct_coeffs_omasa_fx( sign = -1; move16(); } -#ifndef FIX_940_DEBUGGING_VARIABLE - nbits = add( nbits, 1 ); -#endif } set16_fx( q_idx, 0, len_stream ); @@ -4702,9 +4691,7 @@ static void read_stream_dct_coeffs_omasa_fx( { i_min = extract_l( L_add( shl( i_min, 1 ), bit_stream[( *index )--] ) ); /*Q0*/ } -#ifndef FIX_940_DEBUGGING_VARIABLE - nbits = add( nbits, j ); -#endif + /* read GR orders */ GR1 = extract_l( L_add( bit_stream[( *index )--], 1 ) ); /*Q0*/ IF( EQ_16( GR1, 2 ) ) diff --git a/lib_dec/ivas_sba_dec_fx.c b/lib_dec/ivas_sba_dec_fx.c index 7f6c4f287c16cc8f305705e96c7f63a9dfc86456..abc275e9001210ad4081aa0d4fd1d999282ed5c6 100644 --- a/lib_dec/ivas_sba_dec_fx.c +++ b/lib_dec/ivas_sba_dec_fx.c @@ -484,13 +484,8 @@ ivas_error ivas_sba_dec_reconfigure_fx( move16(); } -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING ivas_dirac_config_bands_fx( band_grouping, IVAS_MAX_NUM_BANDS, (Word16) ( L_add( st_ivas->hDecoderConfig->output_Fs, 400 ) / CLDFB_BANDWIDTH ), st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0, 1 ); -#else - ivas_dirac_config_bands_fx( band_grouping, IVAS_MAX_NUM_BANDS, (Word16) ( L_add( st_ivas->hDecoderConfig->output_Fs, 400 ) / CLDFB_BANDWIDTH ), - st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); -#endif if ( st_ivas->hDirAC ) { diff --git a/lib_enc/ivas_spar_md_enc_fx.c b/lib_enc/ivas_spar_md_enc_fx.c index 83cb25990d0d45dc5fd948ea164eef4991e2a21a..63f1f344550d85dd552142c675b3b5c769fd4e0a 100644 --- a/lib_enc/ivas_spar_md_enc_fx.c +++ b/lib_enc/ivas_spar_md_enc_fx.c @@ -486,10 +486,8 @@ ivas_error ivas_spar_md_enc_process_fx( Word16 max_num_indices_tmp; Word32 Wscale_fx[IVAS_MAX_NUM_BANDS]; Word16 q_Wscale[IVAS_MAX_NUM_BANDS]; -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING Word32 P_quant_re_prior[SPAR_DIRAC_SPLIT_START_BAND][FOA_CHANNELS - 1]; Word16 Q_P_quant_re_prior[SPAR_DIRAC_SPLIT_START_BAND]; -#endif /*extra 16 bits for arithmetic coder as overshoot check is after a symbol is written*/ md_indices_allocated = add( hMdEnc->spar_md_cfg.max_bits_per_blk, IVAS_SPAR_ARITH_OVERSHOOT_BITS ); @@ -604,6 +602,7 @@ ivas_error ivas_spar_md_enc_process_fx( bands_bw = 1; move16(); } + test(); IF( hMdEnc->spar_hoa_md_flag && hMdEnc->spar_hoa_dirac2spar_md_flag ) { @@ -617,7 +616,6 @@ ivas_error ivas_spar_md_enc_process_fx( } } -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING IF( LT_32( hEncoderConfig->ivas_total_brate, IVAS_24k4 ) ) { FOR( b = 0; b < i_mult( num_bands, bands_bw ); b++ ) @@ -626,7 +624,6 @@ ivas_error ivas_spar_md_enc_process_fx( Q_P_quant_re_prior[b] = hMdEnc->spar_md.band_coeffs[b].q_P_re_fx; } } -#endif ivas_compute_spar_params_enc_fx( cov_real_fx, cov_real_q, dm_fv_re_fx, &q_dm_fv_re, 0, hMdEnc->mixer_mat_fx, &hMdEnc->q_mixer_mat_fx, 0, nB, dtx_vad, num_ch, bands_bw, active_w, active_w_vlbr, &hMdEnc->spar_md_cfg, &hMdEnc->spar_md, Wscale_fx, q_Wscale, 0, dyn_active_w_flag ); @@ -961,8 +958,8 @@ ivas_error ivas_spar_md_enc_process_fx( *q_prior_mixer = hMdEnc->q_mixer_mat_fx; move16(); } + /* Reuse mixer matrix values for unsent bands */ -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING IF( LT_32( hEncoderConfig->ivas_total_brate, IVAS_24k4 ) ) { FOR( k = num_bands - 1; k >= 0; k-- ) @@ -975,7 +972,7 @@ ivas_error ivas_spar_md_enc_process_fx( } } } -#endif + test(); IF( ( LT_32( hEncoderConfig->ivas_total_brate, IVAS_24k4 ) ) && GT_16( code_strat, 3 ) ) { @@ -986,6 +983,7 @@ ivas_error ivas_spar_md_enc_process_fx( { b = add( b, 2 ); } + FOR( i = 0; i < 1; i++ ) { FOR( j = 0; j < 4; j++ ) @@ -996,14 +994,13 @@ ivas_error ivas_spar_md_enc_process_fx( move32(); } } -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + Copy32( P_quant_re_prior[b], hMdEnc->spar_md.band_coeffs[b].P_quant_re_fx, sub( FOA_CHANNELS, 1 ) ); Copy32( P_quant_re_prior[b + 1], hMdEnc->spar_md.band_coeffs[b + 1].P_quant_re_fx, sub( FOA_CHANNELS, 1 ) ); hMdEnc->spar_md.band_coeffs[b].q_P_re_fx = Q_P_quant_re_prior[b]; hMdEnc->spar_md.band_coeffs[b + 1].q_P_re_fx = Q_P_quant_re_prior[b + 1]; move16(); move16(); -#endif } } @@ -1018,6 +1015,8 @@ ivas_error ivas_spar_md_enc_process_fx( return IVAS_ERR_OK; } + + /*-----------------------------------------------------------------------------------------* * Function ivas_band_mixer() * diff --git a/lib_rend/ivas_crend_fx.c b/lib_rend/ivas_crend_fx.c index a00bccf2129daf8729e09ab34ae35ca696880376..f265b0ac7130618d3424317de30cde3c1cf514af 100644 --- a/lib_rend/ivas_crend_fx.c +++ b/lib_rend/ivas_crend_fx.c @@ -1531,11 +1531,7 @@ ivas_error ivas_rend_openCrend( ) { Word16 i, subframe_length; -#ifdef FIX_CRASH_LONG_BRIR Word32 max_total_ir_len; -#else - Word16 max_total_ir_len; -#endif HRTFS_HANDLE hHrtf; CREND_HANDLE hCrend; ivas_error error; @@ -1578,11 +1574,7 @@ ivas_error ivas_rend_openCrend( IF( hHrtf != NULL ) { -#ifdef FIX_CRASH_LONG_BRIR max_total_ir_len = L_mult0( hHrtf->max_num_iterations, subframe_length ); -#else - max_total_ir_len = imult1616( hHrtf->max_num_iterations, subframe_length ); -#endif FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { @@ -1590,20 +1582,13 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_CRASH_LONG_BRIR set_zero2_fx( hCrend->freq_buffer_re_fx[i], max_total_ir_len ); -#else - set_zero_fx( hCrend->freq_buffer_re_fx[i], max_total_ir_len ); -#endif + IF( ( hCrend->freq_buffer_im_fx[i] = (Word32 *) malloc( sizeof( Word32 ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_CRASH_LONG_BRIR set_zero2_fx( hCrend->freq_buffer_im_fx[i], max_total_ir_len ); -#else - set_zero_fx( hCrend->freq_buffer_im_fx[i], max_total_ir_len ); -#endif } FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) @@ -1615,11 +1600,7 @@ ivas_error ivas_rend_openCrend( set_zero_fx( hCrend->prev_out_buffer_fx[i], subframe_length ); } -#ifdef FIX_CRASH_LONG_BRIR max_total_ir_len = L_mult0( (Word16) hHrtf->num_iterations_diffuse[0], subframe_length ); -#else - max_total_ir_len = imult1616( (Word16) hHrtf->num_iterations_diffuse[0], subframe_length ); -#endif IF( max_total_ir_len > 0 ) { @@ -1627,20 +1608,13 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_CRASH_LONG_BRIR set_zero2_fx( hCrend->freq_buffer_re_diffuse_fx, max_total_ir_len ); -#else - set_zero_fx( hCrend->freq_buffer_re_diffuse_fx, max_total_ir_len ); -#endif + IF( ( hCrend->freq_buffer_im_diffuse_fx = (Word32 *) malloc( sizeof( Word32 ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_CRASH_LONG_BRIR set_zero2_fx( hCrend->freq_buffer_im_diffuse_fx, max_total_ir_len ); -#else - set_zero_fx( hCrend->freq_buffer_im_diffuse_fx, max_total_ir_len ); -#endif } ELSE { @@ -1655,11 +1629,7 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_CRASH_LONG_BRIR set_zero2_fx( hCrend->lfe_delay_line_fx, max_total_ir_len ); -#else - set_zero_fx( hCrend->lfe_delay_line_fx, max_total_ir_len ); -#endif } ELSE { @@ -1902,12 +1872,8 @@ static ivas_error ivas_rend_crendConvolver( Word16 i, j, k, m; Word16 subframe_length, idx_in; Word16 lfe_idx_in; -#ifdef FIX_CRASH_LONG_BRIR Word32 offset, offset_in, offset_diffuse; Word16 index_in; -#else - Word16 offset, offset_in, offset_diffuse; -#endif Word16 nchan_in, nchan_out; const Word32 *pIn; Word32 *pFreq_buf_re, *pFreq_buf_im; @@ -1918,7 +1884,6 @@ static ivas_error ivas_rend_crendConvolver( CREND_HANDLE hCrend; ivas_error error; - #ifdef SPLIT_REND_WITH_HEAD_ROT hCrend = pCrend->hCrend[pos_idx]; #else @@ -1953,13 +1918,8 @@ static ivas_error ivas_rend_crendConvolver( } } -#ifdef FIX_CRASH_LONG_BRIR offset = L_mult0( hCrend->delay_line_rw_index, subframe_length ); /* subframe_length * ( pCrend->hHrtfCrend->max_num_iterations - 1 ); */ offset_diffuse = L_mult0( hCrend->diffuse_delay_line_rw_index, subframe_length ); /* subframe_length *( pCrend->hHrtfCrend->num_iterations_diffuse[0] - 1 ); */ -#else - offset = imult1616( hCrend->delay_line_rw_index, subframe_length ); /* subframe_length * ( pCrend->hHrtfCrend->max_num_iterations - 1 ); */ - offset_diffuse = imult1616( hCrend->diffuse_delay_line_rw_index, subframe_length ); /* subframe_length *( pCrend->hHrtfCrend->num_iterations_diffuse[0] - 1 ); */ -#endif IF( pCrend->hHrtfCrend->num_iterations_diffuse[0] > 0 ) { @@ -2016,17 +1976,11 @@ static ivas_error ivas_rend_crendConvolver( move16(); FOR( m = 0; m < pCrend->hHrtfCrend->num_iterations[i][j]; m++ ) { -#ifdef FIX_CRASH_LONG_BRIR index_in = add( add( hCrend->delay_line_rw_index, sub( pCrend->hHrtfCrend->max_num_iterations, pCrend->hHrtfCrend->num_iterations[i][j] ) ), add( m, 1 ) ); index_in = index_in % ( pCrend->hHrtfCrend->max_num_iterations ); move16(); offset_in = L_mult0( index_in, subframe_length ); -#else - offset_in = add( add( hCrend->delay_line_rw_index, sub( pCrend->hHrtfCrend->max_num_iterations, pCrend->hHrtfCrend->num_iterations[i][j] ) ), add( m, 1 ) ); - offset_in = offset_in % ( pCrend->hHrtfCrend->max_num_iterations ); - move16(); - offset_in = imult1616( offset_in, subframe_length ); -#endif + pFreq_buf_re = &hCrend->freq_buffer_re_fx[i][offset_in]; // Qx pFreq_buf_im = &hCrend->freq_buffer_im_fx[i][offset_in]; // Qx pFreq_filt_re = &pCrend->hHrtfCrend->pOut_to_bin_re_fx[i][j][offset]; // Q29 @@ -2039,11 +1993,8 @@ static ivas_error ivas_rend_crendConvolver( move32(); move32(); } -#ifdef FIX_CRASH_LONG_BRIR + offset = L_add( offset, k ); -#else - offset = add( offset, k ); -#endif } i = add( i, 1 ); } @@ -2053,17 +2004,11 @@ static ivas_error ivas_rend_crendConvolver( move16(); FOR( m = 0; m < pCrend->hHrtfCrend->num_iterations_diffuse[j]; m++ ) { -#ifdef FIX_CRASH_LONG_BRIR index_in = add( hCrend->diffuse_delay_line_rw_index, add( m, 1 ) ); index_in = index_in % pCrend->hHrtfCrend->num_iterations_diffuse[0]; move16(); offset_diffuse = L_mult0( index_in, subframe_length ); -#else - offset_diffuse = add( hCrend->diffuse_delay_line_rw_index, add( m, 1 ) ); - offset_diffuse = offset_diffuse % pCrend->hHrtfCrend->num_iterations_diffuse[0]; - move16(); - offset_diffuse = imult1616( offset_diffuse, subframe_length ); -#endif + pFreq_buf_re = &hCrend->freq_buffer_re_diffuse_fx[offset_diffuse]; // Qx pFreq_buf_im = &hCrend->freq_buffer_im_diffuse_fx[offset_diffuse]; // Qx pFreq_filt_re = &pCrend->hHrtfCrend->pOut_to_bin_diffuse_re_fx[j][offset]; // Q31 @@ -2075,13 +2020,8 @@ static ivas_error ivas_rend_crendConvolver( move32(); move32(); } -#ifdef FIX_CRASH_LONG_BRIR offset = L_add( offset, k ); move32(); -#else - offset = add( offset, k ); - move16(); -#endif } ivas_imdft_fx( tmp_out_re, tmp_out_im, pOut, subframe_length ); diff --git a/lib_rend/ivas_masa_merge_fx.c b/lib_rend/ivas_masa_merge_fx.c index d5c5356e2ec8e08e970b2ca7b4e316cdf7242f1e..a3a74bc7d283ed5649921d4c05d307a0c55c9a6a 100644 --- a/lib_rend/ivas_masa_merge_fx.c +++ b/lib_rend/ivas_masa_merge_fx.c @@ -141,7 +141,6 @@ void copy_masa_descriptive_meta_fx( *---------------------------------------------------------------------*/ void diffuse_meta_merge_1x1_fx( -#ifdef NONBE_FIX_869_MASA_PREREND_MERGE MASA_DECODER_EXT_OUT_META_HANDLE outMeta, /* o : Merged metadata output */ MASA_DECODER_EXT_OUT_META_HANDLE inMeta, /* i : Input metadata 1 */ Word32 inEne_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o: TF-energy of input 1. energy after merge */ @@ -149,15 +148,6 @@ void diffuse_meta_merge_1x1_fx( MASA_DECODER_EXT_OUT_META_HANDLE inMetaISM, /* i : Input metadata 2 */ Word32 inEneISM_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i : TF-energy of input 2 */ Word16 *inEneISM_e /* i : TF-energy of input 2 Exponent */ -#else - MASA_DECODER_EXT_OUT_META_HANDLE outMeta, /* o : Merged metadata output */ - MASA_DECODER_EXT_OUT_META_HANDLE inMeta, /* i : Input metadata 1 */ - Word32 inEne_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i : TF-energy of input 1 */ - Word16 *inEne_e, /* i : TF-energy of input 1 Exponent */ - MASA_DECODER_EXT_OUT_META_HANDLE inMetaISM, /* i : Input metadata 2 */ - Word32 inEneISM_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i : TF-energy of input 2 */ - Word16 *inEneISM_e /* i : TF-energy of input 2 Exponent */ -#endif ) { Word8 sf, band; @@ -442,7 +432,6 @@ void full_stream_merge_fx( *---------------------------------------------------------------------*/ void ivas_prerend_merge_masa_metadata_fx( -#ifdef NONBE_FIX_869_MASA_PREREND_MERGE MASA_DECODER_EXT_OUT_META_HANDLE outMeta, /* o : Merged metadata output */ MASA_DECODER_EXT_OUT_META_HANDLE inMeta1, /* i : Input metadata 1 */ IVAS_REND_AudioConfigType inType1, /* i : Type of input 1 */ @@ -452,17 +441,6 @@ void ivas_prerend_merge_masa_metadata_fx( IVAS_REND_AudioConfigType inType2, /* i : Type of input 2 */ Word32 inEne2_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i : TF-energy of input 2. may be altered */ Word16 *inEne2_e /* i : TF-energy of input 2 Exponent */ -#else - MASA_DECODER_EXT_OUT_META_HANDLE outMeta, /* o : Merged metadata output */ - MASA_DECODER_EXT_OUT_META_HANDLE inMeta1, /* i : Input metadata 1 */ - IVAS_REND_AudioConfigType inType1, /* i : Type of input 1 */ - Word32 inEne1_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o: TF-energy of input 1. after merge, contains the energy of the merged signal */ - Word16 *inEne1_e, /* i/o: TF-energy of input 1 Exponent */ - MASA_DECODER_EXT_OUT_META_HANDLE inMeta2, /* i : Input metadata 2 */ - IVAS_REND_AudioConfigType inType2, /* i : Type of input 2 */ - Word32 inEne2_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i : TF-energy of input 2 */ - Word16 *inEne2_e /* i : TF-energy of input 2 Exponent */ -#endif ) { /* mixing ISMs with non-ISM use different merge */ @@ -475,7 +453,6 @@ void ivas_prerend_merge_masa_metadata_fx( IF( EQ_32( inType1, IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED ) && NE_32( inType2, IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED ) && ( inMeta1->descriptiveMeta.numberOfDirections == 0u && inMeta2->descriptiveMeta.numberOfDirections == 0u ) ) { /* meta_1 is ISM and both are 1dir */ -#ifdef NONBE_FIX_869_MASA_PREREND_MERGE Word8 sf; diffuse_meta_merge_1x1_fx( outMeta, inMeta2, inEne2_fx, inEne2_e, inMeta1, inEne1_fx, inEne1_e ); /* post-merge energy is now in inEne2 and needs to be copied to inEne1 */ @@ -486,10 +463,6 @@ void ivas_prerend_merge_masa_metadata_fx( } *inEne1_e = *inEne2_e; move16(); - -#else - diffuse_meta_merge_1x1_fx( outMeta, inMeta2, inEne2_fx, inEne2_e, inMeta1, inEne1_fx, inEne1_e ); -#endif } ELSE IF( EQ_32( inType2, IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED ) && NE_32( inType1, IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED ) && ( inMeta1->descriptiveMeta.numberOfDirections == 0u && inMeta2->descriptiveMeta.numberOfDirections == 0u ) ) {