From dd8aba2c42661143d1fe7a576a3f94e45645fd39 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Wed, 7 Aug 2024 17:06:39 +1000 Subject: [PATCH] Update to LFE PLC, fixing issue 764 --- lib_com/cnst.h | 4 + lib_com/ivas_cnst.h | 4 + lib_com/ivas_prot.h | 6 +- lib_com/ivas_rom_com.c | 22 ++++- lib_com/ivas_rom_com.h | 4 + lib_com/lpc_tools.c | 2 +- lib_com/lsf_tools.c | 19 +++- lib_com/options.h | 1 + lib_com/prot.h | 5 + lib_dec/ivas_lfe_plc.c | 210 +++++++++++++++++++++++++++++++++++++---- lib_dec/swb_tbe_dec.c | 1 + lib_enc/ivas_lfe_enc.c | 4 + lib_enc/swb_tbe_enc.c | 1 + 13 files changed, 261 insertions(+), 22 deletions(-) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 5bfffa4dd..1fb76df31 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -553,6 +553,10 @@ enum #define INT_FS_12k8 12800 /* internal sampling frequency */ #define M 16 /* order of the LP filter @ 12.8kHz */ +#ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT +#define MAX_LP_FILTER_ORDER 20 /* Max order of an LP filter */ +#endif + #define L_FRAME 256 /* frame size at 12.8kHz */ #define NB_SUBFR 4 /* number of subframes per frame */ #define L_SUBFR ( L_FRAME / NB_SUBFR ) /* subframe size */ diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 11f6bd56f..2c6cd7f56 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1441,7 +1441,11 @@ typedef enum /* LFE PLC */ #define LFE_PLC_BUFLEN 240 #define LFE_PLC_FS 1600 +#ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT +#define L_FRAME_1k6 ( LFE_PLC_FS / FRAMES_PER_SEC ) +#else #define L_FRAME_1k6 ( 20 * LFE_PLC_FS / 1000 ) +#endif #define LFE_PLC_LENANA LFE_PLC_BUFLEN #define LFE_PLC_FDEL 300 diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 68f3a9de6..0ffed7821 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5473,7 +5473,11 @@ void ivas_lfe_dec( void ivas_lfe_tdplc( LFE_DEC_HANDLE hLFE, /* i/o: LFE decoder handle */ - const float *prevsynth, /* i : previous frame synthesis */ +#ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT + float *prevsynth, /* i : previous frame synthesis */ +#else + double *prevsynth, /* i : previous frame synthesis */ +#endif float *ytda, /* o : output time-domain buffer */ const int16_t output_frame /* i : output frame length */ ); diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index ad8279712..fe97aea47 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -3188,6 +3188,26 @@ const int16_t ivas_lfe_min_shift_tbl[IVAS_LFE_NUM_COEFFS_IN_SUBGRP] = { 1, 0 }; const float ivas_lfe_lpf_delay[2] = { 0.00175f, 0.0035f }; +#ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT +const float hamm_lfe_plc[LFE_PLC_LENANA / 2] = +{ + 0.08000000000000002f, 0.08015895227847719f, 0.08063569926248770f, 0.08142991147368656f, 0.08254104003450596f, 0.08396831704748331f, 0.08571075612595230f, 0.08776715307573196f, + 0.09013608672734141f, 0.09281591991816535f, 0.09580480062389246f, 0.09910066323844335f, 0.10270123000150438f, 0.10660401257268071f, 0.11080631375118072f, 0.11530522933984272f, + 0.12009765015221685f, 0.12518026416131367f, 0.13054955878853602f, 0.13620182333121073f, 0.14213315152704381f, 0.14833944425372619f, 0.15481641236182375f, 0.16155957963899570f, + 0.16856428590349043f, 0.17582569022478273f, 0.18333877426912554f, 0.19109834576770490f, 0.19909904210500018f, 0.20733533402487142f, 0.21580152945181053f, 0.22449177742471671f, + 0.23340007214047787f, 0.24252025710456171f, 0.25184602938575001f, 0.26137094397207467f, 0.27108841822494550f, 0.28099173642839037f, 0.29107405443026624f, 0.30132840437223085f, + 0.31174769950520753f, 0.32232473908701620f, 0.33305221335878232f, 0.34392270859668939f, 0.35492871223557998f, 0.36606261806086549f, 0.37731673146515798f, 0.38868327476598852f, + 0.40015439258093899f, 0.41172215725647360f, 0.42337857434671339f, 0.43511558813837425f, 0.44692508721804453f, 0.45879891007795709f, 0.47072885075638249f, 0.48270666450874267f, + 0.49472407350552849f, 0.50677277255308162f, 0.51884443483328757f, 0.53093071765821398f, 0.54302326823571601f, 0.55511372944202464f, 0.56719374559732838f, 0.57925496824035816f, + 0.59128906189798180f, 0.60328770984582458f, 0.61524261985593010f, 0.62714552992749328f, 0.63898821399670414f, 0.65076248762175315f, 0.66246021363907504f, 0.67407330778691554f, + 0.68559374429233988f, 0.69701356141781945f, 0.70832486696356345f, 0.71951984372179334f, 0.73059075487919101f, 0.74152994936378558f, 0.75232986713258543f, 0.76298304439630038f, + 0.77348211877754336f, 0.78381983439894576f, 0.79398904689767136f, 0.80398272836286389f, 0.81379397219261318f, 0.82341599786708708f, 0.83284215563452701f, 0.84206593110687011f, + 0.85108094976182280f, 0.85988098134827329f, 0.86845994419199846f, 0.87681190939868969f, 0.88493110495139349f, 0.89281191969953333f, 0.90044890723675941f, 0.90783678966494241f, + 0.91497046124171255f, 0.92184499190902180f, 0.92845563070029180f, 0.93479780902379184f, 0.94086714381997805f, 0.94665944059061280f, 0.95217069629756890f, 0.95739710212931617f, + 0.96233504613317988f, 0.96698111571154954f, 0.97133209998031445f, 0.97538499198789563f, 0.97913699079334116f, 0.98258550340204664f, 0.98572814655776630f, 0.98856274838967395f, + 0.99108734991333569f, 0.99330020638455863f, 0.99519978850517732f, 0.99678478347994692f, 0.99805409592381300f, 0.99900684861892730f, 0.99964238312089115f, 0.99996026021380402f +}; +#else const double d_hamm_lfe_plc[LFE_PLC_LENANA / 2] = { 0.08000000000000002, 0.08015895227847719, 0.08063569926248770, 0.08142991147368656, 0.08254104003450596, 0.08396831704748331, 0.08571075612595230, 0.08776715307573196, @@ -3206,7 +3226,7 @@ const double d_hamm_lfe_plc[LFE_PLC_LENANA / 2] = 0.96233504613317988, 0.96698111571154954, 0.97133209998031445, 0.97538499198789563, 0.97913699079334116, 0.98258550340204664, 0.98572814655776630, 0.98856274838967395, 0.99108734991333569, 0.99330020638455863, 0.99519978850517732, 0.99678478347994692, 0.99805409592381300, 0.99900684861892730, 0.99964238312089115, 0.99996026021380402 }; - +#endif /*------------------------------------------------------------------------------------------* * MDFT/iMDFT ROM tables diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index b13d41548..c88b698c0 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -359,7 +359,11 @@ extern const int16_t ivas_lfe_min_shift_tbl[IVAS_LFE_NUM_COEFFS_IN_SUBGRP]; extern const ivas_lfe_freq_models ivas_str_lfe_freq_models; extern const float ivas_lfe_lpf_delay[2]; +#ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT +extern const float hamm_lfe_plc[LFE_PLC_LENANA / 2]; +#else extern const double d_hamm_lfe_plc[LFE_PLC_LENANA / 2]; +#endif extern const float ivas_sin_twiddle_480[IVAS_480_PT_LEN >> 1]; extern const float ivas_cos_twiddle_480[IVAS_480_PT_LEN >> 1]; diff --git a/lib_com/lpc_tools.c b/lib_com/lpc_tools.c index 9c936da11..2af9f407c 100644 --- a/lib_com/lpc_tools.c +++ b/lib_com/lpc_tools.c @@ -128,7 +128,7 @@ void autocorr( * of input signal *---------------------------------------------------------------------*/ -/*! r: energy of prediction error */ +/*! r: stability flag */ int16_t lev_dur( float *a, /* o : LP coefficients (a[0] = 1.0) */ const float *r, /* i : vector of autocorrelations */ diff --git a/lib_com/lsf_tools.c b/lib_com/lsf_tools.c index eaa94b506..32df7a35e 100644 --- a/lib_com/lsf_tools.c +++ b/lib_com/lsf_tools.c @@ -944,14 +944,22 @@ void isp2isf( * * Convert from LPC to reflection coeff *-------------------------------------------------------------------*/ - +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT void a2rc( +#else +/*! r: stability flag */ +uint16_t a2rc( +#endif const float *a, /* i : LPC coefficients */ float *refl, /* o : Reflection co-efficients */ const int16_t lpcorder /* i : LPC order */ ) { +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT float f[M]; +#else + float f[MAX_LP_FILTER_ORDER]; +#endif int16_t m, j, n; float km, denom, x; @@ -970,8 +978,11 @@ void a2rc( { refl[j] = 0.f; } - +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT return; +#else + return 0; +#endif } refl[m] = -km; @@ -991,7 +1002,11 @@ void a2rc( } } +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT return; +#else + return 1; +#endif } diff --git a/lib_com/options.h b/lib_com/options.h index 4d860e371..5f48e70b3 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -77,6 +77,7 @@ #define NON_BE_FIX_807_MASA_DTX_BRSW /* Nokia: adds fix to check existence of DTX encoder for secondary channel in TD mode */ #define NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL /* Nokia: add fix for precision limitation in comparison with masa2total energy ratio threshold */ #define FIX_828_PORT_1152_FROM_FLT_REPO /* FhG: fix for issue 828 - fix uninitialized value used in BASOP */ +#define NONE_BE_FIX_816_LFE_PLC_FLOAT /* DLB: issue 816: reduce required precision to float for LFE-PLC*/ /* #################### End FIXES switches ############################ */ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ diff --git a/lib_com/prot.h b/lib_com/prot.h index a032dcf7e..c15223c29 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -2912,7 +2912,12 @@ void a2isf( const float *old_isf, const int16_t lpcOrder ); +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT void a2rc( +#else +/*! r: stability flag */ +uint16_t a2rc( +#endif const float *a, /* i : LPC coefficients */ float *refl, /* o : Reflection co-efficients */ const int16_t lpcorder /* i : LPC order */ diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index d973dc4a0..c1fda3025 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -42,19 +42,26 @@ * Local constants *------------------------------------------------------------------------------------------*/ -#define LFE_PLC_DSF ( 48000 / LFE_PLC_FS ) -#define LFE_PLC_LPCORD ( 20 ) -#define LFE_PLC_MAXITER ( 10 ) +#define LFE_PLC_DSF ( 48000 / LFE_PLC_FS ) +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT +#define LFE_PLC_LPCORD ( 20 ) +#else +#define LFE_PLC_LPCORD ( MAX_LP_FILTER_ORDER ) +#endif #define POW_THR ( 1.0e-8f ) #define LFE_PLC_RECLEN_48K ( ( IVAS_LFE_NUM_COEFFS_IN_SUBGRP + 1 ) * L_FRAME48k / IVAS_LFE_NUM_COEFFS_IN_SUBGRP + LFE_PLC_FDEL ) #define LFE_PLC_RECLEN ( ( LFE_PLC_RECLEN_48K / LFE_PLC_DSF ) ) #define LFE_PLC_MUTE_THR ( 10 ) -#define LFE_PLC_BURST_ATT ( pow( pow( 10.0, -3.0 / 20.0 ), 1.0 / ( LFE_PLC_FS * 0.02 ) ) ) /* attenuate 3dB per frame starting with 10th consecutive loss */ - -#define MAX_LEN_LP 960 - -#define EPS_STOP 1e-5 - +#ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT +#define LFE_PLC_BURST_ATT ( powf( powf( 10.0f, -3.0f / 20.0f ), 1.0f / ( LFE_PLC_FS * 20 / 1000 ) ) ) /* attenuate 3dB per frame starting with 10th consecutive loss */ +#define EPS_STOP 1e-5f +#else +#define LFE_PLC_BURST_ATT ( pow( pow( 10.0, -3.0 / 20.0 ), 1.0 / ( LFE_PLC_FS * 0.02 ) ) ) /* attenuate 3dB per frame starting with 10th consecutive loss */ +#define MAX_LEN_LP 960 +#define EPS_STOP 1e-5 +#endif + +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT /*------------------------------------------------------------------------------------------* * Static function declarations * @@ -199,10 +206,12 @@ static int16_t d_lev_dur( } rc[i - 1] = ( -s ) / err; + if ( fabs( rc[i - 1] ) > 0.99945f ) { flag = 1; /* Test for unstable filter. If unstable keep old A(z) */ } + for ( j = 1; j <= i / 2; j++ ) { l = i - j; @@ -228,13 +237,82 @@ static int16_t d_lev_dur( return ( flag ); } +#else +/*---------------------------------------------------------------------* + * lfeplc_lev_dur() + * + * Wiener-Levinson-Durbin algorithm to compute LP parameters from the autocorrelations + * of input signal + *---------------------------------------------------------------------*/ + +/*! r: stability flag */ +static int16_t lfeplc_lev_dur( + float *a_out, /* o : LP coefficients (a[0] = 1.0) */ + const float *r, /* i : vector of autocorrelations */ + const int16_t m /* i : order of LP filter */ +) +{ + int16_t i, j, l; + float buf[TCXLTP_LTP_ORDER]; + float *rc; /* reflection coefficients 0,...,m-1 */ + float s, at, err; + float a[LFE_PLC_LPCORD + 1]; + + set_f( a, 0.f, LFE_PLC_LPCORD + 1 ); + set_f( a_out, 0.f, LFE_PLC_LPCORD + 1 ); + rc = &buf[0]; + a[0] = 1.f; + err = r[0]; + a_out[0] = a[0]; + rc[0] = ( -r[1] ) / r[0]; + s = r[1]; + a[1] = rc[0]; + a_out[1] = a[1]; + + i = 1; + while ( i < m ) + { + for ( j = 1; j <= i / 2; j++ ) + { + l = i - j; + at = a[j] + rc[i - 1] * a[l]; + a[l] += rc[i - 1] * a[j]; + a[j] = at; + } + a[i] = rc[i - 1]; + err += rc[i - 1] * s; + s = 0.f; + i++; + for ( j = 0; j < i; j++ ) + { + s += r[i - j] * a[j]; + } + rc[i - 1] = ( -s ) / err; + if ( fabsf( rc[i - 1] ) > 0.99945f ) + { + return 1; + } + else + { + for ( j = 0; j <= m; j++ ) + { + a_out[j] = a[j]; + } + } + } + + return 0; +} + +#endif + +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT /*-------------------------------------------------------------------* * a2rc() * * Convert from LPC to reflection coeff *-------------------------------------------------------------------*/ - static uint16_t d_a2rc( const double *a, /* i : LPC coefficients */ double *refl, /* o : Reflection co-efficients */ @@ -242,8 +320,8 @@ static uint16_t d_a2rc( ) { double ff[LFE_PLC_LPCORD]; - int16_t m, j, n; double km, denom, x; + int16_t m, j, n; for ( m = 0; m < lpcorder; m++ ) { @@ -283,7 +361,6 @@ static uint16_t d_a2rc( return 1; } - static void d_syn_filt( const double a[], /* i : LP filter coefficients */ const int16_t m, /* i : order of LP filter */ @@ -325,7 +402,7 @@ static void d_syn_filt( return; } - +#endif /*-----------------------------------------------------------------------------------------* * Function check_stab() @@ -333,17 +410,31 @@ static void d_syn_filt( * LPC filter stability check applying given sharpening value delta *-----------------------------------------------------------------------------------------*/ +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT static uint16_t check_stab( const double *a, double delta ) { double amod[LFE_PLC_LPCORD], refl[LFE_PLC_LPCORD]; - int16_t i; double fac; double fac1; +#else +static uint16_t check_stab( + const float *a, + const float delta ) +{ + float amod[LFE_PLC_LPCORD], refl[LFE_PLC_LPCORD]; + float fac; + float fac1; +#endif + int16_t i; uint16_t stable; +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT fac = 1.0 + delta; +#else + fac = 1.0f + delta; +#endif fac1 = fac; for ( i = 0; i < LFE_PLC_LPCORD; i++ ) @@ -351,7 +442,12 @@ static uint16_t check_stab( amod[i] = a[i] * fac; fac *= fac1; } + +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT stable = d_a2rc( amod, refl, LFE_PLC_LPCORD ); +#else + stable = a2rc( amod, refl, LFE_PLC_LPCORD ); +#endif return stable; } @@ -363,16 +459,30 @@ static uint16_t check_stab( * Find maximum LPC filter sharpening by iteration to get a filter that is almost instable *-----------------------------------------------------------------------------------------*/ +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT static double find_max_delta( double *a ) { double delta; double eps; - uint16_t stable; double fac; +#else +static float find_max_delta( + float *a ) +{ + float delta; + float eps; + float fac; +#endif + uint16_t stable; +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT delta = 0.0; eps = 0.01; +#else + delta = 0.0f; + eps = 0.01f; +#endif fac = 2; stable = FALSE; @@ -382,7 +492,11 @@ static double find_max_delta( eps *= fac; stable = TRUE; } +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT fac = 0.5; +#else + fac = 0.5f; +#endif if ( stable ) { @@ -404,6 +518,7 @@ static double find_max_delta( delta += eps; stable = check_stab( a, delta ); +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT if ( !stable ) { if ( fabs( eps ) > EPS_STOP ) @@ -423,6 +538,27 @@ static double find_max_delta( } eps = fabs( eps ) * fac; } +#else + if ( !stable ) + { + if ( fabsf( eps ) > EPS_STOP ) + { + eps = -fabsf( eps ) * fac; + } + else + { + eps = -fabsf( eps ); + } + } + else + { + if ( fabsf( eps ) < EPS_STOP ) + { + break; + } + eps = fabsf( eps ) * fac; + } +#endif } return delta; @@ -437,28 +573,54 @@ static double find_max_delta( static void recover_samples( const int16_t bfi_count, +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT const float *outbuf, +#else + float *outbuf, +#endif float *rec_frame ) { int16_t i; float zeroes[LFE_PLC_RECLEN]; +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT double delta, fac, att; double d_outbuf[LFE_PLC_BUFLEN], d_r[LFE_PLC_LPCORD + 1], d_a[LFE_PLC_LPCORD + 1], d_pee[LFE_PLC_LPCORD + 1]; + mvr2d( outbuf, d_outbuf, LFE_PLC_BUFLEN ); d_autocorr( d_outbuf, d_r, LFE_PLC_LPCORD, LFE_PLC_BUFLEN, d_hamm_lfe_plc, 0, 1, 1 ); +#else + float delta, fac, att; + float r[LFE_PLC_LPCORD + 1], a[LFE_PLC_LPCORD + 1]; + + autocorr( outbuf, r, LFE_PLC_LPCORD, LFE_PLC_BUFLEN, hamm_lfe_plc, 0, 1, 1 ); +#endif +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT if ( d_r[0] < POW_THR * LFE_PLC_BUFLEN ) +#else + if ( r[0] < POW_THR * LFE_PLC_BUFLEN ) +#endif { set_zero( rec_frame, LFE_PLC_RECLEN ); return; } + +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT d_lev_dur( d_a, d_r, LFE_PLC_LPCORD, d_pee ); delta = find_max_delta( d_a + 1 ); fac = 1.0 + delta; att = 1.0; +#else + lfeplc_lev_dur( a, r, LFE_PLC_LPCORD ); + + delta = find_max_delta( a + 1 ); + + fac = 1.0f + delta; + att = 1.0f; +#endif if ( bfi_count >= LFE_PLC_MUTE_THR ) { @@ -468,12 +630,22 @@ static void recover_samples( for ( i = 1; i <= LFE_PLC_LPCORD; i++ ) { +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT d_a[i] = d_a[i] * fac; fac *= att * ( 1.0 + delta ); +#else + a[i] = a[i] * fac; + fac *= att * ( 1.0f + delta ); +#endif } set_zero( zeroes, LFE_PLC_RECLEN ); + +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT d_syn_filt( d_a, LFE_PLC_LPCORD, zeroes, rec_frame, LFE_PLC_RECLEN, outbuf + LFE_PLC_BUFLEN - LFE_PLC_LPCORD ); +#else + syn_filt( a, LFE_PLC_LPCORD, zeroes, rec_frame, LFE_PLC_RECLEN, outbuf + LFE_PLC_BUFLEN - LFE_PLC_LPCORD, 0 ); +#endif return; } @@ -486,8 +658,12 @@ static void recover_samples( *-----------------------------------------------------------------------------------------*/ void ivas_lfe_tdplc( - LFE_DEC_HANDLE hLFE, /* i/o: LFE decoder handle */ - const float *prevsynth, /* i : previous frame synthesis */ + LFE_DEC_HANDLE hLFE, /* i/o: LFE decoder handle */ +#ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT + float *prevsynth, /* i : previous frame synthesis */ +#else + double *prevsynth, /* i : previous frame synthesis */ +#endif float *ytda, /* o : output time-domain buffer */ const int16_t output_frame /* i : output frame length */ ) diff --git a/lib_dec/swb_tbe_dec.c b/lib_dec/swb_tbe_dec.c index 8ac934f44..1fbf1a857 100644 --- a/lib_dec/swb_tbe_dec.c +++ b/lib_dec/swb_tbe_dec.c @@ -930,6 +930,7 @@ void swb_tbe_dec( } a2rc( hBWE_TD->cur_sub_Aq + 1, refl, M ); + tilt_para = 6.6956f * ( 1.0f + refl[0] ) * ( 1.0f + refl[0] ) - 3.8714f * ( 1.0f + refl[0] ) + 1.3041f; if ( st->last_extl != SWB_TBE && st->last_extl != FB_TBE ) { diff --git a/lib_enc/ivas_lfe_enc.c b/lib_enc/ivas_lfe_enc.c index 0c7a1a21a..433f66fb6 100644 --- a/lib_enc/ivas_lfe_enc.c +++ b/lib_enc/ivas_lfe_enc.c @@ -161,7 +161,11 @@ static void ivas_lfe_enc_quant( } else { +#ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT + shift = (int16_t) floorf( IVAS_LFE_SHIFTS_PER_DOUBLE * log2_f( max_value / lfe_abs_sum ) ); +#else shift = (int16_t) floor( IVAS_LFE_SHIFTS_PER_DOUBLE * log2_f( max_value / lfe_abs_sum ) ); +#endif } shift = max( min_shift * IVAS_LFE_SHIFTS_PER_DOUBLE, min( max_shift, shift ) ); diff --git a/lib_enc/swb_tbe_enc.c b/lib_enc/swb_tbe_enc.c index cef5e338d..b22ad1845 100644 --- a/lib_enc/swb_tbe_enc.c +++ b/lib_enc/swb_tbe_enc.c @@ -785,6 +785,7 @@ void swb_tbe_enc( { lsf_diff[i] = lsf_shb[i] - lsf_shb[i - 1]; } + a2rc( hBWE_TD->cur_sub_Aq + 1, refl, M ); /* LSP interpolation for 13.2 kbps and 16.4 kbps */ -- GitLab