summaryrefslogtreecommitdiff
path: root/apps/codecs/libmusepack/decoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libmusepack/decoder.h')
-rw-r--r--apps/codecs/libmusepack/decoder.h56
1 files changed, 13 insertions, 43 deletions
diff --git a/apps/codecs/libmusepack/decoder.h b/apps/codecs/libmusepack/decoder.h
index 11acb7598b..759670ee72 100644
--- a/apps/codecs/libmusepack/decoder.h
+++ b/apps/codecs/libmusepack/decoder.h
@@ -34,8 +34,8 @@
34 34
35/// \file decoder.h 35/// \file decoder.h
36 36
37#ifndef _musepack_decoder_h_ 37#ifndef _mpcdec_decoder_h_
38#define _musepack_decoder_h_ 38#define _mpcdec_decoder_h_
39 39
40#include "huffman.h" 40#include "huffman.h"
41#include "math.h" 41#include "math.h"
@@ -43,6 +43,8 @@
43#include "reader.h" 43#include "reader.h"
44#include "streaminfo.h" 44#include "streaminfo.h"
45 45
46#define MPC_SUPPORT_SV456
47
46enum { 48enum {
47 MPC_V_MEM = 2304, 49 MPC_V_MEM = 2304,
48 MPC_DECODER_MEMSIZE = 16384, // overall buffer size 50 MPC_DECODER_MEMSIZE = 16384, // overall buffer size
@@ -59,29 +61,28 @@ typedef struct mpc_decoder_t {
59 /// @name internal state variables 61 /// @name internal state variables
60 //@{ 62 //@{
61 63
62 mpc_uint32_t dword; /// actually decoded 32bit-word 64 mpc_uint32_t dword; /// currently decoded 32bit-word
63 mpc_uint32_t pos; /// bit-position within dword 65 mpc_uint32_t pos; /// bit-position within dword
64 mpc_uint32_t Speicher[MPC_DECODER_MEMSIZE]; /// read-buffer 66 mpc_uint32_t Speicher[MPC_DECODER_MEMSIZE]; /// read-buffer
65 mpc_uint32_t Zaehler; /// actual index within read-buffer 67 mpc_uint32_t Zaehler; /// actual index within read-buffer
66 68
67 mpc_uint32_t samples_to_skip; 69 mpc_uint32_t samples_to_skip;
68 70
69 mpc_uint32_t FwdJumpInfo; 71 mpc_uint32_t FwdJumpInfo;
70 mpc_uint32_t ActDecodePos; 72 mpc_uint32_t ActDecodePos;
71 mpc_uint32_t FrameWasValid; 73
72 74
73 mpc_uint32_t DecodedFrames; 75 mpc_uint32_t DecodedFrames;
74 mpc_uint32_t OverallFrames; 76 mpc_uint32_t OverallFrames;
75 mpc_int32_t SampleRate; // Sample frequency 77 mpc_int32_t SampleRate; // Sample frequency
76 78
77 mpc_uint32_t StreamVersion; // version of bitstream 79 mpc_uint32_t StreamVersion; // version of bitstream
78 mpc_uint32_t MS_used; // MS-coding used ?
79 mpc_int32_t Max_Band; 80 mpc_int32_t Max_Band;
80 mpc_uint32_t MPCHeaderPos; // AB: needed to support ID3v2 81 mpc_uint32_t MPCHeaderPos; // AB: needed to support ID3v2
81 mpc_uint32_t LastValidSamples;
82 mpc_uint32_t TrueGaplessPresent;
83 82
84 mpc_uint32_t EQ_activated; 83 mpc_uint32_t FrameWasValid;
84 mpc_uint32_t MS_used; // MS-coding used ?
85 mpc_uint32_t TrueGaplessPresent;
85 86
86 mpc_uint32_t WordsRead; // counts amount of decoded dwords 87 mpc_uint32_t WordsRead; // counts amount of decoded dwords
87 88
@@ -89,49 +90,18 @@ typedef struct mpc_decoder_t {
89 mpc_uint32_t __r1; 90 mpc_uint32_t __r1;
90 mpc_uint32_t __r2; 91 mpc_uint32_t __r2;
91 92
92 mpc_uint32_t Q_bit [32];
93 mpc_uint32_t Q_res [32][16];
94
95 // huffman table stuff
96 HuffmanTyp HuffHdr [10];
97 HuffmanTyp HuffSCFI [ 4];
98 HuffmanTyp HuffDSCF [16];
99 HuffmanTyp* HuffQ [2] [8];
100
101 HuffmanTyp HuffQ1 [2] [3*3*3];
102 HuffmanTyp HuffQ2 [2] [5*5];
103 HuffmanTyp HuffQ3 [2] [ 7];
104 HuffmanTyp HuffQ4 [2] [ 9];
105 HuffmanTyp HuffQ5 [2] [15];
106 HuffmanTyp HuffQ6 [2] [31];
107 HuffmanTyp HuffQ7 [2] [63];
108 const HuffmanTyp* SampleHuff [18];
109 HuffmanTyp SCFI_Bundle [ 8];
110 HuffmanTyp DSCF_Entropie [13];
111 HuffmanTyp Region_A [16];
112 HuffmanTyp Region_B [ 8];
113 HuffmanTyp Region_C [ 4];
114
115 HuffmanTyp Entropie_1 [ 3];
116 HuffmanTyp Entropie_2 [ 5];
117 HuffmanTyp Entropie_3 [ 7];
118 HuffmanTyp Entropie_4 [ 9];
119 HuffmanTyp Entropie_5 [15];
120 HuffmanTyp Entropie_6 [31];
121 HuffmanTyp Entropie_7 [63];
122
123 mpc_int32_t SCF_Index_L [32] [3]; 93 mpc_int32_t SCF_Index_L [32] [3];
124 mpc_int32_t SCF_Index_R [32] [3]; // holds scalefactor-indices 94 mpc_int32_t SCF_Index_R [32] [3]; // holds scalefactor-indices
125 QuantTyp Q [32]; // holds quantized samples 95 QuantTyp Q [32]; // holds quantized samples
126 mpc_int32_t Res_L [32]; 96 mpc_int32_t Res_L [32];
127 mpc_int32_t Res_R [32]; // holds the chosen quantizer for each subband 97 mpc_int32_t Res_R [32]; // holds the chosen quantizer for each subband
128 mpc_int32_t DSCF_Flag_L [32]; 98 mpc_bool_t DSCF_Flag_L [32];
129 mpc_int32_t DSCF_Flag_R [32]; // differential SCF used? 99 mpc_bool_t DSCF_Flag_R [32]; // differential SCF used?
130 mpc_int32_t SCFI_L [32]; 100 mpc_int32_t SCFI_L [32];
131 mpc_int32_t SCFI_R [32]; // describes order of transmitted SCF 101 mpc_int32_t SCFI_R [32]; // describes order of transmitted SCF
132 mpc_int32_t DSCF_Reference_L [32]; 102 mpc_int32_t DSCF_Reference_L [32];
133 mpc_int32_t DSCF_Reference_R [32]; // holds last frames SCF 103 mpc_int32_t DSCF_Reference_R [32]; // holds last frames SCF
134 mpc_int32_t MS_Flag[32]; // MS used? 104 mpc_bool_t MS_Flag[32]; // MS used?
135#ifdef MPC_FIXED_POINT 105#ifdef MPC_FIXED_POINT
136 unsigned char SCF_shift[256]; 106 unsigned char SCF_shift[256];
137#endif 107#endif