changeset 27121:237e683b7480

Half size for adpcm_index
author reimar
date Sun, 29 Jun 2008 09:14:26 +0000
parents ea18c012330a
children f8df4c3e2ac2
files libmpcodecs/ad_imaadpcm.c
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_imaadpcm.c	Sun Jun 29 09:10:46 2008 +0000
+++ b/libmpcodecs/ad_imaadpcm.c	Sun Jun 29 09:14:26 2008 +0000
@@ -50,10 +50,9 @@
   15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
 };
 
-static const int8_t adpcm_index[16] =
+static const int8_t adpcm_index[8] =
 {
   -1, -1, -1, -1, 2, 4, 6, 8,
-  -1, -1, -1, -1, 2, 4, 6, 8
 };
 
 // useful macros
@@ -144,12 +143,12 @@
   for (i = 0; i < output_size; i++)
   {
     delta = output[i];
+    sign = delta & 8;
+    delta = delta & 7;
 
     index[channel_number] += adpcm_index[delta];
     CLAMP_0_TO_88(index[channel_number]);
 
-    sign = delta & 8;
-    delta = delta & 7;
     delta = 2 * delta + 1;
     if (sign) delta = -delta;