Commit cff493b5 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'main' into...

Merge branch 'main' into 1057-segfault-in-mc-decoding-to-binaural_room_reverb-when-using-either-t-or-exof-with-ltv
parents 7d2e66c0 d5a2adaf
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -121,7 +121,11 @@ void generate_nelp_excitation(

        for ( j = 0; j < len; j++ )
        {
#ifdef FIX_970_USAN_IN_NELP_SEED
            tmp[j] = ( ( *seed ) = (int16_t) ( 521 * ( *seed ) + 259 ) ) / PCM16_TO_FLT_FAC;
#else
            tmp[j] = ( ( *seed ) = 521 * ( *seed ) + 259 ) / PCM16_TO_FLT_FAC;
#endif
            tmp1[j] = ABSVAL( tmp[j] );
            I[j] = j;
        }
+6 −2
Original line number Diff line number Diff line
@@ -159,6 +159,9 @@
#define FIX_1033_MEMORY_LEAK_OMASA                      /* Nokia / Orange: issue #1033: Memory leak in OMASA to BINAURAL with HRTF with bitrate switching */
#define FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI      /* FhG: move setting of pointers for parameter decoding so they are skipped in lost frames when they are not needed */
#define FIX_1043_JBM_MD_BUFFER                          /* VA: issue 1043: JBM MD handle allocation is avoided in non-JBM EXT operations */
#define FIX_970_USAN_IN_NELP_SEED
#define FIX_1044_ISM_REND_MEMORY                        /* VA: issue 1044: Lower the memory of the ISM renderer handle. */


/* #################### End BE switches ################################## */

@@ -167,12 +170,13 @@
/* all switches in this category should start with "NONBE_" */

#define NONBE_FIX_1075                                  /* FhG: fix segfault for bitrate switching + BINAURAL_ROOM_REVERB output in MC */
#define NON_BE_FIX_EVS_USAN_ERR_IN_WAVEADJUST           /* FhG: address issue 1037 */
#define NON_BE_1055_RESET_LP_MEMORIES                   /* VA: issue 1055: Correctly reset LP filter MA and AR memories in bitrate switching */
#define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM   /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */
#define NONBE_FIX_1056_ISM_RATE_SWITCH                  /* FhG: Fix #1056: fix TC buffer udpate on a ISM rate switch */	

#define NON_BE_FIX_1048_THRESHOLD_COH_BASOP             /* Nokia: Fix 1048 replace comparison with 0 with comparison to threshold, to align with BASOP*/
#define NONBE_FIX_1054_NEGATIVE_LVQ_INDEX               /* Nokia: issue 1054: Input to decode_comb in deindex_lvq_SHB should be positive */
#define NONBE_FIX_1063_DIV_BY_ZERO_SUMNRG               /* VoiceAge: issue 1063: division by zero for angle_rot feature in the UNCLR classifier */

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

+8 −0
Original line number Diff line number Diff line
@@ -804,10 +804,18 @@ typedef struct ivas_lfe_dec_data_structure

typedef struct renderer_struct
{
#ifdef FIX_1044_ISM_REND_MEMORY
    float prev_gains[MAX_NUM_OBJECTS][MAX_OUTPUT_CHANNELS];
#else
    float prev_gains[MAX_CICP_CHANNELS - 1][MAX_OUTPUT_CHANNELS];
#endif
    float *interpolator;
    int16_t interpolator_length;
#ifdef FIX_1044_ISM_REND_MEMORY
    float gains[MAX_NUM_OBJECTS][MAX_OUTPUT_CHANNELS];
#else
    float gains[MAX_CICP_CHANNELS - 1][MAX_OUTPUT_CHANNELS];
#endif

} ISM_RENDERER_DATA, *ISM_RENDERER_HANDLE;

+6 −0
Original line number Diff line number Diff line
@@ -742,7 +742,13 @@ void concealment_decode(
            /* sign randomization */
            for ( i = 0; i < hPlcInfo->L_frameTCX; i++ )
            {
#ifdef NON_BE_FIX_EVS_USAN_ERR_IN_WAVEADJUST
                int16_t rnd;
                rnd = own_random( seed );
                sign = ( rnd >= 0 ) - ( rnd < 0 );
#else
                sign = ( ( own_random( seed ) >> 15 ) << 1 ) + 1;
#endif
                invkoef[i] *= sign;
            }
        }
+18 −2
Original line number Diff line number Diff line
@@ -640,9 +640,10 @@ void stereo_dft_enc_compute_itd(
    STEREO_CLASSIF_HANDLE hStereoClassif;
    const float *dft_trigo32k;
    float trigo_enc[STEREO_DFT_N_32k_ENC / 2 + 1];

    float cng_xcorr_filt;

#ifdef NONBE_FIX_1063_DIV_BY_ZERO_SUMNRG
    float sum_nrg_delta;
#endif
    int16_t prev_itd_max;
    int16_t itd_max_flip;

@@ -727,7 +728,10 @@ void stereo_dft_enc_compute_itd(
        grand_dot_prod_real += xcorr[2 * i];
        grand_dot_prod_img += xcorr[2 * i + 1];
        xcorr_abs[i] = sqrtf( xcorr[2 * i] * xcorr[2 * i] + xcorr[2 * i + 1] * xcorr[2 * i + 1] );

#ifndef NONBE_FIX_1063_DIV_BY_ZERO_SUMNRG
        /* VM: prod_LL tends to overflow, better to replace with sum(log(prod_L)) and retrain the classifier */
#endif
        prod_LL = prod_L;
        prod_RR = prod_R;

@@ -784,7 +788,19 @@ void stereo_dft_enc_compute_itd(
        hStereoClassif->unclr_fv[E_gainIPD] = g_IPD;
        hStereoClassif->xtalk_fv[E_gainIPD] = g_IPD;

#ifdef NONBE_FIX_1063_DIV_BY_ZERO_SUMNRG
        if ( sum_nrg_L >= sum_nrg_R )
        {
            sum_nrg_delta = max( sum_nrg_L - sum_nrg_R, 1.0f );
        }
        else
        {
            sum_nrg_delta = min( sum_nrg_L - sum_nrg_R, -1.0f );
        }
        angle_rot = fabsf( atanf( 2.0f * ( grand_dot_prod_real ) / sum_nrg_delta ) );
#else
        angle_rot = fabsf( atanf( 2.0f * ( grand_dot_prod_real ) / ( sum_nrg_L - sum_nrg_R + 1.0f ) ) );
#endif
        hStereoClassif->unclr_fv[E_angle_rot] = angle_rot;
        hStereoClassif->xtalk_fv[E_angle_rot] = angle_rot;

Loading