161 lines
10 KiB
HTML
Executable File
161 lines
10 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/decoder.h Source File</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 Page</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="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
|
|
<div class="nav">
|
|
<a class="el" href="dir_000000.html">include</a> / <a class="el" href="dir_000001.html">musepack</a></div>
|
|
<h1>decoder.h</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">/*</span>
|
|
00002 <span class="comment"> Copyright (c) 2005, The Musepack Development Team</span>
|
|
00003 <span class="comment"> All rights reserved.</span>
|
|
00004 <span class="comment"></span>
|
|
00005 <span class="comment"> Redistribution and use in source and binary forms, with or without</span>
|
|
00006 <span class="comment"> modification, are permitted provided that the following conditions are</span>
|
|
00007 <span class="comment"> met:</span>
|
|
00008 <span class="comment"></span>
|
|
00009 <span class="comment"> * Redistributions of source code must retain the above copyright</span>
|
|
00010 <span class="comment"> notice, this list of conditions and the following disclaimer.</span>
|
|
00011 <span class="comment"></span>
|
|
00012 <span class="comment"> * Redistributions in binary form must reproduce the above</span>
|
|
00013 <span class="comment"> copyright notice, this list of conditions and the following</span>
|
|
00014 <span class="comment"> disclaimer in the documentation and/or other materials provided</span>
|
|
00015 <span class="comment"> with the distribution.</span>
|
|
00016 <span class="comment"></span>
|
|
00017 <span class="comment"> * Neither the name of the The Musepack Development Team nor the</span>
|
|
00018 <span class="comment"> names of its contributors may be used to endorse or promote</span>
|
|
00019 <span class="comment"> products derived from this software without specific prior</span>
|
|
00020 <span class="comment"> written permission.</span>
|
|
00021 <span class="comment"></span>
|
|
00022 <span class="comment"> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS</span>
|
|
00023 <span class="comment"> "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT</span>
|
|
00024 <span class="comment"> LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR</span>
|
|
00025 <span class="comment"> A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT</span>
|
|
00026 <span class="comment"> OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</span>
|
|
00027 <span class="comment"> SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT</span>
|
|
00028 <span class="comment"> LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,</span>
|
|
00029 <span class="comment"> DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY</span>
|
|
00030 <span class="comment"> THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span>
|
|
00031 <span class="comment"> (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE</span>
|
|
00032 <span class="comment"> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
|
|
00033 <span class="comment">*/</span>
|
|
00034
|
|
00036
|
|
00037 <span class="preprocessor">#ifndef _musepack_decoder_h_</span>
|
|
00038 <span class="preprocessor"></span><span class="preprocessor">#define _musepack_decoder_h_</span>
|
|
00039 <span class="preprocessor"></span>
|
|
00040 <span class="preprocessor">#include "<a class="code" href="huffman_8h.html">musepack/huffman.h</a>"</span>
|
|
00041 <span class="preprocessor">#include "musepack/math.h"</span>
|
|
00042 <span class="preprocessor">#include "<a class="code" href="musepack_8h.html">musepack/musepack.h</a>"</span>
|
|
00043 <span class="preprocessor">#include "<a class="code" href="reader_8h.html">musepack/reader.h</a>"</span>
|
|
00044 <span class="preprocessor">#include "<a class="code" href="streaminfo_8h.html">musepack/streaminfo.h</a>"</span>
|
|
00045
|
|
00046 <span class="keyword">enum</span> {
|
|
00047 MPC_V_MEM = 2304,
|
|
00048 MPC_DECODER_MEMSIZE = 16384, <span class="comment">// overall buffer size</span>
|
|
00049 };
|
|
00050
|
|
00051 <span class="keyword">typedef</span> <span class="keyword">struct </span>{
|
|
00052 mpc_int32_t L [36];
|
|
00053 mpc_int32_t R [36];
|
|
00054 } QuantTyp;
|
|
00055
|
|
00056 <span class="keyword">typedef</span> <span class="keyword">struct </span>mpc_decoder_t {
|
|
00057 mpc_reader *r;
|
|
00058
|
|
00060
|
|
00061
|
|
00062 mpc_uint32_t dword;
|
|
00063 mpc_uint32_t pos;
|
|
00064 mpc_uint32_t Speicher[MPC_DECODER_MEMSIZE];
|
|
00065 mpc_uint32_t Zaehler;
|
|
00066
|
|
00067 mpc_uint32_t samples_to_skip;
|
|
00068
|
|
00069 mpc_uint32_t FwdJumpInfo;
|
|
00070 mpc_uint32_t ActDecodePos;
|
|
00071 mpc_uint32_t FrameWasValid;
|
|
00072
|
|
00073 mpc_uint32_t DecodedFrames;
|
|
00074 mpc_uint32_t OverallFrames;
|
|
00075 mpc_int32_t SampleRate; <span class="comment">// Sample frequency</span>
|
|
00076
|
|
00077 mpc_uint32_t StreamVersion; <span class="comment">// version of bitstream</span>
|
|
00078 mpc_uint32_t MS_used; <span class="comment">// MS-coding used ?</span>
|
|
00079 mpc_int32_t Max_Band;
|
|
00080 mpc_uint32_t MPCHeaderPos; <span class="comment">// AB: needed to support ID3v2</span>
|
|
00081 mpc_uint32_t LastValidSamples;
|
|
00082 mpc_uint32_t TrueGaplessPresent;
|
|
00083
|
|
00084 mpc_uint32_t EQ_activated;
|
|
00085
|
|
00086 mpc_uint32_t WordsRead; <span class="comment">// counts amount of decoded dwords</span>
|
|
00087
|
|
00088 <span class="comment">// randomizer state variables</span>
|
|
00089 mpc_uint32_t __r1;
|
|
00090 mpc_uint32_t __r2;
|
|
00091
|
|
00092 mpc_uint32_t Q_bit [32];
|
|
00093 mpc_uint32_t Q_res [32][16];
|
|
00094
|
|
00095 <span class="comment">// huffman table stuff</span>
|
|
00096 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> HuffHdr [10];
|
|
00097 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> HuffSCFI [ 4];
|
|
00098 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> HuffDSCF [16];
|
|
00099 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a>* HuffQ [2] [8];
|
|
00100
|
|
00101 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> HuffQ1 [2] [3*3*3];
|
|
00102 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> HuffQ2 [2] [5*5];
|
|
00103 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> HuffQ3 [2] [ 7];
|
|
00104 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> HuffQ4 [2] [ 9];
|
|
00105 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> HuffQ5 [2] [15];
|
|
00106 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> HuffQ6 [2] [31];
|
|
00107 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> HuffQ7 [2] [63];
|
|
00108 <span class="keyword">const</span> <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a>* SampleHuff [18];
|
|
00109 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> SCFI_Bundle [ 8];
|
|
00110 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> DSCF_Entropie [13];
|
|
00111 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> Region_A [16];
|
|
00112 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> Region_B [ 8];
|
|
00113 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> Region_C [ 4];
|
|
00114
|
|
00115 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> Entropie_1 [ 3];
|
|
00116 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> Entropie_2 [ 5];
|
|
00117 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> Entropie_3 [ 7];
|
|
00118 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> Entropie_4 [ 9];
|
|
00119 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> Entropie_5 [15];
|
|
00120 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> Entropie_6 [31];
|
|
00121 <a class="code" href="structhuffman__type__t.html">HuffmanTyp</a> Entropie_7 [63];
|
|
00122
|
|
00123 mpc_int32_t SCF_Index_L [32] [3];
|
|
00124 mpc_int32_t SCF_Index_R [32] [3]; <span class="comment">// holds scalefactor-indices</span>
|
|
00125 QuantTyp Q [32]; <span class="comment">// holds quantized samples</span>
|
|
00126 mpc_int32_t Res_L [32];
|
|
00127 mpc_int32_t Res_R [32]; <span class="comment">// holds the chosen quantizer for each subband</span>
|
|
00128 mpc_int32_t DSCF_Flag_L [32];
|
|
00129 mpc_int32_t DSCF_Flag_R [32]; <span class="comment">// differential SCF used?</span>
|
|
00130 mpc_int32_t SCFI_L [32];
|
|
00131 mpc_int32_t SCFI_R [32]; <span class="comment">// describes order of transmitted SCF</span>
|
|
00132 mpc_int32_t DSCF_Reference_L [32];
|
|
00133 mpc_int32_t DSCF_Reference_R [32]; <span class="comment">// holds last frames SCF</span>
|
|
00134 mpc_int32_t MS_Flag[32]; <span class="comment">// MS used?</span>
|
|
00135 <span class="preprocessor">#ifdef MPC_FIXED_POINT</span>
|
|
00136 <span class="preprocessor"></span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> SCF_shift[256];
|
|
00137 <span class="preprocessor">#endif</span>
|
|
00138 <span class="preprocessor"></span>
|
|
00139 MPC_SAMPLE_FORMAT V_L[MPC_V_MEM + 960];
|
|
00140 MPC_SAMPLE_FORMAT V_R[MPC_V_MEM + 960];
|
|
00141 MPC_SAMPLE_FORMAT Y_L[36][32];
|
|
00142 MPC_SAMPLE_FORMAT Y_R[36][32];
|
|
00143 MPC_SAMPLE_FORMAT SCF[256];
|
|
00144
|
|
00145
|
|
00146 } mpc_decoder;
|
|
00147
|
|
00148 <span class="preprocessor">#endif // _mpc_decoder_h</span>
|
|
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Sat Jan 22 09:34:06 2005 for libmusepack 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>
|