gps/GPSResources/tcpmp 0.73/mpc/libmusepack/docs/html/musepack_8h.html

463 lines
20 KiB
HTML
Executable File

<!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>libmusepack: include/musepack/musepack.h File Reference</title>
<link href="custom.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.1 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<div class="nav">
<a class="el" href="dir_000000.html">include</a>&nbsp;/&nbsp;<a class="el" href="dir_000001.html">musepack</a></div>
<h1>musepack.h File Reference</h1><code>#include &lt;stdio.h&gt;</code><br>
<code>#include &lt;stdlib.h&gt;</code><br>
<code>#include &lt;string.h&gt;</code><br>
<code>#include &lt;math.h&gt;</code><br>
<code>#include "musepack/config_types.h"</code><br>
<code>#include "musepack/decoder.h"</code><br>
<code>#include "<a class="el" href="reader_8h-source.html">musepack/reader.h</a>"</code><br>
<code>#include "<a class="el" href="streaminfo_8h-source.html">musepack/streaminfo.h</a>"</code><br>
<p>
<a href="musepack_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a0" doxytag="musepack.h::ERROR_CODE_OK"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>ERROR_CODE_OK</b>&nbsp;&nbsp;&nbsp;0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a1" doxytag="musepack.h::ERROR_CODE_FILE"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>ERROR_CODE_FILE</b>&nbsp;&nbsp;&nbsp;-1</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a2" doxytag="musepack.h::ERROR_CODE_SV7BETA"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>ERROR_CODE_SV7BETA</b>&nbsp;&nbsp;&nbsp;1</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a3" doxytag="musepack.h::ERROR_CODE_CBR"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>ERROR_CODE_CBR</b>&nbsp;&nbsp;&nbsp;2</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a4" doxytag="musepack.h::ERROR_CODE_IS"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>ERROR_CODE_IS</b>&nbsp;&nbsp;&nbsp;3</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a5" doxytag="musepack.h::ERROR_CODE_BLOCKSIZE"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>ERROR_CODE_BLOCKSIZE</b>&nbsp;&nbsp;&nbsp;4</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a6" doxytag="musepack.h::ERROR_CODE_INVALIDSV"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>ERROR_CODE_INVALIDSV</b>&nbsp;&nbsp;&nbsp;5</td></tr>
<tr><td colspan="2"><br><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom">{ <b>MPC_FRAME_LENGTH</b> = (36 * 32),
<a class="el" href="musepack_8h.html#a19a8">MPC_DECODER_BUFFER_LENGTH</a> = 4 * MPC_FRAME_LENGTH
}</td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="musepack_8h.html#a9">mpc_streaminfo_init</a> (mpc_streaminfo *si)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">mpc_int32_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="musepack_8h.html#a10">mpc_streaminfo_read</a> (mpc_streaminfo *si, mpc_reader *r)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="musepack_8h.html#a11">mpc_streaminfo_get_length</a> (mpc_streaminfo *si)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">mpc_int64_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="musepack_8h.html#a12">mpc_streaminfo_get_length_samples</a> (mpc_streaminfo *si)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="musepack_8h.html#a13">mpc_decoder_setup</a> (mpc_decoder *d, mpc_reader *r)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">BOOL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="musepack_8h.html#a14">mpc_decoder_initialize</a> (mpc_decoder *d, mpc_streaminfo *si)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="musepack_8h.html#a15">mpc_decoder_scale_output</a> (mpc_decoder *d, double scale_factor)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">mpc_uint32_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="musepack_8h.html#a16">mpc_decoder_decode</a> (mpc_decoder *d, MPC_SAMPLE_FORMAT *buffer, mpc_uint32_t *vbr_update_acc, mpc_uint32_t *vbr_update_bits)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a17" doxytag="musepack.h::mpc_decoder_seek_sample"></a>
BOOL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="musepack_8h.html#a17">mpc_decoder_seek_sample</a> (mpc_decoder *d, mpc_int64_t destsample)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Seeks to the specified sample in the source stream. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a18" doxytag="musepack.h::mpc_decoder_seek_seconds"></a>
BOOL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="musepack_8h.html#a18">mpc_decoder_seek_seconds</a> (mpc_decoder *d, double seconds)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Seeks to specified position in seconds in the source stream. <br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Top level include file for libmusepack.
<p>
Definition in file <a class="el" href="musepack_8h-source.html">musepack.h</a>.<hr><h2>Enumeration Type Documentation</h2>
<a class="anchor" name="a19" doxytag="musepack.h::@1"></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">anonymous enum </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" name="a19a8" doxytag="MPC_DECODER_BUFFER_LENGTH"></a>MPC_DECODER_BUFFER_LENGTH</em>&nbsp;</td><td>
samples per mpc frame </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="musepack_8h-source.html#l00056">56</a> of file <a class="el" href="musepack_8h-source.html">musepack.h</a>. </td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="a16" doxytag="musepack.h::mpc_decoder_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">mpc_uint32_t mpc_decoder_decode </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">mpc_decoder *&nbsp;</td>
<td class="mdname" nowrap> <em>d</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>MPC_SAMPLE_FORMAT *&nbsp;</td>
<td class="mdname" nowrap> <em>buffer</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>mpc_uint32_t *&nbsp;</td>
<td class="mdname" nowrap> <em>vbr_update_acc</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>mpc_uint32_t *&nbsp;</td>
<td class="mdname" nowrap> <em>vbr_update_bits</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Actually reads data from previously initialized stream. Call this iteratively to decode the mpc stream. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>buffer</em>&nbsp;</td><td>destination buffer for decoded samples </td></tr>
<tr><td valign="top"></td><td valign="top"><em>vbr_update_acc</em>&nbsp;</td><td></td></tr>
</table>
</dl>
<dl compact><dt><b><a class="el" href="todo.html#_todo000001">Todo:</a></b></dt><dd>document me</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>vbr_update_bits</em>&nbsp;</td><td></td></tr>
</table>
</dl>
<dl compact><dt><b><a class="el" href="todo.html#_todo000001">Todo:</a></b></dt><dd>document me</dd></dl>
<dl compact><dt><b>Returns:</b></dt><dd>-1 if an error is encountered <p>
0 if the stream has been completely decoded successfully and there are no more samples <p>
&gt; 0 to indicate the number of bytes that were actually read from the stream. </dd></dl>
<p>
Definition at line <a class="el" href="mpc__decoder_8c-source.html#l00422">422</a> of file <a class="el" href="mpc__decoder_8c-source.html">mpc_decoder.c</a>. </td>
</tr>
</table>
<a class="anchor" name="a14" doxytag="musepack.h::mpc_decoder_initialize"></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">BOOL mpc_decoder_initialize </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">mpc_decoder *&nbsp;</td>
<td class="mdname" nowrap> <em>d</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>mpc_streaminfo *&nbsp;</td>
<td class="mdname" nowrap> <em>si</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Initializes mpc decoder with the supplied stream info parameters. Call this next after calling mpc_decoder_setup. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>si</em>&nbsp;</td><td>streaminfo structure indicating format of source stream </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>TRUE if decoder was initalized successfully, FALSE otherwise </dd></dl>
<p>
Definition at line <a class="el" href="mpc__decoder_8c-source.html#l01194">1194</a> of file <a class="el" href="mpc__decoder_8c-source.html">mpc_decoder.c</a>. </td>
</tr>
</table>
<a class="anchor" name="a15" doxytag="musepack.h::mpc_decoder_scale_output"></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">void mpc_decoder_scale_output </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">mpc_decoder *&nbsp;</td>
<td class="mdname" nowrap> <em>d</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>double&nbsp;</td>
<td class="mdname" nowrap> <em>scale_factor</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Sets decoder sample scaling factor. All decoded samples will be multiplied by this factor. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>scale_factor</em>&nbsp;</td><td>multiplicative scaling factor </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="requant_8c-source.html#l00089">89</a> of file <a class="el" href="requant_8c-source.html">requant.c</a>. </td>
</tr>
</table>
<a class="anchor" name="a13" doxytag="musepack.h::mpc_decoder_setup"></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">void mpc_decoder_setup </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">mpc_decoder *&nbsp;</td>
<td class="mdname" nowrap> <em>d</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>mpc_reader *&nbsp;</td>
<td class="mdname" nowrap> <em>r</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Sets up decoder library. Call this first when preparing to decode an mpc stream. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>r</em>&nbsp;</td><td>reader that will supply raw data to the decoder </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="mpc__decoder_8c-source.html#l01108">1108</a> of file <a class="el" href="mpc__decoder_8c-source.html">mpc_decoder.c</a>. </td>
</tr>
</table>
<a class="anchor" name="a11" doxytag="musepack.h::mpc_streaminfo_get_length"></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">double mpc_streaminfo_get_length </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">mpc_streaminfo *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>si</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Gets length of stream si, in seconds. <dl compact><dt><b>Returns:</b></dt><dd>length of stream in seconds </dd></dl>
<p>
Definition at line <a class="el" href="streaminfo_8c-source.html#l00263">263</a> of file <a class="el" href="streaminfo_8c-source.html">streaminfo.c</a>.
<p>
References <a class="el" href="streaminfo_8c-source.html#l00270">mpc_streaminfo_get_length_samples()</a>. </td>
</tr>
</table>
<a class="anchor" name="a12" doxytag="musepack.h::mpc_streaminfo_get_length_samples"></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">mpc_int64_t mpc_streaminfo_get_length_samples </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">mpc_streaminfo *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>si</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Returns length of stream si, in samples. <dl compact><dt><b>Returns:</b></dt><dd>length of stream in samples </dd></dl>
<p>
Definition at line <a class="el" href="streaminfo_8c-source.html#l00270">270</a> of file <a class="el" href="streaminfo_8c-source.html">streaminfo.c</a>.
<p>
Referenced by <a class="el" href="streaminfo_8c-source.html#l00263">mpc_streaminfo_get_length()</a>. </td>
</tr>
</table>
<a class="anchor" name="a9" doxytag="musepack.h::mpc_streaminfo_init"></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">void mpc_streaminfo_init </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">mpc_streaminfo *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>si</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Initializes a streaminfo structure. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>si</em>&nbsp;</td><td>streaminfo structure to initialize </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="streaminfo_8c-source.html#l00056">56</a> of file <a class="el" href="streaminfo_8c-source.html">streaminfo.c</a>. </td>
</tr>
</table>
<a class="anchor" name="a10" doxytag="musepack.h::mpc_streaminfo_read"></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">mpc_int32_t mpc_streaminfo_read </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">mpc_streaminfo *&nbsp;</td>
<td class="mdname" nowrap> <em>si</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>mpc_reader *&nbsp;</td>
<td class="mdname" nowrap> <em>r</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Reads streaminfo header from the mpc stream supplied by r. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>si</em>&nbsp;</td><td>streaminfo pointer to which info will be written </td></tr>
<tr><td valign="top"></td><td valign="top"><em>r</em>&nbsp;</td><td>stream reader to supply raw data </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>error code </dd></dl>
<p>
Definition at line <a class="el" href="streaminfo_8c-source.html#l00202">202</a> of file <a class="el" href="streaminfo_8c-source.html">streaminfo.c</a>. </td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Sat Jan 22 09:34:07 2005 for libmusepack by&nbsp;
<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>