Commit b4071947 authored by vaclav's avatar vaclav
Browse files

fix Issue 223: change return data type in function get_delay(); under FIX_GET_DELAY_RETURN

parent 53694b65
Loading
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -50,8 +50,12 @@
 *--------------------------------------------------------------------------*/

/*! r: delay value in ns */
#ifdef FIX_GET_DELAY_RETURN
int32_t get_delay(
#else
float get_delay(
    const int16_t what_delay,         /* i  : what delay? (ENC or DEC)            */
#endif
    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            */
@@ -59,9 +63,13 @@ float get_delay(
    const int32_t binaural_latency_ns /* i  : binaural renderer HRTF delay in ns  */
)
{
#ifdef FIX_GET_DELAY_RETURN
    int32_t delay = 0;
#else
    float delay = 0;
#endif

    if ( what_delay == ENC )
    if ( enc_dec == ENC )
    {
        if ( ivas_format == MONO_FORMAT ) /* EVS mono */
        {
@@ -78,7 +86,7 @@ float get_delay(
            delay += IVAS_FB_ENC_DELAY_NS;
        }
    }
    else
    else /* DEC */
    {
        if ( ivas_format == MONO_FORMAT ) /* EVS mono */
        {
+1 −0
Original line number Diff line number Diff line
@@ -167,6 +167,7 @@
#ifdef FIX_185_REDUCE_MD_BITS
#define CLEANUP_185_NO_AGC_EXCEPTION                    /* Issue 185: Cleanup AGC EXCEPTION code */
#endif
#define FIX_GET_DELAY_RETURN                            /* Issue 223: change return data type in function get_delay() */


/* ################## End DEVELOPMENT switches ######################### */
+10 −6
Original line number Diff line number Diff line
@@ -712,8 +712,12 @@ int16_t lev_dur(
);

/*! r: delay value in ns */
#ifdef FIX_GET_DELAY_RETURN
int32_t get_delay(
#else
float get_delay(
    const int16_t what_delay,         /* i  : what delay? (ENC or DEC)        */
#endif
    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              */
+4 −0
Original line number Diff line number Diff line
@@ -1055,7 +1055,11 @@ ivas_error IVAS_DEC_GetDelay(
    st_ivas = hIvasDec->st_ivas;
    hDecoderConfig = st_ivas->hDecoderConfig;

#ifdef FIX_GET_DELAY_RETURN
    *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 ) );
#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 ) );
#endif

    *timeScale = hDecoderConfig->output_Fs;

+4 −0
Original line number Diff line number Diff line
@@ -954,7 +954,11 @@ ivas_error IVAS_ENC_GetDelay(
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

#ifdef FIX_GET_DELAY_RETURN
    *delay = NS2SA( hEncoderConfig->input_Fs, get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, RENDERER_DISABLE, 0 ) );
#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 *= hEncoderConfig->nchan_inp;