Loading lib_com/ivas_prot.h +10 −0 Original line number Diff line number Diff line Loading @@ -999,10 +999,20 @@ ivas_error ivas_ism_metadata_enc_create( ivas_error ivas_ism_metadata_dec_create( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ #ifdef NONBE_FIX_1065_ISM_MD_HANDLE const int16_t n_ISms, /* i : number of separately coded objects */ #else const int16_t n_ISms, /* i : number of objects */ #endif int32_t element_brate_tmp[] /* o : element bitrate per object */ ); #ifdef NONBE_FIX_1065_ISM_MD_HANDLE void ivas_ism_reset_metadata_handle_dec( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ); #endif ivas_error ivas_ism_enc( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ float *data[], /* i : input signal [channels][samples] */ Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -196,6 +196,7 @@ #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_984_OMASA_EXT_OUTPUT /* Nok: issue 1497 - porting OMASA EXT MR */ #define NONBE_FIX_1065_ISM_MD_HANDLE /* VA: issue 1065: Allocate only the necessary number of ISM MD decoder handles. */ #define NONBE_FIX_1028_1DB_TCX_LEVEL_DROP /* VA: Harmonize the logic setting LP weighting factor between TCX encoder and TCX decoder */ /* #################### End BASOP porting switches ############################ */ Loading lib_dec/ivas_init_dec.c +20 −3 Original line number Diff line number Diff line Loading @@ -1272,7 +1272,11 @@ ivas_error ivas_init_decoder( } } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, element_brate_tmp ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nSCE, element_brate_tmp ) ) != IVAS_ERR_OK ) #endif { return error; } Loading Loading @@ -1603,11 +1607,24 @@ ivas_error ivas_init_decoder( } reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); #ifdef NONBE_FIX_1065_ISM_MD_HANDLE if ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) { return error; } } else { #endif if ( ( error = ivas_ism_metadata_dec_create( st_ivas, 1, NULL ) ) != IVAS_ERR_OK ) { return error; } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE } #endif } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { Loading lib_dec/ivas_ism_metadata_dec.c +69 −4 Original line number Diff line number Diff line Loading @@ -642,6 +642,40 @@ ivas_error ivas_ism_metadata_dec( 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( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ) { hIsmMeta->last_ism_metadata_flag = 0; hIsmMeta->position_angle.last_angle1_idx = 0; hIsmMeta->position_angle.last_angle2_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); hIsmMeta->orientation_angle.last_angle1_idx = 0; hIsmMeta->orientation_angle.last_angle2_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); hIsmMeta->last_radius_idx = 8; /* Init to radius 1.0 */ hIsmMeta->last_true_azimuth = 0; hIsmMeta->last_true_elevation = 0; hIsmMeta->last_azimuth = 0; hIsmMeta->last_elevation = 0; hIsmMeta->ism_imp = -1; hIsmMeta->ism_md_null_flag = 0; hIsmMeta->ism_md_lowrate_flag = 0; ivas_ism_reset_metadata( hIsmMeta ); return; } #endif /*------------------------------------------------------------------------- * ivas_ism_metadata_dec_create() Loading @@ -651,7 +685,11 @@ ivas_error ivas_ism_metadata_dec( ivas_error ivas_ism_metadata_dec_create( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ #ifdef NONBE_FIX_1065_ISM_MD_HANDLE const int16_t n_ISms, /* i : number of separately coded objects */ #else const int16_t n_ISms, /* i : number of objects */ #endif int32_t element_brate_tmp[] /* o : element bitrate per object */ ) { Loading @@ -659,13 +697,27 @@ ivas_error ivas_ism_metadata_dec_create( 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( st_ivas->hIsmMetaData[ch] ); #else st_ivas->hIsmMetaData[ch]->last_ism_metadata_flag = 0; st_ivas->hIsmMetaData[ch]->position_angle.last_angle1_idx = 0; st_ivas->hIsmMetaData[ch]->position_angle.last_angle2_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); Loading @@ -683,8 +735,21 @@ ivas_error ivas_ism_metadata_dec_create( st_ivas->hIsmMetaData[ch]->ism_md_lowrate_flag = 0; 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 ( ( error = ivas_ism_config( 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.c +27 −1 Original line number Diff line number Diff line Loading @@ -297,6 +297,22 @@ ivas_error ivas_omasa_dec_config( if ( 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( 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( st_ivas->hIsmMetaData[k] ); } } #else n_MD = st_ivas->nchan_ism; ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) Loading @@ -305,6 +321,7 @@ ivas_error ivas_omasa_dec_config( } ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); #endif } else { Loading @@ -319,13 +336,21 @@ ivas_error ivas_omasa_dec_config( return error; } } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE else { ivas_ism_reset_metadata_handle_dec( st_ivas->hIsmMetaData[0] ); } #endif } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { n_MD = st_ivas->nchan_ism; ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); #ifndef NONBE_FIX_1065_ISM_MD_HANDLE ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); #endif if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) { return error; Loading Loading @@ -361,6 +386,7 @@ ivas_error ivas_omasa_dec_config( ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); #endif st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; /*-----------------------------------------------------------------* Loading Loading
lib_com/ivas_prot.h +10 −0 Original line number Diff line number Diff line Loading @@ -999,10 +999,20 @@ ivas_error ivas_ism_metadata_enc_create( ivas_error ivas_ism_metadata_dec_create( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ #ifdef NONBE_FIX_1065_ISM_MD_HANDLE const int16_t n_ISms, /* i : number of separately coded objects */ #else const int16_t n_ISms, /* i : number of objects */ #endif int32_t element_brate_tmp[] /* o : element bitrate per object */ ); #ifdef NONBE_FIX_1065_ISM_MD_HANDLE void ivas_ism_reset_metadata_handle_dec( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ); #endif ivas_error ivas_ism_enc( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ float *data[], /* i : input signal [channels][samples] */ Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -196,6 +196,7 @@ #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_984_OMASA_EXT_OUTPUT /* Nok: issue 1497 - porting OMASA EXT MR */ #define NONBE_FIX_1065_ISM_MD_HANDLE /* VA: issue 1065: Allocate only the necessary number of ISM MD decoder handles. */ #define NONBE_FIX_1028_1DB_TCX_LEVEL_DROP /* VA: Harmonize the logic setting LP weighting factor between TCX encoder and TCX decoder */ /* #################### End BASOP porting switches ############################ */ Loading
lib_dec/ivas_init_dec.c +20 −3 Original line number Diff line number Diff line Loading @@ -1272,7 +1272,11 @@ ivas_error ivas_init_decoder( } } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, element_brate_tmp ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nSCE, element_brate_tmp ) ) != IVAS_ERR_OK ) #endif { return error; } Loading Loading @@ -1603,11 +1607,24 @@ ivas_error ivas_init_decoder( } reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); #ifdef NONBE_FIX_1065_ISM_MD_HANDLE if ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) { return error; } } else { #endif if ( ( error = ivas_ism_metadata_dec_create( st_ivas, 1, NULL ) ) != IVAS_ERR_OK ) { return error; } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE } #endif } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { Loading
lib_dec/ivas_ism_metadata_dec.c +69 −4 Original line number Diff line number Diff line Loading @@ -642,6 +642,40 @@ ivas_error ivas_ism_metadata_dec( 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( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ) { hIsmMeta->last_ism_metadata_flag = 0; hIsmMeta->position_angle.last_angle1_idx = 0; hIsmMeta->position_angle.last_angle2_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); hIsmMeta->orientation_angle.last_angle1_idx = 0; hIsmMeta->orientation_angle.last_angle2_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); hIsmMeta->last_radius_idx = 8; /* Init to radius 1.0 */ hIsmMeta->last_true_azimuth = 0; hIsmMeta->last_true_elevation = 0; hIsmMeta->last_azimuth = 0; hIsmMeta->last_elevation = 0; hIsmMeta->ism_imp = -1; hIsmMeta->ism_md_null_flag = 0; hIsmMeta->ism_md_lowrate_flag = 0; ivas_ism_reset_metadata( hIsmMeta ); return; } #endif /*------------------------------------------------------------------------- * ivas_ism_metadata_dec_create() Loading @@ -651,7 +685,11 @@ ivas_error ivas_ism_metadata_dec( ivas_error ivas_ism_metadata_dec_create( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ #ifdef NONBE_FIX_1065_ISM_MD_HANDLE const int16_t n_ISms, /* i : number of separately coded objects */ #else const int16_t n_ISms, /* i : number of objects */ #endif int32_t element_brate_tmp[] /* o : element bitrate per object */ ) { Loading @@ -659,13 +697,27 @@ ivas_error ivas_ism_metadata_dec_create( 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( st_ivas->hIsmMetaData[ch] ); #else st_ivas->hIsmMetaData[ch]->last_ism_metadata_flag = 0; st_ivas->hIsmMetaData[ch]->position_angle.last_angle1_idx = 0; st_ivas->hIsmMetaData[ch]->position_angle.last_angle2_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); Loading @@ -683,8 +735,21 @@ ivas_error ivas_ism_metadata_dec_create( st_ivas->hIsmMetaData[ch]->ism_md_lowrate_flag = 0; 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 ( ( error = ivas_ism_config( 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.c +27 −1 Original line number Diff line number Diff line Loading @@ -297,6 +297,22 @@ ivas_error ivas_omasa_dec_config( if ( 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( 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( st_ivas->hIsmMetaData[k] ); } } #else n_MD = st_ivas->nchan_ism; ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) Loading @@ -305,6 +321,7 @@ ivas_error ivas_omasa_dec_config( } ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); #endif } else { Loading @@ -319,13 +336,21 @@ ivas_error ivas_omasa_dec_config( return error; } } #ifdef NONBE_FIX_1065_ISM_MD_HANDLE else { ivas_ism_reset_metadata_handle_dec( st_ivas->hIsmMetaData[0] ); } #endif } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { n_MD = st_ivas->nchan_ism; ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); #ifndef NONBE_FIX_1065_ISM_MD_HANDLE ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); #endif if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) { return error; Loading Loading @@ -361,6 +386,7 @@ ivas_error ivas_omasa_dec_config( ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); #endif st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; /*-----------------------------------------------------------------* Loading