Creative ADPCM: Difference between revisions

From MultimediaWiki
Jump to navigation Jump to search
No edit summary
m (add to ADPCM category)
(One intermediate revision by one other user not shown)
Line 2: Line 2:
* Company: [[Creative]]
* Company: [[Creative]]


This is variation of [[IMA ADPCM]], maybe it is also used in [[Creative Voice]].  
This is variation of [[IMA ADPCM]], which is also used in [[Creative Voice]].


== Decoding Process ==
== Decoding Process ==
Line 26: Line 26:
   }
   }


[[Category: Audio Codecs]]
[[Category:Audio Codecs]]
[[Category:ADPCM Audio Codecs]]

Revision as of 18:11, 13 February 2006

This is variation of IMA ADPCM, which is also used in Creative Voice.

Decoding Process

 get new nibble from stream
 sign = nibble & 8
 delta = nibble & 7
 diff = ((2 * delta + 1) * step) / 8
 if sign > 0
   newval = (oldval * 254 / 256) - diff
 else
   newval = (oldval * 254 / 256) + diff
 step = (ct_table[delta] * step) >> 8
 step = clip(step, 511, 32767)
 newval = clip(newval, -32769, 32767)
 output newval as 16-bit sample

And here is the table used in step modification:

 const int ct_table[8] = {
   0x00E6, 0x00E6, 0x00E6, 0x00E6,
   0x0133, 0x0199, 0x0200, 0x0266
 }