From 55cea47bae274334acb52910efef1a9e1e3ab759 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 10 Feb 1993 13:21:59 +0000 Subject: Changed adpcm routines to use 2-element state (was 3 element) --- Modules/audioop.c | 10 ++++++---- 1 file 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; } -- cgit v0.12