Commit e002f2f6 authored by emerit's avatar emerit
Browse files

Merge branch 'main' into...

Merge branch 'main' into Float-1134-BRIR-Level-differences-between-MC-rendering-to-stereo-and-binaural
parents 72d39bdc 1f2d6a84
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ static void reajust_bits( float *bits_per_bands, const int16_t st_band, const in

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 Find_bit_alloc_IVAS( 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 );

@@ -223,7 +223,7 @@ void bands_and_bit_alloc(
    {
        if ( GSC_IVAS_mode > 0 )
        {
            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_tot_bands = (int16_t) Find_bit_alloc_IVAS( (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;
        }
        else if ( GSC_noisy_speech )
@@ -789,13 +789,13 @@ static float Find_bit_frac(


/*-------------------------------------------------------------------*
 * Find_bit_alloc_IVAS_int()
 * Find_bit_alloc_IVAS()
 *
 *
 *-------------------------------------------------------------------*/

/*! r: Number of bands to encode */
static Word16 Find_bit_alloc_IVAS_int(
static Word16 Find_bit_alloc_IVAS(
    const Word32 core_brate,      /* i  : core bit rate                                         */
    const Word16 GSC_IVAS_mode,   /* i  : GSC IVAS mode                                         */
    const Word16 Diff_len,        /* i  : Length of the difference signal (before pure spectral)*/
@@ -1022,13 +1022,21 @@ static Word16 Find_bit_alloc_IVAS_int(
            sum_bit = L_add( sum_bit, L_sub( bits_per_bands[i], Q18_112 ) );
            /* bits_per_bands[i] = 112; */
            bits_per_bands[i] = Q18_112;
#ifndef FIX_2585_BIT_ALLOCATION_DIFF
            j = add( j, add( i, 1 ) );
#else
            j = add( i, 1 );
#endif
        }
        /* safety check for overage bit reallocation */
        /* else if (bits_per_bands[i] + sum_bit / 3 > 112) */
        else if ( L_add( bits_per_bands[i], Mpy_32_16_1( sum_bit, Q15_0_33 ) ) > Q18_112 )
        {
#ifndef FIX_2585_BIT_ALLOCATION_DIFF
            j = add( j, add( i, 1 ) );
#else
            j = add( i, 1 );
#endif
        }
    }

+1 −0
Original line number Diff line number Diff line
@@ -184,6 +184,7 @@
#define FIX_FMSW_DEC_2                                  /* float issue 1575: fix crash for format switching when bitsream starts with EVS */
#define FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW     /* Orange: float issue 1548: Harmonize non diegetic panning law in ISM and renderers */
#define FIX_FLOAT_1578_OMASA_REND_SPIKES                /* Nokia: Float issue 1578: Fix spikes and collapsed perception in OMASA/MASA rendering to FOA/HOA */
#define FIX_2585_BIT_ALLOCATION_DIFF                    /* VA : issue 2585, bit allocation different behaviors between float and fixed-point for corner cases */

/* ##################### End NON-BE switches ########################### */

+8 −8
Original line number Diff line number Diff line
@@ -66,10 +66,10 @@ inFilesPath = {

for ind=1:size(inFilesPath,2)
    [level_hrir_bin(ind,:), level_hrir(ind,:), gain_hrir_bin(ind,:), gain_hrir(ind,:)] = levelsBinauralizeAudioWithIvas(inFilesPath{ind}{2}, inFilesPath{ind}{1},bitrates, 'BINAURAL');
    disp("levels computed with binaural correction in bs1770 function : " + num2str(level_hrir_bin))
    disp("levesl computed without binaural correction in bs1770 function : " + num2str(level_hrir))
    disp("gains with binaural correction in bs1770 function : " + num2str(gain_hrir_bin(ind,:)))
    disp("gains without binaural correction in bs1770 function : " + num2str(gain_hrir(ind,:)))
    disp("levels hrir " + inFilesPath{ind}{2} + " computed with binaural correction in bs1770 function : " + num2str(level_hrir_bin(ind,:)))
    disp("levesl hrir " + inFilesPath{ind}{2} + "  computed without binaural correction in bs1770 function : " +  num2str(level_hrir(ind,:)))
    disp("gains hrir " + inFilesPath{ind}{2} + " with binaural correction in bs1770 function : " + num2str(gain_hrir_bin(ind,:)))
    disp("gains hrir " + inFilesPath{ind}{2} + " without binaural correction in bs1770 function : " +  num2str(gain_hrir(ind,:)))
end

    level_brir = zeros(size(inFilesPath,2),size(bitrates,2));
@@ -79,10 +79,10 @@ end

for ind=1:size(inFilesPath,2)
    [level_brir_bin(ind,:), level_brir(ind,:), gain_brir_bin(ind,:), gain_brir(ind,:)] = levelsBinauralizeAudioWithIvas(inFilesPath{ind}{2}, inFilesPath{ind}{1},bitrates, 'BINAURAL_ROOM_IR');
    disp("levels computed with binaural correction in bs1770 function : " + num2str(level_brir_bin))
    disp("levesl computed without binaural correction in bs1770 function : " + num2str(level_brir))
    disp("gains with binaural correction in bs1770 function : " + num2str(gain_brir_bin(ind,:)))
    disp("gains without binaural correction in bs1770 function : " + num2str(gain_brir(ind,:)))
    disp("levels brir " + inFilesPath{ind}{2} + " computed with binaural correction in bs1770 function : " + num2str(level_brir_bin(ind,:)))
    disp("levesl brir " + inFilesPath{ind}{2} + " computed without binaural correction in bs1770 function : " + num2str(level_brir(ind,:)))
    disp("gains brir " + inFilesPath{ind}{2} + "  with binaural correction in bs1770 function : " + num2str(gain_brir_bin(ind,:)))
    disp("gains brir " + inFilesPath{ind}{2} + "  without binaural correction in bs1770 function : " + num2str(gain_brir(ind,:)))
end

+108 −0

File changed.

Preview size limit exceeded, changes collapsed.

+36 −36

File changed.

Preview size limit exceeded, changes collapsed.

Loading