Commit 7c24f7cf authored by kinuthia's avatar kinuthia
Browse files

Merge branch '294-small-fix-in-low-rate-encoding-of-transient' into 'main'

[non-be] Fix for critical item for contribution 20

See merge request !389
parents e9ae109a bcfd83ce
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@
#define FIX_292_VBAP_CALLOC_REMOVAL                     /* Nokia: Fixes issue 292 by removing the remnant callocs */
#define FIX_293_EXT_RENDERER_CLI                        /* FhG: Fix bugs in external renderer CLI */
#define FIX_268                                         /* Issue 268: Add low cost dry-run of memory analysis */
#define LOW_RATE_TRANS_FIX                              /* Eri: Fix for critical item during transitions */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+11 −0
Original line number Diff line number Diff line
@@ -656,6 +656,17 @@ ivas_error ivas_cpe_enc(
        hCPE->hFrontVad[0]->ini_frame = min( hCPE->hFrontVad[0]->ini_frame, MAX_FRAME_COUNTER );
    }

#ifdef LOW_RATE_TRANS_FIX
    /* Store previous attack detection flag */
    for ( n = 0; n < CPE_CHANNELS; n++ )
    {
        if ( sts[n]->mct_chan_mode != MCT_CHAN_MODE_LFE )
        {
            sts[n]->hTranDet->transientDetector.prev_bIsAttackPresent = sts[n]->hTranDet->transientDetector.bIsAttackPresent;
        }
    }
#endif

#ifdef DEBUG_MODE_INFO
    if ( hCPE->element_mode == IVAS_CPE_DFT )
    {
+5 −0
Original line number Diff line number Diff line
@@ -273,6 +273,11 @@ ivas_error ivas_ism_enc(

        /* update input samples buffer */
        mvr2r( st->input, st->old_input_signal, input_frame );

#ifdef LOW_RATE_TRANS_FIX
        /* Store previous attack detection flag */
        st->hTranDet->transientDetector.prev_bIsAttackPresent = st->hTranDet->transientDetector.bIsAttackPresent;
#endif
    }

    pop_wmops();
+4 −2
Original line number Diff line number Diff line
@@ -140,8 +140,10 @@ typedef struct TransientDetector
    TCheckSubblocksForAttack CheckSubblocksForAttack; /* Function for checking a presence of an attack. */
    float attackRatioThreshold;                       /* Attack ratio threshold. */
    int16_t bIsAttackPresent;                         /* True when an attack was detected. */
#ifdef LOW_RATE_TRANS_FIX
    int16_t prev_bIsAttackPresent; /* True if an attack was detected in the previous frame. */
#endif
    int16_t attackIndex; /* The index of an attack. */

} TransientDetector;

/* Transient detection: Holds all transient detectors and buffers used by them. */
+7 −1
Original line number Diff line number Diff line
@@ -577,6 +577,9 @@ static void InitTransientDetector(
    pTransientDetector->CheckSubblocksForAttack = pCheckSubblocksForAttack;
    pTransientDetector->attackRatioThreshold = attackRatioThreshold;
    pTransientDetector->bIsAttackPresent = FALSE;
#ifdef LOW_RATE_TRANS_FIX
    pTransientDetector->prev_bIsAttackPresent = FALSE;
#endif
    pTransientDetector->attackIndex = -1;
    pTransientDetector->pSubblockEnergies->ramp_up_flag = 0x0;

@@ -897,8 +900,11 @@ int16_t transient_analysis(
            prel_force_td |= 0x0001;
        }
    }

#ifdef LOW_RATE_TRANS_FIX
    if ( prel_force_td == 0 && hTranDet->transientDetector.prev_bIsAttackPresent == 1 )
#else
    if ( prel_force_td == 0 )
#endif
    {
        /* release analysis */
        pSubblockNrg = hTranDet->transientDetector.pSubblockEnergies->subblockNrg;