Commit 27af412d authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '3gpp_issue_1447_fix' into 'main'

[allow regression] Fix for 3GPP issue 1447: BASOP encoder: W channel sounds dull and distorted in...

See merge request !1385
parents 61ec8773 2b8875ee
Loading
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -494,9 +494,9 @@ void ivas_analy_sp_fx(
        }
        ELSE
        {
            Word16 scale = 0;
            Word16 scale = 0, shift;
            move16();

            shift = s_min( norm_arr( speech + 3 * ( L_SUBFR / 2 ) - L_FFT / 2, L_FFT ), norm_arr( speech + 7 * ( L_SUBFR / 2 ) - L_FFT / 2, L_FFT ) );
            FOR( i_subfr = 0; i_subfr <= 1; i_subfr++ )
            {
                /* set pointer to the beginning of the signal for spectral analysis */
@@ -507,27 +507,26 @@ void ivas_analy_sp_fx(
                    /* set the pointer for second analysis window */
                    pt = speech + 7 * ( L_SUBFR / 2 ) - L_FFT / 2;
                }

                /* Clear 1st value of 1st part, copy 1st value of 2nd part */
                pt_fft[0] = 0;
                move16();
                pt_fft[L_FFT / 2] = pt[L_FFT / 2]; // Q_new - preemph_bits
                pt_fft[L_FFT / 2] = shl( pt[L_FFT / 2], shift ); // (Q_new + shift) - preemph_bits
                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_fft[i] = mult_r( shl( pt[i], shift ), sqrt_han_window_fx[i] ); // (Q_new + shift) - preemph_bits
                    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_fft[L_FFT - i] = mult_r( shl( pt[L_FFT - i], shift ), sqrt_han_window_fx[i] ); // (Q_new + shift) - preemph_bits
                    move16();
                }

                /* compute the spectrum */
                fft_rel_16_32fx( pt_fft, &scale, i_subfr, L_FFT, LOG2_L_FFT );
                *q_fft_buff = add( Q_new, scale ); // resultant q for fft_buff
                *q_fft_buff = add( add( Q_new, shift ), scale ); // resultant q for fft_buff
                move16();
                IF( EQ_16( i_subfr, 1 ) )
                {