summaryrefslogtreecommitdiff
path: root/src/libac3/dither.c
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2001-05-26 15:07:18 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2001-05-26 15:07:18 +0000
commit2bb1b8f3a4984075743b17fbe1d00b1af9917254 (patch)
tree06aa3a03497e938d80a7146013fef96324ef073c /src/libac3/dither.c
parent65480cd3d11b465f0ede5f6c3d1b9f12e06dc98b (diff)
downloadxine-lib-2bb1b8f3a4984075743b17fbe1d00b1af9917254.tar.gz
xine-lib-2bb1b8f3a4984075743b17fbe1d00b1af9917254.tar.bz2
switch to walken's libac3 and minor bugfixes
CVS patchset: 83 CVS date: 2001/05/26 15:07:18
Diffstat (limited to 'src/libac3/dither.c')
-rw-r--r--src/libac3/dither.c29
1 files changed, 13 insertions, 16 deletions
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 <stdlib.h>
#include <stdio.h>
@@ -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