Loading lib_com/hq_tools_fx.c +6 −3 Original line number Diff line number Diff line Loading @@ -1901,7 +1901,7 @@ Word16 get_nor_delta_hf_fx( return add_bits_denv; } #ifndef HARM_HQ_CORE2 #ifndef HARM_HQ_CORE /*-------------------------------------------------------------------* * calc_nor_delta_hf() * Loading Loading @@ -2179,6 +2179,7 @@ void hq_bwe_ivas_fx( return; } /*--------------------------------------------------------------------------* * hq_wb_nf_bwe() * Loading Loading @@ -2597,6 +2598,7 @@ void hq_wb_nf_bwe_fx( return; } /*--------------------------------------------------------------------------* * enforce_zero_for_min_envelope_fx() * Loading Loading @@ -2641,6 +2643,8 @@ void enforce_zero_for_min_envelope_fx( return; } /*--------------------------------------------------------------------------* * apply_envelope() * Loading Loading @@ -2676,10 +2680,10 @@ void apply_envelope_enc_ivas_fx( } } return; } /*--------------------------------------------------------------------------* * apply_envelope() * Loading Loading @@ -2776,6 +2780,5 @@ void apply_envelope_fx( } } return; } lib_com/low_rate_band_att_fx.c +9 −3 Original line number Diff line number Diff line Loading @@ -42,7 +42,9 @@ void ivas_fine_gain_pred_fx( Word32 xx; Word16 accuracy; Word16 k, bw; #ifdef HARM_HQ_CORE Word16 tmp1; #endif Word16 shift, bw_idx; Word16 tmp, exp, exp2; Word32 L_tmp; Loading Loading @@ -91,18 +93,22 @@ void ivas_fine_gain_pred_fx( #ifdef HARM_HQ_CORE IF( element_mode == EVS_MONO ) { Mpy_32_16_ss( L_tmp, fine_gain_pred_sqrt_bw[bw_idx], &L_tmp, &lsb ); /*31-exp+11-15=27-exp */ tmp1 = fine_gain_pred_sqrt_bw[bw_idx]; } ELSE #endif { Word16 norm = norm_s( bw ); #ifdef HARM_HQ_CORE Word16 tmp_exp = sub( 15, norm ); #else Word16 tmp1, tmp_exp = sub( 15, norm ); #endif tmp1 = Sqrt16( shl( bw, norm ), &tmp_exp ); tmp1 = shr( tmp1, sub( sub( 15, tmp_exp ), Q11 ) ); Mpy_32_16_ss( L_tmp, tmp1, &L_tmp, &lsb ); /*31-exp+11-15=27-exp */ } Mpy_32_16_ss( L_tmp, tmp1, &L_tmp, &lsb ); /*31-exp+11-15=27-exp */ gp = round_fx_sat( L_shl_sat( L_tmp, add( 1, exp ) ) ); /*27-exp+1+exp-16=12 */ test(); test(); Loading lib_com/prot_fx.h +4 −1 Original line number Diff line number Diff line Loading @@ -676,7 +676,7 @@ Word16 calc_nor_delta_hf_fx( const Word16 core_sfm /* i : index of the end band for core */ ); #ifndef HARM_HQ_CORE2 #ifndef HARM_HQ_CORE Word16 calc_nor_delta_hf_ivas_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const Word32 *t_audio, /* i : transform-domain coefficients Qx*/ Loading Loading @@ -10130,6 +10130,9 @@ void IGFEncConcatenateBitstream( ); void hq_generic_hf_encoding_fx( #ifdef HARM_HQ_CORE2 const Word16 element_mode, /* i : element mode */ #endif const Word32 *coefs_fx, /* i : MDCT coefficients of weighted original */ Word16 *hq_generic_fenv_fx, /* i/o: energy of SWB envelope */ const Word16 hq_generic_offset, /* i : frequency offset for extracting energy */ Loading lib_enc/hq_env_enc_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -552,7 +552,7 @@ Word16 encode_envelope_indices_fx( return hcode_l; } #ifndef HARM_HQ_CORE2 #ifndef HARM_HQ_CORE Word16 encode_envelope_indices_ivas_fx( /* o : Number of bits if flag_pack=0,0 if flag_pack=1 Q0 */ BSTR_ENC_HANDLE hBstr, /* i : handle to the bitstream Q0 */ const Word16 num_sfm, /* i : Number of subbands Q0 */ Loading lib_enc/hq_hr_enc_fx.c +33 −14 Original line number Diff line number Diff line Loading @@ -168,7 +168,17 @@ void hq_hr_enc_fx( test(); IF( EQ_16( hqswb_clas, HQ_GEN_SWB ) || EQ_16( hqswb_clas, HQ_GEN_FB ) ) { #ifdef HARM_HQ_CORE2 tmp_length = length; if ( st_fx->bwidth == FB ) { tmp_length = L_SPEC48k; // this is temp. hack to keep EVS BE } hq_generic_hf_encoding_fx( st_fx->element_mode, t_audio, hq_generic_fenv, hq_generic_offset, st_fx, &hq_generic_exc_clas, tmp_length ); #else hq_generic_encoding_fx( t_audio, hq_generic_fenv, hq_generic_offset, st_fx, &hq_generic_exc_clas /*, length*/ ); #endif IF( EQ_16( hq_generic_exc_clas, HQ_GENERIC_SP_EXC ) ) { *num_bits = add( *num_bits, 1 ); /* conditional 1 bit saving for representing FD3 BWE excitation class Q0*/ Loading Loading @@ -393,7 +403,7 @@ void hq_hr_enc_ivas_fx( diff_envelope_coding_fx( is_transient, num_env_bands, start_norm, ynrm, normqlg2, difidx ); /* Find norm coding mode and calculate number of bits */ #ifdef HARM_HQ_CORE2 #ifdef HARM_HQ_CORE hcode_l = encode_envelope_indices_fx( hBstr, num_env_bands, numnrmibits, difidx, &LCmode, 0, NORMAL_HQ_CORE, is_transient ); /* Q0 */ #else hcode_l = encode_envelope_indices_ivas_fx( hBstr, num_env_bands, numnrmibits, difidx, &LCmode, 0, NORMAL_HQ_CORE, is_transient ); /* Q0 */ Loading @@ -403,7 +413,7 @@ void hq_hr_enc_ivas_fx( move16(); /* Encode norm indices */ #ifdef HARM_HQ_CORE2 #ifdef HARM_HQ_CORE encode_envelope_indices_fx( hBstr, num_env_bands, numnrmibits, difidx, &LCmode, 1, NORMAL_HQ_CORE, is_transient ); #else encode_envelope_indices_ivas_fx( hBstr, num_env_bands, numnrmibits, difidx, &LCmode, 1, NORMAL_HQ_CORE, is_transient ); Loading @@ -416,7 +426,11 @@ void hq_hr_enc_ivas_fx( test(); IF( EQ_16( hqswb_clas, HQ_GEN_SWB ) || EQ_16( hqswb_clas, HQ_GEN_FB ) ) { #ifdef HARM_HQ_CORE2 hq_generic_hf_encoding_fx( st->element_mode, t_audio_fx, hq_generic_fenv_fx, hq_generic_offset, st, &hq_generic_exc_clas, length ); #else hq_generic_hf_encoding_fx( t_audio_fx, hq_generic_fenv_fx, hq_generic_offset, st, &hq_generic_exc_clas, length ); #endif IF( EQ_16( hq_generic_exc_clas, HQ_GENERIC_SP_EXC ) ) { Loading @@ -442,7 +456,7 @@ void hq_hr_enc_ivas_fx( test(); IF( EQ_16( hqswb_clas, HQ_GEN_SWB ) || EQ_16( hqswb_clas, HQ_GEN_FB ) ) { #ifdef HARM_HQ_CORE2 #ifdef HARM_HQ_CORE b_delta_env = calc_nor_delta_hf_fx( hBstr, t_audio_fx, ynrm, Rsubband, num_env_bands, nb_sfm, sfmsize, sfm_start, core_sfm ); /* Q0 */ #else b_delta_env = calc_nor_delta_hf_ivas_fx( hBstr, t_audio_fx, ynrm, Rsubband, num_env_bands, nb_sfm, sfmsize, sfm_start, core_sfm ); /* Q0 */ Loading Loading @@ -532,6 +546,10 @@ void hq_hr_enc_ivas_fx( move16(); /* Prepare synthesis for LB generation in case of switch to ACELP */ #ifdef HARM_HQ_CORE2 IF( st->element_mode > EVS_MONO ) #endif { IF( NE_16( hqswb_clas, HQ_HVQ ) ) { apply_envelope_enc_ivas_fx( t_audio_q_norm, ynrm, num_sfm, sfm_start, sfm_end, t_audio_q_fx ); Loading @@ -548,6 +566,7 @@ void hq_hr_enc_ivas_fx( } Copy32( t_audio_q_fx, t_audio_fx, length ); } return; } Loading
lib_com/hq_tools_fx.c +6 −3 Original line number Diff line number Diff line Loading @@ -1901,7 +1901,7 @@ Word16 get_nor_delta_hf_fx( return add_bits_denv; } #ifndef HARM_HQ_CORE2 #ifndef HARM_HQ_CORE /*-------------------------------------------------------------------* * calc_nor_delta_hf() * Loading Loading @@ -2179,6 +2179,7 @@ void hq_bwe_ivas_fx( return; } /*--------------------------------------------------------------------------* * hq_wb_nf_bwe() * Loading Loading @@ -2597,6 +2598,7 @@ void hq_wb_nf_bwe_fx( return; } /*--------------------------------------------------------------------------* * enforce_zero_for_min_envelope_fx() * Loading Loading @@ -2641,6 +2643,8 @@ void enforce_zero_for_min_envelope_fx( return; } /*--------------------------------------------------------------------------* * apply_envelope() * Loading Loading @@ -2676,10 +2680,10 @@ void apply_envelope_enc_ivas_fx( } } return; } /*--------------------------------------------------------------------------* * apply_envelope() * Loading Loading @@ -2776,6 +2780,5 @@ void apply_envelope_fx( } } return; }
lib_com/low_rate_band_att_fx.c +9 −3 Original line number Diff line number Diff line Loading @@ -42,7 +42,9 @@ void ivas_fine_gain_pred_fx( Word32 xx; Word16 accuracy; Word16 k, bw; #ifdef HARM_HQ_CORE Word16 tmp1; #endif Word16 shift, bw_idx; Word16 tmp, exp, exp2; Word32 L_tmp; Loading Loading @@ -91,18 +93,22 @@ void ivas_fine_gain_pred_fx( #ifdef HARM_HQ_CORE IF( element_mode == EVS_MONO ) { Mpy_32_16_ss( L_tmp, fine_gain_pred_sqrt_bw[bw_idx], &L_tmp, &lsb ); /*31-exp+11-15=27-exp */ tmp1 = fine_gain_pred_sqrt_bw[bw_idx]; } ELSE #endif { Word16 norm = norm_s( bw ); #ifdef HARM_HQ_CORE Word16 tmp_exp = sub( 15, norm ); #else Word16 tmp1, tmp_exp = sub( 15, norm ); #endif tmp1 = Sqrt16( shl( bw, norm ), &tmp_exp ); tmp1 = shr( tmp1, sub( sub( 15, tmp_exp ), Q11 ) ); Mpy_32_16_ss( L_tmp, tmp1, &L_tmp, &lsb ); /*31-exp+11-15=27-exp */ } Mpy_32_16_ss( L_tmp, tmp1, &L_tmp, &lsb ); /*31-exp+11-15=27-exp */ gp = round_fx_sat( L_shl_sat( L_tmp, add( 1, exp ) ) ); /*27-exp+1+exp-16=12 */ test(); test(); Loading
lib_com/prot_fx.h +4 −1 Original line number Diff line number Diff line Loading @@ -676,7 +676,7 @@ Word16 calc_nor_delta_hf_fx( const Word16 core_sfm /* i : index of the end band for core */ ); #ifndef HARM_HQ_CORE2 #ifndef HARM_HQ_CORE Word16 calc_nor_delta_hf_ivas_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const Word32 *t_audio, /* i : transform-domain coefficients Qx*/ Loading Loading @@ -10130,6 +10130,9 @@ void IGFEncConcatenateBitstream( ); void hq_generic_hf_encoding_fx( #ifdef HARM_HQ_CORE2 const Word16 element_mode, /* i : element mode */ #endif const Word32 *coefs_fx, /* i : MDCT coefficients of weighted original */ Word16 *hq_generic_fenv_fx, /* i/o: energy of SWB envelope */ const Word16 hq_generic_offset, /* i : frequency offset for extracting energy */ Loading
lib_enc/hq_env_enc_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -552,7 +552,7 @@ Word16 encode_envelope_indices_fx( return hcode_l; } #ifndef HARM_HQ_CORE2 #ifndef HARM_HQ_CORE Word16 encode_envelope_indices_ivas_fx( /* o : Number of bits if flag_pack=0,0 if flag_pack=1 Q0 */ BSTR_ENC_HANDLE hBstr, /* i : handle to the bitstream Q0 */ const Word16 num_sfm, /* i : Number of subbands Q0 */ Loading
lib_enc/hq_hr_enc_fx.c +33 −14 Original line number Diff line number Diff line Loading @@ -168,7 +168,17 @@ void hq_hr_enc_fx( test(); IF( EQ_16( hqswb_clas, HQ_GEN_SWB ) || EQ_16( hqswb_clas, HQ_GEN_FB ) ) { #ifdef HARM_HQ_CORE2 tmp_length = length; if ( st_fx->bwidth == FB ) { tmp_length = L_SPEC48k; // this is temp. hack to keep EVS BE } hq_generic_hf_encoding_fx( st_fx->element_mode, t_audio, hq_generic_fenv, hq_generic_offset, st_fx, &hq_generic_exc_clas, tmp_length ); #else hq_generic_encoding_fx( t_audio, hq_generic_fenv, hq_generic_offset, st_fx, &hq_generic_exc_clas /*, length*/ ); #endif IF( EQ_16( hq_generic_exc_clas, HQ_GENERIC_SP_EXC ) ) { *num_bits = add( *num_bits, 1 ); /* conditional 1 bit saving for representing FD3 BWE excitation class Q0*/ Loading Loading @@ -393,7 +403,7 @@ void hq_hr_enc_ivas_fx( diff_envelope_coding_fx( is_transient, num_env_bands, start_norm, ynrm, normqlg2, difidx ); /* Find norm coding mode and calculate number of bits */ #ifdef HARM_HQ_CORE2 #ifdef HARM_HQ_CORE hcode_l = encode_envelope_indices_fx( hBstr, num_env_bands, numnrmibits, difidx, &LCmode, 0, NORMAL_HQ_CORE, is_transient ); /* Q0 */ #else hcode_l = encode_envelope_indices_ivas_fx( hBstr, num_env_bands, numnrmibits, difidx, &LCmode, 0, NORMAL_HQ_CORE, is_transient ); /* Q0 */ Loading @@ -403,7 +413,7 @@ void hq_hr_enc_ivas_fx( move16(); /* Encode norm indices */ #ifdef HARM_HQ_CORE2 #ifdef HARM_HQ_CORE encode_envelope_indices_fx( hBstr, num_env_bands, numnrmibits, difidx, &LCmode, 1, NORMAL_HQ_CORE, is_transient ); #else encode_envelope_indices_ivas_fx( hBstr, num_env_bands, numnrmibits, difidx, &LCmode, 1, NORMAL_HQ_CORE, is_transient ); Loading @@ -416,7 +426,11 @@ void hq_hr_enc_ivas_fx( test(); IF( EQ_16( hqswb_clas, HQ_GEN_SWB ) || EQ_16( hqswb_clas, HQ_GEN_FB ) ) { #ifdef HARM_HQ_CORE2 hq_generic_hf_encoding_fx( st->element_mode, t_audio_fx, hq_generic_fenv_fx, hq_generic_offset, st, &hq_generic_exc_clas, length ); #else hq_generic_hf_encoding_fx( t_audio_fx, hq_generic_fenv_fx, hq_generic_offset, st, &hq_generic_exc_clas, length ); #endif IF( EQ_16( hq_generic_exc_clas, HQ_GENERIC_SP_EXC ) ) { Loading @@ -442,7 +456,7 @@ void hq_hr_enc_ivas_fx( test(); IF( EQ_16( hqswb_clas, HQ_GEN_SWB ) || EQ_16( hqswb_clas, HQ_GEN_FB ) ) { #ifdef HARM_HQ_CORE2 #ifdef HARM_HQ_CORE b_delta_env = calc_nor_delta_hf_fx( hBstr, t_audio_fx, ynrm, Rsubband, num_env_bands, nb_sfm, sfmsize, sfm_start, core_sfm ); /* Q0 */ #else b_delta_env = calc_nor_delta_hf_ivas_fx( hBstr, t_audio_fx, ynrm, Rsubband, num_env_bands, nb_sfm, sfmsize, sfm_start, core_sfm ); /* Q0 */ Loading Loading @@ -532,6 +546,10 @@ void hq_hr_enc_ivas_fx( move16(); /* Prepare synthesis for LB generation in case of switch to ACELP */ #ifdef HARM_HQ_CORE2 IF( st->element_mode > EVS_MONO ) #endif { IF( NE_16( hqswb_clas, HQ_HVQ ) ) { apply_envelope_enc_ivas_fx( t_audio_q_norm, ynrm, num_sfm, sfm_start, sfm_end, t_audio_q_fx ); Loading @@ -548,6 +566,7 @@ void hq_hr_enc_ivas_fx( } Copy32( t_audio_q_fx, t_audio_fx, length ); } return; }