Commit 605ab23b authored by Nishant S Kulgod's avatar Nishant S Kulgod
Browse files

commit 1

parent 12778592
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -117,4 +117,5 @@
#define FIX_ISSUE_1152                          /* Ittiam: Fix for issue 1152: Assertion error observed in evs_enc_fx (with option stereo_dmx_evs) from find_tilt_fx function*/
#define FIX_ISSUE_1156                          /* Ittiam: Fix for Issue 1156: Encoder crash for Stereo at 32kbps in SWB_BWE_encoding_ivas_fx() */
#define FIX_DISCLAIMER                             /* VA: Add disclaimer for external renderer + Add info about IVAS reference version (FLP issue 1225) */
#define FIX_ISSUE_1167                          /* Ittiam: Fix for Issue 1167: Encoder crash for OSBA ISM3SBA1 at 13.2 and 16.4 kbps in gauss_L2_ivas_fx() */
#endif
+11 −7
Original line number Diff line number Diff line
@@ -448,7 +448,7 @@ void ivas_analy_sp_fx(
    const Word16 element_mode, /* i  : element mode                                    Q0*/
    CPE_ENC_HANDLE hCPE,       /* i/o: CPE encoder structure                           */
    const Word32 input_Fs,     /* i  : input sampling rate                             Q0*/
    Word16 *speech,            /* i  : speech buffer                          Q_new - preemph_bits */
    Word16 *speech,            /* i  : speech buffer                          Q_new */
    const Word16 Q_new,        /* i  : current scaling exp                    Q0                 */
    Word32 *fr_bands,          /* o  : energy in critical frequency bands     q_fr_bands */
    Word16 *q_fr_bands,        /* o  : energy in critical frequency bands     Q0 */
@@ -475,6 +475,7 @@ void ivas_analy_sp_fx(
    Word32 *pt_bands;
    Word32 Ltmp;
    Word16 *pt_fft;
    Word32 pt_fft32[L_FFT];
    Word16 exp, tmp;
    Word64 LEtot;
    LEtot = 0;
@@ -525,26 +526,29 @@ void ivas_analy_sp_fx(
                }

                /* Clear 1st value of 1st part, copy 1st value of 2nd part */
                pt_fft[0] = 0;
                pt_fft32[0] = 0;
                move16();
                pt_fft[L_FFT / 2] = pt[L_FFT / 2]; // Q_new - preemph_bits
                pt_fft32[L_FFT / 2] = L_deposit_h( pt[L_FFT / 2] ); // Q_new + 16
                move16();

                FOR( i = 1; i < L_FFT / 2; i++ )
                {
                    /* 1st windowed part */
                    pt_fft[i] = mult_r( pt[i], sqrt_han_window_fx[i] ); // Q_new - preemph_bits
                    pt_fft32[i] = L_mult( pt[i], sqrt_han_window_fx[i] ); // Q_new + 16
                    move16();

                    /* 2nd windowed part  */
                    pt_fft[L_FFT - i] = mult_r( pt[L_FFT - i], sqrt_han_window_fx[i] ); // Q_new - preemph_bits
                    pt_fft32[L_FFT - i] = L_mult( pt[L_FFT - i], sqrt_han_window_fx[i] ); // Q_new + 16
                    move16();
                }

                scale_sig( pt_fft, L_FFT, scale );
                scale_sig32( pt_fft32, L_FFT, scale );

                /* compute the spectrum */
                fft_rel_fx( pt_fft, L_FFT, LOG2_L_FFT );
                fft_rel_fx32( pt_fft32, L_FFT, LOG2_L_FFT ); // Q_new + 16 + scale

                /* Copying the fft data to original 16-bit buffer */
                Copy_Scale_sig32_16( pt_fft32, pt_fft, L_FFT, 0 );

                /* find energy per critical band */
                ivas_find_enr( pt_fft, *q_fft_buff, pt_bands, q_fr_bands, lf_E + i_subfr * VOIC_BINS, q_lf_E, &LEtot, min_band, max_band,
+19 −1
Original line number Diff line number Diff line
@@ -143,14 +143,24 @@ void gauss_L2_ivas_fx(
    *gain = L_deposit_l( 0 );
    move32();
    /*Update correlations for gains coding */
#ifdef FIX_ISSUE_1167
    tmp32 = L_shr( 21474836l /*0.01f Q31*/, 31 - 16 );   /* Q16 */
    tmp32_2 = L_shr( 21474836l /*0.01f Q31*/, 31 - 16 ); /* Q16 */
    FOR( i = 0; i < L_SUBFR; i++ )
    {
        tmp16 = shr( y11[i], 1 );
        tmp32 = L_mac0( tmp32, tmp16, tmp16 );               /* Q16 */
        tmp32_2 = L_mac0( tmp32_2, tmp16, shr( y2[i], 1 ) ); /* Q16 */
    }
#else
    tmp32 = L_shr( 21474836l /*0.01f Q31*/, 31 - 18 );   /* Q18 */
    tmp32_2 = L_shr( 21474836l /*0.01f Q31*/, 31 - 18 ); /* Q18 */

    FOR( i = 0; i < L_SUBFR; i++ )
    {
        tmp32 = L_mac0( tmp32, y11[i], y11[i] );    /* Q18 */
        tmp32_2 = L_mac0( tmp32_2, y11[i], y2[i] ); /* Q18 */
    }
#endif

    tmp16 = norm_l( tmp32 );
    // To be checked
@@ -159,13 +169,21 @@ void gauss_L2_ivas_fx(
#else
    g_corr->y1y1 = round_fx( L_shl( tmp32, tmp16 ) );
#endif
#ifdef FIX_ISSUE_1167
    g_corr->y1y1_e = sub( 31 - 16, tmp16 );
#else
    g_corr->y1y1_e = sub( 31 - 18, tmp16 );
#endif
    move16();
    move16();

    tmp16 = norm_l( tmp32_2 );
    g_corr->y1y2 = round_fx_sat( L_shl( tmp32_2, tmp16 ) );
#ifdef FIX_ISSUE_1167
    g_corr->y1y2_e = sub( 31 - 16, tmp16 );
#else
    g_corr->y1y2_e = sub( 31 - 18, tmp16 );
#endif
    move16();
    move16();
}
+10 −1
Original line number Diff line number Diff line
@@ -2364,7 +2364,16 @@ static void reduce_metadata_further_fx(
        }
    }

    tmp2 = W_norm( W_tmp );
    IF( W_tmp != 0 )
    {
        tmp2 = sub( W_norm( W_tmp ), 1 ); // Usage of guard bits to avoid the large values of onset_detector in multiplication
    }
    ELSE
    {
        tmp2 = 0;
        move16();
    }

    tmp2 = s_min( 32, tmp2 );
    totalEnergySum = W_extract_h( W_shl( W_tmp, tmp2 ) );
    tmp2 = sub( tmp2, 32 );