another big glob of changes/fixes
[platform/upstream/flac.git] / include / FLAC / format.h
1 /* libFLAC - Free Lossless Audio Codec library
2  * Copyright (C) 2000,2001,2002  Josh Coalson
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA  02111-1307, USA.
18  */
19
20 #ifndef FLAC__FORMAT_H
21 #define FLAC__FORMAT_H
22
23 #include "ordinals.h"
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 /* changing the following values to be higher will break the framing and hence the stream format, so DON'T! */
30 #define FLAC__MIN_BLOCK_SIZE (16u)
31 #define FLAC__MAX_BLOCK_SIZE (65535u)
32 #define FLAC__MAX_CHANNELS (8u)
33 #define FLAC__MIN_BITS_PER_SAMPLE (4u)
34 #define FLAC__MAX_BITS_PER_SAMPLE (32u)
35 /*
36  * NOTE: the above value is the limit of the FLAC format.  However, the
37  * reference encoder/decoder is currently limited to 24 bits because of
38  * prevalent 32-bit math, so make sure and use the following value when
39  * appropriate:
40  */
41 #define FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE (24u)
42 /* the following is ((2 ** 16) - 1) * 10; see format.html as to why */
43 #define FLAC__MAX_SAMPLE_RATE (655350u)
44 #define FLAC__MAX_LPC_ORDER (32u)
45 #define FLAC__MIN_QLP_COEFF_PRECISION (5u)
46 /* changing FLAC__MAX_FIXED_ORDER also means changing all of fixed.c and more, so DON'T! */
47 #define FLAC__MAX_FIXED_ORDER (4u)
48 #define FLAC__MAX_RICE_PARTITION_ORDER (15u)
49
50 /* VERSION should come from configure */
51 #ifdef VERSION
52 #define FLAC__VERSION_STRING VERSION
53 #endif
54
55 extern const FLAC__byte FLAC__STREAM_SYNC_STRING[4]; /* = "fLaC" */;
56 extern const unsigned FLAC__STREAM_SYNC; /* = 0x664C6143 */;
57 extern const unsigned FLAC__STREAM_SYNC_LEN; /* = 32 bits */;
58
59 #define FLAC__STREAM_SYNC_LENGTH (4u)
60
61
62 /*****************************************************************************
63  *
64  * NOTE: Within the bitstream, all fixed-width numbers are big-endian coded.
65  *       All numbers are unsigned unless otherwise noted.
66  *
67  * NOTE: It's not the best convention, but symbols ending in _LEN are in bits
68  *       and _LENGTH are in bytes.  _LENGTH symbols are #defines instead of
69  *       global variables because they are usually when declaring arrays and
70  *       some compilers require compile-time knowledge of array sizes when
71  *       declared on the stack.
72  *
73  *****************************************************************************/
74
75
76 /*****************************************************************************
77  *
78  * Subframe structures
79  *
80  *****************************************************************************/
81
82 /*****************************************************************************/
83
84 typedef enum {
85         FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE = 0
86 } FLAC__EntropyCodingMethodType;
87 extern const char * const FLAC__EntropyCodingMethodTypeString[];
88
89 /*****************************************************************************
90  *
91  *  4: partition order => (2 ** order) subdivisions
92  */
93 typedef struct {
94         unsigned order;
95         unsigned parameters[1 << FLAC__MAX_RICE_PARTITION_ORDER];
96         unsigned raw_bits[1 << FLAC__MAX_RICE_PARTITION_ORDER];
97 } FLAC__EntropyCodingMethod_PartitionedRice;
98
99 extern const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN; /* = 4 bits */
100 extern const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN; /* = 4 bits */
101 extern const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN; /* = 5 bits */
102
103 extern const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER; /* = (1<<FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN)-1 */
104
105 /*****************************************************************************
106  *
107  *  2: entropy coding method:
108  *     00: partitioned rice coding
109  *     01-11: reserved
110  *  ?: entropy coding method data
111  */
112 typedef struct {
113         FLAC__EntropyCodingMethodType type;
114         union {
115                 FLAC__EntropyCodingMethod_PartitionedRice partitioned_rice;
116         } data;
117 } FLAC__EntropyCodingMethod;
118
119 extern const unsigned FLAC__ENTROPY_CODING_METHOD_TYPE_LEN; /* = 2 bits */
120
121 /*****************************************************************************/
122
123 typedef enum {
124         FLAC__SUBFRAME_TYPE_CONSTANT = 0,
125         FLAC__SUBFRAME_TYPE_VERBATIM = 1,
126         FLAC__SUBFRAME_TYPE_FIXED = 2,
127         FLAC__SUBFRAME_TYPE_LPC = 3
128 } FLAC__SubframeType;
129 extern const char * const FLAC__SubframeTypeString[];
130
131 /*****************************************************************************
132  *
133  * n: constant value for signal; n = frame's bits-per-sample
134  */
135 typedef struct {
136         FLAC__int32 value;
137 } FLAC__Subframe_Constant;
138
139 /*****************************************************************************
140  *
141  * n*i: unencoded signal; n = frame's bits-per-sample, i = frame's blocksize
142  */
143 typedef struct {
144         const FLAC__int32 *data;
145 } FLAC__Subframe_Verbatim;
146
147 /*****************************************************************************
148  *
149  *  n: unencoded warm-up samples (n = fixed-predictor order * bits per sample)
150  *  ?: entropy coding method info
151  *  ?: encoded residual ((blocksize minus fixed-predictor order) samples)
152  *  The order is stored in the main subframe header
153  */
154 typedef struct {
155         FLAC__EntropyCodingMethod entropy_coding_method;
156         unsigned order;
157         FLAC__int32 warmup[FLAC__MAX_FIXED_ORDER];
158         const FLAC__int32 *residual;
159 } FLAC__Subframe_Fixed;
160
161 /*****************************************************************************
162  *
163  *  n: unencoded warm-up samples (n = lpc order * bits per sample)
164  *  4: (qlp coeff precision in bits)-1 (1111 = invalid, use to check for erroneous sync)
165  *  5: qlp shift needed in bits (signed)
166  *  n: unencoded predictor coefficients (n = lpc order * qlp coeff precision)
167  *  ?: entropy coding method info
168  *  ?: encoded residual ((blocksize minus lpc order) samples)
169  *  The order is stored in the main subframe header
170  */
171 typedef struct {
172         FLAC__EntropyCodingMethod entropy_coding_method;
173         unsigned order;
174         unsigned qlp_coeff_precision;
175         int quantization_level;
176         FLAC__int32 qlp_coeff[FLAC__MAX_LPC_ORDER];
177         FLAC__int32 warmup[FLAC__MAX_LPC_ORDER];
178         const FLAC__int32 *residual;
179 } FLAC__Subframe_LPC;
180
181 extern const unsigned FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN; /* = 4 bits */
182 extern const unsigned FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN; /* = 5 bits */
183
184 /*****************************************************************************
185  *
186  *  1: zero pad, to prevent sync-fooling string of 1s (use to check for erroneous sync)
187  *  6: subframe type
188  *       000000: constant value
189  *       000001: verbatim
190  *       00001x: reserved
191  *       0001xx: reserved
192  *       001xxx: fixed predictor, xxx=order <= 4, else reserved
193  *       01xxxx: reserved
194  *       1xxxxx: lpc, xxxxx=order-1
195  *  1: 'wasted bits' flag
196  *       0: no wasted bits in source subblock
197  *       1: all samples in source subblock contain n 0 least significant bits.  n-1 follows, unary coded, i.e. n=3, 001 follows, n=7, 0000001 follows.
198  *             ?: unary coded (n-1)
199  *  ?: subframe-specific data (c.f. FLAC__Subframe_*)
200  */
201 typedef struct {
202         FLAC__SubframeType type;
203         union {
204                 FLAC__Subframe_Constant constant;
205                 FLAC__Subframe_Fixed fixed;
206                 FLAC__Subframe_LPC lpc;
207                 FLAC__Subframe_Verbatim verbatim;
208         } data;
209         unsigned wasted_bits;
210 } FLAC__Subframe;
211
212 extern const unsigned FLAC__SUBFRAME_ZERO_PAD_LEN; /* = 1 bit */
213 extern const unsigned FLAC__SUBFRAME_TYPE_LEN; /* = 6 bits */
214 extern const unsigned FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN; /* = 1 bit */
215
216 extern const unsigned FLAC__SUBFRAME_TYPE_CONSTANT_BYTE_ALIGNED_MASK; /* = 0x00 */
217 extern const unsigned FLAC__SUBFRAME_TYPE_VERBATIM_BYTE_ALIGNED_MASK; /* = 0x02 */
218 extern const unsigned FLAC__SUBFRAME_TYPE_FIXED_BYTE_ALIGNED_MASK; /* = 0x10 */
219 extern const unsigned FLAC__SUBFRAME_TYPE_LPC_BYTE_ALIGNED_MASK; /* = 0x40 */
220
221 /*****************************************************************************/
222
223
224 /*****************************************************************************
225  *
226  * Frame structures
227  *
228  *****************************************************************************/
229
230 typedef enum {
231         FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT = 0,
232         FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE = 1,
233         FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE = 2,
234         FLAC__CHANNEL_ASSIGNMENT_MID_SIDE = 3
235 } FLAC__ChannelAssignment;
236 extern const char * const FLAC__ChannelAssignmentString[];
237
238 typedef enum {
239         FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER,
240         FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER
241 } FLAC__FrameNumberType;
242 extern const char * const FLAC__FrameNumberTypeString[];
243
244 /*****************************************************************************
245  *
246  * 14: sync code '11111111111110'
247  *  2: reserved
248  *        00: currently required value
249  *        01-11: reserved
250  *  4: blocksize in samples
251  *        0000: get from stream header => implies constant blocksize throughout stream
252  *        0001: 192 samples (AES/EBU) => implies constant blocksize throughout stream
253  *        0010-0101: 576 * (2^(n-2)) samples, i.e. 576/1152/2304/4608 => implies constant blocksize throughout stream
254  *        0110: get 8 bit (blocksize-1) from end of header => possibly variable blocksize throughout stream unless it's the last frame
255  *        0111: get 16 bit (blocksize-1) from end of header => possibly variable blocksize throughout stream unless it's the last frame
256  *        1000-1111: 256 * (2^(n-8)) samples, i.e. 256/512/1024/2048/4096/8192/16384/32768 => implies constant blocksize throughout stream
257  *  4: sample rate:
258  *        0000: get from stream header
259  *        0001-0011: reserved
260  *        0100: 8kHz
261  *        0101: 16kHz
262  *        0110: 22.05kHz
263  *        0111: 24kHz
264  *        1000: 32kHz
265  *        1001: 44.1kHz
266  *        1010: 48kHz
267  *        1011: 96kHz
268  *        1100: get 8 bit sample rate (in kHz) from end of header
269  *        1101: get 16 bit sample rate (in Hz) from end of header
270  *        1110: get 16 bit sample rate (in tens of Hz) from end of header
271  *        1111: invalid, to prevent sync-fooling string of 1s (use to check for erroneous sync)
272  *  4: channel assignment
273  *     0000-0111: (number of independent channels)-1.  when == 0001, channel 0 is the left channel and channel 1 is the right
274  *     1000: left/side stereo : channel 0 is the left             channel, channel 1 is the side(difference) channel
275  *     1001: right/side stereo: channel 0 is the side(difference) channel, channel 1 is the right            channel
276  *     1010: mid/side stereo  : channel 0 is the mid(average)     channel, channel 1 is the side(difference) channel
277  *     1011-1111: reserved
278  *  3: sample size in bits
279  *        000: get from stream header
280  *        001: 8 bits per sample
281  *        010: 12 bits per sample
282  *        011: reserved
283  *        100: 16 bits per sample
284  *        101: 20 bits per sample
285  *        110: 24 bits per sample
286  *        111: reserved
287  *  1: zero pad, to prevent sync-fooling string of 1s (use to check for erroneous sync)
288  *  ?: if(variable blocksize)
289  *        8-56: 'UTF-8' coded sample number (decoded number is 0-36 bits) (use to check for erroneous sync)
290  *     else
291  *        8-48: 'UTF-8' coded frame number (decoded number is 0-31 bits) (use to check for erroneous sync)
292  *  ?: if(blocksize bits == 11x)
293  *        8/16 bit (blocksize-1)
294  *  ?: if(sample rate bits == 11xx)
295  *        8/16 bit sample rate
296  *  8: CRC-8 (polynomial = x^8 + x^2 + x^1 + x^0, initialized with 0) of everything before the crc, including the sync code
297  */
298 typedef struct {
299         unsigned blocksize; /* in samples */
300         unsigned sample_rate; /* in Hz */
301         unsigned channels;
302         FLAC__ChannelAssignment channel_assignment;
303         unsigned bits_per_sample;
304         FLAC__FrameNumberType number_type;
305         union {
306                 FLAC__uint32 frame_number;
307                 FLAC__uint64 sample_number;
308         } number;
309         FLAC__uint8 crc;
310 } FLAC__FrameHeader;
311
312 extern const unsigned FLAC__FRAME_HEADER_SYNC; /* = 0x3ffe */
313 extern const unsigned FLAC__FRAME_HEADER_SYNC_LEN; /* = 14 bits */
314 extern const unsigned FLAC__FRAME_HEADER_RESERVED_LEN; /* = 2 bits */
315 extern const unsigned FLAC__FRAME_HEADER_BLOCK_SIZE_LEN; /* = 4 bits */
316 extern const unsigned FLAC__FRAME_HEADER_SAMPLE_RATE_LEN; /* = 4 bits */
317 extern const unsigned FLAC__FRAME_HEADER_CHANNEL_ASSIGNMENT_LEN; /* = 4 bits */
318 extern const unsigned FLAC__FRAME_HEADER_BITS_PER_SAMPLE_LEN; /* = 3 bits */
319 extern const unsigned FLAC__FRAME_HEADER_ZERO_PAD_LEN; /* = 1 bit */
320 extern const unsigned FLAC__FRAME_HEADER_CRC_LEN; /* = 8 bits */
321
322 /*****************************************************************************
323  *
324  * 16: CRC-16 (polynomial = x^16 + x^15 + x^2 + x^0, initialized with 0) of everything before the crc, back to and including the frame header sync code
325  */
326 typedef struct {
327         FLAC__uint16 crc;
328 } FLAC__FrameFooter;
329
330 extern const unsigned FLAC__FRAME_FOOTER_CRC_LEN; /* = 16 bits */
331
332 typedef struct {
333         FLAC__FrameHeader header;
334         FLAC__Subframe subframes[FLAC__MAX_CHANNELS];
335         FLAC__FrameFooter footer;
336 } FLAC__Frame;
337
338 /*****************************************************************************/
339
340
341 /*****************************************************************************
342  *
343  * Meta-data structures
344  *
345  *****************************************************************************/
346
347 typedef enum {
348         FLAC__METADATA_TYPE_STREAMINFO = 0,
349         FLAC__METADATA_TYPE_PADDING = 1,
350         FLAC__METADATA_TYPE_APPLICATION = 2,
351         FLAC__METADATA_TYPE_SEEKTABLE = 3,
352         FLAC__METADATA_TYPE_VORBIS_COMMENT = 4
353 } FLAC__MetadataType;
354 extern const char * const FLAC__MetadataTypeString[];
355
356 /*****************************************************************************
357  *
358  * 16: minimum blocksize (in samples) of all blocks in the stream
359  * 16: maximum blocksize (in samples) of all blocks in the stream
360  * 24: minimum framesize (in bytes) of all frames in the stream; 0 => unknown
361  * 24: maximum framesize (in bytes) of all frames in the stream; 0 => unknown
362  * 20: sample rate in Hz, 0 is invalid
363  *  3: (number of channels)-1
364  *  5: (bits per sample)-1
365  * 36: total samples, 0 => unknown
366  *128: MD5 digest of the original unencoded audio data
367  *---- -----------------
368  * 34  bytes total
369  */
370 typedef struct {
371         unsigned min_blocksize, max_blocksize;
372         unsigned min_framesize, max_framesize;
373         unsigned sample_rate;
374         unsigned channels;
375         unsigned bits_per_sample;
376         FLAC__uint64 total_samples;
377         FLAC__byte md5sum[16];
378 } FLAC__StreamMetadata_StreamInfo;
379
380 extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN; /* = 16 bits */
381 extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN; /* = 16 bits */
382 extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN; /* = 24 bits */
383 extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN; /* = 24 bits */
384 extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN; /* = 20 bits */
385 extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN; /* = 3 bits */
386 extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN; /* = 5 bits */
387 extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN; /* = 36 bits */
388 extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_MD5SUM_LEN; /* = 128 bits */
389
390 #define FLAC__STREAM_METADATA_STREAMINFO_LENGTH (34u)
391
392 /*****************************************************************************
393  *
394  *   n: '0' bits
395  *----- -----------------
396  * n/8  bytes total
397  */
398 typedef struct {
399         int dummy; /* conceptually this is an empty struct since we don't store the padding bytes */
400                    /* empty structs are allowed by C++ but not C, hence the 'dummy' */
401 } FLAC__StreamMetadata_Padding;
402
403 /*****************************************************************************
404  *
405  *    32: Registered application ID
406  *     n: Application data
407  *------- -----------------
408  * 4+n/8  bytes total
409  */
410 typedef struct {
411         FLAC__byte id[4];
412         FLAC__byte *data;
413 } FLAC__StreamMetadata_Application;
414
415 extern const unsigned FLAC__STREAM_METADATA_APPLICATION_ID_LEN; /* = 32 bits */
416
417 /*****************************************************************************
418  *
419  *  64: sample number of target frame
420  *  64: offset, in bytes, of target frame with respect to beginning of first frame
421  *  16: number of samples in the target frame
422  *----- -----------------
423  *  18  bytes total
424  */
425 typedef struct {
426         FLAC__uint64 sample_number;
427         FLAC__uint64 stream_offset;
428         unsigned frame_samples;
429 } FLAC__StreamMetadata_SeekPoint;
430
431 extern const unsigned FLAC__STREAM_METADATA_SEEKPOINT_SAMPLE_NUMBER_LEN; /* = 64 bits */
432 extern const unsigned FLAC__STREAM_METADATA_SEEKPOINT_STREAM_OFFSET_LEN; /* = 64 bits */
433 extern const unsigned FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN; /* = 16 bits */
434
435 #define FLAC__STREAM_METADATA_SEEKPOINT_LENGTH (18u)
436
437 extern const FLAC__uint64 FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; /* = 0xffffffffffffffff */
438
439 /*****************************************************************************
440  *
441  *      0: num_points is implied by the metadata block 'length' field (i.e. num_points = length / 18)
442  * n*18*8: seek points (n = num_points, 18 is the size of a seek point in bytes)
443  * ------- -----------------
444  *   n*18  bytes total
445  *
446  * NOTE: the seek points must be sorted by ascending sample number.
447  * NOTE: each seek point's sample number must be the first sample of the target frame.
448  * NOTE: each seek point's sample number must be unique within the table.
449  * NOTE: existence of a SEEKTABLE block implies a correct setting of total_samples in the stream_info block.
450  * NOTE: behavior is undefined when more than one SEEKTABLE block is present in a stream.
451  */
452 typedef struct {
453         unsigned num_points;
454         FLAC__StreamMetadata_SeekPoint *points;
455 } FLAC__StreamMetadata_SeekTable;
456
457 /*****************************************************************************
458  *
459  *     32: Entry length in bytes (WATCHOUT: this is little-endian coded)
460  *      n: Entry (n = 8 * length)
461  *-------- -----------------
462  * 32+n/8  bytes total
463  */
464 typedef struct {
465         FLAC__uint32 length;
466         FLAC__byte *entry;
467 } FLAC__StreamMetadata_VorbisComment_Entry;
468
469 extern const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN; /* = 32 bits */
470
471 /*****************************************************************************
472  *
473  *          n: Vendor string entry
474  *         32: Number of comment fields (WATCHOUT: this is little-endian coded)
475  *          m: Comment entries
476  *------------ -----------------
477  * (32+m+n)/8  bytes total
478  */
479 typedef struct {
480         FLAC__StreamMetadata_VorbisComment_Entry vendor_string;
481         FLAC__uint32 num_comments;
482         FLAC__StreamMetadata_VorbisComment_Entry *comments;
483 } FLAC__StreamMetadata_VorbisComment;
484
485 extern const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN; /* = 32 bits */
486
487 /*****************************************************************************
488  *
489  *  1: =1 if this is the last meta-data block, else =0
490  *  7: meta-data type (c.f. FLAC__MetadataType)
491  * 24: length (in bytes) of the block-specific data to follow
492  *---- -----------------
493  *  4  bytes total
494  */
495 typedef struct {
496         FLAC__MetadataType type;
497         FLAC__bool is_last;
498         unsigned length; /* in bytes */
499         union {
500                 FLAC__StreamMetadata_StreamInfo stream_info;
501                 FLAC__StreamMetadata_Padding padding;
502                 FLAC__StreamMetadata_Application application;
503                 FLAC__StreamMetadata_SeekTable seek_table;
504                 FLAC__StreamMetadata_VorbisComment vorbis_comment;
505         } data;
506 } FLAC__StreamMetadata;
507
508 extern const unsigned FLAC__STREAM_METADATA_IS_LAST_LEN; /* = 1 bit */
509 extern const unsigned FLAC__STREAM_METADATA_TYPE_LEN; /* = 7 bits */
510 extern const unsigned FLAC__STREAM_METADATA_LENGTH_LEN; /* = 24 bits */
511
512 #define FLAC__STREAM_METADATA_HEADER_LENGTH (4u)
513
514 /*****************************************************************************/
515
516
517 /*****************************************************************************
518  *
519  * Utility functions
520  *
521  *****************************************************************************/
522
523 /*
524  * Since the rules for valid sample rates are slightly complex, they are
525  * encapsulated here:
526  */
527 FLAC__bool FLAC__format_is_valid_sample_rate(unsigned sample_rate);
528
529 #ifdef __cplusplus
530 }
531 #endif
532
533 #endif