diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index dcd22861c79ff7c158a515240e96d3d04d0e69db..9506a5da1ad1ee680186eec27cb480931a845b99 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -7631,14 +7631,6 @@ void HQ_nbfec_init_fx( HQ_NBFEC_HANDLE hHQ_nbfec /* i/o: HQ NB FEC data handle */ ); -void GetAttackForTCXDecision_fx( - Word32 const *pSubblockNrg, - Word32 const *pAccSubblockNrg, - Word16 nSubblocks, - Word16 nPastSubblocks, - Word16 attackRatioThreshold, - Word16 *pbIsAttackPresent, - Word16 *pAttackIndex ); void hq_ecu_fx( const Word16 *prevsynth, /* i : buffer of previously synthesized signal */ diff --git a/lib_enc/transient_detection_fx.c b/lib_enc/transient_detection_fx.c index bb8239f90a4ab6ae55edc1b245017274bec24154..b0593456d05d7aeada3e57c854eb50b4a398e020 100644 --- a/lib_enc/transient_detection_fx.c +++ b/lib_enc/transient_detection_fx.c @@ -259,88 +259,6 @@ static void GetAttackForTCXDecision_ivas_fx( } -void GetAttackForTCXDecision_fx( - Word32 const *pSubblockNrg, - Word32 const *pAccSubblockNrg, - Word16 nSubblocks, - Word16 nPastSubblocks, - Word16 attackRatioThreshold, - Word16 *pbIsAttackPresent, - Word16 *pAttackIndex ) -{ - Word16 i; - Word16 bIsAttackPresent, attackIndex; - Word16 attackRatioThreshold_1_5; - - assert( nSubblocks >= NSUBBLOCKS ); - assert( nPastSubblocks >= 2 ); - - /* attackRatioThreshold_1_5 = attackRatioThreshold * 1.5, exponent is ATTACKTHRESHOLD_E+1 */ - attackRatioThreshold_1_5 = add( shr( attackRatioThreshold, 2 ), shr( attackRatioThreshold, 1 ) ); - - move16(); - move16(); - bIsAttackPresent = FALSE; - attackIndex = 0; - /* Search for the last attack in the subblocks */ - if ( s_or( (Word16) GT_32( L_shr( pSubblockNrg[-1], ATTACKTHRESHOLD_E ), Mpy_32_16_1( pAccSubblockNrg[-1], attackRatioThreshold ) ), - L_sub( L_shr( pSubblockNrg[-2], ATTACKTHRESHOLD_E ), Mpy_32_16_1( pAccSubblockNrg[-2], attackRatioThreshold ) ) > 0 ) ) - { - move16(); - bIsAttackPresent = TRUE; - } - - FOR( i = 0; i < NSUBBLOCKS; i++ ) - { - IF( GT_32( L_shr( pSubblockNrg[i], ATTACKTHRESHOLD_E ), Mpy_32_16_1( pAccSubblockNrg[i], attackRatioThreshold ) ) ) - { - if ( i < 6 ) - { - move16(); - bIsAttackPresent = TRUE; - } - - if ( s_and( (Word16) NE_16( attackIndex, 2 ), (Word16) NE_16( attackIndex, 6 ) ) ) - { - move16(); - attackIndex = i; - } - } - ELSE /* no attack, but set index anyway in case of strong energy increase */ - { - IF( s_and( ( (Word16) GT_32( L_shr( pSubblockNrg[i], 1 + ATTACKTHRESHOLD_E ), Mpy_32_16_1( pSubblockNrg[sub( i, 1 )], attackRatioThreshold_1_5 ) ) ), - ( L_sub( L_shr( pSubblockNrg[i], 1 + ATTACKTHRESHOLD_E ), Mpy_32_16_1( pSubblockNrg[sub( i, 2 )], attackRatioThreshold_1_5 ) ) > 0 ) ) ) - { - - if ( s_and( (Word16) NE_16( attackIndex, 2 ), (Word16) NE_16( attackIndex, 6 ) ) ) - { - move16(); - attackIndex = i; - } - } - } - } - /* avoid post-echos on click sounds (very short transients) due to TNS aliasing */ - if ( EQ_16( attackIndex, 4 ) ) - { - move16(); - attackIndex = 7; - } - if ( EQ_16( attackIndex, 5 ) ) - { - move16(); - attackIndex = 6; - } - - move16(); - move16(); - *pAttackIndex = attackIndex; - *pbIsAttackPresent = bIsAttackPresent; - - return; -} - - /** Initialize TCX transient detector. * See InitTransientDetector_fx for definition of parameters. */