Commit 452053b7 authored by Jiaquan Huo's avatar Jiaquan Huo
Browse files

Merge branch 'main' into lfe-plc-precision

parents 69a3d22b a5f949bf
Loading
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -198,10 +198,12 @@ def tr_from_row(row, id_current, id_previous):
            try:
                if float(curr) > float(prev):
                    curr += f" {ARROW_UP}"
                    td_tmpl_curr = TD_TMPL_INCREASE
                    # increase is bad -> mark in red, execpt for SNR for which it is good -> mark in green
                    td_tmpl_curr = TD_TMPL_REDUCE if c == "MIN_SSNR" else TD_TMPL_INCREASE
                elif float(curr) < float(prev):
                    curr += f" {ARROW_DOWN}"
                    td_tmpl_curr = TD_TMPL_REDUCE
                    # reduce is good -> mark in green, execpt for SNR for which it is bad -> mark in red
                    td_tmpl_curr = TD_TMPL_INCREASE if c == "MIN_SSNR" else TD_TMPL_REDUCE
            except ValueError:
                # if we land here, one of the cells is not a number, this indicates a crash
                # or some error in the scripts, so mark with red as well
@@ -258,7 +260,12 @@ def merge_and_cleanup_mld_reports(
            for col_pair in other_col_pairs:
                col_prev = col_pair[0]
                col_curr = col_pair[1]

                try:
                    diff_other += abs(float(x[col_curr]) - float(x[col_prev]))
                except ValueError:
                    # can't make float from the column contents, probably NONE -> put to top
                    diff_other += float("inf")

            if diff_other > 0:
                diff = -1000000
+5 −2
Original line number Diff line number Diff line
@@ -65,9 +65,12 @@ def get_job_id(branch_name, job_name, project_id, success_only):
                if job_name not in resp_jobs.text:
                    continue

                # find actual job by name
                # find actual job by name, exclude timed out or stuck jobs
                for job in resp_jobs.json():
                    if job["name"] == job_name:
                    name_matches = job["name"] == job_name
                    is_success = job["status"] == "success"
                    has_timed_out = job.get("failure_reason", "") == "stuck_or_timeout_failure"
                    if name_matches and (is_success or not has_timed_out):
                        job_id = job["id"]
                        break
                if job_id >= 0:
+7 −0
Original line number Diff line number Diff line
@@ -54,6 +54,13 @@ TESTCASES = [
    "Multi-channel 5_1_4 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 32kHz out, EXT out",
    "Multi-channel 7_1 bitrate switching from 24.4 kbps to 256 kbps, 48kHz in, 16kHz out, EXT out",
    "Multi-channel 7_1_4 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, EXT out",
    "SBA planar 2OA bitrate switching from 13.2 kbps to 128 kbps, 32kHz in, 32kHz out, DTX on, EXT out",
    "SBA planar FOA bitrate switching from 13.2 kbps to 512 kbps, 32kHz in, 32kHz out, EXT out",
    "SBA 2OA bitrate switching from 13.2 kbps to 512 kbps, 32kHz in, 32kHz out, EXT out",
    "SBA planar 3OA bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, random FER at 5%, EXT out",
    "Multi-channel 5_1 at 512 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB out custom acoustic environment with a sequence (CREND)",
    "Multi-channel 5_1 at 64 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB out custom acoustic environment with a sequence (FastConv)",
    "Multi-channel 5_1 at 32 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB out custom acoustic environment with a sequence (ParamBin)",
]


+2 −193
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@
#include "wmc_auto.h"


#ifdef NON_BE_FIX_1137_GSC_IVAS_FXFLT_DECODING
/*-------------------------------------------------------------------*
 * Local constants
 *-------------------------------------------------------------------*/
@@ -71,7 +70,6 @@
#define Q31_0_17    365072220 /* 0.17  */
#define Q31_0_23    493921239 /* 0.23  */

#endif

/*-------------------------------------------------------------------*
 * Local function prototypes
@@ -81,14 +79,12 @@ static float Find_bit_frac( const int16_t nb_band, const int16_t remaining_bits

static void reajust_bits( float *bits_per_bands, const int16_t st_band, const int16_t end_band, const int16_t sum_bit_in, const int16_t bit_bdgt_in );

#ifdef NON_BE_FIX_1137_GSC_IVAS_FXFLT_DECODING
static Word16 Find_norm_inv( const Word32 ToDivide, Word16 *e_div );

static Word16 Find_bit_alloc_IVAS_int( const Word32 core_brate, const Word16 GSC_IVAS_mode, const Word16 Diff_len, const Word16 nb_tot_bands, const Word16 L_frame, Word16 *bit, Word16 *max_ener_band, float *ener_vec, float *bits_per_bands );

static Word16 maximum_fx( const Word16 *vec_fx, const Word16 lvec_fx, Word16 *max_fx );

#endif

/*-------------------------------------------------------------------*
 * bands_and_bit_alloc()
@@ -127,12 +123,8 @@ void bands_and_bit_alloc(
    int16_t pos, band;
    float SWB_bit_budget;
    float bits_per_bands[MBANDS_GN_BITALLOC16k];
#ifndef NON_BE_FIX_1137_GSC_IVAS_FXFLT_DECODING
    float fzero_val, mp, mb, nb_bands_adj, bit_adj;
    int16_t nb_pulse_per_band[MBANDS_GN_BITALLOC16k];
#else
    float fzero_val;
#endif

    /* initializations */
    nb_tot_bands = 16;
    set_f( bits_per_bands, 0.0f, MBANDS_GN_BITALLOC16k );
@@ -231,189 +223,8 @@ void bands_and_bit_alloc(
    {
        if ( GSC_IVAS_mode > 0 )
        {
#ifndef NON_BE_FIX_1137_GSC_IVAS_FXFLT_DECODING
            SWB_bit_budget = *bit;
            st_band = 5;

            set_f( bits_per_bands, 0, MBANDS_GN_BITALLOC16k );

            /* 2- Decide the pourcentage of bits allocated to LF (between 50-75%) depending of the temporal contribution in GSC */
            bit_fracf = ( -0.125f * Diff_len + 76.0f ) / 100;
            bit_fracf = check_bounds( bit_fracf, 0.50f, 0.75f );

            /* Adjusment of the bitrate between LF and HF base on the content type */
            /* 1 = new GSC bit alloc
               2 = GSC bit alloc for tc frame
               3 = more music like (should not happen often given music is coded with dft) */

            if ( GSC_IVAS_mode <= 3 )
            {
                nb_bands_max -= 6;
            }

            if ( GSC_IVAS_mode == 2 )
            {
                bit_fracf += 0.1f;
                nb_bands_max--;
            }

            if ( GSC_IVAS_mode == 3 )
            {
                bit_fracf -= 0.1f;
                nb_bands_max += 3;
            }

            /* First find how much we want to share between LF and HF, at low bitrate, a miminum of bits is needed in LF by limitating the number of bands*/
            /* Adjust the number of band based on the content type and bitrate */
            nb_bands_adj = 1.0f;
            if ( GSC_IVAS_mode == 1 && core_brate < GSC_L_RATE_STG )
            {
                nb_bands_adj = 0.0125f * SWB_bit_budget - 0.75f;
            }
            else if ( GSC_IVAS_mode != 2 && core_brate > GSC_H_RATE_STG )
            {
                nb_bands_adj = 0.02f * SWB_bit_budget - 1.2f;
            }
            nb_bands_max = (int16_t) ( nb_bands_max * nb_bands_adj + 0.5f );
            nb_bands_max = check_bounds_s( nb_bands_max, 5, nb_tot_bands );

            bit_fracf *= SWB_bit_budget;

            /* Estimation of the number of bit used in HF */
            /* with only the first weigthing The number of bits in max_ener_band[st_band-1] = 17% of bit_fracf */
            mb = .17f * bit_fracf;
            mp = ( 2.0f * DSR_NB_PULSE );
            if ( core_brate < GSC_L_RATE_STG && GSC_IVAS_mode == 3 )
            {
                mp = 1.5f * DSR_NB_PULSE;
            }
            else if ( core_brate < GSC_L_RATE_STG )
            {
                mp = DSR_NB_PULSE;
            }

            /* We want  max_ener_band[st_band] <=  max_ener_band[st_band-1] and  max_ener_band[nb_bands_max-1] <=  max_ener_band[st_band]*/
            /* We will estimate the number of bits to allocate of HF and put the remaining bits, if any, back on LF */
            /* compute the total possible number of band to be coded */
            nb_tot_bands = (int16_t) ( ( SWB_bit_budget - bit_fracf ) / ( mp + ( mb - mp ) / 2.0f ) );
            mp = min( mp, mb );
            if ( nb_tot_bands + st_band > nb_bands_max )
            {
                bit_adj = ( ( mb + mp ) / 2 ) * ( nb_tot_bands + st_band - nb_bands_max );
                bit_adj = max( 0, bit_adj );
                nb_tot_bands = nb_bands_max - st_band;
                bit_fracf += bit_adj;
            }
            nb_tot_bands += st_band;

            /* Allocate bits to LF */
            etmp = 0.23f;
            for ( j = 0; j < st_band; j++ )
            {
                i = j;
                max_ener_band[j] = i;
                ener_vec[i] = MIN16B;
                bits_per_bands[j] = etmp * bit_fracf;
                etmp -= 0.015f;
            }

            SWB_bit_budget -= bit_fracf;

            /* Find low energy band in HF */
            set_s( nb_pulse_per_band, 2, MBANDS_GN_BITALLOC16k );
            for ( i = st_band + 2; i < nb_tot_bands - 1; i++ )
            {
                if ( ener_vec[i] < ener_vec[i - 1] && ener_vec[i] < ener_vec[i + 1] )
                {
                    nb_pulse_per_band[i] = 1;
                }
            }
            for ( j = st_band; j < nb_tot_bands; j++ )
            {
                if ( j > 6 )
                {
                    i = maximum( ener_vec, nb_tot_bands, &etmp );
                }
                else
                {
                    i = j;
                }

                max_ener_band[j] = i;
                ener_vec[i] = MIN16B;
            }

            /* Recompute the final bit distribution for HF */
            if ( nb_tot_bands > st_band )
            {
                bit_fracf = DSR_NB_PULSE;
                mb = ( SWB_bit_budget * 2 / ( nb_tot_bands - st_band ) ) - mp;
                bit_fracf = ( mb - mp ) / ( nb_tot_bands - st_band );
                mb -= bit_fracf;
                /* Do the distribution */
                for ( j = st_band; j < nb_tot_bands; j++ )
                {
                    if ( nb_pulse_per_band[max_ener_band[j]] > 1 )
                    {
                        bits_per_bands[max_ener_band[j]] = mb;
                    }
                    else
                    {
                        bits_per_bands[max_ener_band[j]] = 4.5f;
                    }
                    mb -= bit_fracf;
                    SWB_bit_budget -= bits_per_bands[max_ener_band[j]];
                }
            }

            /* Series of verification in case bit allocated != the budget */
            if ( SWB_bit_budget > 0 )
            {
                i = st_band - 1;
                while ( SWB_bit_budget > 0 )
                {
                    bits_per_bands[i]++;
                    SWB_bit_budget--;
                    i--;
                    if ( i == -1 )
                    {
                        i = st_band - 1;
                    }
                }
            }

            nb_bands = nb_tot_bands;

            sum_bit = 0;
            j = 0;
            for ( i = 0; i < nb_bands; i++ )
            {
                if ( bits_per_bands[i] > 112 )
                {
                    sum_bit += bits_per_bands[i] - 112;
                    bits_per_bands[i] = 112;
                    j = i + 1;
                }

                /* safety check for overage bit reallocation */
                else if ( bits_per_bands[i] + sum_bit / 3 > 112 )
                {
                    j = i + 1;
                }
            }

            if ( sum_bit != 0 )
            {
                sum_bit /= ( nb_bands - j );
                for ( i = j; i < nb_bands; i++ )
                {
                    bits_per_bands[i] += sum_bit;
                }
            }
#else
            nb_tot_bands = (int16_t) Find_bit_alloc_IVAS_int( (Word32) core_brate, (Word16) GSC_IVAS_mode, (Word16) Diff_len, (Word16) nb_tot_bands, (Word16) L_frame, (Word16 *) bit, (Word16 *) max_ener_band, ener_vec, bits_per_bands );
            nb_bands = nb_tot_bands;
#endif
        }
        else if ( GSC_noisy_speech )
        {
@@ -976,7 +787,6 @@ static float Find_bit_frac(
    return ( var_out );
}

#ifdef NON_BE_FIX_1137_GSC_IVAS_FXFLT_DECODING

/*-------------------------------------------------------------------*
 * Find_bit_alloc_IVAS_int()
@@ -1159,7 +969,7 @@ static Word16 Find_bit_alloc_IVAS_int(
    }

    /* Recompute the final bit distribution for HF */
    IF( nb_tot_bands_loc > st_band )
    if ( nb_tot_bands_loc > st_band )
    {
        /* mb = ( SWB_bit_budget * 2 / ( nb_tot_bands_loc - st_band ) ) - mp; */
        d_tmp = Find_norm_inv( L_deposit_h( sub( nb_tot_bands_loc, st_band ) ), &e_div );
@@ -1295,4 +1105,3 @@ static Word16 maximum_fx(

    return ind;
}
#endif
+0 −3
Original line number Diff line number Diff line
@@ -160,8 +160,6 @@
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */

#define FIX_CREND_SIMPLIFY_CODE                         /* Ora : simplify line code in crend */
#define FIX_1138_SBA_EXT_ERROR_PRINTOUT                 /* VA: issue 1138: Fix SBA EXT output call of audioCfg2channels() */
#define FIX_1117_ISAR_MALLOC                            /* VA: issue 1117: call ISAR malloc() only at the initialization. */
#define TMP_FIX_1119_SPLIT_RENDERING_VOIP               /* FhG: Add error check for unsupported config: split rendering with VoIP mode */
#define FIX_1113_EXTREND_ISAR                           /* FhG: issue 1113: fix external renderer asserts for FOA/HOA2 and CLDFB config */
#define FIX_1113_CLDFB_REND_IN_ISAR                     /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */
@@ -181,7 +179,6 @@
/* any switch which is non-be wrt selection floating point code */
/* 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 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 */

Loading