Commit dd2e370a authored by sagnowski's avatar sagnowski
Browse files

Merge branch '1122-jbm-and-dtx-interaction-not-as-expected' into 'main'

[non-BE] Resolve "JBM and DTX interaction not as expected"

See merge request !2040
parents 71bc6aed 0259d18d
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -175,6 +175,8 @@
#define NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING           /* Ericsson: issue 1180, corrected long term mute loop attnuation after 200ms  in PhECU-PLC  */
#define NONBE_FIX_1297_SPAR_JBM_MEM_SAN                 /*Dolby: issue 1297, SPAR + JBM + BR switch memory sanitizer*/  
#define NONBE_1289_STEREO_SW_TO_MONO                    /* VA: issue 1289: Fix glitch when stereo signal is decoded to mono n TD->DFT switching */
#define NONBE_1122_JBM_FIX_PLAYOUT_DELAY_IN_DTX         /* FhG: Avoid JBM ignoring safety margin and setting playout delay to 0 during DTX */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define NONBE_1296_TDREND_ITD_OUT_OF_BOUNDS_ACCESS      /* Eri: issue 1296: ITD resampling can occasionally read out of bounds, especially when the requested subframes are short (1.25 ms). Seen for headtracking+JBM. */
#define NONBE_1303_GRANULARITY_OSBA_REND                /* VA: issue 1303: Correctly set the granularity in OSBA, Disc mode, and BINAURAL_ROOM_REVERB output */

+1 −1
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ int16_t JB4_JMF_PushPacket(

    rtpTimeDiff = (int32_t) ( rtpTimeStamp - h->lastRtpTimeStamp );
    sysTimeDiff = sysTime - h->lastSysTime;
    offset = sysTime - rtpTimeStamp;
    offset = (int32_t) sysTime - (int32_t) rtpTimeStamp;

    /* get the delay (yes, signed!!!!) */
    delay = sysTimeDiff - rtpTimeDiff + h->lastDelay;
+24 −0
Original line number Diff line number Diff line
@@ -199,6 +199,9 @@ struct JB4
    JB4_DATAUNIT_HANDLE freeMemorySlots[MAX_JBM_SLOTS];
    uint16_t nFreeMemorySlots;
    /*@} */
#ifdef NONBE_1122_KEEP_EVS_MODE_UNCHANGED
    bool evsMode;
#endif
}; /* JB4 */


@@ -293,6 +296,9 @@ ivas_error JB4_Create(
        h->freeMemorySlots[iter] = &h->memorySlots[iter];
    }
    h->nFreeMemorySlots = MAX_JBM_SLOTS;
#ifdef NONBE_1122_KEEP_EVS_MODE_UNCHANGED
    h->evsMode = false;
#endif
    *ph = h;

    return IVAS_ERR_OK;
@@ -369,6 +375,12 @@ ivas_error JB4_Init(
    return IVAS_ERR_OK;
}

#ifdef NONBE_1122_KEEP_EVS_MODE_UNCHANGED
void JB4_TMP_SetEvsCompatFlag( JB4_HANDLE h )
{
    h->evsMode = true;
}
#endif

/* Returns a memory slot to store a new data unit */
JB4_DATAUNIT_HANDLE JB4_AllocDataUnit(
@@ -671,10 +683,22 @@ static void JB4_targetPlayoutDelay(
        *targetStartUp = ( *targetMin + *targetMax ) / 2;
    }

#ifdef NONBE_1122_JBM_FIX_PLAYOUT_DELAY_IN_DTX
#ifdef NONBE_1122_KEEP_EVS_MODE_UNCHANGED
    if ( !h->evsMode )
    {
#endif
        *targetDtx = JB4_MAX( *targetDtx, (uint32_t) h->safetyMargin );
#ifdef NONBE_1122_KEEP_EVS_MODE_UNCHANGED
    }
#endif
    *targetStartUp = JB4_MAX( *targetStartUp, (uint32_t) h->safetyMargin );
#else
    if ( *targetStartUp < 60 )
    {
        *targetStartUp = 60;
    }
#endif

    return;
}
+4 −0
Original line number Diff line number Diff line
@@ -86,6 +86,10 @@ void JB4_Destroy( JB4_HANDLE *ph );

ivas_error JB4_Init( JB4_HANDLE h, const int16_t safetyMargin );

#ifdef NONBE_1122_KEEP_EVS_MODE_UNCHANGED
void JB4_TMP_SetEvsCompatFlag( JB4_HANDLE h );
#endif

JB4_DATAUNIT_HANDLE JB4_AllocDataUnit( JB4_HANDLE h );

void JB4_FreeDataUnit( JB4_HANDLE h, JB4_DATAUNIT_HANDLE dataUnit );
+6 −0
Original line number Diff line number Diff line
@@ -793,6 +793,12 @@ ivas_error IVAS_DEC_EnableVoIP(
    {
        return IVAS_ERR_FAILED_ALLOC;
    }
#ifdef NONBE_1122_KEEP_EVS_MODE_UNCHANGED
    if ( hIvasDec->mode == IVAS_DEC_MODE_EVS )
    {
        JB4_TMP_SetEvsCompatFlag( hIvasDec->hVoIP->hJBM );
    }
#endif

    /* init flush buffer if necessary (only needed for binaural)*/
    if ( hIvasDec->flushbuffer == NULL && ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
Loading