projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6eb23b8
)
simpler
author
Michael Niedermayer
<michaelni@gmx.at>
Sun, 28 Sep 2003 20:27:56 +0000
(20:27 +0000)
committer
Michael Niedermayer
<michaelni@gmx.at>
Sun, 28 Sep 2003 20:27:56 +0000
(20:27 +0000)
Originally committed as revision 2310 to svn://svn.ffmpeg.org/ffmpeg/trunk
libavcodec/pcm.c
patch
|
blob
|
history
diff --git
a/libavcodec/pcm.c
b/libavcodec/pcm.c
index
7f3d630
..
a6c0d34
100644
(file)
--- a/
libavcodec/pcm.c
+++ b/
libavcodec/pcm.c
@@
-45,19
+45,11
@@
static int alaw2linear(unsigned char a_val)
a_val ^= 0x55;
- t =
(a_val & QUANT_MASK) << 4
;
+ t =
a_val & QUANT_MASK
;
seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT;
- switch (seg) {
- case 0:
- t += 8;
- break;
- case 1:
- t += 0x108;
- break;
- default:
- t += 0x108;
- t <<= seg - 1;
- }
+ if(seg) t= (t + t + 1 + 32) << (seg + 2);
+ else t= (t + t + 1 ) << 3;
+
return ((a_val & SIGN_BIT) ? t : -t);
}