From 2bb1b8f3a4984075743b17fbe1d00b1af9917254 Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Sat, 26 May 2001 15:07:18 +0000 Subject: switch to walken's libac3 and minor bugfixes CVS patchset: 83 CVS date: 2001/05/26 15:07:18 --- src/libac3/dither.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'src/libac3/dither.c') diff --git a/src/libac3/dither.c b/src/libac3/dither.c index 07fa2f596..8b7ef3427 100644 --- a/src/libac3/dither.c +++ b/src/libac3/dither.c @@ -21,9 +21,6 @@ * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include #include @@ -94,24 +91,24 @@ uint16_t lfsr_state = 1; uint16_t dither_gen(void) { - int i; - uint32_t state; + int i; + uint32_t state; - //explicitly bring the state into a local var as gcc > 3.0? - //doesn't know how to optimize out the stores - state = lfsr_state; + //explicitly bring the state into a local var as gcc > 3.0? + //doesn't know how to optimize out the stores + state = lfsr_state; - //Generate eight pseudo random bits - for(i=0;i<8;i++) { - state <<= 1; + //Generate eight pseudo random bits + for(i=0;i<8;i++) { + state <<= 1; - if(state & 0x10000) - state ^= 0xa011; - } + if(state & 0x10000) + state ^= 0xa011; + } - lfsr_state = state; + lfsr_state = state; - return (((((int32_t)state<<8)>>8) * (int32_t) (0.707106 * 256.0))>>16); + return (((((int32_t)state<<8)>>8) * (int32_t) (0.707106 * 256.0))>>16); } #endif -- cgit v1.2.3