From 7c755f6fb6698fbff080e627e5f7c3ec6927b535 Mon Sep 17 00:00:00 2001 From: Thomas Dettbarn Date: Fri, 10 Oct 2025 14:32:17 +0200 Subject: [PATCH 1/2] removed GetAttackForTCXDecision_fx() prototype and implementation. --- lib_com/prot_fx.h | 8 ---- lib_enc/transient_detection_fx.c | 81 -------------------------------- 2 files changed, 89 deletions(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index d55830740..c918b01bd 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 bb8239f90..bee65d774 100644 --- a/lib_enc/transient_detection_fx.c +++ b/lib_enc/transient_detection_fx.c @@ -259,87 +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. -- GitLab From 6af4c1a0f800c631ae4a32975990bbffd36aac33 Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Wed, 15 Oct 2025 17:20:19 +0200 Subject: [PATCH 2/2] clang format --- lib_enc/transient_detection_fx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_enc/transient_detection_fx.c b/lib_enc/transient_detection_fx.c index bee65d774..b0593456d 100644 --- a/lib_enc/transient_detection_fx.c +++ b/lib_enc/transient_detection_fx.c @@ -259,7 +259,6 @@ static void GetAttackForTCXDecision_ivas_fx( } - /** Initialize TCX transient detector. * See InitTransientDetector_fx for definition of parameters. */ -- GitLab