changeset 27226:847ed11ede5e

Scale msadpcm coefficients to fit into 8 bits
author reimar
date Fri, 11 Jul 2008 18:59:03 +0000
parents 46bcd3f1b123
children 2de688c15263
files libmpcodecs/ad_msadpcm.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_msadpcm.c	Fri Jul 11 18:51:12 2008 +0000
+++ b/libmpcodecs/ad_msadpcm.c	Fri Jul 11 18:59:03 2008 +0000
@@ -34,14 +34,14 @@
   768, 614, 512, 409, 307, 230, 230, 230
 };
 
-static const int ms_adapt_coeff1[] =
+static const int8_t ms_adapt_coeff1[] =
 {
-  256, 512, 0, 192, 240, 460, 392
+  64, 128, 0, 48, 60, 115, 98
 };
 
-static const int ms_adapt_coeff2[] =
+static const int8_t ms_adapt_coeff2[] =
 {
-  0, -256, 0, 64, 0, -208, -232
+  0, -64, 0, 16, 0, -52, -58
 };
 
 #define MS_ADPCM_PREAMBLE_SIZE 6
@@ -173,7 +173,7 @@
 
     predictor = (
       ((sample1[current_channel] * coeff1[current_channel]) +
-       (sample2[current_channel] * coeff2[current_channel])) / 256) +
+       (sample2[current_channel] * coeff2[current_channel])) / 64) +
       (snibble * idelta[current_channel]);
     CLAMP_S16(predictor);
     sample2[current_channel] = sample1[current_channel];