Commit 48ece3d0 authored by Anjaneyulu Sana's avatar Anjaneyulu Sana
Browse files

Fix for 3GPP issue 1258: Decoder: Click artifact for Stereo to Mono Decoding

parent b4a8a48f
Loading
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -782,6 +782,7 @@ ivas_error ivas_core_dec_fx(
        /* for inactive frames with mono output, copy and (if necessary) downmix buffers */
        ELSE IF( EQ_16( hCPE->nchan_out, 1 ) )
        {
            Word16 shift1, shift2;
            sts[0] = hCPE->hCoreCoder[0];
            sts[1] = hCPE->hCoreCoder[1];

@@ -800,6 +801,15 @@ ivas_error ivas_core_dec_fx(
                move16();
                sts[1]->hHQ_core->Q_old_wtda = sub( 15, sts[1]->hHQ_core->exp_old_out );
                move16();

                shift1 = norm_arr( sts[0]->hHQ_core->old_out_fx, L_FRAME48k );
                shift2 = norm_arr( sts[1]->hHQ_core->old_out_fx, L_FRAME48k );
                scale_sig( sts[0]->hHQ_core->old_out_fx, L_FRAME48k, shift1 );
                scale_sig( sts[1]->hHQ_core->old_out_fx, L_FRAME48k, shift2 );
                sts[0]->hHQ_core->Q_old_wtda = add( sts[0]->hHQ_core->Q_old_wtda, shift1 );
                sts[1]->hHQ_core->Q_old_wtda = add( sts[1]->hHQ_core->Q_old_wtda, shift2 );
                move16();
                move16();
            }
        }