Loading lib_com/ivas_prot_fx.h +14 −2 Original line number Diff line number Diff line Loading @@ -2345,9 +2345,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 @@ -2363,6 +2374,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 +1 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,7 @@ #define FIX_998_UNUSED_FUNCTION /* FhG: issue 998: delete unused funtion ivas_dirac_dec_get_response_split_order */ #define NONBE_FIX_1014_1015_1016_OSBA_JBM_STEREO /* FhG: issues #1014, #1015, #1016: fix tc buffer info update in the discrete ism renderer */ #define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING /* FhG: issue 987: solution b: downmix HOA3 to stereo a input for the reverberator */ #define NONBE_FIX_1065_ISM_MD_HANDLE /* VA: issue 1065: Allocate only the necessary number of ISM MD decoder handles. */ /* #################### End BASOP porting switches ############################ */ Loading lib_dec/ivas_init_dec_fx.c +21 −2 Original line number Diff line number Diff line Loading @@ -1468,7 +1468,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 @@ -1867,6 +1871,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 @@ -1874,10 +1879,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 +21 −0 Original line number Diff line number Diff line Loading @@ -165,7 +165,11 @@ ivas_error ivas_omasa_dec_config_fx( Word16 *data /* o : output synthesis signal Qx*/ ) { #ifdef NONBE_FIX_1065_ISM_MD_HANDLE Word16 k, sce_id, nSCE_old, nchan_hp20_old, numCldfbAnalyses_old, numCldfbSyntheses_old; #else Word16 k, sce_id, nSCE_old, nchan_hp20_old, numCldfbAnalyses_old, numCldfbSyntheses_old, n_MD; #endif Word32 ivas_total_brate, ism_total_brate, cpe_brate; Word32 brate_SCE, brate_CPE; ISM_MODE ism_mode_old; Loading Loading @@ -291,6 +295,22 @@ ivas_error ivas_omasa_dec_config_fx( IF( NE_16( ism_mode_old, st_ivas->ism_mode ) ) { /* ISM MD reconfig. */ #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 n_MD = 0; move16(); Loading Loading @@ -322,6 +342,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 @@ -2345,9 +2345,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 @@ -2363,6 +2374,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 +1 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,7 @@ #define FIX_998_UNUSED_FUNCTION /* FhG: issue 998: delete unused funtion ivas_dirac_dec_get_response_split_order */ #define NONBE_FIX_1014_1015_1016_OSBA_JBM_STEREO /* FhG: issues #1014, #1015, #1016: fix tc buffer info update in the discrete ism renderer */ #define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING /* FhG: issue 987: solution b: downmix HOA3 to stereo a input for the reverberator */ #define NONBE_FIX_1065_ISM_MD_HANDLE /* VA: issue 1065: Allocate only the necessary number of ISM MD decoder handles. */ /* #################### End BASOP porting switches ############################ */ Loading
lib_dec/ivas_init_dec_fx.c +21 −2 Original line number Diff line number Diff line Loading @@ -1468,7 +1468,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 @@ -1867,6 +1871,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 @@ -1874,10 +1879,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 +21 −0 Original line number Diff line number Diff line Loading @@ -165,7 +165,11 @@ ivas_error ivas_omasa_dec_config_fx( Word16 *data /* o : output synthesis signal Qx*/ ) { #ifdef NONBE_FIX_1065_ISM_MD_HANDLE Word16 k, sce_id, nSCE_old, nchan_hp20_old, numCldfbAnalyses_old, numCldfbSyntheses_old; #else Word16 k, sce_id, nSCE_old, nchan_hp20_old, numCldfbAnalyses_old, numCldfbSyntheses_old, n_MD; #endif Word32 ivas_total_brate, ism_total_brate, cpe_brate; Word32 brate_SCE, brate_CPE; ISM_MODE ism_mode_old; Loading Loading @@ -291,6 +295,22 @@ ivas_error ivas_omasa_dec_config_fx( IF( NE_16( ism_mode_old, st_ivas->ism_mode ) ) { /* ISM MD reconfig. */ #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 n_MD = 0; move16(); Loading Loading @@ -322,6 +342,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