Loading lib_com/cng_exc_fx.c +8 −0 Original line number Diff line number Diff line Loading @@ -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); */ Loading Loading @@ -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; */ Loading lib_com/modif_fs_fx.c +48 −4 Original line number Diff line number Diff line Loading @@ -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 */ Loading Loading @@ -75,21 +79,32 @@ Word16 modify_Fs_ivas_fx( /* o : length of output Q move16(); Word16 filt_len_tmp; const Resampling_cfg *cfg_ptr_fx; Word16 norm_cfg_ptr; /*-------------------------------------------------------------------* * 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 Loading Loading @@ -146,8 +161,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; Loading Loading @@ -225,8 +245,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 { norm_cfg_ptr = 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 ) ); Loading @@ -240,7 +264,12 @@ Word16 modify_Fs_ivas_fx( /* o : length of output Q } sigIn_ptr += add( lshr( j, 15 ), datastep ); } #ifdef FIX_2410_HARM_MODIF_FS if ( Q_new_inp != NULL ) #endif { *Q_new_inp = negate( norm_cfg_ptr ); } move16(); /* rescaling */ test(); Loading @@ -259,9 +288,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(); Loading @@ -270,9 +304,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*/ Loading Loading @@ -300,11 +339,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++ ) Loading @@ -319,7 +363,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 */ Loading Loading @@ -585,7 +629,7 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ return lg_out; } #endif /*-------------------------------------------------------------------* * modify_Fs_intcub3m_sup() * Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ #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 FIX_2410_HARM_MODIF_FS /* VA: basop issue 2410: Remove duplicated modif_Fs */ /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ Loading lib_com/prot_fx.h +7 −2 Original line number Diff line number Diff line Loading @@ -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 */ Loading @@ -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 */ Loading @@ -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 lib_dec/ivas_lfe_plc_fx.c +8 −0 Original line number Diff line number Diff line Loading @@ -1001,10 +1001,18 @@ void ivas_lfe_tdplc_fx( Copy_Scale_sig_32_16( rec_frame_fx, rec_frame_16_fx, LFE_PLC_RECLEN, -Q5 ); // Q0 Word16 Q_new_inp, mem_decim_size, size_modified; #ifndef FIX_2410_HARM_MODIF_FS size_modified = modify_Fs_ivas_fx( prevsynth_16_fx + LFE_PLC_BUFLEN - LFE_PLC_FDEL / LFE_PLC_DSF, LFE_PLC_FDEL / LFE_PLC_DSF, LFE_PLC_FS, rec_frame_us_16_fx, 48000, mem_fx, 0, &Q_new_inp, &mem_decim_size ); #else size_modified = modify_Fs_fx( prevsynth_16_fx + LFE_PLC_BUFLEN - LFE_PLC_FDEL / LFE_PLC_DSF, LFE_PLC_FDEL / LFE_PLC_DSF, LFE_PLC_FS, rec_frame_us_16_fx, 48000, mem_fx, 0, &Q_new_inp, &mem_decim_size ); #endif Scale_sig( rec_frame_us_16_fx, size_modified, negate( Q_new_inp ) ); /* scaling back to Q0 */ #ifndef FIX_2410_HARM_MODIF_FS size_modified = modify_Fs_ivas_fx( rec_frame_16_fx, LFE_PLC_RECLEN, LFE_PLC_FS, rec_frame_us_16_fx, 48000, mem_fx, 0, &Q_new_inp, &mem_decim_size ); #else size_modified = modify_Fs_fx( rec_frame_16_fx, LFE_PLC_RECLEN, LFE_PLC_FS, rec_frame_us_16_fx, 48000, mem_fx, 0, &Q_new_inp, &mem_decim_size ); #endif Scale_sig( rec_frame_us_16_fx, size_modified, negate( Q_new_inp ) ); /* scaling back to Q0 */ /*samples are generated with 48k sampling rate Loading Loading
lib_com/cng_exc_fx.c +8 −0 Original line number Diff line number Diff line Loading @@ -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); */ Loading Loading @@ -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; */ Loading
lib_com/modif_fs_fx.c +48 −4 Original line number Diff line number Diff line Loading @@ -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 */ Loading Loading @@ -75,21 +79,32 @@ Word16 modify_Fs_ivas_fx( /* o : length of output Q move16(); Word16 filt_len_tmp; const Resampling_cfg *cfg_ptr_fx; Word16 norm_cfg_ptr; /*-------------------------------------------------------------------* * 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 Loading Loading @@ -146,8 +161,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; Loading Loading @@ -225,8 +245,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 { norm_cfg_ptr = 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 ) ); Loading @@ -240,7 +264,12 @@ Word16 modify_Fs_ivas_fx( /* o : length of output Q } sigIn_ptr += add( lshr( j, 15 ), datastep ); } #ifdef FIX_2410_HARM_MODIF_FS if ( Q_new_inp != NULL ) #endif { *Q_new_inp = negate( norm_cfg_ptr ); } move16(); /* rescaling */ test(); Loading @@ -259,9 +288,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(); Loading @@ -270,9 +304,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*/ Loading Loading @@ -300,11 +339,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++ ) Loading @@ -319,7 +363,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 */ Loading Loading @@ -585,7 +629,7 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ return lg_out; } #endif /*-------------------------------------------------------------------* * modify_Fs_intcub3m_sup() * Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ #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 FIX_2410_HARM_MODIF_FS /* VA: basop issue 2410: Remove duplicated modif_Fs */ /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ Loading
lib_com/prot_fx.h +7 −2 Original line number Diff line number Diff line Loading @@ -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 */ Loading @@ -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 */ Loading @@ -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
lib_dec/ivas_lfe_plc_fx.c +8 −0 Original line number Diff line number Diff line Loading @@ -1001,10 +1001,18 @@ void ivas_lfe_tdplc_fx( Copy_Scale_sig_32_16( rec_frame_fx, rec_frame_16_fx, LFE_PLC_RECLEN, -Q5 ); // Q0 Word16 Q_new_inp, mem_decim_size, size_modified; #ifndef FIX_2410_HARM_MODIF_FS size_modified = modify_Fs_ivas_fx( prevsynth_16_fx + LFE_PLC_BUFLEN - LFE_PLC_FDEL / LFE_PLC_DSF, LFE_PLC_FDEL / LFE_PLC_DSF, LFE_PLC_FS, rec_frame_us_16_fx, 48000, mem_fx, 0, &Q_new_inp, &mem_decim_size ); #else size_modified = modify_Fs_fx( prevsynth_16_fx + LFE_PLC_BUFLEN - LFE_PLC_FDEL / LFE_PLC_DSF, LFE_PLC_FDEL / LFE_PLC_DSF, LFE_PLC_FS, rec_frame_us_16_fx, 48000, mem_fx, 0, &Q_new_inp, &mem_decim_size ); #endif Scale_sig( rec_frame_us_16_fx, size_modified, negate( Q_new_inp ) ); /* scaling back to Q0 */ #ifndef FIX_2410_HARM_MODIF_FS size_modified = modify_Fs_ivas_fx( rec_frame_16_fx, LFE_PLC_RECLEN, LFE_PLC_FS, rec_frame_us_16_fx, 48000, mem_fx, 0, &Q_new_inp, &mem_decim_size ); #else size_modified = modify_Fs_fx( rec_frame_16_fx, LFE_PLC_RECLEN, LFE_PLC_FS, rec_frame_us_16_fx, 48000, mem_fx, 0, &Q_new_inp, &mem_decim_size ); #endif Scale_sig( rec_frame_us_16_fx, size_modified, negate( Q_new_inp ) ); /* scaling back to Q0 */ /*samples are generated with 48k sampling rate Loading