Commit 93750309 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch '583-clang-error-left-shift-of-negative-value-in-transient-detector' into 'main'

Resolve "Clang error "left shift of negative value" in transient detector"

See merge request !793
parents 7b5cd1f8 e29a2301
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@
#define ISM_FB_16k4                                     /* VA: Issue: 579: change BW from SWB to FB in NxISM conditions to match the EVS codec */
#define FIX_580_PARAMMC_ENER_BURSTS                     /* FhG: issue 580: energy bursts due to ILD holding when energy relations change too much */
#define FIX_593_STL_INCLUDE                             /* FhG: Issue 593: correct include of stl.h in lib_enc/ivas_stereo_eclvq_enc.c */

#define FIX_583_CLANG_TRANS_DET                         /* FhG: Issue 583: clang left shift on ramp_up_flag in transient detector */

/* ################## End BE DEVELOPMENT switches ######################### */

+4 −0
Original line number Diff line number Diff line
@@ -124,7 +124,11 @@ typedef struct
    float firState1;
    float firState2;

#ifdef FIX_583_CLANG_TRANS_DET
    uint16_t ramp_up_flag; /* bit map flags to indicate a ramp up in beginning of TCX frame */
#else
    int16_t ramp_up_flag; /* bit map flags to indicate a ramp up in beginning of TCX frame */
#endif

} SubblockEnergies;

+4 −0
Original line number Diff line number Diff line
@@ -241,7 +241,11 @@ void RunTransientDetection(
    UpdateDelayBuffer( filteredInput, length, &hTranDet->delayBuffer );

    /* compute ramp up flag */
#ifdef FIX_583_CLANG_TRANS_DET
    pSubblockEnergies->ramp_up_flag = ( ( pSubblockEnergies->ramp_up_flag << 1 ) & 0x0003 );
#else
    pSubblockEnergies->ramp_up_flag = pSubblockEnergies->ramp_up_flag << 1;
#endif
    e0 = dotp( filteredInput + length / 2, filteredInput + length / 2, pSubblockEnergies->pDelayBuffer->nSubblockSize / 2 ) + 0.5f * MIN_BLOCK_ENERGY;
    e1 = pSubblockEnergies->subblockNrg[pSubblockEnergies->nDelay + 4] - e0;
    if ( e1 > e0 )