Commit d964fa43 authored by vaclav's avatar vaclav
Browse files

Merge remote-tracking branch 'remotes/origin/ivas-float-update' into 1956-ref-PortFlpMr2109

parents 28c65247 545f05d1
Loading
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -170,6 +170,7 @@
#define NONBE_1215_FIX_JBM_MAX_SCALING                  /* FhG: issue 1215: Fix assert hit in a specific VoIP decoder config. Caused by integer overflow in max scaling calculation. */
#define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT   /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/
#define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR          /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/
#define FIX_1129_EXT_REND_OUTPUT_HIGH                   /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */
#define NONBE_FIX_MC_LFE_LPF                                  /* Dlb: Adding the LFE LPF filter back for MC content. */
#define FIX_1050_EFAP_ALLOC                             /* FhG: issue 1050: reduction of memory allocated to EFAP handle */
#define NONBE_FIX_1052_SBA_EXT                          /* Dlb: SBA external output support */
@@ -222,6 +223,8 @@
#define FIX_1139_REV_COLORATION_SHORT_T60               /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */
#define FIX_1320_STACK_CPE_DECODER                      /* VA: issue 1320: Optimize the stack memory consumption in the CPE decoder */

#define NONBE_1328_FIX_NON_LINEARITY                    /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0  */

/* #################### End BASOP porting switches ############################ */

/* clang-format on */
+4 −0
Original line number Diff line number Diff line
@@ -2638,6 +2638,10 @@ void non_linearity(
    const int16_t coder_type,     /* i  : Coder Type                              */
    const float *voice_factors,   /* i  : Voice Factors                           */
    const int16_t L_frame         /* i  : ACELP frame length                      */
#ifdef NONBE_1328_FIX_NON_LINEARITY
    ,
    const int16_t element_mode /* i  : element_mode to differentiate EVS and IVAS */
#endif
);

void interp_code_5over2(
+27 −3
Original line number Diff line number Diff line
@@ -1353,6 +1353,10 @@ void non_linearity(
    const int16_t coder_type,     /* i  : Coder Type          */
    const float *voice_factors,   /* i  : Voice Factors       */
    const int16_t L_frame         /* i  : ACELP frame length  */
#ifdef NONBE_1328_FIX_NON_LINEARITY
    ,
    const int16_t element_mode /* i  : element_mode to differentiate EVS and IVAS */
#endif
)
{
    int16_t i, j;
@@ -1365,7 +1369,9 @@ void non_linearity(
    int16_t en_abs = 0;
    float v_fac = 0, ths;
    int16_t nframes;

#ifdef NONBE_1328_FIX_NON_LINEARITY
    float sc_factor;
#endif
    if ( L_frame == L_FRAME16k )
    {
        nframes = 5;
@@ -1410,8 +1416,17 @@ void non_linearity(
        scale = 0.67f;
    }


#ifdef NONBE_1328_FIX_NON_LINEARITY
    sc_factor = 1024.0f;
    if ( element_mode > EVS_MONO )
    {
        sc_factor = (float) ( 1 << max( 13 - norm_s( j + 1 ), 0 ) ); /* Adapt the scaling factor allowed depending of max position  */
        sc_factor = max( sc_factor, 2.0f );
    }
    if ( *prev_scale <= 0.0 || *prev_scale > sc_factor * scale )
#else
    if ( *prev_scale <= 0.0 || *prev_scale > 1024.0f * scale )
#endif
    {
        scale_step = 1.0;
        *prev_scale = scale;
@@ -1468,8 +1483,17 @@ void non_linearity(
        scale = 0.67f;
    }


#ifdef NONBE_1328_FIX_NON_LINEARITY
    sc_factor = 1024.0f;
    if ( element_mode > EVS_MONO )
    {
        sc_factor = (float) ( 1 << max( 12 - norm_s( j - length / 2 + 1 ), 0 ) ); /* allowed intra frame jump is smaller */
        sc_factor = max( sc_factor, 2.0f );
    }
    if ( *prev_scale <= 0.0 || *prev_scale > sc_factor * scale )
#else
    if ( *prev_scale <= 0.0 || *prev_scale > 1024.0f * scale )
#endif
    {
        scale_step = 1.0;
        *prev_scale = scale;
+6 −1
Original line number Diff line number Diff line
@@ -1442,7 +1442,12 @@ ivas_error acelp_core_dec(

        if ( !st->ppp_mode_dec && ( st->idchan == 0 || st->element_mode != IVAS_CPE_TD || ( st->idchan == 1 && st->element_mode == IVAS_CPE_TD && st->tdm_LRTD_flag ) ) )
        {
            non_linearity( bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame );
            non_linearity( bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame
#ifdef NONBE_1328_FIX_NON_LINEARITY
                           ,
                           st->element_mode
#endif
            );
        }

        if ( st->core_brate == FRAME_NO_DATA || st->core_brate == SID_2k40 )
+6 −1
Original line number Diff line number Diff line
@@ -425,7 +425,12 @@ void dec_acelp_tcx_frame(

            if ( st->core == ACELP_CORE && st->igf && st->con_tcx == 0 )
            {
                non_linearity( ptr_bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame );
                non_linearity( ptr_bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame
#ifdef NONBE_1328_FIX_NON_LINEARITY
                               ,
                               st->element_mode
#endif
                );

                /* update the old BWE exe memory */
                mvr2r( &old_bwe_exc[L_FRAME32k], st->hBWE_TD->old_bwe_exc, PIT16k_MAX * 2 );
Loading