author | llornkcor <llornkcor> | 2004-04-22 09:31:57 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-04-22 09:31:57 (UTC) |
commit | 0cfc21f93c66731a51f0982c0a6d357ab9c9a86b (patch) (side-by-side diff) | |
tree | 5106cfa5bce47cdb29800f7921b6d0621fe52800 | |
parent | 731e459a8621fb359ca39ccf4d11bffcc024dcfa (diff) | |
download | opie-0cfc21f93c66731a51f0982c0a6d357ab9c9a86b.zip opie-0cfc21f93c66731a51f0982c0a6d357ab9c9a86b.tar.gz opie-0cfc21f93c66731a51f0982c0a6d357ab9c9a86b.tar.bz2 |
initialize
-rw-r--r-- | core/applets/vmemo/adpcm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/applets/vmemo/adpcm.c b/core/applets/vmemo/adpcm.c index c4dfa50..a123249 100644 --- a/core/applets/vmemo/adpcm.c +++ b/core/applets/vmemo/adpcm.c @@ -73,34 +73,34 @@ void adpcm_coder(indata, outdata, len, state) short indata[]; char outdata[]; int len; struct adpcm_state *state; { short *inp; /* Input buffer pointer */ signed char *outp; /* output buffer pointer */ int val; /* Current input sample value */ int sign; /* Current adpcm sign bit */ int delta; /* Current adpcm output value */ int diff; /* Difference between val and valprev */ int step; /* Stepsize */ int valpred; /* Predicted output value */ int vpdiff; /* Current change to valpred */ int index; /* Current step change index */ - int outputbuffer; /* place to keep previous 4-bit value */ - int bufferstep; /* toggle between outputbuffer/output */ + int outputbuffer = 0; /* place to keep previous 4-bit value */ + int bufferstep = 0; /* toggle between outputbuffer/output */ outp = (signed char *)outdata; inp = indata; valpred = state->valprev; index = state->index; step = stepsizeTable[index]; bufferstep = 1; for ( ; len > 0 ; len-- ) { val = *inp++; /* Step 1 - compute difference with previous value */ diff = val - valpred; sign = (diff < 0) ? 8 : 0; @@ -174,34 +174,34 @@ adpcm_coder(indata, outdata, len, state) void adpcm_decoder(indata, outdata, len, state) char indata[]; short outdata[]; int len; struct adpcm_state *state; { signed char *inp; /* Input buffer pointer */ short *outp; /* output buffer pointer */ int sign; /* Current adpcm sign bit */ int delta; /* Current adpcm output value */ int step; /* Stepsize */ int valpred; /* Predicted value */ int vpdiff; /* Current change to valpred */ int index; /* Current step change index */ - int inputbuffer; /* place to keep next 4-bit value */ - int bufferstep; /* toggle between inputbuffer/input */ + int inputbuffer = 0; /* place to keep next 4-bit value */ + int bufferstep = 0; /* toggle between inputbuffer/input */ outp = outdata; inp = (signed char *)indata; valpred = state->valprev; index = state->index; step = stepsizeTable[index]; bufferstep = 0; for ( ; len > 0 ; len-- ) { /* Step 1 - get the delta value */ if ( bufferstep ) { delta = inputbuffer & 0xf; } else { |