Commit a23e871d authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Fix for 3GPP issue 1466: Large deviations observed with the extrapolation of...

Fix for 3GPP issue 1466: Large deviations observed with the extrapolation of shifted channel by TD-ITD compensation in stereo

Link #1466, #1463
parent 8d9f712d
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -785,6 +785,9 @@ ivas_error ivas_cpe_enc_fx(
        }

        stereo_td_itd_mdct_stereo_fx( hCPE, vad_flag_dtx, vad_hover_flag, input_frame );

        Copy_Scale_sig_16_32_no_sat( sts[0]->input_fx - input_frame, sts[0]->input32_fx - input_frame, shl( input_frame, 1 ), sub( sts[0]->q_inp32, sts[0]->q_inp ) );
        Copy_Scale_sig_16_32_no_sat( sts[1]->input_fx - input_frame, sts[1]->input32_fx - input_frame, shl( input_frame, 1 ), sub( sts[1]->q_inp32, sts[1]->q_inp ) );
    }

    /*----------------------------------------------------------------*
+7 −1
Original line number Diff line number Diff line
@@ -575,9 +575,12 @@ void stereo_td_itd_mdct_stereo_fx(
        /*call ITD function*/
        stereo_dft_enc_compute_itd_fx( hCPE, DFT_fx[0], DFT_tmp_e[0], DFT_fx[1], DFT_tmp_e[1], STEREO_DFT_OFFSET, input_frame, vad_flag_dtx, vad_hover_flag, bin_nrgL_fx, bin_nrgL_e, bin_nrgR_fx, bin_nrgR_e );

        q_com = MAX_16;
        move16();

        FOR( n = 0; n < CPE_CHANNELS; n++ )
        {
            q_com = add( norm_arr( hCPE->hCoreCoder[n]->input_fx, input_frame ), hCPE->hCoreCoder[n]->q_inp );
            q_com = s_min( q_com, add( norm_arr( hCPE->hCoreCoder[n]->input_fx, input_frame ), hCPE->hCoreCoder[n]->q_inp ) );
            q_com = s_min( q_com, add( norm_arr( hCPE->hCoreCoder[n]->old_input_signal_fx, input_frame ), hCPE->hCoreCoder[n]->q_old_inp ) );
            q_com = s_min( q_com, add( norm_arr( hCPE->input_mem_fx[n], hStereoMdct->hDft_ana->dft_ovl ), hCPE->q_input_mem[n] ) );

@@ -586,7 +589,10 @@ void stereo_td_itd_mdct_stereo_fx(
                q_com = 0;
                move16();
            }
        }

        FOR( n = 0; n < CPE_CHANNELS; n++ )
        {
            scale_sig( hCPE->hCoreCoder[n]->input_fx, input_frame, sub( q_com, hCPE->hCoreCoder[n]->q_inp ) );
            hCPE->hCoreCoder[n]->q_inp = q_com;
            move16();