Commit eed7894d authored by Manuel Jander's avatar Manuel Jander
Browse files

Align scale also across channels for stereo_td_channel_extrapolate_fx() to operate correctly.

parent 310c2267
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -701,16 +701,17 @@ ivas_error ivas_cpe_enc_fx(
        move16();

#ifdef NONBE_FIX_ISSUE_2206
        q_com = MAX_16;
        move16();
        /* Align Q values of the signals that need to be aligned in stereo_td_channel_extrapolate_fx() */
        FOR( n = 0; n < CPE_CHANNELS; n++ )
        {
            q_com = MAX_16;
            move16();

            q_com = s_min( q_com, sub( add( L_norm_arr( sts[n]->input32_fx, input_frame ), sts[n]->q_inp32 ), 16 ) );
            q_com = s_min( q_com, add( norm_arr( hCPE->input_mem_fx[n], hCPE->hStereoDft->dft_ovl ), hCPE->q_input_mem[n] ) );
            q_com = s_min( q_com, sub( add( L_norm_arr( sts[n]->old_input_signal32_fx, input_frame ), sts[n]->q_old_inp32 ), 16 ) );

        }
        FOR( n = 0; n < CPE_CHANNELS; n++ )
        {
            Copy_Scale_sig_32_16( sts[n]->input32_fx, sts[n]->input_fx, input_frame, sub( q_com, sts[n]->q_inp32 ) );
            sts[n]->q_inp = q_com;
            move16();