changeset 1485:d7bb818768c5 libavcodec

simpler
author michaelni
date Sun, 28 Sep 2003 20:27:56 +0000
parents a2930ee10a6b
children f22010affdce
files pcm.c
diffstat 1 files changed, 4 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/pcm.c	Sat Sep 27 00:02:29 2003 +0000
+++ b/pcm.c	Sun Sep 28 20:27:56 2003 +0000
@@ -45,19 +45,11 @@
 
 	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);
 }