diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 17fb7412fdeb8da014f5755bca1e7ac0a5dff146..11f49e14a03fd29e338815e5c7bbe8d760cd3256 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -253,7 +253,7 @@ ivas_error ivas_compute_core_buffers( /*! r: number of clipped samples */ uint32_t ivas_syn_output( - float *synth[], /* i/o: float synthesis signal */ + float *synth[], /* i/o: float synthesis signal */ const int16_t output_frame, /* i : output frame length (one channel) */ const int16_t n_channels, /* i : number of output channels */ int16_t *synth_out /* o : integer 16 bits synthesis signal */ @@ -302,8 +302,8 @@ void stereo_dmx_evs_close_encoder( ivas_error ivas_dec( Decoder_Struct *st_ivas, /* i : IVAS decoder structure */ #ifdef SPLIT_REND_WITH_HEAD_ROT - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ + const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ + void *data /* o : output synthesis signal */ #else int16_t *data /* o : output synthesis signal */ #endif @@ -313,10 +313,10 @@ ivas_error ivas_dec_setup( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ #ifdef SPLIT_REND_WITH_HEAD_ROT - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ + const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ + void *data /* o : output synthesis signal */ #else - int16_t *data /* o : output synthesis signal */ + int16_t *data /* o : output synthesis signal */ #endif ); @@ -658,10 +658,10 @@ ivas_error ivas_mc_dec_config( const int16_t idx, /* i : LS config. index */ uint16_t *nSamplesRendered, /* o : samples flushed from last frame (JBM) */ #ifdef SPLIT_REND_WITH_HEAD_ROT - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ + const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ + void *data /* o : output synthesis signal */ #else - int16_t *data /* o : output synthesis signal */ + int16_t *data /* o : output synthesis signal */ #endif ); @@ -803,10 +803,10 @@ ivas_error ivas_jbm_dec_flush_renderer( const ISM_MODE ism_mode_old, /* i : old ISM mode */ uint16_t *nSamplesRendered, /* o : number of samples flushed */ #ifdef SPLIT_REND_WITH_HEAD_ROT - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ + const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ + void *data /* o : output synthesis signal */ #else - int16_t *data /* o : output synthesis signal */ + int16_t *data /* o : output synthesis signal */ #endif ); @@ -853,11 +853,11 @@ void ivas_jbm_dec_copy_tc_no_tsm( ); void ivas_jbm_dec_get_md_map_even_spacing( - const int16_t len, /* i : length of the modfied frames in metadata slots */ - const int16_t subframe_len, /* i : default length of a subframe */ - const int16_t offset, /* i : current read offset into the md buffer */ - const int16_t buf_len, /* i : length of the metadata buffer */ - int16_t *map /* o : metadata index map */ + const int16_t len, /* i : length of the modfied frames in metadata slots */ + const int16_t subframe_len, /* i : default length of a subframe */ + const int16_t offset, /* i : current read offset into the md buffer */ + const int16_t buf_len, /* i : length of the metadata buffer */ + int16_t *map /* o : metadata index map */ ); TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( @@ -869,7 +869,7 @@ int16_t ivas_jbm_dec_get_render_granularity( const RENDERER_TYPE rendererType, /* i : renderer type */ const IVAS_FORMAT ivas_format, /* i : ivas format */ const MC_MODE mc_mode, /* i : MC mode */ - const int32_t output_Fs /* i : sampling rate */ + const int32_t output_Fs /* i : sampling rate */ ); ivas_error ivas_jbm_dec_tc_buffer_open( @@ -1073,10 +1073,10 @@ ivas_error ivas_ism_dec_config( const ISM_MODE last_ism_mode, /* i/o: last ISM mode */ uint16_t *nSamplesRendered, /* o : number of samples flushed on renderer change*/ #ifdef SPLIT_REND_WITH_HEAD_ROT - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ + const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ + void *data /* o : output synthesis signal */ #else - int16_t *data /* o : output synthesis signal */ + int16_t *data /* o : output synthesis signal */ #endif ); @@ -1106,10 +1106,10 @@ void ivas_param_ism_dec_digest_tc( ); void ivas_ism_param_dec_tc_gain_ajust( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const uint16_t nSamples, /* i : number of samples to be compensate */ - const uint16_t nFadeLength, /* i : length of the crossfade in samples */ - float *transport_channels_f[] /* i : synthesized core-coder transport channels/DirAC output */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const uint16_t nSamples, /* i : number of samples to be compensate */ + const uint16_t nFadeLength, /* i : length of the crossfade in samples */ + float *transport_channels_f[] /* i : synthesized core-coder transport channels/DirAC output */ ); void ivas_param_ism_dec_render( @@ -3601,11 +3601,11 @@ ivas_error ivas_dirac_enc( IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ BSTR_ENC_HANDLE hMetaData, /* i/o: Metadata bitstream handle */ float *data_f[], /* i/o: SBA channels */ - float **ppIn_FR_real, /* o : real freq domain values */ - float **ppIn_FR_imag, /* o : imag freq domain values */ - const int16_t input_frame, /* i : input frame length */ - const int16_t dtx_vad, /* i : DTX vad flag */ - const IVAS_FORMAT ivas_format, /* i : ivas format */ + float **ppIn_FR_real, /* o : real freq domain values */ + float **ppIn_FR_imag, /* o : imag freq domain values */ + const int16_t input_frame, /* i : input frame length */ + const int16_t dtx_vad, /* i : DTX vad flag */ + const IVAS_FORMAT ivas_format, /* i : ivas format */ const int16_t hodirac_flag /* i : hodirac flag */ ); @@ -3791,18 +3791,18 @@ void ivas_mc_paramupmix_dec_read_BS( ); void ivas_mc_paramupmix_dec_digest_tc( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const uint8_t nCldfbSlots, /* i : number of CLFBS slots in the transport channels */ - const int16_t nSamplesForRendering /* i : number of samples provided */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const uint8_t nCldfbSlots, /* i : number of CLFBS slots in the transport channels */ + const int16_t nSamplesForRendering /* i : number of samples provided */ ); void ivas_mc_paramupmix_dec_render( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ - uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ - uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */ - float *input_f[], /* i : core-coder transport channels */ - float *output_f[] /* i/o: synthesized core-coder transport channels */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ + uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ + uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */ + float *input_f[], /* i : core-coder transport channels */ + float *output_f[] /* i/o: synthesized core-coder transport channels */ ); void ivas_param_mc_metadata_open( @@ -4144,7 +4144,7 @@ ivas_error ivas_sba_linear_renderer( float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */ const int16_t output_frame, /* i : output frame length per channel */ const int16_t nchan_in, /* i : number of input ambisonics channels */ - const int16_t nchan_ism, + const int16_t nchan_ism, const AUDIO_CONFIG output_config, /* i : output audio configuration */ const IVAS_OUTPUT_SETUP output_setup, /* i : output format setup */ const float hoa_dec_mtx[] /* i : HOA decoding mtx */ @@ -4262,7 +4262,7 @@ int16_t ivas_get_sba_num_TCs( void ivas_spar_set_bitrate_config( ivas_spar_md_com_cfg *pSpar_md_cfg, /* i/o: SPAR MD config. handle */ const int16_t table_idx, /* i : config. table index */ - const int16_t num_bands, /* i : number of bands */ + const int16_t num_bands, /* i : number of bands */ const int16_t dirac2spar_md_flag, const int16_t enc_flag, const int16_t pca_flag, @@ -4397,8 +4397,8 @@ ivas_error ivas_spar_md_enc_process( const int16_t nchan_inp, const int16_t sba_order, /* i : Ambisonic (SBA) order */ float *prior_mixer[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH], /* i : prior mixer_matrix */ - const int16_t dyn_active_w_flag, /* i : flag to indicate dynamic active W */ - const int16_t dirac_mono_flag /* i : flag to indicate mono only mode in SBA */ + const int16_t dyn_active_w_flag, /* i : flag to indicate dynamic active W */ + const int16_t dirac_mono_flag /* i : flag to indicate mono only mode in SBA */ ); void ivas_compute_spar_params( @@ -4565,7 +4565,7 @@ ivas_error ivas_spar_covar_enc_open( const int32_t input_Fs, /* i : input sampling rate */ const int16_t nchan_inp, /* i : number of input channels */ const COV_SMOOTHING_TYPE smooth_mode, /* i : Smooth covariance for SPAR or MC */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ ); void ivas_spar_covar_enc_close( @@ -4988,10 +4988,10 @@ ivas_error ivas_masa_dec_reconfigure( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ #ifdef SPLIT_REND_WITH_HEAD_ROT - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ + const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ + void *data /* o : output synthesis signal */ #else - int16_t *data /* o : output synthesis signal */ + int16_t *data /* o : output synthesis signal */ #endif ); @@ -5684,14 +5684,19 @@ void ivas_osba_enc( #endif ); +#ifdef FIX_782_OSBA_FUNCTION_NAMES +ivas_error ivas_osba_data_open( +#else ivas_error ivas_masa_ism_data_open( +#endif Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ ); +#ifndef FIX_782_OSBA_FUNCTION_NAMES ivas_error ivas_sba_ism_separate_object_renderer_open( - Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); - +#endif ivas_error ivas_osba_dirac_td_binaural( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output[], /* o : output synthesis signal */ @@ -5711,9 +5716,15 @@ ivas_error ivas_osba_render( const int16_t output_frame /* i : output frame length per channel */ ); +#ifdef FIX_782_OSBA_FUNCTION_NAMES +void ivas_osba_data_close( + SBA_ISM_DATA_HANDLE *hSbaIsmData /* i/o: OSBA rendering handle */ +); +#else void ivas_masa_ism_data_close( - MASA_ISM_DATA_HANDLE *hMasaIsmData /* i/o: MASA_ISM rendering handle */ + MASA_ISM_DATA_HANDLE *hMasaIsmData /* i/o: MASA_ISM rendering handle */ ); +#endif /*----------------------------------------------------------------------------------* @@ -5736,10 +5747,10 @@ ivas_error ivas_omasa_dec_config( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ #ifdef SPLIT_REND_WITH_HEAD_ROT - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ + const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ + void *data /* o : output synthesis signal */ #else - int16_t *data /* o : output synthesis signal */ + int16_t *data /* o : output synthesis signal */ #endif ); diff --git a/lib_com/options.h b/lib_com/options.h index 1a5f05080f7d9d9c7e5a0eab9651464ea23052f5..d0fc7b27462e723d58253d9ae5971a4fe0c48c11 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -173,6 +173,7 @@ #define FIX_764_HARM_CODE /* VA: issue 764: introduce new function for the same code block at four different places */ #define FIX_747_ISM_TODOS /* VA: issue 747 - address ISM ToDos */ #define FIX_ISMRENDERER_HANDLE_DEALLOC /* VA: issue 781: harmonize Deallocation of handle 'hIsmRendererData' */ +#define FIX_782_OSBA_FUNCTION_NAMES /* VA: fix 782: correct OSBA function names */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 6602c344c166ebbf8ad9f5d236194528c6f5cea6..cfe3dd64a647dd1087edd7bc371e7135f99427ef 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -749,7 +749,11 @@ ivas_error ivas_dec( { for ( n = 0; n < nchan_ism; n++ ) { - delay_signal( p_output[n], output_frame, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); +#ifdef FIX_782_OSBA_FUNCTION_NAMES + delay_signal( p_output[n], output_frame, st_ivas->hSbaIsmData->delayBuffer[n], st_ivas->hSbaIsmData->delayBuffer_size ); +#else + delay_signal( output[n], output_frame, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); +#endif } } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 31de52db2b219ec79a49701c3f07fee8f91c0058..5a590ab91edf020f3a5cd4a454087933bb38564b 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -276,8 +276,8 @@ ivas_error ivas_dec_setup( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ #ifdef SPLIT_REND_WITH_HEAD_ROT - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ + const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ + void *data /* o : output synthesis signal */ #else int16_t *data /* o : output synthesis signal */ #endif @@ -1569,13 +1569,16 @@ ivas_error ivas_init_decoder( return error; } +#ifdef FIX_782_OSBA_FUNCTION_NAMES + if ( ( error = ivas_osba_data_open( st_ivas ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_masa_ism_data_open( st_ivas ) ) != IVAS_ERR_OK ) +#endif { return error; } } - /* set CNA/CNG flags */ ivas_sba_set_cna_cng_flag( st_ivas ); } @@ -1681,7 +1684,7 @@ ivas_error ivas_init_decoder( st_ivas->nchan_transport = ivas_mc_ls_setup_get_num_channels( ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ) ); st_ivas->nSCE = 0; - st_ivas->nCPE = st_ivas->nchan_transport / 2; + st_ivas->nCPE = st_ivas->nchan_transport / CPE_CHANNELS; st_ivas->element_mode_init = IVAS_CPE_MDCT; @@ -1715,7 +1718,7 @@ ivas_error ivas_init_decoder( } st_ivas->nSCE = 0; - st_ivas->nCPE = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS / 2; + st_ivas->nCPE = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS / CPE_CHANNELS; st_ivas->nchan_transport = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS; if ( ( error = ivas_mc_paramupmix_dec_open( st_ivas ) ) != IVAS_ERR_OK ) @@ -2080,7 +2083,7 @@ ivas_error ivas_init_decoder( return error; } } - +#ifndef FIX_782_OSBA_FUNCTION_NAMES if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ @@ -2089,6 +2092,7 @@ ivas_error ivas_init_decoder( return error; } } +#endif } /*-----------------------------------------------------------------* @@ -2455,6 +2459,9 @@ void ivas_initialize_handles_dec( st_ivas->hHrtfParambin = NULL; st_ivas->hoa_dec_mtx = NULL; st_ivas->hMasaIsmData = NULL; +#ifdef FIX_782_OSBA_FUNCTION_NAMES + st_ivas->hSbaIsmData = NULL; +#endif st_ivas->hHeadTrackData = NULL; st_ivas->hHrtfTD = NULL; @@ -2668,8 +2675,13 @@ void ivas_destroy_dec( st_ivas->hMonoDmxRenderer = NULL; } +#ifdef FIX_782_OSBA_FUNCTION_NAMES + /* OSBA structure */ + ivas_osba_data_close( &st_ivas->hSbaIsmData ); +#else /* MASA ISM structure */ ivas_masa_ism_data_close( &st_ivas->hMasaIsmData ); +#endif /* OMASA structure */ ivas_omasa_data_close( &st_ivas->hMasaIsmData ); diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index 39efa31c91f2c61da66a5bfacaab24b4cb18087e..20c457c707adae797787a8706d269a6f4b337453 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -43,6 +43,81 @@ #include "wmc_auto.h" +#ifdef FIX_782_OSBA_FUNCTION_NAMES +/*-------------------------------------------------------------------* + * ivas_osba_data_open() + * + * Allocate and initialize SBA_ISM rendering handle + *-------------------------------------------------------------------*/ + +ivas_error ivas_osba_data_open( + Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ +) +{ + SBA_ISM_DATA_HANDLE hSbaIsmData; + int16_t i; + + if ( ( hSbaIsmData = (SBA_ISM_DATA_HANDLE) malloc( sizeof( SBA_ISM_DATA ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for OSBA data\n" ) ); + } + + hSbaIsmData->delayBuffer_nchan = st_ivas->nchan_ism; + hSbaIsmData->delayBuffer_size = (int16_t) ( ( st_ivas->hDecoderConfig->output_Fs / 50 ) / MAX_PARAM_SPATIAL_SUBFRAMES ); + + if ( ( hSbaIsmData->delayBuffer = (float **) malloc( hSbaIsmData->delayBuffer_nchan * sizeof( float * ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for OSBA delay buffer \n" ) ); + } + + for ( i = 0; i < hSbaIsmData->delayBuffer_nchan; i++ ) + { + if ( ( hSbaIsmData->delayBuffer[i] = (float *) malloc( hSbaIsmData->delayBuffer_size * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for OSBA delay buffer \n" ) ); + } + set_zero( hSbaIsmData->delayBuffer[i], hSbaIsmData->delayBuffer_size ); + } + + st_ivas->hSbaIsmData = hSbaIsmData; + + return IVAS_ERR_OK; +} + + +/*-------------------------------------------------------------------* + * ivas_osba_data_close() + * + * Deallocate SBA_ISM rendering handle + *-------------------------------------------------------------------*/ + +void ivas_osba_data_close( + SBA_ISM_DATA_HANDLE *hSbaIsmData /* i/o: OSBA rendering handle */ +) +{ + int16_t i; + + if ( hSbaIsmData == NULL || *hSbaIsmData == NULL ) + { + return; + } + + if ( ( *hSbaIsmData )->delayBuffer != NULL ) + { + for ( i = 0; i < ( *hSbaIsmData )->delayBuffer_nchan; i++ ) + { + free( ( *hSbaIsmData )->delayBuffer[i] ); + } + free( ( *hSbaIsmData )->delayBuffer ); + ( *hSbaIsmData )->delayBuffer = NULL; + } + + free( *hSbaIsmData ); + *hSbaIsmData = NULL; + + return; +} +#else /*-------------------------------------------------------------------* * ivas_masa_ism_data_open() * @@ -131,12 +206,13 @@ ivas_error ivas_sba_ism_separate_object_renderer_open( return IVAS_ERR_OK; } +#endif /*--------------------------------------------------------------------------* * ivas_osba_dirac_td_binaural() * - * Binaural rendering in OMASA format + * Binaural rendering in OSBA format *--------------------------------------------------------------------------*/ ivas_error ivas_osba_dirac_td_binaural( @@ -147,7 +223,6 @@ ivas_error ivas_osba_dirac_td_binaural( { int16_t n; float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; - ivas_error error; float *p_sepobj[MAX_NUM_OBJECTS]; int16_t channel_offset; @@ -170,7 +245,11 @@ ivas_error ivas_osba_dirac_td_binaural( { for ( n = 0; n < st_ivas->nchan_ism; n++ ) { +#ifdef FIX_782_OSBA_FUNCTION_NAMES + delay_signal( data_separated_objects[n], output_frame, st_ivas->hSbaIsmData->delayBuffer[n], st_ivas->hSbaIsmData->delayBuffer_size ); +#else delay_signal( data_separated_objects[n], output_frame, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); +#endif } } @@ -264,6 +343,12 @@ ivas_error ivas_osba_dirac_td_binaural( } +/*-------------------------------------------------------------------------* + * ivas_osba_ism_metadata_dec() + * + * ISM metadata decoding in OSBA format. + *-------------------------------------------------------------------------*/ + ivas_error ivas_osba_ism_metadata_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const int32_t ism_total_brate, /* i : ISM total bitrate */ @@ -327,7 +412,11 @@ ivas_error ivas_osba_render( for ( n = 0; n < nchan_ism; n++ ) { mvr2r( output_f[n], tmp_ism_out[n], output_frame ); +#ifdef FIX_782_OSBA_FUNCTION_NAMES + delay_signal( tmp_ism_out[n], output_frame, st_ivas->hSbaIsmData->delayBuffer[n], st_ivas->hSbaIsmData->delayBuffer_size ); +#else delay_signal( tmp_ism_out[n], output_frame, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); +#endif } if ( st_ivas->renderer_type == RENDERER_OSBA_AMBI ) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 595c4fd6ac306e69508f844bb007ce006d5f5b69..8895ebf0cb8eca372a7680192ca02988f6ca7569 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -400,6 +400,13 @@ ivas_error ivas_sba_dec_reconfigure( } } +#ifdef FIX_782_OSBA_FUNCTION_NAMES + /* Allocate memory for OSBA delay buffer */ + if ( ( error = ivas_osba_data_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( ( error = ivas_masa_ism_data_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; @@ -410,6 +417,7 @@ ivas_error ivas_sba_dec_reconfigure( { return error; } +#endif #ifndef NONBE_FIX_752_OSBA_MISCONFIG_MCT st_ivas->nchan_transport += st_ivas->nchan_ism; @@ -430,7 +438,7 @@ ivas_error ivas_sba_dec_reconfigure( } #endif ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); - ivas_masa_ism_data_close( &st_ivas->hMasaIsmData ); + ivas_osba_data_close( &st_ivas->hSbaIsmData ); /* Time Domain binaural renderer handle */ if ( st_ivas->hBinRendererTd != NULL ) diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 95154d74a16ed649ec2df0a8757a6c870b0762ad..adb49b7fa7ec60477381382a26daecbc4bed4e37 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -659,6 +659,18 @@ typedef struct ivas_spar_dec_lib_t } SPAR_DEC_DATA, *SPAR_DEC_HANDLE; +#ifdef FIX_782_OSBA_FUNCTION_NAMES +/* Data structure for SBA_ISM rendering */ +typedef struct ivas_osba_data +{ + float **delayBuffer; + int16_t delayBuffer_size; + int16_t delayBuffer_nchan; + +} SBA_ISM_DATA, *SBA_ISM_DATA_HANDLE; +#endif + + /*----------------------------------------------------------------------------------* * SCE decoder structure *----------------------------------------------------------------------------------*/ @@ -1104,7 +1116,10 @@ typedef struct Decoder_Struct COMBINED_ORIENTATION_HANDLE hCombinedOrientationData; /* Combined external and head orientation data structure */ DIRAC_REND_HANDLE hDirACRend; /* DirAC renderer handle */ SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; /* Spatial parametric (DirAC rend, ParamBin, ParamISM) rendering common data handle. */ - MASA_ISM_DATA_HANDLE hMasaIsmData; + MASA_ISM_DATA_HANDLE hMasaIsmData; /* OMASA rendering handle */ +#ifdef FIX_782_OSBA_FUNCTION_NAMES + SBA_ISM_DATA_HANDLE hSbaIsmData; /* OSBA rendering handle */ +#endif int16_t flag_omasa_brate;