Loading lib_com/cldfb.c +54 −20 Original line number Diff line number Diff line Loading @@ -1101,6 +1101,9 @@ void cldfbSynthesis_ivas_fx( Word32 **imagBuffer_fx, /* i : imag values Qx*/ Word32 *timeOut_fx, /* o : output time domain samples Qx - 1*/ const Word16 samplesToProcess, /* i : number of processed samples */ #ifdef OPT_SBA_AVOID_SPAR_RESCALE const Word16 shift, /* i : scale for state buffer */ #endif /* OPT_SBA_AVOID_SPAR_RESCALE */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ) { Loading Loading @@ -1266,6 +1269,10 @@ void cldfbSynthesis_ivas_fx( } /* synthesis prototype filter */ #ifdef OPT_SBA_AVOID_SPAR_RESCALE IF( 0 == shift ) { #endif /* OPT_SBA_AVOID_SPAR_RESCALE */ FOR( i = 0; i < L2; i++ ) { accu0 = Madd_32_16( synthesisBuffer_fx[i], Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter[i] ), p_filter_sf ); // Qx - 1 Loading @@ -1285,6 +1292,33 @@ void cldfbSynthesis_ivas_fx( synthesisBuffer_fx[4 * L2 + i] = accu4; move32(); } #ifdef OPT_SBA_AVOID_SPAR_RESCALE } ELSE { FOR( i = 0; i < L2; i++ ) { Word32 prod = L_shl_sat( Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter_sf ), shift ); accu0 = Madd_32_16( synthesisBuffer_fx[i], prod, p_filter[i] ); // Qx - 1 accu1 = Madd_32_16( synthesisBuffer_fx[1 * L2 + i], prod, p_filter[( 1 * L2 + i )] ); // Qx - 1 accu2 = Madd_32_16( synthesisBuffer_fx[2 * L2 + i], prod, p_filter[( 2 * L2 + i )] ); // Qx - 1 accu3 = Madd_32_16( synthesisBuffer_fx[3 * L2 + i], prod, p_filter[( 3 * L2 + i )] ); // Qx - 1 accu4 = Madd_32_16( synthesisBuffer_fx[4 * L2 + i], prod, p_filter[( 4 * L2 + i )] ); // Qx - 1 synthesisBuffer_fx[i] = accu0; move32(); synthesisBuffer_fx[1 * L2 + i] = accu1; move32(); synthesisBuffer_fx[2 * L2 + i] = accu2; move32(); synthesisBuffer_fx[3 * L2 + i] = accu3; move32(); synthesisBuffer_fx[4 * L2 + i] = accu4; move32(); } } #endif /* OPT_SBA_AVOID_SPAR_RESCALE */ FOR( i = 0; i < M1; i++ ) { Loading lib_com/cng_exc_fx.c +2 −3 Original line number Diff line number Diff line Loading @@ -295,10 +295,9 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) /* calculate the spectrum of random excitation signal */ Copy( exc2, fft_io, L_frame ); Word16 Q_new_inp, mem_decim_size; // TO be removed IF( EQ_16( L_frame, L_FRAME16k ) ) { modify_Fs_fx( fft_io, L_FRAME16k, 16000, fft_io, 12800, exc_mem1, 0, &Q_new_inp, &mem_decim_size ); modify_Fs_fx( fft_io, L_FRAME16k, 16000, fft_io, 12800, exc_mem1, 0 ); } /* fft_rel(fft_io, L_FFT, LOG2_L_FFT); */ Loading Loading @@ -411,7 +410,7 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) IF( EQ_16( L_frame, L_FRAME16k ) ) { modify_Fs_fx( fft_io, L_FFT, 12800, fft_io, 16000, exc_mem, 0, &Q_new_inp, &mem_decim_size ); modify_Fs_fx( fft_io, L_FFT, 12800, fft_io, 16000, exc_mem, 0 ); } /* enr1 = dotp( fft_io, fft_io, L_frame ) / L_frame; */ Loading lib_com/ivas_prot_fx.h +18 −8 Original line number Diff line number Diff line Loading @@ -3786,8 +3786,11 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( const UWord16 nSamplesAsked, /* i : number of CLDFB slots requested */ UWord16 *nSamplesRendered, /* o : number of CLDFB slots rendered */ UWord16 *nSamplesAvailable, /* o : number of CLDFB slots still to render */ Word32 *output_fx[], /* o : rendered time signal */ Word32 *output_fx[] /* o : rendered time signal */ #ifndef OPT_SBA_AVOID_SPAR_RESCALE , Word16 out_len /*Store the length of values in each channel*/ #endif /* OPT_SBA_AVOID_SPAR_RESCALE */ ); ivas_error ivas_osba_ism_metadata_dec_fx( Loading Loading @@ -5343,15 +5346,22 @@ ivas_error ivas_sba_dec_render_fx( const UWord16 nSamplesAsked, /* i : number of CLDFB slots requested */ UWord16 *nSamplesRendered, /* o : number of CLDFB slots rendered */ UWord16 *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ Word32 *output_fx[], /* o : rendered time signal Q11*/ Word32 *output_fx[] /* o : rendered time signal Q11*/ #ifndef OPT_SBA_AVOID_SPAR_RESCALE , Word16 out_len /*Store the length of values in each channel*/ #endif /* OPT_SBA_AVOID_SPAR_RESCALE */ ); void ivas_spar_dec_upmixer_sf_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ Word32 *output_fx[], /* o : output audio channels */ const Word16 nchan_internal, /* i : number of internal channels */ Word16 out_len ); const Word16 nchan_internal /* i : number of internal channels */ #ifndef OPT_SBA_AVOID_SPAR_RESCALE , Word16 out_len #endif /* OPT_SBA_AVOID_SPAR_RESCALE */ ); ivas_error ivas_spar_md_enc_open_fx( ivas_spar_md_enc_state_t **hMdEnc_in, /* i/o: SPAR MD encoder handle */ Loading lib_com/modif_fs_fx.c +8 −26 Original line number Diff line number Diff line Loading @@ -330,9 +330,7 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ Word16 sigOut_fx[], /* o : decimated signal Q0 */ const Word32 fout, /* i : frequency of output Q0 */ Word16 mem_fx[], /* i/o: filter memory Q0 */ const Word16 nblp, /* i : flag indicating if NB low-pass is applied */ Word16 *Q_new_inp, // TO be removed Word16 *mem_decim_size // TO be removed const Word16 nblp /* i : flag indicating if NB low-pass is applied */ ) { Word16 i; Loading Loading @@ -364,17 +362,13 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ /*-------------------------------------------------------------------* * Find the resampling configuration *-------------------------------------------------------------------*/ *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 ); *mem_decim_size = 0; *Q_new_inp = 0; move16(); move16(); return lg; } ELSE Loading Loading @@ -439,8 +433,6 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ } mem_len = shl( filt_len, 1 ); *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 @@ -508,7 +500,7 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ } /* interpolation */ datastep = shr( div_s( shl( fac_den, 7 ), shl( fac_num, 10 ) ), 12 ); datastep = shr( div_s( shl( fac_den, 8 ), shl( fac_num, 11 ) ), 12 ); /* equivalent to 'datastep = fac_den % fac_num' */ temp_n = i_mult2( datastep, fac_num ); /*Q0*/ fracstep = sub( fac_den, temp_n ); Loading Loading @@ -550,9 +542,6 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ FOR( i = 0; i < lg_out; i++ ) { sigOut_fx[i] = round_fx( L_shl( L_mult( sigOut_fx[i], num_den ), 1 ) ); /*Q0*/ *Q_new_inp = -1; move16(); move16(); } } ELSE Loading @@ -562,16 +551,17 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ test(); if ( GT_32( fin, 16000 ) && ( EQ_16( lg_out, L_FRAME ) || EQ_16( lg_out, L_FRAME16k ) || EQ_16( lg_out, 512 ) ) ) { #ifdef BASOP_NOGLOB_DECLARE_LOCAL num_den = shl_o( num_den, 1, &Overflow ); //*Q_new_inp = 2; #else num_den = shl( num_den, 1 ); #endif } FOR( i = 0; i < lg_out; i++ ) { sigOut_fx[i] = mult_r( sigOut_fx[i], num_den ); /*Q0*/ move16(); } *Q_new_inp = -1; move16(); } } ELSE Loading @@ -579,13 +569,10 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ IF( EQ_16( fac_num, 8 ) ) { num_den = 26214; move16(); FOR( i = 0; i < lg_out; i++ ) { sigOut_fx[i] = mult_r( sigOut_fx[i], num_den ); /*Q-1*/ move16(); *Q_new_inp = -2; move16(); } } ELSE Loading @@ -594,9 +581,6 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ FOR( i = 0; i < lg_out; i++ ) { sigOut_fx[i] = round_fx( L_mac( L_deposit_h( sigOut_fx[i] ), sigOut_fx[i], num_den ) ); /*Q0*/ *Q_new_inp = -1; move16(); move16(); } } } Loading @@ -607,8 +591,6 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ { sigOut_fx[i] = mult_r( sigOut_fx[i], 16384 ); move16(); /*Q-1*/ *Q_new_inp = -2; move16(); } } /* update the filter memory */ Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,7 @@ #define FIX_ISSUE_1327 /* Ittiam: Fix for issue 1327: Glitch when stereo is switching from TD to FD*/ #define NONBE_FIX_1402_WAVEADJUST /* VA: BASOP iisue 1402: fix waveform adjustment decoder PLC */ #define FIX_ISSUE_1376 /* VA: Fix for issue 1376 (issue with GSC excitation) */ #define OPT_SBA_AVOID_SPAR_RESCALE /* Optimization made to spar decoder and IGF */ #define REMOVE_EVS_DUPLICATES /* remove core-coder duplicated functions, ACELP low-band decoder */ #endif Loading
lib_com/cldfb.c +54 −20 Original line number Diff line number Diff line Loading @@ -1101,6 +1101,9 @@ void cldfbSynthesis_ivas_fx( Word32 **imagBuffer_fx, /* i : imag values Qx*/ Word32 *timeOut_fx, /* o : output time domain samples Qx - 1*/ const Word16 samplesToProcess, /* i : number of processed samples */ #ifdef OPT_SBA_AVOID_SPAR_RESCALE const Word16 shift, /* i : scale for state buffer */ #endif /* OPT_SBA_AVOID_SPAR_RESCALE */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ) { Loading Loading @@ -1266,6 +1269,10 @@ void cldfbSynthesis_ivas_fx( } /* synthesis prototype filter */ #ifdef OPT_SBA_AVOID_SPAR_RESCALE IF( 0 == shift ) { #endif /* OPT_SBA_AVOID_SPAR_RESCALE */ FOR( i = 0; i < L2; i++ ) { accu0 = Madd_32_16( synthesisBuffer_fx[i], Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter[i] ), p_filter_sf ); // Qx - 1 Loading @@ -1285,6 +1292,33 @@ void cldfbSynthesis_ivas_fx( synthesisBuffer_fx[4 * L2 + i] = accu4; move32(); } #ifdef OPT_SBA_AVOID_SPAR_RESCALE } ELSE { FOR( i = 0; i < L2; i++ ) { Word32 prod = L_shl_sat( Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter_sf ), shift ); accu0 = Madd_32_16( synthesisBuffer_fx[i], prod, p_filter[i] ); // Qx - 1 accu1 = Madd_32_16( synthesisBuffer_fx[1 * L2 + i], prod, p_filter[( 1 * L2 + i )] ); // Qx - 1 accu2 = Madd_32_16( synthesisBuffer_fx[2 * L2 + i], prod, p_filter[( 2 * L2 + i )] ); // Qx - 1 accu3 = Madd_32_16( synthesisBuffer_fx[3 * L2 + i], prod, p_filter[( 3 * L2 + i )] ); // Qx - 1 accu4 = Madd_32_16( synthesisBuffer_fx[4 * L2 + i], prod, p_filter[( 4 * L2 + i )] ); // Qx - 1 synthesisBuffer_fx[i] = accu0; move32(); synthesisBuffer_fx[1 * L2 + i] = accu1; move32(); synthesisBuffer_fx[2 * L2 + i] = accu2; move32(); synthesisBuffer_fx[3 * L2 + i] = accu3; move32(); synthesisBuffer_fx[4 * L2 + i] = accu4; move32(); } } #endif /* OPT_SBA_AVOID_SPAR_RESCALE */ FOR( i = 0; i < M1; i++ ) { Loading
lib_com/cng_exc_fx.c +2 −3 Original line number Diff line number Diff line Loading @@ -295,10 +295,9 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) /* calculate the spectrum of random excitation signal */ Copy( exc2, fft_io, L_frame ); Word16 Q_new_inp, mem_decim_size; // TO be removed IF( EQ_16( L_frame, L_FRAME16k ) ) { modify_Fs_fx( fft_io, L_FRAME16k, 16000, fft_io, 12800, exc_mem1, 0, &Q_new_inp, &mem_decim_size ); modify_Fs_fx( fft_io, L_FRAME16k, 16000, fft_io, 12800, exc_mem1, 0 ); } /* fft_rel(fft_io, L_FFT, LOG2_L_FFT); */ Loading Loading @@ -411,7 +410,7 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) IF( EQ_16( L_frame, L_FRAME16k ) ) { modify_Fs_fx( fft_io, L_FFT, 12800, fft_io, 16000, exc_mem, 0, &Q_new_inp, &mem_decim_size ); modify_Fs_fx( fft_io, L_FFT, 12800, fft_io, 16000, exc_mem, 0 ); } /* enr1 = dotp( fft_io, fft_io, L_frame ) / L_frame; */ Loading
lib_com/ivas_prot_fx.h +18 −8 Original line number Diff line number Diff line Loading @@ -3786,8 +3786,11 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( const UWord16 nSamplesAsked, /* i : number of CLDFB slots requested */ UWord16 *nSamplesRendered, /* o : number of CLDFB slots rendered */ UWord16 *nSamplesAvailable, /* o : number of CLDFB slots still to render */ Word32 *output_fx[], /* o : rendered time signal */ Word32 *output_fx[] /* o : rendered time signal */ #ifndef OPT_SBA_AVOID_SPAR_RESCALE , Word16 out_len /*Store the length of values in each channel*/ #endif /* OPT_SBA_AVOID_SPAR_RESCALE */ ); ivas_error ivas_osba_ism_metadata_dec_fx( Loading Loading @@ -5343,15 +5346,22 @@ ivas_error ivas_sba_dec_render_fx( const UWord16 nSamplesAsked, /* i : number of CLDFB slots requested */ UWord16 *nSamplesRendered, /* o : number of CLDFB slots rendered */ UWord16 *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ Word32 *output_fx[], /* o : rendered time signal Q11*/ Word32 *output_fx[] /* o : rendered time signal Q11*/ #ifndef OPT_SBA_AVOID_SPAR_RESCALE , Word16 out_len /*Store the length of values in each channel*/ #endif /* OPT_SBA_AVOID_SPAR_RESCALE */ ); void ivas_spar_dec_upmixer_sf_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ Word32 *output_fx[], /* o : output audio channels */ const Word16 nchan_internal, /* i : number of internal channels */ Word16 out_len ); const Word16 nchan_internal /* i : number of internal channels */ #ifndef OPT_SBA_AVOID_SPAR_RESCALE , Word16 out_len #endif /* OPT_SBA_AVOID_SPAR_RESCALE */ ); ivas_error ivas_spar_md_enc_open_fx( ivas_spar_md_enc_state_t **hMdEnc_in, /* i/o: SPAR MD encoder handle */ Loading
lib_com/modif_fs_fx.c +8 −26 Original line number Diff line number Diff line Loading @@ -330,9 +330,7 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ Word16 sigOut_fx[], /* o : decimated signal Q0 */ const Word32 fout, /* i : frequency of output Q0 */ Word16 mem_fx[], /* i/o: filter memory Q0 */ const Word16 nblp, /* i : flag indicating if NB low-pass is applied */ Word16 *Q_new_inp, // TO be removed Word16 *mem_decim_size // TO be removed const Word16 nblp /* i : flag indicating if NB low-pass is applied */ ) { Word16 i; Loading Loading @@ -364,17 +362,13 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ /*-------------------------------------------------------------------* * Find the resampling configuration *-------------------------------------------------------------------*/ *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 ); *mem_decim_size = 0; *Q_new_inp = 0; move16(); move16(); return lg; } ELSE Loading Loading @@ -439,8 +433,6 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ } mem_len = shl( filt_len, 1 ); *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 @@ -508,7 +500,7 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ } /* interpolation */ datastep = shr( div_s( shl( fac_den, 7 ), shl( fac_num, 10 ) ), 12 ); datastep = shr( div_s( shl( fac_den, 8 ), shl( fac_num, 11 ) ), 12 ); /* equivalent to 'datastep = fac_den % fac_num' */ temp_n = i_mult2( datastep, fac_num ); /*Q0*/ fracstep = sub( fac_den, temp_n ); Loading Loading @@ -550,9 +542,6 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ FOR( i = 0; i < lg_out; i++ ) { sigOut_fx[i] = round_fx( L_shl( L_mult( sigOut_fx[i], num_den ), 1 ) ); /*Q0*/ *Q_new_inp = -1; move16(); move16(); } } ELSE Loading @@ -562,16 +551,17 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ test(); if ( GT_32( fin, 16000 ) && ( EQ_16( lg_out, L_FRAME ) || EQ_16( lg_out, L_FRAME16k ) || EQ_16( lg_out, 512 ) ) ) { #ifdef BASOP_NOGLOB_DECLARE_LOCAL num_den = shl_o( num_den, 1, &Overflow ); //*Q_new_inp = 2; #else num_den = shl( num_den, 1 ); #endif } FOR( i = 0; i < lg_out; i++ ) { sigOut_fx[i] = mult_r( sigOut_fx[i], num_den ); /*Q0*/ move16(); } *Q_new_inp = -1; move16(); } } ELSE Loading @@ -579,13 +569,10 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ IF( EQ_16( fac_num, 8 ) ) { num_den = 26214; move16(); FOR( i = 0; i < lg_out; i++ ) { sigOut_fx[i] = mult_r( sigOut_fx[i], num_den ); /*Q-1*/ move16(); *Q_new_inp = -2; move16(); } } ELSE Loading @@ -594,9 +581,6 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ FOR( i = 0; i < lg_out; i++ ) { sigOut_fx[i] = round_fx( L_mac( L_deposit_h( sigOut_fx[i] ), sigOut_fx[i], num_den ) ); /*Q0*/ *Q_new_inp = -1; move16(); move16(); } } } Loading @@ -607,8 +591,6 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ { sigOut_fx[i] = mult_r( sigOut_fx[i], 16384 ); move16(); /*Q-1*/ *Q_new_inp = -2; move16(); } } /* update the filter memory */ Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,7 @@ #define FIX_ISSUE_1327 /* Ittiam: Fix for issue 1327: Glitch when stereo is switching from TD to FD*/ #define NONBE_FIX_1402_WAVEADJUST /* VA: BASOP iisue 1402: fix waveform adjustment decoder PLC */ #define FIX_ISSUE_1376 /* VA: Fix for issue 1376 (issue with GSC excitation) */ #define OPT_SBA_AVOID_SPAR_RESCALE /* Optimization made to spar decoder and IGF */ #define REMOVE_EVS_DUPLICATES /* remove core-coder duplicated functions, ACELP low-band decoder */ #endif