diff pcm.c @ 2979:bfabfdf9ce55 libavcodec

COSMETICS: tabs --> spaces, some prettyprinting
author diego
date Thu, 22 Dec 2005 01:10:11 +0000
parents ef2149182f1c
children 0b546eab515d
line wrap: on
line diff
--- a/pcm.c	Wed Dec 21 17:50:40 2005 +0000
+++ b/pcm.c	Thu Dec 22 01:10:11 2005 +0000
@@ -27,48 +27,48 @@
 
 /* from g711.c by SUN microsystems (unrestricted use) */
 
-#define	SIGN_BIT	(0x80)		/* Sign bit for a A-law byte. */
-#define	QUANT_MASK	(0xf)		/* Quantization field mask. */
-#define	NSEGS		(8)		/* Number of A-law segments. */
-#define	SEG_SHIFT	(4)		/* Left shift for segment number. */
-#define	SEG_MASK	(0x70)		/* Segment field mask. */
+#define         SIGN_BIT        (0x80)      /* Sign bit for a A-law byte. */
+#define         QUANT_MASK      (0xf)       /* Quantization field mask. */
+#define         NSEGS           (8)         /* Number of A-law segments. */
+#define         SEG_SHIFT       (4)         /* Left shift for segment number. */
+#define         SEG_MASK        (0x70)      /* Segment field mask. */
 
-#define	BIAS		(0x84)		/* Bias for linear code. */
+#define         BIAS            (0x84)      /* Bias for linear code. */
 
 /*
  * alaw2linear() - Convert an A-law value to 16-bit linear PCM
  *
  */
-static int alaw2linear(unsigned char	a_val)
+static int alaw2linear(unsigned char a_val)
 {
-	int		t;
-	int		seg;
+        int t;
+        int seg;
 
-	a_val ^= 0x55;
+        a_val ^= 0x55;
 
-	t = a_val & QUANT_MASK;
-	seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT;
-	if(seg) t= (t + t + 1 + 32) << (seg + 2);
-	else    t= (t + t + 1     ) << 3;
+        t = a_val & QUANT_MASK;
+        seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT;
+        if(seg) t= (t + t + 1 + 32) << (seg + 2);
+        else    t= (t + t + 1     ) << 3;
 
-	return ((a_val & SIGN_BIT) ? t : -t);
+        return ((a_val & SIGN_BIT) ? t : -t);
 }
 
-static int ulaw2linear(unsigned char	u_val)
+static int ulaw2linear(unsigned char u_val)
 {
-	int		t;
+        int t;
 
-	/* Complement to obtain normal u-law value. */
-	u_val = ~u_val;
+        /* Complement to obtain normal u-law value. */
+        u_val = ~u_val;
 
-	/*
-	 * Extract and bias the quantization bits. Then
-	 * shift up by the segment number and subtract out the bias.
-	 */
-	t = ((u_val & QUANT_MASK) << 3) + BIAS;
-	t <<= ((unsigned)u_val & SEG_MASK) >> SEG_SHIFT;
+        /*
+         * Extract and bias the quantization bits. Then
+         * shift up by the segment number and subtract out the bias.
+         */
+        t = ((u_val & QUANT_MASK) << 3) + BIAS;
+        t <<= ((unsigned)u_val & SEG_MASK) >> SEG_SHIFT;
 
-	return ((u_val & SIGN_BIT) ? (BIAS - t) : (t - BIAS));
+        return ((u_val & SIGN_BIT) ? (BIAS - t) : (t - BIAS));
 }
 
 /* 16384 entries per table */
@@ -209,7 +209,7 @@
 }
 
 static int pcm_encode_frame(AVCodecContext *avctx,
-			    unsigned char *frame, int buf_size, void *data)
+                            unsigned char *frame, int buf_size, void *data)
 {
     int n, sample_size, v;
     short *samples;
@@ -397,8 +397,8 @@
 }
 
 static int pcm_decode_frame(AVCodecContext *avctx,
-			    void *data, int *data_size,
-			    uint8_t *buf, int buf_size)
+                            void *data, int *data_size,
+                            uint8_t *buf, int buf_size)
 {
     PCMDecode *s = avctx->priv_data;
     int n;
@@ -509,9 +509,9 @@
     CODEC_TYPE_AUDIO,                           \
     id,                                         \
     0,                                          \
-    pcm_encode_init,				\
-    pcm_encode_frame,				\
-    pcm_encode_close,				\
+    pcm_encode_init,                            \
+    pcm_encode_frame,                           \
+    pcm_encode_close,                           \
     NULL,                                       \
 };                                              \
 AVCodec name ## _decoder = {                    \
@@ -519,7 +519,7 @@
     CODEC_TYPE_AUDIO,                           \
     id,                                         \
     sizeof(PCMDecode),                          \
-    pcm_decode_init,				\
+    pcm_decode_init,                            \
     NULL,                                       \
     NULL,                                       \
     pcm_decode_frame,                           \