Loading lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -164,7 +164,7 @@ #define SBA_AND_OBJECTS #ifdef SBA_AND_OBJECTS #define OSBA_DISC_OBJ_MCT //#define ENABLE_ISM_MD_CODING #define ENABLE_ISM_MD_CODING #endif /* ################## End DEVELOPMENT switches ######################### */ Loading lib_dec/ivas_dec.c +13 −9 Original line number Diff line number Diff line Loading @@ -61,7 +61,11 @@ ivas_error ivas_dec( float output[MAX_OUTPUT_CHANNELS][L_FRAME48k]; /* 'float' buffer for output synthesis, MAX_OUTPUT_CHANNELS channels */ int16_t nchan_remapped; float output_lfe_ch[L_FRAME48k]; #ifndef OSBA_DISC_OBJ_MCT int16_t nb_bits_metadata[MAX_SCE]; #else int16_t nb_bits_metadata[MAX_SCE+1]; #endif int32_t output_Fs, ivas_total_brate; AUDIO_CONFIG output_config; float pan_left, pan_right; Loading Loading @@ -457,7 +461,7 @@ ivas_error ivas_dec( int16_t nchan_ism, nchan_transport_ism; int16_t dirac_bs_md_write_idx; set_s( nb_bits_metadata, 0, MAX_SCE ); set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); nchan_transport_ism = 1; dirac_bs_md_write_idx = 0; Loading @@ -465,13 +469,6 @@ ivas_error ivas_dec( { dirac_bs_md_write_idx = st_ivas->hDirAC->dirac_bs_md_write_idx; /* Store the write-index for this frame */ } /* SBA metadata decoding */ if ( ( error = ivas_spar_dec( st_ivas, nb_bits_metadata ) ) != IVAS_ERR_OK ) { return error; } #ifdef ENABLE_ISM_MD_CODING /* set ISM parameters and decode ISM metadata in OSBA format */ if ( ( error = ivas_osba_ism_metadata_dec( st_ivas, ivas_total_brate, &nchan_ism, &nchan_transport_ism, dirac_bs_md_write_idx, &nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) Loading @@ -479,6 +476,13 @@ ivas_error ivas_dec( return error; } #endif /* SBA metadata decoding */ if ( ( error = ivas_spar_dec( st_ivas, nb_bits_metadata ) ) != IVAS_ERR_OK ) { return error; } #if 0 /* Configuration of combined-format bit-budget distribution */ ivas_set_surplus_brate_dec( st_ivas, &ism_total_brate ); Loading Loading @@ -574,7 +578,7 @@ ivas_error ivas_dec( } } #else if ( ( error = ivas_mct_dec( st_ivas, output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) if ( ( error = ivas_mct_dec( st_ivas, output, output_frame, nb_bits_metadata[0]+nb_bits_metadata[1] )) != IVAS_ERR_OK ) { return error; } Loading lib_dec/ivas_ism_metadata_dec.c +71 −14 Original line number Diff line number Diff line Loading @@ -150,12 +150,18 @@ ivas_error ivas_ism_metadata_dec( const PARAM_ISM_CONFIG_HANDLE hParamIsm, /* i : Param ISM Config Handle */ int16_t *ism_extmeta_active, /* i/o: Extended metadata active in renderer */ int16_t *ism_extmeta_cnt /* i/o: Number of change frames observed */ #ifdef OSBA_DISC_OBJ_MCT , DEC_CORE_HANDLE st0 #endif ) { int16_t ch, nb_bits_start = 0, last_bit_pos; int16_t idx_radius; int32_t element_brate[MAX_NUM_OBJECTS], total_brate[MAX_NUM_OBJECTS]; #ifndef OSBA_DISC_OBJ_MCT DEC_CORE_HANDLE st0; #endif int16_t ism_extmeta_bitstream; int16_t non_diegetic_flag_global; float yaw, pitch, radius; Loading @@ -178,7 +184,9 @@ ivas_error ivas_ism_metadata_dec( push_wmops( "ism_meta_dec" ); /* initialization */ #ifndef OSBA_DISC_OBJ_MCT st0 = hSCE[0]->hCoreCoder[0]; #endif ism_metadata_flag_global = 0; nchan_transport_prev = *nchan_transport; Loading @@ -204,12 +212,21 @@ ivas_error ivas_ism_metadata_dec( /*----------------------------------------------------------------* * Read ISM common signaling *----------------------------------------------------------------*/ #ifdef OSBA_DISC_OBJ_MCT if ( ism_mode == ISM_SBA_MODE_DISC ) { /* number of objects was read in ivas_dec_setup() */ st0->next_bit_pos += NO_BITS_MASA_ISM_NO_OBJ; } else { #endif /* number of objects was read in ivas_dec_setup() */ st0->next_bit_pos += nchan_ism; ism_mode = ivas_ism_mode_select( nchan_ism, ism_total_brate ); if ( ism_mode == ISM_MODE_PARAM ) { *nchan_transport = MAX_PARAM_ISM_WAVE; Loading @@ -218,7 +235,9 @@ ivas_error ivas_ism_metadata_dec( { *nchan_transport = nchan_ism; } #ifdef OSBA_DISC_OBJ_MCT } #endif if ( *nchan_transport != nchan_transport_prev ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong number of objects signalled!" ); Loading Loading @@ -255,8 +274,16 @@ ivas_error ivas_ism_metadata_dec( /* Read ISM metadata flags (one per object) */ for ( ch = 0; ch < *nchan_transport; ch++ ) { #ifdef OSBA_DISC_OBJ_MCT if ( ism_mode != ISM_SBA_MODE_DISC ) { ism_imp[ch] = get_next_indice( st0, ISM_METADATA_FLAG_BITS ); } else { ism_imp[ch] = get_next_indice( st0, 1 ); } #endif if ( ism_imp[ch] > ISM_NO_META ) { hIsmMeta[ch]->ism_metadata_flag = 1; Loading @@ -276,7 +303,11 @@ ivas_error ivas_ism_metadata_dec( } /* read ISM_NO_META class signalling */ #ifdef OSBA_DISC_OBJ_MCT if ( ism_mode == ISM_MODE_DISC && ism_mode != ISM_SBA_MODE_DISC ) #else if ( ism_mode == ISM_MODE_DISC ) #endif { for ( ch = 0; ch < *nchan_transport; ch++ ) { Loading Loading @@ -324,7 +355,11 @@ ivas_error ivas_ism_metadata_dec( for ( ch = 0; ch < nchan_ism; ch++ ) { hIsmMetaData = hIsmMeta[ch]; #ifdef OSBA_DISC_OBJ_MCT if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_SBA_MODE_DISC ) #else if ( ism_mode == ISM_MODE_DISC ) #endif { nb_bits_start = st0->next_bit_pos; } Loading Loading @@ -410,7 +445,11 @@ ivas_error ivas_ism_metadata_dec( } } /* save number of metadata bits read */ #ifdef OSBA_DISC_OBJ_MCT if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_SBA_MODE_DISC ) #else if ( ism_mode == ISM_MODE_DISC ) #endif { nb_bits_metadata[ch] = st0->next_bit_pos - nb_bits_start; } Loading Loading @@ -494,6 +533,23 @@ ivas_error ivas_ism_metadata_dec( hISMDTX.ism_dtx_hangover_cnt += 1; } #ifdef OSBA_DISC_OBJ_MCT if ( ism_mode == ISM_SBA_MODE_DISC ) { /* set the bitstream pointer to its original position */ nb_bits_metadata[0]=st0->next_bit_pos; st0->bit_stream = bstr_orig; st0->next_bit_pos = next_bit_pos_orig; /* updates*/ set_s( md_diff_flag, 1, nchan_ism ); update_last_metadata( nchan_ism, hIsmMeta, md_diff_flag ); pop_wmops(); return IVAS_ERR_OK; } #endif /*----------------------------------------------------------------* * Configuration and decision about bitrates per channel *----------------------------------------------------------------*/ Loading Loading @@ -561,7 +617,8 @@ ivas_error ivas_ism_metadata_dec( set_s( md_diff_flag, 1, nchan_ism ); update_last_metadata( nchan_ism, hIsmMeta, md_diff_flag ); for ( ch = 0; ch < *nchan_transport; ch++ ) { Loading lib_dec/ivas_spar_decoder.c +16 −1 Original line number Diff line number Diff line Loading @@ -320,10 +320,14 @@ ivas_error ivas_spar_dec( #ifdef OSBA_DISC_OBJ_MCT if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { #ifndef ENABLE_ISM_MD_CODING last_bit_pos = (int16_t) ( ( hDecoderConfig->ivas_total_brate / FRAMES_PER_SEC ) - 1 ); /* the number of objects was read */ last_bit_pos -= NO_BITS_MASA_ISM_NO_OBJ; *nb_bits_read += NO_BITS_MASA_ISM_NO_OBJ; #else last_bit_pos = (int16_t) ( ( hDecoderConfig->ivas_total_brate / FRAMES_PER_SEC ) - 1 ) - nb_bits_read[1]; #endif } else { Loading @@ -341,7 +345,18 @@ ivas_error ivas_spar_dec( #endif } #ifdef OSBA_DISC_OBJ_MCT if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { last_bit_pos = (int16_t) ( ( hDecoderConfig->ivas_total_brate / FRAMES_PER_SEC ) - 1 ) - nb_bits_read[1]; } else { #endif last_bit_pos = (int16_t) ( ( hDecoderConfig->ivas_total_brate / FRAMES_PER_SEC ) - 1 ); #ifdef OSBA_DISC_OBJ_MCT } #endif if ( !st0->bfi && hDecoderConfig->ivas_total_brate == IVAS_SID_5k2 ) { last_bit_pos -= SID_FORMAT_NBITS; Loading lib_enc/ivas_enc.c +10 −1 Original line number Diff line number Diff line Loading @@ -347,8 +347,17 @@ ivas_error ivas_enc( n = hEncoderConfig->nchan_ism; st = st_ivas->hCPE[0]->hCoreCoder[0]; hMetaData = st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData; #ifdef OSBA_DISC_OBJ_MCT #ifdef ENABLE_ISM_MD_CODING if ( hEncoderConfig->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode != ISM_MODE_NONE ) { /* write the number of objects in ISM_SBA format*/ push_next_indice( hMetaData, hEncoderConfig->nchan_ism - 1, NO_BITS_MASA_ISM_NO_OBJ ); } #endif #endif #ifdef ENABLE_ISM_MD_CODING if ( ( error = ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, n, st_ivas->nchan_transport, st_ivas->hIsmMetaData, NULL, hMetaData, nb_bits_metadata, 0, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag if ( ( error = ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, n, st_ivas->nchan_transport, st_ivas->hIsmMetaData, NULL, hMetaData, &nb_bits_metadata[1], 0, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag #ifdef OSBA_DISC_OBJ_MCT , st->ini_frame Loading Loading
lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -164,7 +164,7 @@ #define SBA_AND_OBJECTS #ifdef SBA_AND_OBJECTS #define OSBA_DISC_OBJ_MCT //#define ENABLE_ISM_MD_CODING #define ENABLE_ISM_MD_CODING #endif /* ################## End DEVELOPMENT switches ######################### */ Loading
lib_dec/ivas_dec.c +13 −9 Original line number Diff line number Diff line Loading @@ -61,7 +61,11 @@ ivas_error ivas_dec( float output[MAX_OUTPUT_CHANNELS][L_FRAME48k]; /* 'float' buffer for output synthesis, MAX_OUTPUT_CHANNELS channels */ int16_t nchan_remapped; float output_lfe_ch[L_FRAME48k]; #ifndef OSBA_DISC_OBJ_MCT int16_t nb_bits_metadata[MAX_SCE]; #else int16_t nb_bits_metadata[MAX_SCE+1]; #endif int32_t output_Fs, ivas_total_brate; AUDIO_CONFIG output_config; float pan_left, pan_right; Loading Loading @@ -457,7 +461,7 @@ ivas_error ivas_dec( int16_t nchan_ism, nchan_transport_ism; int16_t dirac_bs_md_write_idx; set_s( nb_bits_metadata, 0, MAX_SCE ); set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); nchan_transport_ism = 1; dirac_bs_md_write_idx = 0; Loading @@ -465,13 +469,6 @@ ivas_error ivas_dec( { dirac_bs_md_write_idx = st_ivas->hDirAC->dirac_bs_md_write_idx; /* Store the write-index for this frame */ } /* SBA metadata decoding */ if ( ( error = ivas_spar_dec( st_ivas, nb_bits_metadata ) ) != IVAS_ERR_OK ) { return error; } #ifdef ENABLE_ISM_MD_CODING /* set ISM parameters and decode ISM metadata in OSBA format */ if ( ( error = ivas_osba_ism_metadata_dec( st_ivas, ivas_total_brate, &nchan_ism, &nchan_transport_ism, dirac_bs_md_write_idx, &nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) Loading @@ -479,6 +476,13 @@ ivas_error ivas_dec( return error; } #endif /* SBA metadata decoding */ if ( ( error = ivas_spar_dec( st_ivas, nb_bits_metadata ) ) != IVAS_ERR_OK ) { return error; } #if 0 /* Configuration of combined-format bit-budget distribution */ ivas_set_surplus_brate_dec( st_ivas, &ism_total_brate ); Loading Loading @@ -574,7 +578,7 @@ ivas_error ivas_dec( } } #else if ( ( error = ivas_mct_dec( st_ivas, output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) if ( ( error = ivas_mct_dec( st_ivas, output, output_frame, nb_bits_metadata[0]+nb_bits_metadata[1] )) != IVAS_ERR_OK ) { return error; } Loading
lib_dec/ivas_ism_metadata_dec.c +71 −14 Original line number Diff line number Diff line Loading @@ -150,12 +150,18 @@ ivas_error ivas_ism_metadata_dec( const PARAM_ISM_CONFIG_HANDLE hParamIsm, /* i : Param ISM Config Handle */ int16_t *ism_extmeta_active, /* i/o: Extended metadata active in renderer */ int16_t *ism_extmeta_cnt /* i/o: Number of change frames observed */ #ifdef OSBA_DISC_OBJ_MCT , DEC_CORE_HANDLE st0 #endif ) { int16_t ch, nb_bits_start = 0, last_bit_pos; int16_t idx_radius; int32_t element_brate[MAX_NUM_OBJECTS], total_brate[MAX_NUM_OBJECTS]; #ifndef OSBA_DISC_OBJ_MCT DEC_CORE_HANDLE st0; #endif int16_t ism_extmeta_bitstream; int16_t non_diegetic_flag_global; float yaw, pitch, radius; Loading @@ -178,7 +184,9 @@ ivas_error ivas_ism_metadata_dec( push_wmops( "ism_meta_dec" ); /* initialization */ #ifndef OSBA_DISC_OBJ_MCT st0 = hSCE[0]->hCoreCoder[0]; #endif ism_metadata_flag_global = 0; nchan_transport_prev = *nchan_transport; Loading @@ -204,12 +212,21 @@ ivas_error ivas_ism_metadata_dec( /*----------------------------------------------------------------* * Read ISM common signaling *----------------------------------------------------------------*/ #ifdef OSBA_DISC_OBJ_MCT if ( ism_mode == ISM_SBA_MODE_DISC ) { /* number of objects was read in ivas_dec_setup() */ st0->next_bit_pos += NO_BITS_MASA_ISM_NO_OBJ; } else { #endif /* number of objects was read in ivas_dec_setup() */ st0->next_bit_pos += nchan_ism; ism_mode = ivas_ism_mode_select( nchan_ism, ism_total_brate ); if ( ism_mode == ISM_MODE_PARAM ) { *nchan_transport = MAX_PARAM_ISM_WAVE; Loading @@ -218,7 +235,9 @@ ivas_error ivas_ism_metadata_dec( { *nchan_transport = nchan_ism; } #ifdef OSBA_DISC_OBJ_MCT } #endif if ( *nchan_transport != nchan_transport_prev ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong number of objects signalled!" ); Loading Loading @@ -255,8 +274,16 @@ ivas_error ivas_ism_metadata_dec( /* Read ISM metadata flags (one per object) */ for ( ch = 0; ch < *nchan_transport; ch++ ) { #ifdef OSBA_DISC_OBJ_MCT if ( ism_mode != ISM_SBA_MODE_DISC ) { ism_imp[ch] = get_next_indice( st0, ISM_METADATA_FLAG_BITS ); } else { ism_imp[ch] = get_next_indice( st0, 1 ); } #endif if ( ism_imp[ch] > ISM_NO_META ) { hIsmMeta[ch]->ism_metadata_flag = 1; Loading @@ -276,7 +303,11 @@ ivas_error ivas_ism_metadata_dec( } /* read ISM_NO_META class signalling */ #ifdef OSBA_DISC_OBJ_MCT if ( ism_mode == ISM_MODE_DISC && ism_mode != ISM_SBA_MODE_DISC ) #else if ( ism_mode == ISM_MODE_DISC ) #endif { for ( ch = 0; ch < *nchan_transport; ch++ ) { Loading Loading @@ -324,7 +355,11 @@ ivas_error ivas_ism_metadata_dec( for ( ch = 0; ch < nchan_ism; ch++ ) { hIsmMetaData = hIsmMeta[ch]; #ifdef OSBA_DISC_OBJ_MCT if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_SBA_MODE_DISC ) #else if ( ism_mode == ISM_MODE_DISC ) #endif { nb_bits_start = st0->next_bit_pos; } Loading Loading @@ -410,7 +445,11 @@ ivas_error ivas_ism_metadata_dec( } } /* save number of metadata bits read */ #ifdef OSBA_DISC_OBJ_MCT if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_SBA_MODE_DISC ) #else if ( ism_mode == ISM_MODE_DISC ) #endif { nb_bits_metadata[ch] = st0->next_bit_pos - nb_bits_start; } Loading Loading @@ -494,6 +533,23 @@ ivas_error ivas_ism_metadata_dec( hISMDTX.ism_dtx_hangover_cnt += 1; } #ifdef OSBA_DISC_OBJ_MCT if ( ism_mode == ISM_SBA_MODE_DISC ) { /* set the bitstream pointer to its original position */ nb_bits_metadata[0]=st0->next_bit_pos; st0->bit_stream = bstr_orig; st0->next_bit_pos = next_bit_pos_orig; /* updates*/ set_s( md_diff_flag, 1, nchan_ism ); update_last_metadata( nchan_ism, hIsmMeta, md_diff_flag ); pop_wmops(); return IVAS_ERR_OK; } #endif /*----------------------------------------------------------------* * Configuration and decision about bitrates per channel *----------------------------------------------------------------*/ Loading Loading @@ -561,7 +617,8 @@ ivas_error ivas_ism_metadata_dec( set_s( md_diff_flag, 1, nchan_ism ); update_last_metadata( nchan_ism, hIsmMeta, md_diff_flag ); for ( ch = 0; ch < *nchan_transport; ch++ ) { Loading
lib_dec/ivas_spar_decoder.c +16 −1 Original line number Diff line number Diff line Loading @@ -320,10 +320,14 @@ ivas_error ivas_spar_dec( #ifdef OSBA_DISC_OBJ_MCT if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { #ifndef ENABLE_ISM_MD_CODING last_bit_pos = (int16_t) ( ( hDecoderConfig->ivas_total_brate / FRAMES_PER_SEC ) - 1 ); /* the number of objects was read */ last_bit_pos -= NO_BITS_MASA_ISM_NO_OBJ; *nb_bits_read += NO_BITS_MASA_ISM_NO_OBJ; #else last_bit_pos = (int16_t) ( ( hDecoderConfig->ivas_total_brate / FRAMES_PER_SEC ) - 1 ) - nb_bits_read[1]; #endif } else { Loading @@ -341,7 +345,18 @@ ivas_error ivas_spar_dec( #endif } #ifdef OSBA_DISC_OBJ_MCT if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { last_bit_pos = (int16_t) ( ( hDecoderConfig->ivas_total_brate / FRAMES_PER_SEC ) - 1 ) - nb_bits_read[1]; } else { #endif last_bit_pos = (int16_t) ( ( hDecoderConfig->ivas_total_brate / FRAMES_PER_SEC ) - 1 ); #ifdef OSBA_DISC_OBJ_MCT } #endif if ( !st0->bfi && hDecoderConfig->ivas_total_brate == IVAS_SID_5k2 ) { last_bit_pos -= SID_FORMAT_NBITS; Loading
lib_enc/ivas_enc.c +10 −1 Original line number Diff line number Diff line Loading @@ -347,8 +347,17 @@ ivas_error ivas_enc( n = hEncoderConfig->nchan_ism; st = st_ivas->hCPE[0]->hCoreCoder[0]; hMetaData = st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData; #ifdef OSBA_DISC_OBJ_MCT #ifdef ENABLE_ISM_MD_CODING if ( hEncoderConfig->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode != ISM_MODE_NONE ) { /* write the number of objects in ISM_SBA format*/ push_next_indice( hMetaData, hEncoderConfig->nchan_ism - 1, NO_BITS_MASA_ISM_NO_OBJ ); } #endif #endif #ifdef ENABLE_ISM_MD_CODING if ( ( error = ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, n, st_ivas->nchan_transport, st_ivas->hIsmMetaData, NULL, hMetaData, nb_bits_metadata, 0, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag if ( ( error = ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, n, st_ivas->nchan_transport, st_ivas->hIsmMetaData, NULL, hMetaData, &nb_bits_metadata[1], 0, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag #ifdef OSBA_DISC_OBJ_MCT , st->ini_frame Loading