Commit b4fce766 authored by fotopoulou's avatar fotopoulou
Browse files

Merge branch 'ivas-float-update' into 1680_ref_port_object_editing_implementation

parents e67545f4 59dbe57e
Loading
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -206,6 +206,15 @@
#define FIX_1387_INIT_PRM_SQQ                           /* FhG: initialize pointer prm_sqQ, which might be uninitialized in case of bfi == 1 */
#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 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 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  */ 

// object-editing feature porting
#define OBJ_EDITING_API                                 /* object editing changes related to the API */
#ifdef OBJ_EDITING_API
#define FIX_HRTF_LOAD_API                               // solves API conflicts between HRTF and object-editing features
#define TMP_FIX_SPLIT_REND                              // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions)
#define TMP_FIX_OMASA_SR_BE                             // temporary fix to keep OMASA split-rendering BE
#endif


// objject-editing feature porting
// objject-editing feature porting
#define OBJ_EDITING_INTERFACE                         /* Interface for object editing */
#define OBJ_EDITING_INTERFACE                         /* Interface for object editing */
+34 −6
Original line number Original line Diff line number Diff line
@@ -263,6 +263,9 @@ static void trans_ana(
    const int16_t time_offs,     /* i  : Time offset                                          */
    const int16_t time_offs,     /* i  : Time offset                                          */
    const float est_mus_content, /* i  : 0.0=speech_like ... 1.0=Music    (==st->env_stab )   */
    const float est_mus_content, /* i  : 0.0=speech_like ... 1.0=Music    (==st->env_stab )   */
    const int16_t last_fec,      /* i  : signal that previous frame was concealed with fec_alg*/
    const int16_t last_fec,      /* i  : signal that previous frame was concealed with fec_alg*/
#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
    const int16_t element_mode, /* i :  element_mode req to handle EVS_MONO specific BE path  */
#endif
    float *alpha,       /* o  : Magnitude modification factors for fade to average   */
    float *alpha,       /* o  : Magnitude modification factors for fade to average   */
    float *beta,        /* o  : Magnitude modification factors for fade to average   */
    float *beta,        /* o  : Magnitude modification factors for fade to average   */
    float *beta_mute,   /* o  : Factor for long-term mute                            */
    float *beta_mute,   /* o  : Factor for long-term mute                            */
@@ -416,10 +419,28 @@ static void trans_ana(
            {
            {
                mag_chg[k] = 0;
                mag_chg[k] = 0;
            }
            }

#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
            if ( element_mode != EVS_MONO )
            {
                if ( k == 0 && 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 *= BETA_MUTE_FAC;
                }
            }
            else
            {
                if ( 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 *= BETA_MUTE_FAC;
                }
            }
#else
            if ( burst_len > BETA_MUTE_THR )
            if ( burst_len > BETA_MUTE_THR )
            {
            {
                *beta_mute *= BETA_MUTE_FAC;
                *beta_mute *= BETA_MUTE_FAC;
            }
            }
#endif
            alpha[k] = mag_chg[k];
            alpha[k] = mag_chg[k];
            beta[k] = (float) ( sqrt( 1.0f - SQR( alpha[k] ) ) * *beta_mute );
            beta[k] = (float) ( sqrt( 1.0f - SQR( alpha[k] ) ) * *beta_mute );
            if ( k >= LGW32k - 1 )
            if ( k >= LGW32k - 1 )
@@ -2104,8 +2125,11 @@ static void hq_phase_ecu(
            *time_offs = 0;
            *time_offs = 0;
        }
        }
#endif
#endif

#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
        trans_ana( prevsynth + 2 * output_frame - Lprot - *time_offs + ph_ecu_lookahead, 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( prevsynth + 2 * output_frame - Lprot - *time_offs + ph_ecu_lookahead, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, *last_fec, alpha, beta, beta_mute, Xavg );
        trans_ana( prevsynth + 2 * output_frame - Lprot - *time_offs + ph_ecu_lookahead, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, *last_fec, alpha, beta, beta_mute, Xavg );
#endif
        spec_ana( prevsynth + 2 * output_frame - Lprot - *time_offs + ph_ecu_lookahead, plocs, plocsi, num_p, X_sav, output_frame, bwidth, element_mode, &noise_fac, pcorr );
        spec_ana( prevsynth + 2 * output_frame - Lprot - *time_offs + ph_ecu_lookahead, plocs, plocsi, num_p, X_sav, output_frame, bwidth, element_mode, &noise_fac, pcorr );


        if ( prev_bfi && *last_fec )
        if ( prev_bfi && *last_fec )
@@ -2142,7 +2166,11 @@ static void hq_phase_ecu(
#endif
#endif
        }
        }


#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
        trans_ana( prevsynth + 2 * output_frame - Lprot, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, 0, element_mode, alpha, beta, beta_mute, Xavg ); /* 1.0 stable-music,  0.0 speech-like */
#else
        trans_ana( prevsynth + 2 * output_frame - Lprot, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, 0, alpha, beta, beta_mute, Xavg ); /* 1.0 stable-music,  0.0 speech-like */
        trans_ana( prevsynth + 2 * output_frame - Lprot, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, 0, alpha, beta, beta_mute, Xavg ); /* 1.0 stable-music,  0.0 speech-like */
#endif
    }
    }


    mvr2r( X_sav, X, Lprot );
    mvr2r( X_sav, X, Lprot );