00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00036
00037 #ifndef _musepack_decoder_h_
00038 #define _musepack_decoder_h_
00039
00040 #include "musepack/huffman.h"
00041 #include "musepack/math.h"
00042 #include "musepack/musepack.h"
00043 #include "musepack/reader.h"
00044 #include "musepack/streaminfo.h"
00045
00046 enum {
00047 MPC_V_MEM = 2304,
00048 MPC_DECODER_MEMSIZE = 16384,
00049 };
00050
00051 typedef struct {
00052 mpc_int32_t L [36];
00053 mpc_int32_t R [36];
00054 } QuantTyp;
00055
00056 typedef struct 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;
00076
00077 mpc_uint32_t StreamVersion;
00078 mpc_uint32_t MS_used;
00079 mpc_int32_t Max_Band;
00080 mpc_uint32_t MPCHeaderPos;
00081 mpc_uint32_t LastValidSamples;
00082 mpc_uint32_t TrueGaplessPresent;
00083
00084 mpc_uint32_t EQ_activated;
00085
00086 mpc_uint32_t WordsRead;
00087
00088
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
00096 HuffmanTyp HuffHdr [10];
00097 HuffmanTyp HuffSCFI [ 4];
00098 HuffmanTyp HuffDSCF [16];
00099 HuffmanTyp* HuffQ [2] [8];
00100
00101 HuffmanTyp HuffQ1 [2] [3*3*3];
00102 HuffmanTyp HuffQ2 [2] [5*5];
00103 HuffmanTyp HuffQ3 [2] [ 7];
00104 HuffmanTyp HuffQ4 [2] [ 9];
00105 HuffmanTyp HuffQ5 [2] [15];
00106 HuffmanTyp HuffQ6 [2] [31];
00107 HuffmanTyp HuffQ7 [2] [63];
00108 const HuffmanTyp* SampleHuff [18];
00109 HuffmanTyp SCFI_Bundle [ 8];
00110 HuffmanTyp DSCF_Entropie [13];
00111 HuffmanTyp Region_A [16];
00112 HuffmanTyp Region_B [ 8];
00113 HuffmanTyp Region_C [ 4];
00114
00115 HuffmanTyp Entropie_1 [ 3];
00116 HuffmanTyp Entropie_2 [ 5];
00117 HuffmanTyp Entropie_3 [ 7];
00118 HuffmanTyp Entropie_4 [ 9];
00119 HuffmanTyp Entropie_5 [15];
00120 HuffmanTyp Entropie_6 [31];
00121 HuffmanTyp Entropie_7 [63];
00122
00123 mpc_int32_t SCF_Index_L [32] [3];
00124 mpc_int32_t SCF_Index_R [32] [3];
00125 QuantTyp Q [32];
00126 mpc_int32_t Res_L [32];
00127 mpc_int32_t Res_R [32];
00128 mpc_int32_t DSCF_Flag_L [32];
00129 mpc_int32_t DSCF_Flag_R [32];
00130 mpc_int32_t SCFI_L [32];
00131 mpc_int32_t SCFI_R [32];
00132 mpc_int32_t DSCF_Reference_L [32];
00133 mpc_int32_t DSCF_Reference_R [32];
00134 mpc_int32_t MS_Flag[32];
00135 #ifdef MPC_FIXED_POINT
00136 unsigned char SCF_shift[256];
00137 #endif
00138
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 #endif // _mpc_decoder_h