Commit 249f18ac authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Fix for LTV crashes and float code clean up

parent e9117df7
Loading
Loading
Loading
Loading
Loading
+49 −12
Original line number Diff line number Diff line
@@ -274,6 +274,7 @@ ivas_error pre_proc_front_ivas_fx(
    const Word16 MCT_flag,                                     /* i  : hMCT handle allocated (1) or not (0)    */
    const Word32 ivas_total_brate                              /* i  : IVAS total bitrate - for setting the DTX */
);
#ifdef IVAS_FLOAT_FIXED
ivas_error pre_proc_ivas(
    Encoder_State *st,                                          /* i/o: encoder state structure                 */
    const int16_t last_element_mode,                            /* i  : last element mode                       */
@@ -285,11 +286,11 @@ ivas_error pre_proc_ivas(
    float old_inp_16k[],                                        /* i/o: buffer of old input signal @ 16kHz      */
    float **inp,                                                /* o  : ptr. to inp. signal in the current frame*/
    float *ener,                                                /* o  : residual energy from Levinson-Durbin    */
    float A[NB_SUBFR16k * ( M + 1 )],                           /* i/o: A(z) unquantized for the 4 subframes    */
    float Aw[NB_SUBFR16k * ( M + 1 )],                          /* i/o: weighted A(z) unquantized for subframes */
    Word16 A[NB_SUBFR16k * ( M + 1 )],                           /* i/o: A(z) unquantized for the 4 subframes    */
    Word16 Aw[NB_SUBFR16k * ( M + 1 )],                          /* i/o: weighted A(z) unquantized for subframes */
    float epsP[M + 1],                                          /* i/o: LP prediction errors                    */
    float lsp_new[M],                                           /* i/o: LSPs at the end of the frame            */
    float lsp_mid[M],                                           /* i/o: LSPs in the middle of the frame         */
    Word16 lsp_new[M],                                           /* i/o: LSPs at the end of the frame            */
    Word16 lsp_mid[M],                                           /* i/o: LSPs in the middle of the frame         */
    float *new_inp_resamp16k,                                   /* o  : new input signal @16kHz, non pre-emphasised, used by the WB TBE/BWE */
    int16_t *Voicing_flag,                                      /* o  : voicing flag for HQ FEC                 */
    float old_wsp[],                                      /* i  : weighted input signal buffer            */
@@ -310,12 +311,39 @@ ivas_error pre_proc_ivas(
    Word32 enerBuffer_fx[CLDFB_NO_CHANNELS_MAX],
    Word16 e_enerBuffer,
    Word16 fft_buff_fx[2 * L_FFT],
    Word32 cor_map_sum_fx,
    Word16 exp_cor_map_sum,
    Word16 cor_map_sum_fx, //Q8
    Word16 *Q_new
#endif
);

#else
ivas_error pre_proc_ivas(
    Encoder_State *st,                                          /* i/o: encoder state structure                 */
    const int16_t last_element_mode,                            /* i  : last element mode                       */
    const int32_t element_brate,                                /* i  : element bitrate                         */
    const int32_t last_element_brate,                           /* i  : last element bitrate                    */
    const int16_t input_frame,                                  /* i  : frame length                            */
    float old_inp_12k8[],                                       /* i/o: buffer of old input signal              */
    float old_inp_16k[],                                        /* i/o: buffer of old input signal @ 16kHz      */
    float **inp,                                                /* o  : ptr. to inp. signal in the current frame*/
    float *ener,                                                /* o  : residual energy from Levinson-Durbin    */
    float A[NB_SUBFR16k * ( M + 1 )],                           /* i/o: A(z) unquantized for the 4 subframes    */
    float Aw[NB_SUBFR16k * ( M + 1 )],                          /* i/o: weighted A(z) unquantized for subframes */
    float epsP[M + 1],                                          /* i/o: LP prediction errors                    */
    float lsp_new[M],                                           /* i/o: LSPs at the end of the frame            */
    float lsp_mid[M],                                           /* i/o: LSPs in the middle of the frame         */
    float *new_inp_resamp16k,                                   /* o  : new input signal @16kHz, non pre-emphasised, used by the WB TBE/BWE */
    int16_t *Voicing_flag,                                      /* o  : voicing flag for HQ FEC                 */
    const float old_wsp[],                                      /* i  : weighted input signal buffer            */
    const int16_t loc_harm,                                     /* i  : harmonicity flag                        */
    const float cor_map_sum,                                    /* i  : speech/music clasif. parameter          */
    const int16_t vad_flag_dtx,                                 /* i  : HE-SAD flag with additional DTX HO      */
    const float enerBuffer[CLDFB_NO_CHANNELS_MAX],              /* i  : energy buffer                           */
    const float fft_buff[2 * L_FFT],                            /* i  : FFT buffer                              */
    const int16_t MCT_flag,                                     /* i  : hMCT handle allocated (1) or not (0)    */
    const int16_t vad_hover_flag,                               /* i  : VAD hangover flag                       */
    const int16_t flag_16k_smc                                  /* i  : flag to indicate if the OL SMC is run at 16 kHz */
);
#endif
/*! r: number of clipped samples */
uint32_t ivas_syn_output(
	float *synth[],                                             /* i/o: float synthesis signal                  */
@@ -498,18 +526,18 @@ ivas_error ivas_core_enc(
    float old_inp_12k8[][L_INP_12k8],                            /* i  : buffer of old input signal             */
    float old_inp_16k[][L_INP],                                  /* i  : buffer of old input signal             */
    float ener[],                                                /* i  : residual energy from Levinson-Durbin   */
    float A[][NB_SUBFR16k * ( M + 1 )],                          /* i  : A(z) unquantized for the 4 subframes   */
    float Aw[][NB_SUBFR16k * ( M + 1 )],                         /* i  : weighted A(z) unquantized for subframes*/
    Word16 A_fx[][NB_SUBFR16k * ( M + 1 )],                      /* i  : A(z) unquantized for the 4 subframes   */
    Word16 Aw_fx[][NB_SUBFR16k * ( M + 1 )],                     /* i  : weighted A(z) unquantized for subframes*/
    float epsP[][M + 1],                                         /* i  : LP prediction errors                   */
    float lsp_new[][M],                                          /* i  : LSPs at the end of the frame           */
    float lsp_mid[][M],                                          /* i  : LSPs in the middle of the frame        */
    Word16 lsp_new[][M],                                         /* i  : LSPs at the end of the frame       Q15 */
    Word16 lsp_mid[][M],                                         /* i  : LSPs in the middle of the frame    Q15 */
    const int16_t vad_hover_flag[],                              /* i  : VAD hanglover flag                     */
    int16_t attack_flag[],                                       /* i  : attack flag (GSC or TC)                */
    float realBuffer[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: real buffer                            */
    float imagBuffer[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: imag buffer                            */
    float old_wsp[][L_WSP],                                      /* i  : weighted input signal buffer           */
    const int16_t loc_harm[],                                    /* i  : harmonicity flag                       */
    const float cor_map_sum[],                                   /* i  : speech/music clasif. parameter         */
    const Word16 cor_map_sum[],                                   /* i  : speech/music clasif. parameter     Q8 */
    const int16_t vad_flag_dtx[],                                /* i  : HE-SAD flag with additional DTX HO     */
    float enerBuffer[][CLDFB_NO_CHANNELS_MAX],                   /* i  : energy buffer                          */
    float fft_buff[][2 * L_FFT],                                 /* i  : FFT buffer                             */
@@ -2449,12 +2477,21 @@ void InternalTCXDecoder(
    int16_t *gain_tcx_q                                         /* o  : quantized global gain (at low bitrates) */
);

#ifndef IVAS_FLOAT_FIXED
void stereo_mdct_core_enc(
    CPE_ENC_HANDLE hCPE,                                        /* i/o: CPE encoder structure                   */
    float new_samples[CPE_CHANNELS][L_INP],                     /* i  : new samples                             */
    float old_wsp[CPE_CHANNELS][L_WSP],                         /* i  : 12.8kHz weighted speech (for LTP        */
    float pitch_buf[CPE_CHANNELS][NB_SUBFR16k]                  /* o  : floating pitch for each subframe        */
);
#else
void stereo_mdct_core_enc(
    CPE_ENC_HANDLE hCPE,                                        /* i/o: CPE encoder structure                   */
    float new_samples[CPE_CHANNELS][L_INP],                     /* i  : new samples                             */
    float old_wsp[CPE_CHANNELS][L_WSP],                         /* i  : 12.8kHz weighted speech (for LTP        */
    Word16 pitch_buf_fx[CPE_CHANNELS][NB_SUBFR16k]                  /* o  : floating pitch for each subframe        */
);
#endif

void initMdctStereoEncData(
    STEREO_MDCT_ENC_DATA *hStereoMdct,                          /* i/o: mdct stereo parameters structure        */
+81 −66
Original line number Diff line number Diff line
@@ -677,11 +677,10 @@ static void ivas_get_pred_coeffs_enc_fx(
    }
    ELSE
    {
        Word64 dm_alpha64[IVAS_MAX_NUM_BANDS];
        Word64 real64[IVAS_SPAR_MAX_CH - 1];
        Word64 re, dm_y;
        Word16 dm_beta_re_q;
        Word16 dm_alpha64_q[IVAS_MAX_NUM_BANDS];
        Word16 dm_alpha_q[IVAS_MAX_NUM_BANDS];
        Word16 dm_v_re_q[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS];
        Word32 dm_alpha[IVAS_MAX_NUM_BANDS], dm_v_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS];
        Word32 dm_g[IVAS_MAX_NUM_BANDS];
@@ -693,6 +692,7 @@ static void ivas_get_pred_coeffs_enc_fx(
        Word32 L_tmp1, L_tmp2;
        Word16 L_tmp1_q, L_tmp2_q;
        Word16 den_f_e, s_dm_f;
        Word16 guard_bits;

        IF( EQ_16( dyn_active_w_flag, 1 ) )
        {
@@ -706,68 +706,83 @@ static void ivas_get_pred_coeffs_enc_fx(
        }
        g_th_sq = Mpy_32_32( activew_quad_thresh, activew_quad_thresh ); // Q27

        set32_fx( dm_alpha, 0, IVAS_MAX_NUM_BANDS );
        set64_fx( dm_alpha64, 0, IVAS_MAX_NUM_BANDS );
        set16_fx( dm_alpha64_q, 31, IVAS_MAX_NUM_BANDS );

        FOR( i = 1; i < in_chans; i++ )
        {
        guard_bits = sub( find_guarded_bits_fx( in_chans ), 1 );
        FOR( k = start_band; k < end_band; k++ )
        {
                // IVAS_CALCULATE_SQ_ABS_N( cov_real[i][0][k], abs_value );
                abs_value64 = W_mult0_32_32( cov_real[i][0][k], cov_real[i][0][k] ); // Q = 2 * q_cov_real[i][0][k]
                tmp_shift = W_norm( abs_value64 );
                IF( abs_value64 != 0 )
            IF( cov_real[1][0][k] == 0 )
            {
                    q_tmp = sub( add( shl( q_cov_real[i][0][k], 1 ), tmp_shift ), 32 );
                tmp64 = 0;
                move64();
                dm_alpha_q[k] = 127;
                move16();
            }
            ELSE
            {
                    q_tmp = 31;
                tmp64 = W_shr( W_mult0_32_32( cov_real[1][0][k], cov_real[1][0][k] ), guard_bits ); // Q = 2 * q_cov_real[1][0][k] - guard_bits
                dm_alpha_q[k] = sub( shl( q_cov_real[1][0][k], 1 ), guard_bits );
                move16();
            }
                IF( LT_16( q_tmp, dm_alpha64_q[k] ) )
            FOR( i = 2; i < in_chans; i++ )
            {
                // IVAS_CALCULATE_SQ_ABS_N( cov_real[i][0][k], abs_value );
                IF( cov_real[i][0][k] != 0 )
                {
                    abs_value64 = W_shr( W_mult0_32_32( cov_real[i][0][k], cov_real[i][0][k] ), guard_bits ); // Q = 2 * q_cov_real[i][0][k] - guard_bits
                    q_tmp = sub( shl( q_cov_real[i][0][k], 1 ), guard_bits );
                    tmp_shift = sub( q_tmp, dm_alpha_q[k] );

                    IF( tmp_shift < 0 )
                    {
                    dm_alpha64[k] = W_add( W_shr( dm_alpha64[k], sub( dm_alpha64_q[k], q_tmp ) ), W_extract_h( W_shl( abs_value64, tmp_shift ) ) ); // Q=q_tmp
                        IF( LE_16( tmp_shift, -63 ) )
                        {
                            tmp64 = abs_value64;
                            move64();
                    dm_alpha64_q[k] = q_tmp;
                        }
                        ELSE
                        {
                            tmp64 = W_add( W_shl( tmp64, tmp_shift ), abs_value64 ); // Q=q_tmp
                        }
                        dm_alpha_q[k] = q_tmp;
                        move16();
                    }
                    ELSE
                    {
                    tmp_shift = sub( add( q_tmp, sub( 32, tmp_shift ) ), dm_alpha64_q[k] );
                    IF( LT_16( tmp_shift, 63 ) )
                        IF( LE_16( tmp_shift, 63 ) )
                        {
                        dm_alpha64[k] = W_add( dm_alpha64[k], W_shr( abs_value64, tmp_shift ) ); // Q=dm_alpha64_q[k]
                        move64();
                            tmp64 = W_add( tmp64, W_shr( abs_value64, tmp_shift ) ); // Q=dm_alpha_q[k]
                        }
                    }
                }
            }

        FOR( k = start_band; k < end_band; k++ )
        {
            tmp_shift = W_norm( dm_alpha64[k] );
            IF( dm_alpha64[k] != 0 )
            IF( tmp64 != 0 )
            {
                e_tmp = sub( 31, sub( add( dm_alpha64_q[k], tmp_shift ), 32 ) );
                tmp_shift = W_norm( tmp64 );
                e_tmp = sub( 63, add( dm_alpha_q[k], tmp_shift ) );
                dm_alpha[k] = Sqrt32( W_extract_h( W_shl( tmp64, tmp_shift ) ), &e_tmp ); // Q=31-e_tmp
                move32();
                dm_alpha_q[k] = sub( 31, e_tmp );
                move16();

                div_factor[k] = BASOP_Util_Divide3232_Scale( ONE_IN_Q31 /*1 Q31*/, dm_alpha[k], &s_div ); // Q=15-(dm_alpha_q[k]+ s_div-31)
                move16();

                div_factor_e[k] = sub( add( dm_alpha_q[k], s_div ), 31 );
                move16();
            }
            ELSE
            {
                e_tmp = 0;
                move16();
            }
            dm_alpha[k] = Sqrt32( W_extract_h( W_shl( dm_alpha64[k], tmp_shift ) ), &e_tmp ); // Q=31-e_tmp
                dm_alpha[k] = 0;
                move32();
            dm_alpha64_q[k] = sub( 31, e_tmp );
                dm_alpha_q[k] = 31;
                move16();

            div_factor[k] = BASOP_Util_Divide3232_Scale( ONE_IN_Q31 /*1 Q31*/, L_max( dm_alpha[k], 1 ), &s_div ); // Q=15-(dm_alpha64_q[k]+ s_div-31)
                div_factor[k] = 22204;
                move16();

            div_factor_e[k] = sub( add( dm_alpha64_q[k], s_div ), 31 );
                div_factor_e[k] = -37;
                move16();
            }
        }

        FOR( i = 0; i < pred_dim; i++ )
        {
@@ -903,16 +918,16 @@ static void ivas_get_pred_coeffs_enc_fx(
            dm_w = cov_real[0][0][b]; // q_cov_real[0][0][b]
            move32();
            den_f = L_max( dm_w, 1 );                                                             // q_cov_real[0][0][b]
            passive_g = L_deposit_l( BASOP_Util_Divide3232_Scale( dm_alpha[b], den_f, &s_div ) ); // dm_alpha64_q[b] - q_cov_real[0][0][b] + 15 - s_div
            passive_g = L_deposit_l( BASOP_Util_Divide3232_Scale( dm_alpha[b], den_f, &s_div ) ); // dm_alpha_q[b] - q_cov_real[0][0][b] + 15 - s_div

            div_shift = sub( Q29, add( sub( dm_alpha64_q[b], q_cov_real[0][0][b] ), sub( 15, s_div ) ) );
            div_shift = sub( Q29, add( sub( dm_alpha_q[b], q_cov_real[0][0][b] ), sub( 15, s_div ) ) );
            passive_g = L_shl_sat( passive_g, div_shift ); // Q = 29

            IF( EQ_16( dyn_active_w_flag, 1 ) )
            {
                dm_alpha[b] = 0;
                move32();
                dm_alpha64_q[b] = 0;
                dm_alpha_q[b] = 0;
                move16();
                dm_w = 0;
                move32();
@@ -985,10 +1000,10 @@ static void ivas_get_pred_coeffs_enc_fx(

                den_f = L_max( den_f, 1 ); // q_tmp + tmp_shift - 32

                DM_F[b] = L_deposit_l( BASOP_Util_Divide3232_Scale( Mpy_32_32( dm_f_local, dm_alpha[b] ), den_f, &s_div ) ); // Q30 + dm_alpha64_q[b] - 31 - q_tmp - tmp_shift + 32 + 15 - s_div
                DM_F[b] = L_deposit_l( BASOP_Util_Divide3232_Scale( Mpy_32_32( dm_f_local, dm_alpha[b] ), den_f, &s_div ) ); // Q30 + dm_alpha_q[b] - 31 - q_tmp - tmp_shift + 32 + 15 - s_div
                move32();

                DM_F_q[b] = add( sub( sub( dm_alpha64_q[b], add( q_tmp, tmp_shift ) ), s_div ), ( 30 - 31 + 32 + 15 ) );
                DM_F_q[b] = add( sub( sub( dm_alpha_q[b], add( q_tmp, tmp_shift ) ), s_div ), ( 30 - 31 + 32 + 15 ) );
                move16();

                IF( LT_32( ONE_IN_Q30, L_shl_sat( DM_F[b], sub( Q30, DM_F_q[b] ) ) ) ) // q30
@@ -1025,7 +1040,7 @@ static void ivas_get_pred_coeffs_enc_fx(
                L_tmp2 = W_extract_h( tmp64 ); // Q=q_tmp+tmp_shift-32
                L_tmp2_q = sub( add( q_tmp, tmp_shift ), 32 );

                tmp64 = W_shl( W_mult0_32_32( dm_alpha[b], DM_F[b] ), 1 ); // Q=dm_alpha64_q[b]+DM_F_q[b]
                tmp64 = W_shl( W_mult0_32_32( dm_alpha[b], DM_F[b] ), 1 ); // Q=dm_alpha_q[b]+DM_F_q[b]
                tmp_shift = sub( W_norm( tmp64 ), 2 );
                IF( tmp64 == 0 )
                {
@@ -1034,10 +1049,10 @@ static void ivas_get_pred_coeffs_enc_fx(
                }
                ELSE
                {
                    tmp64 = W_shl( tmp64, tmp_shift ); // Q=dm_alpha64_q[b]+DM_F_q[b]+tmp_shift
                    tmp64 = W_shl( tmp64, tmp_shift ); // Q=dm_alpha_q[b]+DM_F_q[b]+tmp_shift
                }
                L_tmp1 = W_extract_h( tmp64 ); // DM_F_q[b] + dm_alpha64_q[b] + tmp_shift - 32
                L_tmp1_q = sub( add( add( DM_F_q[b], dm_alpha64_q[b] ), tmp_shift ), 32 );
                L_tmp1 = W_extract_h( tmp64 ); // DM_F_q[b] + dm_alpha_q[b] + tmp_shift - 32
                L_tmp1_q = sub( add( add( DM_F_q[b], dm_alpha_q[b] ), tmp_shift ), 32 );

                IF( LT_16( L_tmp2_q, L_tmp1_q ) )
                {
@@ -1083,15 +1098,15 @@ static void ivas_get_pred_coeffs_enc_fx(

                tmp_shift = sub( norm_l( dm_alpha[b] ), 1 );

                IF( LT_16( L_tmp2_q, add( dm_alpha64_q[b], tmp_shift ) ) )
                IF( LT_16( L_tmp2_q, add( dm_alpha_q[b], tmp_shift ) ) )
                {
                    L_tmp1 = L_add( L_shr( dm_alpha[b], sub( dm_alpha64_q[b], L_tmp2_q ) ), L_tmp2 ); // Q=L_tmp2_q
                    L_tmp1 = L_add( L_shr( dm_alpha[b], sub( dm_alpha_q[b], L_tmp2_q ) ), L_tmp2 ); // Q=L_tmp2_q
                    L_tmp1_q = L_tmp2_q;
                    move16();
                }
                ELSE
                {
                    L_tmp1_q = add( dm_alpha64_q[b], tmp_shift );
                    L_tmp1_q = add( dm_alpha_q[b], tmp_shift );
                    L_tmp1 = L_add( L_shl( dm_alpha[b], tmp_shift ), L_shr( L_tmp2, sub( L_tmp2_q, L_tmp1_q ) ) ); // Q=L_tmp1_q
                }

@@ -1107,7 +1122,7 @@ static void ivas_get_pred_coeffs_enc_fx(
                Word16 num_f_e;

                /* quadratic activeW */
                tmp64 = W_shl( W_mult0_32_32( dm_alpha[b], activew_quad_thresh ), 1 ); // Q=dm_alpha64_q[b]+29
                tmp64 = W_shl( W_mult0_32_32( dm_alpha[b], activew_quad_thresh ), 1 ); // Q=dm_alpha_q[b]+29
                tmp_shift = sub( W_norm( tmp64 ), 1 );
                IF( tmp64 == 0 )
                {
@@ -1116,15 +1131,15 @@ static void ivas_get_pred_coeffs_enc_fx(
                }
                ELSE
                {
                    tmp64 = W_shl( tmp64, tmp_shift ); // Q=dm_alpha64_q+29+tmp_shift
                    tmp64 = W_shl( tmp64, tmp_shift ); // Q=dm_alpha_q+29+tmp_shift
                }
                L_tmp1 = W_extract_h( tmp64 );                                       // Q29 + dm_alpha64_q[b] + tmp_shift - 32
                L_tmp1_q = sub( add( add( Q29, dm_alpha64_q[b] ), tmp_shift ), 32 ); // Q=dm_alpha64_q+29+1+tmp_shift-32
                L_tmp1 = W_extract_h( tmp64 );                                     // Q29 + dm_alpha_q[b] + tmp_shift - 32
                L_tmp1_q = sub( add( add( Q29, dm_alpha_q[b] ), tmp_shift ), 32 ); // Q=dm_alpha_q+29+1+tmp_shift-32

                num_f = BASOP_Util_Add_Mant32Exp( dm_beta_re, sub( 31, dm_beta_re_q ), L_negate( L_tmp1 ), sub( 31, L_tmp1_q ), &num_f_e ); // Q=31-num_f_e

                sqrt_val = Mpy_32_32( Mpy_32_32( dm_alpha[b], dm_alpha[b] ), g_th_sq );                                                                                                                                                                                                                  //((2*dm_alpha64_q[b]-31)+27-31)-2 ,reducing the Q by 2 instead of multiplication by 4
                val_e = sub( 31, sub( sub( add( sub( shl( dm_alpha64_q[b], 1 ), 31 ), 27 ), 31 ), 2 ) );                                                                                                                                                                                                 // reducing the Q by 2 instead of multiplication by 4
                sqrt_val = Mpy_32_32( Mpy_32_32( dm_alpha[b], dm_alpha[b] ), g_th_sq );                                                                                                                                                                                                                  //((2*dm_alpha_q[b]-31)+27-31)-2 ,reducing the Q by 2 instead of multiplication by 4
                val_e = sub( 31, sub( sub( add( sub( shl( dm_alpha_q[b], 1 ), 31 ), 27 ), 31 ), 2 ) );                                                                                                                                                                                                   // reducing the Q by 2 instead of multiplication by 4
                sqrt_val = BASOP_Util_Add_Mant32Exp( sqrt_val, val_e, Mpy_32_32( dm_beta_re, dm_beta_re ), sub( 31, sub( shl( dm_beta_re_q, 1 ), 31 ) ), &val_e );                                                                                                                                       // q=31-val_e
                sqrt_val = BASOP_Util_Add_Mant32Exp( sqrt_val, val_e, L_negate( Mpy_32_32( Mpy_32_32( dm_beta_re, g_th_sq ), dm_w ) ), sub( 31, sub( sub( add( sub( add( dm_beta_re_q, 27 ), 31 ), q_cov_real[0][0][b] ), 31 ), 2 ) ) /* reducing the Q by 2 instead of multiplication by 4*/, &val_e ); // q=31-val_e
                // val_e = norm_l( sqrt_val );
+91 −0

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -2390,7 +2390,7 @@ ivas_error acelp_core_enc(
#else
ivas_error acelp_core_enc(
    Encoder_State *st,                  /* i/o: encoder state structure                 */
    /*const*/ float inp[],              /* i  : input signal of the current frame       */
    const Word16 inp[],                 /* i  : input signal of the current frame       */
    Word16 A[NB_SUBFR16k * ( M + 1 )],  /* i  : A(z) unquantized for the 4 subframes    */
    Word16 Aw[NB_SUBFR16k * ( M + 1 )], /* i  : weighted A(z) unquant. for subframes    */
    const Word32 epsP[M + 1],           /* i  : LP prediction errors                    */
@@ -6020,7 +6020,7 @@ void core_switching_post_enc(
    // const float *old_inp_16k,  /* i  : old input signal @16kHz             */
    float *old_inp_16k, /* i  : old input signal @16kHz             */
    // const float A[]            /* i  : unquant. LP filter coefs.           */
    float A[], /* i  : unquant. LP filter coefs.           */
    Word16 A_fx[], /* i  : unquant. LP filter coefs.           */
    Word16 Q_new );
#endif
ivas_error core_switching_post_dec(
+21 −0
Original line number Diff line number Diff line
@@ -1102,6 +1102,20 @@ void autocorr_fx(
    const Word16 sym_flag /* i  : symmetric window flag           */
);
void autocorr_ivas_fx(
    const Word16 x[],      /* i  : Input signal                Qx  */
    const Word16 Qx,       /* i  : Q facor of Input signal     Q0  */
    const Word16 m,        /* i  : LPC order                   Q0  */
    Word16 r_h[],          /* o  : Autocorrelations  (msb)     Q15(Q_r -16) */
    Word16 r_l[],          /* o  : Autocorrelations  (lsb)     Q(r)-1   */
    Word16 *Q_r,           /* o  : normalisation shift of r    Q0  */
    const Word16 len,      /* i  : Frame lenght                    */
    const Word16 *wind,    /* i  : Window used                     */
    const Word16 rev_flag, /* i  : flag to reverse window          */
    const Word16 sym_flag, /* i  : symmetric window flag           */
    const Word16 no_thr    /* i  : flag to avoid thresholding      */
);
void autocorr_fx_32(
    const Word16 x[],   /* i  : Input signal                Q(q_x)    */
    const Word16 m,     /* i  : LPC order                   Q0  */
@@ -11128,4 +11142,11 @@ void configureCldfb_ivas_enc_fx(
    const Word32 sampling_rate        /* i  : sampling rate             */
);
void core_switching_post_enc_ivas_fx(
    Encoder_State *st,       /* i/o: encoder state structure             */
    Word16 *old_inp_12k8_fx, /* i  : old input signal @12.8kHz           */
    Word16 *old_inp_16k_fx,  /* i  : old input signal @16kHz             */
    Word16 A_fx[],           /* i  : unquant. LP filter coefs.           */
    Word16 Q_new );
#endif
Loading