diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-27 11:32:29 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-27 11:32:29 -0300 |
commit | 50953e0640b3473dcb409d5d0d938c2742c93b0d (patch) | |
tree | 3b0dc374e61564fbbd8adff92c8fae16fdeb423a /drivers/isdn/mISDN/l1oip_codec.c | |
parent | f92c97c8bd77992ff8bd6ef29a23dc82dca799cb (diff) | |
parent | 626cf236608505d376e4799adb4f7eb00a8594af (diff) |
Merge branch 'poll' into staging/for_v3.4
* poll: (5970 commits)
poll: add poll_requested_events() and poll_does_not_wait() functions
crc32: select an algorithm via Kconfig
crc32: add self-test code for crc32c
crypto: crc32c should use library implementation
crc32: bolt on crc32c
crc32: add note about this patchset to crc32.c
crc32: optimize loop counter for x86
crc32: add slice-by-8 algorithm to existing code
crc32: make CRC_*_BITS definition correspond to actual bit counts
crc32: fix mixing of endian-specific types
crc32: miscellaneous cleanups
crc32: simplify unit test code
crc32: move long comment about crc32 fundamentals to Documentation/
crc32: remove two instances of trailing whitespaces
checkpatch: check for quoted strings broken across lines
checkpatch: whitespace - add/remove blank lines
checkpatch: warn on use of yield()
checkpatch: add --strict tests for braces, comments and casts
checkpatch: add [] to type extensions
checkpatch: high precedence operators do not require additional parentheses in #defines
...
Diffstat (limited to 'drivers/isdn/mISDN/l1oip_codec.c')
-rw-r--r-- | drivers/isdn/mISDN/l1oip_codec.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/drivers/isdn/mISDN/l1oip_codec.c b/drivers/isdn/mISDN/l1oip_codec.c index 5a89972624d..a601c847222 100644 --- a/drivers/isdn/mISDN/l1oip_codec.c +++ b/drivers/isdn/mISDN/l1oip_codec.c @@ -27,22 +27,22 @@ /* -How the codec works: --------------------- + How the codec works: + -------------------- -The volume is increased to increase the dynamic range of the audio signal. -Each sample is converted to a-LAW with only 16 steps of level resolution. -A pair of two samples are stored in one byte. + The volume is increased to increase the dynamic range of the audio signal. + Each sample is converted to a-LAW with only 16 steps of level resolution. + A pair of two samples are stored in one byte. -The first byte is stored in the upper bits, the second byte is stored in the -lower bits. + The first byte is stored in the upper bits, the second byte is stored in the + lower bits. -To speed up compression and decompression, two lookup tables are formed: + To speed up compression and decompression, two lookup tables are formed: -- 16 bits index for two samples (law encoded) with 8 bit compressed result. -- 8 bits index for one compressed data with 16 bits decompressed result. + - 16 bits index for two samples (law encoded) with 8 bit compressed result. + - 8 bits index for one compressed data with 16 bits decompressed result. -NOTE: The bytes are handled as they are law-encoded. + NOTE: The bytes are handled as they are law-encoded. */ @@ -232,7 +232,7 @@ l1oip_law_to_4bit(u8 *data, int len, u8 *result, u32 *state) /* send saved byte and first input byte */ if (*state) { - *result++ = table_com[(((*state)<<8)&0xff00) | (*data++)]; + *result++ = table_com[(((*state) << 8) & 0xff00) | (*data++)]; len--; o++; } @@ -267,7 +267,7 @@ l1oip_4bit_to_law(u8 *data, int len, u8 *result) while (i < len) { r = table_dec[*data++]; - *result++ = r>>8; + *result++ = r >> 8; *result++ = r; i++; } @@ -345,8 +345,8 @@ l1oip_4bit_alloc(int ulaw) c = alaw_to_4bit[i1]; i2 = 0; while (i2 < 256) { - table_com[(i1<<8) | i2] |= (c<<4); - table_com[(i2<<8) | i1] |= c; + table_com[(i1 << 8) | i2] |= (c << 4); + table_com[(i2 << 8) | i1] |= c; i2++; } i1++; @@ -361,8 +361,8 @@ l1oip_4bit_alloc(int ulaw) sample = _4bit_to_alaw[i1]; i2 = 0; while (i2 < 16) { - table_dec[(i1<<4) | i2] |= (sample<<8); - table_dec[(i2<<4) | i1] |= sample; + table_dec[(i1 << 4) | i2] |= (sample << 8); + table_dec[(i2 << 4) | i1] |= sample; i2++; } i1++; @@ -370,5 +370,3 @@ l1oip_4bit_alloc(int ulaw) return 0; } - - |