comparison src/sgiplay.c @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents 7d59cb494b73
children 697ef44129c6
comparison
equal deleted inserted replaced
397:f4aeb21a5bad 398:74fd4e045ea6
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;