Commit 82250202 authored by Jan Kiene's avatar Jan Kiene
Browse files

fix usan error in waveforma adjustment - compute sign differently

parent 27dd5851
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -164,6 +164,7 @@
/* any switch which is non-be wrt selection floating point code */
/* all switches in this category should start with "NONBE_" */

#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;
            }
        }