From 71ac6c7ad84be34624d6f313cb3adbda160b5a4d Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 18 Aug 2025 11:59:35 +0200 Subject: [PATCH 1/2] port MR --- lib_com/ivas_cnst.h | 4 + lib_com/ivas_prot_fx.h | 7 +- lib_com/options.h | 1 + lib_dec/ivas_init_dec_fx.c | 451 ++++++++++++++++++++++++++++++++++- lib_dec/ivas_jbm_dec_fx.c | 4 +- lib_enc/ivas_init_enc_fx.c | 2 + lib_rend/ivas_prot_rend_fx.h | 6 + 7 files changed, 461 insertions(+), 14 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index ec30ba914..dd1e5ce12 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -270,7 +270,11 @@ typedef enum #define SID_MDCT_STEREO 0x1 /* 1| 0| 0 */ #define SID_ISM 0x2 /* 0| 1| 0 */ #define SID_MASA_1TC 0x3 /* 1| 1| 0 */ +#ifdef FIX_1209_SID_SIGNALING +/*reserved*/ /*0x4*/ /* 0| 0| 1 */ +#else #define SID_MULTICHANNEL 0x4 /* 0| 0| 1 */ +#endif #define SID_SBA_1TC 0x5 /* 1| 0| 1 */ #define SID_SBA_2TC 0x6 /* 0| 1| 1 */ #define SID_MASA_2TC 0x7 /* 1| 1| 1 */ diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 7adb4d806..e597688ed 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -4034,7 +4034,6 @@ void ivas_syn_output_f_fx( Word32 *synth_out /* o : integer 16 bits synthesis signal */ ); - ivas_error ivas_init_encoder_fx( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ); @@ -4045,10 +4044,8 @@ ivas_error ivas_output_buff_dec_fx( const Word16 nchan_out_buff /* i : number of output channels */ ); -/*! r: flag to indicate if split rendering is enabled */ -Word16 is_split_rendering_enabled( - const DECODER_CONFIG_HANDLE hDecoderConfig, /* i : configuration structure */ - const IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* i : Render config data structure */ +ivas_error ivas_dec_get_format_fx( + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); ivas_error ivas_dec_setup( diff --git a/lib_com/options.h b/lib_com/options.h index 49f6e68e9..f1f4f265b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -122,6 +122,7 @@ #define NONBE_1360_LFE_DELAY /* Dlb: LFE delay alignment when rendering in CLDFB domain*/ #define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ #define NONBE_SVD_OPTIMIZATION +#define FIX_1209_SID_SIGNALING /* VA: issue 1209: remove dead code in IVAS SID signaling */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 667b9dc32..39369ee79 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -110,6 +110,431 @@ static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const Word16 sba_orde } #endif + +#ifdef FIX_1209_SID_SIGNALING +/*---------------------------------------------------------------------* + * ivas_dec_get_format_fx( ) + * + * Read main parameters from the bitstream to set-up the decoder: + * - IVAS format + * - IVAS format specific signaling + *---------------------------------------------------------------------*/ + +ivas_error ivas_dec_get_format_fx( + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ +) +{ + Word16 k, idx, num_bits_read; + Word16 nchan_ism, element_mode_flag; + Word16 sba_order, sba_planar, sba_analysis_order; + Word32 ivas_total_brate; + UWord16 *bit_stream_orig; + AUDIO_CONFIG signaled_config; + ivas_error error; + + num_bits_read = 0; + move16(); + element_mode_flag = 0; + move16(); + + ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; + move32(); + bit_stream_orig = st_ivas->bit_stream; + + /*-------------------------------------------------------------------* + * Read IVAS format + *-------------------------------------------------------------------*/ + + IF( ( error = ivas_read_format( st_ivas, &num_bits_read ) ) != IVAS_ERR_OK ) + { + return error; + } + + test(); + test(); + test(); + test(); + 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 ) ) ) + { +#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!" ); + } + + /*-------------------------------------------------------------------* + * Read other signaling (ISM/MC mode, number of channels, etc.) + *-------------------------------------------------------------------*/ + + k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); + + 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 + *-------------------------------------------------------------------*/ + + IF( EQ_32( st_ivas->ivas_format, STEREO_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(); + WHILE( st_ivas->bit_stream[k - 1] && 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 ) ) + { +#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(); + 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 ) ) + { +#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!" ); + } + + /* 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 ) ) + { +#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!" ); + } + + 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 ) ) + { + /* read number of MASA transport channels */ + IF( st_ivas->bit_stream[k - 1] ) + { + st_ivas->nchan_transport = 2; + move16(); + element_mode_flag = 1; + move16(); + } + ELSE + { + 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 = 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( st_ivas->nchan_ism, 2 ) ) + { + st_ivas->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(); + } + + test(); + IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) + { +#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(); + } + 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 */ + 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 ) ) + { +#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(); + } + 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 */ + 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 ) ) + { +#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 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 = 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 = 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 ) ) + { +#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!" ); + } + + 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 ) ) ); + } + } + 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 ) ) + { +#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!" ); + } + + st_ivas->mc_mode = ivas_mc_mode_select_fx( ivas_mc_map_output_config_to_mc_ls_setup_fx( signaled_config ), st_ivas->hDecoderConfig->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 ); + } + 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: + 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 ( st_ivas->ivas_format == ISM_FORMAT ) + { + /* read the number of objects */ + nchan_ism = 1; + move16(); + WHILE( st_ivas->bit_stream[k - 1 - SID_FORMAT_NBITS] && 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 ) ) + { +#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(); + } + } + } + + st_ivas->bit_stream = bit_stream_orig; + + return IVAS_ERR_OK; +} +#endif + + /*-------------------------------------------------------------------* * ivas_dec_setup() * @@ -127,6 +552,9 @@ ivas_error ivas_dec_setup( Decoder_State *st; Word32 ivas_total_brate; ivas_error error; + Word16 SrcInd[MAX_NUM_TDREND_CHANNELS]; + Word16 num_src = 0; + move16(); error = IVAS_ERR_OK; move32(); @@ -142,11 +570,14 @@ ivas_error ivas_dec_setup( * Read IVAS format *-------------------------------------------------------------------*/ +#ifdef FIX_1209_SID_SIGNALING + IF( ( error = ivas_read_format( st_ivas, &num_bits_read ) ) != IVAS_ERR_OK ) + { + return error; + } +#else ivas_read_format( st_ivas, &num_bits_read ); - - Word16 SrcInd[MAX_NUM_TDREND_CHANNELS]; - Word16 num_src = 0; - move16(); +#endif /*-------------------------------------------------------------------* * Read other signling (ISM/MC mode, number of channels, etc.) @@ -377,10 +808,11 @@ ivas_error ivas_dec_setup( /* read Ambisonic (SBA) order */ /* read the real Ambisonic order when the above bits are used to signal OSBA format */ - if ( LT_32( ivas_total_brate, IVAS_24k4 ) ) + IF( LT_32( ivas_total_brate, IVAS_24k4 ) ) { st_ivas->sba_order = st_ivas->bit_stream[num_bits_read + 1]; - st_ivas->sba_order += 2 * st_ivas->bit_stream[num_bits_read]; + move16(); + st_ivas->sba_order = shl( st_ivas->bit_stream[num_bits_read], 1 ); num_bits_read += SBA_ORDER_BITS; } @@ -615,6 +1047,7 @@ ivas_error ivas_dec_setup( st_ivas->nchan_ism = nchan_ism; move16(); + /* read ism_mode */ st_ivas->ism_mode = ISM_MODE_DISC; move32(); @@ -825,10 +1258,12 @@ static ivas_error ivas_read_format( st_ivas->ivas_format = ISM_FORMAT; move32(); BREAK; +#ifndef FIX_1209_SID_SIGNALING case SID_MULTICHANNEL: st_ivas->ivas_format = MC_FORMAT; move32(); BREAK; +#endif case SID_SBA_1TC: st_ivas->ivas_format = SBA_FORMAT; move32(); @@ -864,7 +1299,9 @@ static ivas_error ivas_read_format( } BREAK; default: - /* This should actually be impossible, since only 3 bits are read, so if this happens something is broken */ +#ifndef FIX_1209_SID_SIGNALING +/* This should actually be impossible, since only 3 bits are read, so if this happens something is broken */ +#endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Invalid value %c found in SID format field.", st_ivas->sid_format ); } diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index a502d1b1c..5009ba58d 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2651,7 +2651,7 @@ ivas_error ivas_jbm_dec_render_fx( nchan_out_syn_output = nchan_out; move16(); - if ( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ) == 0 ) + IF( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ) == 0 ) { IF( NE_32( st_ivas->ivas_format, MONO_FORMAT ) ) { @@ -2963,7 +2963,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( move16(); /* Only write out the valid data*/ - if ( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ) == 0 ) + IF( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ) == 0 ) { IF( NE_16( st_ivas->ivas_format, MONO_FORMAT ) ) { diff --git a/lib_enc/ivas_init_enc_fx.c b/lib_enc/ivas_init_enc_fx.c index 8c41a62fb..c4a917c23 100644 --- a/lib_enc/ivas_init_enc_fx.c +++ b/lib_enc/ivas_init_enc_fx.c @@ -187,10 +187,12 @@ void ivas_write_format_sid_fx( ind = SID_ISM; move16(); BREAK; +#ifndef FIX_1209_SID_SIGNALING case MC_FORMAT: ind = SID_MULTICHANNEL; move16(); BREAK; +#endif case SBA_FORMAT: SWITCH( element_mode ) { diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index 04d45c726..a690fc598 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -75,6 +75,12 @@ Word16 ivas_get_nchan_buffers_dec_fx( const Word32 ivas_total_brate /* i : total IVAS bitrate */ ); +/*! r: flag to indicate if split rendering is enabled */ +Word16 is_split_rendering_enabled( + const DECODER_CONFIG_HANDLE hDecoderConfig, /* i : configuration structure */ + const IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* i : Render config data structure */ +); + ivas_error get_channel_config( const AUDIO_CONFIG config, /* i : audio configuration */ Word8 *str /* o : string with the configuration name */ -- GitLab From 4189584d2b3e9cd8ba559dab1beb3b72ea9f2736 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 19 Aug 2025 01:37:39 +0200 Subject: [PATCH 2/2] fix --- 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 47b7bc18d..294eb1a68 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -54,7 +54,7 @@ static ivas_error doSanityChecks_IVAS( Decoder_Struct *st_ivas ); #ifdef NONBE_FIX_1052_SBA_EXT #ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER -static AUDIO_CONFIG ivas_set_audio_config_from_sba_order( const int16_t sba_order ); +static AUDIO_CONFIG ivas_set_audio_config_from_sba_order( const Word16 sba_order ); #else static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const Word16 sba_order ); #endif @@ -71,7 +71,7 @@ static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const Word16 sba_orde /*! r: audio configuration */ static AUDIO_CONFIG ivas_set_audio_config_from_sba_order( - const int16_t sba_order /* i : Ambisonic (SBA) order */ + const Word16 sba_order /* i : Ambisonic (SBA) order */ ) #else static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const Word16 sba_order ) @@ -113,7 +113,7 @@ static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const Word16 sba_orde #ifdef FIX_1209_SID_SIGNALING /*---------------------------------------------------------------------* - * ivas_dec_get_format_fx( ) + * ivas_dec_get_format( ) * * Read main parameters from the bitstream to set-up the decoder: * - IVAS format @@ -707,6 +707,7 @@ ivas_error ivas_dec_setup( st_ivas->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*/ #else /* the input_ivas_format should be MASA_ISM_FORMAT, but we cannot initialize it now */ @@ -764,8 +765,8 @@ ivas_error ivas_dec_setup( { st_ivas->nchan_transport = 2; /* always 2 MASA transport channels */ move16(); - /* for the DISC mode the number of objects are written at the end of the bitstream, in the MASA metadata */ + /* for the DISC mode the number of objects are written at the end of the bitstream, in the MASA metadata */ Word32 res_dec, res_frac; iDiv_and_mod_32( ivas_total_brate, FRAMES_PER_SEC, &res_dec, &res_frac, 0 ); st_ivas->nchan_ism = add( add( shl( st_ivas->bit_stream[res_dec - 1], 1 ), st_ivas->bit_stream[res_dec - 2] ), 1 ); @@ -812,8 +813,8 @@ ivas_error ivas_dec_setup( { st_ivas->sba_order = st_ivas->bit_stream[num_bits_read + 1]; move16(); - st_ivas->sba_order = shl( st_ivas->bit_stream[num_bits_read], 1 ); - num_bits_read += SBA_ORDER_BITS; + st_ivas->sba_order = add( st_ivas->sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) ); + num_bits_read = add( num_bits_read, SBA_ORDER_BITS ); } test(); @@ -835,7 +836,6 @@ ivas_error ivas_dec_setup( /*correct number of CPEs for discrete ISM coding*/ test(); IF( st_ivas->ini_frame > 0 && EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) ) - #ifdef NONBE_FIX_ISM_XOVER_BR { Word16 n; -- GitLab