Commit 18ee6506 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

Merge remote-tracking branch 'origin/main' into 1680_basop_port-object-editing-API

parents f1b2f1b9 82546734
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -151,6 +151,7 @@
#define FIX_1387_INIT_PRM_SQQ                           /* FhG: initialize pointer prm_sqQ, which might be uninitialized in case of bfi == 1 */
#define NONBE_1296_TDREND_ITD_OUT_OF_BOUNDS_ACCESS      /* Eri: issue 1296: ITD resampling can occasionally read out of bounds, especially when the requested subframes are short (1.25 ms). Seen for headtracking+JBM. */
#define FIX_1349_TNS_CRASH                              /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */
#define NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING           /* Ericsson: issue 1180, corrected long term mute loop attnuation after 200ms  in PhECU-PLC  */
#define FIX_1179_USAN_PHASEECU                          /* Eri: issue 1179:  better handling of 16 bit wrap around for very long(>200ms) FER-bursts   */

// object-editing feature porting
+50 −4
Original line number Diff line number Diff line
@@ -63,7 +63,11 @@ static Word16 sqrt2ndOrder( const Word16 );
static void windowing( const Word16 *, Word16 *, const Word16 *, const Word16, const Word16 );
static void windowing_ROM_optimized( const Word16 *, Word16 *, const Word16, const Word16, const Word16 );
static void fft_spec2_fx( const Word16[], Word32[], const Word16 );
#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
static void trans_ana_fx( const Word16 *, Word16 *, Word16 *, Word16 *, const Word16, const Word16, const Word16, const Word16, const Word16, Word16 *, Word16 *, Word16 *, Word16 * );
#else
static void trans_ana_fx( const Word16 *, Word16 *, Word16 *, Word16 *, const Word16, const Word16, const Word16, const Word16, Word16 *, Word16 *, Word16 *, Word16 * );
#endif
static void peakfinder_fx( const Word16 *, const Word16, Word16 *, Word16 *, const Word16 );
static Word16 imax_fx( const Word16 *, const Word16 );
static void spec_ana_fx( const Word16 *prevsynth, Word16 *plocs, Word32 *plocsi, Word16 *num_plocs, Word16 *X_sav, const Word16 output_frame, const Word16 bwidth_fx, Word16 *Q );
@@ -230,6 +234,9 @@ static void trans_ana_fx(
    const Word16 time_offs,       /* i  : Time offset (integral multiple of output_frame)        */
    const Word16 est_mus_content, /* i  : 0.0=speech_like ... 1.0=Music    (==st->env_stab )     */
    const Word16 last_fec,        /* i  : signal that previous frame was concealed with fec_alg  */
#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
    const Word16 element_mode, /* i :  element_mode req to handle EVS_MONO specific BE path  */
#endif
    Word16 *alpha,     /* o  : Magnitude modification factors for fade to average     */
    Word16 *beta,      /* o  : Magnitude modification factors for fade to average     */
    Word16 *beta_mute, /* o  : Factor for long-term mute Q15                              */
@@ -555,11 +562,30 @@ static void trans_ana_fx(
            mag_chg[k] = mult_r( mag_chg_1st[k], att_val ); /* Q15 */
            move16();

#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
            IF( NE_16( element_mode, EVS_MONO ) )
            {
                IF( EQ_16( k, 0 ) && GT_16( burst_len, BETA_MUTE_THR ) ) /* beta_mute final long term attenuation adjusted only once per frame in the first sub-band, Ref   Eq(184) in 26.447 */
                {
                    *beta_mute = shr( *beta_mute, 1 );
                    move16();
                }
            }
            ELSE
            {
                IF( GT_16( burst_len, BETA_MUTE_THR ) ) /* legacy incorrect(too fast) EVS_MONO operation, still kept for BE.  To be updated after EVS CR, ref Eq (184) in 26.447 */
                {
                    *beta_mute = shr( *beta_mute, 1 );
                    move16();
                }
            }
#else
            IF( GT_16( burst_len, BETA_MUTE_THR ) )
            {
                *beta_mute = shr( *beta_mute, 1 );
                move16();
            }
#endif
            alpha[k] = mag_chg[k];
            move16();
            /*beta[k] = sqrt(1.0f - SQR(alpha[k])) * *beta_mute;*/
@@ -4519,8 +4545,13 @@ static void ivas_hq_phase_ecu_fx(
#endif

        offset = add( sub( sub( shl( output_frame, 1 ), lprot ), *time_offs ), ph_ecu_lookahead );
#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
        trans_ana_fx( prevsynth + offset, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab,
                      *last_fec, element_mode, alpha, beta, beta_mute, Xavg );
#else
        trans_ana_fx( prevsynth + offset, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab,
                      *last_fec, alpha, beta, beta_mute, Xavg );
#endif

        ivas_spec_ana_fx( prevsynth + offset, plocs, plocsi, num_p, X_sav, output_frame, bwidth_fx, Q_spec, element_mode, &noise_fac, pcorr );

@@ -4540,8 +4571,13 @@ static void ivas_hq_phase_ecu_fx(
        *time_offs = add_sat( *time_offs, output_frame );
        move16();
        offset = sub( shl( output_frame, 1 ), lprot );
#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
        trans_ana_fx( prevsynth + offset, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab,
                      0, element_mode, alpha, beta, beta_mute, Xavg );
#else
        trans_ana_fx( prevsynth + offset, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab,
                      0, alpha, beta, beta_mute, Xavg );
#endif
    }

    Copy( X_sav, X, lprot );
@@ -4630,8 +4666,13 @@ static void hq_phase_ecu_fx(
        }

        offset = sub( sub( shl( output_frame, 1 ), lprot ), *time_offs );
#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
        trans_ana_fx( prevsynth + offset, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab,
                      *last_fec, EVS_MONO, alpha, beta, beta_mute, Xavg );
#else
        trans_ana_fx( prevsynth + offset, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab,
                      *last_fec, alpha, beta, beta_mute, Xavg );
#endif

        spec_ana_fx( prevsynth + offset, plocs, plocsi, num_p, X_sav, output_frame, bwidth_fx, Q_spec );

@@ -4656,8 +4697,13 @@ static void hq_phase_ecu_fx(
        move16();

        offset = sub( shl( output_frame, 1 ), lprot );
#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
        trans_ana_fx( prevsynth + offset, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab,
                      0, EVS_MONO, alpha, beta, beta_mute, Xavg );
#else
        trans_ana_fx( prevsynth + offset, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab,
                      0, alpha, beta, beta_mute, Xavg );
#endif
    }

    Copy( X_sav, X, lprot );