From a17d84878abda2e6cf917b0253426d04d75da833 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 28 Aug 2024 20:43:34 +0530 Subject: [PATCH] Precision improvements to reduce high MLD issues [x] Changes made in deindex_sph_idx_fx and ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx to improve precision [x] Improved precision for hStereoDft->smooth_res_nrg_fx and hStereoDft->smooth_dmx_nrg_fx buffers [x] Added checks to prevent saturation for the buffers hHQ_core->old_out_fx and hHQ_core->old_out_LB_fx --- lib_com/ivas_masa_com.c | 265 ++++++++++++++++++++- lib_dec/ivas_core_dec.c | 12 - lib_dec/ivas_mct_dec.c | 9 - lib_dec/ivas_mdct_core_dec.c | 11 +- lib_dec/ivas_stereo_dft_dec_fx.c | 74 ++++-- lib_dec/ivas_stereo_icbwe_dec.c | 2 +- lib_dec/lib_dec_fx.c | 181 +++++++------- lib_rend/ivas_dirac_output_synthesis_dec.c | 161 ++++++++++--- 8 files changed, 519 insertions(+), 196 deletions(-) diff --git a/lib_com/ivas_masa_com.c b/lib_com/ivas_masa_com.c index a1efc805b..5d91190bb 100644 --- a/lib_com/ivas_masa_com.c +++ b/lib_com/ivas_masa_com.c @@ -66,6 +66,258 @@ static int16_t quantize_phi_masa( float phi, const int16_t flag_delta, float *ph static Word16 quantize_theta_masa_fx( const Word32 x_fx, const Word16 no_cb, Word32 *xhat_fx ); static Word16 quantize_phi_masa_fx( const Word32 phi, const Word16 flag_delta, Word32 *phi_hat, const Word16 n ); + +static Word32 estim_round[MASA_NO_CIRCLES + 1] = { + /* Q0 */ + -423, + 0, + 422, + 845, + 1267, + 1689, + 2111, + 2532, + 2953, + 3373, + 3793, + 4212, + 4630, + 5047, + 5464, + 5880, + 6294, + 6708, + 7120, + 7532, + 7941, + 8350, + 8757, + 9163, + 9567, + 9969, + 10370, + 10769, + 11166, + 11561, + 11955, + 12346, + 12735, + 13122, + 13507, + 13890, + 14270, + 14648, + 15023, + 15396, + 15766, + 16134, + 16499, + 16861, + 17220, + 17576, + 17930, + 18280, + 18627, + 18971, + 19312, + 19650, + 19984, + 20315, + 20643, + 20967, + 21288, + 21605, + 21918, + 22228, + 22534, + 22836, + 23135, + 23429, + 23720, + 24007, + 24289, + 24568, + 24842, + 25112, + 25378, + 25640, + 25898, + 26151, + 26400, + 26644, + 26884, + 27119, + 27350, + 27576, + 27798, + 28015, + 28227, + 28435, + 28637, + 28835, + 29029, + 29217, + 29400, + 29579, + 29752, + 29921, + 30084, + 30243, + 30396, + 30544, + 30688, + 30826, + 30959, + 31086, + 31209, + 31326, + 31438, + 31545, + 31647, + 31743, + 31834, + 31919, + 32000, + 32075, + 32144, + 32208, + 32267, + 32320, + 32368, + 32411, + 32448, + 32480, + 32506, + 32527, + 32542, + 32552 +}; + +static Word32 estim_ceil[MASA_NO_CIRCLES + 1] = { + /* Q0 */ + -422, + 0, + 423, + 845, + 1268, + 1690, + 2111, + 2532, + 2953, + 3374, + 3793, + 4212, + 4630, + 5048, + 5465, + 5880, + 6295, + 6708, + 7121, + 7532, + 7942, + 8350, + 8758, + 9163, + 9567, + 9970, + 10371, + 10770, + 11167, + 11562, + 11955, + 12347, + 12736, + 13123, + 13508, + 13890, + 14270, + 14648, + 15024, + 15396, + 15767, + 16134, + 16499, + 16861, + 17220, + 17577, + 17930, + 18280, + 18628, + 18972, + 19313, + 19650, + 19985, + 20316, + 20644, + 20968, + 21288, + 21605, + 21919, + 22229, + 22535, + 22837, + 23135, + 23430, + 23720, + 24007, + 24290, + 24568, + 24843, + 25113, + 25379, + 25641, + 25898, + 26151, + 26400, + 26644, + 26884, + 27120, + 27350, + 27577, + 27798, + 28015, + 28228, + 28435, + 28638, + 28836, + 29029, + 29217, + 29401, + 29579, + 29753, + 29921, + 30085, + 30243, + 30397, + 30545, + 30688, + 30826, + 30959, + 31087, + 31210, + 31327, + 31439, + 31546, + 31647, + 31743, + 31834, + 31920, + 32000, + 32075, + 32145, + 32209, + 32268, + 32321, + 32369, + 32411, + 32449, + 32480, + 32506, + 32527, + 32543, + 32552 +}; #endif @@ -1564,26 +1816,17 @@ void deindex_sph_idx_fx( } ELSE { - estim_fx = Mpy_32_32( MASA_ANGLE_AT_EQUATOR_Q31, L_sub( L_shl( id_th, Q22 ), 2097152 ) /* 0.5f in Q22 */ ); /* Q22 */ base_low = n[0]; move32(); IF( GE_16( id_th, 2 ) ) { - tmp32 = estim_fx % 26353590; /* 2 * PI in Q22 */ - tmp32 = Mpy_32_32( tmp32, 341782638 /* 2147483647 / 2 * PI */ ); /* Q7 */ - tmp16 = extract_l( L_shr( tmp32, Q7 ) ); - - tmp16 = getSineWord16R2( tmp16 ); - tmp16 = sub( tmp16, MASA_ASIN_OFFSET_Q15 ); - tmp32 = Mpy_32_16_1( MASA_NTOT2_FAC_Q15, tmp16 ); /* Q15 */ - IF( EQ_16( id_th, 2 ) ) { - base_low = L_add( base_low, L_shl( extract_l( L_shr( ceil_fixed( tmp32, Q15 ), Q15 ) ), 1 ) ); /* Q0 */ + base_low = L_add( base_low, L_shl( estim_ceil[id_th], 1 ) ); /* Q0 */ } ELSE { - base_low = L_add( base_low, L_shl( extract_l( L_shr_r( tmp32, Q15 ) ), 1 ) ); /* Q0 */ + base_low = L_add( base_low, L_shl( estim_round[id_th], 1 ) ); /* Q0 */ } } base_up = L_add( base_low, L_shl( n[id_th], 1 ) ); diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 4948c487b..0a3da565c 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -758,9 +758,6 @@ ivas_error ivas_core_dec_fx( st->prev_Q_syn = st->Q_syn; move16(); - Scale_sig( st->hHQ_core->old_out_LB_fx, L_FRAME32k, sub( st->Q_syn, st->hHQ_core->Q_old_wtda_LB ) ); - Scale_sig( st->hHQ_core->old_out_fx, L_FRAME48k, sub( st->Q_syn, st->hHQ_core->Q_old_wtda ) ); - IF( st->hTcxDec ) { st->hTcxDec->conNoiseLevelIndex = st->hTcxDec->NoiseLevelIndex_bfi; @@ -774,15 +771,6 @@ ivas_error ivas_core_dec_fx( } stereo_mdct_core_dec_fx( st_ivas, hCPE, output_32_fx, synth_16_fx, e_sig ); - - FOR( ch = 0; ch < 2; ch++ ) - { - st = hCPE->hCoreCoder[ch]; - st->hHQ_core->Q_old_wtda_LB = st->Q_syn; - move16(); - st->hHQ_core->Q_old_wtda = st->Q_syn; - move16(); - } } } /* for inactive frames with mono output, copy and (if necessary) downmix buffers */ diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 97799ebba..d0526e869 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -571,10 +571,6 @@ ivas_error ivas_mct_dec_fx( } FOR( n = 0; n < CPE_CHANNELS; n++ ) { - IF( hCPE->hCoreCoder[n]->Q_syn != 0 ) - { - Scale_sig( hCPE->hCoreCoder[n]->hHQ_core->old_out_fx, L_FRAME48k, hCPE->hCoreCoder[n]->Q_syn ); - } if ( sts[n]->hTcxDec && sts[n]->hTcxDec->conCngLevelBackgroundTrace_e < 0 ) { sts[n]->hTcxDec->conCngLevelBackgroundTrace_e = 0; @@ -607,11 +603,6 @@ ivas_error ivas_mct_dec_fx( FOR( n = 0; n < CPE_CHANNELS; n++ ) { - IF( hCPE->hCoreCoder[n]->Q_syn != 0 ) - { - Scale_sig( hCPE->hCoreCoder[n]->hHQ_core->old_out_fx, L_FRAME48k, negate( hCPE->hCoreCoder[n]->Q_syn ) ); - Scale_sig( hCPE->hCoreCoder[n]->hHQ_core->old_out_LB_fx, L_FRAME32k, negate( hCPE->hCoreCoder[n]->Q_syn ) ); - } IF( hCPE->hCoreCoder[n]->hBPF ) { hCPE->hCoreCoder[n]->hBPF->pst_mem_deemp_err_fx = extract_l( L_shr( hCPE->hCoreCoder[n]->mem_error, sub( Q16, sub( hCPE->hCoreCoder[n]->Q_syn2, 1 ) ) ) ); diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index 15e157951..9e5c08937 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -2057,8 +2057,8 @@ void ivas_mdct_core_reconstruct_fx( Scale_sig( st->hTcxDec->old_syn_Overl, L_FRAME32k / 2, sub( q_win, sub( -1, st->Q_syn ) ) ); Scale_sig( st->hTcxDec->syn_Overl, L_FRAME32k / 2, sub( q_win, st->Q_syn ) ); Scale_sig( st->hTcxDec->syn_OverlFB, L_FRAME_MAX / 2, sub( q_win, st->Q_syn ) ); - Scale_sig( st->hHQ_core->old_out_LB_fx, L_FRAME32k, sub( q_win, st->Q_syn ) ); - Scale_sig( st->hHQ_core->old_out_fx, L_FRAME48k, sub( q_win, st->Q_syn ) ); + Scale_sig( st->hHQ_core->old_out_LB_fx, L_FRAME32k, sub( q_win, st->hHQ_core->Q_old_wtda_LB ) ); + Scale_sig( st->hHQ_core->old_out_fx, L_FRAME48k, sub( q_win, st->hHQ_core->Q_old_wtda ) ); #ifdef MSAN_FIX Scale_sig( synth_buf_fx, add( add( st->hTcxDec->old_synth_len, L_FRAME_PLUS ), M ), sub( q_win, q_syn ) ); Scale_sig( synth_bufFB_fx, add( add( st->hTcxDec->old_synth_lenFB, L_FRAME_PLUS ), M ), sub( q_win, q_syn ) ); @@ -2110,7 +2110,7 @@ void ivas_mdct_core_reconstruct_fx( st->Q_syn = q_syn; move16(); } - sf = getScaleFactor16( st->hHQ_core->old_out_fx, L_FRAME48k ); + sf = s_min( getScaleFactor16( st->hHQ_core->old_out_fx, L_FRAME48k ), getScaleFactor16( st->hHQ_core->old_out_LB_fx, L_FRAME32k ) ); IF( LT_16( sf, sub( st->Q_syn, q_win ) ) ) { st->Q_syn = add( q_win, sf ); @@ -2181,7 +2181,10 @@ void ivas_mdct_core_reconstruct_fx( Scale_sig( st->mem_syn2_fx, M, st->Q_syn ); Scale_sig( st->mem_syn_r, M, st->Q_syn ); } - + st->hHQ_core->Q_old_wtda = st->Q_syn; + move16(); + st->hHQ_core->Q_old_wtda_LB = st->Q_syn; + move16(); /*--------------------------------------------------------------------------------* * Updates *--------------------------------------------------------------------------------*/ diff --git a/lib_dec/ivas_stereo_dft_dec_fx.c b/lib_dec/ivas_stereo_dft_dec_fx.c index a03d520f9..19973a3df 100644 --- a/lib_dec/ivas_stereo_dft_dec_fx.c +++ b/lib_dec/ivas_stereo_dft_dec_fx.c @@ -2519,6 +2519,8 @@ void stereo_dft_generate_res_pred_fx( Word16 d_long, d_short, d_long_ind, d_short_ind; Word16 g_short, g_long; Word32 dmx_nrg, rev_nrg; + Word64 dmx_nrg_64bit, rev_nrg_64bit; + Word16 q_shift, q_com, dmx_nrg_q, rev_nrg_q, q_smoothed_nrg_local[STEREO_DFT_BAND_MAX]; Word32 past_dmx_nrg; Word32 pred_gain_avg; Word32 g2; @@ -2580,35 +2582,50 @@ void stereo_dft_generate_res_pred_fx( { /* ESF in lowband */ /* main loop over core region*/ + set16_fx( q_smoothed_nrg_local, hStereoDft->q_smoothed_nrg, STEREO_DFT_BAND_MAX ); FOR( b = hStereoDft->res_cod_band_max; b <= band0; b++ ) { - dmx_nrg = EPSILON_FIX; - move32(); - rev_nrg = EPSILON_FIX; - move32(); + dmx_nrg_64bit = EPSILLON_FX; + move64(); + rev_nrg_64bit = EPSILLON_FX; + move64(); /* calculate band energies (low band only in case of ACELP) */ FOR( i = hStereoDft->band_limits[b]; i < s_min( hStereoDft->band_limits[b + 1], bin0 ); i++ ) { - /* Saturating below calculations (to be rechecked?) */ - dmx_nrg = L_add_sat( dmx_nrg, - Madd_32_32( Mpy_32_32( pDFT_DMX[2 * i], pDFT_DMX[2 * i] ), - pDFT_DMX[add( shl( i, 1 ), 1 )], pDFT_DMX[add( shl( i, 1 ), 1 )] ) ); - rev_nrg = L_add_sat( rev_nrg, - Madd_32_32( Mpy_32_32( ap_filt_DMX[2 * i], ap_filt_DMX[2 * i] ), - ap_filt_DMX[add( shl( i, 1 ), 1 )], ap_filt_DMX[add( shl( i, 1 ), 1 )] ) ); - } - IF( LT_16( hStereoDft->q_smoothed_nrg, hStereoDft->q_dft ) ) - { - rev_nrg = L_shr( rev_nrg, shl( sub( hStereoDft->q_dft, hStereoDft->q_smoothed_nrg ), 1 ) ); - dmx_nrg = L_shr( dmx_nrg, shl( sub( hStereoDft->q_dft, hStereoDft->q_smoothed_nrg ), 1 ) ); + dmx_nrg_64bit = W_add( dmx_nrg_64bit, + W_add( W_mult0_32_32( pDFT_DMX[2 * i], pDFT_DMX[2 * i] ), + W_mult0_32_32( pDFT_DMX[add( shl( i, 1 ), 1 )], pDFT_DMX[add( shl( i, 1 ), 1 )] ) ) ); + rev_nrg_64bit = W_add( rev_nrg_64bit, + W_add( W_mult0_32_32( ap_filt_DMX[2 * i], ap_filt_DMX[2 * i] ), + W_mult0_32_32( ap_filt_DMX[add( shl( i, 1 ), 1 )], ap_filt_DMX[add( shl( i, 1 ), 1 )] ) ) ); + } + q_shift = W_norm( dmx_nrg_64bit ); + dmx_nrg = W_extract_l( W_shl( dmx_nrg_64bit, sub( q_shift, 32 ) ) ); // 2 * hStereoDft->q_dft + (q_shift - 32) + dmx_nrg_q = add( imult1616( 2, hStereoDft->q_dft ), sub( q_shift, 32 ) ); + q_shift = W_norm( rev_nrg_64bit ); + rev_nrg = W_extract_l( W_shl( rev_nrg_64bit, sub( q_shift, 32 ) ) ); // 2 * hStereoDft->q_dft + (q_shift - 32) + rev_nrg_q = add( imult1616( 2, hStereoDft->q_dft ), sub( q_shift, 32 ) ); + + /* Reach a common Q for dmx_nrg and rev_nrg */ + q_com = s_min( dmx_nrg_q, rev_nrg_q ); + dmx_nrg = L_shl( dmx_nrg, sub( q_com, dmx_nrg_q ) ); + rev_nrg = L_shl( rev_nrg, sub( q_com, rev_nrg_q ) ); + IF( LT_16( hStereoDft->q_smoothed_nrg, q_com ) ) + { + rev_nrg = L_shr( rev_nrg, shl( sub( q_com, hStereoDft->q_smoothed_nrg ), 1 ) ); + dmx_nrg = L_shr( dmx_nrg, shl( sub( q_com, hStereoDft->q_smoothed_nrg ), 1 ) ); + q_com = hStereoDft->q_smoothed_nrg; + move16(); } - ELSE IF( GT_16( hStereoDft->q_smoothed_nrg, hStereoDft->q_dft ) ) + ELSE IF( GT_16( hStereoDft->q_smoothed_nrg, q_com ) ) { - hStereoDft->smooth_res_nrg_fx[b] = L_shr( hStereoDft->smooth_res_nrg_fx[b], shl( sub( hStereoDft->q_smoothed_nrg, hStereoDft->q_dft ), 1 ) ); - hStereoDft->smooth_dmx_nrg_fx[b] = L_shr( hStereoDft->smooth_dmx_nrg_fx[b], shl( sub( hStereoDft->q_smoothed_nrg, hStereoDft->q_dft ), 1 ) ); + hStereoDft->smooth_res_nrg_fx[b] = L_shr( hStereoDft->smooth_res_nrg_fx[b], shl( sub( hStereoDft->q_smoothed_nrg, q_com ), 1 ) ); move32(); + hStereoDft->smooth_dmx_nrg_fx[b] = L_shr( hStereoDft->smooth_dmx_nrg_fx[b], shl( sub( hStereoDft->q_smoothed_nrg, q_com ), 1 ) ); move32(); + q_smoothed_nrg_local[b] = q_com; + move16(); } /* smoothing */ hStereoDft->smooth_res_nrg_fx[b] = Madd_32_16( Mpy_32_16_1( hStereoDft->smooth_res_nrg_fx[b], alpha ), rev_nrg, sub( (Word16) ( 0x7FFF ), alpha ) ); @@ -2691,8 +2708,23 @@ void stereo_dft_generate_res_pred_fx( move32(); } } - IF( GT_16( hStereoDft->q_smoothed_nrg, hStereoDft->q_dft ) ) + + /* Reach a common Q for all the bands */ + q_com = Q31; + move16(); + FOR( b = 0; b < STEREO_DFT_BAND_MAX; b++ ) + { + q_com = s_min( q_com, q_smoothed_nrg_local[b] ); + } + FOR( b = 0; b < STEREO_DFT_BAND_MAX; b++ ) + { + hStereoDft->smooth_dmx_nrg_fx[b] = L_shl( hStereoDft->smooth_dmx_nrg_fx[b], sub( q_com, q_smoothed_nrg_local[b] ) ); + hStereoDft->smooth_res_nrg_fx[b] = L_shl( hStereoDft->smooth_res_nrg_fx[b], sub( q_com, q_smoothed_nrg_local[b] ) ); + } + IF( GT_16( q_com, hStereoDft->q_dft ) ) { + scale_sig32( hStereoDft->smooth_dmx_nrg_fx, STEREO_DFT_BAND_MAX, sub( hStereoDft->q_dft, q_com ) ); + scale_sig32( hStereoDft->smooth_res_nrg_fx, STEREO_DFT_BAND_MAX, sub( hStereoDft->q_dft, q_com ) ); hStereoDft->q_smoothed_nrg = hStereoDft->q_dft; move16(); } @@ -2905,7 +2937,7 @@ void stereo_dft_generate_res_pred_fx( IF( g_short > 0 ) { - Word16 q_divide, q_shift; + Word16 q_divide; Word32 op = BASOP_Util_Divide3232_Scale( L_add( EPSILON_FIX, dmx_nrg ), L_add( EPSILON_FIX, past_dmx_nrg ), &q_divide ); q_norm_fac = add( add( Q16, q_divide ), hStereoDft->q_hb_nrg_subr ); op = Sqrt32( op, &q_norm_fac ); diff --git a/lib_dec/ivas_stereo_icbwe_dec.c b/lib_dec/ivas_stereo_icbwe_dec.c index 820a65654..2859edb3b 100644 --- a/lib_dec/ivas_stereo_icbwe_dec.c +++ b/lib_dec/ivas_stereo_icbwe_dec.c @@ -1844,7 +1844,7 @@ void stereo_icBWE_decproc_fx( FOR( i = 0; i < output_frame; i++ ) { #ifdef FIX_826_PRECISION_LOST_AND_COMPL - outputHB[0][i] = W_shr( W_mac_32_16( W_mult_32_16( outputHB[0][i], 16384 ), outputHB[1][i], 16384 ), Q16 ); + outputHB[0][i] = W_extract_l( W_shr( W_mac_32_16( W_mult_32_16( outputHB[0][i], 16384 ), outputHB[1][i], 16384 ), Q16 ) ); #else outputHB[0][i] = L_shr( ( outputHB[0][i] + outputHB[1][i] ), 1 ); #endif diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 2e59c9225..153491732 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -148,11 +148,7 @@ ivas_error IVAS_DEC_Open( } hIvasDec = *phIvasDec; hIvasDec->hVoIP = NULL; -#ifndef IVAS_FLOAT_FIXED - hIvasDec->apaExecBuffer = NULL; -#else hIvasDec->apaExecBuffer_fx = NULL; -#endif hIvasDec->hTimeScaler = NULL; hIvasDec->tsm_scale = 100; hIvasDec->tsm_max_scaling = 0; @@ -300,11 +296,7 @@ static void init_decoder_config( hDecoderConfig->Opt_RendConfigCustom = 0; hDecoderConfig->orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE; hDecoderConfig->Opt_non_diegetic_pan = 0; -#ifndef IVAS_FLOAT_FIXED - hDecoderConfig->non_diegetic_pan_gain = 0; -#else hDecoderConfig->non_diegetic_pan_gain_fx = 0; -#endif hDecoderConfig->Opt_tsm = 0; hDecoderConfig->Opt_delay_comp = 0; hDecoderConfig->Opt_ExternalOrientation = 0; @@ -340,6 +332,7 @@ void IVAS_DEC_Close( ) { /* Free all memory */ + test(); IF( phIvasDec == NULL || *phIvasDec == NULL ) { return; @@ -359,17 +352,10 @@ void IVAS_DEC_Close( apa_exit( &( *phIvasDec )->hTimeScaler ); -#ifndef IVAS_FLOAT_FIXED - IF( ( *phIvasDec )->apaExecBuffer != NULL ) - { - free( ( *phIvasDec )->apaExecBuffer ); - } -#else IF( ( *phIvasDec )->apaExecBuffer_fx != NULL ) { free( ( *phIvasDec )->apaExecBuffer_fx ); } -#endif free( *phIvasDec ); *phIvasDec = NULL; phIvasDec = NULL; @@ -463,7 +449,7 @@ ivas_error IVAS_DEC_Configure( test(); test(); test(); - IF( EQ_16( hIvasDec->mode, IVAS_DEC_MODE_EVS ) && !( ( EQ_16( outputConfig, IVAS_AUDIO_CONFIG_MONO ) && EQ_16( Opt_non_diegetic_pan, 0 ) ) || + IF( EQ_16( hIvasDec->mode, IVAS_DEC_MODE_EVS ) && !( ( EQ_16( outputConfig, IVAS_AUDIO_CONFIG_MONO ) && Opt_non_diegetic_pan == 0 ) || ( EQ_16( outputConfig, IVAS_AUDIO_CONFIG_STEREO ) && EQ_16( Opt_non_diegetic_pan, 1 ) ) ) ) { return IVAS_ERR_WRONG_MODE; @@ -1021,13 +1007,6 @@ ivas_error IVAS_DEC_GetSamples( { return error; } - for ( Word16 i = 0; i < hIvasDec->st_ivas->hCombinedOrientationData->num_subframes; i++ ) - { - hIvasDec->st_ivas->hCombinedOrientationData->Quaternions[i].w = fixedToFloat_32( hIvasDec->st_ivas->hCombinedOrientationData->Quaternions[i].w_fx, hIvasDec->st_ivas->hCombinedOrientationData->Quaternions[i].q_fact ); - hIvasDec->st_ivas->hCombinedOrientationData->Quaternions[i].x = fixedToFloat_32( hIvasDec->st_ivas->hCombinedOrientationData->Quaternions[i].x_fx, hIvasDec->st_ivas->hCombinedOrientationData->Quaternions[i].q_fact ); - hIvasDec->st_ivas->hCombinedOrientationData->Quaternions[i].y = fixedToFloat_32( hIvasDec->st_ivas->hCombinedOrientationData->Quaternions[i].y_fx, hIvasDec->st_ivas->hCombinedOrientationData->Quaternions[i].q_fact ); - hIvasDec->st_ivas->hCombinedOrientationData->Quaternions[i].z = fixedToFloat_32( hIvasDec->st_ivas->hCombinedOrientationData->Quaternions[i].z_fx, hIvasDec->st_ivas->hCombinedOrientationData->Quaternions[i].q_fact ); - } hIvasDec->updateOrientation = false; move16(); } @@ -1099,6 +1078,8 @@ ivas_error IVAS_DEC_GetSamples( { return error; } + +#if 1 // apa_exec /* JBM */ IF( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) { @@ -1124,6 +1105,7 @@ ivas_error IVAS_DEC_GetSamples( hIvasDec->apaExecBuffer_fx[i] = float_to_fix( apaExecBuffer[i], Q11 ); } } +#endif ELSE { nSamplesTcsScaled = hIvasDec->nSamplesFrame; @@ -1234,23 +1216,40 @@ static ivas_error IVAS_DEC_Setup( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; Word16 SrcInd[MAX_NUM_TDREND_CHANNELS]; Word16 num_src = 0; - IF( EQ_16( is_DTXrate( ivas_total_brate ), 0 ) && ( !( EQ_16( st_ivas->ini_active_frame, 0 ) && NE_32( ivas_total_brate, FRAME_NO_DATA ) && LT_32( ivas_total_brate, MASA_STEREO_MIN_BITRATE ) && EQ_16( st_ivas->nCPE, 1 ) ) ) && st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 1] && st_ivas->ivas_format == MASA_FORMAT && st_ivas->last_ivas_format != MASA_FORMAT && ( ( GT_32( ivas_total_brate, IVAS_SID_5k2 ) && NE_32( ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate ) ) && EQ_16( st_ivas->ini_active_frame, 0 ) ) ) + move16(); + + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + IF( is_DTXrate( ivas_total_brate ) == 0 && ( !( st_ivas->ini_active_frame == 0 && NE_32( ivas_total_brate, FRAME_NO_DATA ) && LT_32( ivas_total_brate, MASA_STEREO_MIN_BITRATE ) && EQ_16( st_ivas->nCPE, 1 ) ) ) && st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 1] && st_ivas->ivas_format == MASA_FORMAT && st_ivas->last_ivas_format != MASA_FORMAT && ( ( GT_32( ivas_total_brate, IVAS_SID_5k2 ) && NE_32( ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate ) ) && st_ivas->ini_active_frame == 0 ) ) { IF( st_ivas->hSpar ) { Word16 Q_tmp = getScaleFactor16( st_ivas->hSpar->hFbMixer->cldfb_cross_fade_fx, 16 ); - Scale_sig( st_ivas->hSpar->hFbMixer->cldfb_cross_fade_fx, 16, Q_tmp - st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q ); + Scale_sig( st_ivas->hSpar->hFbMixer->cldfb_cross_fade_fx, 16, sub( Q_tmp, st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q ) ); st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q = Q_tmp; } } - IF( EQ_16( is_DTXrate( ivas_total_brate ), 0 ) && st_ivas->ivas_format == MASA_ISM_FORMAT && GT_16( st_ivas->ini_frame, 0 ) && ( GT_32( ivas_total_brate, IVAS_SID_5k2 ) && NE_32( ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate ) ) && EQ_16( st_ivas->ini_active_frame, 0 ) ) + test(); + test(); + test(); + test(); + test(); + IF( is_DTXrate( ivas_total_brate ) == 0 && st_ivas->ivas_format == MASA_ISM_FORMAT && GT_16( st_ivas->ini_frame, 0 ) && ( GT_32( ivas_total_brate, IVAS_SID_5k2 ) && NE_32( ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate ) ) && st_ivas->ini_active_frame == 0 ) { IF( st_ivas->hSpar ) { Word16 Q_tmp = getScaleFactor16( st_ivas->hSpar->hFbMixer->cldfb_cross_fade_fx, 16 ); - Scale_sig( st_ivas->hSpar->hFbMixer->cldfb_cross_fade_fx, 16, Q_tmp - st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q ); + Scale_sig( st_ivas->hSpar->hFbMixer->cldfb_cross_fade_fx, 16, sub( Q_tmp, st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q ) ); st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q = Q_tmp; + move16(); } } @@ -1258,6 +1257,7 @@ static ivas_error IVAS_DEC_Setup( { return error; } + test(); IF( ( st_ivas->ivas_format == MC_FORMAT ) && ( st_ivas->mc_mode == MC_MODE_PARAMMC ) ) { MC_LS_SETUP mc_ls_setup; @@ -1265,7 +1265,13 @@ static ivas_error IVAS_DEC_Setup( st_ivas->nchan_transport = ivas_param_mc_getNumTransportChannels( ivas_total_brate, mc_ls_setup ); } - IF( EQ_16( is_DTXrate( ivas_total_brate ), 0 ) && ( !( EQ_16( st_ivas->ini_active_frame, 0 ) && NE_32( ivas_total_brate, FRAME_NO_DATA ) && LT_32( ivas_total_brate, MASA_STEREO_MIN_BITRATE ) && EQ_16( st_ivas->nCPE, 1 ) ) ) && st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 1] && st_ivas->ivas_format == MASA_FORMAT && ( ( GT_32( ivas_total_brate, IVAS_SID_5k2 ) && NE_32( ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate ) ) || EQ_16( st_ivas->ini_active_frame, 0 ) ) ) + test(); + test(); + test(); + test(); + test(); + test(); + IF( is_DTXrate( ivas_total_brate ) == 0 && ( !( st_ivas->ini_active_frame == 0 && NE_32( ivas_total_brate, FRAME_NO_DATA ) && LT_32( ivas_total_brate, MASA_STEREO_MIN_BITRATE ) && EQ_16( st_ivas->nCPE, 1 ) ) ) && st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 1] && st_ivas->ivas_format == MASA_FORMAT && ( ( GT_32( ivas_total_brate, IVAS_SID_5k2 ) && NE_32( ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate ) ) || st_ivas->ini_active_frame == 0 ) ) { IF( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) { @@ -1280,19 +1286,27 @@ static ivas_error IVAS_DEC_Setup( IF( Src_p->SrcSpatial_p != NULL ) { Src_p->SrcSpatial_p->q_Pos_p = Q31; + move16(); } TDREND_SRC_SPATIAL_t *SrcSpatial_p = st_ivas->hBinRendererTd->Sources[nS]->SrcSpatial_p; SrcSpatial_p->q_Pos_p = Q31; + move16(); } } } - IF( EQ_16( is_DTXrate( ivas_total_brate ), 0 ) && st_ivas->ivas_format == MASA_ISM_FORMAT && GT_16( st_ivas->ini_frame, 0 ) && ( GT_32( ivas_total_brate, IVAS_SID_5k2 ) && NE_32( ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate ) ) && EQ_16( st_ivas->ini_active_frame, 0 ) ) + test(); + test(); + test(); + test(); + test(); + IF( is_DTXrate( ivas_total_brate ) == 0 && st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ini_frame > 0 && ( GT_32( ivas_total_brate, IVAS_SID_5k2 ) && NE_32( ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate ) ) && st_ivas->ini_active_frame == 0 ) { IF( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) { Word16 nchan_rend = num_src; + test(); IF( EQ_16( st_ivas->ivas_format, MC_FORMAT ) && NE_16( st_ivas->transport_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) { nchan_rend--; /* Skip LFE channel -- added to the others */ @@ -1303,9 +1317,11 @@ static ivas_error IVAS_DEC_Setup( IF( Src_p->SrcSpatial_p != NULL ) { Src_p->SrcSpatial_p->q_Pos_p = Q31; + move16(); } TDREND_SRC_SPATIAL_t *SrcSpatial_p = st_ivas->hBinRendererTd->Sources[nS]->SrcSpatial_p; SrcSpatial_p->q_Pos_p = Q31; + move16(); } } } @@ -1364,7 +1380,6 @@ static ivas_error IVAS_DEC_GetTcSamples( Decoder_State *st, **sts; /* used for bitstream handling */ Word16 nCPE, cpe_id; nCPE = st_ivas->nCPE; - /* Float to Fixed */ IF( st_ivas->hDecoderConfig->Opt_tsm == 0 ) { @@ -1377,7 +1392,12 @@ static ivas_error IVAS_DEC_GetTcSamples( CPE_DEC_HANDLE hCPE; - IF( ( ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) || ( st_ivas->mc_mode == MC_MODE_MCT ) || st_ivas->ivas_format == SBA_ISM_FORMAT || ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) || st_ivas->mc_mode == MC_MODE_PARAMMC ) && ( GT_16( st_ivas->nCPE, 1 ) ) ) + test(); + test(); + test(); + test(); + test(); + IF( ( EQ_32( st_ivas->mc_mode, MC_MODE_PARAMUPMIX ) || EQ_32( st_ivas->mc_mode, MC_MODE_MCT ) || EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) || ( EQ_32( st_ivas->ivas_format, SBA_FORMAT ) || EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) || EQ_32( st_ivas->mc_mode, MC_MODE_PARAMMC ) ) && ( GT_16( st_ivas->nCPE, 1 ) ) ) { nCPE = st_ivas->nCPE; @@ -1395,19 +1415,6 @@ static ivas_error IVAS_DEC_GetTcSamples( st->hTcxDec->conNoiseLevelIndex = st->hTcxDec->NoiseLevelIndex_bfi; IF( st->hTcxDec ) st->hTcxDec->conCurrLevelIndex = st->hTcxDec->CurrLevelIndex_bfi; - - /*cldfb struct*/ - - /*------------------fix-to-fix-start---------------------*/ - /*core_switching_post_dec*/ - IF( hCPE->hCoreCoder[n]->hHQ_core != NULL ) - { - IF( LT_16( cpe_id, st_ivas->nCPE_old ) ) - { - Scale_sig( hCPE->hCoreCoder[n]->hHQ_core->old_out_fx, L_FRAME48k, negate( hCPE->hCoreCoder[n]->hHQ_core->Q_old_wtda ) ); - } - hCPE->hCoreCoder[n]->hHQ_core->Q_old_wtda = 0; - } } } } @@ -1422,7 +1429,13 @@ static ivas_error IVAS_DEC_GetTcSamples( hIvasDec->isInitialized = true; /* Initialization done in ivas_dec() */ - IF( ( ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) || ( st_ivas->mc_mode == MC_MODE_MCT ) || st_ivas->ivas_format == SBA_ISM_FORMAT || ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) || st_ivas->mc_mode == MC_MODE_PARAMMC ) && ( GT_16( st_ivas->nCPE, 1 ) ) ) + test(); + test(); + test(); + test(); + test(); + test(); + IF( ( EQ_32( st_ivas->mc_mode, MC_MODE_PARAMUPMIX ) || EQ_32( st_ivas->mc_mode, MC_MODE_MCT ) || EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) || ( EQ_32( st_ivas->ivas_format, SBA_FORMAT ) || EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) || EQ_32( st_ivas->mc_mode, MC_MODE_PARAMMC ) ) && ( GT_16( st_ivas->nCPE, 1 ) ) ) { FOR( cpe_id = 0; cpe_id < nCPE; cpe_id++ ) { @@ -1910,21 +1923,20 @@ ivas_error IVAS_DEC_FeedHeadTrackData( Euler2Quat_fx( deg2rad_fx( orientation.x_fx ), deg2rad_fx( orientation.y_fx ), deg2rad_fx( orientation.z_fx ), &orientation ); } -#ifdef IVAS_FLOAT_FIXED Word32 updateRate_fx = 1677721600; // value is 200 in Q23 move32(); - orientation.w_fx = L_shl( orientation.w_fx, Q29 - orientation.q_fact ); - orientation.x_fx = L_shl( orientation.x_fx, Q29 - orientation.q_fact ); - orientation.y_fx = L_shl( orientation.y_fx, Q29 - orientation.q_fact ); - orientation.z_fx = L_shl( orientation.z_fx, Q29 - orientation.q_fact ); - hHeadTrackData->OrientationTracker->refRot.w_fx = L_shl( hHeadTrackData->OrientationTracker->refRot.w_fx, Q29 - hHeadTrackData->OrientationTracker->refRot.q_fact ); - hHeadTrackData->OrientationTracker->refRot.x_fx = L_shl( hHeadTrackData->OrientationTracker->refRot.x_fx, Q29 - hHeadTrackData->OrientationTracker->refRot.q_fact ); - hHeadTrackData->OrientationTracker->refRot.y_fx = L_shl( hHeadTrackData->OrientationTracker->refRot.y_fx, Q29 - hHeadTrackData->OrientationTracker->refRot.q_fact ); - hHeadTrackData->OrientationTracker->refRot.z_fx = L_shl( hHeadTrackData->OrientationTracker->refRot.z_fx, Q29 - hHeadTrackData->OrientationTracker->refRot.q_fact ); - hHeadTrackData->OrientationTracker->absAvgRot.w_fx = L_shl( hHeadTrackData->OrientationTracker->absAvgRot.w_fx, Q29 - hHeadTrackData->OrientationTracker->absAvgRot.q_fact ); - hHeadTrackData->OrientationTracker->absAvgRot.x_fx = L_shl( hHeadTrackData->OrientationTracker->absAvgRot.x_fx, Q29 - hHeadTrackData->OrientationTracker->absAvgRot.q_fact ); - hHeadTrackData->OrientationTracker->absAvgRot.y_fx = L_shl( hHeadTrackData->OrientationTracker->absAvgRot.y_fx, Q29 - hHeadTrackData->OrientationTracker->absAvgRot.q_fact ); - hHeadTrackData->OrientationTracker->absAvgRot.z_fx = L_shl( hHeadTrackData->OrientationTracker->absAvgRot.z_fx, Q29 - hHeadTrackData->OrientationTracker->absAvgRot.q_fact ); + orientation.w_fx = L_shl( orientation.w_fx, sub( Q29, orientation.q_fact ) ); + orientation.x_fx = L_shl( orientation.x_fx, sub( Q29, orientation.q_fact ) ); + orientation.y_fx = L_shl( orientation.y_fx, sub( Q29, orientation.q_fact ) ); + orientation.z_fx = L_shl( orientation.z_fx, sub( Q29, orientation.q_fact ) ); + hHeadTrackData->OrientationTracker->refRot.w_fx = L_shl( hHeadTrackData->OrientationTracker->refRot.w_fx, sub( Q29, hHeadTrackData->OrientationTracker->refRot.q_fact ) ); + hHeadTrackData->OrientationTracker->refRot.x_fx = L_shl( hHeadTrackData->OrientationTracker->refRot.x_fx, sub( Q29, hHeadTrackData->OrientationTracker->refRot.q_fact ) ); + hHeadTrackData->OrientationTracker->refRot.y_fx = L_shl( hHeadTrackData->OrientationTracker->refRot.y_fx, sub( Q29, hHeadTrackData->OrientationTracker->refRot.q_fact ) ); + hHeadTrackData->OrientationTracker->refRot.z_fx = L_shl( hHeadTrackData->OrientationTracker->refRot.z_fx, sub( Q29, hHeadTrackData->OrientationTracker->refRot.q_fact ) ); + hHeadTrackData->OrientationTracker->absAvgRot.w_fx = L_shl( hHeadTrackData->OrientationTracker->absAvgRot.w_fx, sub( Q29, hHeadTrackData->OrientationTracker->absAvgRot.q_fact ) ); + hHeadTrackData->OrientationTracker->absAvgRot.x_fx = L_shl( hHeadTrackData->OrientationTracker->absAvgRot.x_fx, sub( Q29, hHeadTrackData->OrientationTracker->absAvgRot.q_fact ) ); + hHeadTrackData->OrientationTracker->absAvgRot.y_fx = L_shl( hHeadTrackData->OrientationTracker->absAvgRot.y_fx, sub( Q29, hHeadTrackData->OrientationTracker->absAvgRot.q_fact ) ); + hHeadTrackData->OrientationTracker->absAvgRot.z_fx = L_shl( hHeadTrackData->OrientationTracker->absAvgRot.z_fx, sub( Q29, hHeadTrackData->OrientationTracker->absAvgRot.q_fact ) ); orientation.q_fact = Q29; hHeadTrackData->OrientationTracker->refRot.q_fact = Q29; @@ -1937,17 +1949,7 @@ ivas_error IVAS_DEC_FeedHeadTrackData( { return error; } -#else - IF( ( error = ivas_orient_trk_Process( hHeadTrackData->OrientationTracker, orientation, FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES, &hHeadTrackData->Quaternions[subframe_idx] ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif - hHeadTrackData->Pos[subframe_idx].x = Pos.x; - hHeadTrackData->Pos[subframe_idx].y = Pos.y; - hHeadTrackData->Pos[subframe_idx].z = Pos.z; -#ifdef IVAS_FLOAT_FIXED hHeadTrackData->Pos[subframe_idx].x_fx = Pos.x_fx; hHeadTrackData->Pos[subframe_idx].y_fx = Pos.y_fx; hHeadTrackData->Pos[subframe_idx].z_fx = Pos.z_fx; @@ -1956,7 +1958,6 @@ ivas_error IVAS_DEC_FeedHeadTrackData( move32(); move32(); move16(); -#endif hIvasDec->updateOrientation = true; move16(); @@ -1988,10 +1989,16 @@ ivas_error IVAS_DEC_FeedRefRotData( pOtr = hIvasDec->st_ivas->hHeadTrackData->OrientationTracker; - pOtr->refRot.w = rotation.w; - pOtr->refRot.x = rotation.x; - pOtr->refRot.z = rotation.z; - pOtr->refRot.y = rotation.y; + pOtr->refRot.w_fx = rotation.w_fx; + pOtr->refRot.x_fx = rotation.x_fx; + pOtr->refRot.z_fx = rotation.z_fx; + pOtr->refRot.y_fx = rotation.y_fx; + + pOtr->refRot.q_fact = rotation.q_fact; + move32(); + move32(); + move32(); + move32(); hIvasDec->updateOrientation = true; move16(); @@ -2051,6 +2058,7 @@ ivas_error IVAS_DEC_FeedExternalOrientationData( { EXTERNAL_ORIENTATION_HANDLE hExternalOrientationData; + test(); IF( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -2062,7 +2070,6 @@ ivas_error IVAS_DEC_FeedExternalOrientationData( { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - // IVAS_QUATERNION orientation_fx = { 0 }; orientation.q_fact = Q29; move16(); /* Move external orientation data to the decoder handle (invert orientations) */ @@ -2792,7 +2799,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( return IVAS_ERR_UNKNOWN; } -#ifdef IVAS_FLOAT_FIXED IF( EQ_32( hIvasDec->mode, IVAS_DEC_MODE_EVS ) ) { if ( GT_32( maxScaling, 20 ) ) @@ -2801,7 +2807,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( move16(); } } -#endif maxScaling = Mult_32_32( imult3216( hDecoderConfig->output_Fs, (Word16) maxScaling ), INV_1000_Q31 ); /* avoid time scaling multiple times in one sound card slot */ @@ -3622,11 +3627,7 @@ static ivas_error IVAS_DEC_VoIP_reconfigure( apa_buffer_size = hIvasDec->nSamplesFrame; move16(); -#ifndef IVAS_FLOAT_FIXED - IF( hIvasDec->apaExecBuffer == NULL ) -#else IF( hIvasDec->apaExecBuffer_fx == NULL ) -#endif { DECODER_CONFIG_HANDLE hDecoderConfig; @@ -3690,22 +3691,12 @@ static ivas_error IVAS_DEC_VoIP_reconfigure( } } -#ifndef IVAS_FLOAT_FIXED - IF( ( hIvasDec->apaExecBuffer = malloc( sizeof( float ) * apa_buffer_size * nTransportChannels ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); - } - - set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels ); - -#else IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * imult1616( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); } set_zero_fx( hIvasDec->apaExecBuffer_fx, imult1616( apa_buffer_size, (Word16) nTransportChannels ) ); -#endif } } ELSE @@ -3718,22 +3709,12 @@ static ivas_error IVAS_DEC_VoIP_reconfigure( } apa_buffer_size = APA_BUF_PER_CHANNEL; move16(); -#ifndef IVAS_FLOAT_FIXED - free( hIvasDec->apaExecBuffer ); - IF( ( hIvasDec->apaExecBuffer = malloc( sizeof( float ) * apa_buffer_size * nTransportChannels ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); - } - set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels ); - -#else free( hIvasDec->apaExecBuffer_fx ); IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * imult1616( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); } set_zero_fx( hIvasDec->apaExecBuffer_fx, imult1616( apa_buffer_size, (Word16) nTransportChannels ) ); -#endif } /* realloc apa_exe_buffer */ } diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index e65d811c1..e71bb5341 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec.c @@ -2947,6 +2947,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( Word32 *p_gains_dir, *p_gains_diff; Word32 g, g1, g2; Word32 *p_cy_auto_dir_smooth, *p_cy_auto_dir_smooth_prev; + Word16 q_cy_auto_dir_smooth_local[MAX_OUTPUT_CHANNELS], q_cy_auto_dir_smooth_prev_local[MAX_OUTPUT_CHANNELS]; Word32 *p_cy_cross_dir_smooth, *p_cy_cross_dir_smooth_prev; Word32 *p_cy_auto_diff_smooth, *p_cy_auto_diff_smooth_prev; Word32 gains_dir[CLDFB_NO_CHANNELS_MAX * MAX_OUTPUT_CHANNELS]; @@ -2972,6 +2973,10 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( Word32 tmp32; move16(); + Word64 Cldfb_RealBuffer64_fx[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + Word64 Cldfb_ImagBuffer64_fx[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + Word64 W_temp = 0; + move64(); push_wmops( "dirac_out_synth_sfr" ); h_dirac_output_synthesis_params = &( hDirACRend->h_output_synthesis_psd_params ); @@ -2986,6 +2991,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( move16(); num_freq_bands = hSpatParamRendCom->num_freq_bands; move16(); + set16_fx( q_cy_auto_dir_smooth_local, h_dirac_output_synthesis_state->q_cy_auto_dir_smooth, nchan_out_woLFE ); /*-----------------------------------------------------------------* * compute target PSDs @@ -3022,7 +3028,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( h_dirac_output_synthesis_state->direct_responses_fx, h_dirac_output_synthesis_state->direct_responses_square_fx, h_dirac_output_synthesis_state->cy_auto_dir_smooth_fx, - &h_dirac_output_synthesis_state->q_cy_auto_dir_smooth, + q_cy_auto_dir_smooth_local, h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx, &h_dirac_output_synthesis_state->q_cy_cross_dir_smooth ); @@ -3063,7 +3069,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( p_cy_auto_dir_smooth = h_dirac_output_synthesis_state->cy_auto_dir_smooth_fx; // q_cy_auto_dir_smooth p_cy_auto_diff_smooth = h_dirac_output_synthesis_state->cy_auto_diff_smooth_fx; // q_cy_auto_diff_smooth - q_com = s_min( h_dirac_output_synthesis_state->q_cy_auto_dir_smooth, h_dirac_output_synthesis_state->q_cy_auto_diff_smooth ); + q_com = s_min( q_cy_auto_dir_smooth_local[1], h_dirac_output_synthesis_state->q_cy_auto_diff_smooth ); IF( EQ_32( hDirACRend->synthesisConf, DIRAC_SYNTHESIS_MONO ) ) { @@ -3071,7 +3077,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( move16(); exp1 = 0; move16(); - tmp32 = BASOP_Util_Divide3232_Scale_cadence( L_shl( p_cy_auto_dir_smooth[num_freq_bands], sub( q_com, h_dirac_output_synthesis_state->q_cy_auto_dir_smooth ) ), + tmp32 = BASOP_Util_Divide3232_Scale_cadence( L_shl( p_cy_auto_dir_smooth[num_freq_bands], sub( q_com, q_cy_auto_dir_smooth_local[1] ) ), ( L_add( Sqrt32( h_dirac_output_synthesis_state->direct_power_factor_fx[0], &exp ), EPSILON_FX ) ), // (Q31 - exp) &exp1 ); target_power_y = L_shr( tmp32, 1 ); // Q31 + (q_com - (31 - exp)) @@ -3095,7 +3101,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( ELSE { target_power_y = L_add( - L_shl( p_cy_auto_dir_smooth[num_freq_bands], sub( q_com, h_dirac_output_synthesis_state->q_cy_auto_dir_smooth ) ), + L_shl( p_cy_auto_dir_smooth[num_freq_bands], sub( q_com, q_cy_auto_dir_smooth_local[1] ) ), L_shl( p_cy_auto_diff_smooth[num_freq_bands], sub( q_com, h_dirac_output_synthesis_state->q_cy_auto_diff_smooth ) ) ); // q_com exp = q_com; move16(); @@ -3249,7 +3255,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( } // Move proto_power_smooth_fx to common Q-factor - min_exp = 0; + min_exp = MIN_16; move16(); q_tmp = Q31; move16(); @@ -3295,12 +3301,21 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( p_cy_auto_dir_smooth = h_dirac_output_synthesis_state->cy_auto_dir_smooth_fx; p_cy_auto_dir_smooth_prev = h_dirac_output_synthesis_state->cy_auto_dir_smooth_prev_fx; - q_com = s_min( h_dirac_output_synthesis_state->q_cy_auto_dir_smooth, h_dirac_output_synthesis_state->q_cy_auto_dir_smooth_prev ); - scale_sig32( p_cy_auto_dir_smooth, imult1616( nchan_out_woLFE, num_freq_bands ), sub( q_com, h_dirac_output_synthesis_state->q_cy_auto_dir_smooth ) ); - scale_sig32( p_cy_auto_dir_smooth_prev, imult1616( nchan_out_woLFE, num_freq_bands ), sub( q_com, h_dirac_output_synthesis_state->q_cy_auto_dir_smooth_prev ) ); - h_dirac_output_synthesis_state->q_cy_auto_dir_smooth = h_dirac_output_synthesis_state->q_cy_auto_dir_smooth_prev = q_com; - move16(); - move16(); + FOR( k = 0; k < nchan_out_woLFE; k++ ) + { + q_cy_auto_dir_smooth_prev_local[k] = getScaleFactor32( p_cy_auto_dir_smooth_prev + imult1616( k, num_freq_bands ), num_freq_bands ); + move16(); + scale_sig32( p_cy_auto_dir_smooth_prev + imult1616( k, num_freq_bands ), num_freq_bands, q_cy_auto_dir_smooth_prev_local[k] ); + q_cy_auto_dir_smooth_prev_local[k] = add( q_cy_auto_dir_smooth_prev_local[k], h_dirac_output_synthesis_state->q_cy_auto_dir_smooth_prev ); + move16(); + q_com = s_min( q_cy_auto_dir_smooth_local[k], q_cy_auto_dir_smooth_prev_local[k] ); + scale_sig32( p_cy_auto_dir_smooth + imult1616( k, num_freq_bands ), num_freq_bands, sub( q_com, q_cy_auto_dir_smooth_local[k] ) ); + scale_sig32( p_cy_auto_dir_smooth_prev + imult1616( k, num_freq_bands ), num_freq_bands, sub( q_com, q_cy_auto_dir_smooth_prev_local[k] ) ); + q_cy_auto_dir_smooth_local[k] = q_cy_auto_dir_smooth_prev_local[k] = q_com; + move16(); + move16(); + } + p_cy_cross_dir_smooth = h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx; p_cy_cross_dir_smooth_prev = h_dirac_output_synthesis_state->cy_cross_dir_smooth_prev_fx; @@ -3331,16 +3346,16 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( move32(); g2 = L_sub( ONE_IN_Q31, g1 ); // Q31 *( p_cy_auto_dir_smooth_prev ) = L_add( Mpy_32_32( g1, ( *( p_cy_auto_dir_smooth++ ) ) ), - Mpy_32_32( g2, ( *( p_cy_auto_dir_smooth_prev ) ) ) ); // (Q31, q_cy_auto_dir_smooth_prev) -> q_cy_auto_dir_smooth_prev + Mpy_32_32( g2, ( *( p_cy_auto_dir_smooth_prev ) ) ) ); // (Q31, q_cy_auto_dir_smooth_prev_local) -> q_cy_auto_dir_smooth_prev_local move32(); *( p_cy_cross_dir_smooth_prev ) = L_add( Mpy_32_32( g1, ( *( p_cy_cross_dir_smooth++ ) ) ), Mpy_32_32( g2, ( *( p_cy_cross_dir_smooth_prev ) ) ) ); // (Q31, q_cy_cross_dir_smooth_prev) -> q_cy_cross_dir_smooth_prev move32(); power_smooth_temp = L_shl( *p_power_smooth, norm_l( *p_power_smooth ) ); - L_tmp = Mpy_32_32( power_smooth_temp, ( *( p_cy_auto_dir_smooth_prev++ ) ) ); // proto_power_smooth_q + norm_l( *p_power_smooth ) ) + q_cy_auto_dir_smooth_prev - 31 + L_tmp = Mpy_32_32( power_smooth_temp, ( *( p_cy_auto_dir_smooth_prev++ ) ) ); // proto_power_smooth_q + norm_l( *p_power_smooth ) ) + q_cy_auto_dir_smooth_prev_local - 31 exp = sub( Q31, sub( add( add( h_dirac_output_synthesis_state->proto_power_smooth_q, norm_l( *p_power_smooth ) ), - h_dirac_output_synthesis_state->q_cy_auto_dir_smooth_prev ), + q_cy_auto_dir_smooth_prev_local[k] ), Q31 ) ); p_power_smooth++; @@ -3406,17 +3421,21 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( g1 = alpha[l]; // Q31 move32(); g2 = L_sub( ONE_IN_Q31, g1 ); // Q31 - *( p_cy_auto_dir_smooth_prev ) = L_add( Mpy_32_32( g1, ( *( p_cy_auto_dir_smooth++ ) ) ), - Mpy_32_32( g2, ( *( p_cy_auto_dir_smooth_prev ) ) ) ); // (Q31, q_cy_auto_dir_smooth_prev) -> q_cy_auto_dir_smooth_prev + W_temp = W_add( W_mult_32_32( g1, ( *( p_cy_auto_dir_smooth++ ) ) ), + W_mult_32_32( g2, ( *( p_cy_auto_dir_smooth_prev ) ) ) ); + q_tmp = W_norm( W_temp ); + L_tmp = W_extract_h( W_shl( W_temp, q_tmp ) ); // q_cy_auto_dir_smooth_prev_local + q_tmp + *( p_cy_auto_dir_smooth_prev++ ) = L_shr_r( L_tmp, q_tmp ); + move32(); *( p_cy_cross_dir_smooth_prev ) = L_add( Mpy_32_32( g1, ( *( p_cy_cross_dir_smooth++ ) ) ), Mpy_32_32( g2, ( *( p_cy_cross_dir_smooth_prev ) ) ) ); // (Q31, q_cy_cross_dir_smooth_prev) -> q_cy_cross_dir_smooth_prev move32(); power_smooth_temp = L_shl( *p_power_smooth, norm_l( *p_power_smooth ) ); - L_tmp = Mpy_32_32( power_smooth_temp, ( *( p_cy_auto_dir_smooth_prev++ ) ) ); // proto_power_smooth_q + norm_l( *p_power_smooth ) ) + q_cy_auto_dir_smooth_prev - 31 + L_tmp = Mpy_32_32( power_smooth_temp, L_tmp ); // proto_power_smooth_q + norm_l( *p_power_smooth ) ) + q_cy_auto_dir_smooth_prev_local - 31 exp = sub( Q31, sub( add( add( h_dirac_output_synthesis_state->proto_power_smooth_q, norm_l( *p_power_smooth ) ), - h_dirac_output_synthesis_state->q_cy_auto_dir_smooth_prev ), + add( q_cy_auto_dir_smooth_prev_local[k], q_tmp ) ), Q31 ) ); *( p_gains_dir ) = Sqrt32( L_tmp, &exp ); // (Q31 - exp) @@ -3498,10 +3517,12 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( FOR( l = 0; l < num_freq_bands; l++ ) { g = L_add( Mpy_32_32( g1, *( p_gain_1++ ) ), Mpy_32_32( g2, *( p_gain_2++ ) ) ); // (Q31, gains_dir_prev_q) -> gains_dir_prev_q - RealBuffer[k][buf_idx][l] = Mpy_32_32( g, ( *( p_power_smooth++ ) ) ); // (gains_dir_prev_q, q_proto_direct_buffer) -> gains_dir_prev_q + q_proto_direct_buffer - 31 - move32(); - ImagBuffer[k][buf_idx][l] = Mpy_32_32( g, ( *( p_power_smooth++ ) ) ); // (gains_dir_prev_q, q_proto_direct_buffer) -> gains_dir_prev_q + q_proto_direct_buffer - 31 - move32(); + + Cldfb_RealBuffer64_fx[k][buf_idx][l] = W_mult0_32_32( g, ( *( p_power_smooth++ ) ) ); // (gains_dir_prev_q, q_proto_direct_buffer) -> gains_dir_prev_q + q_proto_direct_buffer + move64(); + + Cldfb_ImagBuffer64_fx[k][buf_idx][l] = W_mult0_32_32( g, ( *( p_power_smooth++ ) ) ); // (gains_dir_prev_q, q_proto_direct_buffer) -> gains_dir_prev_q + q_proto_direct_buffer + move64(); } } @@ -3518,12 +3539,23 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( FOR( l = 0; l < h_dirac_output_synthesis_params->max_band_decorr; l++ ) { g = L_add( Mpy_32_32( g1, *( p_gain_1++ ) ), Mpy_32_32( g2, *( p_gain_2++ ) ) ); // (Q31, gains_diff_prev_q) -> gains_diff_prev_q - RealBuffer[k][buf_idx][l] = L_add( L_shr( RealBuffer[k][buf_idx][l], Q1 ), - L_shr( Mpy_32_32( g, ( *( p_power_smooth_diff++ ) ) ), sub( Q1, q_align ) ) ); // (gains_diff_prev_q, q_proto_direct_buffer) >> Q1 -> gains_diff_prev_q + q_proto_direct_buffer - 32 - move32(); - ImagBuffer[k][buf_idx][l] = L_add( L_shr( ImagBuffer[k][buf_idx][l], Q1 ), - L_shr( Mpy_32_32( g, ( *( p_power_smooth_diff++ ) ) ), sub( Q1, q_align ) ) ); // (gains_diff_prev_q, q_proto_direct_buffer) >> Q1 -> gains_diff_prev_q + q_proto_direct_buffer - 32 - move32(); + Cldfb_RealBuffer64_fx[k][buf_idx][l] = W_add( Cldfb_RealBuffer64_fx[k][buf_idx][l], + W_shr( W_mult0_32_32( g, ( *( p_power_smooth_diff++ ) ) ), negate( q_align ) ) ); // (gains_diff_prev_q, q_proto_direct_buffer) -> gains_diff_prev_q + q_proto_direct_buffer + move64(); + + if ( LT_64( W_temp, W_abs( Cldfb_RealBuffer64_fx[k][buf_idx][l] ) ) ) + { + W_temp = W_abs( Cldfb_RealBuffer64_fx[k][buf_idx][l] ); + } + + Cldfb_ImagBuffer64_fx[k][buf_idx][l] = W_add( Cldfb_ImagBuffer64_fx[k][buf_idx][l], + W_shr( W_mult0_32_32( g, ( *( p_power_smooth_diff++ ) ) ), negate( q_align ) ) ); // (gains_diff_prev_q, q_proto_direct_buffer) -> gains_diff_prev_q + q_proto_direct_buffer + move64(); + + if ( LT_64( W_temp, W_abs( Cldfb_ImagBuffer64_fx[k][buf_idx][l] ) ) ) + { + W_temp = W_abs( Cldfb_ImagBuffer64_fx[k][buf_idx][l] ); + } } /*Direct proto*/ @@ -3534,16 +3566,42 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( FOR( ; l < num_freq_bands; l++ ) { g = L_add( Mpy_32_32( g1, *( p_gain_1++ ) ), Mpy_32_32( g2, *( p_gain_2++ ) ) ); // (Q31, gains_diff_prev_q) -> gains_diff_prev_q - RealBuffer[k][buf_idx][l] = L_add( L_shr( RealBuffer[k][buf_idx][l], Q1 ), - L_shr( Mpy_32_32( g, ( *( p_power_smooth++ ) ) ), Q1 ) ); // (gains_diff_prev_q, q_proto_direct_buffer) >> Q1 -> gains_diff_prev_q + q_proto_direct_buffer - 32 + Cldfb_RealBuffer64_fx[k][buf_idx][l] = W_add( Cldfb_RealBuffer64_fx[k][buf_idx][l], + W_mult0_32_32( g, ( *( p_power_smooth++ ) ) ) ); // (gains_diff_prev_q, q_proto_direct_buffer) >> Q1 -> gains_diff_prev_q + q_proto_direct_buffer - 32 + move64(); + + if ( LT_64( W_temp, W_abs( Cldfb_RealBuffer64_fx[k][buf_idx][l] ) ) ) + { + W_temp = W_abs( Cldfb_RealBuffer64_fx[k][buf_idx][l] ); + } + + Cldfb_ImagBuffer64_fx[k][buf_idx][l] = W_add( Cldfb_ImagBuffer64_fx[k][buf_idx][l], + W_mult0_32_32( g, ( *( p_power_smooth++ ) ) ) ); // (gains_diff_prev_q, q_proto_direct_buffer) >> Q1 -> gains_diff_prev_q + q_proto_direct_buffer - 32 + move64(); + + if ( LT_64( W_temp, W_abs( Cldfb_ImagBuffer64_fx[k][buf_idx][l] ) ) ) + { + W_temp = W_abs( Cldfb_ImagBuffer64_fx[k][buf_idx][l] ); + } + } + } + } + q_align = W_norm( W_temp ); + FOR( buf_idx = 0; buf_idx < nbslots; ++buf_idx ) + { + FOR( k = 0; k < nchan_out_woLFE; k++ ) + { + FOR( l = 0; l < num_freq_bands; l++ ) + { + RealBuffer[k][buf_idx][l] = W_extract_h( W_shl( Cldfb_RealBuffer64_fx[k][buf_idx][l], q_align ) ); move32(); - ImagBuffer[k][buf_idx][l] = L_add( L_shr( ImagBuffer[k][buf_idx][l], Q1 ), - L_shr( Mpy_32_32( g, ( *( p_power_smooth++ ) ) ), Q1 ) ); // (gains_diff_prev_q, q_proto_direct_buffer) >> Q1 -> gains_diff_prev_q + q_proto_direct_buffer - 32 + ImagBuffer[k][buf_idx][l] = W_extract_h( W_shl( Cldfb_ImagBuffer64_fx[k][buf_idx][l], q_align ) ); move32(); } } } - *q_Cldfb = sub( sub( add( h_dirac_output_synthesis_state->proto_direct_buffer_f_q, h_dirac_output_synthesis_state->gains_dir_prev_q ), Q31 ), Q1 ); + + *q_Cldfb = sub( add( add( h_dirac_output_synthesis_state->proto_direct_buffer_f_q, h_dirac_output_synthesis_state->gains_dir_prev_q ), q_align ), 32 ); move16(); /*-----------------------------------------------------------------* @@ -3561,9 +3619,21 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( set_zero_fx( h_dirac_output_synthesis_state->proto_power_diff_smooth_fx, h_dirac_output_synthesis_params->max_band_decorr * nchan_out_woLFE ); } + minimum_fx( q_cy_auto_dir_smooth_prev_local, nchan_out_woLFE, &h_dirac_output_synthesis_state->q_cy_auto_dir_smooth_prev ); + FOR( k = 0; k < nchan_out_woLFE; k++ ) + { + scale_sig32( h_dirac_output_synthesis_state->cy_auto_dir_smooth_prev_fx + ( k * num_freq_bands ), num_freq_bands, sub( h_dirac_output_synthesis_state->q_cy_auto_dir_smooth_prev, q_cy_auto_dir_smooth_prev_local[k] ) ); + } + set_zero_fx( h_dirac_output_synthesis_state->cy_auto_dir_smooth_fx, imult1616( num_freq_bands, nchan_out_woLFE ) ); + h_dirac_output_synthesis_state->q_cy_auto_dir_smooth = 0; + move16(); set_zero_fx( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx, imult1616( num_freq_bands, nchan_out_woLFE ) ); + h_dirac_output_synthesis_state->q_cy_cross_dir_smooth = 0; + move16(); set_zero_fx( h_dirac_output_synthesis_state->cy_auto_diff_smooth_fx, imult1616( num_freq_bands, nchan_out_woLFE ) ); + h_dirac_output_synthesis_state->q_cy_auto_diff_smooth = 0; + move16(); pop_wmops(); @@ -5938,7 +6008,9 @@ static void computeTargetPSDs_direct_subframe_fx( Word32 *cy_cross_dir_smooth, Word16 *q_cy_cross_dir_smooth ) { - Word16 ch_idx, cur_idx; + Word16 ch_idx, cur_idx, i, q_tmp; + Word64 W_tmp[CLDFB_NO_CHANNELS_MAX], W_max; + set64_fx( W_tmp, 0, CLDFB_NO_CHANNELS_MAX ); /* segment auxiliary buffer */ Word32 direct_power[CLDFB_NO_CHANNELS_MAX]; /* size: num_freq_bands. */ @@ -5951,12 +6023,25 @@ static void computeTargetPSDs_direct_subframe_fx( { cur_idx = imult1616( ch_idx, num_freq_bands ); - v_mult_fixed( direct_power, &direct_responses_square[cur_idx], &cy_auto_dir_smooth[cur_idx], num_freq_bands ); // (q_reference_power, Q31) -> q_reference_power - v_mult_fixed( direct_power, &direct_responses[cur_idx], &cy_cross_dir_smooth[cur_idx], num_freq_bands ); // (q_reference_power, Q31) -> q_reference_power + W_max = 0; + move64(); + FOR( i = 0; i < num_freq_bands; i++ ) + { + W_tmp[i] = W_mult_32_32( direct_power[i], direct_responses_square[cur_idx + i] ); // (q_reference_power, Q31) + 1 + move64(); + W_max = W_max < W_abs( W_tmp[i] ) ? W_abs( W_tmp[i] ) : W_max; + } + q_tmp = W_norm( W_max ); + FOR( i = 0; i < num_freq_bands; i++ ) + { + cy_auto_dir_smooth[cur_idx + i] = W_extract_h( W_shl( W_tmp[i], q_tmp ) ); + move32(); + } + q_cy_auto_dir_smooth[ch_idx] = add( *q_reference_power, q_tmp ); + move16(); + v_mult_fixed( direct_power, &direct_responses[cur_idx], &cy_cross_dir_smooth[cur_idx], num_freq_bands ); // (q_reference_power, Q31) -> q_reference_power } - *q_cy_auto_dir_smooth = *q_reference_power; - move16(); *q_cy_cross_dir_smooth = *q_reference_power; move16(); -- GitLab