diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 609fb930aca67722e39b8bcacf6bb9eaf46c0aff..06f5d32e8116d451f8d7b7fadfcd400beb68a461 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -167,11 +167,11 @@ typedef enum #define IVAS_NUM_SUPPORTED_FS 3 /* number of supported sampling-rates in IVAS */ #define CLDFB_SLOT_NS 1250000L /* 1.25ms: CLDFB slot length */ -#define MAX_JBM_SUBFRAMES_5MS 8 -#define DEFAULT_JBM_SUBFRAMES_5MS 4 -#define JBM_CLDFB_SLOTS_IN_SUBFRAME 4 -#define MAX_JBM_CLDFB_TIMESLOTS 32 -#define DEFAULT_JBM_CLDFB_TIMESLOTS 16 +#define DEFAULT_JBM_SUBFRAMES_5MS 4 /* == IVAS_MAX_PARAM_SPATIAL_SUBFRAMES */ +#define MAX_JBM_SUBFRAMES_5MS ( DEFAULT_JBM_SUBFRAMES_5MS * 2 ) +#define JBM_CLDFB_SLOTS_IN_SUBFRAME 4 /* == IVAS_MAX_PARAM_SPATIAL_SUBFRAMES */ +#define DEFAULT_JBM_CLDFB_TIMESLOTS CLDFB_NO_COL_MAX +#define MAX_JBM_CLDFB_TIMESLOTS ( DEFAULT_JBM_CLDFB_TIMESLOTS * 2 ) #define MAX_JBM_L_FRAME48k ( IVAS_MAX_FRAME_SIZE * 2 ) /* 1920: max. time-scaled frame buffer length (per channel) in samples */ #define MAX_JBM_L_FRAME_NS 40000000L /* 40 ms: time-scaled frame size in ns, proportional to MAX_JBM_L_FRAME48k */ #define MAX_SPAR_INTERNAL_CHANNELS IVAS_SPAR_MAX_CH diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index be936f2c37b36ba6aa342dbe1c9220ebf0646731..f42a7b8f7a0c2b869c7ead36521890f04ba742a2 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -322,11 +322,24 @@ void stereo_dmx_evs_close_encoder( STEREO_DMX_EVS_ENC_HANDLE *hStereoDmxEVS /* i/o: Stereo downmix for EVS encoder handle */ ); -ivas_error ivas_dec( - Decoder_Struct *st_ivas, /* i : IVAS decoder structure */ +ivas_error ivas_dec_tmp( // this will be removed in the following step + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ int16_t *data /* o : output synthesis signal */ ); +ivas_error ivas_dec( + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ +); + +ivas_error ivas_dec_render( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + const uint16_t nSamplesAsked, /* i : number of samples wanted */ + uint16_t *nSamplesRendered, /* o : number of samples rendered */ + uint16_t *nSamplesAvailableNext, /* o : number of samples still available in the rendering pipeline */ + const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ + void *data /* o : output synthesis signal */ +); + ivas_error ivas_dec_get_format( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); @@ -813,22 +826,9 @@ void QuaternionInverse( /*----------------------------------------------------------------------------------* - * JBM prototypes + * Internal rendering prototypes *----------------------------------------------------------------------------------*/ -ivas_error ivas_jbm_dec_tc( - Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -); - -ivas_error ivas_jbm_dec_render( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const uint16_t nSamplesAsked, /* i : number of samples wanted */ - uint16_t *nSamplesRendered, /* o : number of samples rendered */ - uint16_t *nSamplesAvailableNext, /* o : number of samples still available in the rendering pipeline */ - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ -); - ivas_error ivas_jbm_dec_flush_renderer( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const int16_t tc_granularity_new, /* i : new renderer granularity */ @@ -842,7 +842,7 @@ ivas_error ivas_jbm_dec_flush_renderer( void *data /* o : output synthesis signal */ ); -void ivas_jbm_dec_feed_tc_to_renderer( +void ivas_dec_feed_tc_to_renderer( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const int16_t nSamplesForRendering, /* i : number of TC samples available for rendering */ int16_t *nSamplesResidual /* o : number of samples not fitting into the renderer grid and buffer for the next call*/ @@ -856,77 +856,77 @@ ivas_error ivas_jbm_dec_set_discard_samples( Decoder_Struct *st_ivas /* i/o: main IVAS decoder structre */ ); -void ivas_jbm_dec_get_adapted_linear_interpolator( +void ivas_dec_get_adapted_linear_interpolator( const int16_t default_interp_length, /* i : default length of the (full-frame) interpolator */ const int16_t interp_length, /* i : length of the interpolator to be created */ float *interpolator /* o : the interpolator */ ); -void ivas_jbm_dec_get_adapted_subframes( +void ivas_dec_get_adapted_subframes( const int16_t nCldfbTs, /* i : number of time slots in the current frame */ int16_t *subframe_nbslots, /* i/o: subframe grid */ int16_t *nb_subframes /* i/o: number of subframes in the frame */ ); -void ivas_jbm_dec_get_md_map( +void ivas_dec_get_md_map( const int16_t default_len, /* i : default frame length in metadata slots */ - const int16_t len, /* i : length of the modfied frames in metadata slots */ + const int16_t len, /* i : length of the modified 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 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 */ ); -int16_t ivas_jbm_dec_get_num_tc_channels( +int16_t ivas_dec_get_num_tc_channels( Decoder_Struct *st_ivas /* i : IVAS decoder handle */ ); -void ivas_jbm_dec_get_md_map_even_spacing( - const int16_t len, /* i : length of the modfied frames in metadata slots */ +void ivas_dec_get_md_map_even_spacing( + const int16_t len, /* i : length of the modefied 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 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( +TC_BUFFER_MODE ivas_dec_get_tc_buffer_mode( Decoder_Struct *st_ivas /* i : IVAS decoder handle */ ); /*! r: render granularity */ -int16_t ivas_jbm_dec_get_render_granularity( +int16_t ivas_dec_get_render_granularity( const RENDERER_TYPE renderer_type, /* i : renderer type */ const RENDERER_TYPE renderer_type_sec, /* i : secondary renderer type */ const int32_t output_Fs /* i : sampling rate */ ); -ivas_error ivas_jbm_dec_tc_buffer_open( +ivas_error ivas_dec_tc_buffer_open( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const TC_BUFFER_MODE tc_buffer_mode, /* i : buffer mode */ - const int16_t nchan_transport_jbm, /* i : number of real transport channels */ + const int16_t nchan_transport_rend, /* i : new number of TCs for rendering */ const int16_t nchan_transport_internal, /* i : number of totally buffered channels */ const int16_t nchan_full, /* i : number of channels to fully store */ const int16_t n_samples_granularity /* i : granularity of the renderer/buffer */ ); -ivas_error ivas_jbm_dec_tc_buffer_reconfigure( +ivas_error ivas_dec_tc_buffer_reconfigure( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const TC_BUFFER_MODE tc_buffer_mode, /* i : new buffer mode */ - const int16_t nchan_transport_jbm, /* i : new number of real transport channels */ + const int16_t nchan_transport_rend, /* i : new number of TCs for rendering */ const int16_t nchan_transport_internal, /* i : new number of totally buffered channels */ const int16_t nchan_full, /* i : new number of channels to fully store */ const int16_t n_samples_granularity /* i : new granularity of the renderer/buffer */ ); -void ivas_jbm_dec_tc_buffer_close( +void ivas_dec_tc_buffer_close( DECODER_TC_BUFFER_HANDLE *phTcBuffer /* i/o: TC buffer handle */ ); -void ivas_jbm_dec_td_renderers_adapt_subframes( +void ivas_dec_td_renderers_adapt_subframes( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); -ivas_error ivas_jbm_dec_metadata_open( +ivas_error ivas_jbm_dec_masa_metadata_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); @@ -5578,7 +5578,7 @@ ivas_error ivas_osba_data_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ ); -ivas_error ivas_osba_dirac_td_binaural_jbm( +ivas_error ivas_osba_dirac_td_binaural( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ @@ -5746,7 +5746,7 @@ ivas_error ivas_omasa_ism_metadata_dec( int16_t nb_bits_metadata[] /* o : number of ISM metadata bits */ ); -ivas_error ivas_omasa_dirac_td_binaural_jbm( +ivas_error ivas_omasa_dirac_td_binaural( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of samples requested */ uint16_t *nSamplesRendered, /* o : number of samples rendered */ @@ -5790,7 +5790,7 @@ void ivas_omasa_gain_masa_tc( const int16_t output_frame /* i : output frame length per channel */ ); -void ivas_omasa_dirac_rend_jbm( +void ivas_omasa_dirac_rend( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of samples requested */ uint16_t *nSamplesRendered, /* o : number of samples rendered */ @@ -5815,7 +5815,7 @@ void ivas_omasa_separate_object_renderer_close( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); -void ivas_omasa_separate_object_render_jbm( +void ivas_omasa_separate_object_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const uint16_t nSamplesRendered, /* i : number of samples rendered */ float input_f[][L_FRAME48k], /* i : separated object signal */ diff --git a/lib_dec/fd_cng_dec.c b/lib_dec/fd_cng_dec.c index 472c8aa20d34b6d0bb7a7813befc556f24a7e90e..a2609943089eb52ad07dd59eeec98f878e25c136 100644 --- a/lib_dec/fd_cng_dec.c +++ b/lib_dec/fd_cng_dec.c @@ -2011,7 +2011,7 @@ void generate_masking_noise_lb_dirac( n_samples_start += hFdCngCom->frameSize; } - /* move generated noise to the 5ms subframe starts in the tc buffer according to the output sampling frequency to avoid + /* move generated noise to the 5ms subframe starts in the TC buffer according to the output sampling frequency to avoid overwriting it with the synthesis in case of shared tc and synth channel memory, i.e. non-TSM mode */ slot_size_cng = hFdCngCom->frameSize / DEFAULT_JBM_CLDFB_TIMESLOTS; /* move start indices forward to the end of the last subframe */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index dc5a821671a90214b6b21d99843ed51cb899160b..4f535a3158eaf62a9507a7269ba386f16009fc55 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -51,12 +51,12 @@ * Principal IVAS decoder routine *--------------------------------------------------------------------------*/ -ivas_error ivas_dec( +ivas_error ivas_dec_tmp( // this will be removed in the following step Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ int16_t *data /* o : output synthesis signal */ ) { - // TODO: move here function ivas_jbm_dec_tc() and rename it to ivas_dec() + // TODO: move here function ivas_dec() st_ivas->ivas_format = UNDEFINED_FORMAT; // temp. to avoid compilation warnings data[0] = 0; // temp. to avoid compilation warnings diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 1a461939fdbe280275d874b066cfeb438f825bbb..c969ab357d414e53cc5661cdd46f4390e518f309 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1484,9 +1484,9 @@ void ivas_dirac_dec_set_md_map( num_slots_in_subfr = CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES; hSpatParamRendCom->subframes_rendered = 0; - ivas_jbm_dec_get_adapted_subframes( nCldfbTs, hSpatParamRendCom->subframe_nbslots, &hSpatParamRendCom->nb_subframes ); + ivas_dec_get_adapted_subframes( nCldfbTs, hSpatParamRendCom->subframe_nbslots, &hSpatParamRendCom->nb_subframes ); - /* copy also to tc buffer */ + /* copy also to TC buffer */ /* only for non-combined formats and combinded formats w/o discrete objects */ if ( ( st_ivas->ivas_format != MASA_ISM_FORMAT || st_ivas->ism_mode != ISM_MASA_MODE_DISC ) && !( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) ) { @@ -1495,20 +1495,19 @@ void ivas_dirac_dec_set_md_map( } /* set mapping according to dirac_read_idx */ - set_s( hSpatParamRendCom->render_to_md_map, 0, MAX_JBM_SUBFRAMES_5MS * JBM_CLDFB_SLOTS_IN_SUBFRAME ); if ( st_ivas->ivas_format == MASA_FORMAT ) { - ivas_jbm_dec_get_md_map_even_spacing( nCldfbTs, num_slots_in_subfr, 0, hSpatParamRendCom->dirac_md_buffer_length, hSpatParamRendCom->render_to_md_map ); + ivas_dec_get_md_map_even_spacing( nCldfbTs, num_slots_in_subfr, 0, hSpatParamRendCom->dirac_md_buffer_length, hSpatParamRendCom->render_to_md_map ); } else if ( hDirAC == NULL || hDirAC->hConfig == NULL || hDirAC->hConfig->dec_param_estim == 0 ) { - ivas_jbm_dec_get_md_map( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbTs, num_slots_in_subfr, 0, hSpatParamRendCom->dirac_md_buffer_length, hSpatParamRendCom->render_to_md_map ); + ivas_dec_get_md_map( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbTs, num_slots_in_subfr, 0, hSpatParamRendCom->dirac_md_buffer_length, hSpatParamRendCom->render_to_md_map ); } else { - ivas_jbm_dec_get_md_map( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbTs, num_slots_in_subfr, hSpatParamRendCom->dirac_read_idx, hSpatParamRendCom->dirac_md_buffer_length, hSpatParamRendCom->render_to_md_map ); + ivas_dec_get_md_map( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbTs, num_slots_in_subfr, hSpatParamRendCom->dirac_read_idx, hSpatParamRendCom->dirac_md_buffer_length, hSpatParamRendCom->render_to_md_map ); } if ( hDirAC == NULL || hDirAC->hConfig == NULL || hDirAC->hConfig->dec_param_estim == 0 ) @@ -2313,7 +2312,7 @@ void ivas_dirac_dec_render_sf( if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] ) { - ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator ); + ivas_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator ); st_ivas->hIsmRendererData->interp_offset = 0; } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index a3d954ef2f3d770751f34017e087449b914f5d1f..e9dd95a102d9009b6ce3945e11638a9b13b09c63 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -444,7 +444,7 @@ ivas_error ivas_dec_get_format( } } - st_ivas->mc_mode = ivas_mc_mode_select( ivas_mc_map_output_config_to_mc_ls_setup( signaled_config ), st_ivas->hDecoderConfig->ivas_total_brate ); + st_ivas->mc_mode = ivas_mc_mode_select( ivas_mc_map_output_config_to_mc_ls_setup( signaled_config ), ivas_total_brate ); st_ivas->transport_config = signaled_config; } @@ -1363,7 +1363,7 @@ ivas_error ivas_init_decoder( int16_t i, n, k; int16_t sce_id, cpe_id; int16_t numCldfbAnalyses, numCldfbSyntheses; - int16_t granularity, n_channels_transport_jbm; + int16_t granularity, n_channels_transport; int16_t nchan_out_buff; int32_t output_Fs, ivas_total_brate; int32_t delay_ns; @@ -2460,7 +2460,7 @@ ivas_error ivas_init_decoder( } /* CLDFB Interpolation weights */ - if ( ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && !st_ivas->sba_dirac_stereo_flag && st_ivas->hDecoderConfig->nchan_out != 1 ) + if ( ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && !st_ivas->sba_dirac_stereo_flag && hDecoderConfig->nchan_out != 1 ) { ivas_spar_get_cldfb_gains( st_ivas->hSpar, st_ivas->cldfbAnaDec[0], st_ivas->cldfbSynDec[0], hDecoderConfig ); } @@ -2523,16 +2523,16 @@ ivas_error ivas_init_decoder( } /*-----------------------------------------------------------------* - * Allocate and initialize JBM struct + buffer + * Allocate and initialize TC struct + buffer *-----------------------------------------------------------------*/ if ( st_ivas->hTcBuffer == NULL ) { /* no module has yet open the TC buffer, open a default one */ - granularity = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, ivas_renderer_secondary_select( st_ivas ), output_Fs ); - n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); + granularity = ivas_dec_get_render_granularity( st_ivas->renderer_type, ivas_renderer_secondary_select( st_ivas ), output_Fs ); + n_channels_transport = ivas_dec_get_num_tc_channels( st_ivas ); - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, ivas_jbm_dec_get_tc_buffer_mode( st_ivas ), n_channels_transport_jbm, n_channels_transport_jbm, n_channels_transport_jbm, granularity ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec_tc_buffer_open( st_ivas, ivas_dec_get_tc_buffer_mode( st_ivas ), n_channels_transport, n_channels_transport, n_channels_transport, granularity ) ) != IVAS_ERR_OK ) { return error; } @@ -2542,7 +2542,7 @@ ivas_error ivas_init_decoder( { if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { - if ( ( error = ivas_jbm_dec_metadata_open( st_ivas ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_jbm_dec_masa_metadata_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } @@ -2799,7 +2799,6 @@ void ivas_initialize_handles_dec( st_ivas->hTdRendHandles[i] = NULL; } - /* JBM handles */ st_ivas->hTcBuffer = NULL; st_ivas->hJbmMetadata = NULL; @@ -3030,8 +3029,8 @@ void ivas_destroy_dec( st_ivas->hDecoderConfig = NULL; } - /* JBM TC buffer structure */ - ivas_jbm_dec_tc_buffer_close( &st_ivas->hTcBuffer ); + /* TC buffer structure */ + ivas_dec_tc_buffer_close( &st_ivas->hTcBuffer ); if ( st_ivas->hJbmMetadata != NULL ) { diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index c29dd20a674bccbd8d9c1c19fcf62b6335d5bef1..1ca7375198f0e86b6ec0002ec8ea47bbe2dfafd5 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -56,9 +56,6 @@ static ivas_error ivas_ism_bitrate_switching_dec( int32_t element_brate_tmp[MAX_NUM_OBJECTS]; int16_t nSCE_old, nCPE_old; int16_t numCldfbAnalyses_old, numCldfbSyntheses_old, ism_mode; - TC_BUFFER_MODE tc_buffer_mode_new; - int16_t tc_nchan_tc_new; - int16_t tc_nchan_allocate_new; int16_t tc_granularity_new; int16_t nchan_out_buff; @@ -110,7 +107,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->hDecoderConfig->output_config ); } - /* transfer subframe info from DirAC or ParamMC to central tc buffer */ + /* transfer subframe info from DirAC or ParamMC to central TC buffer */ /* only do this if we are not having done everything already in the TC decoding part and having only played out from the TC buffer */ if ( last_ism_mode == ISM_MODE_PARAM && st_ivas->hSpatParamRendCom != NULL && st_ivas->hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER ) { @@ -121,15 +118,15 @@ static ivas_error ivas_ism_bitrate_switching_dec( mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); } - /* JBM: when granularity goes down (e.g. Discrete ISM with TD Obj Renderer -> ParamISM with binaural fastconv - render what still fits in the new granularity */ - tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); + /* when granularity goes down (e.g. Discrete ISM with TD Obj Renderer -> ParamISM with binaural fastconv + render what still fits in the new granularity */ + tc_granularity_new = ivas_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { /* flush already done in IVAS_DEC_ReadFormat() */ } - /* JBM: when granularity goes up set samples to discard at the beginning of the frame */ + /* when granularity goes up set samples to discard at the beginning of the frame */ else if ( tc_granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) { if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK ) @@ -283,42 +280,45 @@ static ivas_error ivas_ism_bitrate_switching_dec( } /*-----------------------------------------------------------------* - * JBM TC buffers + * TC buffer *-----------------------------------------------------------------*/ int16_t tc_nchan_full_new; + TC_BUFFER_MODE tc_buffer_mode_new; + int16_t tc_nchan_rend_new; + int16_t tc_nchan_allocate_new; DECODER_TC_BUFFER_HANDLE hTcBuffer; hTcBuffer = st_ivas->hTcBuffer; - tc_buffer_mode_new = ivas_jbm_dec_get_tc_buffer_mode( st_ivas ); - tc_nchan_tc_new = ivas_jbm_dec_get_num_tc_channels( st_ivas ); - tc_nchan_allocate_new = tc_nchan_tc_new; - tc_nchan_full_new = tc_nchan_tc_new; + tc_buffer_mode_new = ivas_dec_get_tc_buffer_mode( st_ivas ); + tc_nchan_rend_new = ivas_dec_get_num_tc_channels( st_ivas ); + tc_nchan_allocate_new = tc_nchan_rend_new; + tc_nchan_full_new = tc_nchan_rend_new; if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { tc_nchan_full_new = 0; } - /* reconfigure buffer */ - if ( hTcBuffer->tc_buffer_mode != tc_buffer_mode_new || hTcBuffer->nchan_transport_jbm != tc_nchan_tc_new || + /* reconfigure TC buffer */ + if ( hTcBuffer->tc_buffer_mode != tc_buffer_mode_new || hTcBuffer->nchan_transport_rend != tc_nchan_rend_new || hTcBuffer->nchan_buffer_full != tc_nchan_full_new || hTcBuffer->nchan_transport_internal != tc_nchan_allocate_new ) { - if ( ( error = ivas_jbm_dec_tc_buffer_reconfigure( st_ivas, tc_buffer_mode_new, tc_nchan_tc_new, tc_nchan_allocate_new, tc_nchan_full_new, tc_granularity_new ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec_tc_buffer_reconfigure( st_ivas, tc_buffer_mode_new, tc_nchan_rend_new, tc_nchan_allocate_new, tc_nchan_full_new, tc_granularity_new ) ) != IVAS_ERR_OK ) { return error; } } - /* transfer subframe info from central tc buffer to ParamMC or McMASA (DirAC) */ + /* transfer subframe info from central TC buffer to ParamMC or McMASA (DirAC) */ if ( st_ivas->hSpatParamRendCom != NULL ) { - st_ivas->hSpatParamRendCom->nb_subframes = st_ivas->hTcBuffer->nb_subframes; - st_ivas->hSpatParamRendCom->subframes_rendered = st_ivas->hTcBuffer->subframes_rendered; - st_ivas->hSpatParamRendCom->num_slots = st_ivas->hTcBuffer->num_slots; - st_ivas->hSpatParamRendCom->slots_rendered = st_ivas->hTcBuffer->slots_rendered; + st_ivas->hSpatParamRendCom->nb_subframes = hTcBuffer->nb_subframes; + st_ivas->hSpatParamRendCom->subframes_rendered = hTcBuffer->subframes_rendered; + st_ivas->hSpatParamRendCom->num_slots = hTcBuffer->num_slots; + st_ivas->hSpatParamRendCom->slots_rendered = hTcBuffer->slots_rendered; - mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); + mvs2s( hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); } /*-----------------------------------------------------------------* diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 1cd6be9e50f77a666a862b02c9564c4be18a3d1a..1593e77bf707d036623e934adf141014f7ef3a34 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -545,7 +545,7 @@ ivas_error ivas_param_ism_dec_open( st_ivas->hParamIsmDec = hParamIsmDec; st_ivas->hSpatParamRendCom = hSpatParamRendCom; - granularity = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, output_Fs ); + granularity = ivas_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, output_Fs ); if ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE ) { @@ -585,7 +585,7 @@ ivas_error ivas_param_ism_dec_open( if ( st_ivas->hTcBuffer == NULL ) { - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, nchan_transport, nchan_transport, nchan_full, granularity ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, nchan_transport, nchan_transport, nchan_full, granularity ) ) != IVAS_ERR_OK ) { return error; } @@ -599,7 +599,7 @@ ivas_error ivas_param_ism_dec_open( { int16_t nchan_to_allocate = st_ivas->hDecoderConfig->nchan_out; - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_BUFFER, nchan_to_allocate, nchan_to_allocate, nchan_to_allocate, granularity ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_BUFFER, nchan_to_allocate, nchan_to_allocate, nchan_to_allocate, granularity ) ) != IVAS_ERR_OK ) { return error; } @@ -697,7 +697,7 @@ void ivas_ism_dec_digest_tc( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) { - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); + ivas_dec_td_renderers_adapt_subframes( st_ivas ); if ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || @@ -736,7 +736,7 @@ void ivas_ism_dec_digest_tc( } else { - ivas_jbm_dec_get_adapted_linear_interpolator( (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ), st_ivas->hTcBuffer->n_samples_available, st_ivas->hIsmRendererData->interpolator ); + ivas_dec_get_adapted_linear_interpolator( (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ), st_ivas->hTcBuffer->n_samples_available, st_ivas->hIsmRendererData->interpolator ); } st_ivas->hIsmRendererData->interp_offset = 0; @@ -812,7 +812,7 @@ void ivas_param_ism_dec_digest_tc( /* Initialization */ num_freq_bands = st_ivas->hSpatParamRendCom->num_freq_bands; output_frame = nCldfbSlots * num_freq_bands; - n_ch_cldfb = st_ivas->hTcBuffer->nchan_transport_jbm - st_ivas->hTcBuffer->nchan_buffer_full; + n_ch_cldfb = st_ivas->hTcBuffer->nchan_transport_rend - st_ivas->hTcBuffer->nchan_buffer_full; cldfb_real_buffer = st_ivas->hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc; cldfb_imag_buffer = st_ivas->hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc; @@ -902,7 +902,7 @@ void ivas_param_ism_dec_prepare_renderer( } /* general setup */ - ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbSlots, hParamIsmDec->hParamIsmRendering->interpolator ); + ivas_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbSlots, hParamIsmDec->hParamIsmRendering->interpolator ); ivas_dirac_dec_set_md_map( st_ivas, nCldfbSlots ); diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index cd8d87a4103dd9880bd29da24d75698d73cca8b9..d92872e2697e9066006c33f289e813d316895098 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -158,7 +158,7 @@ void ivas_ism_render_sf( float gain, prev_gain; float tc_local[MAX_NUM_OBJECTS][L_FRAME48k]; float *p_tc[MAX_NUM_OBJECTS]; - int16_t ism_md_subframe_update_jbm, slots_to_render, first_sf, last_sf, subframe_idx; + int16_t ism_md_subframe_update, slots_to_render, first_sf, last_sf, subframe_idx; int16_t n_samples_rendered_loop; /* loop for synthesis, assume we always have to render in multiples of 5ms subframes with spills */ @@ -186,11 +186,11 @@ void ivas_ism_render_sf( /* Number of subframes to delay metadata to sync with audio */ if ( st_ivas->hDecoderConfig->Opt_delay_comp ) { - ism_md_subframe_update_jbm = max( 0, st_ivas->hTcBuffer->nb_subframes - 3 ); + ism_md_subframe_update = max( 0, st_ivas->hTcBuffer->nb_subframes - 3 ); } else { - ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2; + ism_md_subframe_update = st_ivas->hTcBuffer->nb_subframes - 2; } for ( i = 0; i < num_objects; i++ ) @@ -212,7 +212,7 @@ void ivas_ism_render_sf( if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) { - ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_in_subframe, n_samples_in_subframe, st_ivas->hIsmRendererData->interpolator ); + ivas_dec_get_adapted_linear_interpolator( n_samples_in_subframe, n_samples_in_subframe, st_ivas->hIsmRendererData->interpolator ); interp_offset = 0; } @@ -221,7 +221,7 @@ void ivas_ism_render_sf( /* Combined rotation: rotate the object positions depending the head and external orientations */ if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) { - if ( subframe_idx >= ism_md_subframe_update_jbm ) + if ( subframe_idx >= ism_md_subframe_update ) { rotateAziEle( st_ivas->hIsmMetaData[i]->edited_azimuth, st_ivas->hIsmMetaData[i]->edited_elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); } @@ -411,12 +411,12 @@ void ivas_omasa_separate_object_renderer_close( /*-------------------------------------------------------------------------* - * ivas_omasa_separate_object_render_jbm() + * ivas_omasa_separate_object_render() * - * Rendering separated objects and mixing them to the parametrically rendered signals for JBM + * Rendering separated objects and mixing them to the parametrically rendered signals *-------------------------------------------------------------------------*/ -void ivas_omasa_separate_object_render_jbm( +void ivas_omasa_separate_object_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const uint16_t nSamplesRendered, /* i : number of samples rendered */ float input_f_in[][L_FRAME48k], /* i : separated object signal */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 4f0acd6364146159ca3e5610cdc56ffe963bf89d..3a407b1632a5dedf0adde98f0fb3dc99d3bf698f 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -50,7 +50,8 @@ * Local function prototypes *-----------------------------------------------------------------------*/ -static void ivas_jbm_dec_tc_buffer_playout( Decoder_Struct *st_ivas, const uint16_t nSamplesAsked, uint16_t *nSamplesRendered, float *output[] ); + +static void ivas_dec_tc_buffer_playout( Decoder_Struct *st_ivas, const uint16_t nSamplesAsked, uint16_t *nSamplesRendered, float *output[] ); static void ivas_jbm_dec_copy_masa_meta_to_buffer( Decoder_Struct *st_ivas ); @@ -58,12 +59,12 @@ static void ivas_jbm_masa_sf_to_slot_map( Decoder_Struct *st_ivas, const int16_t /*--------------------------------------------------------------------------* - * ivas_jbm_dec_tc() + * ivas_dec() * - * Principal IVAS JBM decoder routine, decoding of metadata and transport channels + * Principal IVAS decoder routine, decoding of metadata and transport channels *--------------------------------------------------------------------------*/ -ivas_error ivas_jbm_dec_tc( +ivas_error ivas_dec( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) { @@ -78,14 +79,14 @@ ivas_error ivas_jbm_dec_tc( int16_t num_md_sub_frames; int32_t ism_total_brate; - push_wmops( "ivas_jbm_dec_tc" ); + push_wmops( "ivas_dec" ); /*----------------------------------------------------------------* * Initialization of local vars after struct has been set *----------------------------------------------------------------*/ output_Fs = st_ivas->hDecoderConfig->output_Fs; - nchan_out = st_ivas->hTcBuffer->nchan_transport_jbm; + nchan_out = st_ivas->hTcBuffer->nchan_transport_rend; output_config = st_ivas->hDecoderConfig->output_config; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; @@ -197,7 +198,6 @@ ivas_error ivas_jbm_dec_tc( { set_s( nb_bits_metadata, 0, MAX_SCE ); - /* read parameters from the bitstream */ if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hQMetaData != NULL ) { @@ -754,7 +754,7 @@ ivas_error ivas_jbm_dec_tc( * + digest TC channels in ParamISM and ParamMC *--------------------------------------------------------------------------*/ -void ivas_jbm_dec_feed_tc_to_renderer( +void ivas_dec_feed_tc_to_renderer( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const int16_t nSamplesForRendering, /* i : number of TC samples available for rendering */ int16_t *nSamplesResidual /* o : number of samples not fitting into the renderer grid and buffer for the next call*/ @@ -767,7 +767,7 @@ void ivas_jbm_dec_feed_tc_to_renderer( DECODER_TC_BUFFER_HANDLE hTcBuffer; hTcBuffer = st_ivas->hTcBuffer; - n_ch_cldfb = hTcBuffer->nchan_transport_jbm - hTcBuffer->nchan_buffer_full; + n_ch_cldfb = hTcBuffer->nchan_transport_rend - hTcBuffer->nchan_buffer_full; if ( st_ivas->hDecoderConfig->Opt_tsm ) { @@ -778,17 +778,17 @@ void ivas_jbm_dec_feed_tc_to_renderer( hTcBuffer->n_samples_buffered = n_samples_still_available + nSamplesForRendering + hTcBuffer->n_samples_discard; hTcBuffer->n_samples_available = hTcBuffer->n_samples_granularity * ( hTcBuffer->n_samples_buffered / hTcBuffer->n_samples_granularity ); *nSamplesResidual = hTcBuffer->n_samples_buffered - hTcBuffer->n_samples_available; - n_ch_full_copy = min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); - n_ch_res_copy = hTcBuffer->nchan_transport_jbm - hTcBuffer->nchan_buffer_full; + n_ch_full_copy = min( hTcBuffer->nchan_transport_rend, hTcBuffer->nchan_buffer_full ); + n_ch_res_copy = hTcBuffer->nchan_transport_rend - hTcBuffer->nchan_buffer_full; /* buffers are shared between 'hTcBuffer->tc[]' and 'p_output_f[]': - in case of 'length(hTcBuffer->tc[]) < length(p_output_f[])', reset of TC buffers + in case of 'length(hTcBuffer->tc[]) < length(p_output_f[])', reset of TC buffer pointers is needed after ivas_buffer_interleaved_to_deinterleaved() */ len_offset = NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ); if ( len_offset < L_FRAME48k ) { offset = 0; - for ( ch = 0; ch < max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch++ ) + for ( ch = 0; ch < max( hTcBuffer->nchan_transport_rend, hTcBuffer->nchan_buffer_full ); ch++ ) { hTcBuffer->tc[ch] = &hTcBuffer->tc_buffer[offset]; st_ivas->p_output_f[ch] = hTcBuffer->tc[ch]; @@ -807,7 +807,7 @@ void ivas_jbm_dec_feed_tc_to_renderer( if ( n_ch_res_copy > 0 ) { - for ( ; ch < hTcBuffer->nchan_transport_jbm; ch++ ) + for ( ; ch < hTcBuffer->nchan_transport_rend; ch++ ) { p_data_f[ch] = hTcBuffer->tc[ch]; mvr2r( hTcBuffer->tc[ch], tmp_buf, nSamplesForRendering ); @@ -826,7 +826,7 @@ void ivas_jbm_dec_feed_tc_to_renderer( p_data_f[n] = &st_ivas->p_output_f[n][0]; } - ch = max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); + ch = max( hTcBuffer->nchan_transport_rend, hTcBuffer->nchan_buffer_full ); for ( n = 0; n < ch; n++ ) { hTcBuffer->tc[n] = st_ivas->p_output_f[n]; /* note: buffers needed in the TD decorellator */ @@ -859,10 +859,10 @@ void ivas_jbm_dec_feed_tc_to_renderer( /*--------------------------------------------------------------------------* * ivas_dec_render() * - * Principal IVAS JBM rendering routine + * Principal IVAS internal rendering routine *--------------------------------------------------------------------------*/ -ivas_error ivas_jbm_dec_render( +ivas_error ivas_dec_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const uint16_t nSamplesAsked, /* i : number of samples wanted */ uint16_t *nSamplesRendered, /* o : number of samples rendered */ @@ -872,7 +872,7 @@ ivas_error ivas_jbm_dec_render( ) { int16_t n, nchan_out; - int16_t nchan_transport; + int16_t nchan_transport_rend; int16_t nchan_remapped; int32_t output_Fs; AUDIO_CONFIG output_config; @@ -889,7 +889,7 @@ ivas_error ivas_jbm_dec_render( output_Fs = st_ivas->hDecoderConfig->output_Fs; nchan_out = st_ivas->hDecoderConfig->nchan_out; - nchan_transport = st_ivas->hTcBuffer->nchan_transport_jbm; + nchan_transport_rend = st_ivas->hTcBuffer->nchan_transport_rend; output_config = st_ivas->hDecoderConfig->output_config; nSamplesAskedLocal = nSamplesAsked + st_ivas->hTcBuffer->n_samples_discard; @@ -935,7 +935,7 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_BUFFER ) { - ivas_jbm_dec_tc_buffer_playout( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output ); + ivas_dec_tc_buffer_playout( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output ); } else if ( st_ivas->ivas_format == MONO_FORMAT || st_ivas->ivas_format == STEREO_FORMAT ) { @@ -1031,7 +1031,7 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) { - nchan_remapped = nchan_transport; + nchan_remapped = nchan_transport_rend; /* Loudspeakers, Ambisonics or Binaural rendering */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) @@ -1061,7 +1061,7 @@ ivas_error ivas_jbm_dec_render( { if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) { - if ( ( error = ivas_omasa_dirac_td_binaural_jbm( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_omasa_dirac_td_binaural( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ) ) != IVAS_ERR_OK ) { return error; } @@ -1073,24 +1073,24 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->renderer_type == RENDERER_DIRAC ) { - ivas_omasa_dirac_rend_jbm( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ); + ivas_omasa_dirac_rend( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ); } else if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT || st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT ) { - ivas_jbm_dec_tc_buffer_playout( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output ); + ivas_dec_tc_buffer_playout( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output ); ivas_omasa_rearrange_channels( p_output, st_ivas->nchan_ism, *nSamplesRendered ); } } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { - nchan_remapped = nchan_transport; + nchan_remapped = nchan_transport_rend; /* Loudspeakers, Ambisonics or Binaural rendering */ if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) { - if ( ( error = ivas_osba_dirac_td_binaural_jbm( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_osba_dirac_td_binaural( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ) ) != IVAS_ERR_OK ) { return error; } @@ -1243,7 +1243,6 @@ ivas_error ivas_jbm_dec_render( { ivas_mc_paramupmix_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_tc, p_output ); - /* Rendering */ if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) && !st_ivas->hDecoderConfig->Opt_Headrotation ) { @@ -1269,6 +1268,7 @@ ivas_error ivas_jbm_dec_render( else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { nchan_remapped = st_ivas->nchan_transport; + if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ); @@ -1388,7 +1388,7 @@ ivas_error ivas_jbm_dec_render( /*--------------------------------------------------------------------------* * ivas_jbm_dec_flush_renderer() * - * Flush samples if renderer granularity changes on a bitrate change + * Flush samples if renderer granularity changes on a bitrate change in JBM *--------------------------------------------------------------------------*/ ivas_error ivas_jbm_dec_flush_renderer( @@ -1408,6 +1408,7 @@ ivas_error ivas_jbm_dec_flush_renderer( int16_t n_samples_still_available; int16_t n_slots_still_available; int16_t n_samples_to_render; + int16_t n_samples_granularity; DECODER_TC_BUFFER_HANDLE hTcBuffer; float *p_output[MAX_LS_CHANNELS + MAX_NUM_OBJECTS]; @@ -1418,6 +1419,7 @@ ivas_error ivas_jbm_dec_flush_renderer( *nSamplesRendered = 0; hTcBuffer = st_ivas->hTcBuffer; + n_samples_granularity = hTcBuffer->n_samples_granularity; /* get number of possible slots in new granularity */ n_samples_still_available = hTcBuffer->n_samples_buffered - hTcBuffer->n_samples_rendered; @@ -1435,7 +1437,7 @@ ivas_error ivas_jbm_dec_flush_renderer( int16_t ch_idx; /* render available full slots (with new lower granularity) */ - for ( ch_idx = 0; ch_idx < max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ ) + for ( ch_idx = 0; ch_idx < max( hTcBuffer->nchan_transport_rend, hTcBuffer->nchan_buffer_full ); ch_idx++ ) { /* move it at the beginning of the TC buffer with zero padding */ mvr2r( hTcBuffer->tc_buffer_old[ch_idx], hTcBuffer->tc[ch_idx], n_samples_to_render ); @@ -1448,7 +1450,7 @@ ivas_error ivas_jbm_dec_flush_renderer( hTcBuffer->subframes_rendered = 0; hTcBuffer->slots_rendered = 0; hTcBuffer->subframe_nbslots[0] = 1; - hTcBuffer->n_samples_buffered = hTcBuffer->n_samples_granularity + n_samples_still_available; + hTcBuffer->n_samples_buffered = n_samples_granularity + n_samples_still_available; hTcBuffer->n_samples_available = 0; hTcBuffer->n_samples_flushed = n_samples_to_render; hTcBuffer->n_samples_rendered = 0; @@ -1465,7 +1467,7 @@ ivas_error ivas_jbm_dec_flush_renderer( /* Binaural rendering */ if ( renderer_type_old == RENDERER_BINAURAL_OBJECTS_TD ) { - if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, n_samples_granularity ) ) != IVAS_ERR_OK ) { return error; } @@ -1473,12 +1475,12 @@ ivas_error ivas_jbm_dec_flush_renderer( else if ( renderer_type_old == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { /* Convert to CICPxx; used also for ISM->CICP19->binaural_room rendering */ - set_f( st_ivas->hIsmRendererData->interpolator, 1.0f, hTcBuffer->n_samples_granularity ); + set_f( st_ivas->hIsmRendererData->interpolator, 1.0f, n_samples_granularity ); - ivas_ism_render_sf( st_ivas, renderer_type_old, p_output, hTcBuffer->n_samples_granularity ); + ivas_ism_render_sf( st_ivas, renderer_type_old, p_output, n_samples_granularity ); if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, - NULL, NULL, st_ivas->hTcBuffer, p_output, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK ) + NULL, NULL, hTcBuffer, p_output, p_output, n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK ) { return error; } @@ -1500,27 +1502,27 @@ ivas_error ivas_jbm_dec_flush_renderer( if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) < ( hIntSetupOld->nchan_out_woLFE + hIntSetupOld->num_lfe ) ) { crendInPlaceRotation = TRUE; - ivas_mc2sba( st_ivas->hTransSetup, hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, hIntSetupOld->ambisonics_order, GAIN_LFE ); + ivas_mc2sba( st_ivas->hTransSetup, hTcBuffer->tc, p_output, n_samples_granularity, hIntSetupOld->ambisonics_order, GAIN_LFE ); } } if ( renderer_type_old == RENDERER_BINAURAL_MIXER_CONV || renderer_type_old == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, - hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output : st_ivas->hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK ) + hIntSetupOld, st_ivas->hEFAPdata, hTcBuffer, crendInPlaceRotation ? p_output : hTcBuffer->tc, p_output, n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK ) { return error; } - ivas_binaural_add_LFE( st_ivas, hTcBuffer->n_samples_granularity, st_ivas->hTcBuffer->tc, p_output ); + ivas_binaural_add_LFE( st_ivas, n_samples_granularity, hTcBuffer->tc, p_output ); } else if ( renderer_type_old == RENDERER_BINAURAL_OBJECTS_TD ) { - if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, n_samples_granularity ) ) != IVAS_ERR_OK ) { return error; } - ivas_binaural_add_LFE( st_ivas, hTcBuffer->n_samples_granularity, st_ivas->hTcBuffer->tc, p_output ); + ivas_binaural_add_LFE( st_ivas, n_samples_granularity, hTcBuffer->tc, p_output ); } else { @@ -1546,7 +1548,7 @@ ivas_error ivas_jbm_dec_flush_renderer( /* copy from ISM delay buffer to the correct place in TCs */ for ( ch_idx = 0; ch_idx < st_ivas->nchan_ism; ch_idx++ ) { - tc_local[ch_idx] = &st_ivas->hTcBuffer->tc[ch_idx + 2][hTcBuffer->n_samples_rendered]; + tc_local[ch_idx] = &hTcBuffer->tc[ch_idx + 2][hTcBuffer->n_samples_rendered]; mvr2r( st_ivas->hMasaIsmData->delayBuffer[ch_idx], tc_local[ch_idx], st_ivas->hMasaIsmData->delayBuffer_size ); } @@ -1567,7 +1569,7 @@ ivas_error ivas_jbm_dec_flush_renderer( st_ivas->hSpatParamRendCom->num_slots = JBM_CLDFB_SLOTS_IN_SUBFRAME; set_s( st_ivas->hSpatParamRendCom->render_to_md_map, last_dirac_md_idx, n_slots_still_available ); - if ( ( error = ivas_omasa_dirac_td_binaural_jbm( st_ivas, (uint16_t) hTcBuffer->n_samples_granularity, nSamplesRendered, &nSamplesAvailableNext, CPE_CHANNELS, p_output ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_omasa_dirac_td_binaural( st_ivas, (uint16_t) hTcBuffer->n_samples_granularity, nSamplesRendered, &nSamplesAvailableNext, CPE_CHANNELS, p_output ) ) != IVAS_ERR_OK ) { return error; } @@ -1627,7 +1629,7 @@ ivas_error ivas_jbm_dec_flush_renderer( set_s( st_ivas->hSpatParamRendCom->render_to_md_map, last_dirac_md_idx, n_slots_still_available ); /* render the last subframe */ - if ( ( error = ivas_osba_dirac_td_binaural_jbm( st_ivas, (uint16_t) hTcBuffer->n_samples_granularity, nSamplesRendered, &nSamplesAvailableNext, p_output ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_osba_dirac_td_binaural( st_ivas, (uint16_t) n_samples_granularity, nSamplesRendered, &nSamplesAvailableNext, p_output ) ) != IVAS_ERR_OK ) { return error; } @@ -1685,7 +1687,8 @@ ivas_error ivas_jbm_dec_flush_renderer( /*--------------------------------------------------------------------------* * ivas_jbm_dec_set_discard_samples() * - * Set number of samples to discard in the first subframe if the renderer granularity changes on a bitrate change + * Set number of samples to discard in the first subframe + * if the renderer granularity changes on a bitrate change in JBM processing *--------------------------------------------------------------------------*/ ivas_error ivas_jbm_dec_set_discard_samples( @@ -1697,6 +1700,7 @@ ivas_error ivas_jbm_dec_set_discard_samples( /* render first frame with front zero padding and discarding those samples */ nMaxSlotsPerSubframe = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / ( FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) ) / st_ivas->hTcBuffer->n_samples_granularity; nSlotsInFirstSubframe = nMaxSlotsPerSubframe - st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1]; + if ( nSlotsInFirstSubframe > 0 ) { st_ivas->hTcBuffer->n_samples_discard = ( nMaxSlotsPerSubframe - nSlotsInFirstSubframe ) * st_ivas->hTcBuffer->n_samples_granularity; @@ -1709,35 +1713,35 @@ ivas_error ivas_jbm_dec_set_discard_samples( /*--------------------------------------------------------------------------* - * ivas_jbm_dec_get_adapted_linear_interpolator() + * ivas_dec_get_adapted_linear_interpolator() * - * Get an interpolator that is adapted to time scale modified IVAS frame + * Get an interpolator that is adapted to (time scale modified) IVAS frame *--------------------------------------------------------------------------*/ -void ivas_jbm_dec_get_adapted_linear_interpolator( +void ivas_dec_get_adapted_linear_interpolator( const int16_t default_interp_length, /* i : default length of the (full-frame) interpolator */ const int16_t interp_length, /* i : length of the interpolator to be created */ float *interpolator /* o : the interpolator */ ) { - int16_t jbm_segment_len, idx; + int16_t segment_len, idx; float dec; #ifdef DEBUGGING assert( default_interp_length % 2 == 0 ); #endif - jbm_segment_len = ( default_interp_length >> 1 ); + segment_len = ( default_interp_length >> 1 ); dec = 1.0f / default_interp_length; interpolator[interp_length - 1] = 1.0f; - for ( idx = interp_length - 2; idx >= jbm_segment_len; idx-- ) + for ( idx = interp_length - 2; idx >= segment_len; idx-- ) { interpolator[idx] = max( 0.0f, interpolator[idx + 1] - dec ); } if ( interpolator[idx + 1] > 0.0f ) { - dec = interpolator[idx + 1] / ( jbm_segment_len + 1 ); + dec = interpolator[idx + 1] / ( segment_len + 1 ); for ( ; idx >= 0; idx-- ) { interpolator[idx] = interpolator[idx + 1] - dec; @@ -1753,12 +1757,12 @@ void ivas_jbm_dec_get_adapted_linear_interpolator( /*--------------------------------------------------------------------------* - * ivas_jbm_dec_get_adapted_subframes() + * ivas_dec_get_adapted_subframes() * - * Get an interpolator that is adapted to time scale modified IVAS frame + * Get an interpolator that is adapted to (time scale modified) IVAS frame *--------------------------------------------------------------------------*/ -void ivas_jbm_dec_get_adapted_subframes( +void ivas_dec_get_adapted_subframes( const int16_t nCldfbTs, /* i : number of time slots in the current frame */ int16_t *subframe_nbslots, /* i/o: subframe grid */ int16_t *nb_subframes /* i/o: number of subframes in the frame */ @@ -1798,18 +1802,18 @@ void ivas_jbm_dec_get_adapted_subframes( /*--------------------------------------------------------------------------* - * ivas_jbm_dec_get_adapted_linear_interpolator() + * ivas_dec_get_md_map() * - * Get an meta data map adapted to a time scale modified IVAS frame + * Get an meta data map adapted to (time scale modified) IVAS frame *--------------------------------------------------------------------------*/ -void ivas_jbm_dec_get_md_map( - const int16_t default_len, /* i : default frame length in metadata slots */ - 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 */ +void ivas_dec_get_md_map( + const int16_t default_len, /* i : default frame length in metadata slots */ + const int16_t len, /* i : length of the modified 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 */ ) { int16_t jbm_segment_len, map_idx, src_idx, src_idx_map; @@ -1850,17 +1854,18 @@ void ivas_jbm_dec_get_md_map( /*--------------------------------------------------------------------------* - * ivas_jbm_dec_get_md_map_even_spacing() + * ivas_dec_get_md_map_even_spacing() * - * Get an meta data map adapted to a time scale modified IVAS frame. Distribute slots evenly across the modified frame. + * Get an meta data map adapted to (time scale modified) IVAS frame. + * Distribute slots evenly across the (modified) frame. *--------------------------------------------------------------------------*/ -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 */ +void ivas_dec_get_md_map_even_spacing( + const int16_t len, /* i : length of the modified 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 */ ) { int16_t map_idx, sf_idx, sf_length, increment, subframes_written; @@ -1913,12 +1918,12 @@ void ivas_jbm_dec_get_md_map_even_spacing( /*--------------------------------------------------------------------------* - * ivas_jbm_dec_get_num_tc_channels() + * ivas_dec_get_num_tc_channels() * - * Get the number of transport channels provided by the JBM transport channel decode function + * Get the number of channels provided to the renderer *--------------------------------------------------------------------------*/ -int16_t ivas_jbm_dec_get_num_tc_channels( +int16_t ivas_dec_get_num_tc_channels( Decoder_Struct *st_ivas /* i : IVAS decoder handle */ ) { @@ -1926,7 +1931,6 @@ int16_t ivas_jbm_dec_get_num_tc_channels( int32_t ivas_total_brate; AUDIO_CONFIG output_config; - if ( st_ivas->renderer_type == RENDERER_DISABLE ) { num_tc = st_ivas->hDecoderConfig->nchan_out; @@ -1935,6 +1939,7 @@ int16_t ivas_jbm_dec_get_num_tc_channels( { num_tc = st_ivas->nchan_transport; } + output_config = st_ivas->hDecoderConfig->output_config; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; @@ -1969,13 +1974,13 @@ int16_t ivas_jbm_dec_get_num_tc_channels( num_tc = 1; /* Only one channel transported */ } - if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->nchan_transport == 2 && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 ) + if ( st_ivas->ivas_format == MASA_FORMAT && output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->nchan_transport == 2 && ivas_total_brate < MASA_STEREO_MIN_BITRATE && ivas_total_brate > IVAS_SID_5k2 ) { num_tc = CPE_CHANNELS; } + if ( st_ivas->ivas_format == SBA_FORMAT ) { - if ( num_tc == 3 ) { num_tc++; @@ -1984,7 +1989,7 @@ int16_t ivas_jbm_dec_get_num_tc_channels( } else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { - if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) + if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { @@ -2013,11 +2018,11 @@ int16_t ivas_jbm_dec_get_num_tc_channels( } else if ( st_ivas->ivas_format == MC_FORMAT ) { - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO ) + if ( output_config == IVAS_AUDIO_CONFIG_MONO ) { num_tc = 1; } - else if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO ) + else if ( output_config == IVAS_AUDIO_CONFIG_STEREO ) { num_tc = 2; } @@ -2046,11 +2051,12 @@ int16_t ivas_jbm_dec_get_num_tc_channels( { num_tc++; } + if ( st_ivas->hOutSetup.separateChannelEnabled && ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_7_1 || output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || output_config == IVAS_AUDIO_CONFIG_5_1_2 || ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) ) { - /* LFE is synthesized in TD with the TCs*/ + /* LFE is synthesized in TD with the TCs */ num_tc++; } } @@ -2067,13 +2073,13 @@ int16_t ivas_jbm_dec_get_num_tc_channels( /*--------------------------------------------------------------------------* - * ivas_jbm_dec_get_render_granularity() - * + * ivas_dec_get_render_granularity() * + * Get renderer granularity *--------------------------------------------------------------------------*/ /*! r: render granularity */ -int16_t ivas_jbm_dec_get_render_granularity( +int16_t ivas_dec_get_render_granularity( const RENDERER_TYPE renderer_type, /* i : renderer type */ const RENDERER_TYPE renderer_type_sec, /* i : secondary renderer type */ const int32_t output_Fs /* i : sampling rate */ @@ -2100,13 +2106,13 @@ int16_t ivas_jbm_dec_get_render_granularity( /*--------------------------------------------------------------------------* - * ivas_jbm_dec_tc_audio_allocate() + * ivas_dec_tc_audio_allocate() * * allocate and initialize TC audio buffer *--------------------------------------------------------------------------*/ -static ivas_error ivas_jbm_dec_tc_audio_allocate( - DECODER_TC_BUFFER_HANDLE hTcBuffer, /* i/o: JBM TSM buffer handle */ +static ivas_error ivas_dec_tc_audio_allocate( + DECODER_TC_BUFFER_HANDLE hTcBuffer, /* i/o: TC buffer handle */ const int32_t output_Fs, /* i : output sampling rate */ const int16_t Opt_tsm /* i : TSM option flag */ ) @@ -2126,19 +2132,19 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate( n_samp_residual = 0; } - nsamp_to_allocate = max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ) * n_samp_full; + nsamp_to_allocate = max( hTcBuffer->nchan_transport_rend, hTcBuffer->nchan_buffer_full ) * n_samp_full; if ( Opt_tsm ) { - /* note: this is stack memory buffer for time-scale modified audio signals */ + /* note: this is stack memory buffer for TC decoded and also time-scale modified audio signals */ if ( ( hTcBuffer->tc_buffer = (float *) malloc( nsamp_to_allocate * sizeof( float ) ) ) == NULL ) { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) ); + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TC Buffer\n" ) ); } set_zero( hTcBuffer->tc_buffer, nsamp_to_allocate ); offset = 0; - for ( ch_idx = 0; ch_idx < max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ ) + for ( ch_idx = 0; ch_idx < max( hTcBuffer->nchan_transport_rend, hTcBuffer->nchan_buffer_full ); ch_idx++ ) { hTcBuffer->tc[ch_idx] = &hTcBuffer->tc_buffer[offset]; offset += n_samp_full; @@ -2153,7 +2159,7 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate( { if ( ( hTcBuffer->tc_buffer_old[ch_idx] = (float *) malloc( n_samp_residual * sizeof( float ) ) ) == NULL ) { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) ); + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TC Buffer\n" ) ); } set_zero( hTcBuffer->tc_buffer_old[ch_idx], n_samp_residual ); } @@ -2184,13 +2190,13 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate( /*--------------------------------------------------------------------------* - * ivas_jbm_dec_tc_audio_deallocate() + * ivas_dec_tc_audio_deallocate() * * deallocate TC audio buffer *--------------------------------------------------------------------------*/ -static void ivas_jbm_dec_tc_audio_deallocate( - DECODER_TC_BUFFER_HANDLE hTcBuffer /* i/o: JBM TSM buffer handle */ +static void ivas_dec_tc_audio_deallocate( + DECODER_TC_BUFFER_HANDLE hTcBuffer /* i/o: TC buffer handle */ ) { int16_t ch_idx; @@ -2229,15 +2235,15 @@ static void ivas_jbm_dec_tc_audio_deallocate( /*--------------------------------------------------------------------------* - * ivas_jbm_dec_tc_buffer_open() + * ivas_dec_tc_buffer_open() * - * open and initialize JBM transport channel buffer + * Open and initialize transport channel buffer handle *--------------------------------------------------------------------------*/ -ivas_error ivas_jbm_dec_tc_buffer_open( +ivas_error ivas_dec_tc_buffer_open( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const TC_BUFFER_MODE tc_buffer_mode, /* i : buffer mode */ - const int16_t nchan_transport_jbm, /* i : number of real transport channels */ + const int16_t nchan_transport_rend, /* i : number of TCs for rendering */ const int16_t nchan_transport_internal, /* i : number of totally buffered channels */ const int16_t nchan_full, /* i : number of channels to fully store */ const int16_t n_samples_granularity /* i : granularity of the renderer/buffer */ @@ -2253,11 +2259,11 @@ ivas_error ivas_jbm_dec_tc_buffer_open( if ( ( hTcBuffer = (DECODER_TC_BUFFER_HANDLE) malloc( sizeof( DECODER_TC_BUFFER ) ) ) == NULL ) { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) ); + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TC Buffer\n" ) ); } hTcBuffer->tc_buffer_mode = tc_buffer_mode; - hTcBuffer->nchan_transport_jbm = nchan_transport_jbm; + hTcBuffer->nchan_transport_rend = nchan_transport_rend; hTcBuffer->nchan_transport_internal = nchan_transport_internal; hTcBuffer->nchan_buffer_full = nchan_full; hTcBuffer->n_samples_granularity = n_samples_granularity; @@ -2275,7 +2281,7 @@ ivas_error ivas_jbm_dec_tc_buffer_open( set_s( hTcBuffer->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS ); set_s( hTcBuffer->subframe_nbslots, nMaxSlotsPerSubframe, MAX_PARAM_SPATIAL_SUBFRAMES ); - if ( ( error = ivas_jbm_dec_tc_audio_allocate( hTcBuffer, st_ivas->hDecoderConfig->output_Fs, st_ivas->hDecoderConfig->Opt_tsm ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec_tc_audio_allocate( hTcBuffer, st_ivas->hDecoderConfig->output_Fs, st_ivas->hDecoderConfig->Opt_tsm ) ) != IVAS_ERR_OK ) { return error; } @@ -2287,15 +2293,15 @@ ivas_error ivas_jbm_dec_tc_buffer_open( /*--------------------------------------------------------------------------* - * ivas_jbm_dec_tc_buffer_reconfigure() + * ivas_dec_tc_buffer_reconfigure() * - * open and initialize JBM transport channel buffer + * Reconfigure transport channel buffer handle *--------------------------------------------------------------------------*/ -ivas_error ivas_jbm_dec_tc_buffer_reconfigure( +ivas_error ivas_dec_tc_buffer_reconfigure( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const TC_BUFFER_MODE tc_buffer_mode, /* i : new buffer mode */ - const int16_t nchan_transport_jbm, /* i : new number of real transport channels */ + const int16_t nchan_transport_rend, /* i : new number of TCs for rendering */ const int16_t nchan_transport_internal, /* i : new number of totally buffered channels */ const int16_t nchan_full, /* i : new number of channels to fully store */ const int16_t n_samples_granularity /* i : new granularity of the renderer/buffer */ @@ -2360,16 +2366,16 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( } hTcBuffer->tc_buffer_mode = tc_buffer_mode; - hTcBuffer->nchan_transport_jbm = nchan_transport_jbm; + hTcBuffer->nchan_transport_rend = nchan_transport_rend; hTcBuffer->nchan_transport_internal = nchan_transport_internal; hTcBuffer->nchan_buffer_full = nchan_full; hTcBuffer->n_samples_granularity = n_samples_granularity; /* reallocate TC audio buffers */ - ivas_jbm_dec_tc_audio_deallocate( hTcBuffer ); + ivas_dec_tc_audio_deallocate( hTcBuffer ); - if ( ( error = ivas_jbm_dec_tc_audio_allocate( hTcBuffer, st_ivas->hDecoderConfig->output_Fs, st_ivas->hDecoderConfig->Opt_tsm ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec_tc_audio_allocate( hTcBuffer, st_ivas->hDecoderConfig->output_Fs, st_ivas->hDecoderConfig->Opt_tsm ) ) != IVAS_ERR_OK ) { return error; } @@ -2385,61 +2391,63 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( /*--------------------------------------------------------------------------* - * ivas_jbm_dec_tc_buffer_playout() - * + * ivas_dec_tc_buffer_playout() * + * Get TC buffer playout *--------------------------------------------------------------------------*/ -static void ivas_jbm_dec_tc_buffer_playout( +static void ivas_dec_tc_buffer_playout( Decoder_Struct *st_ivas, const uint16_t nSamplesAsked, uint16_t *nSamplesRendered, float *output[] ) { int16_t ch_idx, slot_size, slots_to_render, first_sf, last_sf; + DECODER_TC_BUFFER_HANDLE hTcBuffer; - slot_size = st_ivas->hTcBuffer->n_samples_granularity; + hTcBuffer = st_ivas->hTcBuffer; + slot_size = hTcBuffer->n_samples_granularity; /* loop for synthesis, assume we always have to render in multiples of 5ms subframes with spills */ - slots_to_render = min( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered, nSamplesAsked / slot_size ); - st_ivas->hTcBuffer->slots_rendered += slots_to_render; + slots_to_render = min( hTcBuffer->num_slots - hTcBuffer->slots_rendered, nSamplesAsked / slot_size ); + hTcBuffer->slots_rendered += slots_to_render; *nSamplesRendered = (uint16_t) slots_to_render * slot_size; - first_sf = st_ivas->hTcBuffer->subframes_rendered; + first_sf = hTcBuffer->subframes_rendered; last_sf = first_sf; while ( slots_to_render > 0 ) { - slots_to_render -= st_ivas->hTcBuffer->subframe_nbslots[last_sf]; + slots_to_render -= hTcBuffer->subframe_nbslots[last_sf]; last_sf++; } #ifdef DEBUGGING assert( slots_to_render == 0 ); #endif - for ( ch_idx = 0; ch_idx < st_ivas->hTcBuffer->nchan_transport_jbm; ch_idx++ ) + for ( ch_idx = 0; ch_idx < hTcBuffer->nchan_transport_rend; ch_idx++ ) { output[ch_idx] = st_ivas->hTcBuffer->tc[ch_idx] + st_ivas->hTcBuffer->n_samples_rendered; } - st_ivas->hTcBuffer->subframes_rendered = last_sf; + hTcBuffer->subframes_rendered = last_sf; return; } /*--------------------------------------------------------------------------* - * ivas_jbm_dec_tc_buffer_close() + * ivas_dec_tc_buffer_close() * - * Close JBM transport channel buffer + * Close transport channel buffer handle *--------------------------------------------------------------------------*/ -void ivas_jbm_dec_tc_buffer_close( +void ivas_dec_tc_buffer_close( DECODER_TC_BUFFER_HANDLE *phTcBuffer /* i/o: TC buffer handle */ ) { if ( *phTcBuffer != NULL ) { - ivas_jbm_dec_tc_audio_deallocate( *phTcBuffer ); + ivas_dec_tc_audio_deallocate( *phTcBuffer ); free( *phTcBuffer ); *phTcBuffer = NULL; @@ -2450,63 +2458,67 @@ void ivas_jbm_dec_tc_buffer_close( /*--------------------------------------------------------------------------* - * ivas_jbm_dec_td_renderers_adapt_subframes() + * ivas_dec_td_renderers_adapt_subframes() * - * Close JBM transport channel buffer + * Adapt subframes for TD renderers *--------------------------------------------------------------------------*/ -void ivas_jbm_dec_td_renderers_adapt_subframes( +void ivas_dec_td_renderers_adapt_subframes( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) { int16_t nMaxSlotsPerSubframe, nSlotsAvailable; uint16_t nSlotsInLastSubframe, nSlotsInFirstSubframe; + DECODER_TC_BUFFER_HANDLE hTcBuffer; - nMaxSlotsPerSubframe = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / ( FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) ) / st_ivas->hTcBuffer->n_samples_granularity; - nSlotsAvailable = st_ivas->hTcBuffer->n_samples_available / st_ivas->hTcBuffer->n_samples_granularity; - st_ivas->hTcBuffer->num_slots = nSlotsAvailable; - st_ivas->hTcBuffer->n_samples_available = nSlotsAvailable * st_ivas->hTcBuffer->n_samples_granularity; - nSlotsInFirstSubframe = nMaxSlotsPerSubframe - st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1]; - st_ivas->hTcBuffer->nb_subframes = 0; + hTcBuffer = st_ivas->hTcBuffer; + + nMaxSlotsPerSubframe = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / ( FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) ) / hTcBuffer->n_samples_granularity; + nSlotsAvailable = hTcBuffer->n_samples_available / hTcBuffer->n_samples_granularity; + hTcBuffer->num_slots = nSlotsAvailable; + hTcBuffer->n_samples_available = nSlotsAvailable * hTcBuffer->n_samples_granularity; + nSlotsInFirstSubframe = nMaxSlotsPerSubframe - hTcBuffer->subframe_nbslots[hTcBuffer->nb_subframes - 1]; + hTcBuffer->nb_subframes = 0; if ( nSlotsInFirstSubframe > 0 ) { - st_ivas->hTcBuffer->nb_subframes = 1; + hTcBuffer->nb_subframes = 1; nSlotsAvailable -= nSlotsInFirstSubframe; } - st_ivas->hTcBuffer->nb_subframes += (int16_t) ceilf( (float) nSlotsAvailable / (float) nMaxSlotsPerSubframe ); + hTcBuffer->nb_subframes += (int16_t) ceilf( (float) nSlotsAvailable / (float) nMaxSlotsPerSubframe ); nSlotsInLastSubframe = nSlotsAvailable % nMaxSlotsPerSubframe; - set_s( st_ivas->hTcBuffer->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS ); - set_s( st_ivas->hTcBuffer->subframe_nbslots, nMaxSlotsPerSubframe, st_ivas->hTcBuffer->nb_subframes ); + set_s( hTcBuffer->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS ); + set_s( hTcBuffer->subframe_nbslots, nMaxSlotsPerSubframe, hTcBuffer->nb_subframes ); if ( nSlotsInFirstSubframe > 0 ) { - st_ivas->hTcBuffer->subframe_nbslots[0] = nSlotsInFirstSubframe; + hTcBuffer->subframe_nbslots[0] = nSlotsInFirstSubframe; } if ( nSlotsInLastSubframe > 0 ) { - st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1] = nSlotsInLastSubframe; + hTcBuffer->subframe_nbslots[hTcBuffer->nb_subframes - 1] = nSlotsInLastSubframe; } - st_ivas->hTcBuffer->slots_rendered = 0; - st_ivas->hTcBuffer->subframes_rendered = 0; + hTcBuffer->slots_rendered = 0; + hTcBuffer->subframes_rendered = 0; return; } /*--------------------------------------------------------------------------* - * ivas_jbm_dec_get_tc_buffer_mode() + * ivas_dec_get_tc_buffer_mode() * * *--------------------------------------------------------------------------*/ -TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( +TC_BUFFER_MODE ivas_dec_get_tc_buffer_mode( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) { TC_BUFFER_MODE buffer_mode; + buffer_mode = TC_BUFFER_MODE_BUFFER; switch ( st_ivas->renderer_type ) @@ -2561,7 +2573,7 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( } break; case RENDERER_MC: - if ( ivas_jbm_dec_get_num_tc_channels( st_ivas ) != st_ivas->hDecoderConfig->nchan_out ) + if ( ivas_dec_get_num_tc_channels( st_ivas ) != st_ivas->hDecoderConfig->nchan_out ) { buffer_mode = TC_BUFFER_MODE_RENDERER; } @@ -2597,19 +2609,21 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( /*--------------------------------------------------------------------------* - * ivas_jbm_dec_metadata_open() + * ivas_jbm_dec_masa_metadata_open() * - * Open structure for metadata buffering in JBM + * Open structure for MASA metadata buffering in JBM processing *--------------------------------------------------------------------------*/ -ivas_error ivas_jbm_dec_metadata_open( +ivas_error ivas_jbm_dec_masa_metadata_open( Decoder_Struct *st_ivas ) { JBM_METADATA_HANDLE hJbmMetadata; + if ( ( hJbmMetadata = (JBM_METADATA_HANDLE) malloc( sizeof( JBM_METADATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM metadata handle\n" ) ); } + hJbmMetadata->sf_write_idx = 0; hJbmMetadata->sf_md_buffer_length = MASA_JBM_RINGBUFFER_FRAMES * MAX_PARAM_SPATIAL_SUBFRAMES; @@ -2626,7 +2640,7 @@ ivas_error ivas_jbm_dec_metadata_open( /*--------------------------------------------------------------------------* * ivas_jbm_dec_copy_masa_meta_to_buffer() * - * Copy decoded MASA metadata to a ring buffer + * Copy decoded MASA metadata to a ring buffer in JBM processing *--------------------------------------------------------------------------*/ static void ivas_jbm_dec_copy_masa_meta_to_buffer( @@ -2691,7 +2705,7 @@ static void ivas_jbm_masa_sf_to_slot_map( num_slots_in_subfr = CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES; /* Map input subframes to slots */ - ivas_jbm_dec_get_md_map_even_spacing( nCldfbTs, num_slots_in_subfr, 0, MAX_PARAM_SPATIAL_SUBFRAMES, sf_to_slot_map ); + ivas_dec_get_md_map_even_spacing( nCldfbTs, num_slots_in_subfr, 0, MAX_PARAM_SPATIAL_SUBFRAMES, sf_to_slot_map ); for ( slot_idx = 0; slot_idx < nCldfbTs; slot_idx++ ) { @@ -2782,24 +2796,29 @@ void ivas_jbm_masa_sf_to_sf_map( /*--------------------------------------------------------------------------* * ivas_dec_prepare_renderer() * - * prepare IVAS renderer routine + * Prepare IVAS renderer routine *--------------------------------------------------------------------------*/ void ivas_dec_prepare_renderer( - Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) { - int16_t n, n_render_timeslots; + int16_t n, n_render_timeslots, n_samples_available; + AUDIO_CONFIG output_config; + DECODER_TC_BUFFER_HANDLE hTcBuffer; push_wmops( "ivas_dec_prepare_renderer" ); - n_render_timeslots = st_ivas->hTcBuffer->n_samples_available / st_ivas->hTcBuffer->n_samples_granularity; + output_config = st_ivas->hDecoderConfig->output_config; + hTcBuffer = st_ivas->hTcBuffer; + n_samples_available = hTcBuffer->n_samples_available; + n_render_timeslots = n_samples_available / hTcBuffer->n_samples_granularity; - if ( st_ivas->hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_BUFFER ) + if ( hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_BUFFER ) { - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); + ivas_dec_td_renderers_adapt_subframes( st_ivas ); - if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hDecoderConfig->Opt_tsm ) + if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hDecoderConfig->Opt_tsm ) { ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots ); } @@ -2812,7 +2831,7 @@ void ivas_dec_prepare_renderer( } else if ( st_ivas->ivas_format == MONO_FORMAT || st_ivas->ivas_format == STEREO_FORMAT ) { - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); + ivas_dec_td_renderers_adapt_subframes( st_ivas ); } else if ( st_ivas->ivas_format == ISM_FORMAT ) { @@ -2835,7 +2854,7 @@ void ivas_dec_prepare_renderer( } else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) { - ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); + ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, n_samples_available ); } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { @@ -2848,12 +2867,12 @@ void ivas_dec_prepare_renderer( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_OSBA_LS || - st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) && - ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) && + ( output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { for ( n = 0; n < st_ivas->nchan_ism; n++ ) { - delay_signal( st_ivas->hTcBuffer->tc[n], st_ivas->hTcBuffer->n_samples_available, st_ivas->hSbaIsmData->delayBuffer[n], st_ivas->hSbaIsmData->delayBuffer_size ); + delay_signal( hTcBuffer->tc[n], n_samples_available, st_ivas->hSbaIsmData->delayBuffer[n], st_ivas->hSbaIsmData->delayBuffer_size ); } } @@ -2861,24 +2880,24 @@ void ivas_dec_prepare_renderer( { if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) { - n_render_timeslots *= ( st_ivas->hTcBuffer->n_samples_granularity / st_ivas->hSpatParamRendCom->slot_size ); + n_render_timeslots *= ( hTcBuffer->n_samples_granularity / st_ivas->hSpatParamRendCom->slot_size ); } - ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); + ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, n_samples_available ); } } else { - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); + ivas_dec_td_renderers_adapt_subframes( st_ivas ); - ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); + ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, n_samples_available ); } } else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { if ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); + ivas_dec_td_renderers_adapt_subframes( st_ivas ); if ( st_ivas->hDecoderConfig->Opt_tsm ) { @@ -2898,10 +2917,10 @@ void ivas_dec_prepare_renderer( { if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { - n_render_timeslots *= ( st_ivas->hTcBuffer->n_samples_granularity / st_ivas->hSpatParamRendCom->slot_size ); + n_render_timeslots *= ( hTcBuffer->n_samples_granularity / st_ivas->hSpatParamRendCom->slot_size ); } - ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); + ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, n_samples_available ); if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { @@ -2947,12 +2966,12 @@ void ivas_dec_prepare_renderer( gainIsm *= st_ivas->hMasaIsmData->gain_ism_edited[n]; } - v_multc( st_ivas->hTcBuffer->tc[CPE_CHANNELS + n], gainIsm, st_ivas->hTcBuffer->tc[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available ); + v_multc( hTcBuffer->tc[CPE_CHANNELS + n], gainIsm, hTcBuffer->tc[CPE_CHANNELS + n], n_samples_available ); } - if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { - delay_signal( st_ivas->hTcBuffer->tc[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); + delay_signal( hTcBuffer->tc[CPE_CHANNELS + n], n_samples_available, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); } } @@ -2965,7 +2984,7 @@ void ivas_dec_prepare_renderer( { for ( n = 0; n < BINAURAL_CHANNELS; n++ ) { - v_multc( st_ivas->hTcBuffer->tc[n], st_ivas->hMasaIsmData->gain_masa_edited, st_ivas->hTcBuffer->tc[n], tcBufferSize ); + v_multc( hTcBuffer->tc[n], st_ivas->hMasaIsmData->gain_masa_edited, hTcBuffer->tc[n], tcBufferSize ); } } } @@ -2976,11 +2995,11 @@ void ivas_dec_prepare_renderer( { if ( st_ivas->mc_mode == MC_MODE_MCT ) { - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); + ivas_dec_td_renderers_adapt_subframes( st_ivas ); } else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { - ivas_mc_paramupmix_dec_digest_tc( st_ivas, (uint8_t) n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); + ivas_mc_paramupmix_dec_digest_tc( st_ivas, (uint8_t) n_render_timeslots, n_samples_available ); } else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) { @@ -2988,7 +3007,7 @@ void ivas_dec_prepare_renderer( } else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { - ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); + ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, n_samples_available ); } } diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index a3855196dd08660376353593a0d618ddef32c250..f3be3ece1db4354fd6ccacd910bd727cde824126 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -709,7 +709,7 @@ ivas_error ivas_masa_dec_open( buffer_mode = TC_BUFFER_MODE_BUFFER; } - nchan_transport = ivas_jbm_dec_get_num_tc_channels( st_ivas ); + nchan_transport = ivas_dec_get_num_tc_channels( st_ivas ); nchan_to_allocate = nchan_transport; if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) @@ -728,9 +728,9 @@ ivas_error ivas_masa_dec_open( nchan_to_allocate++; } - granularity = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); + granularity = ivas_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_transport, nchan_to_allocate, nchan_to_allocate, granularity ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_transport, nchan_to_allocate, nchan_to_allocate, granularity ) ) != IVAS_ERR_OK ) { return error; } @@ -1473,18 +1473,17 @@ ivas_error ivas_masa_dec_reconfigure( ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp, st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate ); /*-----------------------------------------------------------------* - * JBM TC buffers + * TC buffer *-----------------------------------------------------------------*/ - { int16_t tc_nchan_to_allocate; int16_t tc_nchan_transport; TC_BUFFER_MODE buffer_mode_new; int16_t n_samples_granularity; - n_samples_granularity = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, ivas_renderer_secondary_select( st_ivas ), st_ivas->hDecoderConfig->output_Fs ); - buffer_mode_new = ivas_jbm_dec_get_tc_buffer_mode( st_ivas ); - tc_nchan_transport = ivas_jbm_dec_get_num_tc_channels( st_ivas ); + n_samples_granularity = ivas_dec_get_render_granularity( st_ivas->renderer_type, ivas_renderer_secondary_select( st_ivas ), st_ivas->hDecoderConfig->output_Fs ); + buffer_mode_new = ivas_dec_get_tc_buffer_mode( st_ivas ); + tc_nchan_transport = ivas_dec_get_num_tc_channels( st_ivas ); tc_nchan_to_allocate = tc_nchan_transport; if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) @@ -1531,9 +1530,10 @@ ivas_error ivas_masa_dec_reconfigure( tc_nchan_to_allocate = st_ivas->nchan_transport + st_ivas->nchan_ism; } - if ( tc_nchan_transport != st_ivas->hTcBuffer->nchan_transport_jbm || tc_nchan_to_allocate != st_ivas->hTcBuffer->nchan_transport_internal || buffer_mode_new != st_ivas->hTcBuffer->tc_buffer_mode ) + /* reconfigure TC buffer */ + if ( tc_nchan_transport != st_ivas->hTcBuffer->nchan_transport_rend || tc_nchan_to_allocate != st_ivas->hTcBuffer->nchan_transport_internal || buffer_mode_new != st_ivas->hTcBuffer->tc_buffer_mode ) { - if ( ( error = ivas_jbm_dec_tc_buffer_reconfigure( st_ivas, buffer_mode_new, tc_nchan_transport, tc_nchan_to_allocate, tc_nchan_to_allocate, n_samples_granularity ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec_tc_buffer_reconfigure( st_ivas, buffer_mode_new, tc_nchan_transport, tc_nchan_to_allocate, tc_nchan_to_allocate, n_samples_granularity ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index f689275098ccc9cf7c441883487222dfe5b30e6b..d801ef0b9786aab2abd28acd6b017e329272c9a0 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -459,9 +459,9 @@ ivas_error ivas_param_mc_dec_open( if ( st_ivas->hTcBuffer == NULL ) { - granularity = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, output_Fs ); + granularity = ivas_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, output_Fs ); - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, nchan_transport, nchan_transport, 0, granularity ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, nchan_transport, nchan_transport, 0, granularity ) ) != IVAS_ERR_OK ) { return error; } @@ -1333,7 +1333,7 @@ void ivas_param_mc_dec_digest_tc( /* Initialization */ num_freq_bands = st_ivas->hParamMC->num_freq_bands; - n_ch_cldfb = st_ivas->hTcBuffer->nchan_transport_jbm - st_ivas->hTcBuffer->nchan_buffer_full; + n_ch_cldfb = st_ivas->hTcBuffer->nchan_transport_rend - st_ivas->hTcBuffer->nchan_buffer_full; cldfb_real_buffer = st_ivas->hParamMC->Cldfb_RealBuffer_tc; cldfb_imag_buffer = st_ivas->hParamMC->Cldfb_ImagBuffer_tc; @@ -1422,11 +1422,12 @@ void ivas_param_mc_dec_prepare_renderer( { hParamMC->hMetadataPMC->attackIndex = (int16_t) max( 0, hParamMC->hMetadataPMC->attackIndex + ( ( nCldfbSlots - DEFAULT_JBM_CLDFB_TIMESLOTS ) / 2 ) ); } + /* adapt subframes */ hParamMC->num_slots = nCldfbSlots; hParamMC->slots_rendered = 0; hParamMC->subframes_rendered = 0; - ivas_jbm_dec_get_adapted_subframes( nCldfbSlots, hParamMC->subframe_nbslots, &hParamMC->nb_subframes ); + ivas_dec_get_adapted_subframes( nCldfbSlots, hParamMC->subframe_nbslots, &hParamMC->nb_subframes ); st_ivas->hTcBuffer->nb_subframes = hParamMC->nb_subframes; mvs2s( hParamMC->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, hParamMC->nb_subframes ); @@ -2145,7 +2146,7 @@ static void ivas_param_mc_dec_compute_interpolator( } else { - ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, interp_length, interpolator ); + ivas_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, interp_length, interpolator ); } return; diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 65904b2183c1416ad8bcbb7d6609f20c2c39d420..f8cd294df14a92d181cd76a831c83b238cf3f320 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -199,9 +199,9 @@ void ivas_mc_paramupmix_dec_digest_tc( ivas_param_upmix_dec_decorr_subframes( st_ivas, nSamplesForRendering ); /* adapt subframes */ - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); + ivas_dec_td_renderers_adapt_subframes( st_ivas ); - ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbSlots, hMCParamUpmix->param_interpolator ); + ivas_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbSlots, hMCParamUpmix->param_interpolator ); pop_wmops(); return; @@ -368,7 +368,7 @@ ivas_error ivas_mc_paramupmix_dec_open( } hMCParamUpmix->free_param_interpolator = 1; - ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, DEFAULT_JBM_CLDFB_TIMESLOTS, hMCParamUpmix->param_interpolator ); + ivas_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, DEFAULT_JBM_CLDFB_TIMESLOTS, hMCParamUpmix->param_interpolator ); if ( st_ivas->hTcBuffer == NULL ) { @@ -378,7 +378,7 @@ ivas_error ivas_mc_paramupmix_dec_open( TC_BUFFER_MODE buffer_mode; buffer_mode = TC_BUFFER_MODE_RENDERER; - nchan_tc = ivas_jbm_dec_get_num_tc_channels( st_ivas ); + nchan_tc = ivas_dec_get_num_tc_channels( st_ivas ); nchan_to_allocate = MC_PARAMUPMIX_MAX_INPUT_CHANS; if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO ) @@ -392,9 +392,9 @@ ivas_error ivas_mc_paramupmix_dec_open( nchan_to_allocate = MC_PARAMUPMIX_MAX_INPUT_CHANS; } - granularity = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, output_Fs ); + granularity = ivas_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, output_Fs ); - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_tc, nchan_to_allocate, nchan_to_allocate, granularity ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_tc, nchan_to_allocate, nchan_to_allocate, granularity ) ) != IVAS_ERR_OK ) { return error; } @@ -454,12 +454,12 @@ void ivas_mc_paramupmix_dec_close( /*------------------------------------------------------------------------- - * paramupmix_td_decorr_process_jbm() + * paramupmix_td_decorr_process() * * *------------------------------------------------------------------------*/ -static void paramupmix_td_decorr_process_jbm( +static void paramupmix_td_decorr_process( ivas_td_decorr_state_t *hTdDecorr[], /* i/o: SPAR Covar. decoder handle */ float *pcm_in[], /* i : input audio channels */ float **pp_out_pcm, /* o : output audio channels */ @@ -513,8 +513,9 @@ static void paramupmix_td_decorr_process_jbm( *------------------------------------------------------------------------*/ static void ivas_param_upmix_dec_decorr_subframes( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const int16_t nSamplesForRendering ) + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const int16_t nSamplesForRendering /* i : number of samples provided */ +) { MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; float *pPcm_tmp[MC_PARAMUPMIX_COMBINATIONS]; @@ -542,7 +543,7 @@ static void ivas_param_upmix_dec_decorr_subframes( { int16_t nSamplesToDecorr = min( nSamplesLeftForTD, default_frame ); - paramupmix_td_decorr_process_jbm( hMCParamUpmix->hTdDecorr, p_tc, pPcm_tmp, nSamplesToDecorr ); + paramupmix_td_decorr_process( hMCParamUpmix->hTdDecorr, p_tc, pPcm_tmp, nSamplesToDecorr ); for ( ch = 0; ch < nchan_internal; ch++ ) { diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c old mode 100644 new mode 100755 index 2e796dd54ed9522f9a87d6315df175b9e8a46e5c..b23ad94c9891454f5a382b1ba05753dfa13fb29d --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -732,12 +732,14 @@ static ivas_error ivas_mc_dec_reconfig( Decoder_State *st; ivas_error error; MC_MODE mc_mode, last_mc_mode; + DECODER_TC_BUFFER_HANDLE hTcBuffer; TC_BUFFER_MODE tc_buffer_mode_new; int16_t tc_nchan_tc_new; int16_t tc_nchan_allocate_new; int16_t tc_granularity_new; int16_t nchan_out_buff; + hTcBuffer = st_ivas->hTcBuffer; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; nchan_transport_old = st_ivas->nchan_transport; last_mc_mode = ivas_mc_mode_select( ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ), st_ivas->hDecoderConfig->last_ivas_total_brate ); /* NB: this assumes that LS config remains the same between frames */ @@ -771,36 +773,36 @@ static ivas_error ivas_mc_dec_reconfig( /* side effect of the renderer selection can be a changed internal config */ ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->intern_config ); - /* transfer subframe info from DirAC or ParamMC to central tc buffer */ - if ( st_ivas->hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER ) + /* transfer subframe info from DirAC or ParamMC to central TC buffer */ + if ( hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER ) { if ( last_mc_mode == MC_MODE_PARAMMC ) { - st_ivas->hTcBuffer->nb_subframes = st_ivas->hParamMC->nb_subframes; - st_ivas->hTcBuffer->subframes_rendered = st_ivas->hParamMC->subframes_rendered; - st_ivas->hTcBuffer->num_slots = st_ivas->hParamMC->num_slots; - st_ivas->hTcBuffer->slots_rendered = st_ivas->hParamMC->slots_rendered; - mvs2s( st_ivas->hParamMC->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); + hTcBuffer->nb_subframes = st_ivas->hParamMC->nb_subframes; + hTcBuffer->subframes_rendered = st_ivas->hParamMC->subframes_rendered; + hTcBuffer->num_slots = st_ivas->hParamMC->num_slots; + hTcBuffer->slots_rendered = st_ivas->hParamMC->slots_rendered; + mvs2s( st_ivas->hParamMC->subframe_nbslots, hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); } else if ( last_mc_mode == MC_MODE_MCMASA && st_ivas->hSpatParamRendCom != NULL ) { - st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; - st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; - st_ivas->hTcBuffer->num_slots = st_ivas->hSpatParamRendCom->num_slots; - st_ivas->hTcBuffer->slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; - mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); + hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; + hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; + hTcBuffer->num_slots = st_ivas->hSpatParamRendCom->num_slots; + hTcBuffer->slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; + mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); } } - /* JBM: when granularity goes down (e.g. MCT with CREND -> ParamMC with binaural fastconv - render what still fits in the new granularity */ - tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); + /* when granularity goes down (e.g. MCT with CREND -> ParamMC with binaural fastconv + render what still fits in the new granularity */ + tc_granularity_new = ivas_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { /* flush already done in IVAS_DEC_ReadFormat() */ } - /* JBM: when granularity goes up set samples to discard at the beginning of the frame */ + /* when granularity goes up set samples to discard at the beginning of the frame */ else if ( tc_granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) { if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK ) @@ -1306,15 +1308,13 @@ static ivas_error ivas_mc_dec_reconfig( } /*-----------------------------------------------------------------* - * JBM TC buffers + * TC buffer *-----------------------------------------------------------------*/ { int16_t tc_nchan_full_new; - DECODER_TC_BUFFER_HANDLE hTcBuffer; - hTcBuffer = st_ivas->hTcBuffer; - tc_buffer_mode_new = ivas_jbm_dec_get_tc_buffer_mode( st_ivas ); - tc_nchan_tc_new = ivas_jbm_dec_get_num_tc_channels( st_ivas ); + tc_buffer_mode_new = ivas_dec_get_tc_buffer_mode( st_ivas ); + tc_nchan_tc_new = ivas_dec_get_num_tc_channels( st_ivas ); tc_nchan_allocate_new = tc_nchan_tc_new; tc_nchan_full_new = tc_nchan_tc_new; @@ -1350,33 +1350,33 @@ static ivas_error ivas_mc_dec_reconfig( tc_nchan_full_new = tc_nchan_allocate_new; } - /* reconfigure buffer */ - if ( hTcBuffer->tc_buffer_mode != tc_buffer_mode_new || hTcBuffer->nchan_transport_jbm != tc_nchan_tc_new || + /* reconfigure TC buffer */ + if ( hTcBuffer->tc_buffer_mode != tc_buffer_mode_new || hTcBuffer->nchan_transport_rend != tc_nchan_tc_new || hTcBuffer->nchan_buffer_full != tc_nchan_full_new || hTcBuffer->nchan_transport_internal != tc_nchan_allocate_new || tc_granularity_new != hTcBuffer->n_samples_granularity ) { - if ( ( error = ivas_jbm_dec_tc_buffer_reconfigure( st_ivas, tc_buffer_mode_new, tc_nchan_tc_new, tc_nchan_allocate_new, tc_nchan_full_new, tc_granularity_new ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec_tc_buffer_reconfigure( st_ivas, tc_buffer_mode_new, tc_nchan_tc_new, tc_nchan_allocate_new, tc_nchan_full_new, tc_granularity_new ) ) != IVAS_ERR_OK ) { return error; } } - /* transfer subframe info from central tc buffer to ParamMC or McMASA (DirAC) */ + /* transfer subframe info from central TC buffer to ParamMC or McMASA (DirAC) */ if ( st_ivas->hSpatParamRendCom != NULL ) { - st_ivas->hSpatParamRendCom->nb_subframes = st_ivas->hTcBuffer->nb_subframes; - st_ivas->hSpatParamRendCom->subframes_rendered = st_ivas->hTcBuffer->subframes_rendered; - st_ivas->hSpatParamRendCom->num_slots = st_ivas->hTcBuffer->num_slots; - st_ivas->hSpatParamRendCom->slots_rendered = st_ivas->hTcBuffer->slots_rendered; - mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); + st_ivas->hSpatParamRendCom->nb_subframes = hTcBuffer->nb_subframes; + st_ivas->hSpatParamRendCom->subframes_rendered = hTcBuffer->subframes_rendered; + st_ivas->hSpatParamRendCom->num_slots = hTcBuffer->num_slots; + st_ivas->hSpatParamRendCom->slots_rendered = hTcBuffer->slots_rendered; + mvs2s( hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); } else if ( st_ivas->hParamMC != NULL ) { - st_ivas->hParamMC->nb_subframes = st_ivas->hTcBuffer->nb_subframes; - st_ivas->hParamMC->subframes_rendered = st_ivas->hTcBuffer->subframes_rendered; - st_ivas->hParamMC->num_slots = st_ivas->hTcBuffer->num_slots; - st_ivas->hParamMC->slots_rendered = st_ivas->hTcBuffer->slots_rendered; - mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hParamMC->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); + st_ivas->hParamMC->nb_subframes = hTcBuffer->nb_subframes; + st_ivas->hParamMC->subframes_rendered = hTcBuffer->subframes_rendered; + st_ivas->hParamMC->num_slots = hTcBuffer->num_slots; + st_ivas->hParamMC->slots_rendered = hTcBuffer->slots_rendered; + mvs2s( hTcBuffer->subframe_nbslots, st_ivas->hParamMC->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); } } diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index ff47b1b9a77fa56f539ca737a201d2fff16f22b5..d9d12ec14ae37540088db3b7b9328217a3456ee0 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -92,7 +92,7 @@ ivas_error ivas_td_binaural_renderer_sf( int16_t ch, slot_size, slots_to_render, output_frame; ivas_error error; - int16_t ism_md_subframe_update_jbm; + int16_t ism_md_subframe_update; int16_t c_indx, nS; int16_t nchan_ism_internal, nchan_ism, ch_offset; @@ -119,16 +119,16 @@ ivas_error ivas_td_binaural_renderer_sf( /* Number of subframes to delay metadata to sync with audio */ if ( st_ivas->hDecoderConfig->Opt_delay_comp ) { - ism_md_subframe_update_jbm = max( 0, st_ivas->hTcBuffer->nb_subframes - 3 ); + ism_md_subframe_update = max( 0, st_ivas->hTcBuffer->nb_subframes - 3 ); } else { - ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2; + ism_md_subframe_update = st_ivas->hTcBuffer->nb_subframes - 2; } if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { - ism_md_subframe_update_jbm = max( 0, st_ivas->hTcBuffer->nb_subframes - 2 ); + ism_md_subframe_update = max( 0, st_ivas->hTcBuffer->nb_subframes - 2 ); } for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) @@ -177,7 +177,7 @@ ivas_error ivas_td_binaural_renderer_sf( } } - if ( subframe_idx == ism_md_subframe_update_jbm ) + if ( subframe_idx == ism_md_subframe_update ) { if ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) { @@ -237,7 +237,7 @@ ivas_error ivas_td_binaural_renderer_sf( } /* Render subframe */ - /* ism_md_subframe_update_jbm != subframe_idx: trigger update only for ism_md_subframe_update_jbm == subframe_idx, + /* ism_md_subframe_update != subframe_idx: trigger update only for ism_md_subframe_update_jbm == subframe_idx, where then the two TDREND_GetMix()-arguments subframe_idx and ism_md_subframe_update are equal, and we want to enforce the update inside TDREND_GetMix to use subframe_idx == 0 */ if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0 ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index ddb3df80033558d9f65cc04b1e3efe5143f34368..21d2c8373ec5d5c6431659fe1888f720e7b94b60 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -656,12 +656,12 @@ ivas_error ivas_omasa_ism_metadata_dec( /*--------------------------------------------------------------------------* - * ivas_omasa_dirac_rend_jbm() + * ivas_omasa_dirac_rend() * - * Rendering in OMASA format for JBM + * Rendering in OMASA format *--------------------------------------------------------------------------*/ -void ivas_omasa_dirac_rend_jbm( +void ivas_omasa_dirac_rend( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of samples requested */ uint16_t *nSamplesRendered, /* o : number of samples rendered */ @@ -719,19 +719,19 @@ void ivas_omasa_dirac_rend_jbm( ivas_dirac_dec_render( st_ivas, nchan_transport, nSamplesAsked, nSamplesRendered, nSamplesAvailable, output_f ); - ivas_omasa_separate_object_render_jbm( st_ivas, *nSamplesRendered, data_separated_objects, output_f, subframes_rendered ); + ivas_omasa_separate_object_render( st_ivas, *nSamplesRendered, data_separated_objects, output_f, subframes_rendered ); return; } /*--------------------------------------------------------------------------* - * ivas_omasa_dirac_td_binaural_render() + * ivas_omasa_dirac_td_binaural() * - * Binaural rendering in OMASA format for JBM + * Binaural rendering in OMASA format *--------------------------------------------------------------------------*/ -ivas_error ivas_omasa_dirac_td_binaural_jbm( +ivas_error ivas_omasa_dirac_td_binaural( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of samples requested */ uint16_t *nSamplesRendered, /* o : number of samples rendered */ diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index cc2599b018bfff3d0edbeae0784acca41efc3bff..49102e1e7bcb10bfa0b087eacbb16912c7e2ad52 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -119,12 +119,12 @@ void ivas_osba_data_close( /*--------------------------------------------------------------------------* - * ivas_osba_dirac_td_binaural_jbm() + * ivas_osba_dirac_td_binaural() * - * Binaural rendering in JBM OSBA format + * Binaural rendering in OSBA format *--------------------------------------------------------------------------*/ -ivas_error ivas_osba_dirac_td_binaural_jbm( +ivas_error ivas_osba_dirac_td_binaural( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 649cda2f12ec66d8ed21152910c30f21e116448d..47ee678d015f7b78ce1fdb2c2e5a5ad5971e2663 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -160,7 +160,7 @@ ivas_error ivas_sba_dec_reconfigure( if ( st_ivas->ivas_format == SBA_ISM_FORMAT && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { /* determine new granularity */ - granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, ivas_renderer_secondary_select( st_ivas ), st_ivas->hDecoderConfig->output_Fs ); + granularity_new = ivas_dec_get_render_granularity( st_ivas->renderer_type, ivas_renderer_secondary_select( st_ivas ), st_ivas->hDecoderConfig->output_Fs ); /* flush renderer on granularity change from 5ms to 1.25ms, again only possible for binaural rendering */ if ( granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) @@ -515,16 +515,15 @@ ivas_error ivas_sba_dec_reconfigure( } /*-----------------------------------------------------------------* - * JBM TC buffers + * TC buffer *-----------------------------------------------------------------*/ - { int16_t tc_nchan_to_allocate; int16_t tc_nchan_tc; TC_BUFFER_MODE tc_buffer_mode; tc_buffer_mode = TC_BUFFER_MODE_RENDERER; - tc_nchan_tc = ivas_jbm_dec_get_num_tc_channels( st_ivas ); + tc_nchan_tc = ivas_dec_get_num_tc_channels( st_ivas ); tc_nchan_to_allocate = tc_nchan_tc; if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO ) { @@ -561,16 +560,17 @@ ivas_error ivas_sba_dec_reconfigure( } } - if ( tc_nchan_tc != st_ivas->hTcBuffer->nchan_transport_jbm || tc_nchan_to_allocate != st_ivas->hTcBuffer->nchan_transport_internal || tc_buffer_mode != st_ivas->hTcBuffer->tc_buffer_mode || granularity_new != st_ivas->hTcBuffer->n_samples_granularity ) + /* reconfigure TC buffer */ + if ( tc_nchan_tc != st_ivas->hTcBuffer->nchan_transport_rend || tc_nchan_to_allocate != st_ivas->hTcBuffer->nchan_transport_internal || tc_buffer_mode != st_ivas->hTcBuffer->tc_buffer_mode || granularity_new != st_ivas->hTcBuffer->n_samples_granularity ) { - if ( ( error = ivas_jbm_dec_tc_buffer_reconfigure( st_ivas, tc_buffer_mode, tc_nchan_tc, tc_nchan_to_allocate, tc_nchan_to_allocate, granularity_new ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec_tc_buffer_reconfigure( st_ivas, tc_buffer_mode, tc_nchan_tc, tc_nchan_to_allocate, tc_nchan_to_allocate, granularity_new ) ) != IVAS_ERR_OK ) { return error; } } } - /* resync SPAR and DirAC JBM info from TC Buffer */ + /* resync SPAR and DirAC info from TC Buffer */ if ( st_ivas->hSpatParamRendCom != NULL && st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity ) { mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index dd8bf56d42f0eb8b633836b5250cdbb37bfb075e..5476ac1a79bb0bab1ac2ffdb5a5826fa77037ac2 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -220,7 +220,7 @@ ivas_error ivas_spar_dec_open( int16_t granularity; buffer_mode = TC_BUFFER_MODE_RENDERER; - nchan_tc = ivas_jbm_dec_get_num_tc_channels( st_ivas ); + nchan_tc = ivas_dec_get_num_tc_channels( st_ivas ); nchan_to_allocate = num_channels_internal; if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) @@ -247,9 +247,9 @@ ivas_error ivas_spar_dec_open( nchan_to_allocate = 2 * BINAURAL_CHANNELS; } - granularity = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, ivas_renderer_secondary_select( st_ivas ), output_Fs ); + granularity = ivas_dec_get_render_granularity( st_ivas->renderer_type, ivas_renderer_secondary_select( st_ivas ), output_Fs ); - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_tc, nchan_to_allocate, nchan_to_allocate, granularity ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_tc, nchan_to_allocate, nchan_to_allocate, granularity ) ) != IVAS_ERR_OK ) { return error; } @@ -1227,9 +1227,9 @@ void ivas_spar_dec_set_render_map( hSpar->subframes_rendered = 0; set_s( hSpar->render_to_md_map, 0, MAX_JBM_SUBFRAMES_5MS * JBM_CLDFB_SLOTS_IN_SUBFRAME ); - ivas_jbm_dec_get_adapted_subframes( nCldfbTs, hSpar->subframe_nbslots, &hSpar->nb_subframes ); + ivas_dec_get_adapted_subframes( nCldfbTs, hSpar->subframe_nbslots, &hSpar->nb_subframes ); - /* copy also to tc buffer */ + /* copy also to TC buffer handle */ /* only for non-combined formats and combinded formats w/o discrete objects */ if ( !( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) ) { @@ -1237,7 +1237,7 @@ void ivas_spar_dec_set_render_map( mvs2s( hSpar->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, hSpar->nb_subframes ); } - ivas_jbm_dec_get_md_map( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbTs, 1, 0, DEFAULT_JBM_CLDFB_TIMESLOTS, hSpar->render_to_md_map ); + ivas_dec_get_md_map( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbTs, 1, 0, DEFAULT_JBM_CLDFB_TIMESLOTS, hSpar->render_to_md_map ); return; } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 3ce93da9de0415ba6743ffca7b4a8b44a71f2335..44112fe16dd466a4a7bf9e89f618a3f28e694559 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -934,7 +934,7 @@ typedef struct ivas_masa_ism_data_structure /*----------------------------------------------------------------------------------* - * JBM structures + * TC buffer structure, stores decoder and renderer audio samples, and rendering parameters *----------------------------------------------------------------------------------*/ typedef struct decoder_tc_buffer_structure @@ -943,7 +943,7 @@ typedef struct decoder_tc_buffer_structure float *tc_buffer; /* the buffer itself */ float *tc[MAX_INTERN_CHANNELS]; /* pointers into the buffer to the beginning of each tc */ TC_BUFFER_MODE tc_buffer_mode; /* mode of the buffer (no buffering, render buffering, out buffering) */ - int16_t nchan_transport_jbm; /* number of TCs after TC decoding */ + int16_t nchan_transport_rend; /* number of TCs provided to the renderer */ int16_t nchan_transport_internal; /* total number of TC buffer channels, can include e.g. TD decorr data */ int16_t nchan_buffer_full; /* number of channels to be fully buffered */ int16_t n_samples_available; /* samples still available for rendering in the current frame */ @@ -962,6 +962,11 @@ typedef struct decoder_tc_buffer_structure } DECODER_TC_BUFFER, *DECODER_TC_BUFFER_HANDLE; + +/*----------------------------------------------------------------------------------* + * JBM metadata structure + *----------------------------------------------------------------------------------*/ + typedef struct jbm_metadata_structure { int16_t sf_write_idx; @@ -1119,8 +1124,7 @@ typedef struct Decoder_Struct ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE hSplitBinRend; /* ISAR split binaural rendering handle */ BINAURAL_TD_OBJECT_RENDERER_HANDLE hTdRendHandles[MAX_HEAD_ROT_POSES - 1]; /* TD object renderer handles */ - /* JBM module */ - DECODER_TC_BUFFER_HANDLE hTcBuffer; /* JBM structure */ + DECODER_TC_BUFFER_HANDLE hTcBuffer; /* transport channels (TC) structure */ JBM_METADATA_HANDLE hJbmMetadata; /* Structure for metadata buffering in JBM */ #ifdef DEBUGGING diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 17342a454a8dbd8c28acdf6ade2e3088f8eb1236..ddc51e0dcd21114e52e4a6fd8500e1c04152a2ba 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1111,7 +1111,7 @@ ivas_error IVAS_DEC_ReadFormat( ( ( renderer_type_old != st_ivas->renderer_type ) || ( renderer_type_sec_old != renderer_type_sec_new ) ) ) { - int16_t tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, renderer_type_sec_new, st_ivas->hDecoderConfig->output_Fs ); + int16_t tc_granularity_new = ivas_dec_get_render_granularity( st_ivas->renderer_type, renderer_type_sec_new, st_ivas->hDecoderConfig->output_Fs ); st_ivas->nchan_transport = nchan_transport_old; @@ -1198,7 +1198,7 @@ ivas_error IVAS_DEC_GetSamplesDecoder( } else if ( hIvasDec->mode == IVAS_DEC_MODE_IVAS ) { - if ( ( error = ivas_jbm_dec_tc( st_ivas ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec( st_ivas ) ) != IVAS_ERR_OK ) { return error; } @@ -1255,7 +1255,7 @@ ivas_error IVAS_DEC_GetSamplesDecoder( * Feed decoded transport channels samples to the renderer *-----------------------------------------------------------------*/ - ivas_jbm_dec_feed_tc_to_renderer( st_ivas, nSamplesTcsScaled, &nResidualSamples ); + ivas_dec_feed_tc_to_renderer( st_ivas, nSamplesTcsScaled, &nResidualSamples ); if ( st_ivas->hDecoderConfig->Opt_tsm ) { @@ -1908,7 +1908,7 @@ ivas_error IVAS_DEC_GetSamplesRenderer( } /* render IVAS frames directly to the output buffer */ - if ( ( error = ivas_jbm_dec_render( st_ivas, nSamplesAsked - nSamplesRendered, &nSamplesRendered_loop, &hIvasDec->nSamplesAvailableNext, pcm_type_API_to_internal( pcmType ), pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ) ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec_render( st_ivas, nSamplesAsked - nSamplesRendered, &nSamplesRendered_loop, &hIvasDec->nSamplesAvailableNext, pcm_type_API_to_internal( pcmType ), pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ) ) ) != IVAS_ERR_OK ) { return error; } @@ -2264,7 +2264,7 @@ static ivas_error ivas_dec_setup_all( } } - *nTransportChannels = (uint8_t) st_ivas->hTcBuffer->nchan_transport_jbm; + *nTransportChannels = (uint8_t) st_ivas->hTcBuffer->nchan_transport_rend; /*-----------------------------------------------------------------* * ISAR: @@ -4297,7 +4297,7 @@ ivas_error IVAS_DEC_Flush( error = IVAS_ERR_OK; if ( nSamplesToRender > 0 && hIvasDec->st_ivas->ivas_format != MONO_FORMAT ) { - error = ivas_jbm_dec_render( hIvasDec->st_ivas, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcm_type_API_to_internal( pcmType ), pcmBuf ); + error = ivas_dec_render( hIvasDec->st_ivas, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcm_type_API_to_internal( pcmType ), pcmBuf ); } else { diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 5341118e3c2aafe6cbbcb2f4563392eb06930e1b..dd750428b41a87ae224599ee25668d3aed52e200 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1705,7 +1705,7 @@ ivas_error ivas_rend_crendProcessSubframe( const COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined orientation handle */ const IVAS_OUTPUT_SETUP_HANDLE hIntSetup, /* i : internal setup handle */ const EFAP_HANDLE hEFAPdata, /* i : EFAP handle */ - DECODER_TC_BUFFER_HANDLE hTcBuffer, /* i/o: JBM handle */ + DECODER_TC_BUFFER_HANDLE hTcBuffer, /* i/o: TC handle */ float *input_f[], /* i : transport channels */ float *output[], /* i/o: input/output audio channels */ const int16_t n_samples_to_render, /* i : output frame length per channel */ @@ -1886,7 +1886,7 @@ ivas_error ivas_rend_crendProcessSubframesSplitBin( const COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined orientation handle */ const IVAS_OUTPUT_SETUP_HANDLE hIntSetup, /* i : internal setup handle */ const EFAP_HANDLE hEFAPdata, /* i : EFAP handle */ - DECODER_TC_BUFFER_HANDLE hTcBuffer, /* i/o: JBM handle */ + DECODER_TC_BUFFER_HANDLE hTcBuffer, /* i/o: TC handle */ float *input_f[], /* i : transport channels */ float *output[], /* i/o: input/output audio channels */ const int16_t n_samples_to_render, /* i : output frame length per channel */ diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index e14414c57e57c0f3849dbf1cac313b58f5d11364..066ba9db4b22e6233a7f605e648a7ea8e60841f9 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -332,9 +332,9 @@ ivas_error ivas_dirac_dec_init_binaural_data( nchan_to_allocate = BINAURAL_CHANNELS + st_ivas->nchan_ism; } - n_samples_granularity = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, ivas_renderer_secondary_select( st_ivas ), output_Fs ); + n_samples_granularity = ivas_dec_get_render_granularity( st_ivas->renderer_type, ivas_renderer_secondary_select( st_ivas ), output_Fs ); - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, ivas_jbm_dec_get_num_tc_channels( st_ivas ), nchan_to_allocate, nchan_to_allocate, n_samples_granularity ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, ivas_dec_get_num_tc_channels( st_ivas ), nchan_to_allocate, nchan_to_allocate, n_samples_granularity ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 01e1d77231ff06fc84f35a4ca20448a53e8b2729..352662949ef17ed5fd66e36ea786c238c3d91553 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -391,7 +391,7 @@ ivas_error ivas_output_buff_dec( if ( Opt_tsm ) { /* JBM decoding: output audio buffers are shared with audio buffers from 'hTcBuffer->tc[]' */ - nchan_tc_jbm = max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); + nchan_tc_jbm = max( hTcBuffer->nchan_transport_rend, hTcBuffer->nchan_buffer_full ); } if ( nchan_out_buff <= nchan_tc_jbm && !Opt_tsm ) diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 2cd33f685ecbdde277565dce3af1f181f33eb05c..48832dd2eacd11731c9fc5371f1b50f465dcec00 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -925,7 +925,7 @@ ivas_error ivas_rend_crendProcessSubframe( const COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined orientation handle */ const IVAS_OUTPUT_SETUP_HANDLE hIntSetup, /* i : internal setup handle */ const EFAP_HANDLE hEFAPdata, /* i : EFAP handle */ - DECODER_TC_BUFFER_HANDLE hTcBuffer, /* i/o: JBM handle */ + DECODER_TC_BUFFER_HANDLE hTcBuffer, /* i/o: TC handle */ float *input_f[], /* i : transport channels */ float *output[], /* i/o: input/output audio channels */ const int16_t n_samples_to_render, /* i : output frame length per channel */ @@ -1535,12 +1535,12 @@ ivas_error ivas_rend_crendProcessSubframesSplitBin( const CREND_WRAPPER *pCrend, /* i/o: Crend wrapper handle */ const AUDIO_CONFIG inConfig, /* i : input audio configuration */ const AUDIO_CONFIG outConfig, /* i : output audio configuration */ - const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, /* i/o: pose correction data handle */ const DECODER_CONFIG_HANDLE hDecoderConfig, /* i : decoder config. structure */ const COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined orientation handle */ const IVAS_OUTPUT_SETUP_HANDLE hIntSetup, /* i : internal setup handle */ const EFAP_HANDLE hEFAPdata, /* i : EFAP handle */ - DECODER_TC_BUFFER_HANDLE hTcBuffer, /* i/o: JBM handle */ + DECODER_TC_BUFFER_HANDLE hTcBuffer, /* i/o: TC handle */ float *input_f[], /* i : transport channels */ float *output[], /* i/o: input/output audio channels */ const int16_t n_samples_to_render, /* i : output frame length per channel */