Commit 03f2b394 authored by Mohammadreza Naghibzadeh's avatar Mohammadreza Naghibzadeh
Browse files

Normalize inputs of calc_residu_fx() and revert normalization of inputs in find_targets_ivas_fx().

parent 022113be
Loading
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -666,7 +666,22 @@ ivas_error acelp_core_enc_fx(
         * Calculation of LP residual (filtering through A[z] filter)
         *---------------------------------------------------------------*/

#ifdef FIX_BASOP_2517_CLICK_IN_OMASA_LTV
        Word16 scf = norm_arr( inp - M, add( st->L_frame, M ) );
        IF( GT_16( scf, 0 ) )
        {
            Word16 inp_local_acelp[L_FRAME16k + M];
            Copy_Scale_sig( inp - M, inp_local_acelp, add( st->L_frame, M ), scf );
            calc_residu_fx( st, inp_local_acelp + M, res_fx, Aq );
            scale_sig( res_fx, st->L_frame, negate( scf ) );
        }
        ELSE
        {
            calc_residu_fx( st, inp, res_fx, Aq );
        }
#else
        calc_residu_fx( st, inp, res_fx, Aq );
#endif

        calculate_hangover_attenuation_gain_fx( st, &att_fx, vad_hover_flag );

+0 −31
Original line number Diff line number Diff line
@@ -247,39 +247,8 @@ void encod_gen_voic_fx(
        }
        ELSE
        {
#ifdef FIX_BASOP_2517_CLICK_IN_OMASA_LTV
            Word16 min_scf = norm_arr( speech_fx + i_subfr_fx - M, M );
            min_scf = s_min( min_scf, norm_arr( hLPDmem->mem_syn, M ) );
            min_scf = s_min( min_scf, norm_arr( res_fx + i_subfr_fx, L_SUBFR ) );
            IF( hLPDmem->mem_w0 != 0 )
            {
                min_scf = s_min( min_scf, norm_s( hLPDmem->mem_w0 ) );
            }

            IF( GT_16( min_scf, 0 ) )
            {
                Word16 speech_local[L_FRAME16k];
                Word16 mem_syn_local[M];
                Word16 res_local[L_FRAME16k];
                Word16 mem_w0_local = shl( hLPDmem->mem_w0, min_scf );
                Copy_Scale_sig( speech_fx, speech_local, L_frame, min_scf );
                Copy_Scale_sig( hLPDmem->mem_syn, mem_syn_local, M, min_scf );
                Copy_Scale_sig( res_fx, res_local, L_frame, min_scf );
                find_targets_ivas_fx( speech_local, mem_syn_local, i_subfr_fx, &mem_w0_local, p_Aq_fx,
                                      res_local, L_SUBFR, p_Aw_fx, st_fx->preemph_fac, xn_fx, cn_fx, h1_fx );
                scale_sig( xn_fx, L_SUBFR, negate( min_scf ) );
                scale_sig( cn_fx, L_SUBFR, negate( min_scf ) );
                hLPDmem->mem_w0 = shr( mem_w0_local, min_scf );
            }
            ELSE
            {
                find_targets_ivas_fx( speech_fx, hLPDmem->mem_syn, i_subfr_fx, &hLPDmem->mem_w0, p_Aq_fx,
                                      res_fx, L_SUBFR, p_Aw_fx, st_fx->preemph_fac, xn_fx, cn_fx, h1_fx );
            }
#else
            find_targets_ivas_fx( speech_fx, hLPDmem->mem_syn, i_subfr_fx, &hLPDmem->mem_w0, p_Aq_fx,
                                  res_fx, L_SUBFR, p_Aw_fx, st_fx->preemph_fac, xn_fx, cn_fx, h1_fx );
#endif

            q_h1 = sub( 14, norm_s( h1_fx[0] ) );
            Copy_Scale_sig( h1_fx, h2_fx, L_SUBFR, sub( 11, q_h1 ) ); /*Q11*/