diff --git a/apps/decoder.c b/apps/decoder.c index 1310ef4d865b0f14d65e4fa942a1e53a51897b62..176ea7c75105c92371b9a55e4312fad368ddb3b9 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1800,10 +1800,8 @@ static void usage_dec( void ) fprintf( stdout, " output configuration. ID1, ID2, ID3, ID4 specify the directivity pattern IDs used for\n" ); fprintf( stdout, " ISMs 1,2,3 and 4 respectively. This options needs to be accompanied by a render_config file,\n" ); fprintf( stdout, " otherwise a default directivity pattern is used.\n" ); - fprintf( stdout, "-aeid ID : Acoustic environment ID (number > 0) or\n" ); - fprintf( stdout, " a sequence thereof in the format [ID1:duration1,ID2:duration2...]\n" ); - fprintf( stdout, " without braces and spaces, with ':' character separating ID from duration and ',' separating\n" ); - fprintf( stdout, " ID and duration pairs, where duration is specified in frames\n" ); + fprintf( stdout, "-aeid ID | File : Acoustic environment ID (number > 0)\n" ); + fprintf( stdout, " alternatively, it can be a text file where each line contains \"ID duration\"\n" ); fprintf( stdout, " for BINAURAL_ROOM_REVERB output configuration.\n" ); fprintf( stdout, "-obj_edit File : Object editing instructions file or NULL for built-in example\n" ); fprintf( stdout, "-level level : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" ); diff --git a/apps/renderer.c b/apps/renderer.c index 8256f1e467ba927f5fd9c46fdf1250ac3395db6c..22af62baaefc15671804dc745e1c5bb492e26b1d 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1354,15 +1354,12 @@ int main( { masaIds[i] = 0u; } -#ifdef FIX_1377_HANDLE_ERROR_CODE + if ( ( error = IVAS_REND_SetObjectIDs( hIvasRend ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_REND_SetObjectIDs: %s\n", ivas_error_to_string( error ) ); goto cleanup; } -#else - IVAS_REND_SetObjectIDs( hIvasRend ); -#endif for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i ) { diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index b8415b7fd28d70214bf80f153a9130b0d2428291..1ca2ca99455239630f04de9d69d8e78b3128a800 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -258,9 +258,7 @@ typedef enum /* format signaling in SID frames */ #define SID_FORMAT_NBITS 3 /* Bit 0 | Bit 1 | Bit 2 */ /*-------|-------|------ */ -#ifdef FIX_1384_MSAN_ivas_spar_dec_open #define SID_FORMAT_NONE (-0x1) /* n/a| n/a| n/a*/ -#endif #define SID_DFT_STEREO 0x0 /* 0| 0| 0 */ #define SID_MDCT_STEREO 0x1 /* 1| 0| 0 */ #define SID_ISM 0x2 /* 0| 1| 0 */ diff --git a/lib_com/options.h b/lib_com/options.h index 31b9785a4e745e30f522c5a112e30d6162beafb6..0f23d808276c5d29a53d9809219a2a43c0a73d18 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -122,25 +122,15 @@ /* #################### Start BASOP porting switches ############################ */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ -#define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0, float issue 1328 */ -#define FIX_1377_HANDLE_ERROR_CODE /* Eri: Add missing error code handling from IVAS_REND_SetObjectIDs */ #define FIX_1053_REVERB_RECONFIGURATION #define FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add split rendering support to decoder in VoIP mode */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ -#define FIX_1385_INIT_IGF_STOP_FREQ /* FhG: Initialize infoIGFStopFreq in init_igf_dec() */ -#define FIX_1387_INIT_PRM_SQQ /* FhG: initialize pointer prm_sqQ, which might be uninitialized in case of bfi == 1 */ -#define FIX_1349_TNS_CRASH /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */ -#define FIX_1384_MSAN_stereo_tcx_core_enc /* VA: issue 1384: fix use-of-uninitialized value in stereo_tcx_core_enc() */ -#define FIX_1384_MSAN_ivas_spar_dec_open /* VA: issue 1386: fix use-of-uninitialized value in ivas_spar_dec_open() */ -#define FIX_1388_MSAN_ivas_init_decoder /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */ #define FIX_1413_IGF_INIT_PRINTOUT /* FhG: use correct variable for IGF initiliazation */ -#define FIX_1383_HEAD_TRACK_SANITIZER /* Nok: issue 1383: Fix head tracking struc values reading in renderer */ #define FIX_1330_JBM_MEMORY_FIX /* VA: basop issue: 2179 fix non-BE difference in FIX_1330_JBM_MEMORY */ #define FIX_1411_IGF_CRASH_BW_SWITCHING /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/ #define FIX_1419_MONO_STEREO_UMX /* FhG: fix for issue 1419 : support upmix to all output formats for mono and stereo */ #define NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG /* FhG: Fix MDCT-Stereo comfort noise for certain noise types */ -#define NONBE_1344_REND_MASA_LOW_FS /* Nokia: Issue 1344: Fix sanitizer errors when using IVAS_rend to render MASA with lower sampling rates */ #define FIX_1437_LC3PLUS_EXTREND_HIRES /* FhG: fix external renderer split bitstream header writing causing a crash for LC3plus High-res mode */ #define NONBE_1412_AVOID_ROUNDING_AZ_ELEV /* FhG: Avoid rounding when passing azimuth and elevation to efap_determine_gains() */ #define FIX_1318_ROOM_SIZE_CMD_LINE /* Philips/Nokia/FhG: Default room sizes support */ diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index 9280541513ca775927bbe8ef9933ae1ef5b824d7..e63dc471ebd194f07d9a62648460c6ad02d96846 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -5901,9 +5901,7 @@ void non_linearity_ivas_fx( Word16 nframes; Word32 prev_scale; Word16 length_half; -#ifdef NONBE_1328_FIX_NON_LINEARITY Word16 sc_factor; -#endif IF( EQ_16( L_frame, L_FRAME16k ) ) { @@ -5964,15 +5962,10 @@ void non_linearity_ivas_fx( move32(); /* Q31; 0.67 in Q31 */ } -#ifdef NONBE_1328_FIX_NON_LINEARITY sc_factor = s_max( sub( 13, norm_s( add( j, 1 ) ) ), 0 ); /* Adapt the scaling factor allowed depending of max position */ sc_factor = s_max( sc_factor, 1 ); /* Note: The sc_factor is the log2 of the sc_factor in the float code to simplify condition below */ test(); IF( prev_scale <= 0 || GT_32( L_shr( prev_scale, sub( sc_factor, 1 ) /*Q30 -> Q31*/ ), scale /*Q31*/ ) ) /* Since the sc_factor is the log2 of sc_factor in float, we apply it using L_shr */ -#else - test(); - IF( prev_scale <= 0 || GT_32( Mult_32_16( prev_scale, 64 ) /*Q30 -> Q31*/, scale /*Q31*/ ) ) -#endif { scale_step = 16384; move16(); /* Q14 */ @@ -6045,16 +6038,12 @@ void non_linearity_ivas_fx( move32(); /* Q31; 0.67 in Q31 */ } -#ifdef NONBE_1328_FIX_NON_LINEARITY /* if ( element_mode > EVS_MONO ) */ /* element mode is not needed because the function is duplicated for IVAS */ sc_factor = s_max( sub( 12, norm_s( add( sub( j, length_half ), 1 ) ) ), 0 ); /* allowed intra frame jump is smaller */ sc_factor = s_max( sc_factor, 1 ); /* Note: The sc_factor is the log2 of the sc_factor in the float code to simplify condition below */ test(); IF( prev_scale <= 0 || GT_32( L_shr( prev_scale, sub( sc_factor, 1 ) /*Q30 -> Q31*/ ), scale /*Q31*/ ) ) /* Since the sc_factor is the log2 of sc_factor in float, we apply it using L_shr */ -#else - IF( prev_scale <= 0 || GT_32( Mult_32_16( prev_scale, 64 ), scale ) ) -#endif { scale_step = 16384; move16(); /*Q14 */ diff --git a/lib_dec/igf_dec_fx.c b/lib_dec/igf_dec_fx.c index 3178e4d392f058d97b8013654d00722ab0587c8d..b08a0cb64c9e472df4c0282f4a76a5e98382106d 100644 --- a/lib_dec/igf_dec_fx.c +++ b/lib_dec/igf_dec_fx.c @@ -4254,10 +4254,8 @@ void init_igf_dec( hIGFDec->flag_sparse = &hIGFDec->flag_sparseBuf[0]; hIGFDec->infoTCXNoise_ptr = &hIGFDec->infoTCXNoise_evs[0]; hIGFDec->virtualSpec_fx = &hIGFDec->virtualSpec[0]; -#ifdef FIX_1385_INIT_IGF_STOP_FREQ hIGFDec->infoIGFStopFreq = 0; move16(); -#endif return; } diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index b6e7a558ec79902eaad55d95ecb0afbcde14eab5..c437ca0f2a7b889e1a10795f05c26db582e62847 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -1589,10 +1589,8 @@ ivas_error ivas_init_decoder_front( move32(); st_ivas->mc_mode = MC_MODE_NONE; move32(); -#ifdef FIX_1384_MSAN_ivas_spar_dec_open st_ivas->sid_format = SID_FORMAT_NONE; move16(); -#endif st_ivas->sba_dirac_stereo_flag = 0; move16(); diff --git a/lib_dec/ivas_mdct_core_dec_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index f9d7386954e401b0e4f94d673a6adbf71a8a85b5..a0915452ed2d9a352b4b0a01f5e5b00af63609cd 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -708,9 +708,7 @@ void ivas_mdct_core_invQ_fx( set16_fx( bitsRead, 0, CPE_CHANNELS ); tmp_concealment_method = 0; move16(); -#ifdef FIX_1387_INIT_PRM_SQQ prm_sqQ = NULL; /* set prm_sqQ to NULL - in case of bfi == 1 it's not set or needed, but it triggers sanitizers */ -#endif FOR( ch = 0; ch < CPE_CHANNELS; ch++ ) { diff --git a/lib_dec/ivas_tcx_core_dec_fx.c b/lib_dec/ivas_tcx_core_dec_fx.c index 01f47c90627fdfc19342b4e6d184bf3b0aceac7f..e62d20b668ddeb2d05ad99bf4997659d708194d7 100644 --- a/lib_dec/ivas_tcx_core_dec_fx.c +++ b/lib_dec/ivas_tcx_core_dec_fx.c @@ -349,23 +349,8 @@ void stereo_tcx_core_dec_fx( { Word16 tcx_lpc_cdk; -#ifdef FIX_1384_MSAN_stereo_tcx_core_enc tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type ); move16(); -#else - test(); - test(); - IF( bfi && st->use_partial_copy && EQ_16( st->rf_frame_type, RF_TCXFD ) ) - { - tcx_lpc_cdk = tcxlpc_get_cdk( GENERIC ); /* Q0 */ - move16(); - } - ELSE - { - tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type ); /* Q0 */ - move16(); - } -#endif Copy( st->lsf_old_fx, &lsf_fx[0], M ); /* Q2.56 */ Copy( st->lsp_old_fx, &lsp_fx[0], M ); /* Q15 */ @@ -490,14 +475,6 @@ void stereo_tcx_core_dec_fx( E_LPC_f_lsp_a_conversion( st->lsp_old_fx, st->old_Aq_12_8_fx, M ); } -#ifndef FIX_1384_MSAN_stereo_tcx_core_enc - test(); - if ( st->enablePlcWaveadjust && bfi ) - { - st->hPlcInfo->nbLostCmpt = add( st->hPlcInfo->nbLostCmpt, 1 ); /* Q0 */ - move16(); - } -#endif /*--------------------------------------------------------------------------------* * TD-TCX concealment *--------------------------------------------------------------------------------*/ @@ -661,38 +638,6 @@ void stereo_tcx_core_dec_fx( test(); IF( EQ_16( st->core, TCX_10_CORE ) || EQ_16( st->core, TCX_20_CORE ) ) { -#ifndef FIX_1384_MSAN_stereo_tcx_core_enc - test(); - test(); - IF( st->enablePlcWaveadjust || /* bfi */ - ( GE_32( st->last_total_brate, HQ_48k ) && /* recovery */ - EQ_16( st->last_codec_mode, MODE2 ) ) ) - { - IF( st->hTonalMDCTConc->q_lastPcmOut != 0 ) - { - Scale_sig( st->hTonalMDCTConc->secondLastPcmOut, shr( hTcxDec->L_frameTCX, 1 ), negate( st->hTonalMDCTConc->q_lastPcmOut ) ); - Scale_sig( st->hTonalMDCTConc->lastPcmOut, hTcxDec->L_frameTCX, negate( st->hTonalMDCTConc->q_lastPcmOut ) ); - st->hTonalMDCTConc->q_lastPcmOut = 0; - move16(); - } - /* waveform adjustment */ - concealment_signal_tuning_fx( st, bfi, synthFB_fx, st->last_core_bfi ); - - test(); - test(); - test(); - IF( ( bfi || st->prev_bfi ) && st->hPlcInfo->Pitch_fx && EQ_16( st->hPlcInfo->concealment_method, TCX_NONTONAL ) ) - { - lerp( synthFB_fx, synth_fx, st->L_frame, hTcxDec->L_frameTCX ); - - if ( !bfi && st->prev_bfi ) - { - st->hPlcInfo->Pitch_fx = 0; - move16(); - } - } - } -#endif IF( !bfi && st->hTonalMDCTConc != NULL ) { #ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE @@ -867,13 +812,6 @@ void stereo_tcx_core_dec_fx( IF( !bfi ) { -#ifndef FIX_1384_MSAN_stereo_tcx_core_enc - if ( st->enablePlcWaveadjust ) - { - st->hPlcInfo->nbLostCmpt = 0; - move16(); - } -#endif IF( param[1 + NOISE_FILL_RANGES] != 0 ) { Word32 tcxltp_pitch_tmp = L_add( L_deposit_h( hTcxLtpDec->tcxltp_pitch_int ), L_shl( L_deposit_l( div_s( hTcxLtpDec->tcxltp_pitch_fr, st->pit_res_max ) ), 1 ) ); /*15Q16*/ @@ -1054,12 +992,7 @@ static void dec_prm_tcx_ivas_fx( getTCXMode_ivas_fx( st, st, 0 /* <- MCT_flag */ ); /* last_core for error concealment */ -#ifdef FIX_1384_MSAN_stereo_tcx_core_enc IF( NE_16( st->element_mode, IVAS_CPE_MDCT ) ) -#else - test(); - IF( !st->use_partial_copy && NE_16( st->element_mode, IVAS_CPE_MDCT ) ) -#endif { st->last_core_from_bs = get_next_indice_fx( st, 1 ); /* Store decoder memory of last_core Q0*/ move16(); @@ -1104,25 +1037,18 @@ static void dec_prm_tcx_ivas_fx( } } -#ifndef FIX_1384_MSAN_stereo_tcx_core_enc - IF( !st->use_partial_copy ) + IF( NE_16( st->element_mode, IVAS_CPE_MDCT ) ) { -#endif - IF( NE_16( st->element_mode, IVAS_CPE_MDCT ) ) - { - getTCXWindowing_ivas_fx( st->core, st->last_core, st->element_mode, st->hTcxCfg, st ); - } - st->flagGuidedAcelp = 0; - move16(); + getTCXWindowing_ivas_fx( st->core, st->last_core, st->element_mode, st->hTcxCfg, st ); + } + st->flagGuidedAcelp = 0; + move16(); - if ( st->dec_glr ) - { - st->dec_glr_idx = -1; - move16(); - } -#ifndef FIX_1384_MSAN_stereo_tcx_core_enc + if ( st->dec_glr ) + { + st->dec_glr_idx = -1; + move16(); } -#endif /*--------------------------------------------------------------------------------* * LPC parameters @@ -1137,7 +1063,6 @@ static void dec_prm_tcx_ivas_fx( * TCX20/10 parameters *--------------------------------------------------------------------------------*/ -#ifdef FIX_1384_MSAN_stereo_tcx_core_enc getTCXparam_fx( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 ); IF( LT_16( sub( *total_nbbits, bitsRead[0] ), sub( st->next_bit_pos, start_bit_pos ) ) ) @@ -1150,26 +1075,6 @@ static void dec_prm_tcx_ivas_fx( bitsRead[0] = sub( st->next_bit_pos, start_bit_pos ); /* Q0 */ move16(); -#else - IF( st->use_partial_copy == 0 ) - { - getTCXparam_fx( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 ); - } - - IF( !st->use_partial_copy ) - { - IF( LT_16( sub( *total_nbbits, bitsRead[0] ), sub( st->next_bit_pos, start_bit_pos ) ) ) - { - st->BER_detect = 1; - move16(); - st->next_bit_pos = add( start_bit_pos, sub( *total_nbbits, bitsRead[0] ) ); /* Q0 */ - move16(); - } - - bitsRead[0] = sub( st->next_bit_pos, start_bit_pos ); /* Q0 */ - move16(); - } -#endif return; } diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 8ac73cb85eca3bf2d44dd62f3442138820786b1c..fc6525440be72d8f777703183e1936ecd5062a25 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -1095,13 +1095,11 @@ ivas_error IVAS_DEC_FeedFrame_Serial( { ivas_error error; -#ifdef FIX_1388_MSAN_ivas_init_decoder test(); IF( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif IF( !hIvasDec->isInitialized ) { @@ -1109,11 +1107,9 @@ ivas_error IVAS_DEC_FeedFrame_Serial( * In IVAS mode, initialization is done in ivas_dec(). */ IF( EQ_16( hIvasDec->mode, IVAS_DEC_MODE_EVS ) ) { -#ifdef FIX_1388_MSAN_ivas_init_decoder hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = ACELP_8k00; move32(); -#endif IF( NE_32( ( error = ivas_init_decoder_fx( hIvasDec->st_ivas ) ), IVAS_ERR_OK ) ) { return error; @@ -1130,13 +1126,6 @@ ivas_error IVAS_DEC_FeedFrame_Serial( hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = imult3216( hIvasDec->hVoIP->hCurrentDataUnit->dataSize, FRAMES_PER_SEC ); move32(); } -#ifndef FIX_1388_MSAN_ivas_init_decoder - ELSE - { - hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = ACELP_8k00; - move32(); - } -#endif hIvasDec->isInitialized = true; move16(); diff --git a/lib_enc/cod_tcx_fx.c b/lib_enc/cod_tcx_fx.c index fbd76743fd0b6b1f76f66b94861597b22f1c1f4a..a60d070a5ee6e7471e8f1f6d554019cc19310a7f 100644 --- a/lib_enc/cod_tcx_fx.c +++ b/lib_enc/cod_tcx_fx.c @@ -5091,7 +5091,6 @@ void TNSAnalysisStereo_fx( move16(); move16(); } -#ifdef FIX_1349_TNS_CRASH ELSE { pFilter[0]->filterType = TNS_FILTER_OFF; @@ -5103,7 +5102,6 @@ void TNSAnalysisStereo_fx( move16(); move16(); } -#endif } } } diff --git a/lib_enc/ivas_tcx_core_enc_fx.c b/lib_enc/ivas_tcx_core_enc_fx.c index 7c5972545795c6dcbde28290bf971053b5b1ceaf..8538f95d1c00e395975a3e95c2a409751952e513 100644 --- a/lib_enc/ivas_tcx_core_enc_fx.c +++ b/lib_enc/ivas_tcx_core_enc_fx.c @@ -435,10 +435,8 @@ void stereo_tcx_core_enc( } } -#ifdef FIX_1384_MSAN_stereo_tcx_core_enc st->acelp_cfg.midLpc = 0; move16(); -#endif last_core_orig = st->last_core; move16(); diff --git a/lib_rend/ivas_dirac_ana_fx.c b/lib_rend/ivas_dirac_ana_fx.c index 81eb72e1dfe40274ec8ef916033f1748c771d9ae..52bedea05801655c7a812900dfeb783bde16df88 100644 --- a/lib_rend/ivas_dirac_ana_fx.c +++ b/lib_rend/ivas_dirac_ana_fx.c @@ -255,16 +255,15 @@ void ivas_dirac_ana_fx( Word32 energyRatio_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; Word32 spreadCoherence_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; Word32 surroundingCoherence_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; + /* Estimate MASA parameters from the SBA signals */ ivas_dirac_param_est_ana_fx( hDirAC, data_fx, elevation_m_values_fx, azimuth_m_values_fx, energyRatio_fx, spreadCoherence_fx, surroundingCoherence_fx, input_frame, data_q ); -#ifdef NONBE_1344_REND_MASA_LOW_FS /* Add zeros to higher bands in case of lower sampling rates */ IF( LT_16( hDirAC->nbands, MASA_FREQUENCY_BANDS ) ) { ivas_masa_zero_high_bands_fx( hDirAC->nbands, elevation_m_values_fx, azimuth_m_values_fx, energyRatio_fx, spreadCoherence_fx, surroundingCoherence_fx ); } -#endif /* Create MASA metadata buffer from the estimated values */ ivas_create_masa_out_meta_fx( hDirAC->hMasaOut, hDirAC->sph_grid16, nchan_transport, elevation_m_values_fx, azimuth_m_values_fx, energyRatio_fx, spreadCoherence_fx, surroundingCoherence_fx, Q31, Q31, Q31 ); diff --git a/lib_rend/ivas_masa_merge_fx.c b/lib_rend/ivas_masa_merge_fx.c index efffccf84bc6cc7195e7e2482aa38cd8e640219d..6837a3e1ab982dc9031114b938ffdfe476dd82c4 100644 --- a/lib_rend/ivas_masa_merge_fx.c +++ b/lib_rend/ivas_masa_merge_fx.c @@ -37,9 +37,7 @@ #include "ivas_cnst.h" #include "prot_fx.h" #include "wmc_auto.h" -#ifdef NONBE_1344_REND_MASA_LOW_FS #include "ivas_rom_com.h" -#endif #include "ivas_prot_fx.h" #define INV_UINT8_MAX 8421505 /* 1/UINT8_MAX in Q31 */ @@ -490,9 +488,7 @@ ivas_error masaPrerendOpen_fx( { MASA_PREREND_HANDLE hMasaPrerend; Word16 i; -#ifdef NONBE_1344_REND_MASA_LOW_FS Word16 maxBin; -#endif ivas_error error; error = IVAS_ERR_OK; @@ -504,7 +500,6 @@ ivas_error masaPrerendOpen_fx( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA prerenderer\n" ) ); } -#ifdef NONBE_1344_REND_MASA_LOW_FS /* Determine the number of bands and band grouping */ hMasaPrerend->nbands = MASA_FREQUENCY_BANDS; move16(); @@ -522,7 +517,6 @@ ivas_error masaPrerendOpen_fx( break; } } -#endif hMasaPrerend->num_Cldfb_instances = numTransports; move16(); diff --git a/lib_rend/ivas_mcmasa_ana_fx.c b/lib_rend/ivas_mcmasa_ana_fx.c index e31241a53344115418de97f16b66cd871e70736d..a6d9968406ddb669983ddd5a487fd76a7e4d99f8 100644 --- a/lib_rend/ivas_mcmasa_ana_fx.c +++ b/lib_rend/ivas_mcmasa_ana_fx.c @@ -486,13 +486,11 @@ void ivas_mcmasa_ana_fx( /* Analysis */ ivas_mcmasa_param_est_ana_fx( hMcMasa, data, elevation_m_values_fx, azimuth_m_values_fx, energyRatio_fx, spreadCoherence_fx, surroundingCoherence_fx, q_data, input_frame, nchan_inp ); -#ifdef NONBE_1344_REND_MASA_LOW_FS /* Add zeros to higher bands in case of lower sampling rates */ IF( LT_16( hMcMasa->nbands, MASA_FREQUENCY_BANDS ) ) { ivas_masa_zero_high_bands_fx( hMcMasa->nbands, elevation_m_values_fx, azimuth_m_values_fx, energyRatio_fx, spreadCoherence_fx, surroundingCoherence_fx ); } -#endif /* Create MASA metadata buffer from the estimated values */ ivas_create_masa_out_meta_fx( hMcMasa->hMasaOut, hMcMasa->sph_grid16, nchan_transport, elevation_m_values_fx, azimuth_m_values_fx, energyRatio_fx, spreadCoherence_fx, surroundingCoherence_fx, Q31, Q31, Q31 ); @@ -1713,7 +1711,6 @@ void ivas_create_masa_out_meta_fx( } -#ifdef NONBE_1344_REND_MASA_LOW_FS /*------------------------------------------------------------------------- * ivas_masa_zero_high_bands() * @@ -1750,4 +1747,3 @@ void ivas_masa_zero_high_bands_fx( return; } -#endif diff --git a/lib_rend/ivas_omasa_ana_fx.c b/lib_rend/ivas_omasa_ana_fx.c index 9c209f036805932146d628f892bdc80f0a71c15a..b95f5500df00136594444fc6f98909eb248c5c35 100644 --- a/lib_rend/ivas_omasa_ana_fx.c +++ b/lib_rend/ivas_omasa_ana_fx.c @@ -45,9 +45,8 @@ * Local function prototypes *------------------------------------------------------------------------*/ - static void ivas_omasa_dmx_fx( - Word32 data_in_f_fx[][L_FRAME48k], + Word32 data_in_fx[][L_FRAME48k], Word16 *data_in_q, const Word16 input_frame, const Word16 nchan_transport, @@ -57,7 +56,6 @@ static void ivas_omasa_dmx_fx( Word32 prev_gains_fx[][MASA_MAX_TRANSPORT_CHANNELS], const Word16 interpolator_fx[L_FRAME48k] ); - static void ivas_omasa_param_est_ana_fx( OMASA_ANA_HANDLE hOMasa, Word32 data_f_fx[][L_FRAME48k], @@ -73,6 +71,7 @@ static void ivas_omasa_param_est_ana_fx( const Word16 input_frame, const Word16 nchan_ism ); + /*--------------------------------------------------------------------------* * ivas_omasa_ana_open() * @@ -292,20 +291,20 @@ void ivas_omasa_ana_close( return; } + /*--------------------------------------------------------------------------* * ivas_omasa_ana() * * OMASA analysis function *--------------------------------------------------------------------------*/ - void ivas_omasa_ana_fx( - OMASA_ANA_HANDLE hOMasa, /* i/o: OMASA analysis handle */ - Word32 data_in_f_fx[][L_FRAME48k], /* i/o: Input / transport audio signals */ - Word16 *data_in_q, - const Word16 input_frame, /* i : Input frame size */ - const Word16 nchan_transport, /* i : Number of transport channels */ - const Word16 nchan_ism /* i : Number of objects for parameter analysis */ + OMASA_ANA_HANDLE hOMasa, /* i/o: OMASA analysis handle */ + Word32 data_in_fx[][L_FRAME48k], /* i/o: Input / transport audio signals */ + Word16 *data_in_q, /* o : audio signals Q factor */ + const Word16 input_frame, /* i : Input frame size */ + const Word16 nchan_transport, /* i : Number of transport channels */ + const Word16 nchan_ism /* i : Number of objects for parameter analysis */ ) { Word32 elevation_m_values_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; @@ -316,21 +315,19 @@ void ivas_omasa_ana_fx( Word16 spreadCoherence_q, sorroundingCoherence_q, energyRatio_q; /* Estimate MASA parameters from the objects */ - ivas_omasa_param_est_ana_fx( hOMasa, data_in_f_fx, *data_in_q, elevation_m_values_fx, azimuth_m_values_fx, energyRatio_fx, &energyRatio_q, spreadCoherence_fx, &spreadCoherence_q, surroundingCoherence_fx, &sorroundingCoherence_q, input_frame, nchan_ism ); + ivas_omasa_param_est_ana_fx( hOMasa, data_in_fx, *data_in_q, elevation_m_values_fx, azimuth_m_values_fx, energyRatio_fx, &energyRatio_q, spreadCoherence_fx, &spreadCoherence_q, surroundingCoherence_fx, &sorroundingCoherence_q, input_frame, nchan_ism ); -#ifdef NONBE_1344_REND_MASA_LOW_FS /* Add zeros to higher bands in case of lower sampling rates */ IF( LT_16( hOMasa->nbands, MASA_FREQUENCY_BANDS ) ) { ivas_masa_zero_high_bands_fx( hOMasa->nbands, elevation_m_values_fx, azimuth_m_values_fx, energyRatio_fx, spreadCoherence_fx, surroundingCoherence_fx ); } -#endif /* Create MASA metadata buffer from the estimated values */ ivas_create_masa_out_meta_fx( hOMasa->hMasaOut, hOMasa->sph_grid16, nchan_transport, elevation_m_values_fx, azimuth_m_values_fx, energyRatio_fx, spreadCoherence_fx, surroundingCoherence_fx, Q31, Q31, Q31 ); /* Downmix */ - ivas_omasa_dmx_fx( data_in_f_fx, data_in_q, input_frame, nchan_transport, nchan_ism, hOMasa->ism_azimuth_fx, hOMasa->ism_elevation_fx, hOMasa->prev_object_dm_gains_fx, hOMasa->interpolator_fx ); + ivas_omasa_dmx_fx( data_in_fx, data_in_q, input_frame, nchan_transport, nchan_ism, hOMasa->ism_azimuth_fx, hOMasa->ism_elevation_fx, hOMasa->prev_object_dm_gains_fx, hOMasa->interpolator_fx ); return; } @@ -341,8 +338,6 @@ void ivas_omasa_ana_fx( *--------------------------------------------------------------------------*/ /* Estimate MASA parameters from the objects */ - - static void ivas_omasa_param_est_ana_fx( OMASA_ANA_HANDLE hOMasa, Word32 data_f_fx[][L_FRAME48k], @@ -651,7 +646,7 @@ static void ivas_omasa_param_est_ana_fx( /* Compute downmix */ static void ivas_omasa_dmx_fx( - Word32 data_in_f_fx[][L_FRAME48k], + Word32 data_in_fx[][L_FRAME48k], Word16 *data_in_q, const Word16 input_frame, const Word16 nchan_transport, @@ -684,7 +679,7 @@ static void ivas_omasa_dmx_fx( { FOR( j = 0; j < input_frame; j++ ) { - data_out_f_fx[0][j] = L_add_sat( data_out_f_fx[0][j], data_in_f_fx[i][j] ); + data_out_f_fx[0][j] = L_add_sat( data_out_f_fx[0][j], data_in_fx[i][j] ); move32(); } } @@ -711,7 +706,7 @@ static void ivas_omasa_dmx_fx( tmp2 = mult( g2_fx, (Word16) L_shr( prev_gains_fx[i][j], 16 ) ); // Q: ( ( ( 15 - scale ) + ( Q31 - Q16 ) ) - Q15 ) -> ( 15 - scale ) scale = BASOP_Util_Add_MantExp( tmp1, 0, tmp2, scale, &tmp1 ); - L_tmp = data_in_f_fx[i][k]; // data_in_q + L_tmp = data_in_fx[i][k]; // data_in_q move32(); tmp_e = sub( 31, *data_in_q ); move16(); @@ -773,7 +768,7 @@ static void ivas_omasa_dmx_fx( FOR( i = 0; i < nchan_transport; i++ ) { - Copy32( data_out_f_fx[i], data_in_f_fx[i], input_frame ); + Copy32( data_out_f_fx[i], data_in_fx[i], input_frame ); IF( NE_16( nchan_transport, 1 ) ) { *data_in_q = sub( 31, max_e ); diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index a1e6f5167a5af0437288a3768f0f72a30c759418..fed740577087f3d970a638de4a2bbab1ad8f1556 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -1449,8 +1449,8 @@ ivas_error ivas_omasa_ana_open( void ivas_omasa_ana_fx( OMASA_ANA_HANDLE hOMasa, /* i/o: OMASA analysis handle */ - Word32 data_in_f_fx[][L_FRAME48k], /* i/o: Input / transport audio signals */ - Word16 *q, + Word32 data_in_fx[][L_FRAME48k], /* i/o: Input / transport audio signals */ + Word16 *data_in_q, /* o : audio signals Q factor */ const Word16 input_frame, /* i : Input frame size */ const Word16 nchan_transport, /* i : Number of transport channels */ const Word16 nchan_ism /* i : Number of objects for parameter analysis*/ @@ -1494,7 +1494,6 @@ void ivas_create_masa_out_meta_fx( Word16 surroundingCoherence_q ); -#ifdef NONBE_1344_REND_MASA_LOW_FS void ivas_masa_zero_high_bands_fx( const Word16 nbands, /* i : Number of frequency bands with estimated values */ Word32 elevation_m_values_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated elevation */ @@ -1503,7 +1502,6 @@ void ivas_masa_zero_high_bands_fx( Word32 spreadCoherence_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated spread coherence */ Word32 surroundingCoherence_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] /* i/o : Estimated surround coherence */ ); -#endif ivas_error ivas_dirac_ana_open_fx( DIRAC_ANA_HANDLE *hDirACPtr, /* i/o: DIRAC data handle pointer */ diff --git a/lib_rend/ivas_rotation_fx.c b/lib_rend/ivas_rotation_fx.c index c05ed40c38c22f118b07a0f742c3981a1ae16013..3ca98153f2bc6358a056af775ad44bca1775de6a 100644 --- a/lib_rend/ivas_rotation_fx.c +++ b/lib_rend/ivas_rotation_fx.c @@ -1545,20 +1545,10 @@ ivas_error combine_external_and_head_orientations_rend( sr_pose_pred_axis = DEFAULT_AXIS; -#ifdef FIX_1383_HEAD_TRACK_SANITIZER IF( hHeadTrackData->headRotEnabled ) { headRotQuaternions = hHeadTrackData->headPositions; listenerPos = hHeadTrackData->Pos; -#else - IF( hHeadTrackData != NULL ) - { - IF( hHeadTrackData->headRotEnabled ) - { - headRotQuaternions = hHeadTrackData->headPositions; - listenerPos = hHeadTrackData->Pos; - } -#endif sr_pose_pred_axis = hHeadTrackData->sr_pose_pred_axis; } ELSE IF( hExtOrientationData != NULL ) diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 87f4e0832f7a053c4d43001d97c7dff967a72ac1..07cf0c6fa58cd3263c23a99ba17697b6267bfcd3 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1701,10 +1701,8 @@ typedef struct ivas_dirac_ana_data_structure typedef struct ivas_masa_prerend_data_structure { -#ifdef NONBE_1344_REND_MASA_LOW_FS Word16 nbands; Word16 band_grouping[MASA_FREQUENCY_BANDS + 1]; -#endif /* CLDFB analysis */ Word16 num_Cldfb_instances; diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index b70cdcadb92b01ef968b8efd983a3f7217c9720e..1fdd31ff503466a853a16ebae44734879413111c 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -8778,23 +8778,13 @@ static void renderMasaToMasa( Word16 q_add = sub( 31, add( scale_factor, q_cldfb_out ) ); /* Compute channel energy for metadata processing */ -#ifdef NONBE_1344_REND_MASA_LOW_FS FOR( band_m_idx = 0; band_m_idx < masaInput->hMasaPrerend->nbands; band_m_idx++ ) -#else - FOR( band_m_idx = 0; band_m_idx < MASA_FREQUENCY_BANDS; band_m_idx++ ) -#endif { -#ifdef NONBE_1344_REND_MASA_LOW_FS brange[0] = masaInput->hMasaPrerend->band_grouping[band_m_idx]; move16(); brange[1] = masaInput->hMasaPrerend->band_grouping[band_m_idx + 1]; move16(); -#else - brange[0] = MASA_band_grouping_24[band_m_idx]; - move16(); - brange[1] = MASA_band_grouping_24[band_m_idx + 1]; - move16(); -#endif + FOR( j = brange[0]; j < brange[1]; j++ ) { FOR( i = 0; i < numAnalysisChannels; i++ )