Loading lib_com/ivas_prot_fx.h +14 −2 Original line number Diff line number Diff line Loading @@ -2376,9 +2376,20 @@ ivas_error ivas_ism_dec_config_fx( ivas_error ivas_ism_metadata_dec_create_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ #ifdef NONBE_FIX_1065_ISM_MD_HANDLE const Word16 n_ISms, /* i : number of separately coded objects */ #else const Word16 n_ISms, /* i : number of objects */ #endif Word32 element_brate_tmp[] /* o : element bitrate per object */ ); #ifdef NONBE_FIX_1065_ISM_MD_HANDLE void ivas_ism_reset_metadata_handle_dec_fx( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ); #endif ivas_error ivas_sba_dec_reconfigure_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ UWord16 *nSamplesFlushed, /* o : number of samples flushed */ Loading @@ -2394,6 +2405,7 @@ void ivas_spar_md_dec_matrix_close_fx( ivas_spar_md_dec_state_t *hMdDecoder, /* i/o: SPAR MD decoder handle */ const Word16 num_channels /* i : number of internal channels */ ); ivas_error ivas_spar_dec_open_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const Word16 spar_reconfig_flag /* i : SPAR reconfiguration flag */ Loading lib_com/options.h +2 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,8 @@ #define NONBE_FIX_SBA_SIGNALING_BITS_B /* FhG: issue 1061: option B: signal sba order additionally in OSBA */ #define NONBE_FIX_1045_ISM_BITRATE_SWITCHING /* Eri: Difference between ROM/File HRTF in ISM bitrate switching */ #define NONBE_FIX_1065_ISM_MD_HANDLE /* VA: issue 1065: Allocate only the necessary number of ISM MD decoder handles. */ /* #################### End BASOP porting switches ############################ */ #endif lib_dec/ivas_init_dec_fx.c +21 −2 Original line number Diff line number Diff line Loading @@ -1508,7 +1508,11 @@ ivas_error ivas_init_decoder_fx( } } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE IF( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, element_brate_tmp ) ) != IVAS_ERR_OK ) #else IF( NE_32( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nSCE, element_brate_tmp ) ), IVAS_ERR_OK ) ) #endif { return error; } Loading Loading @@ -1907,6 +1911,7 @@ ivas_error ivas_init_decoder_fx( move16(); ism_total_brate = sep_object_brate[k - 2][0]; move32(); IF( NE_32( ( error = create_sce_dec( st_ivas, 0, ism_total_brate ) ), IVAS_ERR_OK ) ) { return error; Loading @@ -1914,10 +1919,24 @@ ivas_error ivas_init_decoder_fx( reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); #ifdef NONBE_FIX_1065_ISM_MD_HANDLE IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) { if ( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) { return error; } } else { #endif IF( NE_32( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, 1, NULL ) ), IVAS_ERR_OK ) ) { return error; } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE } #endif } ELSE IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) { Loading lib_dec/ivas_ism_metadata_dec_fx.c +83 −5 Original line number Diff line number Diff line Loading @@ -780,6 +780,53 @@ ivas_error ivas_ism_metadata_dec_fx( return IVAS_ERR_OK; } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE /*-------------------------------------------------------------------* * ivas_ism_reset_metadata_handle_dec() * * Reset ISM decoder metadata handle *-------------------------------------------------------------------*/ void ivas_ism_reset_metadata_handle_dec_fx( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ) { hIsmMeta->last_ism_metadata_flag = 0; move16(); hIsmMeta->position_angle.last_angle1_idx = 0; move16(); hIsmMeta->position_angle.last_angle2_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); move16(); hIsmMeta->orientation_angle.last_angle1_idx = 0; move16(); hIsmMeta->orientation_angle.last_angle2_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); move16(); hIsmMeta->last_radius_idx = 8; /* Init to radius 1.0 */ move16(); hIsmMeta->last_true_azimuth_fx = 0; move32(); hIsmMeta->last_true_elevation_fx = 0; move32(); hIsmMeta->last_azimuth_fx = 0; move32(); hIsmMeta->last_elevation_fx = 0; move32(); hIsmMeta->ism_imp = -1; move16(); hIsmMeta->ism_md_null_flag = 0; move16(); hIsmMeta->ism_md_lowrate_flag = 0; move16(); ivas_ism_reset_metadata( hIsmMeta ); return; } #endif /*------------------------------------------------------------------------- * ivas_ism_metadata_dec_create() Loading @@ -789,7 +836,11 @@ ivas_error ivas_ism_metadata_dec_fx( ivas_error ivas_ism_metadata_dec_create_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ #ifdef NONBE_FIX_1065_ISM_MD_HANDLE const Word16 n_ISms, /* i : number of separately coded objects */ #else const Word16 n_ISms, /* i : number of objects */ #endif Word32 element_brate_tmp[] /* o : element bitrate per object */ ) { Loading @@ -797,13 +848,27 @@ ivas_error ivas_ism_metadata_dec_create_fx( ivas_error error; /* allocate ISM metadata handles */ #ifdef NONBE_FIX_1065_ISM_MD_HANDLE FOR( ch = 0; ch < n_ISms; ch++ ) #else FOR( ch = 0; ch < MAX_NUM_OBJECTS; ch++ ) #endif { #ifdef NONBE_FIX_1065_ISM_MD_HANDLE IF( st_ivas->hIsmMetaData[ch] == NULL ) /* note: the handle can be allocated in OMASA bitrate switching from ISM_MASA_MODE_xxx_ONE_OBJ to ISM_MASA_MODE_DISC mode for 'ch==0' */ { #endif IF( ( st_ivas->hIsmMetaData[ch] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISM MetaData\n" ) ); } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE } #endif #ifdef NONBE_FIX_1065_ISM_MD_HANDLE ivas_ism_reset_metadata_handle_dec_fx( st_ivas->hIsmMetaData[ch] ); #else st_ivas->hIsmMetaData[ch]->last_ism_metadata_flag = 0; move16(); st_ivas->hIsmMetaData[ch]->position_angle.last_angle1_idx = 0; Loading Loading @@ -834,8 +899,21 @@ ivas_error ivas_ism_metadata_dec_create_fx( move16(); ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); #endif } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE /* sanity freeing - it can happen only in reconfiguration when a smaller number of handles than before is requested */ FOR( ; ch < MAX_NUM_OBJECTS; ch++ ) { IF( st_ivas->hIsmMetaData[ch] != NULL ) { free( st_ivas->hIsmMetaData[ch] ); st_ivas->hIsmMetaData[ch] = NULL; } } #endif IF( element_brate_tmp != NULL ) { IF( NE_32( ( error = ivas_ism_config_fx( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ) ), IVAS_ERR_OK ) ) Loading lib_dec/ivas_omasa_dec_fx.c +26 −1 Original line number Diff line number Diff line Loading @@ -569,6 +569,22 @@ ivas_error ivas_omasa_dec_config_fx( IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) { /* the full number of hIsmMetaData are needed for EXT output */ #ifdef NONBE_FIX_1065_ISM_MD_HANDLE IF( st_ivas->hIsmMetaData[0] == NULL ) { IF( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) { return error; } } ELSE { FOR( k = 0; k < st_ivas->nchan_ism; k++ ) { ivas_ism_reset_metadata_handle_dec_fx( st_ivas->hIsmMetaData[k] ); } } #else move16(); n_MD = st_ivas->nchan_ism; ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); Loading @@ -581,6 +597,7 @@ ivas_error ivas_omasa_dec_config_fx( } ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); #endif } ELSE { Loading @@ -599,14 +616,21 @@ ivas_error ivas_omasa_dec_config_fx( return error; } } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE ELSE { ivas_ism_reset_metadata_handle_dec_fx( st_ivas->hIsmMetaData[0] ); } #endif } ELSE IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) { n_MD = st_ivas->nchan_ism; move16(); #ifndef NONBE_FIX_1065_ISM_MD_HANDLE ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); #endif error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ); move32(); IF( NE_32( error, IVAS_ERR_OK ) ) Loading Loading @@ -647,6 +671,7 @@ ivas_error ivas_omasa_dec_config_fx( ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); #endif st_ivas->hCPE[0]->element_brate = L_sub( ivas_total_brate, ism_total_brate ); /*-----------------------------------------------------------------* Loading Loading
lib_com/ivas_prot_fx.h +14 −2 Original line number Diff line number Diff line Loading @@ -2376,9 +2376,20 @@ ivas_error ivas_ism_dec_config_fx( ivas_error ivas_ism_metadata_dec_create_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ #ifdef NONBE_FIX_1065_ISM_MD_HANDLE const Word16 n_ISms, /* i : number of separately coded objects */ #else const Word16 n_ISms, /* i : number of objects */ #endif Word32 element_brate_tmp[] /* o : element bitrate per object */ ); #ifdef NONBE_FIX_1065_ISM_MD_HANDLE void ivas_ism_reset_metadata_handle_dec_fx( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ); #endif ivas_error ivas_sba_dec_reconfigure_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ UWord16 *nSamplesFlushed, /* o : number of samples flushed */ Loading @@ -2394,6 +2405,7 @@ void ivas_spar_md_dec_matrix_close_fx( ivas_spar_md_dec_state_t *hMdDecoder, /* i/o: SPAR MD decoder handle */ const Word16 num_channels /* i : number of internal channels */ ); ivas_error ivas_spar_dec_open_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const Word16 spar_reconfig_flag /* i : SPAR reconfiguration flag */ Loading
lib_com/options.h +2 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,8 @@ #define NONBE_FIX_SBA_SIGNALING_BITS_B /* FhG: issue 1061: option B: signal sba order additionally in OSBA */ #define NONBE_FIX_1045_ISM_BITRATE_SWITCHING /* Eri: Difference between ROM/File HRTF in ISM bitrate switching */ #define NONBE_FIX_1065_ISM_MD_HANDLE /* VA: issue 1065: Allocate only the necessary number of ISM MD decoder handles. */ /* #################### End BASOP porting switches ############################ */ #endif
lib_dec/ivas_init_dec_fx.c +21 −2 Original line number Diff line number Diff line Loading @@ -1508,7 +1508,11 @@ ivas_error ivas_init_decoder_fx( } } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE IF( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, element_brate_tmp ) ) != IVAS_ERR_OK ) #else IF( NE_32( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nSCE, element_brate_tmp ) ), IVAS_ERR_OK ) ) #endif { return error; } Loading Loading @@ -1907,6 +1911,7 @@ ivas_error ivas_init_decoder_fx( move16(); ism_total_brate = sep_object_brate[k - 2][0]; move32(); IF( NE_32( ( error = create_sce_dec( st_ivas, 0, ism_total_brate ) ), IVAS_ERR_OK ) ) { return error; Loading @@ -1914,10 +1919,24 @@ ivas_error ivas_init_decoder_fx( reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); #ifdef NONBE_FIX_1065_ISM_MD_HANDLE IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) { if ( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) { return error; } } else { #endif IF( NE_32( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, 1, NULL ) ), IVAS_ERR_OK ) ) { return error; } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE } #endif } ELSE IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) { Loading
lib_dec/ivas_ism_metadata_dec_fx.c +83 −5 Original line number Diff line number Diff line Loading @@ -780,6 +780,53 @@ ivas_error ivas_ism_metadata_dec_fx( return IVAS_ERR_OK; } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE /*-------------------------------------------------------------------* * ivas_ism_reset_metadata_handle_dec() * * Reset ISM decoder metadata handle *-------------------------------------------------------------------*/ void ivas_ism_reset_metadata_handle_dec_fx( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ) { hIsmMeta->last_ism_metadata_flag = 0; move16(); hIsmMeta->position_angle.last_angle1_idx = 0; move16(); hIsmMeta->position_angle.last_angle2_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); move16(); hIsmMeta->orientation_angle.last_angle1_idx = 0; move16(); hIsmMeta->orientation_angle.last_angle2_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); move16(); hIsmMeta->last_radius_idx = 8; /* Init to radius 1.0 */ move16(); hIsmMeta->last_true_azimuth_fx = 0; move32(); hIsmMeta->last_true_elevation_fx = 0; move32(); hIsmMeta->last_azimuth_fx = 0; move32(); hIsmMeta->last_elevation_fx = 0; move32(); hIsmMeta->ism_imp = -1; move16(); hIsmMeta->ism_md_null_flag = 0; move16(); hIsmMeta->ism_md_lowrate_flag = 0; move16(); ivas_ism_reset_metadata( hIsmMeta ); return; } #endif /*------------------------------------------------------------------------- * ivas_ism_metadata_dec_create() Loading @@ -789,7 +836,11 @@ ivas_error ivas_ism_metadata_dec_fx( ivas_error ivas_ism_metadata_dec_create_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ #ifdef NONBE_FIX_1065_ISM_MD_HANDLE const Word16 n_ISms, /* i : number of separately coded objects */ #else const Word16 n_ISms, /* i : number of objects */ #endif Word32 element_brate_tmp[] /* o : element bitrate per object */ ) { Loading @@ -797,13 +848,27 @@ ivas_error ivas_ism_metadata_dec_create_fx( ivas_error error; /* allocate ISM metadata handles */ #ifdef NONBE_FIX_1065_ISM_MD_HANDLE FOR( ch = 0; ch < n_ISms; ch++ ) #else FOR( ch = 0; ch < MAX_NUM_OBJECTS; ch++ ) #endif { #ifdef NONBE_FIX_1065_ISM_MD_HANDLE IF( st_ivas->hIsmMetaData[ch] == NULL ) /* note: the handle can be allocated in OMASA bitrate switching from ISM_MASA_MODE_xxx_ONE_OBJ to ISM_MASA_MODE_DISC mode for 'ch==0' */ { #endif IF( ( st_ivas->hIsmMetaData[ch] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISM MetaData\n" ) ); } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE } #endif #ifdef NONBE_FIX_1065_ISM_MD_HANDLE ivas_ism_reset_metadata_handle_dec_fx( st_ivas->hIsmMetaData[ch] ); #else st_ivas->hIsmMetaData[ch]->last_ism_metadata_flag = 0; move16(); st_ivas->hIsmMetaData[ch]->position_angle.last_angle1_idx = 0; Loading Loading @@ -834,8 +899,21 @@ ivas_error ivas_ism_metadata_dec_create_fx( move16(); ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); #endif } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE /* sanity freeing - it can happen only in reconfiguration when a smaller number of handles than before is requested */ FOR( ; ch < MAX_NUM_OBJECTS; ch++ ) { IF( st_ivas->hIsmMetaData[ch] != NULL ) { free( st_ivas->hIsmMetaData[ch] ); st_ivas->hIsmMetaData[ch] = NULL; } } #endif IF( element_brate_tmp != NULL ) { IF( NE_32( ( error = ivas_ism_config_fx( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ) ), IVAS_ERR_OK ) ) Loading
lib_dec/ivas_omasa_dec_fx.c +26 −1 Original line number Diff line number Diff line Loading @@ -569,6 +569,22 @@ ivas_error ivas_omasa_dec_config_fx( IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) { /* the full number of hIsmMetaData are needed for EXT output */ #ifdef NONBE_FIX_1065_ISM_MD_HANDLE IF( st_ivas->hIsmMetaData[0] == NULL ) { IF( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) { return error; } } ELSE { FOR( k = 0; k < st_ivas->nchan_ism; k++ ) { ivas_ism_reset_metadata_handle_dec_fx( st_ivas->hIsmMetaData[k] ); } } #else move16(); n_MD = st_ivas->nchan_ism; ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); Loading @@ -581,6 +597,7 @@ ivas_error ivas_omasa_dec_config_fx( } ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); #endif } ELSE { Loading @@ -599,14 +616,21 @@ ivas_error ivas_omasa_dec_config_fx( return error; } } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE ELSE { ivas_ism_reset_metadata_handle_dec_fx( st_ivas->hIsmMetaData[0] ); } #endif } ELSE IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) { n_MD = st_ivas->nchan_ism; move16(); #ifndef NONBE_FIX_1065_ISM_MD_HANDLE ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); #endif error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ); move32(); IF( NE_32( error, IVAS_ERR_OK ) ) Loading Loading @@ -647,6 +671,7 @@ ivas_error ivas_omasa_dec_config_fx( ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); #endif st_ivas->hCPE[0]->element_brate = L_sub( ivas_total_brate, ism_total_brate ); /*-----------------------------------------------------------------* Loading