Commit f8b5c56d authored by multrus's avatar multrus
Browse files

merge from main

parents 0a4485a8 496d928d
Loading
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -1183,7 +1183,12 @@ void stereo_dft_dec_fx(

Word32 stereo_dft_enc_synthesize_fx(
    STEREO_DFT_ENC_DATA_HANDLE hStereoDft,                      /* i/o: encoder stereo handle               */
#ifdef NONBE_FIX_ISSUE_2206
    Word32 *output_fx,                                          /* i/o  : output synthesis         q_output */
    Word16 *q_output,                                           /* i/o  : output synthesis               Q0 */
#else
    Word32 *output_fx,                                          /* o  : output synthesis                Q16 */
#endif
    Word16 *output_start_index,
    Word16 *output_end_index,
    const Word16 chan,                                          /* i  : channel number                      */
@@ -1363,7 +1368,12 @@ void stereo_tcx_init_dec_fx(

void stereo_icBWE_enc_fx(
    CPE_ENC_HANDLE hCPE,                                        /* i/o: CPE encoder structure                */
#ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT
    const Word16 shb_speech_ref_fx16[],                         /* i  : SHB speech ref channel             shb_speech_ref_q*/
    const Word16 shb_speech_ref_q,                              /* i  : SHB speech ref channel Q             */
#else
    const Word16 shb_speech_ref_fx16[],                         /* i  : SHB speech ref channel             Q0*/
#endif
    Word16 shb_speech_nonref_fx_16[],                           /* i/o: SHB speech non-ref channel         shb_speech_nonref_e*/
    Word16 shb_speech_nonref_e,                                 /* i/o: SHB speech non-ref channel           */
    const Word16 *voice_factors_fx                              /* i  : voicing factors                  Q15 */
@@ -2681,6 +2691,9 @@ Word16 ivas_acelp_tcx20_switching_fx(
    Word16 *inp_fx,                                             /* i  : new input signal                        */
    Word16 q_inp,                                               /* i  : i/p Q                                   */
    Word16 *wsp,                                                /* i  : input weighted signal                   */
#ifdef NONBE_FIX_ISSUE_2206
    Word16 q_wsp,                                               /* i  : Q of input weighted signal                   */
#endif
    Word32 non_staX,                                            /* i  : unbound non-stationarity for sp/mu clas */
    Word16 *pitch_fr,                                           /* i  : fraction pitch values                   */
    Word16 *voicing_fr,                                         /* i  : fractional voicing values               */
@@ -5706,7 +5719,12 @@ void pre_proc_ivas_fx(
    Word16 *epsP_fx_q,                                          /* i  : LP prediction errors                                   */
    Word16 lsp_new_fx[M],                                       /* i/o: LSPs at the end of the frame                        Q15*/
    Word16 lsp_mid_fx[M],                                       /* i/o: LSPs in the middle of the frame                     Q15*/
#ifdef NONBE_FIX_ISSUE_2206
    Word16 *new_inp_resamp16k_fx,                               /* o  : new input signal @16kHz, non pre-emphasised, used by the WB TBE/BWE    q_new_inp_resamp16k_fx*/
    Word16 *q_new_inp_resamp16k_fx,                             /* o  : Q value of new input signal @16kHz, non pre-emphasised, used by the WB TBE/BWE */
#else
    Word16 *new_inp_resamp16k_fx,                               /* o  : new input signal @16kHz, non pre-emphasised, used by the WB TBE/BWE    Q_new-1*/
#endif
    Word16 *Voicing_flag,                                       /* o  : voicing flag for HQ FEC                              Q0*/
    Word16 old_wsp_fx[],                                        /* i  : weighted input signal buffer                  e_old_wsp*/
    const Word16 e_old_wsp,                                     /* i  : Q value of weighted input signal buffer                */
+7 −0
Original line number Diff line number Diff line
@@ -84,6 +84,12 @@
#define FIX_1990_SANITIZER_IN_REVERB_LOAD               /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define NONBE_FIX_ISSUE_2206                            /* FhG: Calculate st->q_inp and Q_new dynamically for all data paths instead of assuming constant values */
#define NONBE_FIX_ISSUE_2206_TV1                        /* VA/FhG: Calculate st->q_inp also considering st->mem_q decimation memory to avoid saturation */
#define NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT             /* FhG: Dynamic scale of shb_speech buffers */
#define NONBE_FIX_ISSUE_2206_TD_CHANNEL_EXTRAPOLATION   /* FhG: Use different scale to avoid saturation of LPC coefficient in TD Stereo signal extrapolation. */
#define NONBE_FIX_ISSUE_2206_AVOID_OVERFLOW_SWB_fenv_fx2 /* FhG: Avoid overflow of SWB_fenv_fx in SWB_BWE_encoding_fx because of very small energies. */
#define NONBE_FIX_ISSUE_2206_AVOID_OVERFLOW_MSVQ_Interpol_Tran_fx /* FhG: Fix saturation crash in MSVQ_Interpol_Tran_fx() */
#define HARM_HQ_CORE_KEEP_BE                            /* hack to keep all BE after HQ core functions harmonization; pending resolving issues #2450, #2451, #2452 */
#define FIX_2452_HQ_CORE_PEAQ_AVR_RATIO_HARM            /* Eri: Basop issue 2453: Fix alignment of peak_avrg_ratio_fx */
#define FIX_2480_HARM_TONALMDCT                         /* FhG: basop issue 2480: Harmonize TonalMDCTConceal_Detect_fx() and TonalMDCTConceal_Detect_ivas_fx() */
@@ -96,6 +102,7 @@
#define OPTIMIZE_FFT_STACK                              /* VA: removal of intermediate FFT buffers */
#define HARMONIZE_DCT                                   /* VA: removal of duplicated DCT functions */
#define FIX_2489_HARMONIZE_FdCng_encodeSID              /* FhG: harmonize FdCng_encodeSID_fx() and FdCng_encodeSID_ivas_fx()  */
#define FIX_1527_CMR_BITRATE_IDX                        /* Fix for incorrect bitrate idx packed in rtp CMR E-byte */
#define HARMONIZE_2494_FdCng_decodeSID_fx               /* FhG: harmonize FdCng_decodeSID_fx with _ivas_ version */

/* #################### End BE switches ################################## */
+22 −0
Original line number Diff line number Diff line
@@ -4134,7 +4134,11 @@ Word16 L_norm_arr( const Word32 *arr, Word16 size );
#ifdef OPTIMIZE_FFT_STACK
Word16 L_norm_arr_cmplx( const cmplx *arr, Word16 size );
#endif
#ifdef NONBE_FIX_ISSUE_2206
Word16 norm_arr( const Word16 *arr, Word16 size );
#else
Word16 norm_arr( Word16 *arr, Word16 size );
#endif
Word16 W_norm_arr( Word64 *arr, Word16 size );

Word16 get_min_scalefactor( Word32 x, Word32 y );
@@ -8770,6 +8774,15 @@ void Copy_Scale_sig(
    const Word16 exp0 /* i  : exponent: x = round(x << exp)   Qx ?exp  */
);

#ifdef NONBE_FIX_ISSUE_2206
void Copy_Scale_sig_nosat(
    const Word16 x[], /* i  : signal to scale i             Qx        */
    Word16 y[],       /* o  : scaled signal output            Qx        */
    const Word16 lg,  /* i  : size of x[]                     Q0        */
    const Word16 exp0 /* i  : exponent: x = round(x << exp)   Qx ?exp  */
);
#endif

void Scale_sig32(
    Word32 x[],       /* i/o: signal to scale                 Qx        */
    const Word16 lg,  /* i  : size of x[]                     Q0        */
@@ -8804,6 +8817,15 @@ void Copy_Scale_sig_32_16(
    const Word16 exp0 /* i  : exponent: x = round(x << exp)   Qx ?exp  */
);

#ifdef NONBE_FIX_ISSUE_2206
void Copy_Scale_sig_32_16_nosat(
    const Word32 x[], /* i  : signal to scale input           Qx        */
    Word16 y[],       /* o  : scaled signal output            Qx        */
    const Word16 lg,  /* i  : size of x[]                     Q0        */
    const Word16 exp0 /* i  : exponent: x = round(x << exp)   Qx ?exp  */
);
#endif

void Random_Fill(
    Word16 *seed,  /* i/o: random seed         */
    Word16 n,      /* i  : number of values    */
+4 −0
Original line number Diff line number Diff line
@@ -5281,7 +5281,11 @@ static void Estimate_mix_factors_fx(

    pow3 = Dot_product( shb_res_local, shb_res_local, L_FRAME16k ); /* (2*Q_shb+1) */

#ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT
    pow3 = L_add_sat( pow3, L_shl( 21475l /*0.00001f in Q31*/, 2 * Q_shb + 1 - 31 ) ); /* (2*Q_shb+1) */
#else
    pow3 = L_add( pow3, L_shl( 21475l /*0.00001f in Q31*/, 2 * Q_shb + 1 - 31 ) ); /* (2*Q_shb+1) */
#endif
    if ( pow3 == 0 )
    {
        pow3 = 1;
+93 −0
Original line number Diff line number Diff line
@@ -1249,6 +1249,60 @@ void Copy_Scale_sig(
    return;
}

#ifdef NONBE_FIX_ISSUE_2206
/*-------------------------------------------------------------------*
 * Copy_Scale_sig
 *
 * Up/down scale a 16 bits vector x and move it into y
 *-------------------------------------------------------------------*/

void Copy_Scale_sig_nosat(
    const Word16 x[], /* i  : signal to scale input           Qx        */
    Word16 y[],       /* o  : scaled signal output            Qx        */
    const Word16 lg,  /* i  : size of x[]                     Q0        */
    const Word16 exp0 /* i  : exponent: x = round(x << exp)   Qx ?exp  */
)
{
    Word16 i;
    Word16 tmp;

    IF( exp0 == 0 )
    {
        FOR( i = 0; i < lg; i++ )
        {
            y[i] = x[i];
            move16();
        }
        return;
    }
    IF( exp0 < -15 )
    {
        FOR( i = 0; i < lg; i++ )
        {
            y[i] = 0;
            move16();
        }
        return;
    }
    IF( exp0 < 0 )
    {
        tmp = shl( -32768, exp0 ); /* we use negative to correctly represent 1.0 */
        FOR( i = 0; i < lg; i++ )
        {
            y[i] = msu_r( 0, x[i], tmp );
            move16();
        }
        return;
    }
    FOR( i = 0; i < lg; i++ )
    {
        y[i] = shl( x[i], exp0 );
        move16();
    }

    return;
}
#endif

/*-------------------------------------------------------------------*
 * Copy_Scale_sig
@@ -1407,6 +1461,39 @@ void Copy_Scale_sig_32_16(
    return;
}

#ifdef NONBE_FIX_ISSUE_2206
void Copy_Scale_sig_32_16_nosat(
    const Word32 x[], /* i  : signal to scale input           Qx        */
    Word16 y[],       /* o  : scaled signal output            Qx        */
    const Word16 lg,  /* i  : size of x[]                     Q0        */
    const Word16 exp0 /* i  : exponent: x = round(x << exp)   Qx ?exp  */
)
{
    Word16 i;
    Word16 tmp;

    tmp = add( 16, exp0 );
    IF( tmp != 0 )
    {
        FOR( i = 0; i < lg; i++ )
        {
            y[i] = round_fx_sat( L_shl_sat( x[i], tmp ) );
            move16();
        }
    }
    ELSE
    {
        FOR( i = 0; i < lg; i++ )
        {
            y[i] = round_fx_sat( x[i] );
            move16();
        }
    }

    return;
}

#endif

/*-------------------------------------------------------------------*
 * Scale_sig32
@@ -5407,9 +5494,15 @@ Word16 L_norm_arr_cmplx(
}
#endif

#ifdef NONBE_FIX_ISSUE_2206
Word16 norm_arr(
    const Word16 *arr,
    Word16 size )
#else
Word16 norm_arr(
    Word16 *arr,
    Word16 size )
#endif
{
    Word16 q = 15;
    Word16 exp = 0;
Loading