Commit bc026023 authored by Jan Kiene's avatar Jan Kiene Committed by emerit
Browse files

fix usan error in waveforma adjustment - compute sign differently

parent 56ab1c55
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -168,9 +168,7 @@
/* any switch which is non-be wrt selection floating point code */
/* all switches in this category should start with "NONBE_" */

#define NONBE_FIX_1021_ISM_BRIR_RS_FLUSH                /* FhG: issue #1021: fix ISM with JBM and RS renderer flushing*/
#define NONBE_FIX_1034_DRY_MASA_RATIOS                  /* Nokia: Fix issue 1034, use of wrong numDir state. */
#define NON_BE_FIX_1041_USE_OLD_CNG_LSPS_IF_NONSTAB     /* FhG: fix bug in TD MDCT-Stereo concealment */
#define NON_BE_FIX_EVS_USAN_ERR_IN_WAVEADJUST           /* FhG: address issue 1037 */

/* ##################### End NON-BE switches ########################### */

+6 −0
Original line number Diff line number Diff line
@@ -742,7 +742,13 @@ void concealment_decode(
            /* sign randomization */
            for ( i = 0; i < hPlcInfo->L_frameTCX; i++ )
            {
#ifdef NON_BE_FIX_EVS_USAN_ERR_IN_WAVEADJUST
                int16_t rnd;
                rnd = own_random( seed );
                sign = ( rnd >= 0 ) - ( rnd < 0 );
#else
                sign = ( ( own_random( seed ) >> 15 ) << 1 ) + 1;
#endif
                invkoef[i] *= sign;
            }
        }