From 9c9d846fbf2f038d5a775281dcd4902b13dca919 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Thu, 13 Jun 2024 12:17:57 +1000 Subject: [PATCH 01/61] Reduce double precision in LFE PLC to single --- lib_com/ivas_prot.h | 2 +- lib_com/ivas_rom_com.c | 2 +- lib_com/ivas_rom_com.h | 2 +- lib_dec/ivas_lfe_plc.c | 233 +++++++++-------------------------------- 4 files changed, 55 insertions(+), 184 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 779b328d97..1ce5153e7b 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5495,7 +5495,7 @@ void ivas_lfe_dec( void ivas_lfe_tdplc( LFE_DEC_HANDLE hLFE, /* i/o: LFE decoder handle */ - const float *prevsynth, /* i : previous frame synthesis */ + float *prevsynth, /* i : previous frame synthesis */ 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 ffd5d578de..51e5643774 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -3124,7 +3124,7 @@ 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 }; -const double d_hamm_lfe_plc[LFE_PLC_LENANA / 2] = +const float d_hamm_lfe_plc[LFE_PLC_LENANA / 2] = { 0.08000000000000002, 0.08015895227847719, 0.08063569926248770, 0.08142991147368656, 0.08254104003450596, 0.08396831704748331, 0.08571075612595230, 0.08776715307573196, 0.09013608672734141, 0.09281591991816535, 0.09580480062389246, 0.09910066323844335, 0.10270123000150438, 0.10660401257268071, 0.11080631375118072, 0.11530522933984272, diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index 5983062648..fc2d3133d8 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -359,7 +359,7 @@ 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]; -extern const double d_hamm_lfe_plc[LFE_PLC_LENANA / 2]; +extern const float d_hamm_lfe_plc[LFE_PLC_LENANA / 2]; 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_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index d74cbc7772..7b57e5e70d 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -52,114 +52,20 @@ #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 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 MAX_LEN_LP 960 -#define EPS_STOP 1e-5 +#define EPS_STOP 1e-5f /*------------------------------------------------------------------------------------------* * Static function declarations * - * Note (DLB): the local double precision functions defined below are replica of corresponding + * Note (DLB): the local float precision functions defined below are replica of corresponding * float functions defined in tools.c, lpc_tools.c and syn_filt.c. - * Double precision arithmetic is required for proper functioning of the lfe_plc. + * float precision arithmetic is required for proper functioning of the lfe_plc. *------------------------------------------------------------------------------------------*/ -static void mvr2d( - const float x[], /* i : input vector */ - double y[], /* o : output vector */ - const int16_t n /* i : vector size */ -) -{ - int16_t i; - - if ( n <= 0 ) - { - /* cannot transfer vectors with size 0 */ - return; - } - - for ( i = n - 1; i >= 0; i-- ) - { - y[i] = x[i]; - } - - return; -} - - -/*---------------------------------------------------------------------* - * autocorr() - * - * Compute autocorrelations of input signal - *---------------------------------------------------------------------*/ - -static void d_autocorr( - const double *x, /* i : input signal */ - double *r, /* o : autocorrelations vector */ - const int16_t m, /* i : order of LP filter */ - const int16_t len, /* i : window size */ - const double *wind, /* i : window */ - const int16_t rev_flag, /* i : flag to reverse window */ - const int16_t sym_flag, /* i : symmetric window flag */ - const int16_t no_thr /* i : flag to avoid thresholding */ -) -{ - double t[MAX_LEN_LP]; - double s; - int16_t i, j; - - /* Windowing of signal */ - if ( rev_flag == 1 ) - { - /* time reversed window */ - for ( i = 0; i < len; i++ ) - { - t[i] = x[i] * wind[len - i - 1]; - } - } - else if ( sym_flag == 1 ) - { - /* symmetric window of even length */ - for ( i = 0; i < len / 2; i++ ) - { - t[i] = x[i] * wind[i]; - } - - for ( ; i < len; i++ ) - { - t[i] = x[i] * wind[len - 1 - i]; - } - } - else /* assymetric window */ - { - for ( i = 0; i < len; i++ ) - { - t[i] = x[i] * wind[i]; - } - } - - /* Compute r[1] to r[m] */ - for ( i = 0; i <= m; i++ ) - { - s = t[0] * t[i]; - for ( j = 1; j < len - i; j++ ) - { - s += t[j] * t[i + j]; - } - r[i] = s; - } - - if ( r[0] < 100.0f && no_thr == 0 ) - { - r[0] = 100.0f; - } - - return; -} - - /*---------------------------------------------------------------------* * lev_dur() * @@ -169,21 +75,22 @@ static void d_autocorr( /*! r: energy of prediction error */ static int16_t d_lev_dur( - double *a, /* o : LP coefficients (a[0] = 1.0) */ - const double *r, /* i : vector of autocorrelations */ + 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 */ - double epsP[] /* o : prediction error energy */ + float epsP[] /* o : prediction error energy */ ) { int16_t i, j, l; - double buf[TCXLTP_LTP_ORDER]; - double *rc; /* reflection coefficients 0,...,m-1 */ - double s, at, err; + float buf[TCXLTP_LTP_ORDER]; + float *rc; /* reflection coefficients 0,...,m-1 */ + float s, at, err; int16_t flag = 0; + float a[LFE_PLC_LPCORD + 1] = {0.f}; rc = &buf[0]; rc[0] = ( -r[1] ) / r[0]; - a[0] = 1.0; + a[0] = 1.0f; a[1] = rc[0]; err = r[0] + r[1] * rc[0]; @@ -195,7 +102,7 @@ static int16_t d_lev_dur( for ( i = 2; i <= m; i++ ) { - s = 0.0; + s = 0.0f; for ( j = 0; j < i; j++ ) { s += r[i - j] * a[j]; @@ -205,6 +112,14 @@ static int16_t d_lev_dur( if ( fabs( rc[i - 1] ) > 0.99945f ) { flag = 1; /* Test for unstable filter. If unstable keep old A(z) */ + return flag; + } + else + { + for (j = 0; j < i; j++) + { + a_out[j] = a[j]; + } } for ( j = 1; j <= i / 2; j++ ) { @@ -239,14 +154,14 @@ static int16_t d_lev_dur( *-------------------------------------------------------------------*/ static uint16_t d_a2rc( - const double *a, /* i : LPC coefficients */ - double *refl, /* o : Reflection co-efficients */ + const float *a, /* i : LPC coefficients */ + float *refl, /* o : Reflection co-efficients */ const int16_t lpcorder /* i : LPC order */ ) { - double ff[LFE_PLC_LPCORD]; + float ff[LFE_PLC_LPCORD]; int16_t m, j, n; - double km, denom, x; + float km, denom, x; for ( m = 0; m < lpcorder; m++ ) { @@ -257,18 +172,18 @@ static uint16_t d_a2rc( for ( m = lpcorder - 1; m >= 0; m-- ) { km = ff[m]; - if ( km <= -1.0 || km >= 1.0 ) + if ( km <= -1.0f || km >= 1.0f ) { for ( j = 0; j < lpcorder; j++ ) { - refl[j] = 0.0; + refl[j] = 0.0f; } return 0; } refl[m] = -km; - denom = 1.0 / ( 1.0 - km * km ); + denom = 1.0f / ( 1.0f - km * km ); for ( j = 0; j < m / 2; j++ ) { n = m - 1 - j; @@ -286,50 +201,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 */ - const float x[], /* i : input signal */ - float y[], /* o : output signal */ - const int16_t l, /* i : size of filtering */ - const float mem[] /* i : initial filter states */ -) -{ - int16_t i, j; - double buf[LFE_PLC_LPCORD + LFE_PLC_RECLEN]; /* temporary synthesis buffer */ - double s, *yy; - - yy = &buf[0]; - - /*------------------------------------------------------------------* - * copy initial filter states into synthesis buffer and do synthesis - *------------------------------------------------------------------*/ - for ( i = 0; i < m; i++ ) - { - *yy++ = mem[i]; - } - - /*-----------------------------------------------------------------------* - * Do the filtering - *-----------------------------------------------------------------------*/ - - for ( i = 0; i < l; i++ ) - { - s = x[i]; - for ( j = 1; j <= m; j++ ) - { - s -= a[j] * yy[i - j]; - } - - yy[i] = s; - y[i] = (float) s; - } - - return; -} - - /*-----------------------------------------------------------------------------------------* * Function check_stab() * @@ -337,16 +208,16 @@ static void d_syn_filt( *-----------------------------------------------------------------------------------------*/ static uint16_t check_stab( - const double *a, - double delta ) + const float *a, + float delta ) { - double amod[LFE_PLC_LPCORD], refl[LFE_PLC_LPCORD]; + float amod[LFE_PLC_LPCORD], refl[LFE_PLC_LPCORD]; int16_t i; - double fac; - double fac1; + float fac; + float fac1; uint16_t stable; - fac = 1.0 + delta; + fac = 1.0f + delta; fac1 = fac; for ( i = 0; i < LFE_PLC_LPCORD; i++ ) @@ -366,16 +237,16 @@ static uint16_t check_stab( * Find maximum LPC filter sharpening by iteration to get a filter that is almost instable *-----------------------------------------------------------------------------------------*/ -static double find_max_delta( - double *a ) +static float find_max_delta( + float *a ) { - double delta; - double eps; + float delta; + float eps; uint16_t stable; - double fac; + float fac; - delta = 0.0; - eps = 0.01; + delta = 0.0f; + eps = 0.01f; fac = 2; stable = FALSE; @@ -385,7 +256,7 @@ static double find_max_delta( eps *= fac; stable = TRUE; } - fac = 0.5; + fac = 0.5f; if ( stable ) { @@ -440,16 +311,16 @@ static double find_max_delta( static void recover_samples( const int16_t bfi_count, - const float *outbuf, + float *outbuf, float *rec_frame ) { int16_t i; float zeroes[LFE_PLC_RECLEN]; - 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]; + float delta, fac, att; + float d_outbuf[LFE_PLC_BUFLEN], d_r[LFE_PLC_LPCORD + 1], d_a[LFE_PLC_LPCORD + 1] = {0.f}, d_pee[LFE_PLC_LPCORD + 1] = {0.f}; - 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 ); + mvr2r( outbuf, d_outbuf, LFE_PLC_BUFLEN ); + autocorr( d_outbuf, d_r, LFE_PLC_LPCORD, LFE_PLC_BUFLEN, d_hamm_lfe_plc, 0, 1, 1 ); if ( d_r[0] < POW_THR * LFE_PLC_BUFLEN ) { @@ -460,8 +331,8 @@ static void recover_samples( delta = find_max_delta( d_a + 1 ); - fac = 1.0 + delta; - att = 1.0; + fac = 1.0f + delta; + att = 1.0f; if ( bfi_count >= LFE_PLC_MUTE_THR ) { @@ -472,11 +343,11 @@ static void recover_samples( for ( i = 1; i <= LFE_PLC_LPCORD; i++ ) { d_a[i] = d_a[i] * fac; - fac *= att * ( 1.0 + delta ); + fac *= att * ( 1.0f + delta ); } set_zero( zeroes, LFE_PLC_RECLEN ); - d_syn_filt( d_a, LFE_PLC_LPCORD, zeroes, rec_frame, LFE_PLC_RECLEN, outbuf + LFE_PLC_BUFLEN - LFE_PLC_LPCORD ); + syn_filt( d_a, LFE_PLC_LPCORD, zeroes, rec_frame, LFE_PLC_RECLEN, outbuf + LFE_PLC_BUFLEN - LFE_PLC_LPCORD, 0 ); return; } @@ -490,7 +361,7 @@ static void recover_samples( void ivas_lfe_tdplc( LFE_DEC_HANDLE hLFE, /* i/o: LFE decoder handle */ - const float *prevsynth, /* i : previous frame synthesis */ + float *prevsynth, /* i : previous frame synthesis */ float *ytda, /* o : output time-domain buffer */ const int16_t output_frame /* i : output frame length */ ) -- GitLab From f5085133527e88c4f7cf784638bcdde6fa61578d Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Thu, 20 Jun 2024 12:00:22 +1000 Subject: [PATCH 02/61] code review cleanup --- lib_com/ivas_rom_com.c | 34 +++++++++++++++++----------------- lib_com/ivas_rom_com.h | 2 +- lib_dec/ivas_lfe_plc.c | 23 +++++++++++------------ 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 51e5643774..7ca8d97ab9 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -3124,23 +3124,23 @@ 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 }; -const float d_hamm_lfe_plc[LFE_PLC_LENANA / 2] = -{ - 0.08000000000000002, 0.08015895227847719, 0.08063569926248770, 0.08142991147368656, 0.08254104003450596, 0.08396831704748331, 0.08571075612595230, 0.08776715307573196, - 0.09013608672734141, 0.09281591991816535, 0.09580480062389246, 0.09910066323844335, 0.10270123000150438, 0.10660401257268071, 0.11080631375118072, 0.11530522933984272, - 0.12009765015221685, 0.12518026416131367, 0.13054955878853602, 0.13620182333121073, 0.14213315152704381, 0.14833944425372619, 0.15481641236182375, 0.16155957963899570, - 0.16856428590349043, 0.17582569022478273, 0.18333877426912554, 0.19109834576770490, 0.19909904210500018, 0.20733533402487142, 0.21580152945181053, 0.22449177742471671, - 0.23340007214047787, 0.24252025710456171, 0.25184602938575001, 0.26137094397207467, 0.27108841822494550, 0.28099173642839037, 0.29107405443026624, 0.30132840437223085, - 0.31174769950520753, 0.32232473908701620, 0.33305221335878232, 0.34392270859668939, 0.35492871223557998, 0.36606261806086549, 0.37731673146515798, 0.38868327476598852, - 0.40015439258093899, 0.41172215725647360, 0.42337857434671339, 0.43511558813837425, 0.44692508721804453, 0.45879891007795709, 0.47072885075638249, 0.48270666450874267, - 0.49472407350552849, 0.50677277255308162, 0.51884443483328757, 0.53093071765821398, 0.54302326823571601, 0.55511372944202464, 0.56719374559732838, 0.57925496824035816, - 0.59128906189798180, 0.60328770984582458, 0.61524261985593010, 0.62714552992749328, 0.63898821399670414, 0.65076248762175315, 0.66246021363907504, 0.67407330778691554, - 0.68559374429233988, 0.69701356141781945, 0.70832486696356345, 0.71951984372179334, 0.73059075487919101, 0.74152994936378558, 0.75232986713258543, 0.76298304439630038, - 0.77348211877754336, 0.78381983439894576, 0.79398904689767136, 0.80398272836286389, 0.81379397219261318, 0.82341599786708708, 0.83284215563452701, 0.84206593110687011, - 0.85108094976182280, 0.85988098134827329, 0.86845994419199846, 0.87681190939868969, 0.88493110495139349, 0.89281191969953333, 0.90044890723675941, 0.90783678966494241, - 0.91497046124171255, 0.92184499190902180, 0.92845563070029180, 0.93479780902379184, 0.94086714381997805, 0.94665944059061280, 0.95217069629756890, 0.95739710212931617, - 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 +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 }; diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index fc2d3133d8..9b03ebc4b6 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -359,7 +359,7 @@ 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]; -extern const float d_hamm_lfe_plc[LFE_PLC_LENANA / 2]; +extern const float hamm_lfe_plc[LFE_PLC_LENANA / 2]; 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_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index 7b57e5e70d..7d271534f4 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -74,7 +74,7 @@ *---------------------------------------------------------------------*/ /*! r: energy of prediction error */ -static int16_t d_lev_dur( +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 */ @@ -116,7 +116,7 @@ static int16_t d_lev_dur( } else { - for (j = 0; j < i; j++) + for (j = 0; j <= m; j++) { a_out[j] = a[j]; } @@ -153,7 +153,7 @@ static int16_t d_lev_dur( * Convert from LPC to reflection coeff *-------------------------------------------------------------------*/ -static uint16_t d_a2rc( +static uint16_t lfeplc_a2rc( const float *a, /* i : LPC coefficients */ float *refl, /* o : Reflection co-efficients */ const int16_t lpcorder /* i : LPC order */ @@ -225,7 +225,7 @@ static uint16_t check_stab( amod[i] = a[i] * fac; fac *= fac1; } - stable = d_a2rc( amod, refl, LFE_PLC_LPCORD ); + stable = lfeplc_a2rc( amod, refl, LFE_PLC_LPCORD ); return stable; } @@ -317,19 +317,18 @@ static void recover_samples( int16_t i; float zeroes[LFE_PLC_RECLEN]; float delta, fac, att; - float d_outbuf[LFE_PLC_BUFLEN], d_r[LFE_PLC_LPCORD + 1], d_a[LFE_PLC_LPCORD + 1] = {0.f}, d_pee[LFE_PLC_LPCORD + 1] = {0.f}; + float r[LFE_PLC_LPCORD + 1], a[LFE_PLC_LPCORD + 1], pee[LFE_PLC_LPCORD + 1]; - mvr2r( outbuf, d_outbuf, LFE_PLC_BUFLEN ); - autocorr( d_outbuf, d_r, LFE_PLC_LPCORD, LFE_PLC_BUFLEN, d_hamm_lfe_plc, 0, 1, 1 ); + autocorr(outbuf, r, LFE_PLC_LPCORD, LFE_PLC_BUFLEN, hamm_lfe_plc, 0, 1, 1 ); - if ( d_r[0] < POW_THR * LFE_PLC_BUFLEN ) + if ( r[0] < POW_THR * LFE_PLC_BUFLEN ) { set_zero( rec_frame, LFE_PLC_RECLEN ); return; } - d_lev_dur( d_a, d_r, LFE_PLC_LPCORD, d_pee ); + lfeplc_lev_dur( a, r, LFE_PLC_LPCORD, pee ); - delta = find_max_delta( d_a + 1 ); + delta = find_max_delta( a + 1 ); fac = 1.0f + delta; att = 1.0f; @@ -342,12 +341,12 @@ static void recover_samples( for ( i = 1; i <= LFE_PLC_LPCORD; i++ ) { - d_a[i] = d_a[i] * fac; + a[i] = a[i] * fac; fac *= att * ( 1.0f + delta ); } set_zero( zeroes, LFE_PLC_RECLEN ); - syn_filt( d_a, LFE_PLC_LPCORD, zeroes, rec_frame, LFE_PLC_RECLEN, outbuf + LFE_PLC_BUFLEN - LFE_PLC_LPCORD, 0 ); + syn_filt( a, LFE_PLC_LPCORD, zeroes, rec_frame, LFE_PLC_RECLEN, outbuf + LFE_PLC_BUFLEN - LFE_PLC_LPCORD, 0 ); return; } -- GitLab From bedf96372f5f1743cf6690916f104415a63ff2cc Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac Date: Mon, 24 Jun 2024 10:07:32 +0200 Subject: [PATCH 03/61] Add switch --- lib_com/options.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 8e314ba4f1..015294ed2e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,6 +164,8 @@ #define FIX_1099_JBM_MD_HANDLE_ALLOC /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */ #define FIX_1111_TDM_LSP_BUFFER /* VA: issue 1111: remove unused buffer `tdm_lspQ_PCh[]' */ #define FIX_1101_CLEANING_JBM_CALL /* VA: issue 1101: remove obsolete call of ivas_jbm_dec_tc_buffer_open() */ +#define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ + /* #################### End BE switches ################################## */ -- GitLab From 949b5630b55f594a27febcf8c78465fdad0e0040 Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac Date: Mon, 24 Jun 2024 17:13:22 +0200 Subject: [PATCH 04/61] Switch off reverb and modify crend --- lib_rend/ivas_crend.c | 2 ++ lib_rend/lib_rend.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index bd9fa49571..d3c3c7f693 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1906,6 +1906,7 @@ ivas_error ivas_rend_crendProcessSubframe( return error; } +#ifndef FIX_1129_EXT_REND_OUTPUT_HIGH if ( pCrend->hCrend[0]->hReverb != NULL ) { if ( ( error = ivas_reverb_process( pCrend->hCrend[pos_idx]->hReverb, inConfig, 1, tc_local, p_pcm_tmp, 0 ) ) != IVAS_ERR_OK ) @@ -1913,6 +1914,7 @@ ivas_error ivas_rend_crendProcessSubframe( return error; } } +#endif for ( ch = 0; ch < nchan_in; ch++ ) { diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 6e3257b6c8..6758109466 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2552,7 +2552,11 @@ static ivas_error updateSbaPanGains( return error; } +#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH + if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -6755,11 +6759,19 @@ static ivas_error renderInputSba( case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: error = renderSbaToSplitBinaural( sbaInput, outConfig, outAudio ); break; +#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH + case IVAS_AUDIO_CONFIG_BINAURAL: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + error = renderSbaToBinaural( sbaInput, outConfig, outAudio ); + break; + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: +#else case IVAS_AUDIO_CONFIG_BINAURAL: error = renderSbaToBinaural( sbaInput, outConfig, outAudio ); break; case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: +#endif error = renderSbaToBinauralRoom( sbaInput, outConfig, outAudio ); break; default: -- GitLab From cc42669c68afae8e84d10bcf22aa4bce77901277 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Thu, 27 Jun 2024 11:59:45 +1000 Subject: [PATCH 05/61] fix infinite loop --- lib_dec/ivas_lfe_plc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index 7d271534f4..e4bbe578d7 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -40,6 +40,7 @@ #include "debug.h" #endif #include "wmc_auto.h" +#include "string.h" /*------------------------------------------------------------------------------------------* * Local constants @@ -94,6 +95,8 @@ static int16_t lfeplc_lev_dur( a[1] = rc[0]; err = r[0] + r[1] * rc[0]; + memcpy(a_out, a, sizeof(a)); + if ( epsP != NULL ) { epsP[0] = r[0]; @@ -318,7 +321,6 @@ static void recover_samples( float zeroes[LFE_PLC_RECLEN]; float delta, fac, att; float r[LFE_PLC_LPCORD + 1], a[LFE_PLC_LPCORD + 1], pee[LFE_PLC_LPCORD + 1]; - autocorr(outbuf, r, LFE_PLC_LPCORD, LFE_PLC_BUFLEN, hamm_lfe_plc, 0, 1, 1 ); if ( r[0] < POW_THR * LFE_PLC_BUFLEN ) -- GitLab From 394806a55cbf075f879274fc7d5861b4d35a4705 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Fri, 5 Jul 2024 15:51:19 +0200 Subject: [PATCH 06/61] Fix for intermediate rendering format in case of binaural room reverb output --- lib_rend/ivas_crend.c | 2 -- lib_rend/lib_rend.c | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index d3c3c7f693..bd9fa49571 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1906,7 +1906,6 @@ ivas_error ivas_rend_crendProcessSubframe( return error; } -#ifndef FIX_1129_EXT_REND_OUTPUT_HIGH if ( pCrend->hCrend[0]->hReverb != NULL ) { if ( ( error = ivas_reverb_process( pCrend->hCrend[pos_idx]->hReverb, inConfig, 1, tc_local, p_pcm_tmp, 0 ) ) != IVAS_ERR_OK ) @@ -1914,7 +1913,6 @@ ivas_error ivas_rend_crendProcessSubframe( return error; } } -#endif for ( ch = 0; ch < nchan_in; ch++ ) { diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 6758109466..4a383ee54d 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2530,6 +2530,9 @@ static ivas_error updateSbaPanGains( break; } case IVAS_AUDIO_CONFIG_BINAURAL: +#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: +#endif if ( hRendCfg->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) { if ( ( error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, &rendCtx.pSplitRendWrapper->multiBinPoseData, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) @@ -2546,17 +2549,15 @@ static ivas_error updateSbaPanGains( } break; case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: +#ifndef FIX_1129_EXT_REND_OUTPUT_HIGH case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: +#endif if ( ( error = initSbaPanGainsForMcOut( inputSba, IVAS_AUDIO_CONFIG_7_1_4, NULL ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif { return error; } -- GitLab From c1bdb556ab4a21f4c01555718e67296f05308f96 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Mon, 8 Jul 2024 16:34:26 +0200 Subject: [PATCH 07/61] Additional cleanup --- lib_rend/lib_rend.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 4a383ee54d..52ba461c20 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -947,7 +947,11 @@ static ivas_error initEfap( const float *elevations; int16_t numNonLfeChannels; +#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) +#else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#endif { pEfapWrapper->speakerConfig = IVAS_AUDIO_CONFIG_7_1_4; } @@ -1999,9 +2003,14 @@ static ivas_error updateMcPanGains( case IVAS_AUDIO_CONFIG_BINAURAL: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: +#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: +#endif break; /* Do nothing */ case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: +#ifndef FIX_1129_EXT_REND_OUTPUT_HIGH case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: +#endif /* Prepare rendering to intermediate format */ error = updateMcPanGainsForMcOut( inputMc, IVAS_AUDIO_CONFIG_7_1_4 ); break; @@ -6273,10 +6282,15 @@ static ivas_error renderInputMc( switch ( outConfig ) { case IVAS_AUDIO_CONFIG_BINAURAL: +#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: +#endif error = renderMcToBinaural( mcInput, outConfig, outAudio ); break; case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: +#ifndef FIX_1129_EXT_REND_OUTPUT_HIGH case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: +#endif if ( mcInput->base.inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { error = renderMcCustomLsToBinauralRoom( mcInput, outConfig, outAudio ); -- GitLab From 36f7240f6e786b0b252a668b8358e2c98fb906ee Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Mon, 8 Jul 2024 16:48:27 +0200 Subject: [PATCH 08/61] Reverting previous change --- lib_rend/lib_rend.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 52ba461c20..49e8621c40 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -947,11 +947,7 @@ static ivas_error initEfap( const float *elevations; int16_t numNonLfeChannels; -#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) -#else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif { pEfapWrapper->speakerConfig = IVAS_AUDIO_CONFIG_7_1_4; } @@ -2003,14 +1999,8 @@ static ivas_error updateMcPanGains( case IVAS_AUDIO_CONFIG_BINAURAL: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: -#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH - case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: -#endif break; /* Do nothing */ case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: -#ifndef FIX_1129_EXT_REND_OUTPUT_HIGH - case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: -#endif /* Prepare rendering to intermediate format */ error = updateMcPanGainsForMcOut( inputMc, IVAS_AUDIO_CONFIG_7_1_4 ); break; @@ -6282,15 +6272,9 @@ static ivas_error renderInputMc( switch ( outConfig ) { case IVAS_AUDIO_CONFIG_BINAURAL: -#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH - case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: -#endif error = renderMcToBinaural( mcInput, outConfig, outAudio ); break; case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: -#ifndef FIX_1129_EXT_REND_OUTPUT_HIGH - case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: -#endif if ( mcInput->base.inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { error = renderMcCustomLsToBinauralRoom( mcInput, outConfig, outAudio ); -- GitLab From 9c96307d3b43ebafd4913392bcc26939fa3fcc6b Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Tue, 9 Jul 2024 13:49:03 +0200 Subject: [PATCH 09/61] Rendering via 7.1+4 only in case of BINAURAL_ROOM_IR mode --- lib_rend/lib_rend.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 49e8621c40..4a383ee54d 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2001,6 +2001,7 @@ static ivas_error updateMcPanGains( case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: break; /* Do nothing */ case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: /* Prepare rendering to intermediate format */ error = updateMcPanGainsForMcOut( inputMc, IVAS_AUDIO_CONFIG_7_1_4 ); break; @@ -6275,6 +6276,7 @@ static ivas_error renderInputMc( error = renderMcToBinaural( mcInput, outConfig, outAudio ); break; case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: if ( mcInput->base.inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { error = renderMcCustomLsToBinauralRoom( mcInput, outConfig, outAudio ); -- GitLab From d1ea23bf80aa71f9d77cac01b0497027cba5f203 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Mon, 15 Jul 2024 17:26:25 +1000 Subject: [PATCH 10/61] further code cleanup --- lib_dec/ivas_lfe_plc.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index e4bbe578d7..e407042075 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -96,6 +96,7 @@ static int16_t lfeplc_lev_dur( err = r[0] + r[1] * rc[0]; memcpy(a_out, a, sizeof(a)); + memset(epsP, 0, sizeof(*epsP) * LFE_PLC_LPCORD); if ( epsP != NULL ) { @@ -112,7 +113,7 @@ static int16_t lfeplc_lev_dur( } rc[i - 1] = ( -s ) / err; - if ( fabs( rc[i - 1] ) > 0.99945f ) + if ( fabsf( rc[i - 1] ) > 0.99945f ) { flag = 1; /* Test for unstable filter. If unstable keep old A(z) */ return flag; @@ -283,22 +284,22 @@ static float find_max_delta( if ( !stable ) { - if ( fabs( eps ) > EPS_STOP ) + if ( fabsf( eps ) > EPS_STOP ) { - eps = -fabs( eps ) * fac; + eps = -fabsf( eps ) * fac; } else { - eps = -fabs( eps ); + eps = -fabsf( eps ); } } else { - if ( fabs( eps ) < EPS_STOP ) + if ( fabsf( eps ) < EPS_STOP ) { break; } - eps = fabs( eps ) * fac; + eps = fabsf( eps ) * fac; } } @@ -341,11 +342,20 @@ static void recover_samples( fac *= att; } + printf("LPC filter coefs: %.10f", a[0]); for ( i = 1; i <= LFE_PLC_LPCORD; i++ ) { a[i] = a[i] * fac; fac *= att * ( 1.0f + delta ); + printf(", %.10f", a[i]); } + printf("\n"); + printf("Pred erros: %.10f", pee[0]); + for ( i = 1; i <= LFE_PLC_LPCORD; i++ ) + { + printf(", %.10f", pee[i]); + } + printf("\n"); set_zero( zeroes, LFE_PLC_RECLEN ); syn_filt( a, LFE_PLC_LPCORD, zeroes, rec_frame, LFE_PLC_RECLEN, outbuf + LFE_PLC_BUFLEN - LFE_PLC_LPCORD, 0 ); -- GitLab From 1f4a2099fae2edee07ce4020c0db377955e03e06 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 15 Jul 2024 17:56:33 +0200 Subject: [PATCH 11/61] FIX_1135_EXT_RENDERER_HANDLES --- apps/renderer.c | 26 +++++++++ lib_com/options.h | 1 + lib_dec/ivas_stat_dec.h | 2 +- lib_dec/lib_dec.c | 2 + lib_rend/lib_rend.c | 126 +++++++++++++++++++++++++++++++++++----- lib_rend/lib_rend.h | 4 ++ 6 files changed, 146 insertions(+), 15 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index cf97acf947..4f76ccb800 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -169,6 +169,10 @@ typedef struct char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; int8_t orientation_tracking; +#ifdef FIX_1135_EXT_RENDERER_HANDLES + int16_t Opt_Headrotation; + int16_t Opt_ExternalOrientation; +#endif int16_t nonDiegeticPan; float nonDiegeticPanGain; IVAS_REND_COMPLEXITY_LEVEL complexityLevel; @@ -882,7 +886,11 @@ int main( const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) ); +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, args.Opt_Headrotation, args.Opt_ExternalOrientation, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) ); exit( -1 ); @@ -2510,7 +2518,12 @@ static CmdlnArgs defaultArgs( clearString( args.renderConfigFilePath ); clearString( args.externalOrientationFilePath ); +#ifdef FIX_1135_EXT_RENDERER_HANDLES + args.Opt_Headrotation = 0; + args.Opt_ExternalOrientation = 0; +#endif args.orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE; + args.nonDiegeticPan = 0; args.nonDiegeticPanGain = 0.f; @@ -2598,6 +2611,9 @@ static void parseOption( break; case CmdLnOptionId_trajFile: assert( numOptionValues == 1 ); +#ifdef FIX_1135_EXT_RENDERER_HANDLES + args->Opt_Headrotation = 1; +#endif strncpy( args->headRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; case CmdLnOptionId_outputMetadata: @@ -2618,6 +2634,9 @@ static void parseOption( break; case CmdLnOptionId_exteriorOrientationFile: assert( numOptionValues == 1 ); +#ifdef FIX_1135_EXT_RENDERER_HANDLES + args->Opt_ExternalOrientation = 1; +#endif strncpy( args->externalOrientationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; case CmdLnOptionId_customHrtfFile: @@ -2742,6 +2761,13 @@ static CmdlnArgs parseCmdlnArgs( exit( -1 ); /* Error printout handled by failing function */ } +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + args.Opt_Headrotation = TRUE; + } +#endif + return args; } diff --git a/lib_com/options.h b/lib_com/options.h index 8d9fa9a11f..b16a8e83ff 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -162,6 +162,7 @@ //#define FIX_CREND_FIX_POINT_HRTF_FILE_FORMAT /* Orange issue 1031 : new fix point hrtf binary file format */ //#define FIX_CREND_SIMPLIFY_CODE /* Ora : simplify line code in crend */ #define FLOAT_FIX_POINT_HRTF_FILE_FORMAT /* allows reading floation or fix point hrtf binary file format */ +#define FIX_1135_EXT_RENDERER_HANDLES /* VA: issue 1135: Memory usage reduction in external renderer: Allocate only handles that are really needed. */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 8f096dd705..3660868f27 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -990,7 +990,7 @@ typedef struct decoder_config_structure int16_t Opt_non_diegetic_pan; /* indicates diegetic or not */ float non_diegetic_pan_gain; /* non diegetic panning gain*/ int16_t Opt_AMR_WB; /* flag indicating AMR-WB IO mode */ - int16_t Opt_ExternalOrientation; /* indiates whether external orientations are used */ + int16_t Opt_ExternalOrientation; /* indicates whether external orientations are used */ int16_t Opt_dpid_on; /* indicates whether Directivity pattern option is used */ int16_t Opt_aeid_on; /* indicates whether Acoustic environment option is used */ #ifdef DEBUGGING diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index c5654bd8ad..9ef281f1bd 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -489,11 +489,13 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->render_framesize = renderFramesize; } +#ifndef FIX_1135_EXT_RENDERER_HANDLES if ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { hDecoderConfig->Opt_Headrotation = TRUE; } +#endif /* Set decoder parameters to initial values */ if ( ( error = ivas_init_decoder_front( st_ivas ) ) != IVAS_ERR_OK ) { diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 6e3257b6c8..0ed0194088 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -204,7 +204,11 @@ struct IVAS_REND AUDIO_CONFIG outputConfig; EFAP_WRAPPER efapOutWrapper; IVAS_LSSETUP_CUSTOM_STRUCT customLsOut; +#ifdef FIX_1135_EXT_RENDERER_HANDLES + SPLIT_REND_WRAPPER *splitRendWrapper; +#else SPLIT_REND_WRAPPER splitRendWrapper; +#endif IVAS_REND_AudioBuffer splitRendEncBuffer; IVAS_REND_HeadRotData headRotData; @@ -1218,7 +1222,11 @@ static rendering_context getRendCtx( ctx.pHeadRotData = &hIvasRend->headRotData; ctx.hhRendererConfig = &hIvasRend->hRendererConfig; ctx.pSplitRendBFI = &hIvasRend->splitRendBFI; +#ifdef FIX_1135_EXT_RENDERER_HANDLES + ctx.pSplitRendWrapper = hIvasRend->splitRendWrapper; +#else ctx.pSplitRendWrapper = &hIvasRend->splitRendWrapper; +#endif ctx.pCombinedOrientationData = &hIvasRend->hCombinedOrientationData; return ctx; @@ -2754,13 +2762,18 @@ static void clearInputMasa( *------------------------------------------------------------------------*/ ivas_error IVAS_REND_Open( - IVAS_REND_HANDLE *phIvasRend, - const int32_t outputSampleRate, - const AUDIO_CONFIG outConfig, - const bool asHrtfBinary, - const int16_t nonDiegeticPan, - const float nonDiegeticPanGain, - const int16_t num_subframes ) + IVAS_REND_HANDLE *phIvasRend, /* i/o: Pointer to renderer handle */ + const int32_t outputSampleRate, /* i : output sampling rate */ + const IVAS_AUDIO_CONFIG outConfig, /* i : output audio config */ + const bool asHrtfBinary, /* i : load hrtf binary file */ + const int16_t nonDiegeticPan, /* i : non-diegetic object flag */ + const float nonDiegeticPanGain, /* i : non-diegetic panning gain */ +#ifdef FIX_1135_EXT_RENDERER_HANDLES + const int16_t Opt_Headrotation, /* i : indicates whether head-rotation is used */ + const int16_t Opt_ExternalOrientation, /* i : indicates whether external orientations are used */ +#endif + const int16_t num_subframes /* i : number of subframes */ +) { int16_t i; int16_t j; @@ -2814,22 +2827,46 @@ ivas_error IVAS_REND_Open( } /* Initialize headrotation data */ - if ( ( error = initHeadRotation( hIvasRend ) ) != IVAS_ERR_OK ) +#ifdef FIX_1135_EXT_RENDERER_HANDLES + hIvasRend->headRotData.headRotEnabled = 0; + if ( Opt_Headrotation ) { - return error; +#endif + if ( ( error = initHeadRotation( hIvasRend ) ) != IVAS_ERR_OK ) + { + return error; + } +#ifdef FIX_1135_EXT_RENDERER_HANDLES } +#endif /* Initialize external orientation data */ - if ( ( error = ivas_external_orientation_open( &( hIvasRend->hExternalOrientationData ), num_subframes ) ) != IVAS_ERR_OK ) +#ifdef FIX_1135_EXT_RENDERER_HANDLES + hIvasRend->hExternalOrientationData = NULL; + if ( Opt_ExternalOrientation ) { - return error; +#endif + if ( ( error = ivas_external_orientation_open( &( hIvasRend->hExternalOrientationData ), num_subframes ) ) != IVAS_ERR_OK ) + { + return error; + } +#ifdef FIX_1135_EXT_RENDERER_HANDLES } +#endif /* Initilize combined orientation data */ - if ( ( error = ivas_combined_orientation_open( &( hIvasRend->hCombinedOrientationData ), outputSampleRate, num_subframes ) ) != IVAS_ERR_OK ) +#ifdef FIX_1135_EXT_RENDERER_HANDLESaa + hIvasRend->hCombinedOrientationData = NULL; + if ( Opt_Headrotation || Opt_ExternalOrientation ) { - return error; +#endif + if ( ( error = ivas_combined_orientation_open( &( hIvasRend->hCombinedOrientationData ), outputSampleRate, num_subframes ) ) != IVAS_ERR_OK ) + { + return error; + } +#ifdef FIX_1135_EXT_RENDERER_HANDLESaa } +#endif /* Initialize EFAP */ if ( ( error = initEfap( &hIvasRend->efapOutWrapper, outConfig, &hIvasRend->customLsOut ) ) != IVAS_ERR_OK ) @@ -2838,9 +2875,28 @@ ivas_error IVAS_REND_Open( } /* Initialize inputs */ + +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + if ( ( hIvasRend->splitRendWrapper = (SPLIT_REND_WRAPPER *) malloc( sizeof( SPLIT_REND_WRAPPER ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for IVAS decoder handle" ); + } + + isar_init_split_rend_handles( hIvasRend->splitRendWrapper ); + hIvasRend->splitRendEncBuffer.data = NULL; + } + else + { + hIvasRend->splitRendWrapper = NULL; + } +#else isar_init_split_rend_handles( &hIvasRend->splitRendWrapper ); hIvasRend->splitRendEncBuffer.data = NULL; +#endif + for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { initRendInputBase( &hIvasRend->inputsIsm[i].base, IVAS_AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); @@ -3445,7 +3501,11 @@ ivas_error IVAS_REND_AddInput( int16_t cldfb_in_flag; cldfb_in_flag = getCldfbRendFlag( hIvasRend, getAudioConfigType( inConfig ) ); +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( ( error = ivas_pre_rend_init( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_pre_rend_init( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -3863,7 +3923,11 @@ ivas_error IVAS_REND_GetDelay( { if ( hIvasRend->inputsSba[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( hIvasRend->splitRendWrapper->hBinHrSplitPreRend != NULL ) +#else if ( hIvasRend->splitRendWrapper.hBinHrSplitPreRend != NULL ) +#endif { if ( hIvasRend->hRendererConfig->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) { @@ -4362,9 +4426,17 @@ int16_t IVAS_REND_FeedRenderConfig( { int16_t cldfb_in_flag; cldfb_in_flag = getCldfbRendFlag( hIvasRend, IVAS_REND_AUDIO_CONFIG_TYPE_UNKNOWN ); +#ifdef FIX_1135_EXT_RENDERER_HANDLES + ISAR_PRE_REND_close( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); +#else ISAR_PRE_REND_close( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); +#endif +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( ( error = ivas_pre_rend_init( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_pre_rend_init( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -4521,6 +4593,13 @@ ivas_error IVAS_REND_SetOrientationTrackingMode( const IVAS_HEAD_ORIENT_TRK_T orientation_tracking /* i : Head orientation tracking type */ ) { +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( hIvasRend->headRotData.headRotEnabled == 0 ) + { + return IVAS_HEAD_ORIENT_TRK_NONE; + } +#endif + return ivas_orient_trk_SetTrackingType( hIvasRend->headRotData.hOrientationTracker, orientation_tracking ); } @@ -7371,10 +7450,19 @@ static ivas_error getSamplesInternal( ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { int16_t num_poses_orig; +#ifdef FIX_1135_EXT_RENDERER_HANDLES + num_poses_orig = hIvasRend->splitRendWrapper->multiBinPoseData.num_poses; +#else num_poses_orig = hIvasRend->splitRendWrapper.multiBinPoseData.num_poses; +#endif outAudio = hIvasRend->splitRendEncBuffer; +#ifdef FIX_1135_EXT_RENDERER_HANDLES + ISAR_PRE_REND_GetMultiBinPoseData( &hIvasRend->hRendererConfig->split_rend_config, &hIvasRend->splitRendWrapper->multiBinPoseData, hIvasRend->headRotData.sr_pose_pred_axis ); + assert( num_poses_orig == hIvasRend->splitRendWrapper->multiBinPoseData.num_poses && "number of poses should not change dynamically" ); +#else ISAR_PRE_REND_GetMultiBinPoseData( &hIvasRend->hRendererConfig->split_rend_config, &hIvasRend->splitRendWrapper.multiBinPoseData, hIvasRend->headRotData.sr_pose_pred_axis ); assert( num_poses_orig == hIvasRend->splitRendWrapper.multiBinPoseData.num_poses && "number of poses should not change dynamically" ); +#endif /* Clear output buffer for split rendering bitstream */ set_zero( outAudio.data, outAudio.config.numChannels * outAudio.config.numSamplesPerChannel ); @@ -7439,7 +7527,11 @@ static ivas_error getSamplesInternal( } } +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( hIvasRend->splitRendWrapper, +#else if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( &hIvasRend->splitRendWrapper, +#endif hIvasRend->headRotData.headPositions[0], hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate, hIvasRend->hRendererConfig->split_rend_config.codec, @@ -7448,7 +7540,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, @@ -7611,7 +7703,13 @@ void IVAS_REND_Close( ivas_limiter_close( &hIvasRend->hLimiter ); /* Split binaural rendering */ +#ifdef FIX_1135_EXT_RENDERER_HANDLES + ISAR_PRE_REND_close( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); + free( hIvasRend->splitRendWrapper ); + hIvasRend->splitRendWrapper = NULL; +#else ISAR_PRE_REND_close( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); +#endif closeHeadRotation( hIvasRend ); diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 5cd2b07f61..94ff3ff3da 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -113,6 +113,10 @@ ivas_error IVAS_REND_Open( const bool asHrtfBinary, /* i : load hrtf binary file */ const int16_t nonDiegeticPan, /* i : non-diegetic object flag */ const float nonDiegeticPanGain, /* i : non-diegetic panning gain */ +#ifdef FIX_1135_EXT_RENDERER_HANDLES + const int16_t Opt_Headrotation, /* i : indicates whether head-rotation is used */ + const int16_t Opt_ExternalOrientation, /* i : indicates whether external orientations are used */ +#endif const int16_t num_subframes /* i : number of subframes */ ); -- GitLab From 274445b535237db44dd1826a889b0c02655720c9 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 15 Jul 2024 18:05:27 +0200 Subject: [PATCH 12/61] build fix --- apps/renderer.c | 2 +- lib_rend/lib_rend.c | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 4f76ccb800..e734aeb8ab 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -2764,7 +2764,7 @@ static CmdlnArgs parseCmdlnArgs( #ifdef FIX_1135_EXT_RENDERER_HANDLES if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { - args.Opt_Headrotation = TRUE; + args.Opt_Headrotation = 1; } #endif diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 0ed0194088..5b1b547eeb 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2855,7 +2855,7 @@ ivas_error IVAS_REND_Open( #endif /* Initilize combined orientation data */ -#ifdef FIX_1135_EXT_RENDERER_HANDLESaa +#ifdef FIX_1135_EXT_RENDERER_HANDLES hIvasRend->hCombinedOrientationData = NULL; if ( Opt_Headrotation || Opt_ExternalOrientation ) { @@ -2864,7 +2864,7 @@ ivas_error IVAS_REND_Open( { return error; } -#ifdef FIX_1135_EXT_RENDERER_HANDLESaa +#ifdef FIX_1135_EXT_RENDERER_HANDLES } #endif @@ -2877,6 +2877,7 @@ ivas_error IVAS_REND_Open( /* Initialize inputs */ #ifdef FIX_1135_EXT_RENDERER_HANDLES + hIvasRend->splitRendWrapper = NULL; if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( ( hIvasRend->splitRendWrapper = (SPLIT_REND_WRAPPER *) malloc( sizeof( SPLIT_REND_WRAPPER ) ) ) == NULL ) @@ -2887,14 +2888,9 @@ ivas_error IVAS_REND_Open( isar_init_split_rend_handles( hIvasRend->splitRendWrapper ); hIvasRend->splitRendEncBuffer.data = NULL; } - else - { - hIvasRend->splitRendWrapper = NULL; - } #else isar_init_split_rend_handles( &hIvasRend->splitRendWrapper ); hIvasRend->splitRendEncBuffer.data = NULL; - #endif for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) @@ -4596,7 +4592,7 @@ ivas_error IVAS_REND_SetOrientationTrackingMode( #ifdef FIX_1135_EXT_RENDERER_HANDLES if ( hIvasRend->headRotData.headRotEnabled == 0 ) { - return IVAS_HEAD_ORIENT_TRK_NONE; + return IVAS_ERR_OK; } #endif @@ -7540,7 +7536,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + ( const int16_t ) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, -- GitLab From 403e6da0ae7c40aacd8c8e8712c75d3b45cca3b6 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 15 Jul 2024 18:26:50 +0200 Subject: [PATCH 13/61] fix memory deallocation --- lib_rend/lib_rend.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 5b1b547eeb..bc4a944e91 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1113,7 +1113,11 @@ static ivas_error initHeadRotation( static void closeHeadRotation( IVAS_REND_HANDLE hIvasRend ) { +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( hIvasRend != NULL && hIvasRend->headRotData.headRotEnabled && hIvasRend->headRotData.hOrientationTracker != NULL ) +#else if ( ( hIvasRend != NULL ) && ( hIvasRend->headRotData.hOrientationTracker != NULL ) ) +#endif { free( hIvasRend->headRotData.hOrientationTracker ); } @@ -1399,7 +1403,11 @@ static void clearInputIsm( initRendInputBase( &inputIsm->base, IVAS_AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); /* Free input's internal handles */ +#ifdef FIX_1135_EXT_RENDERER_HANDLES + ivas_rend_closeCrend( &inputIsm->crendWrapper, inputIsm->base.ctx.pSplitRendWrapper != NULL ? inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); +#else ivas_rend_closeCrend( &inputIsm->crendWrapper, inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); +#endif ivas_reverb_close( &inputIsm->hReverb ); @@ -2374,7 +2382,11 @@ static void clearInputMc( efap_free_data( &inputMc->efapInWrapper.hEfap ); } +#ifdef FIX_1135_EXT_RENDERER_HANDLES + ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper != NULL ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); +#else ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); +#endif ivas_reverb_close( &inputMc->hReverb ); @@ -2670,7 +2682,11 @@ static void clearInputSba( initRendInputBase( &inputSba->base, IVAS_AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); /* Free input's internal handles */ +#ifdef FIX_1135_EXT_RENDERER_HANDLES + ivas_rend_closeCrend( &inputSba->crendWrapper, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); +#else ivas_rend_closeCrend( &inputSba->crendWrapper, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ); +#endif if ( inputSba->cldfbRendWrapper.hCldfbRend != NULL ) { @@ -7536,7 +7552,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - ( const int16_t ) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, @@ -7700,9 +7716,12 @@ void IVAS_REND_Close( /* Split binaural rendering */ #ifdef FIX_1135_EXT_RENDERER_HANDLES - ISAR_PRE_REND_close( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); - free( hIvasRend->splitRendWrapper ); - hIvasRend->splitRendWrapper = NULL; + if ( hIvasRend->splitRendWrapper != NULL ) + { + ISAR_PRE_REND_close( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); + free( hIvasRend->splitRendWrapper ); + hIvasRend->splitRendWrapper = NULL; + } #else ISAR_PRE_REND_close( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); #endif -- GitLab From f01f6b87ba436e1e3a242ef2256a7d934fcfffe0 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 15 Jul 2024 19:20:50 +0200 Subject: [PATCH 14/61] fix smoke test failures --- lib_rend/lib_rend.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index bc4a944e91..f04cfd8674 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2559,7 +2559,11 @@ static ivas_error updateSbaPanGains( } else { +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -5244,7 +5248,11 @@ static ivas_error renderIsmToBinauralRoom( hCombinedOrientationData = ismInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( *hCombinedOrientationData != NULL ) +#else if ( hCombinedOrientationData != NULL ) +#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -5858,7 +5866,11 @@ static ivas_error renderMcToBinaural( hCombinedOrientationData = mcInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( *hCombinedOrientationData != NULL ) +#else if ( hCombinedOrientationData != NULL ) +#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -5947,7 +5959,11 @@ static ivas_error renderMcToBinauralRoom( hCombinedOrientationData = mcInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( *hCombinedOrientationData != NULL ) +#else if ( hCombinedOrientationData != NULL ) +#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -6038,7 +6054,11 @@ static ivas_error renderMcCustomLsToBinauralRoom( hCombinedOrientationData = mcInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( *hCombinedOrientationData != NULL ) +#else if ( hCombinedOrientationData != NULL ) +#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -6644,7 +6664,11 @@ static ivas_error renderSbaToBinaural( hCombinedOrientationData = sbaInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( *hCombinedOrientationData != NULL ) +#else if ( hCombinedOrientationData != NULL ) +#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -6721,7 +6745,11 @@ static ivas_error renderSbaToBinauralRoom( hCombinedOrientationData = sbaInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( *hCombinedOrientationData != NULL ) +#else if ( hCombinedOrientationData != NULL ) +#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -7552,7 +7580,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, -- GitLab From 09b8e0b5afb47be8830388eade798d8e822a1945 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 15 Jul 2024 19:24:37 +0200 Subject: [PATCH 15/61] memory optimization for ivas_HRTF_statistics_init() --- lib_rend/lib_rend.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index f04cfd8674..68f53e4bbb 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3001,10 +3001,18 @@ ivas_error IVAS_REND_Open( return error; } } - if ( ( error = ivas_HRTF_statistics_init( &( hIvasRend->hHrtfs.hHrtfStatistics ), hIvasRend->sampleRateOut ) ) != IVAS_ERR_OK ) + +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { - return error; +#endif + if ( ( error = ivas_HRTF_statistics_init( &( hIvasRend->hHrtfs.hHrtfStatistics ), hIvasRend->sampleRateOut ) ) != IVAS_ERR_OK ) + { + return error; + } +#ifdef FIX_1135_EXT_RENDERER_HANDLES } +#endif return IVAS_ERR_OK; } @@ -7580,7 +7588,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, -- GitLab From b890dfb07b7d78cb52af7a152566bfbade044563 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 15 Jul 2024 19:56:11 +0200 Subject: [PATCH 16/61] fixes --- lib_rend/lib_rend.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 68f53e4bbb..efd127562a 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1380,7 +1380,11 @@ static ivas_error setRendInputActiveIsm( } else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -2576,7 +2580,11 @@ static ivas_error updateSbaPanGains( return error; } +#ifdef FIX_1135_EXT_RENDERER_HANDLES + if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -4451,7 +4459,12 @@ int16_t IVAS_REND_FeedRenderConfig( int16_t cldfb_in_flag; cldfb_in_flag = getCldfbRendFlag( hIvasRend, IVAS_REND_AUDIO_CONFIG_TYPE_UNKNOWN ); #ifdef FIX_1135_EXT_RENDERER_HANDLES - ISAR_PRE_REND_close( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); + if ( hIvasRend->splitRendWrapper != NULL ) + { + ISAR_PRE_REND_close( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); + free( hIvasRend->splitRendWrapper ); + hIvasRend->splitRendWrapper = NULL; + } #else ISAR_PRE_REND_close( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); #endif -- GitLab From ee26668bc6dda9602dc35ebc9256b1206e77b59f Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 15 Jul 2024 20:07:38 +0200 Subject: [PATCH 17/61] fixes --- lib_rend/lib_rend.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index efd127562a..700e4a673d 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1276,7 +1276,11 @@ static ivas_error initIsmMasaRendering( ivas_td_binaural_close( &inputIsm->tdRendWrapper.hBinRendererTd ); } +#ifdef FIX_1135_EXT_RENDERER_HANDLES + ivas_rend_closeCrend( &inputIsm->crendWrapper, inputIsm->base.ctx.pSplitRendWrapper != NULL ? inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); +#else ivas_rend_closeCrend( &inputIsm->crendWrapper, inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); +#endif ivas_reverb_close( &inputIsm->hReverb ); @@ -2109,7 +2113,11 @@ static ivas_error initMcBinauralRendering( /* if we need to use TD renderer and CREND was open, close it */ if ( useTDRend ) { +#ifdef FIX_1135_EXT_RENDERER_HANDLES + ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper != NULL ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); +#else ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); +#endif } if ( !reconfigureFlag || ( !useTDRend && outConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && inputMc->hReverb != NULL ) ) @@ -2201,7 +2209,11 @@ static ivas_error initMcMasaRendering( ivas_td_binaural_close( &inputMc->tdRendWrapper.hBinRendererTd ); } +#ifdef FIX_1135_EXT_RENDERER_HANDLES + ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper != NULL ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); +#else ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); +#endif ivas_reverb_close( &inputMc->hReverb ); @@ -2616,7 +2628,11 @@ static ivas_error initSbaMasaRendering( { ivas_error error; +#ifdef FIX_1135_EXT_RENDERER_HANDLES + ivas_rend_closeCrend( &inputSba->crendWrapper, inputSba->base.ctx.pSplitRendWrapper != NULL ? inputSba->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); +#else ivas_rend_closeCrend( &inputSba->crendWrapper, inputSba->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); +#endif if ( ( error = ivas_dirac_ana_open( &inputSba->hDirAC, inSampleRate ) ) != IVAS_ERR_OK ) { -- GitLab From 87740adbf1fc1657008f2696074befc83cc35554 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 Jul 2024 08:08:19 +0200 Subject: [PATCH 18/61] fix --- lib_rend/lib_rend.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 700e4a673d..a7202af5b6 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8437,6 +8437,9 @@ static ivas_error ivas_masa_ext_rend_parambin_init( int32_t output_Fs; RENDERER_TYPE renderer_type; int16_t j, k, bin; +#ifdef FIX_1135_EXT_RENDERER_HANDLES + int16_t num_poses; +#endif float binCenterFreq, tmpFloat; ivas_error error; float frequency_axis[CLDFB_NO_CHANNELS_MAX]; @@ -8451,7 +8454,17 @@ static ivas_error ivas_masa_ext_rend_parambin_init( nBins = inputMasa->hMasaExtRend->hSpatParamRendCom->num_freq_bands; renderer_type = inputMasa->hMasaExtRend->renderer_type; +#ifdef FIX_1135_EXT_RENDERER_HANDLES + num_poses = 1; + if ( inputMasa->base.ctx.pSplitRendWrapper != NULL ) + { + num_poses = inputMasa->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses; + } + + for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) +#else for ( pos_idx = 0; pos_idx < inputMasa->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses; pos_idx++ ) +#endif { hDiracDecBin = inputMasa->hMasaExtRend->hDiracDecBin[pos_idx]; -- GitLab From ed14d821e54aa33b80fe6a3f9713df12816fbf10 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 Jul 2024 08:31:38 +0200 Subject: [PATCH 19/61] fix MSAN error --- lib_rend/lib_rend.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index a7202af5b6..57a6daea7a 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2930,12 +2930,11 @@ ivas_error IVAS_REND_Open( } isar_init_split_rend_handles( hIvasRend->splitRendWrapper ); - hIvasRend->splitRendEncBuffer.data = NULL; } #else isar_init_split_rend_handles( &hIvasRend->splitRendWrapper ); - hIvasRend->splitRendEncBuffer.data = NULL; #endif + hIvasRend->splitRendEncBuffer.data = NULL; for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { @@ -7617,7 +7616,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, -- GitLab From 6bc40b1d8df27e317b7dab759dde62d69494d67b Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 Jul 2024 08:41:34 +0200 Subject: [PATCH 20/61] clang-format --- lib_rend/lib_rend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 57a6daea7a..eef12137ff 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7616,7 +7616,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, -- GitLab From 41baa039b42397b4ade059fb012546d2a6a10b74 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Wed, 17 Jul 2024 15:01:38 +1000 Subject: [PATCH 21/61] remove printf statements --- lib_dec/ivas_lfe_plc.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index e407042075..efc242ef3f 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -342,20 +342,11 @@ static void recover_samples( fac *= att; } - printf("LPC filter coefs: %.10f", a[0]); for ( i = 1; i <= LFE_PLC_LPCORD; i++ ) { a[i] = a[i] * fac; fac *= att * ( 1.0f + delta ); - printf(", %.10f", a[i]); } - printf("\n"); - printf("Pred erros: %.10f", pee[0]); - for ( i = 1; i <= LFE_PLC_LPCORD; i++ ) - { - printf(", %.10f", pee[i]); - } - printf("\n"); set_zero( zeroes, LFE_PLC_RECLEN ); syn_filt( a, LFE_PLC_LPCORD, zeroes, rec_frame, LFE_PLC_RECLEN, outbuf + LFE_PLC_BUFLEN - LFE_PLC_LPCORD, 0 ); -- GitLab From 800f9ba91e0a7ca1529e34df184e2453a25f36ec Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Wed, 17 Jul 2024 21:45:18 +1000 Subject: [PATCH 22/61] Add switches, prepare for public release --- lib_com/options.h | 2 + lib_dec/ivas_lfe_plc.c | 446 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 438 insertions(+), 10 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 76b6649a1f..bb194c5244 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -172,6 +172,8 @@ /* all switches in this category should start with "NONBE_" */ #define NON_BE_FIX_1137_GSC_IVAS_FXFLT_DECODING /* VA: Add fix point bit allocation for special GSC mode such that float and fixed point have the same final bit allocation */ + +#define NONE_BE_FIX_816_LFE_PLC_FLOAT /* DLB: issue 816: reduce required precision to float for LFE-PLC*/ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index efc242ef3f..d92af2bf80 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -40,7 +40,9 @@ #include "debug.h" #endif #include "wmc_auto.h" +#ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT #include "string.h" +#endif /*------------------------------------------------------------------------------------------* * Local constants @@ -53,20 +55,17 @@ #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 ) +#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 MAX_LEN_LP 960 - #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 -/*------------------------------------------------------------------------------------------* - * Static function declarations - * - * Note (DLB): the local float precision functions defined below are replica of corresponding - * float functions defined in tools.c, lpc_tools.c and syn_filt.c. - * float precision arithmetic is required for proper functioning of the lfe_plc. - *------------------------------------------------------------------------------------------*/ - +#ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT /*---------------------------------------------------------------------* * lev_dur() * @@ -353,8 +352,431 @@ static void recover_samples( return; } +#else +/*------------------------------------------------------------------------------------------* + * Static function declarations + * + * Note (DLB): the local double precision functions defined below are replica of corresponding + * float functions defined in tools.c, lpc_tools.c and syn_filt.c. + * Double precision arithmetic is required for proper functioning of the lfe_plc. + *------------------------------------------------------------------------------------------*/ + +static void mvr2d( + const float x[], /* i : input vector */ + double y[], /* o : output vector */ + const int16_t n /* i : vector size */ +) +{ + int16_t i; + + if ( n <= 0 ) + { + /* cannot transfer vectors with size 0 */ + return; + } + + for ( i = n - 1; i >= 0; i-- ) + { + y[i] = x[i]; + } + + return; +} + + +/*---------------------------------------------------------------------* + * autocorr() + * + * Compute autocorrelations of input signal + *---------------------------------------------------------------------*/ + +static void d_autocorr( + const double *x, /* i : input signal */ + double *r, /* o : autocorrelations vector */ + const int16_t m, /* i : order of LP filter */ + const int16_t len, /* i : window size */ + const double *wind, /* i : window */ + const int16_t rev_flag, /* i : flag to reverse window */ + const int16_t sym_flag, /* i : symmetric window flag */ + const int16_t no_thr /* i : flag to avoid thresholding */ +) +{ + double t[MAX_LEN_LP]; + double s; + int16_t i, j; + + /* Windowing of signal */ + if ( rev_flag == 1 ) + { + /* time reversed window */ + for ( i = 0; i < len; i++ ) + { + t[i] = x[i] * wind[len - i - 1]; + } + } + else if ( sym_flag == 1 ) + { + /* symmetric window of even length */ + for ( i = 0; i < len / 2; i++ ) + { + t[i] = x[i] * wind[i]; + } + + for ( ; i < len; i++ ) + { + t[i] = x[i] * wind[len - 1 - i]; + } + } + else /* assymetric window */ + { + for ( i = 0; i < len; i++ ) + { + t[i] = x[i] * wind[i]; + } + } + + /* Compute r[1] to r[m] */ + for ( i = 0; i <= m; i++ ) + { + s = t[0] * t[i]; + for ( j = 1; j < len - i; j++ ) + { + s += t[j] * t[i + j]; + } + r[i] = s; + } + + if ( r[0] < 100.0f && no_thr == 0 ) + { + r[0] = 100.0f; + } + + return; +} + + +/*---------------------------------------------------------------------* + * lev_dur() + * + * Wiener-Levinson-Durbin algorithm to compute LP parameters from the autocorrelations + * of input signal + *---------------------------------------------------------------------*/ + +/*! r: energy of prediction error */ +static int16_t d_lev_dur( + double *a, /* o : LP coefficients (a[0] = 1.0) */ + const double *r, /* i : vector of autocorrelations */ + const int16_t m, /* i : order of LP filter */ + double epsP[] /* o : prediction error energy */ +) +{ + int16_t i, j, l; + double buf[TCXLTP_LTP_ORDER]; + double *rc; /* reflection coefficients 0,...,m-1 */ + double s, at, err; + int16_t flag = 0; + + rc = &buf[0]; + rc[0] = ( -r[1] ) / r[0]; + a[0] = 1.0; + a[1] = rc[0]; + err = r[0] + r[1] * rc[0]; + + if ( epsP != NULL ) + { + epsP[0] = r[0]; + epsP[1] = err; + } + + for ( i = 2; i <= m; i++ ) + { + s = 0.0; + for ( j = 0; j < i; j++ ) + { + s += r[i - j] * a[j]; + } + + 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; + 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; + + if ( err <= 0.0f ) + { + err = 0.01f; + } + + if ( epsP != NULL ) + { + epsP[i] = err; + } + } + + return ( flag ); +} + +/*-------------------------------------------------------------------* + * a2rc() + * + * Convert from LPC to reflection coeff + *-------------------------------------------------------------------*/ + +static uint16_t d_a2rc( + const double *a, /* i : LPC coefficients */ + double *refl, /* o : Reflection co-efficients */ + const int16_t lpcorder /* i : LPC order */ +) +{ + double ff[LFE_PLC_LPCORD]; + int16_t m, j, n; + double km, denom, x; + + for ( m = 0; m < lpcorder; m++ ) + { + ff[m] = -a[m]; + } + + /* Initialization */ + for ( m = lpcorder - 1; m >= 0; m-- ) + { + km = ff[m]; + if ( km <= -1.0 || km >= 1.0 ) + { + for ( j = 0; j < lpcorder; j++ ) + { + refl[j] = 0.0; + } + + return 0; + } + + refl[m] = -km; + denom = 1.0 / ( 1.0 - km * km ); + for ( j = 0; j < m / 2; j++ ) + { + n = m - 1 - j; + x = denom * ff[j] + km * denom * ff[n]; + ff[n] = denom * ff[n] + km * denom * ff[j]; + ff[j] = x; + } + + if ( m & 1 ) + { + ff[j] = denom * ff[j] + km * denom * ff[j]; + } + } + + return 1; +} + + +static void d_syn_filt( + const double a[], /* i : LP filter coefficients */ + const int16_t m, /* i : order of LP filter */ + const float x[], /* i : input signal */ + float y[], /* o : output signal */ + const int16_t l, /* i : size of filtering */ + const float mem[] /* i : initial filter states */ +) +{ + int16_t i, j; + double buf[LFE_PLC_LPCORD + LFE_PLC_RECLEN]; /* temporary synthesis buffer */ + double s, *yy; + + yy = &buf[0]; + + /*------------------------------------------------------------------* + * copy initial filter states into synthesis buffer and do synthesis + *------------------------------------------------------------------*/ + for ( i = 0; i < m; i++ ) + { + *yy++ = mem[i]; + } + + /*-----------------------------------------------------------------------* + * Do the filtering + *-----------------------------------------------------------------------*/ + + for ( i = 0; i < l; i++ ) + { + s = x[i]; + for ( j = 1; j <= m; j++ ) + { + s -= a[j] * yy[i - j]; + } + + yy[i] = s; + y[i] = (float) s; + } + + return; +} + + +/*-----------------------------------------------------------------------------------------* + * Function check_stab() + * + * LPC filter stability check applying given sharpening value delta + *-----------------------------------------------------------------------------------------*/ + +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; + uint16_t stable; + + fac = 1.0 + delta; + fac1 = fac; + + for ( i = 0; i < LFE_PLC_LPCORD; i++ ) + { + amod[i] = a[i] * fac; + fac *= fac1; + } + stable = d_a2rc( amod, refl, LFE_PLC_LPCORD ); + + return stable; +} + + +/*-----------------------------------------------------------------------------------------* + * Function find_max_delta() + * + * Find maximum LPC filter sharpening by iteration to get a filter that is almost instable + *-----------------------------------------------------------------------------------------*/ + +static double find_max_delta( + double *a ) +{ + double delta; + double eps; + uint16_t stable; + double fac; + + delta = 0.0; + eps = 0.01; + fac = 2; + stable = FALSE; + + while ( check_stab( a, eps ) ) + { + + eps *= fac; + stable = TRUE; + } + fac = 0.5; + + if ( stable ) + { + eps *= fac; + } + + while ( !stable ) + { + eps *= fac; + stable = check_stab( a, eps ); + } + + /* must be stable with current eps */ + delta = eps; + eps *= fac; + + while ( 1 ) + { + delta += eps; + stable = check_stab( a, delta ); + + if ( !stable ) + { + if ( fabs( eps ) > EPS_STOP ) + { + eps = -fabs( eps ) * fac; + } + else + { + eps = -fabs( eps ); + } + } + else + { + if ( fabs( eps ) < EPS_STOP ) + { + break; + } + eps = fabs( eps ) * fac; + } + } + + return delta; +} +/*-----------------------------------------------------------------------------------------* + * Function recover_samples() + * + * recover lost samples by extrapolation of signal buffer + *-----------------------------------------------------------------------------------------*/ + +static void recover_samples( + const int16_t bfi_count, + const float *outbuf, + float *rec_frame ) +{ + int16_t i; + float zeroes[LFE_PLC_RECLEN]; + 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 ); + + if ( d_r[0] < POW_THR * LFE_PLC_BUFLEN ) + { + set_zero( rec_frame, LFE_PLC_RECLEN ); + return; + } + 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; + + if ( bfi_count >= LFE_PLC_MUTE_THR ) + { + att = LFE_PLC_BURST_ATT; + fac *= att; + } + + for ( i = 1; i <= LFE_PLC_LPCORD; i++ ) + { + d_a[i] = d_a[i] * fac; + fac *= att * ( 1.0 + delta ); + } + + set_zero( zeroes, LFE_PLC_RECLEN ); + d_syn_filt( d_a, LFE_PLC_LPCORD, zeroes, rec_frame, LFE_PLC_RECLEN, outbuf + LFE_PLC_BUFLEN - LFE_PLC_LPCORD ); + + return; +} +#endif + /*-----------------------------------------------------------------------------------------* * Function ivas_lfe_tdplc() * @@ -363,7 +785,11 @@ static void recover_samples( void ivas_lfe_tdplc( LFE_DEC_HANDLE hLFE, /* i/o: LFE decoder handle */ +#ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT float *prevsynth, /* i : previous frame synthesis */ +#else + const float *prevsynth, /* i : previous frame synthesis */ +#endif float *ytda, /* o : output time-domain buffer */ const int16_t output_frame /* i : output frame length */ ) -- GitLab From c948b8bd539815ac4d52ecd0a27a2ed7dbddf16b Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Fri, 19 Jul 2024 09:30:36 +1000 Subject: [PATCH 23/61] replace floor with floorf in ivas_lfe_enc.c --- lib_enc/ivas_lfe_enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/ivas_lfe_enc.c b/lib_enc/ivas_lfe_enc.c index dafb2cc642..f2fb1fde9a 100644 --- a/lib_enc/ivas_lfe_enc.c +++ b/lib_enc/ivas_lfe_enc.c @@ -164,7 +164,7 @@ static void ivas_lfe_enc_quant( } else { - shift = (int16_t) floor( IVAS_LFE_SHIFTS_PER_DOUBLE * log2_f( max_value / lfe_abs_sum ) ); + shift = (int16_t) floorf( IVAS_LFE_SHIFTS_PER_DOUBLE * log2_f( max_value / lfe_abs_sum ) ); } shift = max( min_shift * IVAS_LFE_SHIFTS_PER_DOUBLE, min( max_shift, shift ) ); -- GitLab From 8dfc24767b6b83a60eb81006257b2d37a3533213 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Fri, 19 Jul 2024 11:21:50 +1000 Subject: [PATCH 24/61] complete wrapping changed codes in #ifdef blocks --- lib_com/ivas_prot.h | 4 ++++ lib_com/ivas_rom_com.c | 23 +++++++++++++++++++++-- lib_enc/ivas_lfe_enc.c | 4 ++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 63041015fa..824ae20d59 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5493,7 +5493,11 @@ void ivas_lfe_dec( void ivas_lfe_tdplc( 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_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index bf2d962d3c..8d15b0e2a6 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -3129,6 +3129,7 @@ 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, @@ -3147,8 +3148,26 @@ const float hamm_lfe_plc[LFE_PLC_LENANA / 2] = 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, + 0.09013608672734141, 0.09281591991816535, 0.09580480062389246, 0.09910066323844335, 0.10270123000150438, 0.10660401257268071, 0.11080631375118072, 0.11530522933984272, + 0.12009765015221685, 0.12518026416131367, 0.13054955878853602, 0.13620182333121073, 0.14213315152704381, 0.14833944425372619, 0.15481641236182375, 0.16155957963899570, + 0.16856428590349043, 0.17582569022478273, 0.18333877426912554, 0.19109834576770490, 0.19909904210500018, 0.20733533402487142, 0.21580152945181053, 0.22449177742471671, + 0.23340007214047787, 0.24252025710456171, 0.25184602938575001, 0.26137094397207467, 0.27108841822494550, 0.28099173642839037, 0.29107405443026624, 0.30132840437223085, + 0.31174769950520753, 0.32232473908701620, 0.33305221335878232, 0.34392270859668939, 0.35492871223557998, 0.36606261806086549, 0.37731673146515798, 0.38868327476598852, + 0.40015439258093899, 0.41172215725647360, 0.42337857434671339, 0.43511558813837425, 0.44692508721804453, 0.45879891007795709, 0.47072885075638249, 0.48270666450874267, + 0.49472407350552849, 0.50677277255308162, 0.51884443483328757, 0.53093071765821398, 0.54302326823571601, 0.55511372944202464, 0.56719374559732838, 0.57925496824035816, + 0.59128906189798180, 0.60328770984582458, 0.61524261985593010, 0.62714552992749328, 0.63898821399670414, 0.65076248762175315, 0.66246021363907504, 0.67407330778691554, + 0.68559374429233988, 0.69701356141781945, 0.70832486696356345, 0.71951984372179334, 0.73059075487919101, 0.74152994936378558, 0.75232986713258543, 0.76298304439630038, + 0.77348211877754336, 0.78381983439894576, 0.79398904689767136, 0.80398272836286389, 0.81379397219261318, 0.82341599786708708, 0.83284215563452701, 0.84206593110687011, + 0.85108094976182280, 0.85988098134827329, 0.86845994419199846, 0.87681190939868969, 0.88493110495139349, 0.89281191969953333, 0.90044890723675941, 0.90783678966494241, + 0.91497046124171255, 0.92184499190902180, 0.92845563070029180, 0.93479780902379184, 0.94086714381997805, 0.94665944059061280, 0.95217069629756890, 0.95739710212931617, + 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_enc/ivas_lfe_enc.c b/lib_enc/ivas_lfe_enc.c index f2fb1fde9a..18e68b709d 100644 --- a/lib_enc/ivas_lfe_enc.c +++ b/lib_enc/ivas_lfe_enc.c @@ -164,7 +164,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 ) ); -- GitLab From 80790586b6c6b7cc8a77ecbe999e18734d781999 Mon Sep 17 00:00:00 2001 From: Jiaquan Huo Date: Mon, 22 Jul 2024 00:18:31 +0000 Subject: [PATCH 25/61] cleanup unused variables --- lib_dec/ivas_lfe_plc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index d92af2bf80..c61cb8b3ab 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -50,14 +50,12 @@ #define LFE_PLC_DSF ( 48000 / LFE_PLC_FS ) #define LFE_PLC_LPCORD ( 20 ) -#define LFE_PLC_MAXITER ( 10 ) #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 ) #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 MAX_LEN_LP 960 #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 */ -- GitLab From ce41f41a96d864f7a3765d8dec81c6bf46ee03f1 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Thu, 25 Jul 2024 16:57:59 +1000 Subject: [PATCH 26/61] Further cleanup to highlight the changes --- lib_dec/ivas_lfe_plc.c | 481 +++++++++++++++-------------------------- 1 file changed, 177 insertions(+), 304 deletions(-) diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index c61cb8b3ab..508da1da44 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -40,9 +40,6 @@ #include "debug.h" #endif #include "wmc_auto.h" -#ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT -#include "string.h" -#endif /*------------------------------------------------------------------------------------------* * Local constants @@ -63,294 +60,7 @@ #define EPS_STOP 1e-5 #endif -#ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT -/*---------------------------------------------------------------------* - * lev_dur() - * - * Wiener-Levinson-Durbin algorithm to compute LP parameters from the autocorrelations - * of input signal - *---------------------------------------------------------------------*/ - -/*! r: energy of prediction error */ -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 */ - float epsP[] /* o : prediction error energy */ -) -{ - int16_t i, j, l; - float buf[TCXLTP_LTP_ORDER]; - float *rc; /* reflection coefficients 0,...,m-1 */ - float s, at, err; - int16_t flag = 0; - float a[LFE_PLC_LPCORD + 1] = {0.f}; - - rc = &buf[0]; - rc[0] = ( -r[1] ) / r[0]; - a[0] = 1.0f; - a[1] = rc[0]; - err = r[0] + r[1] * rc[0]; - - memcpy(a_out, a, sizeof(a)); - memset(epsP, 0, sizeof(*epsP) * LFE_PLC_LPCORD); - - if ( epsP != NULL ) - { - epsP[0] = r[0]; - epsP[1] = err; - } - - for ( i = 2; i <= m; i++ ) - { - s = 0.0f; - for ( j = 0; j < i; j++ ) - { - s += r[i - j] * a[j]; - } - - rc[i - 1] = ( -s ) / err; - if ( fabsf( rc[i - 1] ) > 0.99945f ) - { - flag = 1; /* Test for unstable filter. If unstable keep old A(z) */ - return flag; - } - else - { - for (j = 0; j <= m; j++) - { - a_out[j] = a[j]; - } - } - 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; - - if ( err <= 0.0f ) - { - err = 0.01f; - } - - if ( epsP != NULL ) - { - epsP[i] = err; - } - } - - return ( flag ); -} - -/*-------------------------------------------------------------------* - * a2rc() - * - * Convert from LPC to reflection coeff - *-------------------------------------------------------------------*/ - -static uint16_t lfeplc_a2rc( - const float *a, /* i : LPC coefficients */ - float *refl, /* o : Reflection co-efficients */ - const int16_t lpcorder /* i : LPC order */ -) -{ - float ff[LFE_PLC_LPCORD]; - int16_t m, j, n; - float km, denom, x; - - for ( m = 0; m < lpcorder; m++ ) - { - ff[m] = -a[m]; - } - - /* Initialization */ - for ( m = lpcorder - 1; m >= 0; m-- ) - { - km = ff[m]; - if ( km <= -1.0f || km >= 1.0f ) - { - for ( j = 0; j < lpcorder; j++ ) - { - refl[j] = 0.0f; - } - - return 0; - } - - refl[m] = -km; - denom = 1.0f / ( 1.0f - km * km ); - for ( j = 0; j < m / 2; j++ ) - { - n = m - 1 - j; - x = denom * ff[j] + km * denom * ff[n]; - ff[n] = denom * ff[n] + km * denom * ff[j]; - ff[j] = x; - } - - if ( m & 1 ) - { - ff[j] = denom * ff[j] + km * denom * ff[j]; - } - } - - return 1; -} - -/*-----------------------------------------------------------------------------------------* - * Function check_stab() - * - * LPC filter stability check applying given sharpening value delta - *-----------------------------------------------------------------------------------------*/ - -static uint16_t check_stab( - const float *a, - float delta ) -{ - float amod[LFE_PLC_LPCORD], refl[LFE_PLC_LPCORD]; - int16_t i; - float fac; - float fac1; - uint16_t stable; - - fac = 1.0f + delta; - fac1 = fac; - - for ( i = 0; i < LFE_PLC_LPCORD; i++ ) - { - amod[i] = a[i] * fac; - fac *= fac1; - } - stable = lfeplc_a2rc( amod, refl, LFE_PLC_LPCORD ); - - return stable; -} - - -/*-----------------------------------------------------------------------------------------* - * Function find_max_delta() - * - * Find maximum LPC filter sharpening by iteration to get a filter that is almost instable - *-----------------------------------------------------------------------------------------*/ - -static float find_max_delta( - float *a ) -{ - float delta; - float eps; - uint16_t stable; - float fac; - - delta = 0.0f; - eps = 0.01f; - fac = 2; - stable = FALSE; - - while ( check_stab( a, eps ) ) - { - - eps *= fac; - stable = TRUE; - } - fac = 0.5f; - - if ( stable ) - { - eps *= fac; - } - - while ( !stable ) - { - eps *= fac; - stable = check_stab( a, eps ); - } - - /* must be stable with current eps */ - delta = eps; - eps *= fac; - - while ( 1 ) - { - delta += eps; - stable = check_stab( a, delta ); - - 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; - } - } - - return delta; -} - - -/*-----------------------------------------------------------------------------------------* - * Function recover_samples() - * - * recover lost samples by extrapolation of signal buffer - *-----------------------------------------------------------------------------------------*/ - -static void recover_samples( - const int16_t bfi_count, - float *outbuf, - float *rec_frame ) -{ - int16_t i; - float zeroes[LFE_PLC_RECLEN]; - float delta, fac, att; - float r[LFE_PLC_LPCORD + 1], a[LFE_PLC_LPCORD + 1], pee[LFE_PLC_LPCORD + 1]; - autocorr(outbuf, r, LFE_PLC_LPCORD, LFE_PLC_BUFLEN, hamm_lfe_plc, 0, 1, 1 ); - - if ( r[0] < POW_THR * LFE_PLC_BUFLEN ) - { - set_zero( rec_frame, LFE_PLC_RECLEN ); - return; - } - lfeplc_lev_dur( a, r, LFE_PLC_LPCORD, pee ); - - delta = find_max_delta( a + 1 ); - - fac = 1.0f + delta; - att = 1.0f; - - if ( bfi_count >= LFE_PLC_MUTE_THR ) - { - att = LFE_PLC_BURST_ATT; - fac *= att; - } - - for ( i = 1; i <= LFE_PLC_LPCORD; i++ ) - { - a[i] = a[i] * fac; - fac *= att * ( 1.0f + delta ); - } - - set_zero( zeroes, LFE_PLC_RECLEN ); - syn_filt( a, LFE_PLC_LPCORD, zeroes, rec_frame, LFE_PLC_RECLEN, outbuf + LFE_PLC_BUFLEN - LFE_PLC_LPCORD, 0 ); - - return; -} -#else +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT /*------------------------------------------------------------------------------------------* * Static function declarations * @@ -467,11 +177,34 @@ static int16_t d_lev_dur( const int16_t m, /* i : order of LP filter */ double epsP[] /* o : prediction error energy */ ) +#else +/*---------------------------------------------------------------------* + * lev_dur() + * + * Wiener-Levinson-Durbin algorithm to compute LP parameters from the autocorrelations + * of input signal + *---------------------------------------------------------------------*/ + +/*! r: energy of prediction error */ +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 */ + float epsP[] /* o : prediction error energy */ +) +#endif { int16_t i, j, l; +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT double buf[TCXLTP_LTP_ORDER]; double *rc; /* reflection coefficients 0,...,m-1 */ double s, at, err; +#else + float buf[TCXLTP_LTP_ORDER]; + float *rc; /* reflection coefficients 0,...,m-1 */ + float s, at, err; + float a[LFE_PLC_LPCORD + 1] = {0.f}; +#endif int16_t flag = 0; rc = &buf[0]; @@ -480,6 +213,14 @@ static int16_t d_lev_dur( a[1] = rc[0]; err = r[0] + r[1] * rc[0]; +#ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT + for (i = 0; i <= LFE_PLC_LPCORD; i++) + { + a_out[i] = 0.f; + epsP[i] = 0.f; + } +#endif + if ( epsP != NULL ) { epsP[0] = r[0]; @@ -488,17 +229,37 @@ static int16_t d_lev_dur( for ( i = 2; i <= m; i++ ) { +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT s = 0.0; +#else + s = 0.0f; +#endif for ( j = 0; j < i; j++ ) { s += r[i - j] * a[j]; } rc[i - 1] = ( -s ) / err; +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT if ( fabs( rc[i - 1] ) > 0.99945f ) +#else + if ( fabsf( rc[i - 1] ) > 0.99945f ) +#endif { flag = 1; /* Test for unstable filter. If unstable keep old A(z) */ +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT } +#else + return flag; + } + else + { + for (j = 0; j <=m; j++) + { + a_out[j] = a[j]; + } + } +#endif for ( j = 1; j <= i / 2; j++ ) { l = i - j; @@ -530,16 +291,28 @@ static int16_t d_lev_dur( * * Convert from LPC to reflection coeff *-------------------------------------------------------------------*/ - +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT static uint16_t d_a2rc( const double *a, /* i : LPC coefficients */ double *refl, /* o : Reflection co-efficients */ const int16_t lpcorder /* i : LPC order */ ) +#else +static uint16_t lfeplc_a2rc( + const float *a, /* i : LPC coefficients */ + float *refl, /* o : Reflection co-efficients */ + const int16_t lpcorder /* i : LPC order */ +) +#endif { +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT double ff[LFE_PLC_LPCORD]; - int16_t m, j, n; double km, denom, x; +#else + float ff[LFE_PLC_LPCORD]; + float km, denom, x; +#endif + int16_t m, j, n; for ( m = 0; m < lpcorder; m++ ) { @@ -550,18 +323,30 @@ static uint16_t d_a2rc( for ( m = lpcorder - 1; m >= 0; m-- ) { km = ff[m]; +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT if ( km <= -1.0 || km >= 1.0 ) +#else + if ( km <= -1.0f || km >= 1.0f ) +#endif { for ( j = 0; j < lpcorder; j++ ) { +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT refl[j] = 0.0; +#else + refl[j] = 0.0f; +#endif } return 0; } refl[m] = -km; +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT denom = 1.0 / ( 1.0 - km * km ); +#else + denom = 1.0f / ( 1.0f - km * km ); +#endif for ( j = 0; j < m / 2; j++ ) { n = m - 1 - j; @@ -579,7 +364,7 @@ static uint16_t d_a2rc( return 1; } - +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT static void d_syn_filt( const double a[], /* i : LP filter coefficients */ const int16_t m, /* i : order of LP filter */ @@ -621,25 +406,38 @@ static void d_syn_filt( return; } - +#endif /*-----------------------------------------------------------------------------------------* * Function check_stab() * * 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, + 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++ ) @@ -647,7 +445,11 @@ 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 = lfeplc_a2rc( amod, refl, LFE_PLC_LPCORD ); +#endif return stable; } @@ -658,17 +460,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; @@ -678,7 +493,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 ) { @@ -700,6 +519,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 ) @@ -719,6 +539,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; @@ -730,31 +571,55 @@ static double find_max_delta( * * recover lost samples by extrapolation of signal buffer *-----------------------------------------------------------------------------------------*/ - 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], pee[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, pee ); + + delta = find_max_delta( a + 1 ); + + fac = 1.0f + delta; + att = 1.0f; +#endif if ( bfi_count >= LFE_PLC_MUTE_THR ) { @@ -764,16 +629,24 @@ 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; } -#endif + /*-----------------------------------------------------------------------------------------* * Function ivas_lfe_tdplc() @@ -784,9 +657,9 @@ static void recover_samples( void ivas_lfe_tdplc( LFE_DEC_HANDLE hLFE, /* i/o: LFE decoder handle */ #ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT - float *prevsynth, /* i : previous frame synthesis */ + float *prevsynth, /* i : previous frame synthesis */ #else - const float *prevsynth, /* i : previous frame synthesis */ + double *prevsynth, /* i : previous frame synthesis */ #endif float *ytda, /* o : output time-domain buffer */ const int16_t output_frame /* i : output frame length */ -- GitLab From ca68111f4b253a97629ad65abd6cb18355617ad2 Mon Sep 17 00:00:00 2001 From: Adriana Vasilache Date: Thu, 25 Jul 2024 11:51:35 +0300 Subject: [PATCH 27/61] fix issue 1143 --- lib_com/options.h | 1 + lib_dec/ivas_masa_dec.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 1efaa714cc..978d70c13e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -184,6 +184,7 @@ #define NON_BE_FIX_1137_GSC_IVAS_FXFLT_DECODING /* VA: Add fix point bit allocation for special GSC mode such that float and fixed point have the same final bit allocation */ #define NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE /* VA: issue 1132: prevent division by extremely low energy value in SWB TBE */ #define NONBE_FIX_1141_OSBA_ROOM_RENDERING /* FhG: Fix for issue 1141: render objects in OSBA decoder with room effect */ +#define NONBE_FIX_1143_MASA_BRSW /* Nok: Fix for issue 1143: MSAN use of uninitialized value in masa decoding to binaural with dtx bitrate switching and 5 % FER */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 50cd432dea..51dc7bc0a6 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1393,6 +1393,12 @@ ivas_error ivas_masa_dec_reconfigure( sts = st_ivas->hCPE[cpe_id]->hCoreCoder; sts[0]->bit_stream = bit_stream + num_bits; num_bits += (int16_t) ( st_ivas->hCPE[cpe_id]->element_brate / FRAMES_PER_SEC ); +#ifdef ONBE_FIX_1143_MASA_BRSW + if ( ivas_total_brate < MASA_STEREO_MIN_BITRATE ) + { + st_ivas->hCPE[cpe_id]->nchan_out = 1; + } +#endif if ( ( ivas_total_brate < MASA_STEREO_MIN_BITRATE && last_ivas_total_brate >= MASA_STEREO_MIN_BITRATE ) || ( ivas_total_brate < MASA_STEREO_MIN_BITRATE && last_ivas_total_brate == FRAME_NO_DATA ) ) { -- GitLab From 9618da34ad479d69e38064fd6198f353155986e7 Mon Sep 17 00:00:00 2001 From: Adriana Vasilache Date: Thu, 25 Jul 2024 12:06:20 +0300 Subject: [PATCH 28/61] fix issue 1143 --- lib_dec/ivas_masa_dec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 51dc7bc0a6..5bfe5ad74d 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1393,7 +1393,7 @@ ivas_error ivas_masa_dec_reconfigure( sts = st_ivas->hCPE[cpe_id]->hCoreCoder; sts[0]->bit_stream = bit_stream + num_bits; num_bits += (int16_t) ( st_ivas->hCPE[cpe_id]->element_brate / FRAMES_PER_SEC ); -#ifdef ONBE_FIX_1143_MASA_BRSW +#ifdef NONBE_FIX_1143_MASA_BRSW if ( ivas_total_brate < MASA_STEREO_MIN_BITRATE ) { st_ivas->hCPE[cpe_id]->nchan_out = 1; @@ -1402,8 +1402,9 @@ ivas_error ivas_masa_dec_reconfigure( if ( ( ivas_total_brate < MASA_STEREO_MIN_BITRATE && last_ivas_total_brate >= MASA_STEREO_MIN_BITRATE ) || ( ivas_total_brate < MASA_STEREO_MIN_BITRATE && last_ivas_total_brate == FRAME_NO_DATA ) ) { +#ifndef NONBE_FIX_1143_MASA_BRSW st_ivas->hCPE[cpe_id]->nchan_out = 1; - +#endif if ( ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->hDirACRend != NULL ) || ( ( st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) && st_ivas->hDiracDecBin[0] != NULL ) ) { if ( ( error = ivas_dirac_dec_config( st_ivas, DIRAC_RECONFIGURE ) ) != IVAS_ERR_OK ) -- GitLab From 2739795df314bf7ac8d2b63fc7532b5b65842f03 Mon Sep 17 00:00:00 2001 From: Adriana Vasilache Date: Thu, 25 Jul 2024 16:19:36 +0300 Subject: [PATCH 29/61] improved fix for 1143 --- lib_dec/ivas_masa_dec.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 5bfe5ad74d..544f3d36bf 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1394,17 +1394,15 @@ ivas_error ivas_masa_dec_reconfigure( sts[0]->bit_stream = bit_stream + num_bits; num_bits += (int16_t) ( st_ivas->hCPE[cpe_id]->element_brate / FRAMES_PER_SEC ); #ifdef NONBE_FIX_1143_MASA_BRSW - if ( ivas_total_brate < MASA_STEREO_MIN_BITRATE ) - { - st_ivas->hCPE[cpe_id]->nchan_out = 1; - } -#endif + if ( ( ivas_total_brate < MASA_STEREO_MIN_BITRATE && last_ivas_total_brate >= MASA_STEREO_MIN_BITRATE ) || + ( ivas_total_brate < MASA_STEREO_MIN_BITRATE && last_ivas_total_brate == FRAME_NO_DATA ) || + ( ivas_total_brate < MASA_STEREO_MIN_BITRATE && last_ivas_total_brate == IVAS_SID_5k2 ) ) +#else if ( ( ivas_total_brate < MASA_STEREO_MIN_BITRATE && last_ivas_total_brate >= MASA_STEREO_MIN_BITRATE ) || ( ivas_total_brate < MASA_STEREO_MIN_BITRATE && last_ivas_total_brate == FRAME_NO_DATA ) ) +#endif { -#ifndef NONBE_FIX_1143_MASA_BRSW st_ivas->hCPE[cpe_id]->nchan_out = 1; -#endif if ( ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->hDirACRend != NULL ) || ( ( st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) && st_ivas->hDiracDecBin[0] != NULL ) ) { if ( ( error = ivas_dirac_dec_config( st_ivas, DIRAC_RECONFIGURE ) ) != IVAS_ERR_OK ) -- GitLab From f56931f879714a70f8a1b9a92c7687b4e801cad9 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Tue, 30 Jul 2024 11:58:55 +1000 Subject: [PATCH 30/61] clang format fix --- lib_dec/ivas_lfe_plc.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index 508da1da44..edc2591e2b 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -52,12 +52,12 @@ #define LFE_PLC_RECLEN ( ( LFE_PLC_RECLEN_48K / LFE_PLC_DSF ) ) #define LFE_PLC_MUTE_THR ( 10 ) #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 +#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 +#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 @@ -187,10 +187,10 @@ static int16_t d_lev_dur( /*! r: energy of prediction error */ static int16_t lfeplc_lev_dur( - float *a_out, /* o : LP coefficients (a[0] = 1.0) */ - const float *r, /* i : vector of autocorrelations */ + 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 */ - float epsP[] /* o : prediction error energy */ + float epsP[] /* o : prediction error energy */ ) #endif { @@ -203,7 +203,7 @@ static int16_t lfeplc_lev_dur( float buf[TCXLTP_LTP_ORDER]; float *rc; /* reflection coefficients 0,...,m-1 */ float s, at, err; - float a[LFE_PLC_LPCORD + 1] = {0.f}; + float a[LFE_PLC_LPCORD + 1] = { 0.f }; #endif int16_t flag = 0; @@ -214,7 +214,7 @@ static int16_t lfeplc_lev_dur( err = r[0] + r[1] * rc[0]; #ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT - for (i = 0; i <= LFE_PLC_LPCORD; i++) + for ( i = 0; i <= LFE_PLC_LPCORD; i++ ) { a_out[i] = 0.f; epsP[i] = 0.f; @@ -254,7 +254,7 @@ static int16_t lfeplc_lev_dur( } else { - for (j = 0; j <=m; j++) + for ( j = 0; j <= m; j++ ) { a_out[j] = a[j]; } @@ -299,8 +299,8 @@ static uint16_t d_a2rc( ) #else static uint16_t lfeplc_a2rc( - const float *a, /* i : LPC coefficients */ - float *refl, /* o : Reflection co-efficients */ + const float *a, /* i : LPC coefficients */ + float *refl, /* o : Reflection co-efficients */ const int16_t lpcorder /* i : LPC order */ ) #endif @@ -593,7 +593,7 @@ static void recover_samples( float delta, fac, att; float r[LFE_PLC_LPCORD + 1], a[LFE_PLC_LPCORD + 1], pee[LFE_PLC_LPCORD + 1]; - autocorr(outbuf, r, LFE_PLC_LPCORD, LFE_PLC_BUFLEN, hamm_lfe_plc, 0, 1, 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 @@ -642,7 +642,7 @@ static void recover_samples( #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); + syn_filt( a, LFE_PLC_LPCORD, zeroes, rec_frame, LFE_PLC_RECLEN, outbuf + LFE_PLC_BUFLEN - LFE_PLC_LPCORD, 0 ); #endif return; } @@ -655,11 +655,11 @@ static void recover_samples( *-----------------------------------------------------------------------------------------*/ void ivas_lfe_tdplc( - LFE_DEC_HANDLE hLFE, /* i/o: LFE decoder handle */ + LFE_DEC_HANDLE hLFE, /* i/o: LFE decoder handle */ #ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT - float *prevsynth, /* i : previous frame synthesis */ + float *prevsynth, /* i : previous frame synthesis */ #else - double *prevsynth, /* i : previous frame synthesis */ + double *prevsynth, /* i : previous frame synthesis */ #endif float *ytda, /* o : output time-domain buffer */ const int16_t output_frame /* i : output frame length */ -- GitLab From 9921cbec4f4cad368d60a7d51fbc3b6c7376b4fd Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Tue, 30 Jul 2024 21:25:58 +1000 Subject: [PATCH 31/61] replace lfeplc_a2rc with a2rc --- lib_com/lsf_tools.c | 14 ++++++++++++-- lib_com/prot.h | 4 ++++ lib_dec/ivas_lfe_plc.c | 29 ++--------------------------- lib_dec/swb_tbe_dec.c | 4 ++++ lib_enc/swb_tbe_enc.c | 5 ++++- lib_enc/vad_param_updt.c | 5 ++++- 6 files changed, 30 insertions(+), 31 deletions(-) diff --git a/lib_com/lsf_tools.c b/lib_com/lsf_tools.c index 6311598574..122df43ccd 100644 --- a/lib_com/lsf_tools.c +++ b/lib_com/lsf_tools.c @@ -959,8 +959,11 @@ void isp2isf( * * Convert from LPC to reflection coeff *-------------------------------------------------------------------*/ - +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT void a2rc( +#else +int a2rc( +#endif const float *a, /* i : LPC coefficients */ float *refl, /* o : Reflection co-efficients */ const int16_t lpcorder /* i : LPC order */ @@ -985,8 +988,11 @@ void a2rc( { refl[j] = 0.f; } - +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT return; +#else + return 0; +#endif } refl[m] = -km; @@ -1006,7 +1012,11 @@ void a2rc( } } +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT return; +#else + return 0; +#endif } diff --git a/lib_com/prot.h b/lib_com/prot.h index d26a2a42ab..f22020ba68 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -2998,7 +2998,11 @@ void a2isf( const float *old_isf, const int16_t lpcOrder ); +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT void a2rc( +#else +int 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 edc2591e2b..dcef0c84f9 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -286,32 +286,20 @@ static int16_t lfeplc_lev_dur( return ( flag ); } +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT /*-------------------------------------------------------------------* * a2rc() * * Convert from LPC to reflection coeff *-------------------------------------------------------------------*/ -#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT static uint16_t d_a2rc( const double *a, /* i : LPC coefficients */ double *refl, /* o : Reflection co-efficients */ const int16_t lpcorder /* i : LPC order */ ) -#else -static uint16_t lfeplc_a2rc( - const float *a, /* i : LPC coefficients */ - float *refl, /* o : Reflection co-efficients */ - const int16_t lpcorder /* i : LPC order */ -) -#endif { -#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT double ff[LFE_PLC_LPCORD]; double km, denom, x; -#else - float ff[LFE_PLC_LPCORD]; - float km, denom, x; -#endif int16_t m, j, n; for ( m = 0; m < lpcorder; m++ ) @@ -323,30 +311,18 @@ static uint16_t lfeplc_a2rc( for ( m = lpcorder - 1; m >= 0; m-- ) { km = ff[m]; -#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT if ( km <= -1.0 || km >= 1.0 ) -#else - if ( km <= -1.0f || km >= 1.0f ) -#endif { for ( j = 0; j < lpcorder; j++ ) { -#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT refl[j] = 0.0; -#else - refl[j] = 0.0f; -#endif } return 0; } refl[m] = -km; -#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT denom = 1.0 / ( 1.0 - km * km ); -#else - denom = 1.0f / ( 1.0f - km * km ); -#endif for ( j = 0; j < m / 2; j++ ) { n = m - 1 - j; @@ -364,7 +340,6 @@ static uint16_t lfeplc_a2rc( return 1; } -#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT static void d_syn_filt( const double a[], /* i : LP filter coefficients */ const int16_t m, /* i : order of LP filter */ @@ -448,7 +423,7 @@ static uint16_t check_stab( #ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT stable = d_a2rc( amod, refl, LFE_PLC_LPCORD ); #else - stable = lfeplc_a2rc( amod, refl, LFE_PLC_LPCORD ); + stable = a2rc( amod, refl, LFE_PLC_LPCORD ); #endif return stable; diff --git a/lib_dec/swb_tbe_dec.c b/lib_dec/swb_tbe_dec.c index 5f2978157d..c7e076b3ee 100644 --- a/lib_dec/swb_tbe_dec.c +++ b/lib_dec/swb_tbe_dec.c @@ -933,7 +933,11 @@ void swb_tbe_dec( lsf_diff[i] = lsf_shb[i] - lsf_shb[i - 1]; } +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT a2rc( hBWE_TD->cur_sub_Aq + 1, refl, M ); +#else + (void) a2rc( hBWE_TD->cur_sub_Aq + 1, refl, M ); +#endif 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/swb_tbe_enc.c b/lib_enc/swb_tbe_enc.c index 8f93f4241e..613b7d620e 100644 --- a/lib_enc/swb_tbe_enc.c +++ b/lib_enc/swb_tbe_enc.c @@ -795,8 +795,11 @@ void swb_tbe_enc( { lsf_diff[i] = lsf_shb[i] - lsf_shb[i - 1]; } +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT a2rc( hBWE_TD->cur_sub_Aq + 1, refl, M ); - +#else + (void) a2rc( hBWE_TD->cur_sub_Aq + 1, refl, M ); +#endif /* LSP interpolation for 13.2 kbps and 16.4 kbps */ 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 ) diff --git a/lib_enc/vad_param_updt.c b/lib_enc/vad_param_updt.c index 9a12b41373..a14bd88dba 100644 --- a/lib_enc/vad_param_updt.c +++ b/lib_enc/vad_param_updt.c @@ -117,8 +117,11 @@ void vad_param_updt( if ( hVAD->consec_inactive == 5 ) { /* compute spectral tilt parameter */ +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT a2rc( &A[1], refl, M ); - +#else + (void) a2rc( &A[1], refl, M ); +#endif if ( hVAD->spectral_tilt_reset == 1 ) { hVAD->spectral_tilt_reset = 0; -- GitLab From 39cdb09a0ca71f2f4410967de6ba51ab8bcf8150 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Wed, 31 Jul 2024 10:44:07 +1000 Subject: [PATCH 32/61] a2rc returning uint16_t instead --- lib_com/lsf_tools.c | 2 +- lib_com/prot.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_com/lsf_tools.c b/lib_com/lsf_tools.c index 122df43ccd..5437a44e51 100644 --- a/lib_com/lsf_tools.c +++ b/lib_com/lsf_tools.c @@ -962,7 +962,7 @@ void isp2isf( #ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT void a2rc( #else -int a2rc( +uint16_t a2rc( #endif const float *a, /* i : LPC coefficients */ float *refl, /* o : Reflection co-efficients */ diff --git a/lib_com/prot.h b/lib_com/prot.h index f22020ba68..ba09eef8de 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -3001,7 +3001,7 @@ void a2isf( #ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT void a2rc( #else -int a2rc( +uint16_t a2rc( #endif const float *a, /* i : LPC coefficients */ float *refl, /* o : Reflection co-efficients */ -- GitLab From f95a1865203075052a6fd80195ffa132d92585ba Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Wed, 31 Jul 2024 12:31:32 +1000 Subject: [PATCH 33/61] Fix stack corruption in a2rc for LFE PLC --- lib_com/cnst.h | 4 ++++ lib_com/lsf_tools.c | 4 ++++ lib_dec/ivas_lfe_plc.c | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index ca3c963003..49318b5762 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -563,6 +563,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/lsf_tools.c b/lib_com/lsf_tools.c index 5437a44e51..8db17d8295 100644 --- a/lib_com/lsf_tools.c +++ b/lib_com/lsf_tools.c @@ -969,7 +969,11 @@ uint16_t a2rc( 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; diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index dcef0c84f9..f49a1dd123 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -46,7 +46,11 @@ *------------------------------------------------------------------------------------------*/ #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 ) ) -- GitLab From 51c28a35bb317177bedeff4a9fb8fedf8de1302d Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Wed, 31 Jul 2024 15:09:32 +1000 Subject: [PATCH 34/61] clang format fix --- lib_dec/ivas_lfe_plc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index f49a1dd123..9b1bc12c3c 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -45,11 +45,11 @@ * Local constants *------------------------------------------------------------------------------------------*/ -#define LFE_PLC_DSF ( 48000 / LFE_PLC_FS ) +#define LFE_PLC_DSF ( 48000 / LFE_PLC_FS ) #ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT -#define LFE_PLC_LPCORD ( 20 ) +#define LFE_PLC_LPCORD ( 20 ) #else -#define LFE_PLC_LPCORD ( MAX_LP_FILTER_ORDER ) +#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 ) -- GitLab From f6a64672d90073e88302d20323f3d50ae0339e51 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Wed, 31 Jul 2024 15:19:26 +1000 Subject: [PATCH 35/61] fix a2rc for lfe plc --- lib_com/lsf_tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/lsf_tools.c b/lib_com/lsf_tools.c index 8db17d8295..9af5959c77 100644 --- a/lib_com/lsf_tools.c +++ b/lib_com/lsf_tools.c @@ -1019,7 +1019,7 @@ uint16_t a2rc( #ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT return; #else - return 0; + return 1; #endif } -- GitLab From f96c9b784ecfe5ddc4eb9129abcee12492ee18b3 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Wed, 31 Jul 2024 17:42:10 +1000 Subject: [PATCH 36/61] remove unused array --- lib_dec/ivas_lfe_plc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index 9b1bc12c3c..9518798485 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -193,8 +193,7 @@ static int16_t d_lev_dur( 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 */ - float epsP[] /* o : prediction error energy */ + const int16_t m /* i : order of LP filter */ ) #endif { @@ -221,15 +220,16 @@ static int16_t lfeplc_lev_dur( for ( i = 0; i <= LFE_PLC_LPCORD; i++ ) { a_out[i] = 0.f; - epsP[i] = 0.f; } #endif +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT if ( epsP != NULL ) { epsP[0] = r[0]; epsP[1] = err; } +#endif for ( i = 2; i <= m; i++ ) { @@ -281,10 +281,12 @@ static int16_t lfeplc_lev_dur( err = 0.01f; } +#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT if ( epsP != NULL ) { epsP[i] = err; } +#endif } return ( flag ); @@ -570,7 +572,7 @@ static void recover_samples( 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], pee[LFE_PLC_LPCORD + 1]; + 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 @@ -592,7 +594,7 @@ static void recover_samples( fac = 1.0 + delta; att = 1.0; #else - lfeplc_lev_dur( a, r, LFE_PLC_LPCORD, pee ); + lfeplc_lev_dur( a, r, LFE_PLC_LPCORD ); delta = find_max_delta( a + 1 ); -- GitLab From 93695a806e9f76f93b4c38d131547ba96bc4868a Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Wed, 31 Jul 2024 19:05:58 +1000 Subject: [PATCH 37/61] clang format --- lib_dec/ivas_lfe_plc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index 9518798485..82a6ec158f 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -191,9 +191,9 @@ static int16_t d_lev_dur( /*! r: energy of prediction error */ 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 */ + 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 */ ) #endif { -- GitLab From 5dc45d86e2406e3c4fe47f54195b50bfeec69953 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Wed, 31 Jul 2024 12:20:22 +0300 Subject: [PATCH 38/61] Fix issue 981 by setting parambin early part correction to unity also when on BINAURAL_ROOM_REVERB path --- lib_com/options.h | 1 + lib_rend/ivas_dirac_dec_binaural_functions.c | 11 +++++++++++ lib_rend/lib_rend.c | 11 +++++++++++ 3 files changed, 23 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 7189648051..0af1dd58de 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -182,6 +182,7 @@ #define NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE /* VA: issue 1132: prevent division by extremely low energy value in SWB TBE */ #define NONBE_FIX_1141_OSBA_ROOM_RENDERING /* FhG: Fix for issue 1141: render objects in OSBA decoder with room effect */ +#define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 9c0b1c8374..75816d6519 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -217,7 +217,18 @@ ivas_error ivas_dirac_dec_init_binaural_data( } else if ( renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Indication of binaural rendering with room effect */ { +#ifdef NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + { + mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); + } + else + { + set_f( hDiracDecBin->earlyPartEneCorrection, 1.0f, CLDFB_NO_CHANNELS_MAX ); + } +#else mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); +#endif /* reconfiguration needed when Reverb. parameters are changed -> close and open the handle again */ if ( hDiracDecBin->hReverb != NULL && ( ( hDiracDecBin->hReverb->numBins != nBins ) || diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index c2133d2f6d..9817addeef 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8343,7 +8343,18 @@ static ivas_error ivas_masa_ext_rend_parambin_init( } else if ( renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Indication of binaural rendering with room effect */ { +#ifdef NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART + if ( *inputMasa->base.ctx.pOutConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + { + mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); + } + else + { + set_f( hDiracDecBin->earlyPartEneCorrection, 1.0f, CLDFB_NO_CHANNELS_MAX ); + } +#else mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); +#endif if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ { -- GitLab From a4cece7b7c4d75ddcca0bf346718cf7275a352f0 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 31 Jul 2024 15:47:05 +0200 Subject: [PATCH 39/61] formal improvements --- lib_com/cnst.h | 2 +- lib_com/ivas_cnst.h | 4 ++++ lib_com/ivas_prot.h | 4 ++-- lib_com/ivas_rom_com.c | 1 + lib_com/ivas_rom_com.h | 4 ++++ lib_com/lpc_tools.c | 2 +- lib_com/lsf_tools.c | 1 + lib_com/prot.h | 1 + lib_dec/ivas_lfe_plc.c | 27 ++++++++++++++++++--------- lib_dec/swb_tbe_dec.c | 5 +---- lib_enc/swb_tbe_enc.c | 6 ++---- lib_enc/vad_param_updt.c | 5 +---- 12 files changed, 37 insertions(+), 25 deletions(-) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 49318b5762..775a8a0e01 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -564,7 +564,7 @@ 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 */ +#define MAX_LP_FILTER_ORDER 20 /* Max order of an LP filter */ #endif #define L_FRAME 256 /* frame size at 12.8kHz */ diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index fbe82c07a2..8c72cf2808 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1444,7 +1444,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 3666ef5d15..dc5ef18862 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5497,9 +5497,9 @@ void ivas_lfe_dec( void ivas_lfe_tdplc( LFE_DEC_HANDLE hLFE, /* i/o: LFE decoder handle */ #ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT - float *prevsynth, /* i : previous frame synthesis */ + float *prevsynth, /* i : previous frame synthesis */ #else - double *prevsynth, /* i : previous frame synthesis */ + 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 8d15b0e2a6..38991b4039 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -3168,6 +3168,7 @@ const double d_hamm_lfe_plc[LFE_PLC_LENANA / 2] = 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 c6c8250b03..749ae47b75 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -361,7 +361,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 9926cd6596..fa3923f8ca 100644 --- a/lib_com/lpc_tools.c +++ b/lib_com/lpc_tools.c @@ -131,7 +131,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 9af5959c77..89963d1df8 100644 --- a/lib_com/lsf_tools.c +++ b/lib_com/lsf_tools.c @@ -962,6 +962,7 @@ void isp2isf( #ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT void a2rc( #else +/*! r: stability flag */ uint16_t a2rc( #endif const float *a, /* i : LPC coefficients */ diff --git a/lib_com/prot.h b/lib_com/prot.h index ba09eef8de..4f4222b2f9 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -3001,6 +3001,7 @@ void a2isf( #ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT void a2rc( #else +/*! r: stability flag */ uint16_t a2rc( #endif const float *a, /* i : LPC coefficients */ diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index 82a6ec158f..839276e178 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -64,6 +64,7 @@ #define EPS_STOP 1e-5 #endif + #ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT /*------------------------------------------------------------------------------------------* * Static function declarations @@ -183,13 +184,13 @@ static int16_t d_lev_dur( ) #else /*---------------------------------------------------------------------* - * lev_dur() + * lfeplc_lev_dur() * * Wiener-Levinson-Durbin algorithm to compute LP parameters from the autocorrelations * of input signal *---------------------------------------------------------------------*/ -/*! r: energy of prediction error */ +/*! 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 */ @@ -206,7 +207,7 @@ static int16_t lfeplc_lev_dur( float buf[TCXLTP_LTP_ORDER]; float *rc; /* reflection coefficients 0,...,m-1 */ float s, at, err; - float a[LFE_PLC_LPCORD + 1] = { 0.f }; + float a[LFE_PLC_LPCORD + 1]; #endif int16_t flag = 0; @@ -219,11 +220,10 @@ static int16_t lfeplc_lev_dur( #ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT for ( i = 0; i <= LFE_PLC_LPCORD; i++ ) { + a[i] = 0.f; a_out[i] = 0.f; } -#endif - -#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT +#else if ( epsP != NULL ) { epsP[0] = r[0]; @@ -244,6 +244,7 @@ static int16_t lfeplc_lev_dur( } rc[i - 1] = ( -s ) / err; + #ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT if ( fabs( rc[i - 1] ) > 0.99945f ) #else @@ -264,6 +265,7 @@ static int16_t lfeplc_lev_dur( } } #endif + for ( j = 1; j <= i / 2; j++ ) { l = i - j; @@ -280,8 +282,8 @@ static int16_t lfeplc_lev_dur( { err = 0.01f; } - #ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT + if ( epsP != NULL ) { epsP[i] = err; @@ -394,6 +396,7 @@ 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, @@ -405,7 +408,7 @@ static uint16_t check_stab( #else static uint16_t check_stab( const float *a, - float delta ) + const float delta ) { float amod[LFE_PLC_LPCORD], refl[LFE_PLC_LPCORD]; float fac; @@ -426,6 +429,7 @@ 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 @@ -441,6 +445,7 @@ 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 ) @@ -552,6 +557,7 @@ static float find_max_delta( * * recover lost samples by extrapolation of signal buffer *-----------------------------------------------------------------------------------------*/ + static void recover_samples( const int16_t bfi_count, #ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT @@ -586,6 +592,7 @@ static void recover_samples( 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 ); @@ -620,11 +627,13 @@ static void recover_samples( } 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; } @@ -638,7 +647,7 @@ static void recover_samples( void ivas_lfe_tdplc( LFE_DEC_HANDLE hLFE, /* i/o: LFE decoder handle */ #ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT - float *prevsynth, /* i : previous frame synthesis */ + float *prevsynth, /* i : previous frame synthesis */ #else double *prevsynth, /* i : previous frame synthesis */ #endif diff --git a/lib_dec/swb_tbe_dec.c b/lib_dec/swb_tbe_dec.c index c7e076b3ee..1d8810c6d9 100644 --- a/lib_dec/swb_tbe_dec.c +++ b/lib_dec/swb_tbe_dec.c @@ -933,11 +933,8 @@ void swb_tbe_dec( lsf_diff[i] = lsf_shb[i] - lsf_shb[i - 1]; } -#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT a2rc( hBWE_TD->cur_sub_Aq + 1, refl, M ); -#else - (void) a2rc( hBWE_TD->cur_sub_Aq + 1, refl, M ); -#endif + 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/swb_tbe_enc.c b/lib_enc/swb_tbe_enc.c index 613b7d620e..3d023d766e 100644 --- a/lib_enc/swb_tbe_enc.c +++ b/lib_enc/swb_tbe_enc.c @@ -795,11 +795,9 @@ void swb_tbe_enc( { lsf_diff[i] = lsf_shb[i] - lsf_shb[i - 1]; } -#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT + a2rc( hBWE_TD->cur_sub_Aq + 1, refl, M ); -#else - (void) a2rc( hBWE_TD->cur_sub_Aq + 1, refl, M ); -#endif + /* LSP interpolation for 13.2 kbps and 16.4 kbps */ 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 ) diff --git a/lib_enc/vad_param_updt.c b/lib_enc/vad_param_updt.c index a14bd88dba..9a12b41373 100644 --- a/lib_enc/vad_param_updt.c +++ b/lib_enc/vad_param_updt.c @@ -117,11 +117,8 @@ void vad_param_updt( if ( hVAD->consec_inactive == 5 ) { /* compute spectral tilt parameter */ -#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT a2rc( &A[1], refl, M ); -#else - (void) a2rc( &A[1], refl, M ); -#endif + if ( hVAD->spectral_tilt_reset == 1 ) { hVAD->spectral_tilt_reset = 0; -- GitLab From cda22c0c2f45d73c709b72683f4bc242c91b0d04 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Wed, 31 Jul 2024 16:15:29 +0200 Subject: [PATCH 40/61] check for basop-ci-branch updates to work with BASOP float reference --- .gitlab-ci.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 15cb7a6569..45898af683 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -396,7 +396,6 @@ check-self-test-names-pre: script: - python3 ci/check_self_test_names.py scripts/config/self_test.prm 135 - branch-is-up-to-date-with-main-post: extends: - .rules-merge-request @@ -408,6 +407,32 @@ branch-is-up-to-date-with-main-post: - echo $commits_behind_count - if [ $commits_behind_count -eq 0 ]; then exit 0; else echo "Your branch is behind main, possibly main changed during your pipeline run, run 'git merge origin/main' to update." exit 1; fi; +# for merges to basop-ci-branch, run the long test suite in reference generation mode to catch problems already here and not only in the BASOP repo +check-compatibility-with-basop-reference-branch: + extends: + - .test-job-linux + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "basop-ci-branch" + changes: + - tests/**/* + - scripts/**/* + - ci/**/* + - if: $CI_PIPELINE_SOURCE == 'push' + when: never + tags: + - ivas-linux-fast + variables: + TEST_SUITE: "tests/codec_be_on_mr_nonselection tests/renderer --param_file scripts/config/self_test_ltv.prm" + script: + - git clone -b ivas-float-update https://forge.3gpp.org/rep/sa4/audio/ivas-basop.git --single-branch + - make -j -C ivas-basop + - cp ivas-basop/IVAS_cod ./IVAS_cod_ref + - cp ivas-basop/IVAS_dec ./IVAS_dec_ref + - python3 ci/remove_unsupported_testcases.py scripts/config/self_test.prm + - python3 tests/create_short_testvectors.py + - python3 -m pytest $TEST_SUITE -v --update_ref 1 -m create_ref --create_ref -n auto + - python3 -m pytest $TEST_SUITE -v --update_ref 1 -m create_ref_part2 -n auto + # --------------------------------------------------------------- # Build jobs # --------------------------------------------------------------- -- GitLab From 3412f68f33ccf4981139d5572e77f258ab259d9f Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 31 Jul 2024 16:29:58 +0200 Subject: [PATCH 41/61] fix reset of a[] --- lib_dec/ivas_lfe_plc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index 839276e178..45b57d46c5 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -218,11 +218,8 @@ static int16_t lfeplc_lev_dur( err = r[0] + r[1] * rc[0]; #ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT - for ( i = 0; i <= LFE_PLC_LPCORD; i++ ) - { - a[i] = 0.f; - a_out[i] = 0.f; - } + set_f( a_out, 0.f, LFE_PLC_LPCORD + 1 ); + set_f( a + 2, 0.f, LFE_PLC_LPCORD + 1 - 2 ); #else if ( epsP != NULL ) { -- GitLab From 1e92c06db7ebdf76396c48ec49cd5df61b7d02e4 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Sat, 3 Aug 2024 08:37:15 +1000 Subject: [PATCH 42/61] restructure lfeplc_lev_dur main loop --- lib_dec/ivas_lfe_plc.c | 73 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index 45b57d46c5..eac405c583 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -64,7 +64,7 @@ #define EPS_STOP 1e-5 #endif - +#if 0 #ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT /*------------------------------------------------------------------------------------------* * Static function declarations @@ -290,6 +290,77 @@ static int16_t lfeplc_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] = { 0.0f }; + + 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]; + err += rc[0] * s; + s += r[2] * a[1]; + rc[1] = ( -s ) / err; + + i = 2; + 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 /*-------------------------------------------------------------------* -- GitLab From d9fafc1420a48ae153220d0748c4fb904b104b6c Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Sun, 4 Aug 2024 15:27:33 +1000 Subject: [PATCH 43/61] fix bug --- lib_dec/ivas_lfe_plc.c | 55 +----------------------------------------- 1 file changed, 1 insertion(+), 54 deletions(-) diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index eac405c583..0c358f4233 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -64,7 +64,6 @@ #define EPS_STOP 1e-5 #endif -#if 0 #ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT /*------------------------------------------------------------------------------------------* * Static function declarations @@ -182,33 +181,11 @@ static int16_t d_lev_dur( const int16_t m, /* i : order of LP filter */ double epsP[] /* o : prediction error energy */ ) -#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 */ -) -#endif { int16_t i, j, l; -#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT double buf[TCXLTP_LTP_ORDER]; double *rc; /* reflection coefficients 0,...,m-1 */ double s, at, err; -#else - float buf[TCXLTP_LTP_ORDER]; - float *rc; /* reflection coefficients 0,...,m-1 */ - float s, at, err; - float a[LFE_PLC_LPCORD + 1]; -#endif int16_t flag = 0; rc = &buf[0]; @@ -217,24 +194,15 @@ static int16_t lfeplc_lev_dur( a[1] = rc[0]; err = r[0] + r[1] * rc[0]; -#ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT - set_f( a_out, 0.f, LFE_PLC_LPCORD + 1 ); - set_f( a + 2, 0.f, LFE_PLC_LPCORD + 1 - 2 ); -#else if ( epsP != NULL ) { epsP[0] = r[0]; epsP[1] = err; } -#endif for ( i = 2; i <= m; i++ ) { -#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT s = 0.0; -#else - s = 0.0f; -#endif for ( j = 0; j < i; j++ ) { s += r[i - j] * a[j]; @@ -242,26 +210,10 @@ static int16_t lfeplc_lev_dur( rc[i - 1] = ( -s ) / err; -#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT if ( fabs( rc[i - 1] ) > 0.99945f ) -#else - if ( fabsf( rc[i - 1] ) > 0.99945f ) -#endif { flag = 1; /* Test for unstable filter. If unstable keep old A(z) */ -#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT - } -#else - return flag; } - else - { - for ( j = 0; j <= m; j++ ) - { - a_out[j] = a[j]; - } - } -#endif for ( j = 1; j <= i / 2; j++ ) { @@ -279,13 +231,11 @@ static int16_t lfeplc_lev_dur( { err = 0.01f; } -#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT if ( epsP != NULL ) { epsP[i] = err; } -#endif } return ( flag ); @@ -320,11 +270,8 @@ static int16_t lfeplc_lev_dur( s = r[1]; a[1] = rc[0]; a_out[1] = a[1]; - err += rc[0] * s; - s += r[2] * a[1]; - rc[1] = ( -s ) / err; - i = 2; + i = 1; while ( i < m ) { for ( j = 1; j <= i / 2; j++ ) -- GitLab From d67e43c4f4f7867befd458e60fab1e1cbb8aa3fc Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Sun, 4 Aug 2024 20:34:36 +1000 Subject: [PATCH 44/61] clang format fix --- lib_dec/ivas_lfe_plc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index 0c358f4233..05338b2c9c 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -261,7 +261,7 @@ static int16_t lfeplc_lev_dur( float s, at, err; float a[LFE_PLC_LPCORD + 1] = { 0.0f }; - set_f( a_out, 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]; -- GitLab From fc6bc79885418a18952570846c3e266328d17804 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Mon, 5 Aug 2024 10:33:54 +1000 Subject: [PATCH 45/61] no array init at declaration. --- lib_dec/ivas_lfe_plc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index 05338b2c9c..99509970cb 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -259,8 +259,9 @@ static int16_t lfeplc_lev_dur( float buf[TCXLTP_LTP_ORDER]; float *rc; /* reflection coefficients 0,...,m-1 */ float s, at, err; - float a[LFE_PLC_LPCORD + 1] = { 0.0f }; + 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; -- GitLab From 38b467f9ee2d6aab802b38e7bab98f8a18ac8fbf Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 5 Aug 2024 10:43:49 +0200 Subject: [PATCH 46/61] prevent unnecessary access to uninit vals at upper idx limit too --- lib_enc/ivas_stereo_dft_enc_itd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/ivas_stereo_dft_enc_itd.c b/lib_enc/ivas_stereo_dft_enc_itd.c index 0f32dd9985..f8221df11d 100644 --- a/lib_enc/ivas_stereo_dft_enc_itd.c +++ b/lib_enc/ivas_stereo_dft_enc_itd.c @@ -291,7 +291,7 @@ static int16_t stereo_dft_enc_itd_vad( #ifdef FIX_1152_UNINIT_VAL_IN_ITD_VAD_COMPUTATION /* Spd is later only used starting at itd_vad_band_tbl[0], so only compute values starting from there */ /* -> this avoids uninitialized values in Spd_L and Spd_R at index 0 to be used */ - for ( i = itd_vad_band_tbl[0]; i <= STEREO_DFT_N_16k_ENC / 2; i++ ) + for ( i = itd_vad_band_tbl[0]; i < STEREO_DFT_N_16k_ENC / 2; i++ ) #else for ( i = 0; i <= STEREO_DFT_N_16k_ENC / 2; i++ ) #endif -- GitLab From 61c9abd91b52a5cdb6da6eb6d27a70a7191e8267 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 6 Aug 2024 10:11:43 +0200 Subject: [PATCH 47/61] add mld binary for arm64 macOS --- scripts/tools/Darwin/mld | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 scripts/tools/Darwin/mld diff --git a/scripts/tools/Darwin/mld b/scripts/tools/Darwin/mld new file mode 100755 index 0000000000..47e6f419dc --- /dev/null +++ b/scripts/tools/Darwin/mld @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a8f9a8042c4f24183718491eafde38fcedcb62fd7583e884cfcdbcd148223fd7 +size 115344 -- GitLab From 899a9162d92bfab1cc443496efbd11ad253cb1b6 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 6 Aug 2024 11:19:14 +0200 Subject: [PATCH 48/61] update to universal binary --- scripts/tools/Darwin/mld | Bin 131 -> 167984 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/scripts/tools/Darwin/mld b/scripts/tools/Darwin/mld index 47e6f419dc3c6de752d8afe3f7f52248fec10050..6c7e35f818071959cabbb7b9d9b8f65b28a10532 100755 GIT binary patch literal 167984 zcmX^0Z`VEs1_mZZ1_pKp1_ovZ1_uTPM&1qv1_nMx1_mAm5MXRzU|s6&ba#z%4e|#IqY#WJ zJnS5hIX4(V=7hLLgrKSc>u*36V}SBm85kH~7^EUTz9hAx1jK^i_;^(F1e_TdK<3>s zfyjgSED$DyWPzCs;l{@omy{+ILpWf6qMG-n9Ae%Us0t7t$^=s!Q1jTpJdppA^Ye-k z4n%j~f(nRv1)utJLE6>bJiO+u-BmO0P#WQb?|~n2oEd|;WC&oFf@R|4J2d1#K2$-e2WHv={xj>mQISI%|J;be4Yb z=&e0q_-&T~0|UbgLsJHZ?$RF~-JxLN7wjwy3?7}XJHELdVB~M*VqjqS=6Z;czr`8M zI>5-^A`IG!-_6=r15(&3@&Et-mtdh@)@}=g5Xd@@?!6%C7f($X7!3cv=rUno@Mx~x z!N5QDfJb-f4*qRFnx8YiNM&bW@aU~=F#NU)wEO+Ve2}u}CKt4lZ{YBzKez?&z6~#~7%?z#gChzOT^_xAH4w@cfR*)vOnb2kO(h~?;Su9+#=!7G zhZPjLaLZm)py~7IhTHHW22Bo&nZh75Z-A12H|s}BkkJetovjN0|Nr-Bu6@D4-vT;@ z#iP6Sg-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VEYZzLE7nWTEXgQM(o4?I)h{kcP1Y|nFg7=|FtIdDO-xHkHMU4gPEAQpGBZj`F*mg^PPMQw iNlr^nNlH#JG_f!;GEPe|=PJ&uN>wm4G&MFc;Q|0Cm?&!i -- GitLab From 0facc739cc8782feb617ba32bd4a710ed2c113a7 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Aug 2024 12:07:18 +0200 Subject: [PATCH 49/61] fix compilation issue in lib_enc/ivas_stereo_dft_enc.c with DEBUG_MODE_DFT active --- lib_enc/ivas_stereo_dft_enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/ivas_stereo_dft_enc.c b/lib_enc/ivas_stereo_dft_enc.c index 4c6dd483e1..a869227497 100755 --- a/lib_enc/ivas_stereo_dft_enc.c +++ b/lib_enc/ivas_stereo_dft_enc.c @@ -3297,7 +3297,7 @@ static float stereo_dft_calc_mean_ipd_change( ipd_mean_change /= gipd_band_max; #ifdef DEBUG_MODE_DFT - dbgwrite( ipd_change, sizeof( float ), hStereoDft->gipd_band_max, 1, "res/stereo_dft_ipd_change.pcm" ); + dbgwrite( ipd_change, sizeof( float ), gipd_band_max, 1, "res/stereo_dft_ipd_change.pcm" ); dbgwrite( &ipd_mean_change, sizeof( float ), 1, 1, "res/stereo_dft_ipd_mean_change.pcm" ); #endif -- GitLab From 0710cb01088253b8581a34ae913d01433840ff3c Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Aug 2024 14:11:38 +0200 Subject: [PATCH 50/61] add missing executbale ISAR_post_rend --- scripts/find_unused_symbols.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/find_unused_symbols.sh b/scripts/find_unused_symbols.sh index e184dbd691..259c4efe6f 100755 --- a/scripts/find_unused_symbols.sh +++ b/scripts/find_unused_symbols.sh @@ -76,7 +76,7 @@ fi # print C-code directory echo "C-code directory set to ${WORKDIR}" WORKDIR_EXE=${WORKDIR//" "/"\ "} -EXECUTABLES="${WORKDIR_EXE}/IVAS_cod ${WORKDIR_EXE}/IVAS_dec ${WORKDIR_EXE}/IVAS_rend" +EXECUTABLES="${WORKDIR_EXE}/IVAS_cod ${WORKDIR_EXE}/IVAS_dec ${WORKDIR_EXE}/IVAS_rend ${WORKDIR_EXE}/ISAR_post_rend" # build if [ $compile -ne 0 ]; then -- GitLab From 3099e75b6c9efad2dfa6ed8008e729ec518da28c Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Aug 2024 14:26:22 +0200 Subject: [PATCH 51/61] remove unused table ivas_param_mc_dmx_fac_CICP19_4tc[] --- lib_com/ivas_rom_com.c | 2 ++ lib_com/options.h | 1 + 2 files changed, 3 insertions(+) diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 38991b4039..5abf3cffd4 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -1876,6 +1876,7 @@ const float ivas_param_mc_dmx_fac_CICP19_3tc[36] = 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f /*Ct*/ }; +#ifndef FIX_1157_OBSOLETE_DMX_TABLE const float ivas_param_mc_dmx_fac_CICP19_4tc[48] = { 1.0f, 0.0f, INV_SQRT2, INV_SQRT2, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, /*Lht*/ @@ -1883,6 +1884,7 @@ const float ivas_param_mc_dmx_fac_CICP19_4tc[48] = 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, /*Lut*/ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, /*Rut*/ }; +#endif /* Coefficient for Parametric MC ILD factorization */ const float ivas_param_mc_ild_fac_CICP6_2tc[6] = diff --git a/lib_com/options.h b/lib_com/options.h index fe92d9fa10..7a743e2ae4 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -172,6 +172,7 @@ #endif #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define FIX_1152_UNINIT_VAL_IN_ITD_VAD_COMPUTATION /* FhG: fix uninitialized value being used in ITD VAD mid signal computation that does not affect synthesis, but crashes BASOPs */ +#define FIX_1157_OBSOLETE_DMX_TABLE /* FhG: remove obsolte ParamMC DMX table ivas_param_mc_dmx_fac_CICP19_4tc[] */ /* #################### End BE switches ################################## */ -- GitLab From 236d8ff6d7dadf3b4875e3f64526bfeae01c6346 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 8 Aug 2024 10:58:47 +0200 Subject: [PATCH 52/61] add jobs for BINAURAL out, ISM->BINAURAL_ROOM_IR, OMASA->HOA3 --- .gitlab-ci.yml | 103 +++++++++++++++++++++++++++++++++++++++------- ci/setup_pages.py | 7 +++- 2 files changed, 95 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 15cb7a6569..1c93880b38 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2297,7 +2297,7 @@ complexity-stereo-in-ext-out: - *complexity-measurements-prepare-artifacts - exit $ret_val -complexity-ism-in-binaural_room_reverb-out: +complexity-ism-in-binaural-out: extends: - .complexity-template rules: @@ -2306,7 +2306,22 @@ complexity-ism-in-binaural_room_reverb-out: start_in: 1 hour script: - in_format=ISM - - out_format=BINAURAL_ROOM_REVERB + - out_format=BINAURAL + - ret_val=0 + - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" || ret_val=$? + - *complexity-measurements-prepare-artifacts + - exit $ret_val + +complexity-ism-in-binaural_room_ir-out: + extends: + - .complexity-template + rules: + - if: $MEASURE_COMPLEXITY_LINUX + when: delayed + start_in: 2 hours + script: + - in_format=ISM + - out_format=BINAURAL_ROOM_IR - ret_val=0 - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" || ret_val=$? - *complexity-measurements-prepare-artifacts @@ -2318,7 +2333,7 @@ complexity-ism-in-ext-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 3 hour + start_in: 3 hours script: - in_format=ISM - out_format=EXT @@ -2342,13 +2357,28 @@ complexity-sba-hoa3-in-ext-out: - *complexity-measurements-prepare-artifacts - exit $ret_val -complexity-sba-hoa3-in-binaural_room_ir-out: +complexity-sba-hoa3-in-binaural-out: extends: - .complexity-template rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed start_in: 5 hours + script: + - in_format=HOA3 + - out_format=BINAURAL + - ret_val=0 + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - *complexity-measurements-prepare-artifacts + - exit $ret_val + +complexity-sba-hoa3-in-binaural_room_ir-out: + extends: + - .complexity-template + rules: + - if: $MEASURE_COMPLEXITY_LINUX + when: delayed + start_in: 6 hours script: - in_format=HOA3 - out_format=BINAURAL_ROOM_IR @@ -2363,7 +2393,7 @@ complexity-mc-in-ext-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 6 hours + start_in: 7 hours script: - in_format=MC - out_format=EXT @@ -2372,13 +2402,28 @@ complexity-mc-in-ext-out: - *complexity-measurements-prepare-artifacts - exit $ret_val +complexity-mc-in-binaural-out: + extends: + - .complexity-template + rules: + - if: $MEASURE_COMPLEXITY_LINUX + when: delayed + start_in: 8 hours + script: + - in_format=MC + - out_format=BINAURAL + - ret_val=0 + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - *complexity-measurements-prepare-artifacts + - exit $ret_val + complexity-mc-in-binaural_room_ir-out: extends: - .complexity-template rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 7 hours + start_in: 9 hours script: - in_format=MC - out_format=BINAURAL_ROOM_IR @@ -2393,7 +2438,7 @@ complexity-masa-in-ext-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 8 hours + start_in: 10 hours script: - in_format=MASA - out_format=EXT @@ -2408,7 +2453,7 @@ complexity-masa-in-binaural-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 9 hours + start_in: 11 hours script: - in_format=MASA - out_format=BINAURAL @@ -2423,7 +2468,7 @@ complexity-masa-in-hoa3-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 10 hours + start_in: 12 hours script: - in_format=MASA - out_format=HOA3 @@ -2438,7 +2483,7 @@ complexity-omasa-in-ext-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 11 hours + start_in: 13 hours script: - in_format=OMASA - out_format=EXT @@ -2453,7 +2498,7 @@ complexity-omasa-in-binaural-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 12 hours + start_in: 14 hours script: - in_format=OMASA - out_format=BINAURAL @@ -2462,13 +2507,28 @@ complexity-omasa-in-binaural-out: - *complexity-measurements-prepare-artifacts - exit $ret_val +complexity-omasa-in-hoa3-out: + extends: + - .complexity-template + rules: + - if: $MEASURE_COMPLEXITY_LINUX + when: delayed + start_in: 15 hours + script: + - in_format=OMASA + - out_format=HOA3 + - ret_val=0 + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - *complexity-measurements-prepare-artifacts + - exit $ret_val + complexity-StereoDmxEVS-stereo-in-mono-out: extends: - .complexity-template rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 13 hours + start_in: 16 hours script: - in_format=StereoDmxEVS - out_format=mono @@ -2483,7 +2543,7 @@ complexity-osba-in-ext-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 14 hours + start_in: 17 hours script: - in_format=OSBA - out_format=EXT @@ -2492,13 +2552,28 @@ complexity-osba-in-ext-out: - *complexity-measurements-prepare-artifacts - exit $ret_val +complexity-osba-in-binaural-out: + extends: + - .complexity-template + rules: + - if: $MEASURE_COMPLEXITY_LINUX + when: delayed + start_in: 18 hours + script: + - in_format=OSBA + - out_format=BINAURAL + - ret_val=0 + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - *complexity-measurements-prepare-artifacts + - exit $ret_val + complexity-osba-in-binaural_room_ir-out: extends: - .complexity-template rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 15 hours + start_in: 19 hours script: - in_format=OSBA - out_format=BINAURAL_ROOM_IR diff --git a/ci/setup_pages.py b/ci/setup_pages.py index e810047c90..01c16fcb67 100755 --- a/ci/setup_pages.py +++ b/ci/setup_pages.py @@ -20,18 +20,23 @@ JOBS_FLOAT_REPO = { # "complexity-masa-in-7_1_4-out": "[OLD] Masa in, 7_1_4 out", # current ones "complexity-stereo-in-ext-out": "Stereo in, EXT out", - "complexity-ism-in-binaural_room_reverb-out": "ISM in, BINAURAL_ROOM_REVERB out", + "complexity-ism-in-binaural-out": "ISM in, BINAURAL out", + "complexity-ism-in-binaural_room_ir-out": "ISM in, BINAURAL_ROOM_IR out", "complexity-ism-in-ext-out": "ISM in, EXT out", "complexity-sba-hoa3-in-ext-out": "HOA3 in, EXT out", + "complexity-sba-hoa3-in-binaural-out": "HOA3 in, BINAURAL out", "complexity-sba-hoa3-in-binaural_room_ir-out": "HOA3 in, BINAURAL_ROOM_IR out", "complexity-mc-in-ext-out": "MC in, EXT out", + "complexity-mc-in-binaural-out": "MC in, BINAURAL out", "complexity-mc-in-binaural_room_ir-out": "MC in, BINAURAL_ROOM_IR out", "complexity-masa-in-ext-out": "MASA in, EXT out", "complexity-masa-in-binaural-out": "MASA in, BINAURAL out", "complexity-masa-in-hoa3-out": "MASA in, HOA3 out", "complexity-omasa-in-ext-out": "OMASA in, EXT out", "complexity-omasa-in-binaural-out": "OMASA in, BINAURAL out", + "complexity-omasa-in-hoa3-out": "OMASA in, HOA3 out", "complexity-osba-in-ext-out": "OSBA in, EXT out", + "complexity-osba-in-binaural-out": "OSBA in, BINAURAL out", "complexity-osba-in-binaural_room_ir-out": "OSBA in, BINAURAL_ROOM_IR out", "complexity-StereoDmxEVS-stereo-in-mono-out": "StereoDmxEVS, Stereo in, Mono out", # "timeless" jobs (not complexity) -- GitLab From 72de399a8bee24fa9436ccd5f014b2347b2fbb27 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 8 Aug 2024 13:12:59 +0200 Subject: [PATCH 53/61] port web-run setup from other branch --- .gitlab-ci.yml | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 45898af683..b62f26b720 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,9 +23,11 @@ variables: - 'test-long-self-test' - 'ivas-conformance' - 'ivas-conformance-linux' + - 'check-float-reference' GIT_CLEAN_FLAGS: -ffdxq TESTCASE_TIMEOUT_STV_SANITIZERS: 180 TESTCASE_TIMEOUT_LTV_SANITIZERS: 1200 + BASOP_REFERENCE_BRANCH: "ivas-float-update" default: @@ -63,6 +65,10 @@ workflow: - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'ivas-conformance-linux' variables: IVAS_PIPELINE_NAME: 'Draft IVAS Conformance test -- Linux: $CI_COMMIT_BRANCH' + - if: $CI_PIPELINE_SOURCE == 'trigger' + - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'check-float-reference' + variables: + IVAS_PIPELINE_NAME: 'check-float-reference: $CI_COMMIT_BRANCH' stages: @@ -257,6 +263,8 @@ stages: when: never - if: $MANUAL_PIPELINE_TYPE == 'ivas-conformance-linux' when: never + - if: $MANUAL_PIPELINE_TYPE == 'check-float-reference' + when: never - when: on_success .rules-merge-request: @@ -417,21 +425,41 @@ check-compatibility-with-basop-reference-branch: - tests/**/* - scripts/**/* - ci/**/* + - if: ($CI_PIPELINE_SOURCE == 'web' || $CI_PIPELINE_SOURCE == 'trigger') && $MANUAL_PIPELINE_TYPE == 'check-float-reference' - if: $CI_PIPELINE_SOURCE == 'push' when: never tags: - ivas-linux-fast variables: - TEST_SUITE: "tests/codec_be_on_mr_nonselection tests/renderer --param_file scripts/config/self_test_ltv.prm" + TEST_SUITE: "tests/codec_be_on_mr_nonselection tests/renderer" script: - - git clone -b ivas-float-update https://forge.3gpp.org/rep/sa4/audio/ivas-basop.git --single-branch + - git clone -b $BASOP_REFERENCE_BRANCH https://forge.3gpp.org/rep/sa4/audio/ivas-basop.git --single-branch - make -j -C ivas-basop - cp ivas-basop/IVAS_cod ./IVAS_cod_ref - cp ivas-basop/IVAS_dec ./IVAS_dec_ref - python3 ci/remove_unsupported_testcases.py scripts/config/self_test.prm - python3 tests/create_short_testvectors.py - - python3 -m pytest $TEST_SUITE -v --update_ref 1 -m create_ref --create_ref -n auto - - python3 -m pytest $TEST_SUITE -v --update_ref 1 -m create_ref_part2 -n auto + - exit_code1=0 + - exit_code2=0 + - python3 -m pytest tests/codec_be_on_mr_nonselection -v --update_ref 1 -m create_ref --html=report1.html --self-contained-html --junit-xml=report-junit1.xml || exit_code1=$? + - python3 -m pytest tests/codec_be_on_mr_nonselection -v --update_ref 1 -m create_ref_part2 --html=report2.html --self-contained-html --junit-xml=report-junit2.xml || exit_code2=$? + - zero_errors=$(cat report-junit1.xml report-junit2.xml | grep -c 'errors="0"') || true + - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi + - exit 0 + artifacts: + name: "check-float-reference--sha-$CI_COMMIT_SHORT_SHA--results" + when: always + expire_in: 1 month + paths: + - report-junit1.xml + - report-junit2.xml + - report1.html + - report2.html + expose_as: "check-float-reference results" + reports: + junit: + - report-junit1.xml + - report-junit2.xml # --------------------------------------------------------------- # Build jobs -- GitLab From 8c86b56a35690f02564d6cce0fed0a622676c92e Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 8 Aug 2024 17:42:27 +0200 Subject: [PATCH 54/61] add script to diff complexity logs --- scripts/diff_complexity.py | 261 +++++++++++++++++++++++++++++++++++++ 1 file changed, 261 insertions(+) create mode 100755 scripts/diff_complexity.py diff --git a/scripts/diff_complexity.py b/scripts/diff_complexity.py new file mode 100755 index 0000000000..6a218e57ec --- /dev/null +++ b/scripts/diff_complexity.py @@ -0,0 +1,261 @@ +#!/usr/bin/env python3 +""" +(C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository. All Rights Reserved. + +This software is protected by copyright law and by international treaties. +The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository retain full ownership rights in their respective contributions in +the software. This notice grants no license of any kind, including but not limited to patent +license, nor is any license granted by implication, estoppel or otherwise. + +Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +contributions. + +This software is provided "AS IS", without any express or implied warranties. The software is in the +development stage. It is intended exclusively for experts who have experience with such software and +solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +and fitness for a particular purpose are hereby disclaimed and excluded. + +Any dispute, controversy or claim arising under or in relation to providing this software shall be +submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +the United Nations Convention on Contracts on the International Sales of Goods. +""" + +""" + Script to diff IVAS logs produced by WMC tool instrumented binaries + Recommended script usage is adding to path via symlink to somewhere in your $PATH, e.g.: + + ln -s diff_complexity.py ~/bin/cdiff + + This allows: + cdiff +""" +import argparse +import re +from io import StringIO +from shutil import get_terminal_size + +import pandas as pd + +REGEX_WMOPS_TABLE = r"\s?\w+(\s+\w+\.\w+)(\s+\w+\.\w+){3,6}" +REGEX_ROM = ( + r"((\w+\s+\w+)|(\w+\s+\w+\s+)\(.+\))\s?size\s+\(.+\/(\w+)\/.+\)\:\s(\d+)\s+\w+" +) +REGEX_MAX_MEM = r"(Maximum\s+.+)\s+size\:\s+(\d+)" + +PD_STRING_KWARGS = { + "index": False, + "justify": "center", + "max_colwidth": 30, +} +NOCOLOUR = "\x1b[0m" +RED = "\x1b[31m" +GREEN = "\x1b[32m" +BLUE = "\x1b[34m" + + +def log2df(log_file): + """ + Parse a WMC tool logfile to a pandas dataframe + """ + with open(log_file, "r") as log: + logfile = "".join(line for line in log) + + wmops = [ + re.sub(r"\s+", ",", w.group().strip()) + for w in re.finditer(REGEX_WMOPS_TABLE, logfile) + ] + memory = [m.expand(r"\1 (\4), \5") for m in re.finditer(REGEX_ROM, logfile)] + memory.extend([m.expand(r"\1, \2") for m in re.finditer(REGEX_MAX_MEM, logfile)]) + + if not wmops or not memory: + raise ValueError(f"Error parsing {log_file}!") + + wmops = pd.read_csv( + StringIO("\n".join(wmops)), + header=None, + names=[ + "Routine", + "Calls", + "WMOPs min", + "WMOPs max", + "WMOPs avg", + "WMOPs(cum) min", + "WMOPs(cum) max", + "WMOPs(cum) avg", + ], + ) + memory = pd.read_csv( + StringIO("\n".join(memory)), header=None, names=["Type", "Words"] + ) + return wmops, memory + + +def main(bsl, cut, out_file, quiet=False, verbose=False): + if not quiet: + print(GREEN + f"Baseline conditon: {bsl}" + NOCOLOUR) + print(RED + f"Condition under test: {cut}" + NOCOLOUR) + + bsl_wmops, bsl_mem = log2df(bsl) + cut_wmops, cut_mem = log2df(cut) + + if verbose: + PD_STRING_KWARGS["line_width"] = get_terminal_size()[0] + # outer merge on routines, only identical rows are tagged "BOTH" + merge = ( + pd.merge( + cut_wmops.set_index("Routine").drop("total").reset_index(), + bsl_wmops.set_index("Routine").drop("total").reset_index(), + how="outer", + indicator="Source", + ) + .sort_values(["Routine", "Source"], ascending=[True, False]) + .set_index("Source") + ) + merge.index = merge.index.rename_categories( + { + "left_only": RED + "CUT", + "right_only": GREEN + "BSL", + "both": BLUE + "BOTH", + } + ) + + unique = ( + merge.drop(BLUE + "BOTH", errors="ignore") + .reset_index() + .sort_values(["Routine", "Source"], ascending=[True, False]) + ) + common = ( + merge.drop(GREEN + "BSL", errors="ignore") + .drop(RED + "CUT", errors="ignore") + .reset_index() + .sort_values("Routine", ascending=False) + ) + + if not unique.empty: + print( + "Complexity difference of routines".center( + PD_STRING_KWARGS["line_width"], "-" + ) + ) + print(unique.to_string(**PD_STRING_KWARGS) + NOCOLOUR) + + if not common.empty: + print( + "Routines with no differences".center( + PD_STRING_KWARGS["line_width"], "-" + ) + ) + print(common.to_string(**PD_STRING_KWARGS) + NOCOLOUR) + else: + print("All identical routines".center(PD_STRING_KWARGS["line_width"], "-")) + print(merge.to_string(**PD_STRING_KWARGS)) + SEPARATOR = "_" * PD_STRING_KWARGS["line_width"] + print(NOCOLOUR + SEPARATOR) + + table_wmops = pd.concat( + [ + bsl_wmops.iloc[-1][2:5], + cut_wmops.iloc[-1][2:5], + cut_wmops.iloc[-1][2:5] - bsl_wmops.iloc[-1][2:5], + ], + axis=1, + ) + table_wmops.columns = ["BSL", "CUT", "CUT - BSL"] + + table_mem = pd.concat( + [ + bsl_mem.iloc[:, 1], + cut_mem.iloc[:, 1], + cut_mem.iloc[:, 1] - bsl_mem.iloc[:, 1], + ], + axis=1, + ) + table_mem.set_index(bsl_mem.iloc[:, 0], inplace=True) + table_mem.columns = ["BSL", "CUT", "CUT - BSL"] + + table = pd.concat([table_wmops, table_mem]) + + def fmt_diff(x): + if isinstance(x, int): + fmt = "{}" + else: + fmt = "{:.3f}" + + if x > 0: + return RED + fmt.format(x) + NOCOLOUR + if x < 0: + return GREEN + fmt.format(x) + NOCOLOUR + else: + return BLUE + fmt.format(x) + NOCOLOUR + + table["CUT - BSL"] = table["CUT - BSL"].apply(fmt_diff) + + if not quiet: + print() + print(table.to_string(justify="left")) + + if out_file: + table.to_csv(out_file) + elif not quiet: + print("\nNo output file specified - console output only!") + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description="WMC TOOL instrumented log file parser" + ) + + parser.add_argument( + "bsl", + type=str, + help="input logfile for baseline condition", + ) + + parser.add_argument( + "cut", + type=str, + help="input logfile for condition under test", + ) + + parser.add_argument( + "-o", + "--outfile", + required=False, + type=str, + help="output csv table", + ) + + parser.add_argument( + "-q", + "--quiet", + required=False, + action="store_true", + help="no console output", + default=False, + ) + + parser.add_argument( + "-v", + "--verbose", + required=False, + action="store_true", + help="print detailed info about routines", + default=False, + ) + + args = parser.parse_args() + + if args.verbose and args.quiet: + print("Both verbose and quiet options specified, defaulting to verbose") + args.quiet = False + + main(args.bsl, args.cut, args.outfile, args.quiet, args.verbose) -- GitLab From 1c8cc30f179ffb02eda56703e39a8abf138eb62c Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 8 Aug 2024 17:54:46 +0200 Subject: [PATCH 55/61] update strings --- scripts/diff_complexity.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/diff_complexity.py b/scripts/diff_complexity.py index 6a218e57ec..1193b5b1c4 100755 --- a/scripts/diff_complexity.py +++ b/scripts/diff_complexity.py @@ -156,7 +156,11 @@ def main(bsl, cut, out_file, quiet=False, verbose=False): ) print(common.to_string(**PD_STRING_KWARGS) + NOCOLOUR) else: - print("All identical routines".center(PD_STRING_KWARGS["line_width"], "-")) + print( + "No differences in complexity of routines".center( + PD_STRING_KWARGS["line_width"], "-" + ) + ) print(merge.to_string(**PD_STRING_KWARGS)) SEPARATOR = "_" * PD_STRING_KWARGS["line_width"] print(NOCOLOUR + SEPARATOR) @@ -211,7 +215,7 @@ def main(bsl, cut, out_file, quiet=False, verbose=False): if __name__ == "__main__": parser = argparse.ArgumentParser( - description="WMC TOOL instrumented log file parser" + description="WMC TOOL instrumented log file diff tool" ) parser.add_argument( -- GitLab From e61d9db8fbbaaad4db03b2dbc290e27ef09526fe Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 9 Aug 2024 13:57:31 +0200 Subject: [PATCH 56/61] issue 1159: Execute split rendering config only for split rendering outputs; under FIX_1159_SPLIT_RENDERING_CONFIG --- lib_com/options.h | 1 + lib_dec/lib_dec.c | 11 +++++++++-- lib_rend/lib_rend.c | 31 ++++++++++++++++++++----------- lib_rend/lib_rend.h | 4 ++-- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 9401a6f974..c313a39f88 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -174,6 +174,7 @@ #define FIX_1152_UNINIT_VAL_IN_ITD_VAD_COMPUTATION /* FhG: fix uninitialized value being used in ITD VAD mid signal computation that does not affect synthesis, but crashes BASOPs */ #define FIX_1157_OBSOLETE_DMX_TABLE /* FhG: remove obsolte ParamMC DMX table ivas_param_mc_dmx_fac_CICP19_4tc[] */ #define FIX_1135_EXT_RENDERER_HANDLES /* VA: issue 1135: Memory usage reduction in external renderer: Allocate only handles that are really needed. */ +#define FIX_1159_SPLIT_RENDERING_CONFIG /* VA: issue 1159: Execute split rendering config only for split rendering outputs. */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index da4bc04392..c95d24f0ea 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2230,10 +2230,17 @@ ivas_error IVAS_DEC_FeedRenderConfig( hRenderConfig->split_rend_config.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; } - if ( ( error = isar_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasDec->st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) +#ifdef FIX_1159_SPLIT_RENDERING_CONFIG + if ( is_split_rendering_enabled( hIvasDec->st_ivas->hDecoderConfig, hRenderConfig ) ) { - return error; +#endif + if ( ( error = isar_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasDec->st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) + { + return error; + } +#ifdef FIX_1159_SPLIT_RENDERING_CONFIG } +#endif return IVAS_ERR_OK; } diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 15e4c20ab3..8702c8738b 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -609,7 +609,9 @@ static ivas_error validateOutputSampleRate( /* Otherwise rendering to binaural, support the same set as IVAS decoder */ switch ( sampleRate ) { +#ifndef FIX_1159_SPLIT_RENDERING_CONFIG case 8000: +#endif case 16000: case 32000: case 48000: @@ -2930,7 +2932,7 @@ ivas_error IVAS_REND_Open( { if ( ( hIvasRend->splitRendWrapper = (SPLIT_REND_WRAPPER *) malloc( sizeof( SPLIT_REND_WRAPPER ) ) ) == NULL ) { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for IVAS decoder handle" ); + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for IVAS renderer handle" ); } isar_init_split_rend_handles( hIvasRend->splitRendWrapper ); @@ -4253,7 +4255,7 @@ ivas_error IVAS_REND_InitConfig( *-------------------------------------------------------------------*/ ivas_error IVAS_REND_GetRenderConfig( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const IVAS_RENDER_CONFIG_HANDLE hRCout /* o : Render configuration handle */ ) { @@ -4316,7 +4318,7 @@ ivas_error IVAS_REND_GetRenderConfig( *-------------------------------------------------------------------*/ ivas_error IVAS_REND_FeedRenderConfig( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const IVAS_RENDER_CONFIG_DATA renderConfig /* i : Render configuration struct */ ) { @@ -4466,10 +4468,17 @@ ivas_error IVAS_REND_FeedRenderConfig( hRenderConfig->split_rend_config.codec = renderConfig.split_rend_config.codec; - if ( ( error = isar_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) +#ifdef FIX_1159_SPLIT_RENDERING_CONFIG + if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { - return error; +#endif + if ( ( error = isar_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) + { + return error; + } +#ifdef FIX_1159_SPLIT_RENDERING_CONFIG } +#endif /* Must re-initialize split rendering config in case renderer config is updated after adding renderer inputs */ /* if its not initialized yet then no need to re-initialize, initialization will happen while adding inputs*/ @@ -7628,7 +7637,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, @@ -7975,7 +7984,7 @@ int32_t IVAS_REND_GetCntFramesLimited( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_GetHrtfHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ ) { @@ -7997,7 +8006,7 @@ ivas_error IVAS_REND_GetHrtfHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_GetHrtfCRendHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ ) { @@ -8019,7 +8028,7 @@ ivas_error IVAS_REND_GetHrtfCRendHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_GetHrtfFastConvHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_FASTCONV_HANDLE **hHrtfFastConv /* o : FASTCONV HRTF handle */ ) { @@ -8041,7 +8050,7 @@ ivas_error IVAS_REND_GetHrtfFastConvHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_GetHrtfParamBinHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin /* o : Parametric binauralizer HRTF handle */ ) { @@ -8062,7 +8071,7 @@ ivas_error IVAS_REND_GetHrtfParamBinHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_GetHrtfStatisticsHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics /* o : HRTF statistics handle */ ) { diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 819d85b189..299e4ede26 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -243,12 +243,12 @@ ivas_error IVAS_REND_InitConfig( ); ivas_error IVAS_REND_GetRenderConfig( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const IVAS_RENDER_CONFIG_HANDLE hRCout /* o : Render configuration handle */ ); ivas_error IVAS_REND_FeedRenderConfig( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const IVAS_RENDER_CONFIG_DATA renderConfig /* i : Render configuration struct */ ); -- GitLab From 9ed554d17e77940693ce2abadbdfbab52ad2191c Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 9 Aug 2024 14:08:57 +0200 Subject: [PATCH 57/61] Leftover from !1688; under FIX_1135_EXT_RENDERER_HANDLES --- lib_rend/lib_rend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 15e4c20ab3..6765f2b018 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3975,7 +3975,7 @@ ivas_error IVAS_REND_GetDelay( if ( hIvasRend->inputsSba[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { #ifdef FIX_1135_EXT_RENDERER_HANDLES - if ( hIvasRend->splitRendWrapper->hBinHrSplitPreRend != NULL ) + if ( hIvasRend->splitRendWrapper != NULL && hIvasRend->splitRendWrapper->hBinHrSplitPreRend != NULL ) #else if ( hIvasRend->splitRendWrapper.hBinHrSplitPreRend != NULL ) #endif @@ -7628,7 +7628,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, -- GitLab From 84a199cf0d8982a5b552a697cfcf492bffde7d42 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 9 Aug 2024 14:16:00 +0200 Subject: [PATCH 58/61] clang-format --- lib_rend/lib_rend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 6765f2b018..0351e8e342 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7628,7 +7628,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, -- GitLab From 643885c231c02bd232da850ca980a7c84778beb5 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 9 Aug 2024 14:20:33 +0200 Subject: [PATCH 59/61] clang-format --- lib_rend/lib_rend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 8702c8738b..5d47e23e3b 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7637,7 +7637,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, -- GitLab From 7d0f5ac41c920c84a8efa8f8067c400b5fcba17a Mon Sep 17 00:00:00 2001 From: norvell Date: Mon, 12 Aug 2024 06:21:53 +0000 Subject: [PATCH 60/61] Remove unused variable TEST_SUITE --- .gitlab-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8262b5a9f3..757428ea98 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -430,8 +430,6 @@ check-compatibility-with-basop-reference-branch: when: never tags: - ivas-linux-fast - variables: - TEST_SUITE: "tests/codec_be_on_mr_nonselection tests/renderer" script: - git clone -b $BASOP_REFERENCE_BRANCH https://forge.3gpp.org/rep/sa4/audio/ivas-basop.git --single-branch - make -j -C ivas-basop -- GitLab From 116573e5cf52d67ea9ff3967d6f7c933ba6f1a65 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 13 Aug 2024 10:08:24 +0200 Subject: [PATCH 61/61] Add copying of IVAS_{cod,dec} to fix check-compatibility-with-basop-reference-branch --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 757428ea98..97d547d5c5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -435,6 +435,8 @@ check-compatibility-with-basop-reference-branch: - make -j -C ivas-basop - cp ivas-basop/IVAS_cod ./IVAS_cod_ref - cp ivas-basop/IVAS_dec ./IVAS_dec_ref + - cp ivas-basop/IVAS_cod ./IVAS_cod # Not used but needed to launch the pytest + - cp ivas-basop/IVAS_dec ./IVAS_dec # Not used but needed to launch the pytest - python3 ci/remove_unsupported_testcases.py scripts/config/self_test.prm - python3 tests/create_short_testvectors.py - exit_code1=0 -- GitLab