Commit 60bbeeff authored by vaillancour's avatar vaillancour
Browse files

Fix to correct wrong initialization, small expected impact

parent 5eb18d8b
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -126,4 +126,7 @@
#define NONBE_FIX_1748_SPAR_DIV_OPT                      /*Dlb: issue 1748: SPAR common div optimizations*/

#define FIX_ISSUE_1801_NOISE_FLOOR_REDUCTION    /* FhG: Fixed getScalefactor usage */

#define FIX_1818_WRONG_PIT_INIT                 /* VA: Fix wrong pitch initialization */

#endif
+12 −3
Original line number Diff line number Diff line
@@ -282,8 +282,11 @@ void core_switching_pre_enc_fx(

        tmp16 = shr( st_fx->L_frame, 6 );
        Copy( st_fx->old_pitch_buf_fx + tmp16, st_fx->old_pitch_buf_fx, tmp16 ); /*Q6*/
#ifdef FIX_1818_WRONG_PIT_INIT
        set16_fx( st_fx->old_pitch_buf_fx + tmp16, L_SUBFR << 6, tmp16 );
#else
        set16_fx( st_fx->old_pitch_buf_fx + tmp16, L_SUBFR, tmp16 );

#endif
        /* Reset old TD BWE buffers */
        IF( hBWE_TD != NULL )
        {
@@ -851,8 +854,11 @@ void core_switching_pre_enc_ivas_fx(
        }

        Copy( st_fx->old_pitch_buf_fx + tmp16, st_fx->old_pitch_buf_fx, tmp16 );
#ifdef FIX_1818_WRONG_PIT_INIT 
        set16_fx( st_fx->old_pitch_buf_fx + tmp16, L_SUBFR << 6, tmp16 );
#else
        set16_fx( st_fx->old_pitch_buf_fx + tmp16, L_SUBFR, tmp16 );

#endif
        /* Reset old ACELP buffers */
        test();
        IF( ( st_fx->element_mode == EVS_MONO ) && hLPDmem != NULL )
@@ -902,8 +908,11 @@ void core_switching_pre_enc_ivas_fx(

        tmp16 = shr( st_fx->L_frame, 6 );
        Copy( st_fx->old_pitch_buf_fx + tmp16, st_fx->old_pitch_buf_fx, tmp16 );
#ifdef FIX_1818_WRONG_PIT_INIT
        set16_fx( st_fx->old_pitch_buf_fx + tmp16, L_SUBFR << 6, tmp16 );
#else
        set16_fx( st_fx->old_pitch_buf_fx + tmp16, L_SUBFR, tmp16 );

#endif
        /* Reset old TD BWE buffers */
        IF( hBWE_TD != NULL )
        {
+8 −0
Original line number Diff line number Diff line
@@ -53,11 +53,19 @@ void CNG_reset_enc_fx(
    /* reset the pitch buffer in case of FRAME_NO_DATA or SID frames */
    IF( EQ_16( st_fx->L_frame, L_FRAME ) )
    {
#ifdef FIX_1818_WRONG_PIT_INIT
        set16_fx( pitch_buf, L_SUBFR << 6, NB_SUBFR );
#else
        set16_fx( pitch_buf, L_SUBFR, NB_SUBFR );
#endif
    }
    ELSE /* st->L_frame == L_FRAME16k */
    {
#ifdef FIX_1818_WRONG_PIT_INIT
        set16_fx( pitch_buf, L_SUBFR16k << 6, NB_SUBFR16k );
#else
        set16_fx( pitch_buf, L_SUBFR16k, NB_SUBFR16k );
#endif
    }

    set16_fx( voice_factors, 1, NB_SUBFR16k );