📄 classima__adpcm.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>IMA_ADPCM Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.1 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div><h1>IMA_ADPCM Class Reference<br><small>[<a class="el" href="group__ima__adpcm.html">Audio Codec - IMA ADPCM</a>]</small></h1><code>#include <<a class="el" href="IMA__ADPCM_8h-source.html">IMA_ADPCM.h</a>></code><p><a href="classIMA__ADPCM-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>A class which implements the IMA ADPCM audio coding algorithm. <p>Typically, IMA ADPCM data is stored as blocks of data with the <a class="el" href="classIMA__ADPCM.html#o0">PredictedValue</a> and <a class="el" href="classIMA__ADPCM.html#o1">StepIndex</a> values held in a header to each block. When decoding, these values should be writen to this class to initialise the decoding of a block. When encoding, these values should be writen out to a block's header prior to encoding the samples in the block.<p>Note, when IMA ADPCM data is stored in Microsoft WAV files, the <a class="el" href="classIMA__ADPCM.html#o0">PredictedValue</a> found in the block's header is used as the first sample for that block. The first ADPCM value in the block's data then represents the second sample. <p><p>Definition at line <a class="el" href="IMA__ADPCM_8h-source.html#l00046">46</a> of file <a class="el" href="IMA__ADPCM_8h-source.html">IMA_ADPCM.h</a>.<table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT void </td><td class="memItemRight" valign="bottom"><a class="el" href="classIMA__ADPCM.html#a0">EncodeInit</a> (<a class="el" href="group__integers.html#ga4">int16</a> sample1, <a class="el" href="group__integers.html#ga4">int16</a> sample2)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT <a class="el" href="group__integers.html#ga6">uint</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classIMA__ADPCM.html#a1">Encode</a> (<a class="el" href="group__integers.html#ga4">int16</a> pcm16)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT int </td><td class="memItemRight" valign="bottom"><a class="el" href="classIMA__ADPCM.html#a2">Decode</a> (<a class="el" href="group__integers.html#ga6">uint</a> adpcm)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT <a class="el" href="group__integers.html#ga6">uint</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classIMA__ADPCM.html#a3">Encode</a> (<a class="el" href="group__integers.html#ga0">uint8</a> *dst, int dstOffset, const <a class="el" href="group__integers.html#ga4">int16</a> *src, <a class="el" href="group__integers.html#ga6">uint</a> srcSize)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT <a class="el" href="group__integers.html#ga6">uint</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classIMA__ADPCM.html#a4">Decode</a> (<a class="el" href="group__integers.html#ga4">int16</a> *dst, const <a class="el" href="group__integers.html#ga0">uint8</a> *src, int srcOffset, <a class="el" href="group__integers.html#ga6">uint</a> srcSize)</td></tr><tr><td colspan="2"><br><h2>Public Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__integers.html#ga4">int16</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classIMA__ADPCM.html#o0">PredictedValue</a></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__integers.html#ga0">uint8</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classIMA__ADPCM.html#o1">StepIndex</a></td></tr></table><hr><h2>Member Function Documentation</h2><a class="anchor" name="a0" doxytag="IMA_ADPCM::EncodeInit"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">EXPORT void IMA_ADPCM::EncodeInit </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__integers.html#ga4">int16</a> </td> <td class="mdname" nowrap> <em>sample1</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap><a class="el" href="group__integers.html#ga4">int16</a> </td> <td class="mdname" nowrap> <em>sample2</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Initialise the <a class="el" href="classIMA__ADPCM.html#o0">PredictedValue</a> and <a class="el" href="classIMA__ADPCM.html#o1">StepIndex</a> members to the optimum values for encoding an audio stream whoes first two PCM samples have the values given. Use of this method at the start of audio stream encoding gives improved accuracy over a naive initialisation which sets <a class="el" href="classIMA__ADPCM.html#o0">PredictedValue</a> and <a class="el" href="classIMA__ADPCM.html#o1">StepIndex</a> to predetermined constant values.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>sample1</em> </td><td>The first PCM sample in the audio stream. </td></tr> <tr><td valign="top"></td><td valign="top"><em>sample2</em> </td><td>The second PCM sample in the audio stream.</td></tr> </table></dl><p>Definition at line <a class="el" href="IMA__ADPCM_8cpp-source.html#l00052">52</a> of file <a class="el" href="IMA__ADPCM_8cpp-source.html">IMA_ADPCM.cpp</a>. </td> </tr></table><a class="anchor" name="a1" doxytag="IMA_ADPCM::Encode"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">EXPORT <a class="el" href="group__integers.html#ga6">uint</a> IMA_ADPCM::Encode </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__integers.html#ga4">int16</a> </td> <td class="mdname1" valign="top" nowrap> <em>pcm16</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Encode a single linear PCM sample as an ADPCM value.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>pcm16</em> </td><td>The PCM value to encode.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The 4 least significan bits represent the encoded ADPCM value. Other bits are zero.</dd></dl><dl compact><dt><b>Postcondition:</b></dt><dd><a class="el" href="classIMA__ADPCM.html#o0">PredictedValue</a> and <a class="el" href="classIMA__ADPCM.html#o1">StepIndex</a> are updated ready for encoding the next sample.</dd></dl><p>Definition at line <a class="el" href="IMA__ADPCM_8cpp-source.html#l00067">67</a> of file <a class="el" href="IMA__ADPCM_8cpp-source.html">IMA_ADPCM.cpp</a>. </td> </tr></table><a class="anchor" name="a2" doxytag="IMA_ADPCM::Decode"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">EXPORT int IMA_ADPCM::Decode </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__integers.html#ga6">uint</a> </td> <td class="mdname1" valign="top" nowrap> <em>adpcm</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Decode a single ADPCM value into a 16bit linear PCM value.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>adpcm</em> </td><td>The 4 least significan bits represent ADPCM value to encode. Other bits are ignored.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The decoded 16 bit PCM value sign extended to an int.</dd></dl><dl compact><dt><b>Postcondition:</b></dt><dd><a class="el" href="classIMA__ADPCM.html#o0">PredictedValue</a> and <a class="el" href="classIMA__ADPCM.html#o1">StepIndex</a> are updated ready for decoding the next sample.</dd></dl><p>Definition at line <a class="el" href="IMA__ADPCM_8cpp-source.html#l00125">125</a> of file <a class="el" href="IMA__ADPCM_8cpp-source.html">IMA_ADPCM.cpp</a>. </td> </tr></table><a class="anchor" name="a3" doxytag="IMA_ADPCM::Encode"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">EXPORT <a class="el" href="group__integers.html#ga6">uint</a> IMA_ADPCM::Encode </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__integers.html#ga0">uint8</a> * </td> <td class="mdname" nowrap> <em>dst</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -