Commit 16035d34 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Fix for 3gpp issue 832: Differences between BASOP and float decoder for clipped inputs

parent 7f4c7817
Loading
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
@@ -1694,13 +1694,25 @@ ivas_error core_switching_post_dec_ivas_fx(
            }
            /* delay HQ synthesis to synchronize with ACELP synthesis */
            /* rescaling to the min exp of the 2 */
            IF( hHQ_core->Q_old_postdec )
            Word16 NonZero = 1;
            move16();
            FOR( i = 0; i < delay_comp; i++ )
            {
                Scale_sig( st_fx->delay_buf_out_fx, delay_comp, negate( hHQ_core->Q_old_postdec ) );
                IF( st_fx->delay_buf_out_fx[i] != 0 )
                {
                    NonZero = 0;
                    move16();
                    break;
                }

            }
            test();
            IF( hHQ_core->Q_old_postdec >= 0 || EQ_16( NonZero, 1 ) )
            {
                Scale_sig( st_fx->delay_buf_out_fx, delay_comp, negate( hHQ_core->Q_old_postdec ) );
                hHQ_core->Q_old_postdec = 0;
                move16();
            }
            move16();
            Qtmp = s_min( *Qsynth, hHQ_core->Q_old_postdec );
            Scale_sig( synth, output_frame, sub( Qtmp, *Qsynth ) );
            *Qsynth = Qtmp;
@@ -1711,8 +1723,7 @@ ivas_error core_switching_post_dec_ivas_fx(
            Word16 temp_buffer[L_FRAME48k];

            Copy( st_fx->delay_buf_out_fx, temp_buffer, delay_comp );
            Copy_Scale_sig( synth + sub( output_frame, delay_comp ), st_fx->delay_buf_out_fx, delay_comp, negate( hHQ_core->Q_old_postdec ) );
            hHQ_core->Q_old_postdec = 0;
            Copy( synth + sub( output_frame, delay_comp ), st_fx->delay_buf_out_fx, delay_comp );
            move16();
            Copy( synth, synth + delay_comp, sub( output_frame, delay_comp ) );
            Copy( temp_buffer, synth, delay_comp );
+0 −1
Original line number Diff line number Diff line
@@ -1402,7 +1402,6 @@ static ivas_error IVAS_DEC_GetTcSamples(
                    /*core_switching_post_dec*/
                    IF( hCPE->hCoreCoder[n]->hHQ_core != NULL )
                    {
                        hCPE->hCoreCoder[n]->hHQ_core->Q_old_postdec = 0;
                        hCPE->hCoreCoder[n]->hHQ_core->Q_old_wtda = 0;
                    }
                }