Commit e380a724 authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/main' into...

- Merge remote-tracking branch 'remotes/origin/main' into basop-2426-removing-unnecessary-parameters-in-acelp_fast_fx
- formatting, comments
parents bca73a03 d2a25bc0
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -306,7 +306,11 @@ IF( NE_16( Opt_AMR_WB, 1 ) )

    IF( EQ_16( L_frame, L_FRAME16k ) )
    {
#ifndef FIX_2410_HARM_MODIF_FS
        modify_Fs_fx( fft_io, L_FRAME16k, 16000, fft_io, 12800, exc_mem1, 0 );
#else
        modify_Fs_fx( fft_io, L_FRAME16k, 16000, fft_io, 12800, exc_mem1, 0, NULL, NULL );
#endif
    }

    /* fft_rel(fft_io, L_FFT, LOG2_L_FFT); */
@@ -419,7 +423,11 @@ IF( NE_16( Opt_AMR_WB, 1 ) )

    IF( EQ_16( L_frame, L_FRAME16k ) )
    {
#ifndef FIX_2410_HARM_MODIF_FS
        modify_Fs_fx( fft_io, L_FFT, 12800, fft_io, 16000, exc_mem, 0 );
#else
        modify_Fs_fx( fft_io, L_FFT, 12800, fft_io, 16000, exc_mem, 0, NULL, NULL );
#endif
    }

    /* enr1 = dotp( fft_io, fft_io, L_frame ) / L_frame; */
