10512
|
1 |
--- flac-1.2.1/configure.in-orig 2007-08-01 13:33:59.050837000 -0500
|
|
2 |
+++ flac-1.2.1/configure.in 2007-08-01 13:13:34.248470000 -0500
|
10252
|
3 |
@@ -48,6 +48,14 @@ AM_CONFIG_HEADER(config.h)
|
9748
|
4 |
|
|
5 |
AC_C_BIGENDIAN
|
|
6 |
|
|
7 |
+AC_C_INLINE
|
|
8 |
+
|
|
9 |
+if test "$ac_cv_c_inline" != no ; then
|
|
10 |
+ AC_DEFINE_UNQUOTED(FLAC_INLINE,$ac_cv_c_inline)
|
|
11 |
+ AC_SUBST(FLAC_INLINE)
|
|
12 |
+ AH_TEMPLATE(FLAC_INLINE, [define inline to use])
|
|
13 |
+fi
|
|
14 |
+
|
|
15 |
AC_CHECK_TYPES(socklen_t, [], [])
|
|
16 |
|
|
17 |
dnl check for getopt in standard library
|
10512
|
18 |
@@ -308,7 +308,7 @@
|
9748
|
19 |
else
|
10512
|
20 |
CPPFLAGS="-DNDEBUG $CPPFLAGS"
|
9748
|
21 |
if test "x$GCC" = xyes; then
|
10512
|
22 |
- CPPFLAGS="-DFLaC__INLINE=__inline__ $CPPFLAGS"
|
|
23 |
+ CPPFLAGS="$CPPFLAGS"
|
|
24 |
CFLAGS="-O3 -funroll-loops -finline-functions -Wall -W -Winline $CFLAGS"
|
9748
|
25 |
fi
|
|
26 |
fi
|
10252
|
27 |
--- flac-1.2.0/include/share/replaygain_analysis.h-orig 2007-08-01 13:37:48.953601000 -0500
|
|
28 |
+++ flac-1.2.0/include/share/replaygain_analysis.h 2007-08-01 13:13:34.288739000 -0500
|
9748
|
29 |
@@ -1,59 +1,59 @@
|
12231
|
30 |
-/*
|
|
31 |
- * ReplayGainAnalysis - analyzes input samples and give the recommended dB change
|
|
32 |
- * Copyright (C) 2001 David Robinson and Glen Sawyer
|
|
33 |
- *
|
|
34 |
- * This library is free software; you can redistribute it and/or
|
|
35 |
- * modify it under the terms of the GNU Lesser General Public
|
|
36 |
- * License as published by the Free Software Foundation; either
|
|
37 |
- * version 2.1 of the License, or (at your option) any later version.
|
|
38 |
- *
|
|
39 |
- * This library is distributed in the hope that it will be useful,
|
|
40 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
41 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
42 |
- * Lesser General Public License for more details.
|
|
43 |
- *
|
|
44 |
- * You should have received a copy of the GNU Lesser General Public
|
|
45 |
- * License along with this library; if not, write to the Free Software
|
|
46 |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
47 |
- *
|
|
48 |
- * concept and filter values by David Robinson ([email protected])
|
|
49 |
- * -- blame him if you think the idea is flawed
|
|
50 |
- * coding by Glen Sawyer ([email protected]) 442 N 700 E, Provo, UT 84606 USA
|
|
51 |
- * -- blame him if you think this runs too slowly, or the coding is otherwise flawed
|
|
52 |
- * minor cosmetic tweaks to integrate with FLAC by Josh Coalson
|
|
53 |
- *
|
|
54 |
- * For an explanation of the concepts and the basic algorithms involved, go to:
|
|
55 |
- * http://www.replaygain.org/
|
|
56 |
- */
|
|
57 |
-
|
|
58 |
-#ifndef GAIN_ANALYSIS_H
|
|
59 |
-#define GAIN_ANALYSIS_H
|
|
60 |
-
|
|
61 |
-#include <stddef.h>
|
|
62 |
-
|
|
63 |
-#define GAIN_NOT_ENOUGH_SAMPLES -24601
|
|
64 |
-#define GAIN_ANALYSIS_ERROR 0
|
|
65 |
-#define GAIN_ANALYSIS_OK 1
|
|
66 |
-
|
|
67 |
-#define INIT_GAIN_ANALYSIS_ERROR 0
|
|
68 |
-#define INIT_GAIN_ANALYSIS_OK 1
|
|
69 |
-
|
|
70 |
-#ifdef __cplusplus
|
|
71 |
-extern "C" {
|
|
72 |
-#endif
|
|
73 |
-
|
|
74 |
-typedef float Float_t; /* Type used for filtering */
|
|
75 |
-
|
|
76 |
-extern Float_t ReplayGainReferenceLoudness; /* in dB SPL, currently == 89.0 */
|
|
77 |
-
|
|
78 |
-int InitGainAnalysis ( long samplefreq );
|
|
79 |
-int AnalyzeSamples ( const Float_t* left_samples, const Float_t* right_samples, size_t num_samples, int num_channels );
|
|
80 |
-int ResetSampleFrequency ( long samplefreq );
|
|
81 |
-Float_t GetTitleGain ( void );
|
|
82 |
-Float_t GetAlbumGain ( void );
|
|
83 |
-
|
|
84 |
-#ifdef __cplusplus
|
|
85 |
-}
|
|
86 |
-#endif
|
|
87 |
-
|
|
88 |
-#endif /* GAIN_ANALYSIS_H */
|
9748
|
89 |
+/*
|
|
90 |
+ * ReplayGainAnalysis - analyzes input samples and give the recommended dB change
|
|
91 |
+ * Copyright (C) 2001 David Robinson and Glen Sawyer
|
|
92 |
+ *
|
|
93 |
+ * This library is free software; you can redistribute it and/or
|
|
94 |
+ * modify it under the terms of the GNU Lesser General Public
|
|
95 |
+ * License as published by the Free Software Foundation; either
|
|
96 |
+ * version 2.1 of the License, or (at your option) any later version.
|
|
97 |
+ *
|
|
98 |
+ * This library is distributed in the hope that it will be useful,
|
|
99 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
100 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
101 |
+ * Lesser General Public License for more details.
|
|
102 |
+ *
|
|
103 |
+ * You should have received a copy of the GNU Lesser General Public
|
|
104 |
+ * License along with this library; if not, write to the Free Software
|
|
105 |
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
106 |
+ *
|
|
107 |
+ * concept and filter values by David Robinson ([email protected])
|
|
108 |
+ * -- blame him if you think the idea is flawed
|
|
109 |
+ * coding by Glen Sawyer ([email protected]) 442 N 700 E, Provo, UT 84606 USA
|
|
110 |
+ * -- blame him if you think this runs too slowly, or the coding is otherwise flawed
|
|
111 |
+ * minor cosmetic tweaks to integrate with FLAC by Josh Coalson
|
|
112 |
+ *
|
|
113 |
+ * For an explanation of the concepts and the basic algorithms involved, go to:
|
|
114 |
+ * http://www.replaygain.org/
|
|
115 |
+ */
|
|
116 |
+
|
|
117 |
+#ifndef GAIN_ANALYSIS_H
|
|
118 |
+#define GAIN_ANALYSIS_H
|
|
119 |
+
|
|
120 |
+#include <stddef.h>
|
|
121 |
+
|
|
122 |
+#define GAIN_NOT_ENOUGH_SAMPLES -24601
|
|
123 |
+#define GAIN_ANALYSIS_ERROR 0
|
|
124 |
+#define GAIN_ANALYSIS_OK 1
|
|
125 |
+
|
|
126 |
+#define INIT_GAIN_ANALYSIS_ERROR 0
|
|
127 |
+#define INIT_GAIN_ANALYSIS_OK 1
|
|
128 |
+
|
|
129 |
+#ifdef __cplusplus
|
|
130 |
+extern "C" {
|
|
131 |
+#endif
|
|
132 |
+
|
|
133 |
+typedef float Float_t; /* Type used for filtering */
|
|
134 |
+
|
|
135 |
+extern Float_t ReplayGainReferenceLoudness; /* in dB SPL, currently == 89.0 */
|
|
136 |
+
|
|
137 |
+int InitGainAnalysis ( long samplefreq );
|
|
138 |
+int AnalyzeSamples ( const Float_t* left_samples, const Float_t* right_samples, size_t num_samples, int num_channels );
|
|
139 |
+int ResetSampleFrequency ( long samplefreq );
|
|
140 |
+Float_t GetTitleGain ( void );
|
|
141 |
+Float_t GetAlbumGain ( void );
|
|
142 |
+
|
|
143 |
+#ifdef __cplusplus
|
|
144 |
+}
|
|
145 |
+#endif
|
|
146 |
+
|
|
147 |
+#endif /* GAIN_ANALYSIS_H */
|
10252
|
148 |
--- flac-1.2.0/src/plugin_winamp2/infobox.c-orig 2007-08-01 13:34:46.716826000 -0500
|
|
149 |
+++ flac-1.2.0/src/plugin_winamp2/infobox.c 2007-08-01 13:13:34.257582000 -0500
|
|
150 |
@@ -48,7 +48,7 @@ static const char infoTitle[] = "FLAC Fi
|
12231
|
151 |
|
|
152 |
/* TODO: write genres in utf-8 ? */
|
|
153 |
|
|
154 |
-static __inline int GetGenresFileName(char *buffer, int size)
|
|
155 |
+static FLAC_INLINE int GetGenresFileName(char *buffer, int size)
|
|
156 |
{
|
|
157 |
char *c;
|
|
158 |
|
10252
|
159 |
@@ -273,7 +273,7 @@ static BOOL InitInfoboxInfo(HWND hwnd, c
|
12231
|
160 |
return TRUE;
|
|
161 |
}
|
|
162 |
|
|
163 |
-static void __inline SetTag(HWND hwnd, const char *filename, FLAC__StreamMetadata *tags)
|
|
164 |
+static void FLAC_INLINE SetTag(HWND hwnd, const char *filename, FLAC__StreamMetadata *tags)
|
|
165 |
{
|
|
166 |
strcpy(buffer, infoTitle);
|
|
167 |
|
10252
|
168 |
@@ -399,7 +399,7 @@ ULONGLONG FileSize(const char *fileName)
|
12231
|
169 |
return res.QuadPart;
|
|
170 |
}
|
|
171 |
|
|
172 |
-static __inline char *GetFileName(const char *fullname)
|
|
173 |
+static FLAC_INLINE char *GetFileName(const char *fullname)
|
|
174 |
{
|
|
175 |
const char *c = fullname + strlen(fullname) - 1;
|
|
176 |
|
10252
|
177 |
--- flac-1.2.0/src/share/replaygain_analysis/replaygain_analysis.c-orig 2007-08-01 13:36:01.582583000 -0500
|
|
178 |
+++ flac-1.2.0/src/share/replaygain_analysis/replaygain_analysis.c 2007-08-01 13:22:19.440619000 -0500
|
|
179 |
@@ -110,10 +110,10 @@ typedef signed int Int32_t;
|
|
180 |
#define YULE_ORDER 10
|
|
181 |
#define BUTTER_ORDER 2
|
|
182 |
#define RMS_PERCENTILE 0.95 /* percentile which is louder than the proposed level */
|
|
183 |
-#define MAX_SAMP_FREQ 48000. /* maximum allowed sample frequency [Hz] */
|
|
184 |
-#define RMS_WINDOW_TIME 0.050 /* Time slice size [s] */
|
|
185 |
-#define STEPS_per_dB 100. /* Table entries per dB */
|
|
186 |
-#define MAX_dB 120. /* Table entries for 0...MAX_dB (normal max. values are 70...80 dB) */
|
|
187 |
+#define MAX_SAMP_FREQ 48000 /* maximum allowed sample frequency [Hz] */
|
|
188 |
+#define RMS_WINDOW_TIME 50 /* Time slice size [ms] */
|
|
189 |
+#define STEPS_per_dB 100 /* Table entries per dB */
|
|
190 |
+#define MAX_dB 120 /* Table entries for 0...MAX_dB (normal max. values are 70...80 dB) */
|
|
191 |
|
|
192 |
#define MAX_ORDER (BUTTER_ORDER > YULE_ORDER ? BUTTER_ORDER : YULE_ORDER)
|
|
193 |
/* [JEC] the following was originally #defined as:
|
|
194 |
@@ -122,12 +122,7 @@ typedef signed int Int32_t;
|
|
195 |
* sampleWindow calculation in ResetSampleFrequency(), and was causing
|
|
196 |
* buffer overflows for 48kHz analysis, hence the +1.
|
|
197 |
*/
|
|
198 |
-#ifndef __sun
|
|
199 |
- #define MAX_SAMPLES_PER_WINDOW (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME + 1.) /* max. Samples per Time slice */
|
|
200 |
-#else
|
|
201 |
- /* [JEC] Solaris Forte compiler doesn't like float calc in array indices */
|
|
202 |
- #define MAX_SAMPLES_PER_WINDOW (size_t) (2401)
|
|
203 |
-#endif
|
|
204 |
+#define MAX_SAMPLES_PER_WINDOW (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME / 1000 + 1) /* max. Samples per Time slice */
|
|
205 |
#define PINK_REF 64.82 /* 298640883795 */ /* calibration value */
|
|
206 |
|
|
207 |
static Float_t linprebuf [MAX_ORDER * 2];
|
|
208 |
@@ -255,7 +250,7 @@ ResetSampleFrequency ( long samplefreq )
|
|
209 |
default: return INIT_GAIN_ANALYSIS_ERROR;
|
|
210 |
}
|
|
211 |
|
|
212 |
- sampleWindow = (int) ceil (samplefreq * RMS_WINDOW_TIME);
|
|
213 |
+ sampleWindow = (int) ceil (samplefreq * RMS_WINDOW_TIME / 1000);
|
|
214 |
|
|
215 |
lsum = 0.;
|
|
216 |
rsum = 0.;
|
|
217 |
--- flac-1.2.0/src/share/replaygain_synthesis/replaygain_synthesis.c-orig 2007-08-01 13:38:42.924311000 -0500
|
|
218 |
+++ flac-1.2.0/src/share/replaygain_synthesis/replaygain_synthesis.c 2007-08-01 13:24:07.805641000 -0500
|
|
219 |
@@ -44,10 +44,6 @@
|
|
220 |
#include "replaygain_synthesis.h"
|
|
221 |
#include "FLAC/assert.h"
|
|
222 |
|
|
223 |
-#ifndef FLaC__INLINE
|
|
224 |
-#define FLaC__INLINE
|
|
225 |
-#endif
|
|
226 |
-
|
|
227 |
/* adjust for compilers that can't understand using LL suffix for int64_t literals */
|
|
228 |
#ifdef _MSC_VER
|
|
229 |
#define FLAC__I64L(x) x
|
|
230 |
@@ -236,7 +232,7 @@ void FLAC__replaygain_synthesis__init_di
|
|
231 |
* the following is based on parts of wavegain.c
|
|
232 |
*/
|
|
233 |
|
|
234 |
-static FLaC__INLINE FLAC__int64 dither_output_(DitherContext *d, FLAC__bool do_dithering, int shapingtype, int i, double Sum, int k)
|
|
235 |
+static FLAC_INLINE FLAC__int64 dither_output_(DitherContext *d, FLAC__bool do_dithering, int shapingtype, int i, double Sum, int k)
|
|
236 |
{
|
|
237 |
union {
|
|
238 |
double d;
|
10512
|
239 |
--- flac-1.2.1/src/plugin_common/tags.c-orig 2007-08-01 13:39:21.131268000 -0500
|
|
240 |
+++ flac-1.2.1/src/plugin_common/tags.c 2007-08-01 13:25:03.310108000 -0500
|
|
241 |
@@ -29,12 +29,7 @@
|
10252
|
242 |
#include "FLAC/metadata.h"
|
10512
|
243 |
#include "share/alloc.h"
|
10252
|
244 |
|
|
245 |
-#ifndef FLaC__INLINE
|
|
246 |
-#define FLaC__INLINE
|
|
247 |
-#endif
|
|
248 |
-
|
|
249 |
-
|
10512
|
250 |
-static FLaC__INLINE size_t local__wide_strlen(const FLAC__uint16 *s)
|
12222
|
251 |
+static FLAC_INLINE size_t local__wide_strlen(const FLAC__uint16 *s)
|
10252
|
252 |
{
|
10512
|
253 |
size_t n = 0;
|
10252
|
254 |
while(*s++)
|
10512
|
255 |
@@ -48,7 +43,7 @@
|
10252
|
256 |
* and a more clear explanation at the end of this section:
|
|
257 |
* http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
|
258 |
*/
|
10512
|
259 |
-static FLaC__INLINE size_t local__utf8len(const FLAC__byte *utf8)
|
12222
|
260 |
+static FLAC_INLINE size_t local__utf8len(const FLAC__byte *utf8)
|
10252
|
261 |
{
|
|
262 |
FLAC__ASSERT(0 != utf8);
|
|
263 |
if ((utf8[0] & 0x80) == 0) {
|
10512
|
264 |
@@ -90,7 +85,7 @@
|
10252
|
265 |
}
|
|
266 |
|
|
267 |
|
10512
|
268 |
-static FLaC__INLINE size_t local__utf8_to_ucs2(const FLAC__byte *utf8, FLAC__uint16 *ucs2)
|
12222
|
269 |
+static FLAC_INLINE size_t local__utf8_to_ucs2(const FLAC__byte *utf8, FLAC__uint16 *ucs2)
|
10512
|
270 |
{
|
|
271 |
const size_t len = local__utf8len(utf8);
|
|
272 |
|
|
273 |
@@ -145,7 +140,7 @@
|
|
274 |
return out;
|
|
275 |
}
|
|
276 |
|
|
277 |
-static FLaC__INLINE size_t local__ucs2len(FLAC__uint16 ucs2)
|
12222
|
278 |
+static FLAC_INLINE size_t local__ucs2len(FLAC__uint16 ucs2)
|
10512
|
279 |
{
|
|
280 |
if (ucs2 < 0x0080)
|
|
281 |
return 1;
|
|
282 |
@@ -155,7 +150,7 @@
|
|
283 |
return 3;
|
|
284 |
}
|
|
285 |
|
|
286 |
-static FLaC__INLINE size_t local__ucs2_to_utf8(FLAC__uint16 ucs2, FLAC__byte *utf8)
|
12222
|
287 |
+static FLAC_INLINE size_t local__ucs2_to_utf8(FLAC__uint16 ucs2, FLAC__byte *utf8)
|
10512
|
288 |
{
|
|
289 |
if (ucs2 < 0x080) {
|
|
290 |
utf8[0] = (FLAC__byte)ucs2;
|
10252
|
291 |
-static FLaC__INLINE unsigned local__utf8_to_ucs2(const FLAC__byte *utf8, FLAC__uint16 *ucs2)
|
|
292 |
+static FLAC_INLINE unsigned local__utf8_to_ucs2(const FLAC__byte *utf8, FLAC__uint16 *ucs2)
|
|
293 |
{
|
|
294 |
const unsigned len = local__utf8len(utf8);
|
|
295 |
|
|
296 |
--- flac-1.2.0/src/plugin_common/dither.c-orig 2007-08-01 13:39:27.414786000 -0500
|
|
297 |
+++ flac-1.2.0/src/plugin_common/dither.c 2007-08-01 13:25:25.428824000 -0500
|
|
298 |
@@ -32,17 +32,12 @@
|
|
299 |
#endif
|
|
300 |
#define max(a,b) ((a)>(b)?(a):(b))
|
|
301 |
|
|
302 |
-#ifndef FLaC__INLINE
|
|
303 |
-#define FLaC__INLINE
|
|
304 |
-#endif
|
|
305 |
-
|
|
306 |
-
|
|
307 |
/* 32-bit pseudo-random number generator
|
|
308 |
*
|
|
309 |
* @@@ According to Miroslav, this one is poor quality, the one from the
|
|
310 |
* @@@ original replaygain code is much better
|
|
311 |
*/
|
|
312 |
-static FLaC__INLINE FLAC__uint32 prng(FLAC__uint32 state)
|
|
313 |
+static FLAC_INLINE FLAC__uint32 prng(FLAC__uint32 state)
|
|
314 |
{
|
|
315 |
return (state * 0x0019660dL + 0x3c6ef35fL) & 0xffffffffL;
|
|
316 |
}
|
|
317 |
@@ -54,7 +49,7 @@ typedef struct {
|
|
318 |
FLAC__int32 random;
|
|
319 |
} dither_state;
|
|
320 |
|
|
321 |
-static FLaC__INLINE FLAC__int32 linear_dither(unsigned source_bps, unsigned target_bps, FLAC__int32 sample, dither_state *dither, const FLAC__int32 MIN, const FLAC__int32 MAX)
|
|
322 |
+static FLAC_INLINE FLAC__int32 linear_dither(unsigned source_bps, unsigned target_bps, FLAC__int32 sample, dither_state *dither, const FLAC__int32 MIN, const FLAC__int32 MAX)
|
|
323 |
{
|
|
324 |
unsigned scalebits;
|
|
325 |
FLAC__int32 output, mask, random;
|
|
326 |
--- flac-1.2.0/src/libFLAC/bitreader.c-orig 2007-08-01 13:39:43.956587000 -0500
|
|
327 |
+++ flac-1.2.0/src/libFLAC/bitreader.c 2007-08-01 13:26:46.977537000 -0500
|
|
328 |
@@ -91,7 +91,8 @@ typedef FLAC__uint32 brword;
|
|
329 |
*/
|
|
330 |
static const unsigned FLAC__BITREADER_DEFAULT_CAPACITY = 65536u / FLAC__BITS_PER_WORD; /* in words */
|
|
331 |
|
|
332 |
-static const unsigned char byte_to_unary_table[] = {
|
|
333 |
+/* Must be extern since it is referenced in extern inline functions */
|
|
334 |
+extern const unsigned char byte_to_unary_table[] = {
|
|
335 |
8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
|
|
336 |
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
|
337 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
|
338 |
@@ -126,10 +127,6 @@ static const unsigned char byte_to_unary
|
|
339 |
#define FLAC__U64L(x) x##LLU
|
|
340 |
#endif
|
|
341 |
|
|
342 |
-#ifndef FLaC__INLINE
|
|
343 |
-#define FLaC__INLINE
|
|
344 |
-#endif
|
|
345 |
-
|
|
346 |
/* WATCHOUT: assembly routines rely on the order in which these fields are declared */
|
|
347 |
struct FLAC__BitReader {
|
|
348 |
/* any partially-consumed word at the head will stay right-justified as bits are consumed from the left */
|
|
349 |
@@ -149,7 +146,7 @@ struct FLAC__BitReader {
|
|
350 |
|
|
351 |
#ifdef _MSC_VER
|
|
352 |
/* OPT: an MSVC built-in would be better */
|
|
353 |
-static _inline FLAC__uint32 local_swap32_(FLAC__uint32 x)
|
|
354 |
+static FLAC_INLINE FLAC__uint32 local_swap32_(FLAC__uint32 x)
|
|
355 |
{
|
|
356 |
x = ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
|
|
357 |
return (x>>16) | (x<<16);
|
|
358 |
@@ -173,7 +170,7 @@ done1:
|
|
359 |
}
|
|
360 |
#endif
|
|
361 |
|
|
362 |
-static FLaC__INLINE void crc16_update_word_(FLAC__BitReader *br, brword word)
|
|
363 |
+static FLAC_INLINE void crc16_update_word_(FLAC__BitReader *br, brword word)
|
|
364 |
{
|
|
365 |
register unsigned crc = br->read_crc16;
|
|
366 |
#if FLAC__BYTES_PER_WORD == 4
|
|
367 |
@@ -415,22 +412,22 @@ FLAC__uint16 FLAC__bitreader_get_read_cr
|
|
368 |
return br->read_crc16;
|
|
369 |
}
|
|
370 |
|
|
371 |
-FLaC__INLINE FLAC__bool FLAC__bitreader_is_consumed_byte_aligned(const FLAC__BitReader *br)
|
|
372 |
+FLAC_INLINE FLAC__bool FLAC__bitreader_is_consumed_byte_aligned(const FLAC__BitReader *br)
|
|
373 |
{
|
|
374 |
return ((br->consumed_bits & 7) == 0);
|
|
375 |
}
|
|
376 |
|
|
377 |
-FLaC__INLINE unsigned FLAC__bitreader_bits_left_for_byte_alignment(const FLAC__BitReader *br)
|
|
378 |
+FLAC_INLINE unsigned FLAC__bitreader_bits_left_for_byte_alignment(const FLAC__BitReader *br)
|
|
379 |
{
|
|
380 |
return 8 - (br->consumed_bits & 7);
|
|
381 |
}
|
|
382 |
|
|
383 |
-FLaC__INLINE unsigned FLAC__bitreader_get_input_bits_unconsumed(const FLAC__BitReader *br)
|
|
384 |
+FLAC_INLINE unsigned FLAC__bitreader_get_input_bits_unconsumed(const FLAC__BitReader *br)
|
|
385 |
{
|
|
386 |
return (br->words-br->consumed_words)*FLAC__BITS_PER_WORD + br->bytes*8 - br->consumed_bits;
|
|
387 |
}
|
|
388 |
|
|
389 |
-FLaC__INLINE FLAC__bool FLAC__bitreader_read_raw_uint32(FLAC__BitReader *br, FLAC__uint32 *val, unsigned bits)
|
|
390 |
+FLAC_INLINE FLAC__bool FLAC__bitreader_read_raw_uint32(FLAC__BitReader *br, FLAC__uint32 *val, unsigned bits)
|
|
391 |
{
|
|
392 |
FLAC__ASSERT(0 != br);
|
|
393 |
FLAC__ASSERT(0 != br->buffer);
|
|
394 |
@@ -541,7 +538,7 @@ FLAC__bool FLAC__bitreader_read_raw_uint
|
|
395 |
return true;
|
|
396 |
}
|
|
397 |
|
|
398 |
-FLaC__INLINE FLAC__bool FLAC__bitreader_read_uint32_little_endian(FLAC__BitReader *br, FLAC__uint32 *val)
|
|
399 |
+FLAC_INLINE FLAC__bool FLAC__bitreader_read_uint32_little_endian(FLAC__BitReader *br, FLAC__uint32 *val)
|
|
400 |
{
|
|
401 |
FLAC__uint32 x8, x32 = 0;
|
|
402 |
|
|
403 |
@@ -692,7 +689,7 @@ FLAC__bool FLAC__bitreader_read_byte_blo
|
|
404 |
return true;
|
|
405 |
}
|
|
406 |
|
|
407 |
-FLaC__INLINE FLAC__bool FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, unsigned *val)
|
|
408 |
+FLAC_INLINE FLAC__bool FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, unsigned *val)
|
|
409 |
#if 0 /* slow but readable version */
|
|
410 |
{
|
|
411 |
unsigned bit;
|
|
412 |
--- flac-1.2.0/src/libFLAC/bitwriter.c-orig 2007-08-01 13:40:11.564333000 -0500
|
|
413 |
+++ flac-1.2.0/src/libFLAC/bitwriter.c 2007-08-01 13:13:34.288020000 -0500
|
|
414 |
@@ -92,10 +92,6 @@ static const unsigned FLAC__BITWRITER_DE
|
|
415 |
#define FLAC__U64L(x) x##LLU
|
|
416 |
#endif
|
|
417 |
|
|
418 |
-#ifndef FLaC__INLINE
|
|
419 |
-#define FLaC__INLINE
|
|
420 |
-#endif
|
|
421 |
-
|
|
422 |
struct FLAC__BitWriter {
|
|
423 |
bwword *buffer;
|
|
424 |
bwword accum; /* accumulator; bits are right-justified; when full, accum is appended to buffer */
|
|
425 |
@@ -106,7 +102,7 @@ struct FLAC__BitWriter {
|
|
426 |
|
|
427 |
#ifdef _MSC_VER
|
|
428 |
/* OPT: an MSVC built-in would be better */
|
|
429 |
-static _inline FLAC__uint32 local_swap32_(FLAC__uint32 x)
|
|
430 |
+static FLAC_INLINE FLAC__uint32 local_swap32_(FLAC__uint32 x)
|
|
431 |
{
|
|
432 |
x = ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
|
|
433 |
return (x>>16) | (x<<16);
|
|
434 |
@@ -114,7 +110,8 @@ static _inline FLAC__uint32 local_swap32
|
|
435 |
#endif
|
|
436 |
|
|
437 |
/* * WATCHOUT: The current implementation only grows the buffer. */
|
|
438 |
-static FLAC__bool bitwriter_grow_(FLAC__BitWriter *bw, unsigned bits_to_add)
|
|
439 |
+/* Must be extern since referenced from extern inline functions */
|
|
440 |
+FLAC__bool bitwriter_grow_(FLAC__BitWriter *bw, unsigned bits_to_add)
|
|
441 |
{
|
|
442 |
unsigned new_capacity;
|
|
443 |
bwword *new_buffer;
|
|
444 |
@@ -296,7 +293,7 @@ void FLAC__bitwriter_release_buffer(FLAC
|
|
445 |
(void)bw;
|
|
446 |
}
|
|
447 |
|
|
448 |
-FLaC__INLINE FLAC__bool FLAC__bitwriter_write_zeroes(FLAC__BitWriter *bw, unsigned bits)
|
|
449 |
+FLAC_INLINE FLAC__bool FLAC__bitwriter_write_zeroes(FLAC__BitWriter *bw, unsigned bits)
|
|
450 |
{
|
|
451 |
unsigned n;
|
|
452 |
|
|
453 |
@@ -334,7 +331,7 @@ FLaC__INLINE FLAC__bool FLAC__bitwriter_
|
|
454 |
return true;
|
|
455 |
}
|
|
456 |
|
|
457 |
-FLaC__INLINE FLAC__bool FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter *bw, FLAC__uint32 val, unsigned bits)
|
|
458 |
+FLAC_INLINE FLAC__bool FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter *bw, FLAC__uint32 val, unsigned bits)
|
|
459 |
{
|
|
460 |
register unsigned left;
|
|
461 |
|
|
462 |
@@ -373,7 +370,7 @@ FLaC__INLINE FLAC__bool FLAC__bitwriter_
|
|
463 |
return true;
|
|
464 |
}
|
|
465 |
|
|
466 |
-FLaC__INLINE FLAC__bool FLAC__bitwriter_write_raw_int32(FLAC__BitWriter *bw, FLAC__int32 val, unsigned bits)
|
|
467 |
+FLAC_INLINE FLAC__bool FLAC__bitwriter_write_raw_int32(FLAC__BitWriter *bw, FLAC__int32 val, unsigned bits)
|
|
468 |
{
|
|
469 |
/* zero-out unused bits */
|
|
470 |
if(bits < 32)
|
|
471 |
@@ -382,7 +379,7 @@ FLaC__INLINE FLAC__bool FLAC__bitwriter_
|
|
472 |
return FLAC__bitwriter_write_raw_uint32(bw, (FLAC__uint32)val, bits);
|
|
473 |
}
|
|
474 |
|
|
475 |
-FLaC__INLINE FLAC__bool FLAC__bitwriter_write_raw_uint64(FLAC__BitWriter *bw, FLAC__uint64 val, unsigned bits)
|
|
476 |
+FLAC_INLINE FLAC__bool FLAC__bitwriter_write_raw_uint64(FLAC__BitWriter *bw, FLAC__uint64 val, unsigned bits)
|
|
477 |
{
|
|
478 |
/* this could be a little faster but it's not used for much */
|
|
479 |
if(bits > 32) {
|
|
480 |
@@ -394,7 +391,7 @@ FLaC__INLINE FLAC__bool FLAC__bitwriter_
|
|
481 |
return FLAC__bitwriter_write_raw_uint32(bw, (FLAC__uint32)val, bits);
|
|
482 |
}
|
|
483 |
|
|
484 |
-FLaC__INLINE FLAC__bool FLAC__bitwriter_write_raw_uint32_little_endian(FLAC__BitWriter *bw, FLAC__uint32 val)
|
|
485 |
+FLAC_INLINE FLAC__bool FLAC__bitwriter_write_raw_uint32_little_endian(FLAC__BitWriter *bw, FLAC__uint32 val)
|
|
486 |
{
|
|
487 |
/* this doesn't need to be that fast as currently it is only used for vorbis comments */
|
|
488 |
|
|
489 |
@@ -410,7 +407,7 @@ FLaC__INLINE FLAC__bool FLAC__bitwriter_
|
|
490 |
return true;
|
|
491 |
}
|
|
492 |
|
|
493 |
-FLaC__INLINE FLAC__bool FLAC__bitwriter_write_byte_block(FLAC__BitWriter *bw, const FLAC__byte vals[], unsigned nvals)
|
|
494 |
+FLAC_INLINE FLAC__bool FLAC__bitwriter_write_byte_block(FLAC__BitWriter *bw, const FLAC__byte vals[], unsigned nvals)
|
|
495 |
{
|
|
496 |
unsigned i;
|
|
497 |
|