aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/pcm.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2005-12-22 01:10:11 +0000
committerDiego Biurrun <diego@biurrun.de>2005-12-22 01:10:11 +0000
commitbb270c0896b39e1ae9277355e3c120ed3feb64a3 (patch)
treefc2fc2b1216d19acb3879abb6ea5a3b400f43fe4 /libavcodec/pcm.c
parent50827fcf44f34521df4708cdb633809b56fb9df3 (diff)
downloadffmpeg-bb270c0896b39e1ae9277355e3c120ed3feb64a3.tar.gz
COSMETICS: tabs --> spaces, some prettyprinting
Originally committed as revision 4764 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/pcm.c')
-rw-r--r--libavcodec/pcm.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index a82d86ab84..fa2e240297 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -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 inline void encode_from16(int bps, int le, int us,
}
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 inline void decode_to16(int bps, int le, int us,
}
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 @@ AVCodec name ## _encoder = { \
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 @@ AVCodec name ## _decoder = { \
CODEC_TYPE_AUDIO, \
id, \
sizeof(PCMDecode), \
- pcm_decode_init, \
+ pcm_decode_init, \
NULL, \
NULL, \
pcm_decode_frame, \