Commit 779a4846 authored by michaelni's avatar michaelni

simpler


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@2310 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 7842ccc4
...@@ -45,19 +45,11 @@ static int alaw2linear(unsigned char a_val) ...@@ -45,19 +45,11 @@ static int alaw2linear(unsigned char a_val)
a_val ^= 0x55; a_val ^= 0x55;
t = (a_val & QUANT_MASK) << 4; t = a_val & QUANT_MASK;
seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT; seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT;
switch (seg) { if(seg) t= (t + t + 1 + 32) << (seg + 2);
case 0: else t= (t + t + 1 ) << 3;
t += 8;
break;
case 1:
t += 0x108;
break;
default:
t += 0x108;
t <<= seg - 1;
}
return ((a_val & SIGN_BIT) ? t : -t); return ((a_val & SIGN_BIT) ? t : -t);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment