From f4401edc29d4cc3a8cf8bdea3a0d97fe9292d27b Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 19 Apr 2026 19:15:35 +0200 Subject: [PATCH 01/12] [cleanup] accept FIX_2452_HQ_CORE_PEAQ_AVR_RATIO_HARM --- lib_com/options.h | 1 - lib_enc/hq_classifier_enc_fx.c | 4 ---- lib_enc/hq_lr_enc_fx.c | 4 ---- 3 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 3077f91f2..12a7ffdc3 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -91,7 +91,6 @@ #define NONBE_FIX_ISSUE_2206_AVOID_OVERFLOW_SWB_fenv_fx2 /* FhG: Avoid overflow of SWB_fenv_fx in SWB_BWE_encoding_fx because of very small energies. */ #define NONBE_FIX_ISSUE_2206_AVOID_OVERFLOW_MSVQ_Interpol_Tran_fx /* FhG: Fix saturation crash in MSVQ_Interpol_Tran_fx() */ #define NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT_FIX_2527 /* Fix crash from issue #2527 */ -#define FIX_2452_HQ_CORE_PEAQ_AVR_RATIO_HARM /* Eri: Basop issue 2453: Fix alignment of peak_avrg_ratio_fx */ #define FIX_FLOAT_1539_G192_FORMAT_SWITCH /* VA/Nokia: reintroduce format switching for g192 bitstreams */ #define FIX_1527_CMR_BITRATE_IDX /* Fix for incorrect bitrate idx packed in rtp CMR E-byte */ #define HARMONIZE_2494_FdCng_decodeSID_fx /* FhG: harmonize FdCng_decodeSID_fx with _ivas_ version */ diff --git a/lib_enc/hq_classifier_enc_fx.c b/lib_enc/hq_classifier_enc_fx.c index c9cf8856b..642c503fe 100644 --- a/lib_enc/hq_classifier_enc_fx.c +++ b/lib_enc/hq_classifier_enc_fx.c @@ -387,11 +387,7 @@ Word16 peak_avrg_ratio_fx( test(); test(); test(); -#ifdef FIX_2452_HQ_CORE_PEAQ_AVR_RATIO_HARM IF( ( GE_16( add( k, k1 ), 5 ) && GT_16( k1, 2 ) && LT_32( total_brate, HQ_BWE_CROSSOVER_BRATE ) && GT_32( total_brate, HQ_16k40 ) ) || ( ( ( GE_16( add( k, k1 ), 10 ) && GT_16( k1, 5 ) ) || GE_16( *mode_count, 5 ) ) && LT_16( *mode_count1, 5 ) ) ) -#else - IF( ( GE_16( add( k, k1 ), 5 ) && GT_16( k1, 2 ) && LT_32( total_brate, HQ_BWE_CROSSOVER_BRATE ) ) || ( ( ( GE_16( add( k, k1 ), 10 ) && GT_16( k1, 5 ) ) || GE_16( *mode_count, 5 ) ) && LT_16( *mode_count1, 5 ) ) ) -#endif { hqswb_clas = HQ_HARMONIC; move16(); diff --git a/lib_enc/hq_lr_enc_fx.c b/lib_enc/hq_lr_enc_fx.c index 5daf90dd5..9165eb842 100644 --- a/lib_enc/hq_lr_enc_fx.c +++ b/lib_enc/hq_lr_enc_fx.c @@ -206,11 +206,7 @@ void hq_lr_enc_fx( } ELSE { -#ifdef FIX_2452_HQ_CORE_PEAQ_AVR_RATIO_HARM hqswb_clas_fx = peak_avrg_ratio_fx( st_fx->total_brate, L_t_audio, NUMC_N, &hHQ_core->mode_count, &hHQ_core->mode_count1, SWB_BWE_LR_Qs ); /* Q0 */ -#else - hqswb_clas_fx = peak_avrg_ratio_fx( HQ_BWE_CROSSOVER_BRATE, L_t_audio, NUMC_N, &hHQ_core->mode_count, &hHQ_core->mode_count1, SWB_BWE_LR_Qs ); /* Q0 */ -#endif } /* write the classification information into the bitstream */ -- GitLab From c034cfd94ed86afeb64102e8a398c1e2dcbf3af7 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 19 Apr 2026 19:16:37 +0200 Subject: [PATCH 02/12] [cleanup] accept FIX_1527_CMR_BITRATE_IDX --- apps/encoder.c | 18 ------------------ lib_com/options.h | 1 - lib_util/ivas_rtp_file.c | 2 -- lib_util/ivas_rtp_file.h | 2 -- lib_util/ivas_rtp_payload.c | 12 ------------ 5 files changed, 35 deletions(-) diff --git a/apps/encoder.c b/apps/encoder.c index 420c80c57..6c09d308f 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -45,9 +45,7 @@ #include "masa_file_reader.h" #include "rotation_file_reader.h" #include "ivas_rtp_file.h" -#ifdef FIX_1527_CMR_BITRATE_IDX #include "requests_file_reader.h" -#endif #include "wmc_auto.h" @@ -168,9 +166,7 @@ typedef struct char *sceneOrientationTrajFileName; char *deviceOrientationTrajFileName; -#ifdef FIX_1527_CMR_BITRATE_IDX char *requestsFileName; -#endif } EncArguments; @@ -227,9 +223,7 @@ int main( uint8_t au[IVAS_MAX_BITS_PER_FRAME / 8]; IVAS_RTP ivasRtp = { 0 }; -#ifdef FIX_1527_CMR_BITRATE_IDX ReqFileReader *requestsFileReader = NULL; -#endif /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we use fixed seed for random num generator for regression based tests. Any realtime application should implement this initialization seperately */ @@ -667,7 +661,6 @@ int main( } } -#ifdef FIX_1527_CMR_BITRATE_IDX /*------------------------------------------------------------------------------------------* * Open remote requests file for rtp packing (E-bytes) *------------------------------------------------------------------------------------------*/ @@ -679,7 +672,6 @@ int main( goto cleanup; } } -#endif /*------------------------------------------------------------------------------------------* * Run the encoder @@ -890,7 +882,6 @@ int main( } } -#ifdef FIX_1527_CMR_BITRATE_IDX if ( requestsFileReader ) { if ( ( error = ReadNextRequests( requestsFileReader, ivasRtp.remoteRequests, &ivasRtp.remoteRequestBitmap ) ) != IVAS_ERR_OK ) @@ -899,7 +890,6 @@ int main( goto cleanup; } } -#endif if ( ( error = IVAS_ENC_EncodeFrameToCompact( hIvasEnc, pcmBuf, pcmBufSize, au, &numBits ) ) != IVAS_ERR_OK ) { @@ -996,12 +986,10 @@ cleanup: fclose( f_bitrateProfile ); } -#ifdef FIX_1527_CMR_BITRATE_IDX if ( requestsFileReader ) { RequestsFileReader_close( &requestsFileReader ); } -#endif if ( sceneOrientationFileReader ) { @@ -1049,9 +1037,7 @@ static bool parseCmdlIVAS_enc( /*-----------------------------------------------------------------* * Set default values *-----------------------------------------------------------------*/ -#ifdef FIX_1527_CMR_BITRATE_IDX memset( arg, 0, sizeof( *arg ) ); -#endif arg->inputWavFilename = NULL; arg->outputBitstreamFilename = NULL; @@ -1918,7 +1904,6 @@ static bool parseCmdlIVAS_enc( arg->deviceOrientationTrajFileName = argv[i]; i++; } -#ifdef FIX_1527_CMR_BITRATE_IDX else if ( strcmp( argv_to_upper, "-REQUESTS" ) == 0 ) { i++; @@ -1931,7 +1916,6 @@ static bool parseCmdlIVAS_enc( arg->requestsFileName = argv[i]; i++; } -#endif /*-----------------------------------------------------------------* * Option not recognized @@ -2151,9 +2135,7 @@ static void usage_enc( void ) fprintf( stdout, " EVS RTP Payload Format is used. Optional N represents number of frames per RTP packet\n" ); fprintf( stdout, "-scene_orientation : Scene orientation trajectory file. Only used with rtpdump output.\n" ); fprintf( stdout, "-device_orientation : Device orientation trajectory file. Only used with rtpdump output.\n" ); -#ifdef FIX_1527_CMR_BITRATE_IDX fprintf( stdout, "-requests : Remote requests file, Only used with rtpdump output.\n" ); -#endif fprintf( stdout, "\n" ); diff --git a/lib_com/options.h b/lib_com/options.h index 12a7ffdc3..8f316ca8a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -92,7 +92,6 @@ #define NONBE_FIX_ISSUE_2206_AVOID_OVERFLOW_MSVQ_Interpol_Tran_fx /* FhG: Fix saturation crash in MSVQ_Interpol_Tran_fx() */ #define NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT_FIX_2527 /* Fix crash from issue #2527 */ #define FIX_FLOAT_1539_G192_FORMAT_SWITCH /* VA/Nokia: reintroduce format switching for g192 bitstreams */ -#define FIX_1527_CMR_BITRATE_IDX /* Fix for incorrect bitrate idx packed in rtp CMR E-byte */ #define HARMONIZE_2494_FdCng_decodeSID_fx /* FhG: harmonize FdCng_decodeSID_fx with _ivas_ version */ #define FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM /* FhG: BASOP 2509: st->hTcxCfg->psychParamsCurrent is not initialized */ #define HARMONIZE_2499_CONFIGUREFDCNGDEC /* FhG: basop issue 2499: harmonoize configureFdCngDec */ diff --git a/lib_util/ivas_rtp_file.c b/lib_util/ivas_rtp_file.c index 74b10044f..4aba3a0c0 100644 --- a/lib_util/ivas_rtp_file.c +++ b/lib_util/ivas_rtp_file.c @@ -1086,7 +1086,6 @@ ivas_error IVAS_RTP_WriteNextFrame( rtp->nWrittenPiData--; } -#ifdef FIX_1527_CMR_BITRATE_IDX for ( IVAS_RTP_REQUEST_TYPE req = 0; req < IVAS_REQUEST_MAX; req++ ) { if ( rtp->remoteRequestBitmap & ( 1u << req ) ) @@ -1098,7 +1097,6 @@ ivas_error IVAS_RTP_WriteNextFrame( } } } -#endif if ( forcePacket || IVAS_RTP_PACK_GetNumFrames( rtp->hPack ) == rtp->packCfg.maxFramesPerPacket ) { diff --git a/lib_util/ivas_rtp_file.h b/lib_util/ivas_rtp_file.h index 57af1826c..cb7dd26ec 100644 --- a/lib_util/ivas_rtp_file.h +++ b/lib_util/ivas_rtp_file.h @@ -44,9 +44,7 @@ typedef struct uint8_t packet[NOMINAL_BUFFER_SIZE( IVAS_MAX_FRAMES_PER_RTP_PACKET )]; IVAS_PIDATA_TS piData[IVAS_PI_MAX_ID * IVAS_MAX_FRAMES_PER_RTP_PACKET]; -#ifdef FIX_1527_CMR_BITRATE_IDX IVAS_RTP_REQUEST_VALUE remoteRequests[IVAS_REQUEST_MAX]; -#endif IVAS_RTP_FILE_HANDLE hRtpFile; FILE *f_piDataOut; FILE *f_piExtOut; diff --git a/lib_util/ivas_rtp_payload.c b/lib_util/ivas_rtp_payload.c index f290d7c41..922d4e881 100644 --- a/lib_util/ivas_rtp_payload.c +++ b/lib_util/ivas_rtp_payload.c @@ -657,11 +657,7 @@ static uint32_t getBitrateIdx( const uint32_t *table, uint32_t tableLen, uint32_ for ( n = 0; n < tableLen; n++ ) { -#ifdef FIX_1527_CMR_BITRATE_IDX if ( bitrate >= ( table[n] * IVAS_NUM_FRAMES_PER_SEC ) ) -#else - if ( bitrate > ( table[n] * IVAS_NUM_FRAMES_PER_SEC ) ) -#endif { idx = n; } @@ -727,11 +723,7 @@ static void packEBytes( /* EVS Modes */ bitrate = ( bitrate > 128000 ) ? 128000 : bitrate; bitrate = ( bitrate < 5900 ) ? 5900 : bitrate; -#ifdef FIX_1527_CMR_BITRATE_IDX bitrateIdx = getBitrateIdx( evsFrameSizeInBits, ( sizeof( evsFrameSizeInBits ) / sizeof( evsFrameSizeInBits[0] ) ) - 1, bitrate ); -#else - bitrateIdx = getBitrateIdx( evsFrameSizeInBits, sizeof( evsFrameSizeInBits ) / sizeof( evsFrameSizeInBits[0] ), bitrate ); -#endif BR = (uint8_t) bitrateIdx & MASK_4BIT; /* If a bandwidth choice cannot be signalled for a given bitrate @@ -795,11 +787,7 @@ static void packEBytes( /* Initial E-Byte */ bitrate = ( bitrate > 512000 ) ? 512000 : bitrate; bitrate = ( bitrate < 13200 ) ? 13200 : bitrate; -#ifdef FIX_1527_CMR_BITRATE_IDX bitrateIdx = getBitrateIdx( ivasFrameSizeInBits, ( sizeof( ivasFrameSizeInBits ) / sizeof( ivasFrameSizeInBits[0] ) ) - 2, bitrate ); -#else - bitrateIdx = getBitrateIdx( ivasFrameSizeInBits, sizeof( ivasFrameSizeInBits ) / sizeof( ivasFrameSizeInBits[0] ), bitrate ); -#endif BR = (uint8_t) bitrateIdx & MASK_4BIT; if ( nByte < maxNumEBytes ) { -- GitLab From c469b1b3a6a20ec2189b18b9831c1a86eae41bf7 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 19 Apr 2026 19:17:24 +0200 Subject: [PATCH 03/12] [cleanup] accept HARMONIZE_2494_FdCng_decodeSID_fx --- lib_com/options.h | 1 - lib_com/prot_fx.h | 11 -- lib_dec/acelp_core_dec_fx.c | 12 -- lib_dec/dec_acelp_tcx_main_fx.c | 4 - lib_dec/fd_cng_dec_fx.c | 270 -------------------------------- 5 files changed, 298 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 8f316ca8a..473763a17 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -92,7 +92,6 @@ #define NONBE_FIX_ISSUE_2206_AVOID_OVERFLOW_MSVQ_Interpol_Tran_fx /* FhG: Fix saturation crash in MSVQ_Interpol_Tran_fx() */ #define NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT_FIX_2527 /* Fix crash from issue #2527 */ #define FIX_FLOAT_1539_G192_FORMAT_SWITCH /* VA/Nokia: reintroduce format switching for g192 bitstreams */ -#define HARMONIZE_2494_FdCng_decodeSID_fx /* FhG: harmonize FdCng_decodeSID_fx with _ivas_ version */ #define FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM /* FhG: BASOP 2509: st->hTcxCfg->psychParamsCurrent is not initialized */ #define HARMONIZE_2499_CONFIGUREFDCNGDEC /* FhG: basop issue 2499: harmonoize configureFdCngDec */ #define FIX_BASOP_2530_IVAS_DECISION_MAT /* VA: Fix ambiguous usage of extract_l() */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index d6e36b29e..2106b78ff 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -6574,14 +6574,8 @@ void perform_noise_estimation_dec_ivas_fx( ); /* Decode the CLDFB-CNG bitstream */ -#ifdef HARMONIZE_2494_FdCng_decodeSID_fx void FdCng_decodeSID_fx( Decoder_State *st ); /* i/o: decoder state structure */ -#else -void FdCng_decodeSID_fx( - HANDLE_FD_CNG_COM st, /* i/o: FD_CNG structure containing all buffers and variables */ - Decoder_State *corest ); /* i/o: decoder state structure */ -#endif void noisy_speech_detection_fx( HANDLE_FD_CNG_DEC hFdCngDec, /* i/o: FD_CNG structure */ @@ -9530,11 +9524,6 @@ void SynthesisSTFT_fx( const Word16 nchan_out /* i : number of output channels */ ); -#ifndef HARMONIZE_2494_FdCng_decodeSID_fx -void FdCng_decodeSID_ivas_fx( - Decoder_State *st /* i/o: decoder state structure */ -); -#endif void cldfb_restore_memory_ivas_fx( HANDLE_CLDFB_FILTER_BANK hs /* i/o: filter bank handle */ diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index 5fe8407e5..4ca6b2e8c 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -166,11 +166,7 @@ ivas_error acelp_core_dec_fx( /* Only run parameter decoding in SID frames */ IF( EQ_32( st->core_brate, SID_2k40 ) ) { -#ifndef HARMONIZE_2494_FdCng_decodeSID_fx - FdCng_decodeSID_ivas_fx( st ); -#else FdCng_decodeSID_fx( st ); -#endif Word16 n1, n2; n1 = L_norm_arr( st->hFdCngDec->hFdCngCom->sidNoiseEst, NPART ); @@ -663,21 +659,13 @@ ivas_error acelp_core_dec_fx( { IF( EQ_16( st->element_mode, EVS_MONO ) ) { -#ifndef HARMONIZE_2494_FdCng_decodeSID_fx - FdCng_decodeSID_fx( st->hFdCngDec->hFdCngCom, st ); -#else FdCng_decodeSID_fx( st ); -#endif } ELSE { Word16 old_NoiseEstExp = st->hFdCngDec->hFdCngCom->sidNoiseEstExp; move16(); -#ifndef HARMONIZE_2494_FdCng_decodeSID_fx - FdCng_decodeSID_ivas_fx( st ); -#else FdCng_decodeSID_fx( st ); -#endif Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEstLp, NPART, sub( old_NoiseEstExp, st->hFdCngDec->hFdCngCom->sidNoiseEstExp ) ); Scale_sig( st->hFdCngDec->hFdCngCom->A_cng, M + 1, sub( norm_s( st->hFdCngDec->hFdCngCom->A_cng[0] ), Q2 ) ); // Qx diff --git a/lib_dec/dec_acelp_tcx_main_fx.c b/lib_dec/dec_acelp_tcx_main_fx.c index aed46c1ef..dfeb3773a 100644 --- a/lib_dec/dec_acelp_tcx_main_fx.c +++ b/lib_dec/dec_acelp_tcx_main_fx.c @@ -521,11 +521,7 @@ Word16 dec_acelp_tcx_frame_fx( IF( EQ_16( st->m_frame_type, SID_FRAME ) ) { -#ifndef HARMONIZE_2494_FdCng_decodeSID_fx - FdCng_decodeSID_fx( st->hFdCngDec->hFdCngCom, st ); -#else FdCng_decodeSID_fx( st ); -#endif } /* updates */ diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 54caafcef..5fced60ad 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -2119,145 +2119,6 @@ void perform_noise_estimation_dec_ivas_fx( } -#ifndef HARMONIZE_2494_FdCng_decodeSID_fx -/* - FdCng_decodeSID_fx - - Parameters: - - st i/o: FD_CNG structure containing all buffers and variables - bs_word16 i : Bitstream - amrwb_io i : amr wideband mode - preemph_fac i : preemphase factor - - Function: - decode the FD-CNG bitstream - - Returns: - void -*/ -void FdCng_decodeSID_fx( HANDLE_FD_CNG_COM st, Decoder_State *corest ) -{ - Word16 i, N, index; - Word32 *sidNoiseEst; - - Word16 indices[32], v16[32]; - Word32 v[32], gain; - - Word32 tmp, maxVal, E_ExpLd64; - Word16 sidNoiseEst_Exp; - - Word16 preemph_fac; - Word32 *invTrfMatrix_fx; - Word32 tmpRAM_fx[FDCNG_VQ_MAX_LEN][FDCNG_VQ_DCT_MAXTRUNC]; - invTrfMatrix_fx = (Word32 *) tmpRAM_fx; - - - sidNoiseEst = st->sidNoiseEst; /*Q31 - st->sidNoiseEstExp*/ - move16(); - preemph_fac = corest->preemph_fac; /*Q15*/ - move16(); - - N = st->npart; /*Q0*/ - move16(); - - st->sid_frame_counter = add( st->sid_frame_counter, 1 ); /*Q15*/ - move16(); - - /* Read bitstream */ - FOR( i = 0; i < stages_37bits; i++ ) - { - indices[i] = get_next_indice_fx( corest, bits_37bits[i] ); /*Q0*/ - move16(); - } - index = get_next_indice_fx( corest, 7 ); /*Q0*/ - - /* MSVQ decoder */ - IF( corest->element_mode != EVS_MONO ) - { - create_IDCT_N_Matrix_fx( invTrfMatrix_fx, FDCNG_VQ_MAX_LEN, FDCNG_VQ_DCT_MAXTRUNC, FDCNG_VQ_MAX_LEN * FDCNG_VQ_DCT_MAXTRUNC ); - msvq_dec_fx( ivas_cdk_37bits_fx, NULL, NULL, stages_37bits, N, maxN_37bits, indices, 1, invTrfMatrix_fx, v, NULL, 7 ); - } - ELSE - { - msvq_decoder( - cdk_37bits, - stages_37bits, - N, - maxN_37bits, - indices, - v16 ); - - FOR( i = 0; i < N; i++ ) - { - v[i] = L_deposit_h( v16[i] ); /*Q23*/ - move32(); - } - } - - - /* decode gain, format gain: Q9.23 */ - gain = L_shl( L_deposit_l( index ), WORD32_BITS - 1 - 8 ); - gain = L_sub( gain, 503316480l /*60.0 Q23*/ ); /*Q23*/ - gain = Mpy_32_16_1( gain, 21845 /*2.0f/3.0f Q15*/ ); /*Q23*/ - - - /* Apply gain and undo log */ - - /* calculate worst case for scaling */ - maxVal = L_add( 0x80000000 /*-1.0 Q31*/, 0 ); - FOR( i = 0; i < N; i++ ) - { - maxVal = L_max( maxVal, v[i] ); /*Q23*/ - } - - maxVal = L_add( maxVal, gain ); /*Q23*/ - maxVal = L_shl( Mpy_32_16_1( maxVal, 21771 /*0.66438561897 Q15*/ ), 1 ); /*Q23*/ - - sidNoiseEst_Exp = 0; - move16(); - FOR( ; maxVal >= 0; maxVal -= 33554432l /*0.015625 Q31*/ ) - { - sidNoiseEst_Exp = add( sidNoiseEst_Exp, 1 ); - } - st->sidNoiseEstExp = sidNoiseEst_Exp; - move16(); - E_ExpLd64 = L_shl( sidNoiseEst_Exp, WORD32_BITS - 1 - LD_DATA_SCALE ); - - /* format v: Q9.23, format sidNoiseEst: Q6.26, 0.66438561897 = log10(10)/log10(2.0) / 10.0 * 2.0 */ - FOR( i = 0; i < N; i++ ) - { - tmp = L_add( v[i], gain ); /*Q23*/ - tmp = L_shl( Mpy_32_16_1( tmp, 21771 /*0.66438561897 Q15*/ ), 1 ); /*Q23*/ - tmp = L_sub( tmp, E_ExpLd64 ); - assert( tmp < 0 ); - st->sidNoiseEst[i] = BASOP_Util_InvLog2( tmp ); /*Q31 - st->sidNoiseEstExp*/ - move32(); - } - - /* NB last band energy compensation */ - IF( st->CngBandwidth == NB ) - { - st->sidNoiseEst[( N - 1 )] = Mpy_32_16_1( st->sidNoiseEst[( N - 1 )], NB_LAST_BAND_SCALE ); /*Q31 - st->sidNoiseEstExp*/ - move32(); - } - - test(); - IF( EQ_16( st->CngBandwidth, SWB ) && LE_32( st->CngBitrate, ACELP_13k20 ) ) - { - st->sidNoiseEst[( N - 1 )] = Mpy_32_16_1( st->sidNoiseEst[( N - 1 )], SWB_13k2_LAST_BAND_SCALE ); /*Q31 - st->sidNoiseEstExp*/ - move32(); - } - - - scalebands( sidNoiseEst, st->part, st->npart, st->midband, st->nFFTpart, sub( st->stopBand, st->startBand ), st->cngNoiseLevel, 1 ); - st->cngNoiseLevelExp = st->sidNoiseEstExp; - move16(); - - - lpc_from_spectrum( st, st->startBand, st->stopFFTbin, preemph_fac ); -} -#else /* FdCng_decodeSID_fx @@ -2435,7 +2296,6 @@ void FdCng_decodeSID_fx( Decoder_State *st ) lpc_from_spectrum( hFdCngCom, hFdCngCom->startBand, hFdCngCom->stopFFTbin, st->preemph_fac ); } -#endif /* noisy_speech_detection_fx @@ -4509,136 +4369,6 @@ void configureFdCngDec_ivas_fx( return; } -#ifndef HARMONIZE_2494_FdCng_decodeSID_fx -/*------------------------------------------------------------------- - * FdCng_decodeSID_ivas_fx() - * - * Decode the FD-CNG bitstream - *-------------------------------------------------------------------*/ - -void FdCng_decodeSID_ivas_fx( - Decoder_State *st /* i/o: decoder state structure */ -) -{ - Word16 N; - Word32 *sidNoiseEst; - Word32 gain; - Word16 i, index; - Word32 v[32]; - Word16 indices[32]; - HANDLE_FD_CNG_COM hFdCngCom; - Word32 *invTrfMatrix_fx; - Word32 tmpRAM_fx[FDCNG_VQ_MAX_LEN][FDCNG_VQ_DCT_MAXTRUNC]; - Word16 tmp16; - - IF( st->element_mode == EVS_MONO ) - { - tmp16 = GAIN_Q_OFFSET_EVS_FX_Q0; - move16(); - } - ELSE - { - tmp16 = GAIN_Q_OFFSET_IVAS_FX_Q0; - move16(); - } - - const Word16 gain_q_offset = tmp16; /* Q0 */ - move16(); - - invTrfMatrix_fx = (Word32 *) tmpRAM_fx; /*Q31*/ - - hFdCngCom = ( st->hFdCngDec )->hFdCngCom; - - sidNoiseEst = hFdCngCom->sidNoiseEst; /*Q16*/ - - N = hFdCngCom->npart; /*Q0*/ - move16(); - gain = 0; - move32(); - hFdCngCom->sid_frame_counter = add( hFdCngCom->sid_frame_counter, 1 ); - move16(); - - /* Read bitstream */ - FOR( i = 0; i < FD_CNG_stages_37bits; i++ ) - { - indices[i] = get_next_indice_fx( st, bits_37bits[i] ); /*Q0*/ - move16(); - } - - index = get_next_indice_fx( st, 7 ); - - /* MSVQ decoder */ - - IF( st->element_mode != EVS_MONO ) - { - create_IDCT_N_Matrix_fx( invTrfMatrix_fx, FDCNG_VQ_MAX_LEN, FDCNG_VQ_DCT_MAXTRUNC, FDCNG_VQ_MAX_LEN * FDCNG_VQ_DCT_MAXTRUNC ); - msvq_dec_fx( ivas_cdk_37bits_fx, NULL, NULL, FD_CNG_stages_37bits, N, FD_CNG_maxN_37bits, indices, 1, invTrfMatrix_fx, v, NULL, 7 ); - } - ELSE - { /* Legacy EVS_MONO MSVQ tables */ - msvq_dec_fx( cdk_37bits, NULL, NULL, FD_CNG_stages_37bits, N, FD_CNG_maxN_37bits, indices, 0, NULL, v, NULL, 7 ); - } - - - /* Decode gain */ - // gain = ((float)index - gain_q_offset) / 1.5f; - gain = L_mult0( sub( index, gain_q_offset ), 21845 ); // Q15 - - /* Apply gain and undo log */ - Word16 res_exp[NPART]; - Word16 max_res_exp = 0; - move16(); - FOR( i = 0; i < N; i++ ) - { - sidNoiseEst[i] = BASOP_util_Pow2( Mpy_32_32( L_add( v[i], gain ), LOG_10_BASE_2_BY_10_Q31 ), Q16, &res_exp[i] ); /*Q31 - res_exp[i]*/ - move32(); - if ( LT_16( max_res_exp, res_exp[i] ) ) - { - max_res_exp = res_exp[i]; - move16(); - } - } - - FOR( i = 0; i < N; i++ ) - { - sidNoiseEst[i] = L_shr( sidNoiseEst[i], sub( max_res_exp, res_exp[i] ) ); /*Q31 - max_res_exp*/ - move32(); - } - - hFdCngCom->sidNoiseEstExp = max_res_exp; - move16(); - - /* NB last band energy compensation */ - - IF( hFdCngCom->CngBandwidth == NB ) - { - sidNoiseEst[( N - 1 )] = Mpy_32_16_1( sidNoiseEst[( N - 1 )], NB_LAST_BAND_SCALE ); /*Q31 - max_res_exp*/ - move32(); - } - - test(); - IF( EQ_16( hFdCngCom->CngBandwidth, SWB ) && LE_32( hFdCngCom->CngBitrate, ACELP_13k20 ) ) - { - sidNoiseEst[( N - 1 )] = Mpy_32_16_1( sidNoiseEst[( N - 1 )], SWB_13k2_LAST_BAND_SCALE ); /*Q31 - max_res_exp*/ - move32(); - } - - scalebands( sidNoiseEst, hFdCngCom->part, hFdCngCom->npart, hFdCngCom->midband, hFdCngCom->nFFTpart, sub( hFdCngCom->stopBand, hFdCngCom->startBand ), hFdCngCom->cngNoiseLevel, 1 ); - Word16 shift1 = L_norm_arr( hFdCngCom->cngNoiseLevel, sub( hFdCngCom->stopBand, hFdCngCom->startBand ) ); - Word16 shift2 = L_norm_arr( hFdCngCom->cngNoiseLevel + sub( hFdCngCom->stopBand, hFdCngCom->startBand ), sub( FFTCLDFBLEN, sub( hFdCngCom->stopBand, hFdCngCom->startBand ) ) ); - Word16 shift = s_max( sub( hFdCngCom->sidNoiseEstExp, shift1 ), sub( hFdCngCom->cngNoiseLevelExp, shift2 ) ); - - scale_sig32( hFdCngCom->cngNoiseLevel, sub( hFdCngCom->stopBand, hFdCngCom->startBand ), sub( hFdCngCom->sidNoiseEstExp, shift ) ); - scale_sig32( hFdCngCom->cngNoiseLevel + sub( hFdCngCom->stopBand, hFdCngCom->startBand ), sub( FFTCLDFBLEN, sub( hFdCngCom->stopBand, hFdCngCom->startBand ) ), sub( hFdCngCom->cngNoiseLevelExp, shift ) ); - - hFdCngCom->cngNoiseLevelExp = shift; - move16(); - - lpc_from_spectrum( hFdCngCom, hFdCngCom->startBand, hFdCngCom->stopFFTbin, st->preemph_fac ); - - return; -} -#endif /*HARMONIZE_2494_FdCng_decodeSID_fx*/ /*------------------------------------------------------------------- * generate_masking_noise_ivas_fx() -- GitLab From 6d2d3bdf8b4c96894ba6b3df542c577ed9a59f59 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 19 Apr 2026 19:18:32 +0200 Subject: [PATCH 04/12] [cleanup] accept FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM --- lib_com/options.h | 1 - lib_com/prot_fx.h | 4 --- lib_dec/core_dec_init_fx.c | 70 ------------------------------------ lib_dec/core_dec_switch_fx.c | 4 --- lib_dec/init_dec_fx.c | 4 --- 5 files changed, 83 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 473763a17..f8c7c7630 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -92,7 +92,6 @@ #define NONBE_FIX_ISSUE_2206_AVOID_OVERFLOW_MSVQ_Interpol_Tran_fx /* FhG: Fix saturation crash in MSVQ_Interpol_Tran_fx() */ #define NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT_FIX_2527 /* Fix crash from issue #2527 */ #define FIX_FLOAT_1539_G192_FORMAT_SWITCH /* VA/Nokia: reintroduce format switching for g192 bitstreams */ -#define FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM /* FhG: BASOP 2509: st->hTcxCfg->psychParamsCurrent is not initialized */ #define HARMONIZE_2499_CONFIGUREFDCNGDEC /* FhG: basop issue 2499: harmonoize configureFdCngDec */ #define FIX_BASOP_2530_IVAS_DECISION_MAT /* VA: Fix ambiguous usage of extract_l() */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 2106b78ff..90c2710a4 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -7212,12 +7212,8 @@ ivas_error ppp_quarter_decoder_fx( void open_decoder_LPD_fx( Decoder_State *st, const Word32 total_brate, /* Q0 */ -#ifndef FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM - const Word16 bwidth /* Q0 */ -#else const Word16 bwidth, /* Q0 */ const Word16 is_init /* i : indicate call during initialization */ -#endif ); void open_decoder_LPD_ivas_fx( diff --git a/lib_dec/core_dec_init_fx.c b/lib_dec/core_dec_init_fx.c index 357a57f0b..bd77b1f1d 100644 --- a/lib_dec/core_dec_init_fx.c +++ b/lib_dec/core_dec_init_fx.c @@ -20,12 +20,8 @@ void open_decoder_LPD_fx( Decoder_State *st, const Word32 total_brate, /* Q0 */ -#ifndef FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM - const Word16 bwidth /* Q0 */ -#else const Word16 bwidth, /* Q0 */ const Word16 is_init /* i : indicate call during initialization */ -#endif ) { Word16 i; @@ -211,7 +207,6 @@ void open_decoder_LPD_fx( set16_fx( hBWE_TD->cur_sub_Aq_fx, 0, M + 1 ); /* Q12 */ } -#ifdef FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM IF( st->hIGFDec != NULL ) { test(); @@ -233,71 +228,6 @@ void open_decoder_LPD_fx( { resetTecDec_Fx( st->hTECDec ); } -#else - /*TCX config*/ - st->hTcxCfg->preemph_fac = st->preemph_fac; - move16(); - st->hTcxCfg->tcx_mdct_window_length_old = st->hTcxCfg->tcx_mdct_window_length; - move16(); - init_TCX_config( st->hTcxCfg, st->L_frame, st->fscale, hTcxDec->L_frameTCX, fscaleFB ); // TEMPORARY should be rename to init_TCX_config - IF( st->ini_frame == 0 ) - { - st->hTcxCfg->tcx_last_overlap_mode = st->hTcxCfg->tcx_curr_overlap_mode = ALDO_WINDOW; - move16(); - move16(); - } - - /* TCX Offset */ - st->hTcxCfg->tcx_offset = shr( st->hTcxCfg->tcx_mdct_window_delay, 1 ); /* Q0 */ - move16(); - st->hTcxCfg->tcx_offsetFB = shr( st->hTcxCfg->tcx_mdct_window_delayFB, 1 ); /* Q0 */ - move16(); - - /* Initialize FAC */ - st->hTcxCfg->lfacNext = sub( st->hTcxCfg->tcx_offset, shr( st->L_frame, 2 ) ); /* Q0 */ - move16(); - st->hTcxCfg->lfacNextFB = sub( st->hTcxCfg->tcx_offsetFB, shr( hTcxDec->L_frameTCX, 2 ) ); /* Q0 */ - move16(); - - /* set number of coded lines */ - st->hTcxCfg->tcx_coded_lines = getNumTcxCodedLines( st->bwidth ); - move16(); - - /* TNS in TCX */ - st->hTcxCfg->pCurrentTnsConfig = NULL; - st->hTcxCfg->fIsTNSAllowed = getTnsAllowed( st->total_brate, st->igf, st->element_mode ); - move16(); - - IF( st->hTcxCfg->fIsTNSAllowed != 0 ) - { - InitTnsConfigs_fx( st->bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFDec->infoIGFStopFreq, st->total_brate, st->element_mode, 0 /*is_mct*/ ); - } - /*Constraint for adaptive BPF, otherwise parameter estimation and post-processing not time aligned*/ - if ( st->tcxonly == 0 ) - { - assert( 0 == ( st->hTcxCfg->lfacNext > 0 ? st->hTcxCfg->lfacNext : 0 ) ); - } - - IF( 1 ) // st->element_mode == EVS_MONO) - { - IF( st->hTECDec == NULL ) - { - IF( ( st->hTECDec = (TEC_DEC_HANDLE) malloc( sizeof( TEC_DEC_DATA ) ) ) == NULL ) - { - // return (IVAS_ERROR(IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TEC\n")); - assert( 0 ); - } - } - } - ELSE - { - st->hTECDec = NULL; - } - resetTecDec_Fx( st->hTECDec ); - - /* Initialize decoder delay */ - -#endif if ( NE_16( st->element_mode, IVAS_SCE ) ) { diff --git a/lib_dec/core_dec_switch_fx.c b/lib_dec/core_dec_switch_fx.c index ea55dd251..a9d9d24d7 100644 --- a/lib_dec/core_dec_switch_fx.c +++ b/lib_dec/core_dec_switch_fx.c @@ -89,11 +89,7 @@ void mode_switch_decoder_LPD_fx( test(); IF( NE_16( fscale, st->fscale ) || ( switchWB != 0 ) || ( bSwitchFromAmrwbIO != 0 ) || EQ_16( st->last_codec_mode, MODE1 ) || st->force_lpd_reset ) { -#ifdef FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM open_decoder_LPD_fx( st, total_brate, bwidth, 0 ); -#else - open_decoder_LPD_fx( st, total_brate, bwidth ); -#endif } ELSE { diff --git a/lib_dec/init_dec_fx.c b/lib_dec/init_dec_fx.c index d3b61ab39..9ab72547b 100644 --- a/lib_dec/init_dec_fx.c +++ b/lib_dec/init_dec_fx.c @@ -881,11 +881,7 @@ ivas_error init_decoder_fx( /* Init Decoder */ IF( st_fx->element_mode == EVS_MONO ) { -#ifdef FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM open_decoder_LPD_fx( st_fx, st_fx->total_brate, st_fx->bwidth, 1 ); -#else - open_decoder_LPD_fx( st_fx, st_fx->total_brate, st_fx->bwidth ); -#endif } ELSE { -- GitLab From 3497a75bb5892e2559bb4d5562e847434c5dc94d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 19 Apr 2026 19:19:26 +0200 Subject: [PATCH 05/12] [cleanup] accept FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT --- lib_com/low_rate_band_att_fx.c | 26 -------------------------- lib_com/options.h | 1 - lib_com/prot_fx.h | 3 --- lib_dec/peak_vq_dec_fx.c | 5 ----- lib_dec/pvq_core_dec_fx.c | 5 ----- lib_enc/peak_vq_enc_fx.c | 5 ----- lib_enc/pvq_core_enc_fx.c | 5 ----- 7 files changed, 50 deletions(-) diff --git a/lib_com/low_rate_band_att_fx.c b/lib_com/low_rate_band_att_fx.c index d31e032b9..e259295f5 100644 --- a/lib_com/low_rate_band_att_fx.c +++ b/lib_com/low_rate_band_att_fx.c @@ -27,9 +27,6 @@ void fine_gain_pred_fx( Word16 *xq, /* i/o: Quantized vector /quantized vector with finegain adj Q15*/ Word16 *y, /* i/o: Quantized vector (int) Q0 */ Word16 *fg_pred, /* o : Predicted fine gains Q12 */ -#ifndef FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT - const Word16 element_mode, /* i : element mode */ -#endif const Word16 core /* i : Core */ ) { @@ -76,7 +73,6 @@ void fine_gain_pred_fx( exp = sub( 31, add( exp, sub( 30, shl( shift, 1 ) ) ) ); L_tmp = Isqrt_lc( L_tmp, &exp ); /*31 - exp */ -#ifdef FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT IF( EQ_16( sfm_size[0], 10 ) ) /* If sfm_size[0] is 10, it means the extended ACELP->HQ transition frame is used. See hq_configure_fx(). */ { bw_idx = band_len_idx_ext[shr( bw, 3 )]; @@ -86,28 +82,6 @@ void fine_gain_pred_fx( { tmp1 = fine_gain_pred_sqrt_bw[bw_idx]; } -#else - IF( element_mode == EVS_MONO ) - { - tmp1 = fine_gain_pred_sqrt_bw[bw_idx]; - } - ELSE - { - IF( EQ_16( sfm_size[0], 10 ) ) /* If sfm_size[0] is 10, it means the extended ACELP->HQ transition frame is used. See hq_configure_fx(). */ - { - bw_idx = band_len_idx_ext[shr( bw, 3 )]; - tmp1 = fine_gain_pred_sqrt_bw_ext[bw_idx]; - } - ELSE - { - tmp1 = fine_gain_pred_sqrt_bw[bw_idx]; - if ( EQ_16( bw_idx, 0 ) ) - { - tmp1--; /* Lookup table uses rounding while calculations use truncation */ - } - } - } -#endif Mpy_32_16_ss( L_tmp, tmp1, &L_tmp, &lsb ); /*31-exp+11-15=27-exp */ gp = round_fx_sat( L_shl_sat( L_tmp, add( 1, exp ) ) ); /*27-exp+1+exp-16=12 */ test(); diff --git a/lib_com/options.h b/lib_com/options.h index f8c7c7630..bf1d6a6bb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -101,7 +101,6 @@ /* #################### Start NON-BE switches ############################ */ /* any switch which is non-be wrt. TS 26.251 V3.0 */ -#define FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT /* Eri: Basop issue 2486: IVAS BASOP used calculations with truncation, EVS BASOP used rounding. This aligns the use of a table lookup. */ #define FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API /* Expose Payload Type setting in RTP Header */ #define FIX_BASOP_2511_PROTO_REF_POWER_FIX /* FhG: BASOP 2511; Fix reference power computation in protoSignalComputation_shd_fx() */ #define FIX_BASOP_2512_WRONG_SHIFT_IN_DIRAC_CONFIG /* Nokia: BASOP 2512: Fix wrong division by shift */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 90c2710a4..a7f4e0587 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -4426,9 +4426,6 @@ void fine_gain_pred_fx( Word16 *xq, /* i/o: Quantized vector /quantized vector with finegain adj Q15*/ Word16 *y, /* i/o: Quantized vector (int) */ Word16 *fg_pred, /* o : Predicted fine gains Q12 */ -#ifndef FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT - const Word16 element_mode, /* i : element mode */ -#endif const Word16 core /* i : Core */ ); diff --git a/lib_dec/peak_vq_dec_fx.c b/lib_dec/peak_vq_dec_fx.c index f345c61ee..cf12153fd 100644 --- a/lib_dec/peak_vq_dec_fx.c +++ b/lib_dec/peak_vq_dec_fx.c @@ -321,13 +321,8 @@ static void peak_vq_dec_fx( pvq_decode_frame_fx( st_fx, pvq_vector, npulses, pvq_inp_vector, hvq_band_start, hvq_band_end, hvq_band_width, pvq_bands, Rk, pvq_bits, core ); -#ifdef FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT fine_gain_pred_fx( hvq_band_start, hvq_band_end, hvq_band_width, k_sort, npulses, pvq_maxpulse, NULL, pvq_bands, pvq_vector, pvq_inp_vector, fg_pred, core ); -#else - fine_gain_pred_fx( hvq_band_start, hvq_band_end, hvq_band_width, k_sort, npulses, pvq_maxpulse, NULL, - pvq_bands, pvq_vector, pvq_inp_vector, fg_pred, st_fx->element_mode, core ); -#endif fine_gain_dec_fx( st_fx, k_sort, pvq_bands, gain_bits_array, fg_pred ); diff --git a/lib_dec/pvq_core_dec_fx.c b/lib_dec/pvq_core_dec_fx.c index 1d02cb818..6673c9f33 100644 --- a/lib_dec/pvq_core_dec_fx.c +++ b/lib_dec/pvq_core_dec_fx.c @@ -277,13 +277,8 @@ Word16 pvq_core_dec_fx( get_max_pulses_fx( sfm_start, sfm_end, ord, npulses, nb_sfm, pulse_vector, maxpulse ); -#ifdef FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT fine_gain_pred_fx( sfm_start, sfm_end, sfmsize, ord, npulses, maxpulse, R, nb_sfm, coefs_quant, pulse_vector, fg_pred, core ); -#else - fine_gain_pred_fx( sfm_start, sfm_end, sfmsize, ord, npulses, maxpulse, R, - nb_sfm, coefs_quant, pulse_vector, fg_pred, st_fx->element_mode, core ); -#endif fine_gain_dec_fx( st_fx, ord, nb_sfm, gain_bits_array, fg_pred ); IF( st_fx->hHQ_core != NULL ) diff --git a/lib_enc/peak_vq_enc_fx.c b/lib_enc/peak_vq_enc_fx.c index 6d7208bb8..2e396e3d0 100644 --- a/lib_enc/peak_vq_enc_fx.c +++ b/lib_enc/peak_vq_enc_fx.c @@ -402,13 +402,8 @@ Word16 peak_vq_enc_fx( move16(); } -#ifdef FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT fine_gain_pred_fx( hvq_band_start, hvq_band_end, hvq_band_width, k_sort, npulses, NULL, NULL, pvq_bands, coefs_pvq, pvq_inp_vector, fg_pred, HQ_CORE ); -#else - fine_gain_pred_fx( hvq_band_start, hvq_band_end, hvq_band_width, k_sort, npulses, NULL, NULL, pvq_bands, coefs_pvq, - pvq_inp_vector, fg_pred, element_mode, HQ_CORE ); -#endif pCoefsOut = &coefs_out[0]; pSelBnds = &sel_bnds[0]; diff --git a/lib_enc/pvq_core_enc_fx.c b/lib_enc/pvq_core_enc_fx.c index 23f3bcb58..397e45662 100644 --- a/lib_enc/pvq_core_enc_fx.c +++ b/lib_enc/pvq_core_enc_fx.c @@ -323,13 +323,8 @@ Word16 pvq_core_enc_fx( get_max_pulses_fx( sfm_start, sfm_end, ord, npulses, nb_sfm, pulse_vector, maxpulse ); /* Fine gain prediction */ -#ifdef FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT fine_gain_pred_fx( sfm_start, sfm_end, sfmsize, ord, npulses, maxpulse, R, nb_sfm, coefs_quant, pulse_vector, fg_pred, core ); -#else - fine_gain_pred_fx( sfm_start, sfm_end, sfmsize, ord, npulses, maxpulse, R, nb_sfm, - coefs_quant, pulse_vector, fg_pred, element_mode, core ); -#endif fine_gain_quant_fx( hBstr, ord, nb_sfm, gain_bits_array, fg_pred, gopt ); -- GitLab From 90aab4dfa5f50d8382e6fee18f18f149c3919cf9 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 19 Apr 2026 19:20:13 +0200 Subject: [PATCH 06/12] [cleanup] accept FIX_BASOP_2511_PROTO_REF_POWER_FIX --- lib_com/options.h | 1 - lib_rend/ivas_dirac_rend_fx.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index bf1d6a6bb..50c04cacc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -102,7 +102,6 @@ /* any switch which is non-be wrt. TS 26.251 V3.0 */ #define FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API /* Expose Payload Type setting in RTP Header */ -#define FIX_BASOP_2511_PROTO_REF_POWER_FIX /* FhG: BASOP 2511; Fix reference power computation in protoSignalComputation_shd_fx() */ #define FIX_BASOP_2512_WRONG_SHIFT_IN_DIRAC_CONFIG /* Nokia: BASOP 2512: Fix wrong division by shift */ #define FIX_BASOP_2513_EXTRA_RETURN_REND_OPEN /* Nokia: BASOP issue 2513: Removes extra return block */ #define FIX_BASOP_2514_EFAP_PORTING_ERROR /* Nokia: BASOP issue 2514: Fix wrongly ported line */ diff --git a/lib_rend/ivas_dirac_rend_fx.c b/lib_rend/ivas_dirac_rend_fx.c index 97695ce39..ccfc7795a 100644 --- a/lib_rend/ivas_dirac_rend_fx.c +++ b/lib_rend/ivas_dirac_rend_fx.c @@ -1492,11 +1492,7 @@ void protoSignalComputation_shd_fx( move32(); *p_k_fx[k] = L_shl( *p_k_fx[k], Q1 ); // left shift is done to maintain constant Q factor Q(q_cldfb+min_q_shift) move32(); -#ifdef FIX_BASOP_2511_PROTO_REF_POWER_FIX reference_power_fx[idx1] = Madd_32_32( reference_power_fx[idx1], *p_k_fx[k], *p_k_fx[k] ); // Q(2*(q_cldfb + min_q_shift)-31) -#else - reference_power_fx[idx1] = Mpy_32_32( *p_k_fx[k], *p_k_fx[k] ); // Q(2*(q_cldfb + min_q_shift)-31) -#endif move32(); p_k_fx[k]++; -- GitLab From 4410392a27b5838a6cc7b3591f189a68f59e7aa3 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 19 Apr 2026 19:21:04 +0200 Subject: [PATCH 07/12] [cleanup] accept FIX_BASOP_2512_WRONG_SHIFT_IN_DIRAC_CONFIG --- lib_com/options.h | 1 - lib_rend/ivas_dirac_rend_fx.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 50c04cacc..79af8c3df 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -102,7 +102,6 @@ /* any switch which is non-be wrt. TS 26.251 V3.0 */ #define FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API /* Expose Payload Type setting in RTP Header */ -#define FIX_BASOP_2512_WRONG_SHIFT_IN_DIRAC_CONFIG /* Nokia: BASOP 2512: Fix wrong division by shift */ #define FIX_BASOP_2513_EXTRA_RETURN_REND_OPEN /* Nokia: BASOP issue 2513: Removes extra return block */ #define FIX_BASOP_2514_EFAP_PORTING_ERROR /* Nokia: BASOP issue 2514: Fix wrongly ported line */ #define FIX_BASOP_2516_REND_CUSTOM_LAYOUT_PORT_BUG /* Nokia: BASOP issue 2516: Fix porting bug in setting planar state for custom layout in renderer */ diff --git a/lib_rend/ivas_dirac_rend_fx.c b/lib_rend/ivas_dirac_rend_fx.c index ccfc7795a..10092f166 100644 --- a/lib_rend/ivas_dirac_rend_fx.c +++ b/lib_rend/ivas_dirac_rend_fx.c @@ -331,11 +331,7 @@ ivas_error ivas_spat_hSpatParamRendCom_config_fx( ELSE { Word16 num_slots_in_subfr, tmp; -#ifdef FIX_BASOP_2512_WRONG_SHIFT_IN_DIRAC_CONFIG tmp = 0; -#else - tmp = 1; -#endif move16(); num_slots_in_subfr = 1; -- GitLab From 8c5646af6cd3cf1c9c90289f10bb8a642371088f Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 19 Apr 2026 19:21:48 +0200 Subject: [PATCH 08/12] [cleanup] accept FIX_BASOP_2513_EXTRA_RETURN_REND_OPEN --- lib_com/options.h | 1 - lib_rend/lib_rend_fx.c | 5 ----- 2 files changed, 6 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 79af8c3df..8f6c02b7e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -102,7 +102,6 @@ /* any switch which is non-be wrt. TS 26.251 V3.0 */ #define FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API /* Expose Payload Type setting in RTP Header */ -#define FIX_BASOP_2513_EXTRA_RETURN_REND_OPEN /* Nokia: BASOP issue 2513: Removes extra return block */ #define FIX_BASOP_2514_EFAP_PORTING_ERROR /* Nokia: BASOP issue 2514: Fix wrongly ported line */ #define FIX_BASOP_2516_REND_CUSTOM_LAYOUT_PORT_BUG /* Nokia: BASOP issue 2516: Fix porting bug in setting planar state for custom layout in renderer */ #define USE_RTPDUMP /* FhG: RTPDUMP format (rtptools standard) instead of custom format */ diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 1c10f3488..aee543d54 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -4028,11 +4028,6 @@ ivas_error IVAS_REND_Open( return error; } } -#ifndef FIX_BASOP_2513_EXTRA_RETURN_REND_OPEN - { - return error; - } -#endif } return IVAS_ERR_OK; -- GitLab From d05234b6d9664ecca8c0b1de586f0bb6d52fbabb Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 19 Apr 2026 19:22:36 +0200 Subject: [PATCH 09/12] [cleanup] accept FIX_BASOP_2514_EFAP_PORTING_ERROR --- lib_com/options.h | 1 - lib_rend/ivas_efap_fx.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 8f6c02b7e..7850f4396 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -102,7 +102,6 @@ /* any switch which is non-be wrt. TS 26.251 V3.0 */ #define FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API /* Expose Payload Type setting in RTP Header */ -#define FIX_BASOP_2514_EFAP_PORTING_ERROR /* Nokia: BASOP issue 2514: Fix wrongly ported line */ #define FIX_BASOP_2516_REND_CUSTOM_LAYOUT_PORT_BUG /* Nokia: BASOP issue 2516: Fix porting bug in setting planar state for custom layout in renderer */ #define USE_RTPDUMP /* FhG: RTPDUMP format (rtptools standard) instead of custom format */ #define FIX_FLOAT_1569_REND_RENDER_CONFIG_CHECKS /* Nokia: float issue 1569: fix render config checks in renderer */ diff --git a/lib_rend/ivas_efap_fx.c b/lib_rend/ivas_efap_fx.c index 2f1157e14..7b7a5244f 100644 --- a/lib_rend/ivas_efap_fx.c +++ b/lib_rend/ivas_efap_fx.c @@ -1064,11 +1064,7 @@ static void add_vertex_to_convex_hull_fx( move32(); centroid[1] = Mpy_32_32( centroid[1], tmp32 ); // q27 move32(); -#ifdef FIX_BASOP_2514_EFAP_PORTING_ERROR centroid[2] = Mpy_32_32( centroid[2], tmp32 ); // q27 -#else - centroid[2] = Mpy_32_32( centroid[1], tmp32 ); // q27 -#endif move32(); centroid[0] = L_shl( centroid[0], 4 ); // q31 -- GitLab From 9dd47ee983abf226a35bd43d6ebaeb7eb0b5aac2 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 19 Apr 2026 19:23:33 +0200 Subject: [PATCH 10/12] [cleanup] accept FIX_BASOP_2516_REND_CUSTOM_LAYOUT_PORT_BUG --- lib_com/options.h | 1 - lib_rend/lib_rend_fx.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7850f4396..53dddfa4b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -102,7 +102,6 @@ /* any switch which is non-be wrt. TS 26.251 V3.0 */ #define FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API /* Expose Payload Type setting in RTP Header */ -#define FIX_BASOP_2516_REND_CUSTOM_LAYOUT_PORT_BUG /* Nokia: BASOP issue 2516: Fix porting bug in setting planar state for custom layout in renderer */ #define USE_RTPDUMP /* FhG: RTPDUMP format (rtptools standard) instead of custom format */ #define FIX_FLOAT_1569_REND_RENDER_CONFIG_CHECKS /* Nokia: float issue 1569: fix render config checks in renderer */ #define FIX_BASOP_2526_SPAR_MASA_PARAM_MAP_Q_BUG /* Nokia: BASOP issue 2526: Fix wrong Q variable in SPAR to MASA param mapping */ diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index aee543d54..23823fe11 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -4049,11 +4049,7 @@ static LSSETUP_CUSTOM_STRUCT makeCustomLsSetup( move16(); FOR( i = 0; i < rendCustomLsLayout.num_spk; ++i ) { -#ifdef FIX_BASOP_2516_REND_CUSTOM_LAYOUT_PORT_BUG IF( GT_32( L_abs( rendCustomLsLayout.elevation_fx[i] ), EPSILON_FX ) ) -#else - IF( LT_32( L_abs( rendCustomLsLayout.elevation_fx[i] ), EPSILON_FX ) ) -#endif { customLs.is_planar_setup = 0; move16(); -- GitLab From 099c0834523c75a298f18fc05e62df6b683b4ee7 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 19 Apr 2026 19:25:01 +0200 Subject: [PATCH 11/12] formatting --- lib_com/low_rate_band_att_fx.c | 2 +- lib_com/prot_fx.h | 6 +++--- lib_dec/core_dec_init_fx.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib_com/low_rate_band_att_fx.c b/lib_com/low_rate_band_att_fx.c index e259295f5..ecb48c49e 100644 --- a/lib_com/low_rate_band_att_fx.c +++ b/lib_com/low_rate_band_att_fx.c @@ -27,7 +27,7 @@ void fine_gain_pred_fx( Word16 *xq, /* i/o: Quantized vector /quantized vector with finegain adj Q15*/ Word16 *y, /* i/o: Quantized vector (int) Q0 */ Word16 *fg_pred, /* o : Predicted fine gains Q12 */ - const Word16 core /* i : Core */ + const Word16 core /* i : Core */ ) { Word16 i, band; diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index a7f4e0587..54eb3d51a 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -4426,7 +4426,7 @@ void fine_gain_pred_fx( Word16 *xq, /* i/o: Quantized vector /quantized vector with finegain adj Q15*/ Word16 *y, /* i/o: Quantized vector (int) */ Word16 *fg_pred, /* o : Predicted fine gains Q12 */ - const Word16 core /* i : Core */ + const Word16 core /* i : Core */ ); void fine_gain_quant_fx( @@ -7209,8 +7209,8 @@ ivas_error ppp_quarter_decoder_fx( void open_decoder_LPD_fx( Decoder_State *st, const Word32 total_brate, /* Q0 */ - const Word16 bwidth, /* Q0 */ - const Word16 is_init /* i : indicate call during initialization */ + const Word16 bwidth, /* Q0 */ + const Word16 is_init /* i : indicate call during initialization */ ); void open_decoder_LPD_ivas_fx( diff --git a/lib_dec/core_dec_init_fx.c b/lib_dec/core_dec_init_fx.c index bd77b1f1d..dbffbcc02 100644 --- a/lib_dec/core_dec_init_fx.c +++ b/lib_dec/core_dec_init_fx.c @@ -20,8 +20,8 @@ void open_decoder_LPD_fx( Decoder_State *st, const Word32 total_brate, /* Q0 */ - const Word16 bwidth, /* Q0 */ - const Word16 is_init /* i : indicate call during initialization */ + const Word16 bwidth, /* Q0 */ + const Word16 is_init /* i : indicate call during initialization */ ) { Word16 i; -- GitLab From dbefb3ac1faaa6ce53fceceedbb6702c340f19db Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 19 Apr 2026 19:25:35 +0200 Subject: [PATCH 12/12] formatting --- lib_com/options.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 53dddfa4b..c09e1ff3d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -95,7 +95,6 @@ #define HARMONIZE_2499_CONFIGUREFDCNGDEC /* FhG: basop issue 2499: harmonoize configureFdCngDec */ #define FIX_BASOP_2530_IVAS_DECISION_MAT /* VA: Fix ambiguous usage of extract_l() */ - /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ -- GitLab