Loading lib_com/cldfb.c +423 −0 Original line number Diff line number Diff line Loading @@ -1305,6 +1305,429 @@ void cldfbSynthesis_ivas_fx( return; } void cldfbSynthesis_ivas_fx_2( Word32 **realBuffer_fx, /* i : real values Qx*/ 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 */ const Word16 shift, /* i : number of processed samples */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ) { Word16 i; Word16 k; Word16 L2; Word16 M1; Word16 M2; Word16 M41; Word16 M42; Word16 Mz; Word32 rBuffer_fx[2 * CLDFB_NO_CHANNELS_MAX]; Word32 iBuffer_fx[2 * CLDFB_NO_CHANNELS_MAX]; const Word32 *rot_vctr_re_fx; const Word32 *rot_vctr_im_fx; const Word32 *rot_vctr_delay_re_fx; const Word32 *rot_vctr_delay_im_fx; Word32 rr12_fx, ir12_fx; Word32 ri12_fx, ii12_fx; Word32 *synthesisBuffer_fx, buffer_fx[( CLDFB_NO_CHANNELS_MAX * CLDFB_NO_COL_MAX ) + ( 10 * CLDFB_NO_CHANNELS_MAX )]; Word32 new_samples_fx[2 * CLDFB_NO_CHANNELS_MAX]; Word32 *ptr_time_out_fx; const Word16 *p_filter; Word16 p_filter_sf; Word32 accu0, accu1, accu2, accu3, accu4; Word16 no_col = h_cldfb->no_col; move16(); M1 = h_cldfb->no_channels; move16(); L2 = shl( M1, 1 ); M2 = shr( M1, 1 ); M41 = shr( M2, 1 ); M42 = sub( M2, M41 ); Mz = sub( M1, h_cldfb->bandsToZero ); /* only process needed cols */ IF( GT_16( samplesToProcess, -1 ) ) { no_col = s_min( no_col, idiv1616( sub( add( samplesToProcess, h_cldfb->no_channels ), 1 ), h_cldfb->no_channels ) ); move16(); } rot_vctr_re_fx = h_cldfb->rot_vec_syn_re_fx; rot_vctr_im_fx = h_cldfb->rot_vec_syn_im_fx; rot_vctr_delay_re_fx = h_cldfb->rot_vec_syn_delay_re_fx; rot_vctr_delay_im_fx = h_cldfb->rot_vec_syn_delay_im_fx; synthesisBuffer_fx = buffer_fx; Copy32( h_cldfb->cldfb_state_fx, synthesisBuffer_fx + i_mult( M1, no_col ), h_cldfb->p_filter_length ); p_filter = h_cldfb->p_filter; p_filter_sf = h_cldfb->p_filter_sf; // Q14 move16(); ptr_time_out_fx = timeOut_fx; /*synthesisBuffer += M1 * h_cldfb->no_col;*/ synthesisBuffer_fx += i_mult( M1, no_col ); FOR( k = 0; k < no_col; k++ ) { IF( EQ_16( h_cldfb->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { /* rotation due to delay*/ /*if(h_cldfb->ds != M1)*/ IF( rot_vctr_delay_re_fx != NULL ) { FOR( i = 0; i < M1; i++ ) { Word32 cplx_aux; /* delay */ /*cplxMult(&rBuffer[i], &iBuffer[i], realBuffer[k][i], imagBuffer[k][i], cos((EVS_PI/M1)*(i+0.5)*(-(h_cldfb->ds-M1)*0.5)), sin((EVS_PI/M1)*(i+0.5)*(-(h_cldfb->ds-M1)*0.5)));*/ /*cplxMult(&rBuffer[i], &iBuffer[i], realBuffer[k][i], imagBuffer[k][i], rot_vctr_delay_re[i], rot_vctr_delay_im[i]);*/ /*cplxMult(&realBuffer[k][i], &imagBuffer[k][i], realBuffer[k][i], imagBuffer[k][i], rot_vctr_delay_re[i], rot_vctr_delay_im[i]);*/ cplx_aux = Msub_32_32( Mpy_32_32( realBuffer_fx[k][i], rot_vctr_delay_re_fx[i] ), imagBuffer_fx[k][i], rot_vctr_delay_im_fx[i] ); // Qx imagBuffer_fx[k][i] = Madd_32_32( Mpy_32_32( realBuffer_fx[k][i], rot_vctr_delay_im_fx[i] ), imagBuffer_fx[k][i], rot_vctr_delay_re_fx[i] ); move32(); realBuffer_fx[k][i] = cplx_aux; move32(); /*realBuffer[k][i] = rBuffer[i];*/ /*imagBuffer[k][i] = iBuffer[i];*/ } } } FOR( i = Mz; i < M1; i++ ) { realBuffer_fx[k][i] = 0; move32(); imagBuffer_fx[k][i] = 0; move32(); } FOR( i = 0; i < M2; i++ ) { /* pre modulation of DST IV */ /*cplxMult(&rBuffer[2*i], &rBuffer[2*i+1], realBuffer[k][2*i], realBuffer[k][M1-1-2*i], rot_vctr_re[i], rot_vctr_im[i]);*/ rBuffer_fx[2 * i] = Msub_32_32( Mpy_32_32( realBuffer_fx[k][2 * i], rot_vctr_re_fx[i] ), realBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[i] ); // Qx move32(); rBuffer_fx[2 * i + 1] = Madd_32_32( Mpy_32_32( realBuffer_fx[k][2 * i], rot_vctr_im_fx[i] ), realBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[i] ); // Qx move32(); /* pre modulation of DCT IV */ /*cplxMult(&iBuffer[2*i], &iBuffer[2*i+1],-imagBuffer[k][2*i], imagBuffer[k][M1-1-2*i], rot_vctr_re[i], rot_vctr_im[i]);*/ iBuffer_fx[2 * i] = Msub_32_32( Mpy_32_32( ( L_negate( imagBuffer_fx[k][2 * i] ) ), rot_vctr_re_fx[i] ), imagBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[i] ); // Qx move32(); iBuffer_fx[2 * i + 1] = Msub_32_32( Mpy_32_32( imagBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[i] ), imagBuffer_fx[k][2 * i], rot_vctr_im_fx[i] ); // Qx move32(); } /* FFT of DST IV */ fft_cldfb_fx( rBuffer_fx, M2 ); /* FFT of DCT IV */ fft_cldfb_fx( iBuffer_fx, M2 ); /* folding */ FOR( i = 0; i < M41; i++ ) { /* post modulation of DST IV */ rr12_fx = Msub_32_32( Mpy_32_32( rBuffer_fx[( M1 - 2 ) - ( i * 2 )], rot_vctr_re_fx[( M2 - 1 ) - i] ), rBuffer_fx[( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[( M2 - 1 ) - i] ); // Qx ri12_fx = Madd_32_32( Mpy_32_32( rBuffer_fx[( M1 - 2 ) - ( i * 2 )], rot_vctr_im_fx[( M2 - 1 ) - i] ), rBuffer_fx[( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[( M2 - 1 ) - i] ); // Qx /* post modulation of DCT IV */ ir12_fx = Msub_32_32( Mpy_32_32( iBuffer_fx[( M1 - 2 ) - ( i * 2 )], rot_vctr_re_fx[( M2 - 1 ) - i] ), iBuffer_fx[( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[( M2 - 1 ) - i] ); // Qx ii12_fx = Madd_32_32( Mpy_32_32( iBuffer_fx[( M1 - 2 ) - ( i * 2 )], rot_vctr_im_fx[( M2 - 1 ) - i] ), iBuffer_fx[( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[( M2 - 1 ) - i] ); // Qx new_samples_fx[M1 + M2 + 1 + 2 * i] = L_negate( L_add( rr12_fx, ii12_fx ) ); // Qx move32(); new_samples_fx[M2 - 2 - 2 * i] = L_negate( L_add( ri12_fx, ir12_fx ) ); // Qx move32(); new_samples_fx[M1 + M2 - 2 - 2 * i] = L_sub( rr12_fx, ii12_fx ); // Qx move32(); new_samples_fx[M2 + 1 + 2 * i] = L_sub( ir12_fx, ri12_fx ); // Qx move32(); } FOR( i = 0; i < M42; i++ ) { /* post modulation of DST IV */ rr12_fx = Msub_32_32( Mpy_32_32( rBuffer_fx[2 * i], rot_vctr_re_fx[i] ), rBuffer_fx[2 * i + 1], rot_vctr_im_fx[i] ); // Qx ri12_fx = Madd_32_32( Mpy_32_32( rBuffer_fx[2 * i], rot_vctr_im_fx[i] ), rBuffer_fx[2 * i + 1], rot_vctr_re_fx[i] ); // Qx /* post modulation of DCT IV */ ir12_fx = Msub_32_32( Mpy_32_32( iBuffer_fx[2 * i], rot_vctr_re_fx[i] ), iBuffer_fx[2 * i + 1], rot_vctr_im_fx[i] ); // Qx ii12_fx = Madd_32_32( Mpy_32_32( iBuffer_fx[2 * i], rot_vctr_im_fx[i] ), iBuffer_fx[2 * i + 1], rot_vctr_re_fx[i] ); // Qx new_samples_fx[M1 + M2 + 2 * i] = L_add( ri12_fx, ir12_fx ); // Qx move32(); new_samples_fx[M2 - 1 - 2 * i] = L_add( rr12_fx, ii12_fx ); // Qx move32(); new_samples_fx[M1 + M2 - 1 - 2 * i] = L_sub( ir12_fx, ri12_fx ); // Qx move32(); new_samples_fx[M2 + 2 * i] = L_sub( rr12_fx, ii12_fx ); // Qx move32(); } /* synthesis prototype filter */ 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(); } FOR( i = 0; i < M1; i++ ) { ptr_time_out_fx[( M1 - 1 ) - i] = synthesisBuffer_fx[4 * L2 + M1 + i]; move32(); } ptr_time_out_fx += M1; synthesisBuffer_fx -= M1; set32_fx( synthesisBuffer_fx, 0, M1 ); } /* update memory */ Copy32( buffer_fx, h_cldfb->cldfb_state_fx, h_cldfb->p_filter_length ); return; } void cldfbSynthesis_ivas_fx_3( Word32 **realBuffer_fx, /* i : real values Qx*/ 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 */ const Word16 shift, /* i : number of processed samples */ const Word16 out_shift, /* i : number of processed samples */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ) { Word16 i; Word16 k; Word16 L2; Word16 M1; Word16 M2; Word16 M41; Word16 M42; Word16 Mz; Word32 rBuffer_fx[2 * CLDFB_NO_CHANNELS_MAX]; Word32 iBuffer_fx[2 * CLDFB_NO_CHANNELS_MAX]; const Word32 *rot_vctr_re_fx; const Word32 *rot_vctr_im_fx; const Word32 *rot_vctr_delay_re_fx; const Word32 *rot_vctr_delay_im_fx; Word32 rr12_fx, ir12_fx; Word32 ri12_fx, ii12_fx; Word32 *synthesisBuffer_fx, buffer_fx[( CLDFB_NO_CHANNELS_MAX * CLDFB_NO_COL_MAX ) + ( 10 * CLDFB_NO_CHANNELS_MAX )]; Word32 new_samples_fx[2 * CLDFB_NO_CHANNELS_MAX]; Word32 *ptr_time_out_fx; const Word16 *p_filter; Word16 p_filter_sf; Word32 accu0, accu1, accu2, accu3, accu4; Word16 no_col = h_cldfb->no_col; move16(); M1 = h_cldfb->no_channels; move16(); L2 = shl( M1, 1 ); M2 = shr( M1, 1 ); M41 = shr( M2, 1 ); M42 = sub( M2, M41 ); Mz = sub( M1, h_cldfb->bandsToZero ); /* only process needed cols */ IF( GT_16( samplesToProcess, -1 ) ) { no_col = s_min( no_col, idiv1616( sub( add( samplesToProcess, h_cldfb->no_channels ), 1 ), h_cldfb->no_channels ) ); move16(); } rot_vctr_re_fx = h_cldfb->rot_vec_syn_re_fx; rot_vctr_im_fx = h_cldfb->rot_vec_syn_im_fx; rot_vctr_delay_re_fx = h_cldfb->rot_vec_syn_delay_re_fx; rot_vctr_delay_im_fx = h_cldfb->rot_vec_syn_delay_im_fx; synthesisBuffer_fx = buffer_fx; Copy32( h_cldfb->cldfb_state_fx, synthesisBuffer_fx + i_mult( M1, no_col ), h_cldfb->p_filter_length ); p_filter = h_cldfb->p_filter; p_filter_sf = h_cldfb->p_filter_sf; // Q14 move16(); ptr_time_out_fx = timeOut_fx; /*synthesisBuffer += M1 * h_cldfb->no_col;*/ synthesisBuffer_fx += i_mult( M1, no_col ); FOR( k = 0; k < no_col; k++ ) { IF( EQ_16( h_cldfb->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { /* rotation due to delay*/ /*if(h_cldfb->ds != M1)*/ IF( rot_vctr_delay_re_fx != NULL ) { FOR( i = 0; i < M1; i++ ) { Word32 cplx_aux; /* delay */ /*cplxMult(&rBuffer[i], &iBuffer[i], realBuffer[k][i], imagBuffer[k][i], cos((EVS_PI/M1)*(i+0.5)*(-(h_cldfb->ds-M1)*0.5)), sin((EVS_PI/M1)*(i+0.5)*(-(h_cldfb->ds-M1)*0.5)));*/ /*cplxMult(&rBuffer[i], &iBuffer[i], realBuffer[k][i], imagBuffer[k][i], rot_vctr_delay_re[i], rot_vctr_delay_im[i]);*/ /*cplxMult(&realBuffer[k][i], &imagBuffer[k][i], realBuffer[k][i], imagBuffer[k][i], rot_vctr_delay_re[i], rot_vctr_delay_im[i]);*/ cplx_aux = Msub_32_32( Mpy_32_32( realBuffer_fx[k][i], rot_vctr_delay_re_fx[i] ), imagBuffer_fx[k][i], rot_vctr_delay_im_fx[i] ); // Qx imagBuffer_fx[k][i] = Madd_32_32( Mpy_32_32( realBuffer_fx[k][i], rot_vctr_delay_im_fx[i] ), imagBuffer_fx[k][i], rot_vctr_delay_re_fx[i] ); move32(); realBuffer_fx[k][i] = cplx_aux; move32(); /*realBuffer[k][i] = rBuffer[i];*/ /*imagBuffer[k][i] = iBuffer[i];*/ } } } FOR( i = Mz; i < M1; i++ ) { realBuffer_fx[k][i] = 0; move32(); imagBuffer_fx[k][i] = 0; move32(); } FOR( i = 0; i < M2; i++ ) { /* pre modulation of DST IV */ /*cplxMult(&rBuffer[2*i], &rBuffer[2*i+1], realBuffer[k][2*i], realBuffer[k][M1-1-2*i], rot_vctr_re[i], rot_vctr_im[i]);*/ rBuffer_fx[2 * i] = Msub_32_32( Mpy_32_32( realBuffer_fx[k][2 * i], rot_vctr_re_fx[i] ), realBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[i] ); // Qx move32(); rBuffer_fx[2 * i + 1] = Madd_32_32( Mpy_32_32( realBuffer_fx[k][2 * i], rot_vctr_im_fx[i] ), realBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[i] ); // Qx move32(); /* pre modulation of DCT IV */ /*cplxMult(&iBuffer[2*i], &iBuffer[2*i+1],-imagBuffer[k][2*i], imagBuffer[k][M1-1-2*i], rot_vctr_re[i], rot_vctr_im[i]);*/ iBuffer_fx[2 * i] = Msub_32_32( Mpy_32_32( ( L_negate( imagBuffer_fx[k][2 * i] ) ), rot_vctr_re_fx[i] ), imagBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[i] ); // Qx move32(); iBuffer_fx[2 * i + 1] = Msub_32_32( Mpy_32_32( imagBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[i] ), imagBuffer_fx[k][2 * i], rot_vctr_im_fx[i] ); // Qx move32(); } /* FFT of DST IV */ fft_cldfb_fx( rBuffer_fx, M2 ); /* FFT of DCT IV */ fft_cldfb_fx( iBuffer_fx, M2 ); /* folding */ FOR( i = 0; i < M41; i++ ) { /* post modulation of DST IV */ rr12_fx = Msub_32_32( Mpy_32_32( rBuffer_fx[( M1 - 2 ) - ( i * 2 )], rot_vctr_re_fx[( M2 - 1 ) - i] ), rBuffer_fx[( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[( M2 - 1 ) - i] ); // Qx ri12_fx = Madd_32_32( Mpy_32_32( rBuffer_fx[( M1 - 2 ) - ( i * 2 )], rot_vctr_im_fx[( M2 - 1 ) - i] ), rBuffer_fx[( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[( M2 - 1 ) - i] ); // Qx /* post modulation of DCT IV */ ir12_fx = Msub_32_32( Mpy_32_32( iBuffer_fx[( M1 - 2 ) - ( i * 2 )], rot_vctr_re_fx[( M2 - 1 ) - i] ), iBuffer_fx[( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[( M2 - 1 ) - i] ); // Qx ii12_fx = Madd_32_32( Mpy_32_32( iBuffer_fx[( M1 - 2 ) - ( i * 2 )], rot_vctr_im_fx[( M2 - 1 ) - i] ), iBuffer_fx[( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[( M2 - 1 ) - i] ); // Qx new_samples_fx[M1 + M2 + 1 + 2 * i] = L_negate( L_add( rr12_fx, ii12_fx ) ); // Qx move32(); new_samples_fx[M2 - 2 - 2 * i] = L_negate( L_add( ri12_fx, ir12_fx ) ); // Qx move32(); new_samples_fx[M1 + M2 - 2 - 2 * i] = L_sub( rr12_fx, ii12_fx ); // Qx move32(); new_samples_fx[M2 + 1 + 2 * i] = L_sub( ir12_fx, ri12_fx ); // Qx move32(); } FOR( i = 0; i < M42; i++ ) { /* post modulation of DST IV */ rr12_fx = Msub_32_32( Mpy_32_32( rBuffer_fx[2 * i], rot_vctr_re_fx[i] ), rBuffer_fx[2 * i + 1], rot_vctr_im_fx[i] ); // Qx ri12_fx = Madd_32_32( Mpy_32_32( rBuffer_fx[2 * i], rot_vctr_im_fx[i] ), rBuffer_fx[2 * i + 1], rot_vctr_re_fx[i] ); // Qx /* post modulation of DCT IV */ ir12_fx = Msub_32_32( Mpy_32_32( iBuffer_fx[2 * i], rot_vctr_re_fx[i] ), iBuffer_fx[2 * i + 1], rot_vctr_im_fx[i] ); // Qx ii12_fx = Madd_32_32( Mpy_32_32( iBuffer_fx[2 * i], rot_vctr_im_fx[i] ), iBuffer_fx[2 * i + 1], rot_vctr_re_fx[i] ); // Qx new_samples_fx[M1 + M2 + 2 * i] = L_add( ri12_fx, ir12_fx ); // Qx move32(); new_samples_fx[M2 - 1 - 2 * i] = L_add( rr12_fx, ii12_fx ); // Qx move32(); new_samples_fx[M1 + M2 - 1 - 2 * i] = L_sub( ir12_fx, ri12_fx ); // Qx move32(); new_samples_fx[M2 + 2 * i] = L_sub( rr12_fx, ii12_fx ); // Qx move32(); } /* synthesis prototype filter */ 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(); } FOR( i = 0; i < M1; i++ ) { ptr_time_out_fx[( M1 - 1 ) - i] = L_shl_sat( synthesisBuffer_fx[4 * L2 + M1 + i], out_shift ); move32(); } ptr_time_out_fx += M1; synthesisBuffer_fx -= M1; set32_fx( synthesisBuffer_fx, 0, M1 ); } /* update memory */ Copy32( buffer_fx, h_cldfb->cldfb_state_fx, h_cldfb->p_filter_length ); return; } void configureCldfb_ivas_enc_fx( HANDLE_CLDFB_FILTER_BANK h_cldfb, /* i/o: filter bank handle */ Loading lib_com/ivas_prot_fx.h +4 −4 Original line number Diff line number Diff line Loading @@ -5364,8 +5364,8 @@ ivas_error ivas_sba_dec_render_fx( 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 */ ); 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/prot_fx.h +19 −0 Original line number Diff line number Diff line Loading @@ -9746,6 +9746,25 @@ void cldfbSynthesis_ivas_fx( HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ); void cldfbSynthesis_ivas_fx_2( Word32 **realBuffer_fx, /* i : real values Qx*/ 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 */ const Word16 shift, /* i : number of processed samples */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ); void cldfbSynthesis_ivas_fx_3( Word32 **realBuffer_fx, /* i : real values Qx*/ 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 */ const Word16 shift, /* i : number of processed samples */ const Word16 out_shift, /* i : number of processed samples */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ); // bass_psfilter.c void addBassPostFilter_ivas_fx( const Word32 *harm_timeIn_fx, Loading lib_dec/dec_tcx_fx.c +12 −7 Original line number Diff line number Diff line Loading @@ -2686,7 +2686,7 @@ void IMDCT_ivas_fx( } move16(); set16_fx( win_fx, 0, shr( add( L_FRAME_PLUS, L_MDCT_OVLP_MAX ), 1 ) ); set16_fx( win_fx, 0, shr( ( L_FRAME_PLUS + L_MDCT_OVLP_MAX ), 1 ) ); Word16 tcx_offset_tmp = add( tcx_offset, shr( L_ola, 1 ) ); set16_fx( xn_buf_fx, 0, tcx_offset_tmp ); /* zero left end of buffer */ Loading Loading @@ -2865,9 +2865,10 @@ void IMDCT_ivas_fx( q_tmp_fx_32 = q_xn_buf_fx_32; move16(); Word16 diff = sub( q_tmp_fx_32, q_win ); FOR( Word16 ind = 0; ind < L_frame; ind++ ) { old_out_fx_32[ind] = L_shl( old_out_fx[ind], sub( q_tmp_fx_32, q_win ) ); old_out_fx_32[ind] = L_shl( old_out_fx[ind], diff ); move32(); } Loading @@ -2875,8 +2876,8 @@ void IMDCT_ivas_fx( FOR( Word16 ind = 0; ind < L_frame; ind++ ) { old_out_fx[ind] = (Word16) L_shr( old_out_fx_32[ind], sub( q_tmp_fx_32, q_win ) ); xn_buf_fx[ind] = (Word16) L_shr( xn_buf_fx_32[ind], sub( q_tmp_fx_32, q_win ) ); old_out_fx[ind] = (Word16) L_shr( old_out_fx_32[ind], diff ); xn_buf_fx[ind] = (Word16) L_shr( xn_buf_fx_32[ind], diff ); move16(); move16(); } Loading @@ -2900,19 +2901,23 @@ void IMDCT_ivas_fx( q_tmp_fx_32 = sub( q_xn_buf_fx_32, res_e ); // v_multc_fixed( xn_buf_fx_32 + overlap / 2 + nz, (float) sqrt( (float) L_frame / NORM_MDCT_FACTOR ), tmp_fx_32, L_frame ); Word16 q_diff = sub( q_xn_buf_fx_32, q_win ); FOR( Word16 ind = 0; ind < L_frame; ind++ ) { xn_buf_fx[( ind + ( overlap / 2 ) ) + nz] = (Word16) L_shr( xn_buf_fx_32[( ind + ( overlap / 2 ) ) + nz], sub( q_xn_buf_fx_32, q_win ) ); xn_buf_fx[( ind + ( overlap / 2 ) ) + nz] = (Word16) L_shr( xn_buf_fx_32[( ind + ( overlap / 2 ) ) + nz], q_diff ); move16(); } window_ola_fx( tmp_fx_32, xn_buf_fx, &q_tmp_fx_32, old_out_fx, &q_old_out, L_frame, hTcxCfg->tcx_last_overlap_mode, hTcxCfg->tcx_curr_overlap_mode, 0, 0, NULL ); q_diff = sub( q_old_out, q_win ); Word16 diff = sub( q_tmp_fx_32, q_win ); FOR( Word16 ind = 0; ind < L_frame; ind++ ) { old_out_fx[ind] = shr_sat( old_out_fx[ind], sub( q_old_out, q_win ) ); old_out_fx[ind] = shr_sat( old_out_fx[ind], q_diff ); move16(); xn_buf_fx[ind] = shr_sat( xn_buf_fx[ind], sub( q_tmp_fx_32, q_win ) ); xn_buf_fx[ind] = shr_sat( xn_buf_fx[ind], diff ); move16(); } } Loading lib_dec/igf_dec_fx.c +19 −17 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
lib_com/cldfb.c +423 −0 Original line number Diff line number Diff line Loading @@ -1305,6 +1305,429 @@ void cldfbSynthesis_ivas_fx( return; } void cldfbSynthesis_ivas_fx_2( Word32 **realBuffer_fx, /* i : real values Qx*/ 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 */ const Word16 shift, /* i : number of processed samples */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ) { Word16 i; Word16 k; Word16 L2; Word16 M1; Word16 M2; Word16 M41; Word16 M42; Word16 Mz; Word32 rBuffer_fx[2 * CLDFB_NO_CHANNELS_MAX]; Word32 iBuffer_fx[2 * CLDFB_NO_CHANNELS_MAX]; const Word32 *rot_vctr_re_fx; const Word32 *rot_vctr_im_fx; const Word32 *rot_vctr_delay_re_fx; const Word32 *rot_vctr_delay_im_fx; Word32 rr12_fx, ir12_fx; Word32 ri12_fx, ii12_fx; Word32 *synthesisBuffer_fx, buffer_fx[( CLDFB_NO_CHANNELS_MAX * CLDFB_NO_COL_MAX ) + ( 10 * CLDFB_NO_CHANNELS_MAX )]; Word32 new_samples_fx[2 * CLDFB_NO_CHANNELS_MAX]; Word32 *ptr_time_out_fx; const Word16 *p_filter; Word16 p_filter_sf; Word32 accu0, accu1, accu2, accu3, accu4; Word16 no_col = h_cldfb->no_col; move16(); M1 = h_cldfb->no_channels; move16(); L2 = shl( M1, 1 ); M2 = shr( M1, 1 ); M41 = shr( M2, 1 ); M42 = sub( M2, M41 ); Mz = sub( M1, h_cldfb->bandsToZero ); /* only process needed cols */ IF( GT_16( samplesToProcess, -1 ) ) { no_col = s_min( no_col, idiv1616( sub( add( samplesToProcess, h_cldfb->no_channels ), 1 ), h_cldfb->no_channels ) ); move16(); } rot_vctr_re_fx = h_cldfb->rot_vec_syn_re_fx; rot_vctr_im_fx = h_cldfb->rot_vec_syn_im_fx; rot_vctr_delay_re_fx = h_cldfb->rot_vec_syn_delay_re_fx; rot_vctr_delay_im_fx = h_cldfb->rot_vec_syn_delay_im_fx; synthesisBuffer_fx = buffer_fx; Copy32( h_cldfb->cldfb_state_fx, synthesisBuffer_fx + i_mult( M1, no_col ), h_cldfb->p_filter_length ); p_filter = h_cldfb->p_filter; p_filter_sf = h_cldfb->p_filter_sf; // Q14 move16(); ptr_time_out_fx = timeOut_fx; /*synthesisBuffer += M1 * h_cldfb->no_col;*/ synthesisBuffer_fx += i_mult( M1, no_col ); FOR( k = 0; k < no_col; k++ ) { IF( EQ_16( h_cldfb->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { /* rotation due to delay*/ /*if(h_cldfb->ds != M1)*/ IF( rot_vctr_delay_re_fx != NULL ) { FOR( i = 0; i < M1; i++ ) { Word32 cplx_aux; /* delay */ /*cplxMult(&rBuffer[i], &iBuffer[i], realBuffer[k][i], imagBuffer[k][i], cos((EVS_PI/M1)*(i+0.5)*(-(h_cldfb->ds-M1)*0.5)), sin((EVS_PI/M1)*(i+0.5)*(-(h_cldfb->ds-M1)*0.5)));*/ /*cplxMult(&rBuffer[i], &iBuffer[i], realBuffer[k][i], imagBuffer[k][i], rot_vctr_delay_re[i], rot_vctr_delay_im[i]);*/ /*cplxMult(&realBuffer[k][i], &imagBuffer[k][i], realBuffer[k][i], imagBuffer[k][i], rot_vctr_delay_re[i], rot_vctr_delay_im[i]);*/ cplx_aux = Msub_32_32( Mpy_32_32( realBuffer_fx[k][i], rot_vctr_delay_re_fx[i] ), imagBuffer_fx[k][i], rot_vctr_delay_im_fx[i] ); // Qx imagBuffer_fx[k][i] = Madd_32_32( Mpy_32_32( realBuffer_fx[k][i], rot_vctr_delay_im_fx[i] ), imagBuffer_fx[k][i], rot_vctr_delay_re_fx[i] ); move32(); realBuffer_fx[k][i] = cplx_aux; move32(); /*realBuffer[k][i] = rBuffer[i];*/ /*imagBuffer[k][i] = iBuffer[i];*/ } } } FOR( i = Mz; i < M1; i++ ) { realBuffer_fx[k][i] = 0; move32(); imagBuffer_fx[k][i] = 0; move32(); } FOR( i = 0; i < M2; i++ ) { /* pre modulation of DST IV */ /*cplxMult(&rBuffer[2*i], &rBuffer[2*i+1], realBuffer[k][2*i], realBuffer[k][M1-1-2*i], rot_vctr_re[i], rot_vctr_im[i]);*/ rBuffer_fx[2 * i] = Msub_32_32( Mpy_32_32( realBuffer_fx[k][2 * i], rot_vctr_re_fx[i] ), realBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[i] ); // Qx move32(); rBuffer_fx[2 * i + 1] = Madd_32_32( Mpy_32_32( realBuffer_fx[k][2 * i], rot_vctr_im_fx[i] ), realBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[i] ); // Qx move32(); /* pre modulation of DCT IV */ /*cplxMult(&iBuffer[2*i], &iBuffer[2*i+1],-imagBuffer[k][2*i], imagBuffer[k][M1-1-2*i], rot_vctr_re[i], rot_vctr_im[i]);*/ iBuffer_fx[2 * i] = Msub_32_32( Mpy_32_32( ( L_negate( imagBuffer_fx[k][2 * i] ) ), rot_vctr_re_fx[i] ), imagBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[i] ); // Qx move32(); iBuffer_fx[2 * i + 1] = Msub_32_32( Mpy_32_32( imagBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[i] ), imagBuffer_fx[k][2 * i], rot_vctr_im_fx[i] ); // Qx move32(); } /* FFT of DST IV */ fft_cldfb_fx( rBuffer_fx, M2 ); /* FFT of DCT IV */ fft_cldfb_fx( iBuffer_fx, M2 ); /* folding */ FOR( i = 0; i < M41; i++ ) { /* post modulation of DST IV */ rr12_fx = Msub_32_32( Mpy_32_32( rBuffer_fx[( M1 - 2 ) - ( i * 2 )], rot_vctr_re_fx[( M2 - 1 ) - i] ), rBuffer_fx[( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[( M2 - 1 ) - i] ); // Qx ri12_fx = Madd_32_32( Mpy_32_32( rBuffer_fx[( M1 - 2 ) - ( i * 2 )], rot_vctr_im_fx[( M2 - 1 ) - i] ), rBuffer_fx[( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[( M2 - 1 ) - i] ); // Qx /* post modulation of DCT IV */ ir12_fx = Msub_32_32( Mpy_32_32( iBuffer_fx[( M1 - 2 ) - ( i * 2 )], rot_vctr_re_fx[( M2 - 1 ) - i] ), iBuffer_fx[( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[( M2 - 1 ) - i] ); // Qx ii12_fx = Madd_32_32( Mpy_32_32( iBuffer_fx[( M1 - 2 ) - ( i * 2 )], rot_vctr_im_fx[( M2 - 1 ) - i] ), iBuffer_fx[( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[( M2 - 1 ) - i] ); // Qx new_samples_fx[M1 + M2 + 1 + 2 * i] = L_negate( L_add( rr12_fx, ii12_fx ) ); // Qx move32(); new_samples_fx[M2 - 2 - 2 * i] = L_negate( L_add( ri12_fx, ir12_fx ) ); // Qx move32(); new_samples_fx[M1 + M2 - 2 - 2 * i] = L_sub( rr12_fx, ii12_fx ); // Qx move32(); new_samples_fx[M2 + 1 + 2 * i] = L_sub( ir12_fx, ri12_fx ); // Qx move32(); } FOR( i = 0; i < M42; i++ ) { /* post modulation of DST IV */ rr12_fx = Msub_32_32( Mpy_32_32( rBuffer_fx[2 * i], rot_vctr_re_fx[i] ), rBuffer_fx[2 * i + 1], rot_vctr_im_fx[i] ); // Qx ri12_fx = Madd_32_32( Mpy_32_32( rBuffer_fx[2 * i], rot_vctr_im_fx[i] ), rBuffer_fx[2 * i + 1], rot_vctr_re_fx[i] ); // Qx /* post modulation of DCT IV */ ir12_fx = Msub_32_32( Mpy_32_32( iBuffer_fx[2 * i], rot_vctr_re_fx[i] ), iBuffer_fx[2 * i + 1], rot_vctr_im_fx[i] ); // Qx ii12_fx = Madd_32_32( Mpy_32_32( iBuffer_fx[2 * i], rot_vctr_im_fx[i] ), iBuffer_fx[2 * i + 1], rot_vctr_re_fx[i] ); // Qx new_samples_fx[M1 + M2 + 2 * i] = L_add( ri12_fx, ir12_fx ); // Qx move32(); new_samples_fx[M2 - 1 - 2 * i] = L_add( rr12_fx, ii12_fx ); // Qx move32(); new_samples_fx[M1 + M2 - 1 - 2 * i] = L_sub( ir12_fx, ri12_fx ); // Qx move32(); new_samples_fx[M2 + 2 * i] = L_sub( rr12_fx, ii12_fx ); // Qx move32(); } /* synthesis prototype filter */ 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(); } FOR( i = 0; i < M1; i++ ) { ptr_time_out_fx[( M1 - 1 ) - i] = synthesisBuffer_fx[4 * L2 + M1 + i]; move32(); } ptr_time_out_fx += M1; synthesisBuffer_fx -= M1; set32_fx( synthesisBuffer_fx, 0, M1 ); } /* update memory */ Copy32( buffer_fx, h_cldfb->cldfb_state_fx, h_cldfb->p_filter_length ); return; } void cldfbSynthesis_ivas_fx_3( Word32 **realBuffer_fx, /* i : real values Qx*/ 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 */ const Word16 shift, /* i : number of processed samples */ const Word16 out_shift, /* i : number of processed samples */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ) { Word16 i; Word16 k; Word16 L2; Word16 M1; Word16 M2; Word16 M41; Word16 M42; Word16 Mz; Word32 rBuffer_fx[2 * CLDFB_NO_CHANNELS_MAX]; Word32 iBuffer_fx[2 * CLDFB_NO_CHANNELS_MAX]; const Word32 *rot_vctr_re_fx; const Word32 *rot_vctr_im_fx; const Word32 *rot_vctr_delay_re_fx; const Word32 *rot_vctr_delay_im_fx; Word32 rr12_fx, ir12_fx; Word32 ri12_fx, ii12_fx; Word32 *synthesisBuffer_fx, buffer_fx[( CLDFB_NO_CHANNELS_MAX * CLDFB_NO_COL_MAX ) + ( 10 * CLDFB_NO_CHANNELS_MAX )]; Word32 new_samples_fx[2 * CLDFB_NO_CHANNELS_MAX]; Word32 *ptr_time_out_fx; const Word16 *p_filter; Word16 p_filter_sf; Word32 accu0, accu1, accu2, accu3, accu4; Word16 no_col = h_cldfb->no_col; move16(); M1 = h_cldfb->no_channels; move16(); L2 = shl( M1, 1 ); M2 = shr( M1, 1 ); M41 = shr( M2, 1 ); M42 = sub( M2, M41 ); Mz = sub( M1, h_cldfb->bandsToZero ); /* only process needed cols */ IF( GT_16( samplesToProcess, -1 ) ) { no_col = s_min( no_col, idiv1616( sub( add( samplesToProcess, h_cldfb->no_channels ), 1 ), h_cldfb->no_channels ) ); move16(); } rot_vctr_re_fx = h_cldfb->rot_vec_syn_re_fx; rot_vctr_im_fx = h_cldfb->rot_vec_syn_im_fx; rot_vctr_delay_re_fx = h_cldfb->rot_vec_syn_delay_re_fx; rot_vctr_delay_im_fx = h_cldfb->rot_vec_syn_delay_im_fx; synthesisBuffer_fx = buffer_fx; Copy32( h_cldfb->cldfb_state_fx, synthesisBuffer_fx + i_mult( M1, no_col ), h_cldfb->p_filter_length ); p_filter = h_cldfb->p_filter; p_filter_sf = h_cldfb->p_filter_sf; // Q14 move16(); ptr_time_out_fx = timeOut_fx; /*synthesisBuffer += M1 * h_cldfb->no_col;*/ synthesisBuffer_fx += i_mult( M1, no_col ); FOR( k = 0; k < no_col; k++ ) { IF( EQ_16( h_cldfb->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { /* rotation due to delay*/ /*if(h_cldfb->ds != M1)*/ IF( rot_vctr_delay_re_fx != NULL ) { FOR( i = 0; i < M1; i++ ) { Word32 cplx_aux; /* delay */ /*cplxMult(&rBuffer[i], &iBuffer[i], realBuffer[k][i], imagBuffer[k][i], cos((EVS_PI/M1)*(i+0.5)*(-(h_cldfb->ds-M1)*0.5)), sin((EVS_PI/M1)*(i+0.5)*(-(h_cldfb->ds-M1)*0.5)));*/ /*cplxMult(&rBuffer[i], &iBuffer[i], realBuffer[k][i], imagBuffer[k][i], rot_vctr_delay_re[i], rot_vctr_delay_im[i]);*/ /*cplxMult(&realBuffer[k][i], &imagBuffer[k][i], realBuffer[k][i], imagBuffer[k][i], rot_vctr_delay_re[i], rot_vctr_delay_im[i]);*/ cplx_aux = Msub_32_32( Mpy_32_32( realBuffer_fx[k][i], rot_vctr_delay_re_fx[i] ), imagBuffer_fx[k][i], rot_vctr_delay_im_fx[i] ); // Qx imagBuffer_fx[k][i] = Madd_32_32( Mpy_32_32( realBuffer_fx[k][i], rot_vctr_delay_im_fx[i] ), imagBuffer_fx[k][i], rot_vctr_delay_re_fx[i] ); move32(); realBuffer_fx[k][i] = cplx_aux; move32(); /*realBuffer[k][i] = rBuffer[i];*/ /*imagBuffer[k][i] = iBuffer[i];*/ } } } FOR( i = Mz; i < M1; i++ ) { realBuffer_fx[k][i] = 0; move32(); imagBuffer_fx[k][i] = 0; move32(); } FOR( i = 0; i < M2; i++ ) { /* pre modulation of DST IV */ /*cplxMult(&rBuffer[2*i], &rBuffer[2*i+1], realBuffer[k][2*i], realBuffer[k][M1-1-2*i], rot_vctr_re[i], rot_vctr_im[i]);*/ rBuffer_fx[2 * i] = Msub_32_32( Mpy_32_32( realBuffer_fx[k][2 * i], rot_vctr_re_fx[i] ), realBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[i] ); // Qx move32(); rBuffer_fx[2 * i + 1] = Madd_32_32( Mpy_32_32( realBuffer_fx[k][2 * i], rot_vctr_im_fx[i] ), realBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[i] ); // Qx move32(); /* pre modulation of DCT IV */ /*cplxMult(&iBuffer[2*i], &iBuffer[2*i+1],-imagBuffer[k][2*i], imagBuffer[k][M1-1-2*i], rot_vctr_re[i], rot_vctr_im[i]);*/ iBuffer_fx[2 * i] = Msub_32_32( Mpy_32_32( ( L_negate( imagBuffer_fx[k][2 * i] ) ), rot_vctr_re_fx[i] ), imagBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[i] ); // Qx move32(); iBuffer_fx[2 * i + 1] = Msub_32_32( Mpy_32_32( imagBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[i] ), imagBuffer_fx[k][2 * i], rot_vctr_im_fx[i] ); // Qx move32(); } /* FFT of DST IV */ fft_cldfb_fx( rBuffer_fx, M2 ); /* FFT of DCT IV */ fft_cldfb_fx( iBuffer_fx, M2 ); /* folding */ FOR( i = 0; i < M41; i++ ) { /* post modulation of DST IV */ rr12_fx = Msub_32_32( Mpy_32_32( rBuffer_fx[( M1 - 2 ) - ( i * 2 )], rot_vctr_re_fx[( M2 - 1 ) - i] ), rBuffer_fx[( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[( M2 - 1 ) - i] ); // Qx ri12_fx = Madd_32_32( Mpy_32_32( rBuffer_fx[( M1 - 2 ) - ( i * 2 )], rot_vctr_im_fx[( M2 - 1 ) - i] ), rBuffer_fx[( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[( M2 - 1 ) - i] ); // Qx /* post modulation of DCT IV */ ir12_fx = Msub_32_32( Mpy_32_32( iBuffer_fx[( M1 - 2 ) - ( i * 2 )], rot_vctr_re_fx[( M2 - 1 ) - i] ), iBuffer_fx[( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[( M2 - 1 ) - i] ); // Qx ii12_fx = Madd_32_32( Mpy_32_32( iBuffer_fx[( M1 - 2 ) - ( i * 2 )], rot_vctr_im_fx[( M2 - 1 ) - i] ), iBuffer_fx[( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[( M2 - 1 ) - i] ); // Qx new_samples_fx[M1 + M2 + 1 + 2 * i] = L_negate( L_add( rr12_fx, ii12_fx ) ); // Qx move32(); new_samples_fx[M2 - 2 - 2 * i] = L_negate( L_add( ri12_fx, ir12_fx ) ); // Qx move32(); new_samples_fx[M1 + M2 - 2 - 2 * i] = L_sub( rr12_fx, ii12_fx ); // Qx move32(); new_samples_fx[M2 + 1 + 2 * i] = L_sub( ir12_fx, ri12_fx ); // Qx move32(); } FOR( i = 0; i < M42; i++ ) { /* post modulation of DST IV */ rr12_fx = Msub_32_32( Mpy_32_32( rBuffer_fx[2 * i], rot_vctr_re_fx[i] ), rBuffer_fx[2 * i + 1], rot_vctr_im_fx[i] ); // Qx ri12_fx = Madd_32_32( Mpy_32_32( rBuffer_fx[2 * i], rot_vctr_im_fx[i] ), rBuffer_fx[2 * i + 1], rot_vctr_re_fx[i] ); // Qx /* post modulation of DCT IV */ ir12_fx = Msub_32_32( Mpy_32_32( iBuffer_fx[2 * i], rot_vctr_re_fx[i] ), iBuffer_fx[2 * i + 1], rot_vctr_im_fx[i] ); // Qx ii12_fx = Madd_32_32( Mpy_32_32( iBuffer_fx[2 * i], rot_vctr_im_fx[i] ), iBuffer_fx[2 * i + 1], rot_vctr_re_fx[i] ); // Qx new_samples_fx[M1 + M2 + 2 * i] = L_add( ri12_fx, ir12_fx ); // Qx move32(); new_samples_fx[M2 - 1 - 2 * i] = L_add( rr12_fx, ii12_fx ); // Qx move32(); new_samples_fx[M1 + M2 - 1 - 2 * i] = L_sub( ir12_fx, ri12_fx ); // Qx move32(); new_samples_fx[M2 + 2 * i] = L_sub( rr12_fx, ii12_fx ); // Qx move32(); } /* synthesis prototype filter */ 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(); } FOR( i = 0; i < M1; i++ ) { ptr_time_out_fx[( M1 - 1 ) - i] = L_shl_sat( synthesisBuffer_fx[4 * L2 + M1 + i], out_shift ); move32(); } ptr_time_out_fx += M1; synthesisBuffer_fx -= M1; set32_fx( synthesisBuffer_fx, 0, M1 ); } /* update memory */ Copy32( buffer_fx, h_cldfb->cldfb_state_fx, h_cldfb->p_filter_length ); return; } void configureCldfb_ivas_enc_fx( HANDLE_CLDFB_FILTER_BANK h_cldfb, /* i/o: filter bank handle */ Loading
lib_com/ivas_prot_fx.h +4 −4 Original line number Diff line number Diff line Loading @@ -5364,8 +5364,8 @@ ivas_error ivas_sba_dec_render_fx( 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 */ ); 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/prot_fx.h +19 −0 Original line number Diff line number Diff line Loading @@ -9746,6 +9746,25 @@ void cldfbSynthesis_ivas_fx( HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ); void cldfbSynthesis_ivas_fx_2( Word32 **realBuffer_fx, /* i : real values Qx*/ 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 */ const Word16 shift, /* i : number of processed samples */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ); void cldfbSynthesis_ivas_fx_3( Word32 **realBuffer_fx, /* i : real values Qx*/ 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 */ const Word16 shift, /* i : number of processed samples */ const Word16 out_shift, /* i : number of processed samples */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ); // bass_psfilter.c void addBassPostFilter_ivas_fx( const Word32 *harm_timeIn_fx, Loading
lib_dec/dec_tcx_fx.c +12 −7 Original line number Diff line number Diff line Loading @@ -2686,7 +2686,7 @@ void IMDCT_ivas_fx( } move16(); set16_fx( win_fx, 0, shr( add( L_FRAME_PLUS, L_MDCT_OVLP_MAX ), 1 ) ); set16_fx( win_fx, 0, shr( ( L_FRAME_PLUS + L_MDCT_OVLP_MAX ), 1 ) ); Word16 tcx_offset_tmp = add( tcx_offset, shr( L_ola, 1 ) ); set16_fx( xn_buf_fx, 0, tcx_offset_tmp ); /* zero left end of buffer */ Loading Loading @@ -2865,9 +2865,10 @@ void IMDCT_ivas_fx( q_tmp_fx_32 = q_xn_buf_fx_32; move16(); Word16 diff = sub( q_tmp_fx_32, q_win ); FOR( Word16 ind = 0; ind < L_frame; ind++ ) { old_out_fx_32[ind] = L_shl( old_out_fx[ind], sub( q_tmp_fx_32, q_win ) ); old_out_fx_32[ind] = L_shl( old_out_fx[ind], diff ); move32(); } Loading @@ -2875,8 +2876,8 @@ void IMDCT_ivas_fx( FOR( Word16 ind = 0; ind < L_frame; ind++ ) { old_out_fx[ind] = (Word16) L_shr( old_out_fx_32[ind], sub( q_tmp_fx_32, q_win ) ); xn_buf_fx[ind] = (Word16) L_shr( xn_buf_fx_32[ind], sub( q_tmp_fx_32, q_win ) ); old_out_fx[ind] = (Word16) L_shr( old_out_fx_32[ind], diff ); xn_buf_fx[ind] = (Word16) L_shr( xn_buf_fx_32[ind], diff ); move16(); move16(); } Loading @@ -2900,19 +2901,23 @@ void IMDCT_ivas_fx( q_tmp_fx_32 = sub( q_xn_buf_fx_32, res_e ); // v_multc_fixed( xn_buf_fx_32 + overlap / 2 + nz, (float) sqrt( (float) L_frame / NORM_MDCT_FACTOR ), tmp_fx_32, L_frame ); Word16 q_diff = sub( q_xn_buf_fx_32, q_win ); FOR( Word16 ind = 0; ind < L_frame; ind++ ) { xn_buf_fx[( ind + ( overlap / 2 ) ) + nz] = (Word16) L_shr( xn_buf_fx_32[( ind + ( overlap / 2 ) ) + nz], sub( q_xn_buf_fx_32, q_win ) ); xn_buf_fx[( ind + ( overlap / 2 ) ) + nz] = (Word16) L_shr( xn_buf_fx_32[( ind + ( overlap / 2 ) ) + nz], q_diff ); move16(); } window_ola_fx( tmp_fx_32, xn_buf_fx, &q_tmp_fx_32, old_out_fx, &q_old_out, L_frame, hTcxCfg->tcx_last_overlap_mode, hTcxCfg->tcx_curr_overlap_mode, 0, 0, NULL ); q_diff = sub( q_old_out, q_win ); Word16 diff = sub( q_tmp_fx_32, q_win ); FOR( Word16 ind = 0; ind < L_frame; ind++ ) { old_out_fx[ind] = shr_sat( old_out_fx[ind], sub( q_old_out, q_win ) ); old_out_fx[ind] = shr_sat( old_out_fx[ind], q_diff ); move16(); xn_buf_fx[ind] = shr_sat( xn_buf_fx[ind], sub( q_tmp_fx_32, q_win ) ); xn_buf_fx[ind] = shr_sat( xn_buf_fx[ind], diff ); move16(); } } Loading
lib_dec/igf_dec_fx.c +19 −17 File changed.Preview size limit exceeded, changes collapsed. Show changes