Loading lib_com/bits_alloc_fx.c +4 −2 Original line number Diff line number Diff line Loading @@ -439,6 +439,7 @@ static Word16 fcb_table( * Routine to allocate fixed innovation codebook bit-budget *--------------------------------------------------------------------*/ #ifndef REMOVE_EVS_DUPLICATES static ivas_error acelp_FCB_allocator( Word16 *nBits, /* i/o: available bit-budget */ Word16 fixed_cdk_index[], /* o : codebook index Q0 */ Loading Loading @@ -599,7 +600,7 @@ static ivas_error acelp_FCB_allocator( return error; } #endif static ivas_error acelp_FCB_allocator_ivas( Word16 *nBits, /* i/o: available bit-budget */ Word16 fixed_cdk_index[], /* o : codebook index Q0 */ Loading Loading @@ -761,6 +762,7 @@ static ivas_error acelp_FCB_allocator_ivas( * - per channel bitrate minimum is 13250 kbps for ACELP@16kHz *--------------------------------------------------------------------*/ #ifndef REMOVE_EVS_DUPLICATES ivas_error config_acelp1( const Word16 enc_dec, /* i : encoder/decoder flag */ const Word32 total_brate, /* i : total bitrate */ Loading Loading @@ -1885,7 +1887,7 @@ ivas_error config_acelp1( * - should be in range of <6700; 24350> for ACELP@12.8kHz * - per channel bitrate minimum is 13250 kbps for ACELP@16kHz *--------------------------------------------------------------------*/ #endif ivas_error config_acelp1_IVAS( const Word16 enc_dec, /* i : encoder/decoder flag */ const Word32 total_brate, /* i : total bitrate */ Loading lib_com/gs_inact_switching_fx.c +54 −16 Original line number Diff line number Diff line Loading @@ -38,6 +38,8 @@ /* RETURN ARGUMENTS : */ /* _ None */ /*========================================================================*/ #ifndef REMOVE_EVS_DUPLICATES void Inac_swtch_ematch_fx( Word16 exc2[], /* i/o: CELP/GSC excitation buffer Q_exc*/ Word16 dct_exc_tmp[], /* i : GSC excitation in DCT domain */ Loading Loading @@ -155,8 +157,7 @@ void Inac_swtch_ematch_fx( return; } #endif void Inac_switch_ematch_ivas_fx( Word16 exc2[], /* i/o: CELP/GSC excitation buffer Q_exc*/ Word16 dct_exc_tmp[], /* i : GSC excitation in DCT domain */ Loading Loading @@ -250,6 +251,21 @@ void Inac_switch_ematch_ivas_fx( exp = sub( exp, 14 ); IF( LT_16( i, 2 ) ) { #ifdef REMOVE_EVS_DUPLICATES IF( EQ_16( element_mode, EVS_MONO ) ) { FOR( j = 0; j < 8; j++ ) { L_tmp = L_mult( *pt_exc, ftmp ); L_tmp = L_shl_sat( L_tmp, add( exp, 15 ) ); /* Q(Q_exc) -> Q(15+Q_exc)*/ *pt_exc = round_fx_sat( L_tmp ); /*Q_exc - 1*/ move16(); pt_exc++; } } ELSE #endif { FOR( j = 0; j < 8; j++ ) { L_tmp = L_mult0( *pt_exc, ftmp ); Loading @@ -259,8 +275,24 @@ void Inac_switch_ematch_ivas_fx( pt_exc++; } } } ELSE { #ifdef REMOVE_EVS_DUPLICATES IF( EQ_16( element_mode, EVS_MONO ) ) { FOR( j = 0; j < 16; j++ ) { L_tmp = L_mult( *pt_exc, ftmp ); L_tmp = L_shl_sat( L_tmp, add( exp, 15 ) ); /* Q(Q_exc) -> Q(15+Q_exc)*/ *pt_exc = round_fx_sat( L_tmp ); /*Q_exc - 1*/ move16(); pt_exc++; } } ELSE #endif { FOR( j = 0; j < 16; j++ ) { L_tmp = L_mult0( *pt_exc, ftmp ); Loading @@ -271,10 +303,16 @@ void Inac_switch_ematch_ivas_fx( } } } } /* Going back to time */ #ifdef REMOVE_EVS_DUPLICATES IF( GT_16( element_mode, EVS_MONO ) ) #endif { Scale_sig( dct_exc_tmp, 240, 1 ); // Q_exc Scale_sig( exc2, 240, 1 ); // Q_exc } edct_16fx( dct_exc_tmp, exc2, L_frame, 5, element_mode ); } Loading lib_com/gs_noisefill_fx.c +42 −18 Original line number Diff line number Diff line Loading @@ -1332,6 +1332,21 @@ void highband_exc_dct_in_ivas_fx( } } #ifdef REMOVE_EVS_DUPLICATES IF( EQ_16( element_mode, EVS_MONO ) ) { Comp_and_apply_gain_fx( exc_diffQ, Ener_per_bd_iQ, Ener_per_bd_yQ, last_bin, 0, Qexc_diffQ, *Q_exc ); IF( exc_wo_nf != NULL ) { Comp_and_apply_gain_fx( exc_wo_nf, Ener_per_bd_iQ, Ener_per_bd_yQ, last_bin, 1, Qexc_diffQ, *Q_exc ); Vr_add( exc_dct_in, exc_wo_nf, exc_wo_nf, L_frame ); } } ELSE { #endif Word16 Q_tmp = *Q_exc; move16(); Word16 Q_old = *Q_exc; Loading @@ -1358,6 +1373,10 @@ void highband_exc_dct_in_ivas_fx( { Scale_sig( exc_dct_in, L_frame, sub( *Q_exc, Q_old ) ); } #ifdef REMOVE_EVS_DUPLICATES } #endif /*--------------------------------------------------------------------------------------* * add the correction layer to the LF bins, * and add the quantized pulses or the noise for the higher part of the spectrum Loading Loading @@ -1397,7 +1416,12 @@ void highband_exc_dct_in_ivas_fx( Q_hb_exc = 0; move16(); envelop_modify_fx( exc_diffQ, seed_tcx, last_bin, Ener_per_bd_iQ, *Q_exc, &Q_hb_exc ); #ifdef REMOVE_EVS_DUPLICATES test(); IF( GT_16( *Q_exc, Q_hb_exc ) && GT_16( element_mode, EVS_MONO ) ) #else IF( GT_16( *Q_exc, Q_hb_exc ) ) #endif { Scale_sig( exc_wo_nf, L_frame, sub( Q_hb_exc, *Q_exc ) ); *Q_exc = Q_hb_exc; Loading lib_com/gs_preech_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -233,7 +233,7 @@ void pre_echo_att_ivas_fx( tmp = BASOP_Util_Divide3232_Scale( *Last_frame_ener_fx, etmp_fx, &tmp_e ); /* numerator Q = 2 * Q_new + 1; denominator Q = 31 - tmp_e */ tmp_e = add( tmp_e, sub( sub( 31, etmp_e ), add( shl( Q_new, 1 ), 1 ) ) ); /* tmp_e = tmp_e + (31 - tmp_e) - (2 * Q_new + 1) */ tmp = Sqrt16( tmp, &tmp_e ); ratio_fx = shr( tmp, sub( 2, tmp_e ) ); /* Q13 */ ratio_fx = shr_sat( tmp, sub( 2, tmp_e ) ); /* Q13 */ /* Pre-echo atttenuation should never increase the energy */ ratio_fx = s_min( ratio_fx, 8192 /* 1 in Q13 */ ); /* Q13 */ Loading lib_com/ivas_rom_com_fx.c +15 −0 Original line number Diff line number Diff line Loading @@ -1545,6 +1545,7 @@ const Word16 ivas_param_mc_quant_icc_fx[PARAM_MC_SZ_ICC_QUANTIZER] = { /* from 1 to 11 bits*/ /*q factor = 8*/ const Word32 no_phi_masa_inv_fx[NO_SPHERICAL_GRIDS][MAX_NO_THETA] = { #ifndef FIX_1379_MASA_ANGLE_ROUND { 1073741824 }, { 536870912 }, { 536870912, 1073741824 }, Loading @@ -1556,8 +1557,22 @@ const Word32 no_phi_masa_inv_fx[NO_SPHERICAL_GRIDS][MAX_NO_THETA] = { { 44739242, 45691141, 47721858, 52377649, 61356675, 76695844, 107374182, 178956970, 1073741824, 2147483647 }, { 35791394, 35791394, 37025580, 38347922, 39768215, 42949672, 46684427, 52377649, 59652323, 71582788, 93368854, 126322567, 214748364, 2147483647 }, { 24129029, 24129029, 24403223, 24970740, 25565281, 26512143, 27889398, 29417584, 31580641, 34087042, 37675151, 42107522, 48806446, 56512727, 71582788, 93368854, 143165576, 268435456, 2147483647 } #else { 1073741824 }, { 536870912 }, { 536870912, 1073741824 }, { 268435456, 536870912 }, { 178956971, 306783378, 1073741824, 2147483647 }, { 153391689, 165191050, 238609294, 1073741824, 2147483647 }, { 97612893, 102261126, 126322568, 195225786, 715827883, 2147483647 }, { 65075262, 67108864, 74051160, 93368854, 126322568, 238609294, 2147483647 }, { 44739243, 45691141, 47721859, 52377650, 61356676, 76695845, 107374182, 178956971, 1073741824, 2147483647 }, { 35791394, 35791394, 37025580, 38347922, 39768216, 42949673, 46684427, 52377650, 59652324, 71582788, 93368854, 126322568, 214748365, 2147483647 }, { 24129030, 24129030, 24403223, 24970740, 25565282, 26512144, 27889398, 29417584, 31580642, 34087042, 37675152, 42107523, 48806447, 56512728, 71582788, 93368854, 143165577, 268435456, 2147483647 }, #endif }; const Word32 azimuth_cb_fx[8] = { 0, -754974720, -377487360, 377487360, -188743680, 188743680, -566231040, 566231040 }; Loading Loading
lib_com/bits_alloc_fx.c +4 −2 Original line number Diff line number Diff line Loading @@ -439,6 +439,7 @@ static Word16 fcb_table( * Routine to allocate fixed innovation codebook bit-budget *--------------------------------------------------------------------*/ #ifndef REMOVE_EVS_DUPLICATES static ivas_error acelp_FCB_allocator( Word16 *nBits, /* i/o: available bit-budget */ Word16 fixed_cdk_index[], /* o : codebook index Q0 */ Loading Loading @@ -599,7 +600,7 @@ static ivas_error acelp_FCB_allocator( return error; } #endif static ivas_error acelp_FCB_allocator_ivas( Word16 *nBits, /* i/o: available bit-budget */ Word16 fixed_cdk_index[], /* o : codebook index Q0 */ Loading Loading @@ -761,6 +762,7 @@ static ivas_error acelp_FCB_allocator_ivas( * - per channel bitrate minimum is 13250 kbps for ACELP@16kHz *--------------------------------------------------------------------*/ #ifndef REMOVE_EVS_DUPLICATES ivas_error config_acelp1( const Word16 enc_dec, /* i : encoder/decoder flag */ const Word32 total_brate, /* i : total bitrate */ Loading Loading @@ -1885,7 +1887,7 @@ ivas_error config_acelp1( * - should be in range of <6700; 24350> for ACELP@12.8kHz * - per channel bitrate minimum is 13250 kbps for ACELP@16kHz *--------------------------------------------------------------------*/ #endif ivas_error config_acelp1_IVAS( const Word16 enc_dec, /* i : encoder/decoder flag */ const Word32 total_brate, /* i : total bitrate */ Loading
lib_com/gs_inact_switching_fx.c +54 −16 Original line number Diff line number Diff line Loading @@ -38,6 +38,8 @@ /* RETURN ARGUMENTS : */ /* _ None */ /*========================================================================*/ #ifndef REMOVE_EVS_DUPLICATES void Inac_swtch_ematch_fx( Word16 exc2[], /* i/o: CELP/GSC excitation buffer Q_exc*/ Word16 dct_exc_tmp[], /* i : GSC excitation in DCT domain */ Loading Loading @@ -155,8 +157,7 @@ void Inac_swtch_ematch_fx( return; } #endif void Inac_switch_ematch_ivas_fx( Word16 exc2[], /* i/o: CELP/GSC excitation buffer Q_exc*/ Word16 dct_exc_tmp[], /* i : GSC excitation in DCT domain */ Loading Loading @@ -250,6 +251,21 @@ void Inac_switch_ematch_ivas_fx( exp = sub( exp, 14 ); IF( LT_16( i, 2 ) ) { #ifdef REMOVE_EVS_DUPLICATES IF( EQ_16( element_mode, EVS_MONO ) ) { FOR( j = 0; j < 8; j++ ) { L_tmp = L_mult( *pt_exc, ftmp ); L_tmp = L_shl_sat( L_tmp, add( exp, 15 ) ); /* Q(Q_exc) -> Q(15+Q_exc)*/ *pt_exc = round_fx_sat( L_tmp ); /*Q_exc - 1*/ move16(); pt_exc++; } } ELSE #endif { FOR( j = 0; j < 8; j++ ) { L_tmp = L_mult0( *pt_exc, ftmp ); Loading @@ -259,8 +275,24 @@ void Inac_switch_ematch_ivas_fx( pt_exc++; } } } ELSE { #ifdef REMOVE_EVS_DUPLICATES IF( EQ_16( element_mode, EVS_MONO ) ) { FOR( j = 0; j < 16; j++ ) { L_tmp = L_mult( *pt_exc, ftmp ); L_tmp = L_shl_sat( L_tmp, add( exp, 15 ) ); /* Q(Q_exc) -> Q(15+Q_exc)*/ *pt_exc = round_fx_sat( L_tmp ); /*Q_exc - 1*/ move16(); pt_exc++; } } ELSE #endif { FOR( j = 0; j < 16; j++ ) { L_tmp = L_mult0( *pt_exc, ftmp ); Loading @@ -271,10 +303,16 @@ void Inac_switch_ematch_ivas_fx( } } } } /* Going back to time */ #ifdef REMOVE_EVS_DUPLICATES IF( GT_16( element_mode, EVS_MONO ) ) #endif { Scale_sig( dct_exc_tmp, 240, 1 ); // Q_exc Scale_sig( exc2, 240, 1 ); // Q_exc } edct_16fx( dct_exc_tmp, exc2, L_frame, 5, element_mode ); } Loading
lib_com/gs_noisefill_fx.c +42 −18 Original line number Diff line number Diff line Loading @@ -1332,6 +1332,21 @@ void highband_exc_dct_in_ivas_fx( } } #ifdef REMOVE_EVS_DUPLICATES IF( EQ_16( element_mode, EVS_MONO ) ) { Comp_and_apply_gain_fx( exc_diffQ, Ener_per_bd_iQ, Ener_per_bd_yQ, last_bin, 0, Qexc_diffQ, *Q_exc ); IF( exc_wo_nf != NULL ) { Comp_and_apply_gain_fx( exc_wo_nf, Ener_per_bd_iQ, Ener_per_bd_yQ, last_bin, 1, Qexc_diffQ, *Q_exc ); Vr_add( exc_dct_in, exc_wo_nf, exc_wo_nf, L_frame ); } } ELSE { #endif Word16 Q_tmp = *Q_exc; move16(); Word16 Q_old = *Q_exc; Loading @@ -1358,6 +1373,10 @@ void highband_exc_dct_in_ivas_fx( { Scale_sig( exc_dct_in, L_frame, sub( *Q_exc, Q_old ) ); } #ifdef REMOVE_EVS_DUPLICATES } #endif /*--------------------------------------------------------------------------------------* * add the correction layer to the LF bins, * and add the quantized pulses or the noise for the higher part of the spectrum Loading Loading @@ -1397,7 +1416,12 @@ void highband_exc_dct_in_ivas_fx( Q_hb_exc = 0; move16(); envelop_modify_fx( exc_diffQ, seed_tcx, last_bin, Ener_per_bd_iQ, *Q_exc, &Q_hb_exc ); #ifdef REMOVE_EVS_DUPLICATES test(); IF( GT_16( *Q_exc, Q_hb_exc ) && GT_16( element_mode, EVS_MONO ) ) #else IF( GT_16( *Q_exc, Q_hb_exc ) ) #endif { Scale_sig( exc_wo_nf, L_frame, sub( Q_hb_exc, *Q_exc ) ); *Q_exc = Q_hb_exc; Loading
lib_com/gs_preech_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -233,7 +233,7 @@ void pre_echo_att_ivas_fx( tmp = BASOP_Util_Divide3232_Scale( *Last_frame_ener_fx, etmp_fx, &tmp_e ); /* numerator Q = 2 * Q_new + 1; denominator Q = 31 - tmp_e */ tmp_e = add( tmp_e, sub( sub( 31, etmp_e ), add( shl( Q_new, 1 ), 1 ) ) ); /* tmp_e = tmp_e + (31 - tmp_e) - (2 * Q_new + 1) */ tmp = Sqrt16( tmp, &tmp_e ); ratio_fx = shr( tmp, sub( 2, tmp_e ) ); /* Q13 */ ratio_fx = shr_sat( tmp, sub( 2, tmp_e ) ); /* Q13 */ /* Pre-echo atttenuation should never increase the energy */ ratio_fx = s_min( ratio_fx, 8192 /* 1 in Q13 */ ); /* Q13 */ Loading
lib_com/ivas_rom_com_fx.c +15 −0 Original line number Diff line number Diff line Loading @@ -1545,6 +1545,7 @@ const Word16 ivas_param_mc_quant_icc_fx[PARAM_MC_SZ_ICC_QUANTIZER] = { /* from 1 to 11 bits*/ /*q factor = 8*/ const Word32 no_phi_masa_inv_fx[NO_SPHERICAL_GRIDS][MAX_NO_THETA] = { #ifndef FIX_1379_MASA_ANGLE_ROUND { 1073741824 }, { 536870912 }, { 536870912, 1073741824 }, Loading @@ -1556,8 +1557,22 @@ const Word32 no_phi_masa_inv_fx[NO_SPHERICAL_GRIDS][MAX_NO_THETA] = { { 44739242, 45691141, 47721858, 52377649, 61356675, 76695844, 107374182, 178956970, 1073741824, 2147483647 }, { 35791394, 35791394, 37025580, 38347922, 39768215, 42949672, 46684427, 52377649, 59652323, 71582788, 93368854, 126322567, 214748364, 2147483647 }, { 24129029, 24129029, 24403223, 24970740, 25565281, 26512143, 27889398, 29417584, 31580641, 34087042, 37675151, 42107522, 48806446, 56512727, 71582788, 93368854, 143165576, 268435456, 2147483647 } #else { 1073741824 }, { 536870912 }, { 536870912, 1073741824 }, { 268435456, 536870912 }, { 178956971, 306783378, 1073741824, 2147483647 }, { 153391689, 165191050, 238609294, 1073741824, 2147483647 }, { 97612893, 102261126, 126322568, 195225786, 715827883, 2147483647 }, { 65075262, 67108864, 74051160, 93368854, 126322568, 238609294, 2147483647 }, { 44739243, 45691141, 47721859, 52377650, 61356676, 76695845, 107374182, 178956971, 1073741824, 2147483647 }, { 35791394, 35791394, 37025580, 38347922, 39768216, 42949673, 46684427, 52377650, 59652324, 71582788, 93368854, 126322568, 214748365, 2147483647 }, { 24129030, 24129030, 24403223, 24970740, 25565282, 26512144, 27889398, 29417584, 31580642, 34087042, 37675152, 42107523, 48806447, 56512728, 71582788, 93368854, 143165577, 268435456, 2147483647 }, #endif }; const Word32 azimuth_cb_fx[8] = { 0, -754974720, -377487360, 377487360, -188743680, 188743680, -566231040, 566231040 }; Loading