diff --git a/lib_com/delay_comp.c b/lib_com/delay_comp.c index 3589d32d479d659d31cdbb003fc4490994b17f33..2801df4478f7e011a82dc963d311ba0625a96af3 100644 --- a/lib_com/delay_comp.c +++ b/lib_com/delay_comp.c @@ -99,6 +99,7 @@ int32_t get_delay( else /* IVAS */ { delay = IVAS_DEC_DELAY_NS; + #ifdef FIX_I59_LFE_TD_DELAY if ( hCldfb != NULL ) { diff --git a/lib_com/prot.h b/lib_com/prot.h index 9563601d334b5aa5395df98754cfdfb74969a51c..5f48ddc8250f564d658f3be88ee1614203e56124 100755 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -714,11 +714,11 @@ int16_t lev_dur( /*! r: delay value in ns */ 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 */ + 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 */ #ifndef FIX_I59_LFE_TD_DELAY - RENDERER_TYPE renderer_type, /* i : IVAS rendering type */ + RENDERER_TYPE renderer_type, /* i : IVAS rendering type */ const int32_t binaural_latency_ns /* i : binaural renderer HRTF delay in ns */ #else const int32_t binaural_latency_ns /* i : binauralization delay in ns */ @@ -3896,7 +3896,7 @@ void td_cng_enc_init( void dtx( Encoder_State *st, /* i/o: encoder state structure */ - const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int16_t vad, /* i : VAD flag for DTX */ const float speech[] /* i : Pointer to the speech frame */ ); diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 5234a5a6c9803869c5dfd71f0cc98bfa0c33dd9c..a631513ae3eb2418b54d83337501f60c479c8101 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1057,9 +1057,9 @@ ivas_error IVAS_DEC_GetDelay( #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 diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 0401df16e4578b4c97aed15c3f30b681179bbdda..6db4bb991bd638f13cf2050d46a0f5c962b787bd 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -952,17 +952,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 ); -#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 ); + *delay = NS2SA( hEncoderConfig->input_Fs, get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, 0 ) ); #else *delay = NS2SA( hEncoderConfig->input_Fs, get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, RENDERER_DISABLE, 0 ) ); -#endif #endif *delay *= hEncoderConfig->nchan_inp;