+3 −3
Original line number Diff line number Diff line
@@ -3031,13 +3031,13 @@ void acelp_fast_fx(
    BSTR_ENC_HANDLE hBstr,                                      /* i/o: encoder bitstream handle                */
    const Word16 cdk_index,                                     /* i  : codebook index                          */
    const Word16 dn_orig[L_SUBFR],                              /* i  : corr. between target and h[].      Q_dn */
#ifdef OPT_241x_ACELP_FAST                                      
#ifdef OPT_2416_ACELP_FAST                                      
    const Word16 Q_dncn,                                        /* i  : scaling factor of dn and cn             */  
#else
    Word16 Q_dn,
#endif
    const Word16 cn[L_SUBFR],                                   /* i  : residual after long term prediction q_cn*/
#ifndef OPT_241x_ACELP_FAST
#ifndef OPT_2416_ACELP_FAST
    const Word16 q_cn,
#endif
    const Word16 H[L_SUBFR],                                    /* i  : impulse response of weighted synthesis filter  e(norm_s(H[0])+1) */
+58 −20
Original line number Diff line number Diff line
@@ -42,7 +42,11 @@
/* CALLED FROM : TX/RX                              */
/*==============================================================================*/

#ifndef FIX_2410_HARM_MODIF_FS
Word16 modify_Fs_ivas_fx( /* o  : length of output    Q0  */
#else
Word16 modify_Fs_fx( /* o  : length of output    Q0  */
#endif
                          const Word16 sigIn_fx[], /* i  : signal to decimate  Q0  */
                          Word16 lg,               /* i  : length of input     Q0  */
                          const Word32 fin,        /* i  : frequency of input  Q0  */
@@ -79,17 +83,27 @@ Word16 modify_Fs_ivas_fx( /* o : length of output Q
    /*-------------------------------------------------------------------*
     * Find the resampling configuration
     *-------------------------------------------------------------------*/
#ifdef FIX_2410_HARM_MODIF_FS
    if ( Q_new_inp != NULL )
#endif
    {
        *Q_new_inp = 0;
        move16();
    }
    /* check if fin and fout are the same */
    IF( EQ_32( fin, fout ) )
    {
        /* just copy the signal_fx and quit */
        Copy( sigIn_fx, sigOut_fx, lg );
#ifdef FIX_2410_HARM_MODIF_FS
        if ( Q_new_inp != NULL )
#endif
        {
            *mem_decim_size = 0;
            *Q_new_inp = 0;
            move16();
            move16();
        }
        return lg;
    }
    ELSE
@@ -146,8 +160,13 @@ Word16 modify_Fs_ivas_fx( /* o : length of output Q
        }

        mem_len = shl( filt_len, 1 );
#ifdef FIX_2410_HARM_MODIF_FS
        if ( mem_decim_size != NULL )
#endif
        {
            *mem_decim_size = mem_len;
            move16();
        }
        signal_fx = signal_tab_fx + 2 * L_FILT_MAX + sub( L_FRAME48k, add( mem_len, lg ) );
        signal_ana_fx = signal_fx;
        mem_len_ana = mem_len;
@@ -225,8 +244,12 @@ Word16 modify_Fs_ivas_fx( /* o : length of output Q
    {
        filt_len_tmp = shr( add( filt_len, 1 ), 1 );
    }

    Word16 norm_cfg_ptr = norm_s( sub( cfg_ptr_fx->filter_fx[0], 1 ) );
#ifdef FIX_2410_HARM_MODIF_FS
    if ( Q_new_inp != NULL )
#endif
    {
        *Q_new_inp = negate( norm_s( sub( cfg_ptr_fx->filter_fx[0], 1 ) ) );
    }
    FOR( i = 0; i < lg_out; i++ )
    {
        sigOut_fx[i] = round_fx_sat( Interpol_lc_fx( sigIn_ptr, cfg_ptr_fx->filter_fx, frac, fac_num, filt_len_tmp ) );
@@ -240,7 +263,7 @@ Word16 modify_Fs_ivas_fx( /* o : length of output Q
        }
        sigIn_ptr += add( lshr( j, 15 ), datastep );
    }
    *Q_new_inp = negate( norm_cfg_ptr );

    move16();
    /* rescaling */
    test();
@@ -259,9 +282,14 @@ Word16 modify_Fs_ivas_fx( /* o : length of output Q
                    sigOut_fx[i] = round_fx( L_shl( L_mult( sigOut_fx[i], num_den ), 1 ) ); /*Q0*/
                    move16();
                }
#ifdef FIX_2410_HARM_MODIF_FS
                if ( Q_new_inp != NULL )
#endif
                {
                    *Q_new_inp = add( *Q_new_inp, 1 );
                    move16();
                }
            }
            ELSE
            {
                test();
@@ -270,9 +298,14 @@ Word16 modify_Fs_ivas_fx( /* o : length of output Q
                IF( GT_32( fin, 16000 ) && ( EQ_16( lg_out, L_FRAME ) || EQ_16( lg_out, L_FRAME16k ) || EQ_16( lg_out, 512 ) ) )
                {
                    num_den = shl_sat( num_den, 1 );
#ifdef FIX_2410_HARM_MODIF_FS
                    if ( Q_new_inp != NULL )
#endif
                    {
                        *Q_new_inp = add( *Q_new_inp, 1 );
                        move16();
                    }
                }
                FOR( i = 0; i < lg_out; i++ )
                {
                    sigOut_fx[i] = mult_r( sigOut_fx[i], num_den ); /*Q0*/
@@ -300,11 +333,16 @@ Word16 modify_Fs_ivas_fx( /* o : length of output Q
                    sigOut_fx[i] = round_fx( L_mac( L_deposit_h( sigOut_fx[i] ), sigOut_fx[i], num_den ) ); /*Q0*/
                    move16();
                }
#ifdef FIX_2410_HARM_MODIF_FS
                if ( Q_new_inp != NULL )
#endif
                {
                    *Q_new_inp = add( *Q_new_inp, 1 );
                    move16();
                }
            }
        }
    }
    ELSE IF( ( LT_16( fac_num, fac_den ) ) && ( ( cfg_ptr_fx->flags_fx & RS_INV_FAC ) != 0 ) )
    {
        FOR( i = 0; i < lg_out; i++ )
@@ -319,7 +357,7 @@ Word16 modify_Fs_ivas_fx( /* o : length of output Q

    return lg_out;
}

#ifndef FIX_2410_HARM_MODIF_FS
Word16 modify_Fs_fx(                          /* o  : length of output    Q0  */
                     const Word16 sigIn_fx[], /* i  : signal to decimate  Q0  */
                     Word16 lg,               /* i  : length of input     Q0  */
@@ -585,7 +623,7 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */

    return lg_out;
}

#endif
/*-------------------------------------------------------------------*
 * modify_Fs_intcub3m_sup()
 *
+3 −2
Original line number Diff line number Diff line
@@ -94,8 +94,9 @@
#define FIX_2404_HARM_SIGNAL_CLAS                       /* VA: basop-2404, harmonize signal_clas and signa_ivas_clas */
#define HARMONIZE_ACELP_ENC                             /* VA: basop issue 2400: Remove duplicated main ACELP encoder function */
#define FIX_2392_MSAN_DESTROY_DEC                       /* VA: basop issue 2392: fix MSAN in ivas_destroy_dec_fx() */

#define OPT_241x_ACELP_FAST                             /* VA: basop issue 2426, optimisation of acelp_fast_fx ( reduc. compl. by 0.35 wmops ) */
#define FIX_FLOAT_1522_LTV_MSAN_QMETADATA_ENC_EC3       /* Nokia: float issue 1522: fix uninit MSAN in EC3 of qmetadata encoding */
#define OPT_2416_ACELP_FAST                             /* VA: basop issue 2426, optimisation of acelp_fast_fx ( reduc. compl. by 0.35 wmops ) */
#define FIX_2410_HARM_MODIF_FS                          /* VA: basop issue 2410: Remove duplicated modif_Fs */

/* #################### End BE switches ################################## */

+18 −13
Original line number Diff line number Diff line
@@ -2489,7 +2489,11 @@ Word32 Interpol_lc_fx(
);
/* o  : length of output    Q0  */
Word16 modify_Fs_ivas_fx(
#ifndef FIX_2410_HARM_MODIF_FS
Word16 modify_Fs_ivas_fx( /* o  : length of output    Q0  */
#else
Word16 modify_Fs_fx(     /* o  : length of output    Q0  */
#endif
                          const Word16 sigIn_fx[], /* i  : signal to decimate  Q0  */
                          Word16 lg,               /* i  : length of input     Q0  */
                          const Word32 fin,        /* i  : frequency of input  Q0  */
@@ -2501,6 +2505,7 @@ Word16 modify_Fs_ivas_fx(
                          Word16 *mem_decim_size   /*i: size modified for mem_fx*/
);
#ifndef FIX_2410_HARM_MODIF_FS
/* o  : length of output    Q0  */
Word16 modify_Fs_fx(
    const Word16 sigIn_fx[], /* i  : signal to decimate  Q0  */
@@ -2511,7 +2516,7 @@ Word16 modify_Fs_fx(
    Word16 mem_fx[],         /* i/o: filter memory       Q0  */
    const Word16 nblp        /* i  : flag indicating if NB low-pass is applied */
);
#endif
/* o  : length of output    */
Word16 modify_Fs_intcub3m_sup_fx(
    const Word16 sigIn[], /* i  : signal to decimate with memory of 2 samples (indexes -2 & -1) */
Loading