Commit 2185457f authored by norvell's avatar norvell
Browse files

Add NONBE_APPLY_CLIPPING_BEFORE_CORE_PREPROC

parent 56640ad5
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -190,6 +190,7 @@
#define NONBE_FIX_1165_STATIC_SCAL_PARAMMC              /* FhG: add static scaling to ParamMC DMX */
#define NONBE_FIX_1165_APPLY_LIMITER_ON_ENCODER_DMX     /* FhG: apply the limiter before the core encoder for formats with downmixing where the signal could exceed the 16-bit value range */
#define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR            /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */
#define NONBE_APPLY_CLIPPING_BEFORE_CORE_PREPROC        /* Ericsson: Add clipping before core preprocessing for IVAS */

#define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR       /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */
#define NONBE_FIX_1197_OMASA_META_BUFFER                /* Nokia: OMASA ISM_MASA_MODE_PARAM_ONE_OBJ history zero in rateswitching */
+8 −0
Original line number Diff line number Diff line
@@ -230,8 +230,16 @@ uint32_t check_clipping(
    float *maxOverload, /* i/o: max overload value                             */
    float *minOverload  /* i/o: max overload value                             */
);
#endif

#ifdef NONBE_APPLY_CLIPPING_BEFORE_CORE_PREPROC
/*! r: number of clipped samples */
uint32_t apply_clipping(
    float x[],      /* i  : input vector  */
    const int16_t n /* i  : vector size   */
);
#endif

/*! r: number of clipped samples */
uint32_t mvr2s(
    const float x[], /* i  : input vector                                    */
+30 −0
Original line number Diff line number Diff line
@@ -411,6 +411,36 @@ uint32_t check_clipping(
}

#endif
#ifdef NONBE_APPLY_CLIPPING_BEFORE_CORE_PREPROC
/*! r: number of clipped samples */
uint32_t apply_clipping(
    float x[],      /* i  : input vector  */
    const int16_t n /* i  : vector size   */
)
{
    int16_t i;
    float temp;
    uint32_t noClipping = 0;

    for ( i = 0; i < n; i++ )
    {
        temp = x[i];
        if ( temp > MAX16B_FLT )
        {
            x[i] = MAX16B_FLT;
            noClipping++;
        }
        else if ( temp < MIN16B_FLT )
        {
            x[i] = MIN16B_FLT;
            noClipping++;
        }
    }

    return noClipping;
}
#endif

/*! r: number of clipped samples */
uint32_t mvr2s(
    const float x[], /* i  : input vector  */
+5 −0
Original line number Diff line number Diff line
@@ -471,6 +471,11 @@ ivas_error ivas_cpe_enc(

    for ( n = 0; n < n_CoreChannels; n++ )
    {
#ifdef NONBE_APPLY_CLIPPING_BEFORE_CORE_PREPROC
        apply_clipping( hCPE->hCoreCoder[n]->input, input_frame );
        apply_clipping( old_inp_16k[n], L_FRAME16k );
        apply_clipping( old_inp_12k8[n], L_FRAME );
#endif
#ifdef DEBUGGING
        st_ivas->noClipping += check_clipping( hCPE->hCoreCoder[n]->input, input_frame, &st_ivas->maxOverload, &st_ivas->minOverload );
#endif
+5 −0
Original line number Diff line number Diff line
@@ -172,6 +172,11 @@ ivas_error ivas_ism_enc(
         * Front Pre-processing
         *----------------------------------------------------------------*/

#ifdef NONBE_APPLY_CLIPPING_BEFORE_CORE_PREPROC
        apply_clipping( hSCE->hCoreCoder[0]->input, input_frame );
        apply_clipping( old_inp_16k[sce_id][0], L_FRAME16k );
        apply_clipping( old_inp_12k8[sce_id][0], L_FRAME );
#endif
#ifdef DEBUGGING
        st_ivas->noClipping += check_clipping( hSCE->hCoreCoder[0]->input, input_frame, &st_ivas->maxOverload, &st_ivas->minOverload );
#endif
Loading