From bb270c0896b39e1ae9277355e3c120ed3feb64a3 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Thu, 22 Dec 2005 01:10:11 +0000 Subject: COSMETICS: tabs --> spaces, some prettyprinting Originally committed as revision 4764 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/pcm.c | 66 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'libavcodec/pcm.c') 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, \ -- cgit v1.2.3