diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 10573daf8a533f5884818c1bfaa42d1fac92bb37..aa456627a47f35e9cb563547b4928b9ed0f62ae7 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -259,37 +259,19 @@ uint32_t ivas_syn_output( int16_t *synth_out /* o : integer 16 bits synthesis signal */ ); -#ifdef FIX_BASOP_2396_CONSTANT_STRIDE_IN_TC_BUFFER void ivas_buffer_interleaved_to_deinterleaved( float *audio_in, /* i : interleaved audio buffer */ float *audio_out[], /* o : pointers to each channel of deinterleaved audio buffer */ const int16_t n_channels, /* i : number of channels */ const int16_t frame_length /* i : frame length (one channel) */ ); -#else -void ivas_buffer_interleaved_to_deinterleaved( - float *audio, /* i/o: audio buffer */ - const int16_t n_channels, /* i : number of channels */ - const int16_t frame_length, /* i : frame length (one channel) */ - const int16_t n_samp_full /* i : full frame length (one channel) */ -); -#endif -#ifdef FIX_BASOP_2396_CONSTANT_STRIDE_IN_TC_BUFFER void ivas_buffer_deinterleaved_to_interleaved( float *audio_in[], /* i : pointers to each channel of deinterleaved audio buffer */ float *audio_out, /* o : interleaved audio buffer */ const int16_t n_channels, /* i : number of channels */ const int16_t frame_length /* i : frame length (one channel) */ ); -#else -void ivas_buffer_deinterleaved_to_interleaved( - float *audio[], /* i : deinterleaved audio buffer */ - const int16_t n_channels, /* i : number of channels */ - const int16_t frame_length, /* i : frame length (one channel) */ - float *audio_out /* o : interleaved audio buffer */ -); -#endif void ivas_initialize_handles_enc( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ diff --git a/lib_com/ivas_tools.c b/lib_com/ivas_tools.c index 484503defa9e77a3d267e63e7f5ea8265bc2f1d0..c5f195804a36b1a5346c7b8599ce6089892bfea2 100644 --- a/lib_com/ivas_tools.c +++ b/lib_com/ivas_tools.c @@ -155,7 +155,6 @@ uint32_t ivas_syn_output( * Convert an interleaved buffer of audio channels to deinterleaved one *-------------------------------------------------------------------*/ -#ifdef FIX_BASOP_2396_CONSTANT_STRIDE_IN_TC_BUFFER void ivas_buffer_interleaved_to_deinterleaved( float *audio_in, /* i : interleaved audio buffer */ float *audio_out[], /* o : pointers to each channel of deinterleaved audio buffer */ @@ -184,35 +183,6 @@ void ivas_buffer_interleaved_to_deinterleaved( return; } -#else -void ivas_buffer_interleaved_to_deinterleaved( - float *audio, /* i/o: audio buffer */ - const int16_t n_channels, /* i : number of channels */ - const int16_t frame_length, /* i : frame length (one channel) */ - const int16_t n_samp_full /* i : full frame length (one channel) */ -) -{ - int16_t offset, ch, m; - float buffer[MAX_TRANSPORT_CHANNELS][MAX_JBM_L_FRAME48k]; - - for ( ch = 0; ch < n_channels; ch++ ) - { - for ( m = 0; m < frame_length; m++ ) - { - buffer[ch][m] = audio[m * n_channels + ch]; - } - } - - offset = 0; - for ( ch = 0; ch < n_channels; ch++ ) - { - mvr2r( buffer[ch], audio + offset, frame_length ); - offset += n_samp_full; - } - - return; -} -#endif /*-------------------------------------------------------------------* * ivas_buffer_deinterleaved_to_interleaved() @@ -220,7 +190,6 @@ void ivas_buffer_interleaved_to_deinterleaved( * Convert a deinterleaved buffer of audio channels to interleaved one *-------------------------------------------------------------------*/ -#ifdef FIX_BASOP_2396_CONSTANT_STRIDE_IN_TC_BUFFER void ivas_buffer_deinterleaved_to_interleaved( float *audio_in[], /* i : pointers to each channel of deinterleaved audio buffer */ float *audio_out, /* o : interleaved audio buffer */ @@ -249,33 +218,6 @@ void ivas_buffer_deinterleaved_to_interleaved( return; } -#else -void ivas_buffer_deinterleaved_to_interleaved( - float *audio[], /* i/o: deinterleaved audio buffer */ - const int16_t n_channels, /* i : number of channels */ - const int16_t frame_length, /* i : frame length (one channel) */ - float *audio_out /* o : interleaved audio buffer */ -) -{ - int16_t ch, m; - float buffer[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; /* temp buffer needed when "*audio[]" and "*audio_out[]" are the same */ - - for ( ch = 0; ch < n_channels; ch++ ) - { - mvr2r( audio[ch], buffer[ch], frame_length ); - } - - for ( ch = 0; ch < n_channels; ch++ ) - { - for ( m = 0; m < frame_length; m++ ) - { - audio_out[m * n_channels + ch] = buffer[ch][m]; - } - } - - return; -} -#endif /*-------------------------------------------------------------------* diff --git a/lib_com/options.h b/lib_com/options.h index 73697d566ff5f77b879c152104941689b472ce26..c289efb2a450fd8ed53b05d12d676806b03802fc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,15 +161,13 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #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 FIX_2392_MSAN_DESTROY_DEC /* VA: basop issue 2392: fix MSAN in ivas_destroy_dec_fx() */ #define FIX_FLOAT_1522_LTV_MSAN_QMETADATA_ENC_EC3 /* Nokia: float issue 1522: fix uninit MSAN in EC3 of qmetadata encoding */ /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ /* any switch which is non-be wrt. TS 26.258 V3.0 */ -#define FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION /* Dolby: issue 1465: Fix constant in create_random_vector() to allow more reliable fixed point port */ -#define FIX_BASOP_2396_CONSTANT_STRIDE_IN_TC_BUFFER /* FhG/VA: basop issue 2396: keep TC channel pointers in one constant place during decoding and rendering */ + /* ##################### End NON-BE switches ########################### */ /* ################## End MAINTENANCE switches ######################### */ diff --git a/lib_com/prot.h b/lib_com/prot.h index b47e2592111fc59c148496fad64460b57453c218..1c16749be86e90e739dcc7e50d5373395ad55b5d 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -2685,13 +2685,11 @@ void GenShapedWBExcitation( float *mem_genSHBexc_filt_down3, /* i/o: memory */ float *state_lpc_syn, /* i/o: memory */ const int16_t coder_type, /* i : coding type */ -#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION - const int16_t element_mode, /* i : element mode */ -#endif - const float *bwe_exc_extended, /* i : bandwidth extended exciatation */ - int16_t bwe_seed[], /* i/o: random number generator seed */ - const float voice_factors[], /* i : voicing factor */ - const int16_t uv_flag, /* i : unvoiced flag */ + const int16_t element_mode, /* i : element mode */ + const float *bwe_exc_extended, /* i : bandwidth extended exciatation */ + int16_t bwe_seed[], /* i/o: random number generator seed */ + const float voice_factors[], /* i : voicing factor */ + const int16_t uv_flag, /* i : unvoiced flag */ const int16_t igf_flag ); void GenWBSynth( diff --git a/lib_com/swb_tbe_com.c b/lib_com/swb_tbe_com.c index d83c5e17fb97d38622c911404376bdfc822d8a17..180cc0d0c1ee7f187d6f5892b350e7b01a328d9a 100644 --- a/lib_com/swb_tbe_com.c +++ b/lib_com/swb_tbe_com.c @@ -54,11 +54,7 @@ * Local function prototypes *-----------------------------------------------------------------*/ -#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION static void create_random_vector( float output[], const int16_t length, int16_t seed[], const int16_t element_mode ); -#else -static void create_random_vector( float output[], const int16_t length, int16_t seed[] ); -#endif static void flip_spectrum( const float input[], float output[], const int16_t length ); static void Hilbert_transform( float tmp_R[], float tmp_I[], float *tmpi_R, float *tmpi_I, const int16_t length, const int16_t HB_stage_id ); static void Estimate_mix_factors( const float *shb_res, const float *exc16kWhtnd, const float *White_exc16k, const float pow1, const float pow22, float *vf_modified, int16_t *vf_ind ); @@ -370,13 +366,11 @@ void GenShapedWBExcitation( float *mem_genSHBexc_filt_down3, /* i/o: memory */ float *state_lpc_syn, /* i/o: memory */ const int16_t coder_type, /* i : coding type */ -#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION - const int16_t element_mode, /* i : element mode */ -#endif - const float *bwe_exc_extended, /* i : bandwidth extended exciatation */ - int16_t bwe_seed[], /* i/o: random number generator seed */ - const float voice_factors[], /* i : voicing factor */ - const int16_t uv_flag, /* i : unvoiced flag */ + const int16_t element_mode, /* i : element mode */ + const float *bwe_exc_extended, /* i : bandwidth extended exciatation */ + int16_t bwe_seed[], /* i/o: random number generator seed */ + const float voice_factors[], /* i : voicing factor */ + const int16_t uv_flag, /* i : unvoiced flag */ const int16_t igf_flag ) { int16_t i, j, k; @@ -414,11 +408,7 @@ void GenShapedWBExcitation( if ( uv_flag ) { /* unvoiced signal */ -#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION create_random_vector( exc4kWhtnd, L_FRAME16k / 4, bwe_seed, element_mode ); -#else - create_random_vector( exc4kWhtnd, L_FRAME16k / 4, bwe_seed ); -#endif } else { @@ -447,11 +437,7 @@ void GenShapedWBExcitation( *mem_csfilt = -csfilt_den2[1] * excNoisyEnv[i]; } -#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION create_random_vector( exc4k, L_FRAME16k / 4, bwe_seed, element_mode ); -#else - create_random_vector( exc4k, L_FRAME16k / 4, bwe_seed ); -#endif /* Ensure pow22 is greater than zero when computing normalization */ for ( i = 0, pow22 = 0.00001f; i < L_FRAME16k / 4; i++ ) @@ -905,13 +891,8 @@ void GenShapedSHBExcitation( } else { -#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION create_random_vector( White_exc16k, L_FRAME, bwe_seed, element_mode ); create_random_vector( White_exc16k + L_FRAME, L_FRAME16k - L_FRAME, bwe_seed, element_mode ); -#else - create_random_vector( White_exc16k, L_FRAME, bwe_seed ); - create_random_vector( White_exc16k + L_FRAME, L_FRAME16k - L_FRAME, bwe_seed ); -#endif for ( k = 0, pow22 = 0.00001f; k < L_FRAME16k; k++ ) { @@ -1555,22 +1536,15 @@ void non_linearity( * -------------------------------------------------------------------*/ void create_random_vector( -#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION float output[], /* o : output random vector */ const int16_t length, /* i : length of random vector */ int16_t seed[], /* i/o: start seed */ const int16_t element_mode /* i : element mode */ -#else - float output[], /* o : output random vector */ - const int16_t length, /* i : length of random vector */ - int16_t seed[] /* i/o: start seed */ -#endif ) { int16_t i, j, k; float scale1, scale2; -#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION if ( element_mode != EVS_MONO ) { j = (int16_t) ( own_random( &seed[0] ) * 0.0078125f ); @@ -1585,16 +1559,9 @@ void create_random_vector( k = (int16_t) ( own_random( &seed[1] ) * 0.0078f ); k = abs( k ) & 0xff; } -#else - j = (int16_t) ( own_random( &seed[0] ) * 0.0078f ); - j = abs( j ) & 0xff; - k = (int16_t) ( own_random( &seed[1] ) * 0.0078f ); - k = abs( k ) & 0xff; -#endif while ( k == j ) { -#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION if ( element_mode != EVS_MONO ) { k = (int16_t) ( own_random( &seed[1] ) * 0.0078125f ); @@ -1605,10 +1572,6 @@ void create_random_vector( k = (int16_t) ( own_random( &seed[1] ) * 0.0078f ); k = abs( k ) & 0xff; } -#else - k = (int16_t) ( own_random( &seed[1] ) * 0.0078f ); - k = abs( k ) & 0xff; -#endif } if ( own_random( &seed[0] ) < 0 ) diff --git a/lib_dec/ivas_dec_render.c b/lib_dec/ivas_dec_render.c index a5cbed9fab629331d725809ad393fb59c06fa848..cfef84e48c96dab97891d441d11123fb85564f47 100644 --- a/lib_dec/ivas_dec_render.c +++ b/lib_dec/ivas_dec_render.c @@ -73,12 +73,7 @@ void ivas_dec_feed_tc_to_renderer( { float tmp_buf[MAX_JBM_L_FRAME48k]; float *p_data_f[FOA_CHANNELS + MAX_NUM_OBJECTS]; -#ifdef FIX_BASOP_2396_CONSTANT_STRIDE_IN_TC_BUFFER int16_t n, n_render_timeslots, n_ch_cldfb, ch; -#else - int16_t n, n_render_timeslots, n_ch_cldfb; - int16_t ch, offset, len_offset; -#endif DECODER_TC_BUFFER_HANDLE hTcBuffer; hTcBuffer = st_ivas->hTcBuffer; @@ -96,23 +91,6 @@ void ivas_dec_feed_tc_to_renderer( 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; -#ifndef FIX_BASOP_2396_CONSTANT_STRIDE_IN_TC_BUFFER - /* buffers are shared between 'hTcBuffer->tc[]' and 'p_output_f[]': - 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_rend, hTcBuffer->nchan_buffer_full ); ch++ ) - { - hTcBuffer->tc[ch] = &hTcBuffer->tc_buffer[offset]; - st_ivas->p_output_f[ch] = hTcBuffer->tc[ch]; - offset += len_offset; - } - } - -#endif for ( ch = 0; ch < n_ch_full_copy; ch++ ) { mvr2r( hTcBuffer->tc[ch], tmp_buf, nSamplesForRendering ); @@ -682,11 +660,7 @@ ivas_error ivas_dec_render( break; case PCM_FLOAT32: -#ifdef FIX_BASOP_2396_CONSTANT_STRIDE_IN_TC_BUFFER ivas_buffer_deinterleaved_to_interleaved( p_output, (float *) data, nchan_out_syn_output, *nSamplesRendered ); -#else - ivas_buffer_deinterleaved_to_interleaved( p_output, nchan_out_syn_output, *nSamplesRendered, (float *) data ); -#endif break; default: error = IVAS_ERR_UNKNOWN; @@ -988,11 +962,7 @@ ivas_error ivas_jbm_dec_flush_renderer( ivas_syn_output( p_output, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, (int16_t *) data ); break; case PCM_FLOAT32: -#ifdef FIX_BASOP_2396_CONSTANT_STRIDE_IN_TC_BUFFER ivas_buffer_deinterleaved_to_interleaved( p_output, (float *) data, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered ); -#else - ivas_buffer_deinterleaved_to_interleaved( p_output, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, (float *) data ); -#endif break; default: error = IVAS_ERR_UNKNOWN; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 035f6b86be63a917218a0e1addda525f3bd08c58..0afec7310f1d418fba7b53751caff22a671d131a 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -298,9 +298,7 @@ static void init_decoder_config( ) { hDecoderConfig->Opt_AMR_WB = 0; -#ifdef FIX_2392_MSAN_DESTROY_DEC hDecoderConfig->output_Fs = -1; -#endif hDecoderConfig->nchan_out = 1; hDecoderConfig->output_config = IVAS_AUDIO_CONFIG_INVALID; hDecoderConfig->Opt_LsCustom = 0; @@ -1206,11 +1204,7 @@ ivas_error IVAS_DEC_GetSamplesDecoder( } /* convert deinterleaved decoded TC audio channels buffer to an interleaved one */ -#ifdef FIX_BASOP_2396_CONSTANT_STRIDE_IN_TC_BUFFER ivas_buffer_deinterleaved_to_interleaved( st_ivas->p_output_f, st_ivas->hTcBuffer->tc_buffer, nTransportChannels, hIvasDec->nSamplesFrame ); -#else - ivas_buffer_deinterleaved_to_interleaved( st_ivas->p_output_f, nTransportChannels, hIvasDec->nSamplesFrame, st_ivas->hTcBuffer->tc_buffer ); -#endif /* time-scale modification */ if ( apa_exec( hIvasDec->hTimeScaler, st_ivas->hTcBuffer->tc_buffer, hIvasDec->nSamplesFrame * nTransportChannels, (uint16_t) hIvasDec->tsm_max_scaling, st_ivas->hTcBuffer->tc_buffer, &nTimeScalerOutSamples ) != 0 ) @@ -1223,11 +1217,7 @@ ivas_error IVAS_DEC_GetSamplesDecoder( hIvasDec->timeScalingDone = 1; /* convert interleaved time-scaled TC audio channels buffer to deinterleaved one */ -#ifdef FIX_BASOP_2396_CONSTANT_STRIDE_IN_TC_BUFFER ivas_buffer_interleaved_to_deinterleaved( st_ivas->hTcBuffer->tc_buffer, st_ivas->p_output_f, nTransportChannels, nSamplesTcsScaled ); -#else - ivas_buffer_interleaved_to_deinterleaved( st_ivas->hTcBuffer->tc_buffer, nTransportChannels, nSamplesTcsScaled, NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) ); -#endif } else { diff --git a/lib_dec/swb_tbe_dec.c b/lib_dec/swb_tbe_dec.c index 67a1e8013f5f56edd35eafc84accea61cac85c32..ad4eb78a66c37b922b606a96da017f74a3aa0c54 100644 --- a/lib_dec/swb_tbe_dec.c +++ b/lib_dec/swb_tbe_dec.c @@ -323,11 +323,7 @@ void wb_tbe_dec( /* From low band excitation, generate highband excitation */ mvr2r( hBWE_TD->state_syn_shbexc, shaped_wb_excitation, L_SHB_LAHEAD / 4 ); -#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION GenShapedWBExcitation( shaped_wb_excitation + L_SHB_LAHEAD / 4, lpc_wb, exc4kWhtnd, hBWE_TD->mem_csfilt, hBWE_TD->mem_genSHBexc_filt_down_shb, hBWE_TD->mem_genSHBexc_filt_down_wb2, hBWE_TD->mem_genSHBexc_filt_down_wb3, hBWE_TD->state_lpc_syn, st->coder_type, st->element_mode, bwe_exc_extended, hBWE_TD->bwe_seed, vf_modified, uv_flag, st->igf ); -#else - GenShapedWBExcitation( shaped_wb_excitation + L_SHB_LAHEAD / 4, lpc_wb, exc4kWhtnd, hBWE_TD->mem_csfilt, hBWE_TD->mem_genSHBexc_filt_down_shb, hBWE_TD->mem_genSHBexc_filt_down_wb2, hBWE_TD->mem_genSHBexc_filt_down_wb3, hBWE_TD->state_lpc_syn, st->coder_type, bwe_exc_extended, hBWE_TD->bwe_seed, vf_modified, uv_flag, st->igf ); -#endif prev_pow = sum2_f( shaped_wb_excitation, L_SHB_LAHEAD / 4 ); curr_pow = sum2_f( shaped_wb_excitation + L_SHB_LAHEAD / 4, L_SHB_LAHEAD / 4 ); diff --git a/lib_enc/swb_tbe_enc.c b/lib_enc/swb_tbe_enc.c index 9ada8d3f2e81d9f0c7e64c55137aa919d9b90781..655d16bbeddcd3bea0193ea4fad70f64125e46e0 100644 --- a/lib_enc/swb_tbe_enc.c +++ b/lib_enc/swb_tbe_enc.c @@ -378,11 +378,7 @@ void wb_tbe_enc( /* From low band excitation, generate highband excitation */ mvr2r( hBWE_TD->state_syn_shbexc, shaped_wb_excitation, L_SHB_LAHEAD / 4 ); -#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION GenShapedWBExcitation( shaped_wb_excitation + L_SHB_LAHEAD / 4, lpc_wb, exc4kWhtnd, hBWE_TD->mem_csfilt, hBWE_TD->mem_genSHBexc_filt_down_shb, hBWE_TD->mem_genSHBexc_filt_down_wb2, hBWE_TD->mem_genSHBexc_filt_down_wb3, hBWE_TD->state_lpc_syn, st->coder_type, st->element_mode, bwe_exc_extended, hBWE_TD->bwe_seed, vf_modified, uv_flag, st->igf ); -#else - GenShapedWBExcitation( shaped_wb_excitation + L_SHB_LAHEAD / 4, lpc_wb, exc4kWhtnd, hBWE_TD->mem_csfilt, hBWE_TD->mem_genSHBexc_filt_down_shb, hBWE_TD->mem_genSHBexc_filt_down_wb2, hBWE_TD->mem_genSHBexc_filt_down_wb3, hBWE_TD->state_lpc_syn, st->coder_type, bwe_exc_extended, hBWE_TD->bwe_seed, vf_modified, uv_flag, st->igf ); -#endif prev_pow = sum2_f( shaped_wb_excitation, L_SHB_LAHEAD / 4 ); curr_pow = sum2_f( shaped_wb_excitation + L_SHB_LAHEAD / 4, L_SHB_LAHEAD / 4 );