📄 classg726.htm
字号:
</dl><dl compact><dt><b>Returns:</b></dt><dd>The decoded PCM value. This is in the format specified by <a class="el" href="classG726.html#a2">SetLaw()</a>.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__g726.html#ga0">IMPLEMENT_G191_BUGS</a></dd></dl> </td> </tr></table><a class="anchor" name="a6" doxytag="G726::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> G726::Encode </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void * </td> <td class="mdname" nowrap> <em>dst</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>dstOffset</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const void * </td> <td class="mdname" nowrap> <em>src</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#ga6">uint</a> </td> <td class="mdname" nowrap> <em>srcSize</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>Encode a buffer of 16 bit uniform PCM values into ADPCM values.<p>Each ADPCM value only occupies the minimum number of bits required and successive values occupy adjacent bit positions. E.g. Four 3 bit ADPCM values (A,B,C,D) are stored in two successive bytes like this: 1st byte: ccbbbaaa 2nd byte: ----dddc. Note that any unused bits in the last byte are set to zero.<p><dl compact><dt><b>Precondition:</b></dt><dd>The coding law and ADPCM bit-rate should have been previous initialised with <a class="el" href="classG726.html#a2">SetLaw()</a> and <a class="el" href="classG726.html#a3">SetRate()</a>.</dd></dl><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>dst</em> </td><td>Pointer to location to store ADPCM values. </td></tr> <tr><td valign="top"></td><td valign="top"><em>dstOffset</em> </td><td>Offset from <em>dst</em>, in number-of-bits, at which the decoded values will be stored. I.e. the least significant bit of the first ADPCM value will be stored in byte <div class="fragment"><pre class="fragment"> dst[dstOffset>>3] </pre></div> at bit position <div class="fragment"><pre class="fragment"> dstOffset&7 </pre></div> Where the bit 0 is the least significant bit in a byte and bit 7 is the most significant bit. </td></tr> <tr><td valign="top"></td><td valign="top"><em>src</em> </td><td>Pointer to the buffer of PCM values to be converted. </td></tr> <tr><td valign="top"></td><td valign="top"><em>srcSize</em> </td><td>The size in bytes of the buffer at <em>src</em>. Must be a multiple of the size of a single PCM sample.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The number of bits were stored in the <em>dst</em> buffer.</dd></dl><dl compact><dt><b>Since:</b></dt><dd>2005-02-13</dd></dl> </td> </tr></table><a class="anchor" name="a7" doxytag="G726::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 <a class="el" href="group__integers.html#ga6">uint</a> G726::Decode </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void * </td> <td class="mdname" nowrap> <em>dst</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const void * </td> <td class="mdname" nowrap> <em>src</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>srcOffset</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#ga6">uint</a> </td> <td class="mdname" nowrap> <em>srcSize</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>Decode a buffer of ADPCM values into 16 bit uniform PCM values.<p>Each ADPCM value only occupies the minimum number of bits required and successive values occupy adjacent bit positions. E.g. Four 3 bit ADPCM values (A,B,C,D) are stored in two successive bytes like this: 1st byte: ccbbbaaa 2nd byte: ----dddc.<p><dl compact><dt><b>Precondition:</b></dt><dd>The coding law and ADPCM bit-rate should have been previous initialised with <a class="el" href="classG726.html#a2">SetLaw()</a> and <a class="el" href="classG726.html#a3">SetRate()</a>.</dd></dl><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>dst</em> </td><td>Pointer to location to store PCM values. </td></tr> <tr><td valign="top"></td><td valign="top"><em>src</em> </td><td>Pointer to the buffer of ADPCM values to be converted. </td></tr> <tr><td valign="top"></td><td valign="top"><em>srcOffset</em> </td><td>Offset from <em>src</em>, in number-of-bits, from which the ADPCM values will be read. I.e. the least significant bit of the first ADPCM value will be read from byte <div class="fragment"><pre class="fragment"> src[srcOffset>>3] </pre></div> at bit position <div class="fragment"><pre class="fragment"> srcOffset&7 </pre></div> Where the bit 0 is the least significant bit in a byte and bit 7 is the most significant bit. </td></tr> <tr><td valign="top"></td><td valign="top"><em>srcSize</em> </td><td>The number of bits to be read from the buffer at <em>src</em>. Must be a multiple of the size of a single ADPCM value.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The number of bytes which were stored in the <em>dst</em> buffer.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__g726.html#ga0">IMPLEMENT_G191_BUGS</a></dd></dl><dl compact><dt><b>Since:</b></dt><dd>2005-02-13</dd></dl> </td> </tr></table><a class="anchor" name="d14" doxytag="G726::EncodeDecode"></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"><a class="el" href="group__integers.html#ga6">uint</a> G726::EncodeDecode </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="mdname" nowrap> <em>input</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>bool </td> <td class="mdname" nowrap> <em>encode</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"><code> [private]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>The top level method which implements the complete algorithm for both encoding and decoding. <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>input</em> </td><td>Either the PCM input to the encoder or the ADPCM input to the decoder. </td></tr> <tr><td valign="top"></td><td valign="top"><em>encode</em> </td><td>A flag which if true makes this method perform the encode function. If the flag is false then the decode function is performed. </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>Either the ADPCM output to the encoder or the PCM output to the decoder. </dd></dl> </td> </tr></table><hr>The documentation for this class was generated from the following files:<ul><li><a class="el" href="G726_8h.html">G726.h</a><li><a class="el" href="G726_8cpp.html">G726.cpp</a></ul><HR><ADDRESS STYLE="align: right;"><SMALL>Generated by <A HREF="http://www.doxygen.org/index.html"><IMG SRC="doxygen.png" ALT="doxygen" ALIGN="middle" BORDER="0"></A> 1.4.1</SMALL></ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -