From c60aa4e6159492e3d42396dc7af7a5a6bbbb0d0e Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 31 Mar 2026 17:04:51 +0200 Subject: [PATCH 1/5] port FIX_FLOAT_1539_G192_FORMAT_SWITCH --- apps/decoder.c | 49 +++ lib_com/options.h | 1 + lib_dec/ivas_init_dec_fx.c | 865 +++++++++++++++++++------------------ 3 files changed, 498 insertions(+), 417 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index fca2d9e6e..5cf6f77f7 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -159,7 +159,11 @@ 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_RENDER_CONFIG_DATA *renderConfig, 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 ); static void do_object_editing_fx( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader ); @@ -668,7 +672,11 @@ 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 ) @@ -2002,7 +2010,11 @@ 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 ) { @@ -2010,6 +2022,9 @@ 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 AudioFileWriter *afWriter = NULL; MasaFileWriter *masaWriter = NULL; bool decodedGoodFrame = false; @@ -2033,6 +2048,9 @@ static ivas_error decodeG192( int16_t isSplitRend, isSplitCoded; IVAS_RENDER_CONFIG_DATA renderConfig; RenderConfigReader *renderConfigReader = NULL; +#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH + bool restartNeeded; +#endif #ifdef VARIABLE_SPEED_DECODING if ( arg.tsmEnabled ) @@ -2289,6 +2307,37 @@ 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; + } + + if ( restartNeeded ) + { + IVAS_DEC_BS_FORMAT tempFormat; + if ( ( error = IVAS_DEC_GetFormat( hIvasDec, &tempFormat ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetFormat, code: %d\n", error ); + goto cleanup; + } + IVAS_DEC_MODE codecMode = ( tempFormat == IVAS_DEC_BS_MONO ) ? IVAS_DEC_MODE_EVS : IVAS_DEC_MODE_IVAS; + error = restartDecoder( + &hIvasDec, + codecMode, + &arg, + NULL, /* ToDo : Provide rendererConfig */ + NULL /* ToDo : Provide LS Custom Data */ + ); + if ( error != IVAS_ERR_OK ) + { + fprintf( stderr, "\nFailed to restart decoder\n" ); + goto cleanup; + } + *phIvasDec = hIvasDec; /* Update for main()' s free */ + } +#endif + /* Placeholder for memory reallocation */ /* ... */ diff --git a/lib_com/options.h b/lib_com/options.h index 7976d55ed..efa8edeea 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -90,6 +90,7 @@ #define FIX_2479_HARM_PITCH_GAIN /* FhG: basop issue 2479: Harmonize tcx_ltp_pitch_search_*(), tcx_ltp_find_gain_*fx() */ #define HARMONIZE_2481_EXTEND_SHRINK /* FhG: basop issue 2481: Harmonize extend_frm_*fx() and shrink_frm_*fx() */ #define FIX_FLOAT_ISSUE_1546_DEAD_CODE /* FhG: remove dead code reported in the issue*/ +#define FIX_FLOAT_1539_G192_FORMAT_SWITCH /* VA/Nokia: reintroduce format switching for g192 bitstreams */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 52d38ed58..a2e56132e 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -108,8 +108,9 @@ ivas_error ivas_dec_get_format_fx( Word16 nchan_ism, element_mode_flag; Word16 sba_order, sba_planar, sba_analysis_order; Word32 ivas_total_brate; +#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH Word16 Opt_tsm; - +#endif UWord16 *bit_stream_orig; AUDIO_CONFIG signaled_config; ivas_error error; @@ -121,8 +122,10 @@ ivas_error ivas_dec_get_format_fx( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; move32(); +#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH Opt_tsm = st_ivas->hDecoderConfig->Opt_tsm; move16(); +#endif bit_stream_orig = st_ivas->bit_stream; /*-------------------------------------------------------------------* @@ -141,511 +144,539 @@ ivas_error ivas_dec_get_format_fx( test(); IF( st_ivas->ini_frame > 0 && NE_32( st_ivas->ivas_format, st_ivas->last_ivas_format ) && !( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) && EQ_32( st_ivas->last_ivas_format, MASA_ISM_FORMAT ) ) && - !( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && EQ_32( st_ivas->last_ivas_format, MASA_FORMAT ) ) ) - { - IF( Opt_tsm ) - { + !( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && EQ_32( st_ivas->last_ivas_format, MASA_FORMAT ) ) ){ +#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH + IF( Opt_tsm ){ +#endif st_ivas->restartNeeded = 1; - move16(); + move16(); - return IVAS_ERR_OK; - } - ELSE - { + 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" ); + 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!" ); - } - } + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); +} +#endif +} + +/*-------------------------------------------------------------------* + * Read other signaling (ISM/MC mode, number of channels, etc.) + *-------------------------------------------------------------------*/ +IF( is_DTXrate( ivas_total_brate ) == 0 ) +{ /*-------------------------------------------------------------------* - * Read other signaling (ISM/MC mode, number of channels, etc.) + * Read IVAS format related signaling: + * - in ISM : read number of objects + * - in SBA : read SBA planar flag and SBA order + * - in MASA : read number of TC + * - in MC : read LS setup *-------------------------------------------------------------------*/ - IF( is_DTXrate( ivas_total_brate ) == 0 ) + IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) { - /*-------------------------------------------------------------------* - * Read IVAS format related signaling: - * - in ISM : read number of objects - * - in SBA : read SBA planar flag and SBA order - * - in MASA : read number of TC - * - in MC : read LS setup - *-------------------------------------------------------------------*/ - - IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) - { - element_mode_flag = 1; - move16(); - } - ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) + element_mode_flag = 1; + move16(); + } + ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) + { + /* read the number of objects */ + nchan_ism = 1; + move16(); + k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); + k = sub( k, 1 ); + WHILE( st_ivas->bit_stream[k] && ( nchan_ism < MAX_NUM_OBJECTS ) ) { - /* read the number of objects */ - nchan_ism = 1; - move16(); - k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); + nchan_ism = add( nchan_ism, 1 ); k = sub( k, 1 ); - WHILE( st_ivas->bit_stream[k] && ( nchan_ism < MAX_NUM_OBJECTS ) ) - { - nchan_ism = add( nchan_ism, 1 ); - k = sub( k, 1 ); - } + } - test(); - IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) - { - IF( Opt_tsm ) - { - st_ivas->restartNeeded = 1; - move16(); + test(); + IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ){ +#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH + IF( Opt_tsm ){ +#endif + st_ivas->restartNeeded = 1; + move16(); - return IVAS_ERR_OK; - } - ELSE - { + 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" ); + 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!" ); - } - } + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); + } +#endif +} - st_ivas->nchan_ism = nchan_ism; - move16(); - st_ivas->ism_mode = ivas_ism_mode_select( nchan_ism, ivas_total_brate ); +st_ivas->nchan_ism = nchan_ism; +move16(); +st_ivas->ism_mode = ivas_ism_mode_select( nchan_ism, ivas_total_brate ); - st_ivas->nchan_transport = nchan_ism; - move16(); - if ( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) - { - st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; - move16(); - } - } - ELSE IF( EQ_32( st_ivas->ivas_format, SBA_FORMAT ) ) - { - /* read Ambisonic (SBA) planar flag */ - sba_planar = st_ivas->bit_stream[num_bits_read]; - num_bits_read = add( num_bits_read, SBA_PLANAR_BITS ); +st_ivas->nchan_transport = nchan_ism; +move16(); +if ( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) +{ + st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; + move16(); +} +} +ELSE IF( EQ_32( st_ivas->ivas_format, SBA_FORMAT ) ) +{ + /* read Ambisonic (SBA) planar flag */ + sba_planar = st_ivas->bit_stream[num_bits_read]; + num_bits_read = add( num_bits_read, SBA_PLANAR_BITS ); - test(); - IF( st_ivas->ini_frame > 0 && NE_16( sba_planar, st_ivas->sba_planar ) ) - { - IF( Opt_tsm ) - { - st_ivas->restartNeeded = 1; - move16(); + test(); + IF( st_ivas->ini_frame > 0 && NE_16( sba_planar, st_ivas->sba_planar ) ){ +#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH + IF( Opt_tsm ){ +#endif + st_ivas->restartNeeded = 1; + move16(); - return IVAS_ERR_OK; - } - ELSE - { + 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" ); + 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!" ); - } - } + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA planar flag signalled!" ); +} +#endif +} - /* read Ambisonic (SBA) order */ - sba_order = st_ivas->bit_stream[num_bits_read + 1]; - move16(); - sba_order = add( sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) ); +/* read Ambisonic (SBA) order */ +sba_order = st_ivas->bit_stream[num_bits_read + 1]; +move16(); +sba_order = add( sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) ); - test(); - IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) ) - { - IF( Opt_tsm ) - { - st_ivas->restartNeeded = 1; - move16(); +test(); +IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) ){ +#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH + IF( Opt_tsm ){ +#endif + st_ivas->restartNeeded = 1; +move16(); - return IVAS_ERR_OK; - } - ELSE - { +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" ); + fprintf( stderr, "\nError: Changing the SBA order is not supported!\n" ); #endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" ); - } - } + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" ); +} +#endif +} - sba_analysis_order = ivas_sba_get_analysis_order_fx( ivas_total_brate, sba_order ); - st_ivas->nchan_transport = ivas_get_sba_num_TCs_fx( ivas_total_brate, sba_analysis_order ); - } - ELSE IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) +sba_analysis_order = ivas_sba_get_analysis_order_fx( ivas_total_brate, sba_order ); +st_ivas->nchan_transport = ivas_get_sba_num_TCs_fx( ivas_total_brate, sba_analysis_order ); +} +ELSE IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) +{ + UWord8 masaRestartCandidate; + masaRestartCandidate = 0; + move16(); + + /* read number of MASA transport channels */ + k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); + IF( st_ivas->bit_stream[k - 1] ) + { +#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH + if ( st_ivas->nchan_transport == 1 ) +#else + test(); + if ( st_ivas->nchan_transport == 1 && Opt_tsm ) +#endif { - UWord8 masaRestartCandidate; - masaRestartCandidate = 0; + masaRestartCandidate = 1; move16(); + } - /* read number of MASA transport channels */ - k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); - IF( st_ivas->bit_stream[k - 1] ) - { - test(); - if ( st_ivas->nchan_transport == 1 && Opt_tsm ) - { - masaRestartCandidate = 1; - move16(); - } - - st_ivas->nchan_transport = 2; - move16(); - element_mode_flag = 1; - move16(); - } - ELSE - { - test(); - if ( st_ivas->nchan_transport == 2 && Opt_tsm ) - { - masaRestartCandidate = 1; - move16(); - } + st_ivas->nchan_transport = 2; + move16(); + element_mode_flag = 1; + move16(); + } + ELSE + { +#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH + if ( st_ivas->nchan_transport == 2 ) +#else + test(); + if ( st_ivas->nchan_transport == 2 && Opt_tsm ) +#endif + { + masaRestartCandidate = 1; + move16(); + } - st_ivas->nchan_transport = 1; - move16(); - } + st_ivas->nchan_transport = 1; + move16(); + } - /* this should be non-zero if original input format was MASA_ISM_FORMAT */ - st_ivas->ism_mode = ISM_MODE_NONE; + /* this should be non-zero if original input format was MASA_ISM_FORMAT */ + st_ivas->ism_mode = ISM_MODE_NONE; + move16(); + nchan_ism = add( st_ivas->bit_stream[k - 3], shl( st_ivas->bit_stream[k - 2], 1 ) ); + + IF( nchan_ism > 0 ) + { + /* the input_ivas_format should be MASA_ISM_FORMAT, but we cannot initialize it now */ + /* info about the number of objects: + '00' - MASA format at the encoder + '01' - MASA_ISM_FORMAT at the encoder, with 4 objects + '10' - MASA_ISM_FORMAT at the encoder, with 3 objects + '11' - MASA_ISM_FORMAT at the encoder, with 1 or 2 objects + reading if 1 or 2 objects is performed later + */ + nchan_ism = sub( 5, nchan_ism ); + test(); + IF( EQ_16( st_ivas->nchan_transport, 1 ) && EQ_16( nchan_ism, 2 ) ) + { + nchan_ism = 1; move16(); - nchan_ism = add( st_ivas->bit_stream[k - 3], shl( st_ivas->bit_stream[k - 2], 1 ) ); - - IF( nchan_ism > 0 ) - { - /* the input_ivas_format should be MASA_ISM_FORMAT, but we cannot initialize it now */ - /* info about the number of objects: - '00' - MASA format at the encoder - '01' - MASA_ISM_FORMAT at the encoder, with 4 objects - '10' - MASA_ISM_FORMAT at the encoder, with 3 objects - '11' - MASA_ISM_FORMAT at the encoder, with 1 or 2 objects - reading if 1 or 2 objects is performed later - */ - nchan_ism = sub( 5, nchan_ism ); - test(); - IF( EQ_16( st_ivas->nchan_transport, 1 ) && EQ_16( nchan_ism, 2 ) ) - { - nchan_ism = 1; - move16(); - } + } - /* for MASA_ISM_FORMAT at input the number of MASA transport channels is always 2 and the corresponding bit is not used here*/ - st_ivas->nchan_transport = 2; - move16(); - element_mode_flag = 1; - move16(); - } - ELSE IF( masaRestartCandidate > 0 ) - { - st_ivas->restartNeeded = 1; - move16(); + /* for MASA_ISM_FORMAT at input the number of MASA transport channels is always 2 and the corresponding bit is not used here*/ + st_ivas->nchan_transport = 2; + move16(); + element_mode_flag = 1; + move16(); + } + ELSE IF( masaRestartCandidate > 0 ) + { + st_ivas->restartNeeded = 1; + move16(); - return IVAS_ERR_OK; - } + return IVAS_ERR_OK; + } - test(); - IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) - { - IF( Opt_tsm ) - { - st_ivas->restartNeeded = 1; - move16(); + test(); + IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ){ +#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH + IF( Opt_tsm ){ +#endif + st_ivas->restartNeeded = 1; + move16(); - return IVAS_ERR_OK; - } - ELSE - { + 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" ); + 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!" ); - } - } + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); +} +#endif +} - st_ivas->nchan_ism = nchan_ism; - move16(); - } - ELSE IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) - { - st_ivas->nchan_transport = 2; /* always 2 MASA transport channels */ - move16(); +st_ivas->nchan_ism = nchan_ism; +move16(); +} +ELSE IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) +{ + st_ivas->nchan_transport = 2; /* always 2 MASA transport channels */ + move16(); - /* the number of objects are written at the end of the bitstream */ - k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); - nchan_ism = add( add( shl( st_ivas->bit_stream[k - 1], 1 ), st_ivas->bit_stream[k - 2] ), 1 ); - st_ivas->ism_mode = ivas_omasa_ism_mode_select_fx( ivas_total_brate, nchan_ism ); + /* the number of objects are written at the end of the bitstream */ + k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); + nchan_ism = add( add( shl( st_ivas->bit_stream[k - 1], 1 ), st_ivas->bit_stream[k - 2] ), 1 ); + st_ivas->ism_mode = ivas_omasa_ism_mode_select_fx( ivas_total_brate, nchan_ism ); - test(); - IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) - { - IF( Opt_tsm ) - { - st_ivas->restartNeeded = 1; - move16(); + test(); + IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ){ +#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH + IF( Opt_tsm ){ +#endif + st_ivas->restartNeeded = 1; + move16(); - return IVAS_ERR_OK; - } - ELSE - { + 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" ); + 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!" ); - } - } + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); +} +#endif +} - st_ivas->nchan_ism = nchan_ism; - move16(); - } - ELSE IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) - { - /* the number of objects is written at the end of the bitstream, in the SBA metadata */ - k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); - nchan_ism = add( add( shl( st_ivas->bit_stream[k - 1], 1 ), st_ivas->bit_stream[k - 2] ), 1 ); +st_ivas->nchan_ism = nchan_ism; +move16(); +} +ELSE IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) +{ + /* the number of objects is written at the end of the bitstream, in the SBA metadata */ + k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); + nchan_ism = add( add( shl( st_ivas->bit_stream[k - 1], 1 ), st_ivas->bit_stream[k - 2] ), 1 ); - test(); - IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) - { - IF( Opt_tsm ) - { - st_ivas->restartNeeded = 1; - move16(); + test(); + IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ){ +#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH + IF( Opt_tsm ){ +#endif + st_ivas->restartNeeded = 1; + move16(); - return IVAS_ERR_OK; - } - ELSE - { + 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" ); + 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!" ); - } - } + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); +} +#endif +} - st_ivas->nchan_ism = nchan_ism; - move16(); +st_ivas->nchan_ism = nchan_ism; +move16(); - /* read Ambisonic (SBA) planar flag */ - /*sba_planar = st_ivas->bit_stream[num_bits_read];*/ - num_bits_read = add( num_bits_read, SBA_PLANAR_BITS ); +/* read Ambisonic (SBA) planar flag */ +/*sba_planar = st_ivas->bit_stream[num_bits_read];*/ +num_bits_read = add( num_bits_read, SBA_PLANAR_BITS ); - /* read Ambisonic (SBA) order (0 for signaling OSBA format at low bitrates)*/ - sba_order = st_ivas->bit_stream[num_bits_read + 1]; - move16(); - sba_order = add( sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) ); - num_bits_read = add( num_bits_read, SBA_ORDER_BITS ); +/* read Ambisonic (SBA) order (0 for signaling OSBA format at low bitrates)*/ +sba_order = st_ivas->bit_stream[num_bits_read + 1]; +move16(); +sba_order = add( sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) ); +num_bits_read = add( num_bits_read, SBA_ORDER_BITS ); - /* read the real Ambisonic order when the above bits are used to signal OSBA format */ - IF( LT_32( ivas_total_brate, IVAS_24k4 ) ) - { - sba_order = st_ivas->bit_stream[num_bits_read + 1]; - move16(); - sba_order = add( sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) ); - num_bits_read = add( num_bits_read, SBA_ORDER_BITS ); - } +/* read the real Ambisonic order when the above bits are used to signal OSBA format */ +IF( LT_32( ivas_total_brate, IVAS_24k4 ) ) +{ + sba_order = st_ivas->bit_stream[num_bits_read + 1]; + move16(); + sba_order = add( sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) ); + num_bits_read = add( num_bits_read, SBA_ORDER_BITS ); +} - test(); - IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) ) - { - IF( Opt_tsm ) - { - st_ivas->restartNeeded = 1; - move16(); +test(); +IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) ){ +#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH + IF( Opt_tsm ){ +#endif + st_ivas->restartNeeded = 1; +move16(); - return IVAS_ERR_OK; - } - ELSE - { +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" ); + fprintf( stderr, "\nError: Changing the SBA order is not supported!\n" ); #endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" ); - } - } + 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 ); +st_ivas->ism_mode = ivas_osba_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); - sba_analysis_order = ivas_sba_get_analysis_order_fx( ivas_total_brate, sba_order ); - st_ivas->nchan_transport = ivas_get_sba_num_TCs_fx( ivas_total_brate, sba_analysis_order ); - } - ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) ) +sba_analysis_order = ivas_sba_get_analysis_order_fx( ivas_total_brate, sba_order ); +st_ivas->nchan_transport = ivas_get_sba_num_TCs_fx( ivas_total_brate, sba_analysis_order ); +} +ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) ) +{ + /* read MC configuration */ + idx = 0; + move16(); + FOR( k = 0; k < MC_LS_SETUP_BITS; k++ ) + { + IF( st_ivas->bit_stream[num_bits_read + k] ) { - /* read MC configuration */ - idx = 0; - move16(); - FOR( k = 0; k < MC_LS_SETUP_BITS; k++ ) - { - IF( st_ivas->bit_stream[num_bits_read + k] ) - { - idx = add( idx, shl( 1, sub( ( MC_LS_SETUP_BITS - 1 ), k ) ) ); - } - } - num_bits_read = add( num_bits_read, MC_LS_SETUP_BITS ); + idx = add( idx, shl( 1, sub( ( MC_LS_SETUP_BITS - 1 ), k ) ) ); + } + } + num_bits_read = add( num_bits_read, MC_LS_SETUP_BITS ); - signaled_config = ivas_mc_map_ls_setup_to_output_config_fx( idx ); + signaled_config = ivas_mc_map_ls_setup_to_output_config_fx( idx ); - test(); - IF( st_ivas->ini_frame > 0 && NE_32( st_ivas->transport_config, signaled_config ) ) - { - IF( Opt_tsm ) - { - st_ivas->restartNeeded = 1; - move16(); + test(); + IF( st_ivas->ini_frame > 0 && NE_32( st_ivas->transport_config, signaled_config ) ){ +#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH + IF( Opt_tsm ){ +#endif + st_ivas->restartNeeded = 1; + move16(); - return IVAS_ERR_OK; - } - ELSE - { + 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" ); + fprintf( stderr, "\nError: Switching of MC configurations is not supported!\n" ); #endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong MC configuration signalled!" ); - } - } + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong MC configuration signalled!" ); +} +#endif +} - st_ivas->mc_mode = ivas_mc_mode_select_fx( ivas_mc_map_output_config_to_mc_ls_setup_fx( signaled_config ), ivas_total_brate ); - st_ivas->transport_config = signaled_config; - move16(); - } +st_ivas->mc_mode = ivas_mc_mode_select_fx( ivas_mc_map_output_config_to_mc_ls_setup_fx( signaled_config ), ivas_total_brate ); +st_ivas->transport_config = signaled_config; +move16(); +} - /*-------------------------------------------------------------------* - * Read element mode - *-------------------------------------------------------------------*/ +/*-------------------------------------------------------------------* + * Read element mode + *-------------------------------------------------------------------*/ - test(); - IF( st_ivas->ini_frame == 0 && element_mode_flag ) +test(); +IF( st_ivas->ini_frame == 0 && element_mode_flag ) +{ + /* read stereo technology info */ + if ( LT_32( ivas_total_brate, MIN_BRATE_MDCT_STEREO ) ) + { + /* 1 bit */ + IF( st_ivas->bit_stream[num_bits_read] ) { - /* read stereo technology info */ - if ( LT_32( ivas_total_brate, MIN_BRATE_MDCT_STEREO ) ) + st_ivas->element_mode_init = add( 1, IVAS_CPE_DFT ); + } + ELSE + { + st_ivas->element_mode_init = add( 0, IVAS_CPE_DFT ); + } + } + ELSE + { + st_ivas->element_mode_init = IVAS_CPE_MDCT; + move16(); + } +} +} +ELSE IF( EQ_32( ivas_total_brate, IVAS_SID_5k2 ) ) +{ + SWITCH( st_ivas->sid_format ) + { + case SID_DFT_STEREO: + st_ivas->element_mode_init = IVAS_CPE_DFT; + move16(); + BREAK; + case SID_MDCT_STEREO: + st_ivas->element_mode_init = IVAS_CPE_MDCT; + move16(); + BREAK; + case SID_ISM: + st_ivas->element_mode_init = IVAS_SCE; + move16(); + BREAK; + case SID_MASA_1TC: + st_ivas->element_mode_init = IVAS_SCE; + move16(); + st_ivas->nchan_transport = 1; + move16(); + BREAK; + case SID_MASA_2TC: + k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); + IF( st_ivas->bit_stream[k - 1 - SID_FORMAT_NBITS] == 1 ) { - /* 1 bit */ - IF( st_ivas->bit_stream[num_bits_read] ) - { - st_ivas->element_mode_init = add( 1, IVAS_CPE_DFT ); - } - ELSE - { - st_ivas->element_mode_init = add( 0, IVAS_CPE_DFT ); - } + st_ivas->element_mode_init = IVAS_CPE_MDCT; + move16(); } ELSE { - st_ivas->element_mode_init = IVAS_CPE_MDCT; + st_ivas->element_mode_init = IVAS_CPE_DFT; move16(); } - } + st_ivas->nchan_transport = 2; + move16(); + BREAK; + case SID_SBA_1TC: + st_ivas->element_mode_init = IVAS_SCE; + move16(); + BREAK; + case SID_SBA_2TC: + st_ivas->element_mode_init = IVAS_CPE_MDCT; + move16(); + BREAK; } - ELSE IF( EQ_32( ivas_total_brate, IVAS_SID_5k2 ) ) - { - SWITCH( st_ivas->sid_format ) - { - case SID_DFT_STEREO: - st_ivas->element_mode_init = IVAS_CPE_DFT; - move16(); - BREAK; - case SID_MDCT_STEREO: - st_ivas->element_mode_init = IVAS_CPE_MDCT; - move16(); - BREAK; - case SID_ISM: - st_ivas->element_mode_init = IVAS_SCE; - move16(); - BREAK; - case SID_MASA_1TC: - st_ivas->element_mode_init = IVAS_SCE; - move16(); - st_ivas->nchan_transport = 1; - move16(); - BREAK; - case SID_MASA_2TC: - k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); - IF( st_ivas->bit_stream[k - 1 - SID_FORMAT_NBITS] == 1 ) - { - st_ivas->element_mode_init = IVAS_CPE_MDCT; - move16(); - } - ELSE - { - st_ivas->element_mode_init = IVAS_CPE_DFT; - move16(); - } - st_ivas->nchan_transport = 2; - move16(); - BREAK; - case SID_SBA_1TC: - st_ivas->element_mode_init = IVAS_SCE; - move16(); - BREAK; - case SID_SBA_2TC: - st_ivas->element_mode_init = IVAS_CPE_MDCT; - move16(); - BREAK; - } - IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) + IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) + { + /* read the number of objects */ + nchan_ism = 1; + move16(); + k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); + k = sub( sub( k, 1 ), SID_FORMAT_NBITS ); + WHILE( st_ivas->bit_stream[k] && ( nchan_ism < MAX_NUM_OBJECTS ) ) { - /* read the number of objects */ - nchan_ism = 1; - move16(); - k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); - k = sub( sub( k, 1 ), SID_FORMAT_NBITS ); - WHILE( st_ivas->bit_stream[k] && ( nchan_ism < MAX_NUM_OBJECTS ) ) - { - nchan_ism = add( nchan_ism, 1 ); - k = sub( k, 1 ); - } + nchan_ism = add( nchan_ism, 1 ); k = sub( k, 1 ); + } + k = sub( k, 1 ); - test(); - IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) - { - IF( Opt_tsm ) - { - st_ivas->restartNeeded = 1; - move16(); + test(); + IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ){ +#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH + IF( Opt_tsm ){ +#endif + st_ivas->restartNeeded = 1; + move16(); - return IVAS_ERR_OK; - } - ELSE - { + 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" ); + 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!" ); - } - } + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); + } +#endif +} - st_ivas->nchan_ism = nchan_ism; - move16(); +st_ivas->nchan_ism = nchan_ism; +move16(); - /* read ism_mode */ - st_ivas->ism_mode = ISM_MODE_DISC; - move32(); - IF( GT_16( nchan_ism, 2 ) ) - { - k = sub( k, nchan_ism ); /* SID metadata flags */ - idx = st_ivas->bit_stream[k]; - move16(); - st_ivas->ism_mode = (ISM_MODE) add( idx, 1 ); - move32(); - } +/* read ism_mode */ +st_ivas->ism_mode = ISM_MODE_DISC; +move32(); +IF( GT_16( nchan_ism, 2 ) ) +{ + k = sub( k, nchan_ism ); /* SID metadata flags */ + idx = st_ivas->bit_stream[k]; + move16(); + st_ivas->ism_mode = (ISM_MODE) add( idx, 1 ); + move32(); +} - st_ivas->nchan_transport = nchan_ism; - move16(); - if ( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) - { - st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; - move16(); - } - } - } +st_ivas->nchan_transport = nchan_ism; +move16(); +if ( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) +{ + st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; + move16(); +} +} +} - st_ivas->bit_stream = bit_stream_orig; +st_ivas->bit_stream = bit_stream_orig; - return IVAS_ERR_OK; +return IVAS_ERR_OK; } -- GitLab From 97d666949c77ef74819b2b5e551c5a17f899c192 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 31 Mar 2026 17:17:50 +0200 Subject: [PATCH 2/5] clang-format --- lib_dec/ivas_init_dec_fx.c | 916 +++++++++++++++++++------------------ 1 file changed, 467 insertions(+), 449 deletions(-) diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index a2e56132e..f0f14bb04 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -144,539 +144,557 @@ ivas_error ivas_dec_get_format_fx( test(); IF( st_ivas->ini_frame > 0 && NE_32( st_ivas->ivas_format, st_ivas->last_ivas_format ) && !( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) && EQ_32( st_ivas->last_ivas_format, MASA_ISM_FORMAT ) ) && - !( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && EQ_32( st_ivas->last_ivas_format, MASA_FORMAT ) ) ){ + !( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && EQ_32( st_ivas->last_ivas_format, MASA_FORMAT ) ) ) + { #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - IF( Opt_tsm ){ + IF( Opt_tsm ) + { #endif st_ivas->restartNeeded = 1; - move16(); + move16(); - return IVAS_ERR_OK; + return IVAS_ERR_OK; #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH -} -ELSE -{ + } + ELSE + { #ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); + 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!" ); -} + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); + } #endif -} - -/*-------------------------------------------------------------------* - * Read other signaling (ISM/MC mode, number of channels, etc.) - *-------------------------------------------------------------------*/ + } -IF( is_DTXrate( ivas_total_brate ) == 0 ) -{ /*-------------------------------------------------------------------* - * Read IVAS format related signaling: - * - in ISM : read number of objects - * - in SBA : read SBA planar flag and SBA order - * - in MASA : read number of TC - * - in MC : read LS setup + * Read other signaling (ISM/MC mode, number of channels, etc.) *-------------------------------------------------------------------*/ - - IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) - { - element_mode_flag = 1; - move16(); - } - ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) + + IF( is_DTXrate( ivas_total_brate ) == 0 ) { - /* read the number of objects */ - nchan_ism = 1; - move16(); - k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); - k = sub( k, 1 ); - WHILE( st_ivas->bit_stream[k] && ( nchan_ism < MAX_NUM_OBJECTS ) ) + /*-------------------------------------------------------------------* + * Read IVAS format related signaling: + * - in ISM : read number of objects + * - in SBA : read SBA planar flag and SBA order + * - in MASA : read number of TC + * - in MC : read LS setup + *-------------------------------------------------------------------*/ + + IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) { - nchan_ism = add( nchan_ism, 1 ); - k = sub( k, 1 ); + element_mode_flag = 1; + move16(); } - - test(); - IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ){ + ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) + { + /* read the number of objects */ + nchan_ism = 1; + move16(); + k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); + k = sub( k, 1 ); + WHILE( st_ivas->bit_stream[k] && ( nchan_ism < MAX_NUM_OBJECTS ) ) + { + nchan_ism = add( nchan_ism, 1 ); + k = sub( k, 1 ); + } + + test(); + IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) + { #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - IF( Opt_tsm ){ + IF( Opt_tsm ) + { #endif - st_ivas->restartNeeded = 1; - move16(); - - return IVAS_ERR_OK; + st_ivas->restartNeeded = 1; + move16(); + + return IVAS_ERR_OK; #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - } - ELSE - { + } + ELSE + { #ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); + 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!" ); - } + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); + } #endif -} - -st_ivas->nchan_ism = nchan_ism; -move16(); -st_ivas->ism_mode = ivas_ism_mode_select( nchan_ism, ivas_total_brate ); - -st_ivas->nchan_transport = nchan_ism; -move16(); -if ( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) -{ - st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; - move16(); -} -} -ELSE IF( EQ_32( st_ivas->ivas_format, SBA_FORMAT ) ) -{ - /* read Ambisonic (SBA) planar flag */ - sba_planar = st_ivas->bit_stream[num_bits_read]; - num_bits_read = add( num_bits_read, SBA_PLANAR_BITS ); - - test(); - IF( st_ivas->ini_frame > 0 && NE_16( sba_planar, st_ivas->sba_planar ) ){ + } + + st_ivas->nchan_ism = nchan_ism; + move16(); + st_ivas->ism_mode = ivas_ism_mode_select( nchan_ism, ivas_total_brate ); + + st_ivas->nchan_transport = nchan_ism; + move16(); + if ( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) + { + st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; + move16(); + } + } + ELSE IF( EQ_32( st_ivas->ivas_format, SBA_FORMAT ) ) + { + /* read Ambisonic (SBA) planar flag */ + sba_planar = st_ivas->bit_stream[num_bits_read]; + num_bits_read = add( num_bits_read, SBA_PLANAR_BITS ); + + test(); + IF( st_ivas->ini_frame > 0 && NE_16( sba_planar, st_ivas->sba_planar ) ) + { #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - IF( Opt_tsm ){ + IF( Opt_tsm ) + { #endif - st_ivas->restartNeeded = 1; - move16(); - - return IVAS_ERR_OK; + st_ivas->restartNeeded = 1; + move16(); + + return IVAS_ERR_OK; #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH -} -ELSE -{ + } + ELSE + { #ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the SBA planar/3D layout is not supported!\n" ); + 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!" ); -} + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA planar flag signalled!" ); + } #endif -} - -/* read Ambisonic (SBA) order */ -sba_order = st_ivas->bit_stream[num_bits_read + 1]; -move16(); -sba_order = add( sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) ); - -test(); -IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) ){ + } + + /* read Ambisonic (SBA) order */ + sba_order = st_ivas->bit_stream[num_bits_read + 1]; + move16(); + sba_order = add( sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) ); + + test(); + IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) ) + { #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - IF( Opt_tsm ){ + IF( Opt_tsm ) + { #endif - st_ivas->restartNeeded = 1; -move16(); - -return IVAS_ERR_OK; + st_ivas->restartNeeded = 1; + move16(); + + return IVAS_ERR_OK; #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH -} -ELSE -{ + } + ELSE + { #ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the SBA order is not supported!\n" ); + fprintf( stderr, "\nError: Changing the SBA order is not supported!\n" ); #endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" ); -} + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" ); + } #endif -} - -sba_analysis_order = ivas_sba_get_analysis_order_fx( ivas_total_brate, sba_order ); -st_ivas->nchan_transport = ivas_get_sba_num_TCs_fx( ivas_total_brate, sba_analysis_order ); -} -ELSE IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) -{ - UWord8 masaRestartCandidate; - masaRestartCandidate = 0; - move16(); - - /* read number of MASA transport channels */ - k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); - IF( st_ivas->bit_stream[k - 1] ) - { + } + + sba_analysis_order = ivas_sba_get_analysis_order_fx( ivas_total_brate, sba_order ); + st_ivas->nchan_transport = ivas_get_sba_num_TCs_fx( ivas_total_brate, sba_analysis_order ); + } + ELSE IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) + { + UWord8 masaRestartCandidate; + masaRestartCandidate = 0; + move16(); + + /* read number of MASA transport channels */ + k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); + IF( st_ivas->bit_stream[k - 1] ) + { #ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH - if ( st_ivas->nchan_transport == 1 ) + if ( st_ivas->nchan_transport == 1 ) #else - test(); - if ( st_ivas->nchan_transport == 1 && Opt_tsm ) + test(); + if ( st_ivas->nchan_transport == 1 && Opt_tsm ) #endif - { - masaRestartCandidate = 1; - move16(); - } - - st_ivas->nchan_transport = 2; - move16(); - element_mode_flag = 1; - move16(); - } - ELSE - { + { + masaRestartCandidate = 1; + move16(); + } + + st_ivas->nchan_transport = 2; + move16(); + element_mode_flag = 1; + move16(); + } + ELSE + { #ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH - if ( st_ivas->nchan_transport == 2 ) + if ( st_ivas->nchan_transport == 2 ) #else - test(); - if ( st_ivas->nchan_transport == 2 && Opt_tsm ) + test(); + if ( st_ivas->nchan_transport == 2 && Opt_tsm ) #endif - { - masaRestartCandidate = 1; + { + masaRestartCandidate = 1; + move16(); + } + + st_ivas->nchan_transport = 1; + move16(); + } + + /* this should be non-zero if original input format was MASA_ISM_FORMAT */ + st_ivas->ism_mode = ISM_MODE_NONE; + move16(); + nchan_ism = add( st_ivas->bit_stream[k - 3], shl( st_ivas->bit_stream[k - 2], 1 ) ); + + IF( nchan_ism > 0 ) + { + /* the input_ivas_format should be MASA_ISM_FORMAT, but we cannot initialize it now */ + /* info about the number of objects: + '00' - MASA format at the encoder + '01' - MASA_ISM_FORMAT at the encoder, with 4 objects + '10' - MASA_ISM_FORMAT at the encoder, with 3 objects + '11' - MASA_ISM_FORMAT at the encoder, with 1 or 2 objects + reading if 1 or 2 objects is performed later + */ + nchan_ism = sub( 5, nchan_ism ); + test(); + IF( EQ_16( st_ivas->nchan_transport, 1 ) && EQ_16( nchan_ism, 2 ) ) + { + nchan_ism = 1; + move16(); + } + + /* for MASA_ISM_FORMAT at input the number of MASA transport channels is always 2 and the corresponding bit is not used here*/ + st_ivas->nchan_transport = 2; + move16(); + element_mode_flag = 1; + move16(); + } + ELSE IF( masaRestartCandidate > 0 ) + { + st_ivas->restartNeeded = 1; + move16(); + + return IVAS_ERR_OK; + } + + test(); + IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) + { +#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH + IF( Opt_tsm ) + { +#endif + st_ivas->restartNeeded = 1; + move16(); + + 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; move16(); } - - st_ivas->nchan_transport = 1; - move16(); - } - - /* this should be non-zero if original input format was MASA_ISM_FORMAT */ - st_ivas->ism_mode = ISM_MODE_NONE; - move16(); - nchan_ism = add( st_ivas->bit_stream[k - 3], shl( st_ivas->bit_stream[k - 2], 1 ) ); - - IF( nchan_ism > 0 ) - { - /* the input_ivas_format should be MASA_ISM_FORMAT, but we cannot initialize it now */ - /* info about the number of objects: - '00' - MASA format at the encoder - '01' - MASA_ISM_FORMAT at the encoder, with 4 objects - '10' - MASA_ISM_FORMAT at the encoder, with 3 objects - '11' - MASA_ISM_FORMAT at the encoder, with 1 or 2 objects - reading if 1 or 2 objects is performed later - */ - nchan_ism = sub( 5, nchan_ism ); - test(); - IF( EQ_16( st_ivas->nchan_transport, 1 ) && EQ_16( nchan_ism, 2 ) ) + ELSE IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) { - nchan_ism = 1; + st_ivas->nchan_transport = 2; /* always 2 MASA transport channels */ move16(); - } - - /* for MASA_ISM_FORMAT at input the number of MASA transport channels is always 2 and the corresponding bit is not used here*/ - st_ivas->nchan_transport = 2; - move16(); - element_mode_flag = 1; - move16(); - } - ELSE IF( masaRestartCandidate > 0 ) - { - st_ivas->restartNeeded = 1; - move16(); - - return IVAS_ERR_OK; - } - - test(); - IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ){ + + /* the number of objects are written at the end of the bitstream */ + k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); + nchan_ism = add( add( shl( st_ivas->bit_stream[k - 1], 1 ), st_ivas->bit_stream[k - 2] ), 1 ); + st_ivas->ism_mode = ivas_omasa_ism_mode_select_fx( ivas_total_brate, nchan_ism ); + + test(); + IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) + { #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - IF( Opt_tsm ){ + IF( Opt_tsm ) + { #endif - st_ivas->restartNeeded = 1; - move16(); - - return IVAS_ERR_OK; + st_ivas->restartNeeded = 1; + move16(); + + return IVAS_ERR_OK; #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH -} -ELSE -{ + } + ELSE + { #ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); + 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!" ); -} + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); + } #endif -} - -st_ivas->nchan_ism = nchan_ism; -move16(); -} -ELSE IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) -{ - st_ivas->nchan_transport = 2; /* always 2 MASA transport channels */ - move16(); - - /* the number of objects are written at the end of the bitstream */ - k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); - nchan_ism = add( add( shl( st_ivas->bit_stream[k - 1], 1 ), st_ivas->bit_stream[k - 2] ), 1 ); - st_ivas->ism_mode = ivas_omasa_ism_mode_select_fx( ivas_total_brate, nchan_ism ); - - test(); - IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ){ -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - IF( Opt_tsm ){ -#endif - st_ivas->restartNeeded = 1; - move16(); - - 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; -move16(); -} -ELSE IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) -{ - /* the number of objects is written at the end of the bitstream, in the SBA metadata */ - k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); - nchan_ism = add( add( shl( st_ivas->bit_stream[k - 1], 1 ), st_ivas->bit_stream[k - 2] ), 1 ); - - test(); - IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ){ + } + + st_ivas->nchan_ism = nchan_ism; + move16(); + } + ELSE IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) + { + /* the number of objects is written at the end of the bitstream, in the SBA metadata */ + k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); + nchan_ism = add( add( shl( st_ivas->bit_stream[k - 1], 1 ), st_ivas->bit_stream[k - 2] ), 1 ); + + test(); + IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) + { #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - IF( Opt_tsm ){ + IF( Opt_tsm ) + { #endif - st_ivas->restartNeeded = 1; - move16(); - - return IVAS_ERR_OK; + st_ivas->restartNeeded = 1; + move16(); + + return IVAS_ERR_OK; #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH -} -ELSE -{ + } + ELSE + { #ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); + 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!" ); -} + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); + } #endif -} - -st_ivas->nchan_ism = nchan_ism; -move16(); - -/* read Ambisonic (SBA) planar flag */ -/*sba_planar = st_ivas->bit_stream[num_bits_read];*/ -num_bits_read = add( num_bits_read, SBA_PLANAR_BITS ); - -/* read Ambisonic (SBA) order (0 for signaling OSBA format at low bitrates)*/ -sba_order = st_ivas->bit_stream[num_bits_read + 1]; -move16(); -sba_order = add( sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) ); -num_bits_read = add( num_bits_read, SBA_ORDER_BITS ); - -/* read the real Ambisonic order when the above bits are used to signal OSBA format */ -IF( LT_32( ivas_total_brate, IVAS_24k4 ) ) -{ - sba_order = st_ivas->bit_stream[num_bits_read + 1]; - move16(); - sba_order = add( sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) ); - num_bits_read = add( num_bits_read, SBA_ORDER_BITS ); -} - -test(); -IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) ){ + } + + st_ivas->nchan_ism = nchan_ism; + move16(); + + /* read Ambisonic (SBA) planar flag */ + /*sba_planar = st_ivas->bit_stream[num_bits_read];*/ + num_bits_read = add( num_bits_read, SBA_PLANAR_BITS ); + + /* read Ambisonic (SBA) order (0 for signaling OSBA format at low bitrates)*/ + sba_order = st_ivas->bit_stream[num_bits_read + 1]; + move16(); + sba_order = add( sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) ); + num_bits_read = add( num_bits_read, SBA_ORDER_BITS ); + + /* read the real Ambisonic order when the above bits are used to signal OSBA format */ + IF( LT_32( ivas_total_brate, IVAS_24k4 ) ) + { + sba_order = st_ivas->bit_stream[num_bits_read + 1]; + move16(); + sba_order = add( sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) ); + num_bits_read = add( num_bits_read, SBA_ORDER_BITS ); + } + + test(); + IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) ) + { #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - IF( Opt_tsm ){ + IF( Opt_tsm ) + { #endif - st_ivas->restartNeeded = 1; -move16(); - -return IVAS_ERR_OK; + st_ivas->restartNeeded = 1; + move16(); + + return IVAS_ERR_OK; #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH -} -ELSE -{ + } + ELSE + { #ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the SBA order is not supported!\n" ); + fprintf( stderr, "\nError: Changing the SBA order is not supported!\n" ); #endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" ); -} + 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 ); - -sba_analysis_order = ivas_sba_get_analysis_order_fx( ivas_total_brate, sba_order ); -st_ivas->nchan_transport = ivas_get_sba_num_TCs_fx( ivas_total_brate, sba_analysis_order ); -} -ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) ) -{ - /* read MC configuration */ - idx = 0; - move16(); - FOR( k = 0; k < MC_LS_SETUP_BITS; k++ ) - { - IF( st_ivas->bit_stream[num_bits_read + k] ) - { - idx = add( idx, shl( 1, sub( ( MC_LS_SETUP_BITS - 1 ), k ) ) ); + } + + st_ivas->ism_mode = ivas_osba_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); + + sba_analysis_order = ivas_sba_get_analysis_order_fx( ivas_total_brate, sba_order ); + st_ivas->nchan_transport = ivas_get_sba_num_TCs_fx( ivas_total_brate, sba_analysis_order ); } - } - num_bits_read = add( num_bits_read, MC_LS_SETUP_BITS ); - - signaled_config = ivas_mc_map_ls_setup_to_output_config_fx( idx ); - - test(); - IF( st_ivas->ini_frame > 0 && NE_32( st_ivas->transport_config, signaled_config ) ){ + ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) ) + { + /* read MC configuration */ + idx = 0; + move16(); + FOR( k = 0; k < MC_LS_SETUP_BITS; k++ ) + { + IF( st_ivas->bit_stream[num_bits_read + k] ) + { + idx = add( idx, shl( 1, sub( ( MC_LS_SETUP_BITS - 1 ), k ) ) ); + } + } + num_bits_read = add( num_bits_read, MC_LS_SETUP_BITS ); + + signaled_config = ivas_mc_map_ls_setup_to_output_config_fx( idx ); + + test(); + IF( st_ivas->ini_frame > 0 && NE_32( st_ivas->transport_config, signaled_config ) ) + { #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - IF( Opt_tsm ){ + IF( Opt_tsm ) + { #endif - st_ivas->restartNeeded = 1; - move16(); - - return IVAS_ERR_OK; + st_ivas->restartNeeded = 1; + move16(); + + return IVAS_ERR_OK; #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH -} -ELSE -{ + } + ELSE + { #ifdef DEBUGGING - fprintf( stderr, "\nError: Switching of MC configurations is not supported!\n" ); + fprintf( stderr, "\nError: Switching of MC configurations is not supported!\n" ); #endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong MC configuration signalled!" ); -} + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong MC configuration signalled!" ); + } #endif -} - -st_ivas->mc_mode = ivas_mc_mode_select_fx( ivas_mc_map_output_config_to_mc_ls_setup_fx( signaled_config ), ivas_total_brate ); -st_ivas->transport_config = signaled_config; -move16(); -} - -/*-------------------------------------------------------------------* - * Read element mode - *-------------------------------------------------------------------*/ - -test(); -IF( st_ivas->ini_frame == 0 && element_mode_flag ) -{ - /* read stereo technology info */ - if ( LT_32( ivas_total_brate, MIN_BRATE_MDCT_STEREO ) ) - { - /* 1 bit */ - IF( st_ivas->bit_stream[num_bits_read] ) - { - st_ivas->element_mode_init = add( 1, IVAS_CPE_DFT ); + } + + st_ivas->mc_mode = ivas_mc_mode_select_fx( ivas_mc_map_output_config_to_mc_ls_setup_fx( signaled_config ), ivas_total_brate ); + st_ivas->transport_config = signaled_config; + move16(); } - ELSE + + /*-------------------------------------------------------------------* + * Read element mode + *-------------------------------------------------------------------*/ + + test(); + IF( st_ivas->ini_frame == 0 && element_mode_flag ) { - st_ivas->element_mode_init = add( 0, IVAS_CPE_DFT ); - } - } - ELSE - { - st_ivas->element_mode_init = IVAS_CPE_MDCT; - move16(); - } -} -} -ELSE IF( EQ_32( ivas_total_brate, IVAS_SID_5k2 ) ) -{ - SWITCH( st_ivas->sid_format ) - { - case SID_DFT_STEREO: - st_ivas->element_mode_init = IVAS_CPE_DFT; - move16(); - BREAK; - case SID_MDCT_STEREO: - st_ivas->element_mode_init = IVAS_CPE_MDCT; - move16(); - BREAK; - case SID_ISM: - st_ivas->element_mode_init = IVAS_SCE; - move16(); - BREAK; - case SID_MASA_1TC: - st_ivas->element_mode_init = IVAS_SCE; - move16(); - st_ivas->nchan_transport = 1; - move16(); - BREAK; - case SID_MASA_2TC: - k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); - IF( st_ivas->bit_stream[k - 1 - SID_FORMAT_NBITS] == 1 ) + /* read stereo technology info */ + if ( LT_32( ivas_total_brate, MIN_BRATE_MDCT_STEREO ) ) { - st_ivas->element_mode_init = IVAS_CPE_MDCT; - move16(); + /* 1 bit */ + IF( st_ivas->bit_stream[num_bits_read] ) + { + st_ivas->element_mode_init = add( 1, IVAS_CPE_DFT ); + } + ELSE + { + st_ivas->element_mode_init = add( 0, IVAS_CPE_DFT ); + } } ELSE { - st_ivas->element_mode_init = IVAS_CPE_DFT; + st_ivas->element_mode_init = IVAS_CPE_MDCT; move16(); } - st_ivas->nchan_transport = 2; - move16(); - BREAK; - case SID_SBA_1TC: - st_ivas->element_mode_init = IVAS_SCE; - move16(); - BREAK; - case SID_SBA_2TC: - st_ivas->element_mode_init = IVAS_CPE_MDCT; - move16(); - BREAK; + } } - - IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) + ELSE IF( EQ_32( ivas_total_brate, IVAS_SID_5k2 ) ) { - /* read the number of objects */ - nchan_ism = 1; - move16(); - k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); - k = sub( sub( k, 1 ), SID_FORMAT_NBITS ); - WHILE( st_ivas->bit_stream[k] && ( nchan_ism < MAX_NUM_OBJECTS ) ) + SWITCH( st_ivas->sid_format ) { - nchan_ism = add( nchan_ism, 1 ); + case SID_DFT_STEREO: + st_ivas->element_mode_init = IVAS_CPE_DFT; + move16(); + BREAK; + case SID_MDCT_STEREO: + st_ivas->element_mode_init = IVAS_CPE_MDCT; + move16(); + BREAK; + case SID_ISM: + st_ivas->element_mode_init = IVAS_SCE; + move16(); + BREAK; + case SID_MASA_1TC: + st_ivas->element_mode_init = IVAS_SCE; + move16(); + st_ivas->nchan_transport = 1; + move16(); + BREAK; + case SID_MASA_2TC: + k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); + IF( st_ivas->bit_stream[k - 1 - SID_FORMAT_NBITS] == 1 ) + { + st_ivas->element_mode_init = IVAS_CPE_MDCT; + move16(); + } + ELSE + { + st_ivas->element_mode_init = IVAS_CPE_DFT; + move16(); + } + st_ivas->nchan_transport = 2; + move16(); + BREAK; + case SID_SBA_1TC: + st_ivas->element_mode_init = IVAS_SCE; + move16(); + BREAK; + case SID_SBA_2TC: + st_ivas->element_mode_init = IVAS_CPE_MDCT; + move16(); + BREAK; + } + + IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) + { + /* read the number of objects */ + nchan_ism = 1; + move16(); + k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); + k = sub( sub( k, 1 ), SID_FORMAT_NBITS ); + WHILE( st_ivas->bit_stream[k] && ( nchan_ism < MAX_NUM_OBJECTS ) ) + { + nchan_ism = add( nchan_ism, 1 ); + k = sub( k, 1 ); + } k = sub( k, 1 ); + + test(); + IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ){ + #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH + IF( Opt_tsm ){ + #endif + st_ivas->restartNeeded = 1; + move16(); + + return IVAS_ERR_OK; + #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH } - k = sub( k, 1 ); - - test(); - IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ){ -#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - IF( Opt_tsm ){ -#endif - st_ivas->restartNeeded = 1; - move16(); - - 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!" ); + 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 } -#endif -} - -st_ivas->nchan_ism = nchan_ism; -move16(); - -/* read ism_mode */ -st_ivas->ism_mode = ISM_MODE_DISC; -move32(); -IF( GT_16( nchan_ism, 2 ) ) -{ - k = sub( k, nchan_ism ); /* SID metadata flags */ - idx = st_ivas->bit_stream[k]; + + st_ivas->nchan_ism = nchan_ism; move16(); - st_ivas->ism_mode = (ISM_MODE) add( idx, 1 ); + + /* read ism_mode */ + st_ivas->ism_mode = ISM_MODE_DISC; move32(); -} - -st_ivas->nchan_transport = nchan_ism; -move16(); -if ( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) -{ - st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; + IF( GT_16( nchan_ism, 2 ) ) + { + k = sub( k, nchan_ism ); /* SID metadata flags */ + idx = st_ivas->bit_stream[k]; + move16(); + st_ivas->ism_mode = (ISM_MODE) add( idx, 1 ); + move32(); + } + + st_ivas->nchan_transport = nchan_ism; move16(); -} -} -} - -st_ivas->bit_stream = bit_stream_orig; - -return IVAS_ERR_OK; + if ( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) + { + st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; + move16(); + } + } + } + + st_ivas->bit_stream = bit_stream_orig; + + return IVAS_ERR_OK; } -- GitLab From 6d76cb1608273777264532e6b9c61ece6cebeb75 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 31 Mar 2026 17:36:35 +0200 Subject: [PATCH 3/5] clang-format --- lib_dec/ivas_init_dec_fx.c | 97 +++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index f0f14bb04..c633a9e72 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -159,9 +159,9 @@ ivas_error ivas_dec_get_format_fx( ELSE { #ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); + 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!" ); + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); } #endif } @@ -169,7 +169,7 @@ ivas_error ivas_dec_get_format_fx( /*-------------------------------------------------------------------* * Read other signaling (ISM/MC mode, number of channels, etc.) *-------------------------------------------------------------------*/ - + IF( is_DTXrate( ivas_total_brate ) == 0 ) { /*-------------------------------------------------------------------* @@ -179,7 +179,7 @@ ivas_error ivas_dec_get_format_fx( * - in MASA : read number of TC * - in MC : read LS setup *-------------------------------------------------------------------*/ - + IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) { element_mode_flag = 1; @@ -197,7 +197,7 @@ ivas_error ivas_dec_get_format_fx( nchan_ism = add( nchan_ism, 1 ); k = sub( k, 1 ); } - + test(); IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) { @@ -214,17 +214,17 @@ ivas_error ivas_dec_get_format_fx( ELSE { #ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); + 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!" ); + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); } #endif } - + st_ivas->nchan_ism = nchan_ism; move16(); st_ivas->ism_mode = ivas_ism_mode_select( nchan_ism, ivas_total_brate ); - + st_ivas->nchan_transport = nchan_ism; move16(); if ( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) @@ -248,7 +248,7 @@ ivas_error ivas_dec_get_format_fx( #endif st_ivas->restartNeeded = 1; move16(); - + return IVAS_ERR_OK; #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH } @@ -261,12 +261,12 @@ ivas_error ivas_dec_get_format_fx( } #endif } - + /* read Ambisonic (SBA) order */ sba_order = st_ivas->bit_stream[num_bits_read + 1]; move16(); sba_order = add( sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) ); - + test(); IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) ) { @@ -276,7 +276,7 @@ ivas_error ivas_dec_get_format_fx( #endif st_ivas->restartNeeded = 1; move16(); - + return IVAS_ERR_OK; #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH } @@ -289,7 +289,7 @@ ivas_error ivas_dec_get_format_fx( } #endif } - + sba_analysis_order = ivas_sba_get_analysis_order_fx( ivas_total_brate, sba_order ); st_ivas->nchan_transport = ivas_get_sba_num_TCs_fx( ivas_total_brate, sba_analysis_order ); } @@ -298,7 +298,7 @@ ivas_error ivas_dec_get_format_fx( UWord8 masaRestartCandidate; masaRestartCandidate = 0; move16(); - + /* read number of MASA transport channels */ k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); IF( st_ivas->bit_stream[k - 1] ) @@ -313,7 +313,7 @@ ivas_error ivas_dec_get_format_fx( masaRestartCandidate = 1; move16(); } - + st_ivas->nchan_transport = 2; move16(); element_mode_flag = 1; @@ -324,23 +324,23 @@ ivas_error ivas_dec_get_format_fx( #ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH if ( st_ivas->nchan_transport == 2 ) #else - test(); - if ( st_ivas->nchan_transport == 2 && Opt_tsm ) + test(); + if ( st_ivas->nchan_transport == 2 && Opt_tsm ) #endif { masaRestartCandidate = 1; move16(); } - + st_ivas->nchan_transport = 1; move16(); } - + /* this should be non-zero if original input format was MASA_ISM_FORMAT */ st_ivas->ism_mode = ISM_MODE_NONE; move16(); nchan_ism = add( st_ivas->bit_stream[k - 3], shl( st_ivas->bit_stream[k - 2], 1 ) ); - + IF( nchan_ism > 0 ) { /* the input_ivas_format should be MASA_ISM_FORMAT, but we cannot initialize it now */ @@ -358,7 +358,7 @@ ivas_error ivas_dec_get_format_fx( nchan_ism = 1; move16(); } - + /* for MASA_ISM_FORMAT at input the number of MASA transport channels is always 2 and the corresponding bit is not used here*/ st_ivas->nchan_transport = 2; move16(); @@ -369,10 +369,10 @@ ivas_error ivas_dec_get_format_fx( { st_ivas->restartNeeded = 1; move16(); - + return IVAS_ERR_OK; } - + test(); IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) { @@ -382,20 +382,20 @@ ivas_error ivas_dec_get_format_fx( #endif st_ivas->restartNeeded = 1; move16(); - + 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" ); + 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!" ); + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); } #endif } - + st_ivas->nchan_ism = nchan_ism; move16(); } @@ -403,12 +403,12 @@ ivas_error ivas_dec_get_format_fx( { st_ivas->nchan_transport = 2; /* always 2 MASA transport channels */ move16(); - + /* the number of objects are written at the end of the bitstream */ k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); nchan_ism = add( add( shl( st_ivas->bit_stream[k - 1], 1 ), st_ivas->bit_stream[k - 2] ), 1 ); st_ivas->ism_mode = ivas_omasa_ism_mode_select_fx( ivas_total_brate, nchan_ism ); - + test(); IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) { @@ -418,7 +418,7 @@ ivas_error ivas_dec_get_format_fx( #endif st_ivas->restartNeeded = 1; move16(); - + return IVAS_ERR_OK; #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH } @@ -431,7 +431,7 @@ ivas_error ivas_dec_get_format_fx( } #endif } - + st_ivas->nchan_ism = nchan_ism; move16(); } @@ -440,7 +440,7 @@ ivas_error ivas_dec_get_format_fx( /* the number of objects is written at the end of the bitstream, in the SBA metadata */ k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); nchan_ism = add( add( shl( st_ivas->bit_stream[k - 1], 1 ), st_ivas->bit_stream[k - 2] ), 1 ); - + test(); IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) { @@ -450,7 +450,7 @@ ivas_error ivas_dec_get_format_fx( #endif st_ivas->restartNeeded = 1; move16(); - + return IVAS_ERR_OK; #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH } @@ -463,20 +463,20 @@ ivas_error ivas_dec_get_format_fx( } #endif } - + st_ivas->nchan_ism = nchan_ism; move16(); - + /* read Ambisonic (SBA) planar flag */ /*sba_planar = st_ivas->bit_stream[num_bits_read];*/ num_bits_read = add( num_bits_read, SBA_PLANAR_BITS ); - + /* read Ambisonic (SBA) order (0 for signaling OSBA format at low bitrates)*/ sba_order = st_ivas->bit_stream[num_bits_read + 1]; move16(); sba_order = add( sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) ); num_bits_read = add( num_bits_read, SBA_ORDER_BITS ); - + /* read the real Ambisonic order when the above bits are used to signal OSBA format */ IF( LT_32( ivas_total_brate, IVAS_24k4 ) ) { @@ -485,7 +485,7 @@ ivas_error ivas_dec_get_format_fx( sba_order = add( sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) ); num_bits_read = add( num_bits_read, SBA_ORDER_BITS ); } - + test(); IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) ) { @@ -495,7 +495,7 @@ ivas_error ivas_dec_get_format_fx( #endif st_ivas->restartNeeded = 1; move16(); - + return IVAS_ERR_OK; #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH } @@ -508,9 +508,9 @@ ivas_error ivas_dec_get_format_fx( } #endif } - + st_ivas->ism_mode = ivas_osba_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); - + sba_analysis_order = ivas_sba_get_analysis_order_fx( ivas_total_brate, sba_order ); st_ivas->nchan_transport = ivas_get_sba_num_TCs_fx( ivas_total_brate, sba_analysis_order ); } @@ -527,9 +527,9 @@ ivas_error ivas_dec_get_format_fx( } } num_bits_read = add( num_bits_read, MC_LS_SETUP_BITS ); - + signaled_config = ivas_mc_map_ls_setup_to_output_config_fx( idx ); - + test(); IF( st_ivas->ini_frame > 0 && NE_32( st_ivas->transport_config, signaled_config ) ) { @@ -539,7 +539,7 @@ ivas_error ivas_dec_get_format_fx( #endif st_ivas->restartNeeded = 1; move16(); - + return IVAS_ERR_OK; #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH } @@ -552,16 +552,16 @@ ivas_error ivas_dec_get_format_fx( } #endif } - + st_ivas->mc_mode = ivas_mc_mode_select_fx( ivas_mc_map_output_config_to_mc_ls_setup_fx( signaled_config ), ivas_total_brate ); st_ivas->transport_config = signaled_config; move16(); } - + /*-------------------------------------------------------------------* * Read element mode *-------------------------------------------------------------------*/ - + test(); IF( st_ivas->ini_frame == 0 && element_mode_flag ) { @@ -4038,7 +4038,6 @@ static ivas_error doSanityChecks_IVAS( } } - IF( st_ivas->hDecoderConfig->Opt_ObjEdit_on ) { test(); -- GitLab From cf6e23e24cb2ac17cfcd110f65cbbc5391c49f45 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 31 Mar 2026 17:40:00 +0200 Subject: [PATCH 4/5] clang-format --- lib_dec/ivas_init_dec_fx.c | 86 +++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index c633a9e72..6d10ca2af 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -207,7 +207,7 @@ ivas_error ivas_dec_get_format_fx( #endif st_ivas->restartNeeded = 1; move16(); - + return IVAS_ERR_OK; #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH } @@ -238,7 +238,7 @@ ivas_error ivas_dec_get_format_fx( /* read Ambisonic (SBA) planar flag */ sba_planar = st_ivas->bit_stream[num_bits_read]; num_bits_read = add( num_bits_read, SBA_PLANAR_BITS ); - + test(); IF( st_ivas->ini_frame > 0 && NE_16( sba_planar, st_ivas->sba_planar ) ) { @@ -631,7 +631,7 @@ ivas_error ivas_dec_get_format_fx( move16(); BREAK; } - + IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) { /* read the number of objects */ @@ -645,51 +645,53 @@ ivas_error ivas_dec_get_format_fx( k = sub( k, 1 ); } k = sub( k, 1 ); - + test(); - IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ){ + IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) + { #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH - IF( Opt_tsm ){ + IF( Opt_tsm ) + { #endif st_ivas->restartNeeded = 1; - move16(); + move16(); + + 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 + } - 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!" ); + st_ivas->nchan_ism = nchan_ism; + move16(); + + /* read ism_mode */ + st_ivas->ism_mode = ISM_MODE_DISC; + move32(); + IF( GT_16( nchan_ism, 2 ) ) + { + k = sub( k, nchan_ism ); /* SID metadata flags */ + idx = st_ivas->bit_stream[k]; + move16(); + st_ivas->ism_mode = (ISM_MODE) add( idx, 1 ); + move32(); + } + + st_ivas->nchan_transport = nchan_ism; + move16(); + if ( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) + { + st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; + move16(); + } } - #endif - } - - st_ivas->nchan_ism = nchan_ism; - move16(); - - /* read ism_mode */ - st_ivas->ism_mode = ISM_MODE_DISC; - move32(); - IF( GT_16( nchan_ism, 2 ) ) - { - k = sub( k, nchan_ism ); /* SID metadata flags */ - idx = st_ivas->bit_stream[k]; - move16(); - st_ivas->ism_mode = (ISM_MODE) add( idx, 1 ); - move32(); - } - - st_ivas->nchan_transport = nchan_ism; - move16(); - if ( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) - { - st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; - move16(); - } - } } st_ivas->bit_stream = bit_stream_orig; -- GitLab From 1b48fdf907ef3bfc5f1fc67d59392741c73748cb Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 31 Mar 2026 18:01:21 +0200 Subject: [PATCH 5/5] clang-format --- lib_dec/ivas_init_dec_fx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 6d10ca2af..fc1133f74 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -649,10 +649,10 @@ ivas_error ivas_dec_get_format_fx( test(); IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) { - #ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH +#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH IF( Opt_tsm ) { - #endif +#endif st_ivas->restartNeeded = 1; move16(); @@ -668,10 +668,10 @@ ivas_error ivas_dec_get_format_fx( } #endif } - + st_ivas->nchan_ism = nchan_ism; move16(); - + /* read ism_mode */ st_ivas->ism_mode = ISM_MODE_DISC; move32(); @@ -683,7 +683,7 @@ ivas_error ivas_dec_get_format_fx( st_ivas->ism_mode = (ISM_MODE) add( idx, 1 ); move32(); } - + st_ivas->nchan_transport = nchan_ism; move16(); if ( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) @@ -693,9 +693,9 @@ ivas_error ivas_dec_get_format_fx( } } } - + st_ivas->bit_stream = bit_stream_orig; - + return IVAS_ERR_OK; } -- GitLab