Commit 62dbac2d authored by vaclav's avatar vaclav
Browse files

correct merge with FIX_GET_DELAY_RETURN

parent b6abbbd1
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -50,8 +50,8 @@
 *--------------------------------------------------------------------------*/

/*! r: delay value in ns */
float get_delay(
    const int16_t what_delay,        /* i  : what delay? (ENC or DEC)            */
int32_t get_delay(
    const int16_t enc_dec,           /* i  : encoder/decoder flag                */
    const int32_t io_fs,             /* i  : input/output sampling frequency     */
    const IVAS_FORMAT ivas_format,   /* i  : IVAS format                         */
    HANDLE_CLDFB_FILTER_BANK hCldfb, /* i  : Handle of Cldfb analysis            */
@@ -63,9 +63,9 @@ float get_delay(
#endif
)
{
    float delay = 0;
    int32_t delay = 0;

    if ( what_delay == ENC )
    if ( enc_dec == ENC )
    {
        if ( ivas_format == MONO_FORMAT ) /* EVS mono */
        {
@@ -82,7 +82,7 @@ float get_delay(
            delay += IVAS_FB_ENC_DELAY_NS;
        }
    }
    else
    else /* DEC */
    {
        if ( ivas_format == MONO_FORMAT ) /* EVS mono */
        {
@@ -98,6 +98,7 @@ float get_delay(
        else /* IVAS */
        {
            delay = IVAS_DEC_DELAY_NS;

#ifdef FIX_I59_LFE_TD_DELAY
            if ( hCldfb != NULL )
            {
+2 −2
Original line number Diff line number Diff line
@@ -712,8 +712,8 @@ int16_t lev_dur(
);

/*! r: delay value in ns */
float get_delay(
    const int16_t what_delay,        /* i  : what delay? (ENC or DEC)        */
int32_t get_delay(
    const int16_t enc_dec,           /* i  : encoder/decoder flag            */
    const int32_t io_fs,             /* i  : input/output sampling frequency */
    const IVAS_FORMAT ivas_format,   /* i  : IVAS format                     */
    HANDLE_CLDFB_FILTER_BANK hCldfb, /* i  : Handle of Cldfb analysis        */
+3 −3
Original line number Diff line number Diff line
@@ -1056,15 +1056,15 @@ ivas_error IVAS_DEC_GetDelay(
    hDecoderConfig = st_ivas->hDecoderConfig;
#ifdef FIX_I59_LFE_TD_DELAY
#ifdef FIX_I59_DELAY_ROUNDING
    *nSamples = (int16_t) roundf( get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], st_ivas->binaural_latency_ns ) * hDecoderConfig->output_Fs / 1000000000.f );
    *nSamples = (int16_t) roundf( (float) get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], st_ivas->binaural_latency_ns ) * hDecoderConfig->output_Fs / 1000000000.f );
#else
    *nSamples = NS2SA( hDecoderConfig->output_Fs, (int32_t) ( get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], st_ivas->binaural_latency_ns ) + 0.5f ) );
    *nSamples = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], st_ivas->binaural_latency_ns ) );
#endif
#else
#ifdef FIX_I59_DELAY_ROUNDING
    *nSamples = (int16_t) roundf( get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], st_ivas->renderer_type, st_ivas->binaural_latency_ns ) * hDecoderConfig->output_Fs / 1000000000.f );
#else
    *nSamples = NS2SA( hDecoderConfig->output_Fs, (int32_t) ( get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], st_ivas->renderer_type, st_ivas->binaural_latency_ns ) + 0.5f ) );
    *nSamples = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], st_ivas->renderer_type, st_ivas->binaural_latency_ns ) );
#endif
#endif

+2 −10
Original line number Diff line number Diff line
@@ -955,17 +955,9 @@ ivas_error IVAS_ENC_GetDelay(
    }

#ifdef FIX_I59_LFE_TD_DELAY
#ifdef FIX_I59_DELAY_ROUNDING
    *delay = NS2SA( hEncoderConfig->input_Fs, get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, 0 ) + 0.5f );
    *delay = NS2SA( hEncoderConfig->input_Fs, get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, 0 ) );
#else
    *delay = NS2SA( hEncoderConfig->input_Fs, (int32_t) ( get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, 0 ) + 0.5f ) );
#endif
#else
#ifdef FIX_I59_DELAY_ROUNDING
    *delay = NS2SA( hEncoderConfig->input_Fs, get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, RENDERER_DISABLE, 0 ) + 0.5f );
#else
    *delay = NS2SA( hEncoderConfig->input_Fs, (int32_t) ( get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, RENDERER_DISABLE, 0 ) + 0.5f ) );
#endif
    *delay = NS2SA( hEncoderConfig->input_Fs, get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, RENDERER_DISABLE, 0 ) );
#endif

    *delay *= hEncoderConfig->nchan_inp;