From c8406caebd084ba9fab7bc4d1774b9920457eae9 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Fri, 29 May 2026 21:17:28 +0200 Subject: [PATCH 1/3] [cleanup] accept FIX_FLOAT_1539_G192_FORMAT_SWITCH --- apps/decoder.c | 18 ----- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 154 ---------------------------------------- 3 files changed, 173 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 752fc401d..dc6d047ea 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -175,11 +175,7 @@ typedef struct static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); -#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf ); -#else -static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); -#endif static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf ); static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs ); #ifdef DEBUGGING @@ -781,11 +777,7 @@ int main( } else { -#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH error = decodeG192( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, &hIvasDec, pcmBuf ); -#else - error = decodeG192( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, hIvasDec, pcmBuf ); -#endif } if ( error == IVAS_ERR_OK || error == IVAS_ERR_END_OF_FILE ) @@ -2232,11 +2224,7 @@ static ivas_error decodeG192( Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, -#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH IVAS_DEC_HANDLE *phIvasDec, -#else - IVAS_DEC_HANDLE hIvasDec, -#endif int16_t *pcmBuf ) { @@ -2244,9 +2232,7 @@ static ivas_error decodeG192( uint16_t bit_stream[IVAS_MAX_BITS_PER_FRAME + 4 * 8]; int16_t i, num_bits; int16_t bfi = 0; -#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH IVAS_DEC_HANDLE hIvasDec = *phIvasDec; -#endif #ifdef DEBUGGING int16_t fec_seed = 12558; /* FEC_SEED */ #endif @@ -2277,9 +2263,7 @@ static ivas_error decodeG192( int16_t vec_pos_update, vec_pos_len; SplitFileReadWrite *splitRendWriter = NULL; int16_t isSplitRend, isSplitCoded; -#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH bool restartNeeded; -#endif #ifdef VARIABLE_SPEED_DECODING if ( arg.tsmEnabled ) @@ -2609,7 +2593,6 @@ static ivas_error decodeG192( return error; } -#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH if ( ( error = IVAS_DEC_isRestartNeeded( hIvasDec, &restartNeeded ) ) != IVAS_ERR_OK ) { return error; @@ -2623,7 +2606,6 @@ static ivas_error decodeG192( goto cleanup; } } -#endif /* Placeholder for memory reallocation */ /* ... */ diff --git a/lib_com/options.h b/lib_com/options.h index d2ccffc1d..2c2764dee 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #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_FLOAT_1539_G192_FORMAT_SWITCH /* Nokia: reintroduce format switching for g192 bitstreams */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 09b1da512..f9cd9aec4 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -106,9 +106,6 @@ ivas_error ivas_dec_get_format( int16_t nchan_ism, element_mode_flag; int16_t sba_order, sba_planar, sba_analysis_order; int32_t ivas_total_brate; -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - int16_t Opt_tsm; -#endif uint16_t *bit_stream_orig; AUDIO_CONFIG signaled_config; ivas_error error; @@ -117,9 +114,6 @@ ivas_error ivas_dec_get_format( element_mode_flag = 0; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - Opt_tsm = st_ivas->hDecoderConfig->Opt_tsm; -#endif bit_stream_orig = st_ivas->bit_stream; /*-------------------------------------------------------------------* @@ -135,23 +129,9 @@ ivas_error ivas_dec_get_format( !( st_ivas->ivas_format == MASA_FORMAT && st_ivas->last_ivas_format == MASA_ISM_FORMAT ) && !( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->last_ivas_format == MASA_FORMAT ) ) { -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - if ( Opt_tsm ) - { -#endif st_ivas->restartNeeded = 1; return IVAS_ERR_OK; -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - } - else - { -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); - } -#endif } /*-------------------------------------------------------------------* @@ -185,23 +165,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && nchan_ism != st_ivas->nchan_ism ) { -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - if ( Opt_tsm ) - { -#endif st_ivas->restartNeeded = 1; return IVAS_ERR_OK; -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - } - else - { -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); - } -#endif } st_ivas->nchan_ism = nchan_ism; @@ -221,23 +187,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && sba_planar != st_ivas->sba_planar ) { -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - if ( Opt_tsm ) - { -#endif st_ivas->restartNeeded = 1; return IVAS_ERR_OK; -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - } - else - { -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the SBA planar/3D layout is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA planar flag signalled!" ); - } -#endif } /* read Ambisonic (SBA) order */ @@ -246,23 +198,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && sba_order != st_ivas->sba_order ) { -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - if ( Opt_tsm ) - { -#endif st_ivas->restartNeeded = 1; return IVAS_ERR_OK; -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - } - else - { -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the SBA order is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" ); - } -#endif } sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, sba_order ); @@ -275,11 +213,7 @@ ivas_error ivas_dec_get_format( /* read number of MASA transport channels */ if ( st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 1] ) { -#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH if ( st_ivas->nchan_transport == 1 ) -#else - if ( st_ivas->nchan_transport == 1 && Opt_tsm ) -#endif { masaRestartCandidate = 1; } @@ -289,11 +223,7 @@ ivas_error ivas_dec_get_format( } else { -#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH if ( st_ivas->nchan_transport == 2 ) -#else - if ( st_ivas->nchan_transport == 2 && Opt_tsm ) -#endif { masaRestartCandidate = 1; } @@ -334,23 +264,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && nchan_ism != st_ivas->nchan_ism ) { -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - if ( Opt_tsm ) - { -#endif st_ivas->restartNeeded = 1; return IVAS_ERR_OK; -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - } - else - { -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); - } -#endif } st_ivas->nchan_ism = nchan_ism; @@ -365,23 +281,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && nchan_ism != st_ivas->nchan_ism ) { -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - if ( Opt_tsm ) - { -#endif st_ivas->restartNeeded = 1; return IVAS_ERR_OK; -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - } - else - { -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); - } -#endif } st_ivas->nchan_ism = nchan_ism; @@ -393,23 +295,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && nchan_ism != st_ivas->nchan_ism ) { -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - if ( Opt_tsm ) - { -#endif st_ivas->restartNeeded = 1; return IVAS_ERR_OK; -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - } - else - { -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); - } -#endif } st_ivas->nchan_ism = nchan_ism; @@ -433,23 +321,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && sba_order != st_ivas->sba_order ) { -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - if ( Opt_tsm ) - { -#endif st_ivas->restartNeeded = 1; return IVAS_ERR_OK; -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - } - else - { -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the SBA order is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" ); - } -#endif } st_ivas->ism_mode = ivas_osba_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); @@ -474,23 +348,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && st_ivas->transport_config != signaled_config ) { -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - if ( Opt_tsm ) - { -#endif st_ivas->restartNeeded = 1; return IVAS_ERR_OK; -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - } - else - { -#ifdef DEBUGGING - fprintf( stderr, "\nError: Switching of MC configurations is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong MC configuration signalled!" ); - } -#endif } st_ivas->mc_mode = ivas_mc_mode_select( ivas_mc_map_output_config_to_mc_ls_setup( signaled_config ), ivas_total_brate ); @@ -572,23 +432,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && nchan_ism != st_ivas->nchan_ism ) { -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - if ( Opt_tsm ) - { -#endif st_ivas->restartNeeded = 1; return IVAS_ERR_OK; -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - } - else - { -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); - } -#endif } st_ivas->nchan_ism = nchan_ism; -- GitLab From a96b651ab750bd4e033bd49ef7b34e15689d1571 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Fri, 29 May 2026 21:18:18 +0200 Subject: [PATCH 2/3] [cleanup] accept FIX_2585_BIT_ALLOCATION_DIFF --- lib_com/gs_bitallocation.c | 8 -------- lib_com/options.h | 1 - 2 files changed, 9 deletions(-) diff --git a/lib_com/gs_bitallocation.c b/lib_com/gs_bitallocation.c index ef2e4835c..6ebb6f869 100644 --- a/lib_com/gs_bitallocation.c +++ b/lib_com/gs_bitallocation.c @@ -1022,21 +1022,13 @@ static Word16 Find_bit_alloc_IVAS( sum_bit = L_add( sum_bit, L_sub( bits_per_bands[i], Q18_112 ) ); /* bits_per_bands[i] = 112; */ bits_per_bands[i] = Q18_112; -#ifndef FIX_2585_BIT_ALLOCATION_DIFF - j = add( j, add( i, 1 ) ); -#else j = add( i, 1 ); -#endif } /* safety check for overage bit reallocation */ /* else if (bits_per_bands[i] + sum_bit / 3 > 112) */ else if ( L_add( bits_per_bands[i], Mpy_32_16_1( sum_bit, Q15_0_33 ) ) > Q18_112 ) { -#ifndef FIX_2585_BIT_ALLOCATION_DIFF - j = add( j, add( i, 1 ) ); -#else j = add( i, 1 ); -#endif } } diff --git a/lib_com/options.h b/lib_com/options.h index 2c2764dee..5b5c21c7b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -170,7 +170,6 @@ /* any switch which is non-be wrt. TS 26.258 V3.0 */ #define FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE /* Dolby: float issue 1576: fix for crash in LCLD mode when codec frame size is less than isar frame size */ -#define FIX_2585_BIT_ALLOCATION_DIFF /* VA : issue 2585, bit allocation different behaviors between float and fixed-point for corner cases */ #define FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI /* Nokia: BASOP issue 2442: Aligns float with identical diffuse gain limitation to minimize diff */ /* ##################### End NON-BE switches ########################### */ -- GitLab From 1d4140c679b3f894345c29ed0d8f8c4fac28de40 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Fri, 29 May 2026 21:21:14 +0200 Subject: [PATCH 3/3] formatting --- lib_dec/ivas_init_dec.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index f9cd9aec4..125939396 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -129,9 +129,9 @@ ivas_error ivas_dec_get_format( !( st_ivas->ivas_format == MASA_FORMAT && st_ivas->last_ivas_format == MASA_ISM_FORMAT ) && !( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->last_ivas_format == MASA_FORMAT ) ) { - st_ivas->restartNeeded = 1; + st_ivas->restartNeeded = 1; - return IVAS_ERR_OK; + return IVAS_ERR_OK; } /*-------------------------------------------------------------------* @@ -165,9 +165,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && nchan_ism != st_ivas->nchan_ism ) { - st_ivas->restartNeeded = 1; + st_ivas->restartNeeded = 1; - return IVAS_ERR_OK; + return IVAS_ERR_OK; } st_ivas->nchan_ism = nchan_ism; @@ -187,9 +187,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && sba_planar != st_ivas->sba_planar ) { - st_ivas->restartNeeded = 1; + st_ivas->restartNeeded = 1; - return IVAS_ERR_OK; + return IVAS_ERR_OK; } /* read Ambisonic (SBA) order */ @@ -198,9 +198,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && sba_order != st_ivas->sba_order ) { - st_ivas->restartNeeded = 1; + st_ivas->restartNeeded = 1; - return IVAS_ERR_OK; + return IVAS_ERR_OK; } sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, sba_order ); @@ -264,9 +264,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && nchan_ism != st_ivas->nchan_ism ) { - st_ivas->restartNeeded = 1; + st_ivas->restartNeeded = 1; - return IVAS_ERR_OK; + return IVAS_ERR_OK; } st_ivas->nchan_ism = nchan_ism; @@ -281,9 +281,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && nchan_ism != st_ivas->nchan_ism ) { - st_ivas->restartNeeded = 1; + st_ivas->restartNeeded = 1; - return IVAS_ERR_OK; + return IVAS_ERR_OK; } st_ivas->nchan_ism = nchan_ism; @@ -295,9 +295,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && nchan_ism != st_ivas->nchan_ism ) { - st_ivas->restartNeeded = 1; + st_ivas->restartNeeded = 1; - return IVAS_ERR_OK; + return IVAS_ERR_OK; } st_ivas->nchan_ism = nchan_ism; @@ -321,9 +321,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && sba_order != st_ivas->sba_order ) { - st_ivas->restartNeeded = 1; + st_ivas->restartNeeded = 1; - return IVAS_ERR_OK; + return IVAS_ERR_OK; } st_ivas->ism_mode = ivas_osba_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); @@ -348,9 +348,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && st_ivas->transport_config != signaled_config ) { - st_ivas->restartNeeded = 1; + st_ivas->restartNeeded = 1; - return IVAS_ERR_OK; + return IVAS_ERR_OK; } st_ivas->mc_mode = ivas_mc_mode_select( ivas_mc_map_output_config_to_mc_ls_setup( signaled_config ), ivas_total_brate ); @@ -432,9 +432,9 @@ ivas_error ivas_dec_get_format( if ( st_ivas->ini_frame > 0 && nchan_ism != st_ivas->nchan_ism ) { - st_ivas->restartNeeded = 1; + st_ivas->restartNeeded = 1; - return IVAS_ERR_OK; + return IVAS_ERR_OK; } st_ivas->nchan_ism = nchan_ism; -- GitLab