summaryrefslogtreecommitdiffstats
path: root/Modules/audioop.c
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1993-02-10 13:21:59 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1993-02-10 13:21:59 (GMT)
commit55cea47bae274334acb52910efef1a9e1e3ab759 (patch)
tree5b471f758a8ad8f8cf8fefda7a475fddff8d4eda /Modules/audioop.c
parentbf80e5407ffa0fc983eb1da50ffa9330b9eada6e (diff)
downloadcpython-55cea47bae274334acb52910efef1a9e1e3ab759.zip
cpython-55cea47bae274334acb52910efef1a9e1e3ab759.tar.gz
cpython-55cea47bae274334acb52910efef1a9e1e3ab759.tar.bz2
Changed adpcm routines to use 2-element state (was 3 element)
Diffstat (limited to 'Modules/audioop.c')
-rw-r--r--Modules/audioop.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/audioop.c b/Modules/audioop.c
index 301b494..792c4ae 100644
--- a/Modules/audioop.c
+++ b/Modules/audioop.c
@@ -872,9 +872,10 @@ audioop_lin2adpcm(self, args)
valpred = 0;
step = 7;
index = 0;
- } else if ( !getargs(state, "(iii)", &valpred, &step, &index) )
+ } else if ( !getargs(state, "(ii)", &valpred, &index) )
return 0;
+ step = stepsizeTable[index];
bufferstep = 1;
for ( i=0; i < len; i += size ) {
@@ -944,7 +945,7 @@ audioop_lin2adpcm(self, args)
}
bufferstep = !bufferstep;
}
- rv = mkvalue("(O(iii))", str, valpred, step, index);
+ rv = mkvalue("(O(ii))", str, valpred, index);
DECREF(str);
return rv;
}
@@ -975,7 +976,7 @@ audioop_adpcm2lin(self, args)
valpred = 0;
step = 7;
index = 0;
- } else if ( !getargs(state, "(iii)", &valpred, &step, &index) )
+ } else if ( !getargs(state, "(ii)", &valpred, &index) )
return 0;
str = newsizedstringobject(NULL, len*size*2);
@@ -983,6 +984,7 @@ audioop_adpcm2lin(self, args)
return 0;
ncp = (signed char *)getstringvalue(str);
+ step = stepsizeTable[index];
bufferstep = 0;
for ( i=0; i < len*size*2; i += size ) {
@@ -1035,7 +1037,7 @@ audioop_adpcm2lin(self, args)
else if ( size == 4 ) *LONGP(ncp, i) = (long)(valpred<<16);
}
- rv = mkvalue("(O(iii))", str, valpred, step, index);
+ rv = mkvalue("(O(ii))", str, valpred, index);
DECREF(str);
return rv;
}