Loading lib_com/gs_bitallocation_ivas_fx.c +1 −3 Original line number Diff line number Diff line Loading @@ -106,7 +106,6 @@ void bands_and_bit_alloc_ivas_fx( Word32 sum_bit /*Q0*/, bit_fracf /*Q18*/; Word16 etmp; Word16 tmp; Word16 Ener_per_bd_iQ_tmp[MBANDS_GN_BITALLOC16k]; // Q13 Word16 pos, band; Word32 SWB_bit_budget; // Q0 -> Q18 Word32 bits_per_bands[MBANDS_GN_BITALLOC16k]; // Q18 Loading @@ -126,7 +125,6 @@ void bands_and_bit_alloc_ivas_fx( nb_tot_bands = MBANDS_GN_BITALLOC16k; move16(); } Copy( Ener_per_bd_iQ, Ener_per_bd_iQ_tmp, nb_tot_bands ); set32_fx( bits_per_bands, 0, MBANDS_GN_BITALLOC16k ); set16_fx( out_bits_per_bands, 0, MBANDS_GN_BITALLOC16k ); Loading @@ -138,7 +136,7 @@ void bands_and_bit_alloc_ivas_fx( ener_vec[0] = add( Ener_per_bd_iQ[0], Ener_per_bd_iQ[1] ); /*Q12 */ #endif move16(); Copy( Ener_per_bd_iQ_tmp + 1, ener_vec, MBANDS_GN - 1 ); /*Q12 */ Copy( Ener_per_bd_iQ + 1, ener_vec, MBANDS_GN - 1 ); /*Q12 */ ener_vec[MBANDS_GN - 1] = ener_vec[MBANDS_GN - 2]; move16(); IF( EQ_16( L_frame, L_FRAME16k ) ) Loading lib_com/ivas_filters.c +27 −0 Original line number Diff line number Diff line Loading @@ -279,6 +279,33 @@ void ivas_filter_process_fx( } #endif void ivas_filter_process_exp_fx( ivas_filters_process_state_t *filter_state, /* i/o: filter state handle */ Word32 *pIn_Out_fx, /* i/o: signal subject to filtering (exp[i] : pIn_out_e[i]) */ const Word16 length, /* i : filter order */ Word16 *pIn_Out_e ) { SWITCH( filter_state->order ) { case IVAS_FILTER_ORDER_1: case IVAS_FILTER_ORDER_2: ivas_iir_2_filter_fx( filter_state, pIn_Out_fx, length, IVAS_FILTER_STAGE_0, pIn_Out_e ); /* Scale pIn_Out_fx back to input Q */ BREAK; case IVAS_FILTER_ORDER_4: /* biquad-1 */ ivas_iir_2_filter_fx( filter_state, pIn_Out_fx, length, IVAS_FILTER_STAGE_0, pIn_Out_e ); /* biquad-2 */ ivas_iir_2_filter_fx( filter_state, pIn_Out_fx, length, IVAS_FILTER_STAGE_1, pIn_Out_e ); /* Scale pIn_Out_fx back to input Q */ BREAK; default: BREAK; } return; } /*-----------------------------------------------------------------------------------------* * Function ivas_iir_2_filter() Loading lib_com/ivas_pca_tools.c +11 −9 Original line number Diff line number Diff line Loading @@ -322,20 +322,19 @@ static void house_refl_fx( Word32 rcp_fx = L_deposit_h( tmp ); // rcp_q Word16 rcp_q = sub( Q31, exp ); rcp_fx = L_shr( rcp_fx, sub( rcp_q, Q31 ) ); // making rcp_fx in Q31 FOR( i = 0; i < sizex; i++ ) { norm = norm_l( pu_fx[i] ); L_tmp = L_shl( pu_fx[i], norm ); pu_fx[i] = Mpy_32_32( L_tmp, rcp_fx ); // px_q + Q31 - Q31 -> px_q pu_e[i] = sub( 31, add( px_q, norm ) ); pu_fx[i] = Mpy_32_32( L_tmp, rcp_fx ); // ( px_q + norm ) + rcp_q - 31 -> exp: 31 + 31 - (px_q + norm + rcp_q) pu_e[i] = sub( 62, add( add( px_q, norm ), rcp_q ) ); move32(); move16(); } IF( pu_fx[0] >= 0 ) { pu_fx[0] = L_add( pu_fx[0], L_shl( 1, sub( 31, pu_e[0] ) ) ); pu_fx[0] = BASOP_Util_Add_Mant32Exp( pu_fx[0], pu_e[0], ONE_IN_Q30, 1, &pu_e[0] ); ( *normu_fx ) = L_negate( *normu_fx ); move32(); Loading @@ -343,7 +342,7 @@ static void house_refl_fx( } ELSE { pu_fx[0] = L_sub( pu_fx[0], L_shl( 1, sub( 31, pu_e[0] ) ) ); pu_fx[0] = BASOP_Util_Add_Mant32Exp( pu_fx[0], pu_e[0], -ONE_IN_Q30, 1, &pu_e[0] ); move32(); } Loading @@ -357,8 +356,8 @@ static void house_refl_fx( FOR( i = 0; i < sizex; i++ ) { pu_fx[i] = Mpy_32_32( pu_fx[i], rcp_fx ); // pu_e[i] + exp2 pu_fx[i] = L_shl( pu_fx[i], exp2 ); // pu_e[i] + exp2 move32(); pu_e[i] = add( pu_e[i], exp2 ); move32(); } Loading Loading @@ -489,6 +488,7 @@ static void house_qr_fx( Word32 U_fx[FOA_CHANNELS * FOA_CHANNELS]; Word16 U_e[FOA_CHANNELS * FOA_CHANNELS]; Word32 pu_fx[FOA_CHANNELS]; Word16 tmp_pu_e[FOA_CHANNELS]; Word16 pv_exp[FOA_CHANNELS]; Word32 pa_fx[FOA_CHANNELS]; Word16 tmp_e; Loading Loading @@ -573,8 +573,10 @@ static void house_qr_fx( { FOR( i = 0; i < n_rows; i++ ) { pu_fx[i] = L_shr( U_fx[i * n + k], sub( sub( 31, U_e[i * n + k] ), pu_fx_q ) ); // pu_fx_q pu_fx[i] = U_fx[i * n + k]; move32(); tmp_pu_e[i] = U_e[i * n + k]; move16(); } FOR( s = k; s < n_rows; s++ ) Loading @@ -586,8 +588,8 @@ static void house_qr_fx( } pv_fx[s - k] = dotp_fixed( &pu_fx[k], &pa_fx[k], sub( n_rows, k ) ); // pu_fx_q + Q31 - Q31 pv_exp[s - k] = sub( 31, pu_fx_q ); pv_fx[s - k] = dotp_fixed( &pu_fx[k], &pa_fx[k], sub( n_rows, k ) ); // exp: tmp_pu_e[k] pv_exp[s - k] = tmp_pu_e[k]; move32(); move16(); } Loading lib_com/ivas_prot.h +2 −3 Original line number Diff line number Diff line Loading @@ -234,8 +234,7 @@ ivas_error pre_proc_front_ivas_fx( const Word16 input_frame, /* i : frame length */ const Word16 n, /* i : channel number */ Word16 old_inp_12k8_fx[], /* o : (Q-1) buffer of old input signal */ float old_inp_12k8[], /* o : buffer of old input signal */ float old_inp_16k[], /* o : buffer of old input signal @16kHz */ Word16 old_inp_16k_fx[], /* o : (Q-1) buffer of old input signal @16kHz */ Word32 *ener_fx, /* o : residual energy from Levinson-Durbin Q_r */ Word16 *relE_fx, /* o : frame relative energy Q8 */ Word16 A_fx[NB_SUBFR16k * ( M + 1 )], /* o : A(z) unquantized for the 4 subframes */ Loading @@ -249,7 +248,7 @@ ivas_error pre_proc_front_ivas_fx( Word32 realBuffer_fx[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: real buffer Q(q_re_im_buf) */ Word32 imagBuffer_fx[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: imag buffer Q(q_re_im_buf) */ Word16 *q_re_im_buf, /* i/o: Q-factor of real and imag buffer */ float old_wsp[], /* o : weighted input signal buffer */ Word16 old_wsp_fx[], /* o : weighted input signal buffer */ Word16 pitch_fr_fx[NB_SUBFR], /* o : fractional pitch values Q6 */ Word16 voicing_fr_fx[NB_SUBFR], /* o : fractional pitch gains Q15 */ Word16 *loc_harm, /* o : harmonicity flag */ Loading lib_com/ivas_prot_fx.h +10 −0 Original line number Diff line number Diff line Loading @@ -779,6 +779,10 @@ void destroy_core_enc_fx( ENC_CORE_HANDLE hCoreCoder /* i/o: core encoder structure */ ); void destroy_evs_core_enc_fx( ENC_CORE_HANDLE hCoreCoder /* i/o: core encoder structure */ ); ivas_error ivas_sce_dec_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const Word16 sce_id, /* i : SCE # identifier */ Loading Loading @@ -3761,6 +3765,12 @@ void ivas_filter_process_fx( const Word16 length, /* i : filter order */ Word16 q_factor ); void ivas_filter_process_exp_fx( ivas_filters_process_state_t *filter_state, /* i/o: filter state handle */ Word32 *pIn_Out_fx, /* i/o: signal subject to filtering (exp[i] : pIn_out_e[i]) */ const Word16 length, /* i : filter order */ Word16 *pIn_Out_e ); ivas_error ivas_osba_enc_open_fx( Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */ ); Loading Loading
lib_com/gs_bitallocation_ivas_fx.c +1 −3 Original line number Diff line number Diff line Loading @@ -106,7 +106,6 @@ void bands_and_bit_alloc_ivas_fx( Word32 sum_bit /*Q0*/, bit_fracf /*Q18*/; Word16 etmp; Word16 tmp; Word16 Ener_per_bd_iQ_tmp[MBANDS_GN_BITALLOC16k]; // Q13 Word16 pos, band; Word32 SWB_bit_budget; // Q0 -> Q18 Word32 bits_per_bands[MBANDS_GN_BITALLOC16k]; // Q18 Loading @@ -126,7 +125,6 @@ void bands_and_bit_alloc_ivas_fx( nb_tot_bands = MBANDS_GN_BITALLOC16k; move16(); } Copy( Ener_per_bd_iQ, Ener_per_bd_iQ_tmp, nb_tot_bands ); set32_fx( bits_per_bands, 0, MBANDS_GN_BITALLOC16k ); set16_fx( out_bits_per_bands, 0, MBANDS_GN_BITALLOC16k ); Loading @@ -138,7 +136,7 @@ void bands_and_bit_alloc_ivas_fx( ener_vec[0] = add( Ener_per_bd_iQ[0], Ener_per_bd_iQ[1] ); /*Q12 */ #endif move16(); Copy( Ener_per_bd_iQ_tmp + 1, ener_vec, MBANDS_GN - 1 ); /*Q12 */ Copy( Ener_per_bd_iQ + 1, ener_vec, MBANDS_GN - 1 ); /*Q12 */ ener_vec[MBANDS_GN - 1] = ener_vec[MBANDS_GN - 2]; move16(); IF( EQ_16( L_frame, L_FRAME16k ) ) Loading
lib_com/ivas_filters.c +27 −0 Original line number Diff line number Diff line Loading @@ -279,6 +279,33 @@ void ivas_filter_process_fx( } #endif void ivas_filter_process_exp_fx( ivas_filters_process_state_t *filter_state, /* i/o: filter state handle */ Word32 *pIn_Out_fx, /* i/o: signal subject to filtering (exp[i] : pIn_out_e[i]) */ const Word16 length, /* i : filter order */ Word16 *pIn_Out_e ) { SWITCH( filter_state->order ) { case IVAS_FILTER_ORDER_1: case IVAS_FILTER_ORDER_2: ivas_iir_2_filter_fx( filter_state, pIn_Out_fx, length, IVAS_FILTER_STAGE_0, pIn_Out_e ); /* Scale pIn_Out_fx back to input Q */ BREAK; case IVAS_FILTER_ORDER_4: /* biquad-1 */ ivas_iir_2_filter_fx( filter_state, pIn_Out_fx, length, IVAS_FILTER_STAGE_0, pIn_Out_e ); /* biquad-2 */ ivas_iir_2_filter_fx( filter_state, pIn_Out_fx, length, IVAS_FILTER_STAGE_1, pIn_Out_e ); /* Scale pIn_Out_fx back to input Q */ BREAK; default: BREAK; } return; } /*-----------------------------------------------------------------------------------------* * Function ivas_iir_2_filter() Loading
lib_com/ivas_pca_tools.c +11 −9 Original line number Diff line number Diff line Loading @@ -322,20 +322,19 @@ static void house_refl_fx( Word32 rcp_fx = L_deposit_h( tmp ); // rcp_q Word16 rcp_q = sub( Q31, exp ); rcp_fx = L_shr( rcp_fx, sub( rcp_q, Q31 ) ); // making rcp_fx in Q31 FOR( i = 0; i < sizex; i++ ) { norm = norm_l( pu_fx[i] ); L_tmp = L_shl( pu_fx[i], norm ); pu_fx[i] = Mpy_32_32( L_tmp, rcp_fx ); // px_q + Q31 - Q31 -> px_q pu_e[i] = sub( 31, add( px_q, norm ) ); pu_fx[i] = Mpy_32_32( L_tmp, rcp_fx ); // ( px_q + norm ) + rcp_q - 31 -> exp: 31 + 31 - (px_q + norm + rcp_q) pu_e[i] = sub( 62, add( add( px_q, norm ), rcp_q ) ); move32(); move16(); } IF( pu_fx[0] >= 0 ) { pu_fx[0] = L_add( pu_fx[0], L_shl( 1, sub( 31, pu_e[0] ) ) ); pu_fx[0] = BASOP_Util_Add_Mant32Exp( pu_fx[0], pu_e[0], ONE_IN_Q30, 1, &pu_e[0] ); ( *normu_fx ) = L_negate( *normu_fx ); move32(); Loading @@ -343,7 +342,7 @@ static void house_refl_fx( } ELSE { pu_fx[0] = L_sub( pu_fx[0], L_shl( 1, sub( 31, pu_e[0] ) ) ); pu_fx[0] = BASOP_Util_Add_Mant32Exp( pu_fx[0], pu_e[0], -ONE_IN_Q30, 1, &pu_e[0] ); move32(); } Loading @@ -357,8 +356,8 @@ static void house_refl_fx( FOR( i = 0; i < sizex; i++ ) { pu_fx[i] = Mpy_32_32( pu_fx[i], rcp_fx ); // pu_e[i] + exp2 pu_fx[i] = L_shl( pu_fx[i], exp2 ); // pu_e[i] + exp2 move32(); pu_e[i] = add( pu_e[i], exp2 ); move32(); } Loading Loading @@ -489,6 +488,7 @@ static void house_qr_fx( Word32 U_fx[FOA_CHANNELS * FOA_CHANNELS]; Word16 U_e[FOA_CHANNELS * FOA_CHANNELS]; Word32 pu_fx[FOA_CHANNELS]; Word16 tmp_pu_e[FOA_CHANNELS]; Word16 pv_exp[FOA_CHANNELS]; Word32 pa_fx[FOA_CHANNELS]; Word16 tmp_e; Loading Loading @@ -573,8 +573,10 @@ static void house_qr_fx( { FOR( i = 0; i < n_rows; i++ ) { pu_fx[i] = L_shr( U_fx[i * n + k], sub( sub( 31, U_e[i * n + k] ), pu_fx_q ) ); // pu_fx_q pu_fx[i] = U_fx[i * n + k]; move32(); tmp_pu_e[i] = U_e[i * n + k]; move16(); } FOR( s = k; s < n_rows; s++ ) Loading @@ -586,8 +588,8 @@ static void house_qr_fx( } pv_fx[s - k] = dotp_fixed( &pu_fx[k], &pa_fx[k], sub( n_rows, k ) ); // pu_fx_q + Q31 - Q31 pv_exp[s - k] = sub( 31, pu_fx_q ); pv_fx[s - k] = dotp_fixed( &pu_fx[k], &pa_fx[k], sub( n_rows, k ) ); // exp: tmp_pu_e[k] pv_exp[s - k] = tmp_pu_e[k]; move32(); move16(); } Loading
lib_com/ivas_prot.h +2 −3 Original line number Diff line number Diff line Loading @@ -234,8 +234,7 @@ ivas_error pre_proc_front_ivas_fx( const Word16 input_frame, /* i : frame length */ const Word16 n, /* i : channel number */ Word16 old_inp_12k8_fx[], /* o : (Q-1) buffer of old input signal */ float old_inp_12k8[], /* o : buffer of old input signal */ float old_inp_16k[], /* o : buffer of old input signal @16kHz */ Word16 old_inp_16k_fx[], /* o : (Q-1) buffer of old input signal @16kHz */ Word32 *ener_fx, /* o : residual energy from Levinson-Durbin Q_r */ Word16 *relE_fx, /* o : frame relative energy Q8 */ Word16 A_fx[NB_SUBFR16k * ( M + 1 )], /* o : A(z) unquantized for the 4 subframes */ Loading @@ -249,7 +248,7 @@ ivas_error pre_proc_front_ivas_fx( Word32 realBuffer_fx[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: real buffer Q(q_re_im_buf) */ Word32 imagBuffer_fx[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: imag buffer Q(q_re_im_buf) */ Word16 *q_re_im_buf, /* i/o: Q-factor of real and imag buffer */ float old_wsp[], /* o : weighted input signal buffer */ Word16 old_wsp_fx[], /* o : weighted input signal buffer */ Word16 pitch_fr_fx[NB_SUBFR], /* o : fractional pitch values Q6 */ Word16 voicing_fr_fx[NB_SUBFR], /* o : fractional pitch gains Q15 */ Word16 *loc_harm, /* o : harmonicity flag */ Loading
lib_com/ivas_prot_fx.h +10 −0 Original line number Diff line number Diff line Loading @@ -779,6 +779,10 @@ void destroy_core_enc_fx( ENC_CORE_HANDLE hCoreCoder /* i/o: core encoder structure */ ); void destroy_evs_core_enc_fx( ENC_CORE_HANDLE hCoreCoder /* i/o: core encoder structure */ ); ivas_error ivas_sce_dec_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const Word16 sce_id, /* i : SCE # identifier */ Loading Loading @@ -3761,6 +3765,12 @@ void ivas_filter_process_fx( const Word16 length, /* i : filter order */ Word16 q_factor ); void ivas_filter_process_exp_fx( ivas_filters_process_state_t *filter_state, /* i/o: filter state handle */ Word32 *pIn_Out_fx, /* i/o: signal subject to filtering (exp[i] : pIn_out_e[i]) */ const Word16 length, /* i : filter order */ Word16 *pIn_Out_e ); ivas_error ivas_osba_enc_open_fx( Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */ ); Loading