Mercurial > hg > xemacs-beta
comparison src/sgiplay.c @ 442:abe6d1db359e r21-2-36
Import from CVS: tag r21-2-36
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:35:02 +0200 |
parents | 3ecd8885ac67 |
children | 576fb035e263 |
comparison
equal
deleted
inserted
replaced
441:72a7cfa4a488 | 442:abe6d1db359e |
---|---|
361 #include "libst.h" | 361 #include "libst.h" |
362 #else /* not USE_MULAW_DECODE_TABLE */ | 362 #else /* not USE_MULAW_DECODE_TABLE */ |
363 static int | 363 static int |
364 st_ulaw_to_linear (int u) | 364 st_ulaw_to_linear (int u) |
365 { | 365 { |
366 static CONST short table[] = {0,132,396,924,1980,4092,8316,16764}; | 366 static const short table[] = {0,132,396,924,1980,4092,8316,16764}; |
367 int u1 = ~u; | 367 int u1 = ~u; |
368 short exponent = (u1 >> 4) & 0x07; | 368 short exponent = (u1 >> 4) & 0x07; |
369 int mantissa = u1 & 0x0f; | 369 int mantissa = u1 & 0x0f; |
370 int unsigned_result = table[exponent]+(mantissa << (exponent+3)); | 370 int unsigned_result = table[exponent]+(mantissa << (exponent+3)); |
371 return u1 & 0x80 ? -unsigned_result : unsigned_result; | 371 return u1 & 0x80 ? -unsigned_result : unsigned_result; |