diff --git a/apps/decoder.c b/apps/decoder.c index 50c8b043e94fe205bf3259bc0bb2f97cc6970c2c..6a1d823f7633824bea45e828548a824a4cd5f2cd 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -298,11 +298,7 @@ int main( if ( arg.hrtfReaderEnabled ) { /* sanity check */ -#ifdef NONBE_1293_SR_HRTF if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#else - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif { arg.hrtfReaderEnabled = false; fprintf( stderr, "\nError: HRTF binary file cannot be used in this output configuration.\n\n" ); diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index d42da1b4228054c9f9db503821a9ebab1d86a9e7..e2d40e74dfd96fc57f96c0ef0675fa5824e5026f 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -175,11 +175,7 @@ typedef enum #define MAX_JBM_L_FRAME48k 1920 #define MAX_JBM_L_FRAME_NS 40000000L #define MAX_SPAR_INTERNAL_CHANNELS IVAS_SPAR_MAX_CH -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS #define MAX_CLDFB_DIGEST_CHANNELS 3 /* == maximum of ParamISM TCs and ParamMC TCs */ -#else -#define MAX_CLDFB_DIGEST_CHANNELS (FOA_CHANNELS + MAX_NUM_OBJECTS) -#endif typedef enum { diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index e0dbc245d7330874fcf609d890e9674f7a56d0d7..f3366e08a8255cffd095db3d4ed886a2de457bf2 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -868,13 +868,6 @@ void ivas_jbm_dec_get_md_map( int16_t ivas_jbm_dec_get_num_tc_channels( Decoder_Struct *st_ivas /* i : IVAS decoder handle */ ); -#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS -void ivas_jbm_dec_copy_tc_no_tsm( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - float *tc[], /* i : transport channels */ - const int16_t output_frame /* i : output frame size */ -); -#endif void ivas_jbm_dec_get_md_map_even_spacing( const int16_t len, /* i : length of the modfied frames in metadata slots */ @@ -1129,14 +1122,6 @@ void ivas_param_ism_dec_prepare_renderer( const uint16_t nCldfbSlots /* i : number of CLDFB slots in transport channels */ ); -#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS -void ivas_ism_param_dec_tc_gain_ajust( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const uint16_t nSamples, /* i : number of samples to be compensate */ - const uint16_t nFadeLength, /* i : length of the crossfade in samples */ - float *p_data_f[] /* i : synthesized core-coder transport channels/DirAC output */ -); -#endif void ivas_param_ism_dec_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ diff --git a/lib_com/options.h b/lib_com/options.h index e237e1f1efea4c1550de2063dbee6518052bc03c..3783d86426a0c48e594e8f723c574fc606ec3dfb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ -#define UNIFIED_DECODING_PATHS_LEFTOVERS /* VA: issue 880: remove leftovers after NONBE_UNIFIED_DECODING_PATHS */ #define FIX_1314_STEREO_TO_EXT /* VA: issue 1314: set RENDERER_DISABLE for stereo to EXT output */ /* #################### End BE switches ################################## */ @@ -172,8 +171,6 @@ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ -#define NONBE_1300_TDREND_LARGE_ITD /* Eri: issue 1300: There was a bug feeding 1.25 ms frames to the TD renderer, causing out-of-buffer access. This was resolved. However, it is still possible that modeled HRTF with large ITDs could trigger out-of-buffer access. This adds a check to prevent this.*/ -#define NONBE_1293_SR_HRTF /* VA: issue 1293: add support of external HRTFs in split rendering */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index a5a6f90f02cc859148455d9167175498198daf13..ba29576848a75a2af4f9cc855bdacacf24269404 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -45,14 +45,12 @@ #include "wmc_auto.h" -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS /*-----------------------------------------------------------------------* * Local function declarations *-----------------------------------------------------------------------*/ static void ivas_ism_param_dec_tc_gain_adjust( Decoder_Struct *st_ivas, const int16_t nSamples, const int16_t nFadeLength, float *p_data_f[] ); -#endif /*-----------------------------------------------------------------------* * Local function definitions *-----------------------------------------------------------------------*/ @@ -804,49 +802,20 @@ void ivas_param_ism_dec_digest_tc( float *p_data_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ ) { -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS int16_t ch, slot_idx, output_frame; int16_t num_freq_bands, cldfb_ch, n_ch_cldfb; float *cldfb_real_buffer, *cldfb_imag_buffer; -#else - int16_t ch, nchan_transport; - int16_t slot_idx; - int16_t output_frame; - PARAM_ISM_DEC_HANDLE hParamIsmDec; - SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; - int16_t fade_len; -#endif /* Initialization */ -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS 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; cldfb_real_buffer = st_ivas->hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc; cldfb_imag_buffer = st_ivas->hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc; -#else - hParamIsmDec = st_ivas->hParamIsmDec; - assert( hParamIsmDec ); - hSpatParamRendCom = st_ivas->hSpatParamRendCom; - assert( hSpatParamRendCom ); - output_frame = nCldfbSlots * hSpatParamRendCom->num_freq_bands; - fade_len = output_frame / 2; - - nchan_transport = st_ivas->nchan_transport; -#endif -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS ivas_ism_param_dec_tc_gain_adjust( st_ivas, output_frame, output_frame / 2, p_data_f ); -#else - if ( st_ivas->hDecoderConfig->Opt_tsm ) - { - /*TODO : FhG to check*/ - ivas_ism_param_dec_tc_gain_ajust( st_ivas, output_frame, fade_len, p_data_f ); - } -#endif -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS /* CLDFB Analysis */ for ( ch = 0, cldfb_ch = 0; cldfb_ch < n_ch_cldfb; cldfb_ch++, ch++ ) { @@ -858,24 +827,6 @@ void ivas_param_ism_dec_digest_tc( num_freq_bands, st_ivas->cldfbAnaDec[cldfb_ch] ); } } -#else - for ( ch = 0; ch < nchan_transport; ch++ ) - { - /* CLDFB Analysis */ - for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) - { - if ( st_ivas->hDecoderConfig->Opt_tsm ) - { - float RealBuffer[CLDFB_NO_CHANNELS_MAX]; - float ImagBuffer[CLDFB_NO_CHANNELS_MAX]; - - cldfbAnalysis_ts( &( p_data_f[ch][hSpatParamRendCom->num_freq_bands * slot_idx] ), RealBuffer, ImagBuffer, hSpatParamRendCom->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); - mvr2r( RealBuffer, &hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], hSpatParamRendCom->num_freq_bands ); - mvr2r( ImagBuffer, &hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], hSpatParamRendCom->num_freq_bands ); - } - } - } -#endif return; } @@ -1037,20 +988,11 @@ void ivas_param_ism_dec_prepare_renderer( * *-------------------------------------------------------------------------*/ -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS static void ivas_ism_param_dec_tc_gain_adjust( -#else -void ivas_ism_param_dec_tc_gain_ajust( -#endif - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const int16_t nSamples, /* i : number of samples to be compensate */ const int16_t nFadeLength, /* i : length of the crossfade in samples */ -#else - const uint16_t nSamples, /* i : number of samples to be compensate */ - const uint16_t nFadeLength, /* i : length of the crossfade in samples */ -#endif - float *p_data_f[] /* i : synthesized core-coder transport channels/DirAC output*/ + float *p_data_f[] /* i : synthesized core-coder transport channels/DirAC output*/ ) { diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 68e9099896673f29978f32dff136fb22c62f002a..e752c91c40e3f13e7c9c653519664f871a6faa79 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -50,9 +50,6 @@ * Local function prototypes *-----------------------------------------------------------------------*/ -#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS -static void ivas_jbm_dec_copy_tc( Decoder_Struct *st_ivas, const int16_t nSamplesForRendering, int16_t *nSamplesResidual, float *data, float *tc_digest_f[] ); -#endif static void ivas_jbm_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 ); @@ -210,12 +207,6 @@ ivas_error ivas_jbm_dec_tc( { return error; } -#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS - if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hDecoderConfig->Opt_tsm ) - { - ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); - } -#endif } else if ( st_ivas->ivas_format == SBA_FORMAT ) { @@ -410,12 +401,6 @@ ivas_error ivas_jbm_dec_tc( /* Extract objects from MASA, output MASA + all objects (i.e., extracted and separated objects) */ ivas_omasa_render_objects_from_mix( st_ivas, p_output, st_ivas->nchan_ism, output_frame ); } -#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS - if ( st_ivas->hDecoderConfig->Opt_tsm ) - { - ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); - } -#endif } } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) @@ -726,18 +711,6 @@ ivas_error ivas_jbm_dec_tc( } } -#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS - /*----------------------------------------------------------------* - * Write IVAS transport channels - *----------------------------------------------------------------*/ - - if ( st_ivas->hDecoderConfig->Opt_tsm == 0 ) - { - /* directly copy to tc buffers */ - ivas_jbm_dec_copy_tc_no_tsm( st_ivas, p_output, output_frame ); - } - -#endif /*----------------------------------------------------------------* * Common updates *----------------------------------------------------------------*/ @@ -773,7 +746,6 @@ ivas_error ivas_jbm_dec_tc( return IVAS_ERR_OK; } -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS /*--------------------------------------------------------------------------* * ivas_dec_feed_tc_to_renderer() @@ -877,73 +849,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( return; } -#else - -/*--------------------------------------------------------------------------* - * ivas_jbm_dec_feed_tc_to_renderer() - * - * Feed decoded transport channels and metadata to the IVAS JBM renderer routine - *--------------------------------------------------------------------------*/ - -void ivas_jbm_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*/ - float *data /* i : transport channels */ -) -{ - float data_f[MAX_CLDFB_DIGEST_CHANNELS][MAX_JBM_L_FRAME48k]; /* 'float' buffer for transport channels that will be directly converted with the CLDFB */ - float *p_data_f[MAX_CLDFB_DIGEST_CHANNELS]; - int16_t n, n_render_timeslots; - - push_wmops( "ivas_jbm_dec_feed_tc_to_renderer" ); - for ( n = 0; n < MAX_CLDFB_DIGEST_CHANNELS; n++ ) - { - p_data_f[n] = &data_f[n][0]; - } - - if ( !st_ivas->hDecoderConfig->Opt_tsm ) - { - for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) - { - st_ivas->hTcBuffer->tc[n] = st_ivas->p_output_f[n]; /* note: buffers needed in the TD decorellator */ - } - } - - if ( st_ivas->hDecoderConfig->Opt_tsm ) - { - ivas_jbm_dec_copy_tc( st_ivas, nSamplesForRendering, nSamplesResidual, data, p_data_f ); - } - else - { - *nSamplesResidual = 0; - } - n_render_timeslots = st_ivas->hTcBuffer->n_samples_available / st_ivas->hTcBuffer->n_samples_granularity; - - if ( st_ivas->ivas_format == ISM_FORMAT ) - { - /* Rendering */ - if ( st_ivas->ism_mode == ISM_MODE_PARAM ) - { - if ( st_ivas->renderer_type == RENDERER_PARAM_ISM || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) - { - ivas_param_ism_dec_digest_tc( st_ivas, n_render_timeslots, p_data_f ); - } - } - } - else if ( st_ivas->ivas_format == MC_FORMAT ) - { - if ( st_ivas->mc_mode == MC_MODE_PARAMMC && st_ivas->hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_RENDERER ) - { - ivas_param_mc_dec_digest_tc( st_ivas, (uint8_t) n_render_timeslots, p_data_f ); - } - } - - pop_wmops(); - return; -} - -#endif /*--------------------------------------------------------------------------* * ivas_dec_render() @@ -969,9 +874,6 @@ ivas_error ivas_jbm_dec_render( ivas_error error; float *p_output[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; float *p_tc[MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS]; -#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS - SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; -#endif int16_t nchan_out_syn_output; push_wmops( "ivas_dec_render" ); @@ -979,9 +881,6 @@ ivas_error ivas_jbm_dec_render( * Initialization of local vars after struct has been set *----------------------------------------------------------------*/ -#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS - hSpatParamRendCom = st_ivas->hSpatParamRendCom; -#endif output_Fs = st_ivas->hDecoderConfig->output_Fs; nchan_out = st_ivas->hDecoderConfig->nchan_out; nchan_transport = st_ivas->hTcBuffer->nchan_transport_jbm; @@ -995,30 +894,16 @@ ivas_error ivas_jbm_dec_render( if ( !st_ivas->hDecoderConfig->Opt_tsm ) { -#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS - for ( n = 0; n < st_ivas->hTcBuffer->nchan_buffer_full; n++ ) - { - p_tc[n] = &p_output[n][st_ivas->hTcBuffer->n_samples_rendered]; - } - -#endif for ( n = 0; n < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; n++ ) { st_ivas->hTcBuffer->tc[n] = p_output[n]; } } -#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS - else - { -#endif - for ( n = 0; n < st_ivas->hTcBuffer->nchan_buffer_full; n++ ) - { - p_tc[n] = &st_ivas->hTcBuffer->tc[n][st_ivas->hTcBuffer->n_samples_rendered]; - } -#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS + for ( n = 0; n < st_ivas->hTcBuffer->nchan_buffer_full; n++ ) + { + p_tc[n] = &st_ivas->hTcBuffer->tc[n][st_ivas->hTcBuffer->n_samples_rendered]; } -#endif /*----------------------------------------------------------------* * Update combined orientation access index @@ -1094,11 +979,7 @@ ivas_error ivas_jbm_dec_render( #endif { /* Convert to Ambisonics */ -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS ivas_ism2sba_sf( p_tc, p_output, st_ivas->hIsmRendererData, st_ivas->nchan_transport, *nSamplesRendered, st_ivas->hTcBuffer->n_samples_rendered, st_ivas->hIntSetup.ambisonics_order ); -#else - ivas_ism2sba_sf( st_ivas->hTcBuffer->tc, p_output, st_ivas->hIsmRendererData, st_ivas->nchan_transport, *nSamplesRendered, st_ivas->hTcBuffer->n_samples_rendered, st_ivas->hIntSetup.ambisonics_order ); -#endif } /* Binaural rendering */ @@ -1236,11 +1117,7 @@ ivas_error ivas_jbm_dec_render( for ( n = 0; n < st_ivas->nchan_ism; n++ ) { -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS mvr2r( p_tc[n], p_output[n], *nSamplesRendered ); -#else - mvr2r( st_ivas->hTcBuffer->tc[n] + st_ivas->hTcBuffer->n_samples_rendered, p_output[n], *nSamplesRendered ); -#endif } } else @@ -1280,12 +1157,6 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->ivas_format == MC_FORMAT ) { -#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS - for ( n = 0; n < st_ivas->hTcBuffer->nchan_buffer_full; n++ ) - { - p_tc[n] = &st_ivas->hTcBuffer->tc[n][st_ivas->hTcBuffer->n_samples_rendered]; - } -#endif if ( st_ivas->mc_mode == MC_MODE_MCT ) { int16_t crendInPlaceRotation = FALSE; @@ -1379,9 +1250,6 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { -#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS - int16_t offset = hSpatParamRendCom->slots_rendered * hSpatParamRendCom->slot_size; -#endif 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 ) { @@ -1396,11 +1264,7 @@ ivas_error ivas_jbm_dec_render( /* we still need to copy the separate channel if available */ if ( st_ivas->hOutSetup.separateChannelEnabled ) { -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS mvr2r( p_tc[LFE_CHANNEL - 1], p_output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); -#else - mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, p_output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); -#endif } ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, *nSamplesRendered, st_ivas->hOutSetup.ambisonics_order, 0.f ); @@ -1421,22 +1285,12 @@ ivas_error ivas_jbm_dec_render( 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 ) ) { -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS mvr2r( p_tc[LFE_CHANNEL], p_output[LFE_CHANNEL], *nSamplesRendered ); mvr2r( p_tc[LFE_CHANNEL - 1], p_output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); -#else - mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL] + offset, p_output[LFE_CHANNEL], *nSamplesRendered ); - mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, p_output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); -#endif } else if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe == 0 ) { -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS mvr2r( p_tc[LFE_CHANNEL - 1], p_output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); -#else - /* Delay the separated channel to sync with the DirAC rendering */ - mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, p_output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); -#endif } } } @@ -2153,65 +2007,6 @@ int16_t ivas_jbm_dec_get_num_tc_channels( return num_tc; } -#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS -/*--------------------------------------------------------------------------* - * ivas_jbm_dec_copy_tc() - * - * Copy interleaved transport chnannels to the correct buffers, update the TC - * buffer handle - *--------------------------------------------------------------------------*/ - -static void ivas_jbm_dec_copy_tc( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const int16_t nSamplesForRendering, /* i : number of samples to digest */ - int16_t *nSamplesResidual, /* o : number of samples that will be left for the next frame */ - float *data, /* i : (interleaved) transport channel samples */ - float *tc_digest_f[] /* o : samples that will be directly digested (e.g. by CLDFB) */ -) -{ - int16_t ch; - DECODER_TC_BUFFER_HANDLE hTcBuffer; - int16_t n_samples_still_available, m; - int16_t n_ch_full_copy; - int16_t n_ch_res_copy; - - hTcBuffer = st_ivas->hTcBuffer; - n_samples_still_available = hTcBuffer->n_samples_buffered - hTcBuffer->n_samples_rendered; - 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; - - for ( ch = 0; ch < n_ch_full_copy; ch++ ) - { - set_zero( hTcBuffer->tc[ch], hTcBuffer->n_samples_discard ); - mvr2r( hTcBuffer->tc[ch] + hTcBuffer->n_samples_rendered, hTcBuffer->tc[ch] + hTcBuffer->n_samples_discard, n_samples_still_available ); - for ( m = 0; m < nSamplesForRendering; m++ ) - { - hTcBuffer->tc[ch][n_samples_still_available + hTcBuffer->n_samples_discard + m] = data[m * st_ivas->hTcBuffer->nchan_transport_jbm + ch]; - } - } - - if ( n_ch_res_copy > 0 ) - { - for ( ; ch < hTcBuffer->nchan_transport_jbm; ch++ ) - { - mvr2r( hTcBuffer->tc[ch], tc_digest_f[ch], n_samples_still_available ); - for ( m = 0; m < nSamplesForRendering; m++ ) - { - tc_digest_f[ch][n_samples_still_available + m] = data[m * st_ivas->hTcBuffer->nchan_transport_jbm + ch]; - } - mvr2r( tc_digest_f[ch] + hTcBuffer->n_samples_available, hTcBuffer->tc[ch], *nSamplesResidual ); - } - } - - hTcBuffer->n_samples_rendered = 0; - hTcBuffer->subframes_rendered = 0; - - return; -} -#endif /*--------------------------------------------------------------------------* * ivas_jbm_dec_get_render_granularity() @@ -2709,80 +2504,6 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( return buffer_mode; } -#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS -/*--------------------------------------------------------------------------* - * ivas_jbm_dec_copy_tc_no_tsm() - * - * - *--------------------------------------------------------------------------*/ - -void ivas_jbm_dec_copy_tc_no_tsm( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - float *tc[], /* i : transport channels */ - const int16_t output_frame /* i : output frame size */ -) -{ - int16_t n_ch_cldfb; - int16_t ch_idx; - DECODER_TC_BUFFER_HANDLE hTcBuffer; - - hTcBuffer = st_ivas->hTcBuffer; - hTcBuffer->n_samples_buffered = output_frame; - hTcBuffer->n_samples_available = hTcBuffer->n_samples_buffered; - n_ch_cldfb = hTcBuffer->nchan_transport_jbm - hTcBuffer->nchan_buffer_full; - -#ifdef DEBUGGING - assert( st_ivas->hDecoderConfig->Opt_tsm == 0 ); -#endif - /* CLDFB ana for ParamMC/ParamISM */ - if ( n_ch_cldfb > 0 ) - { - float *cldfb_real_buffer; - float *cldfb_imag_buffer; - int16_t cldfb_ch, slot_idx, num_freq_bands; - - cldfb_real_buffer = NULL; - cldfb_imag_buffer = NULL; - num_freq_bands = 0; - - if ( st_ivas->ivas_format == ISM_FORMAT ) - { - cldfb_real_buffer = st_ivas->hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc; - cldfb_imag_buffer = st_ivas->hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc; - num_freq_bands = st_ivas->hSpatParamRendCom->num_freq_bands; - ivas_ism_param_dec_tc_gain_ajust( st_ivas, output_frame, output_frame / 2, tc ); - } - else if ( st_ivas->ivas_format == MC_FORMAT ) - { - cldfb_real_buffer = st_ivas->hParamMC->Cldfb_RealBuffer_tc; - cldfb_imag_buffer = st_ivas->hParamMC->Cldfb_ImagBuffer_tc; - num_freq_bands = st_ivas->hParamMC->num_freq_bands; - } -#ifdef DEBUGGING - else - { - assert( 0 && "Residual (direct CLDFB transport channels) only possible for ParamMC/ParamISM!" ); - } -#endif - - /* CLDFB Analysis*/ - for ( ch_idx = 0, cldfb_ch = 0; cldfb_ch < n_ch_cldfb; cldfb_ch++, ch_idx++ ) - { - for ( slot_idx = 0; slot_idx < DEFAULT_JBM_CLDFB_TIMESLOTS; slot_idx++ ) - { - cldfbAnalysis_ts( &( tc[ch_idx][num_freq_bands * slot_idx] ), - &cldfb_real_buffer[slot_idx * num_freq_bands * n_ch_cldfb + cldfb_ch * num_freq_bands], - &cldfb_imag_buffer[slot_idx * num_freq_bands * n_ch_cldfb + cldfb_ch * num_freq_bands], - num_freq_bands, st_ivas->cldfbAnaDec[cldfb_ch] ); - } - } - } - hTcBuffer->n_samples_rendered = 0; - hTcBuffer->subframes_rendered = 0; - - return; -} -#endif /*--------------------------------------------------------------------------* * ivas_jbm_dec_metadata_open() @@ -2872,10 +2593,8 @@ static void ivas_jbm_masa_sf_to_slot_map( int16_t slot_idx; int16_t write_idx, sf_index; -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); -#endif /* Set values */ hJbmMetadata = st_ivas->hJbmMetadata; num_slots_in_subfr = CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES; diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 643781bfccf630d912ba540ad8ae61aac41fd294..2bf96ca0342b3abbbac647a9b5811b2016fed073 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1330,30 +1330,16 @@ void ivas_param_mc_dec_digest_tc( float *p_data_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ ) { -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS int16_t ch, num_freq_bands, slot_idx, cldfb_ch, n_ch_cldfb; float *cldfb_real_buffer, *cldfb_imag_buffer; -#else - PARAM_MC_DEC_HANDLE hParamMC; - int16_t ch, slot_idx; - int16_t nchan_transport; -#endif /* Initialization */ -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS num_freq_bands = st_ivas->hParamMC->num_freq_bands; n_ch_cldfb = st_ivas->hTcBuffer->nchan_transport_jbm - st_ivas->hTcBuffer->nchan_buffer_full; cldfb_real_buffer = st_ivas->hParamMC->Cldfb_RealBuffer_tc; cldfb_imag_buffer = st_ivas->hParamMC->Cldfb_ImagBuffer_tc; -#else - hParamMC = st_ivas->hParamMC; - assert( hParamMC ); - nchan_transport = st_ivas->nchan_transport; -#endif - -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS /* CLDFB Analysis */ for ( ch = 0, cldfb_ch = 0; cldfb_ch < n_ch_cldfb; cldfb_ch++, ch++ ) { @@ -1365,26 +1351,6 @@ void ivas_param_mc_dec_digest_tc( num_freq_bands, st_ivas->cldfbAnaDec[cldfb_ch] ); } } -#else - /* slot loop for gathering the input data */ - for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) - { - if ( st_ivas->hDecoderConfig->Opt_tsm ) - { - float RealBuffer[CLDFB_NO_CHANNELS_MAX]; - float ImagBuffer[CLDFB_NO_CHANNELS_MAX]; - - /* CLDFB Analysis*/ - for ( ch = 0; ch < nchan_transport; ch++ ) - { - cldfbAnalysis_ts( &( p_data_f[ch][hParamMC->num_freq_bands * slot_idx] ), RealBuffer, ImagBuffer, hParamMC->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); - - mvr2r( RealBuffer, &hParamMC->Cldfb_RealBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); - mvr2r( ImagBuffer, &hParamMC->Cldfb_ImagBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); - } - } - } -#endif return; } diff --git a/lib_dec/ivas_sba_rendering_internal.c b/lib_dec/ivas_sba_rendering_internal.c index 1aece93bb9febcd24cba7498d47ed39f221da904..8538411328524c0103695b93bfd5af13ef2d1ba1 100644 --- a/lib_dec/ivas_sba_rendering_internal.c +++ b/lib_dec/ivas_sba_rendering_internal.c @@ -376,11 +376,7 @@ void ivas_ism2sba_sf( for ( j = 0; j < sba_num_chans; j++ ) { g2 = hIsmRendererData->interpolator + offset; -#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS tc = buffer_in[i]; -#else - tc = buffer_in[i] + offset; -#endif out = buffer_tmp[j]; gain = hIsmRendererData->gains[i][j]; prev_gain = hIsmRendererData->prev_gains[i][j]; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index ae919c218419e91fa4fe1ef50415d986b270e484..3c9ffad205707f9737b452d689538d61e049e0ee 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -4271,12 +4271,6 @@ static ivas_error evs_dec_main( mvs2r( pcm_buf_local, p_output[ch], nOutSamples ); } } -#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS - else // ToDo: the 'else' branch can be removed once UNIFIED_DECODING_PATHS_LEFTOVERS is merged - { - ivas_jbm_dec_copy_tc_no_tsm( st_ivas, p_output, nOutSamples ); - } -#endif return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index df7c0d7a63e09e6ac5cac9061229e44767682a53..ed4fb71c423b538609cc173125c6ff82fdf56933 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -437,9 +437,7 @@ ivas_error TDREND_GetMix( float hrf_left_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; float hrf_right_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; int16_t intp_count; -#ifdef NONBE_1300_TDREND_LARGE_ITD int16_t currShift, prevShift, transition_len, length_in2; -#endif error = IVAS_ERR_OK; @@ -465,7 +463,7 @@ ivas_error TDREND_GetMix( { TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev, Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p ); -#ifdef NONBE_1300_TDREND_LARGE_ITD + /* For large ITD values at lower sampling rate, check if the transition can be done */ if ( Src_p->itd * Src_p->previtd < 0 ) { @@ -479,7 +477,6 @@ ivas_error TDREND_GetMix( Src_p->itd = 0; } } -#endif } /* Render source if needed */