2001-02-08 00:38:41 +00:00
/* libFLAC - Free Lossless Audio Codec library
2002-01-26 17:36:39 +00:00
* Copyright ( C ) 2000 , 2001 , 2002 Josh Coalson
2000-12-10 04:09:52 +00:00
*
* This library is free software ; you can redistribute it and / or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation ; either
* version 2 of the License , or ( at your option ) any later version .
*
* This library is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU
* Library General Public License for more details .
*
* You should have received a copy of the GNU Library General Public
* License along with this library ; if not , write to the
* Free Software Foundation , Inc . , 59 Temple Place - Suite 330 ,
* Boston , MA 02111 - 1307 , USA .
*/
# ifndef FLAC__FORMAT_H
# define FLAC__FORMAT_H
2002-10-16 22:18:32 +00:00
# include "export.h"
2000-12-10 04:09:52 +00:00
# include "ordinals.h"
2002-05-06 17:39:29 +00:00
# ifdef __cplusplus
extern " C " {
# endif
2002-07-12 05:42:04 +00:00
/** \file include/FLAC/format.h
*
* \ brief
* This module contains structure definitions for the representation
* of FLAC format components in memory . These are the basic
* structures used by the rest of the interfaces .
*
* See the detailed documentation in the
* \ link flac_format format \ endlink module .
*/
/** \defgroup flac_format FLAC/format.h: format components
* \ ingroup flac
*
* \ brief
* This module contains structure definitions for the representation
* of FLAC format components in memory . These are the basic
* structures used by the rest of the interfaces .
*
2002-07-16 16:14:17 +00:00
* First , you should be familiar with the
* < A HREF = " ../format.html " > FLAC format < / A > . Many of the values here
* follow directly from the specification . As a user of libFLAC , the
* interesting parts really are the structures that describe the frame
* header and metadata blocks .
2002-07-12 05:42:04 +00:00
*
* The format structures here are very primitive , designed to store
* information in an efficient way . Reading information from the
* structures is easy but creating or modifying them directly is
* more complex . For the most part , as a user of a library , editing
* is not necessary ; however , for metadata blocks it is , so there are
2002-08-23 06:42:03 +00:00
* convenience functions provided in the \ link flac_metadata metadata
* module \ endlink to simplify the manipulation of metadata blocks .
2002-07-12 05:42:04 +00:00
*
* \ note
* It ' s not the best convention , but symbols ending in _LEN are in bits
2002-07-15 05:26:50 +00:00
* and _LENGTH are in bytes . _LENGTH symbols are \ # defines instead of
2002-07-12 05:42:04 +00:00
* global variables because they are usually used when declaring byte
* arrays and some compilers require compile - time knowledge of array
* sizes when declared on the stack .
*
* \ {
*/
/*
Most of the values described in this file are defined by the FLAC
format specification . There is nothing to tune here .
*/
/** The minimum block size, in samples, permitted by the format. */
2000-12-10 04:09:52 +00:00
# define FLAC__MIN_BLOCK_SIZE (16u)
2002-07-12 05:42:04 +00:00
/** The maximum block size, in samples, permitted by the format. */
2000-12-10 04:09:52 +00:00
# define FLAC__MAX_BLOCK_SIZE (65535u)
2002-07-12 05:42:04 +00:00
/** The maximum number of channels permitted by the format. */
2000-12-10 04:09:52 +00:00
# define FLAC__MAX_CHANNELS (8u)
2002-07-12 05:42:04 +00:00
/** The minimum sample resolution permitted by the format. */
2001-03-28 22:12:39 +00:00
# define FLAC__MIN_BITS_PER_SAMPLE (4u)
2002-07-12 05:42:04 +00:00
/** The maximum sample resolution permitted by the format. */
2002-05-16 06:39:13 +00:00
# define FLAC__MAX_BITS_PER_SAMPLE (32u)
2002-07-12 05:42:04 +00:00
/** The maximum sample resolution permitted by libFLAC.
*
* \ warning
* FLAC__MAX_BITS_PER_SAMPLE is the limit of the FLAC format . However ,
* the reference encoder / decoder is currently limited to 24 bits because
* of prevalent 32 - bit math , so make sure and use this value when
* appropriate .
2002-05-16 06:39:13 +00:00
*/
# define FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE (24u)
2002-07-12 05:42:04 +00:00
/** The maximum sample rate permitted by the format. The value is
2002-07-16 16:14:17 +00:00
* ( ( 2 ^ 16 ) - 1 ) * 10 ; see < A HREF = " ../format.html " > FLAC format < / A >
* as to why .
2002-07-12 05:42:04 +00:00
*/
2002-05-04 17:33:35 +00:00
# define FLAC__MAX_SAMPLE_RATE (655350u)
2002-07-12 05:42:04 +00:00
/** The maximum LPC order permitted by the format. */
2000-12-10 04:09:52 +00:00
# define FLAC__MAX_LPC_ORDER (32u)
2002-07-12 05:42:04 +00:00
/** The minimum quantized linear predictor coefficient precision
* permitted by the format .
*/
2000-12-10 04:09:52 +00:00
# define FLAC__MIN_QLP_COEFF_PRECISION (5u)
2002-07-12 05:42:04 +00:00
2002-10-04 05:24:30 +00:00
/** The maximum quantized linear predictor coefficient precision
* permitted by the format .
*/
# define FLAC__MAX_QLP_COEFF_PRECISION (15u)
2002-07-12 05:42:04 +00:00
/** The maximum order of the fixed predictors permitted by the format. */
2000-12-10 04:09:52 +00:00
# define FLAC__MAX_FIXED_ORDER (4u)
2002-07-12 05:42:04 +00:00
/** The maximum Rice partition order permitted by the format. */
2000-12-10 04:09:52 +00:00
# define FLAC__MAX_RICE_PARTITION_ORDER (15u)
2002-09-26 04:42:10 +00:00
/** The maximum Rice partition order permitted by the FLAC Subset. */
# define FLAC__SUBSET_MAX_RICE_PARTITION_ORDER (8u)
2002-09-25 06:09:47 +00:00
/** The version string of the release, stamped onto the libraries and binaries.
2002-07-12 05:42:04 +00:00
*
* \ note
* This does not correspond to the shared library version number , which
* is used to determine binary compatibility .
*/
2002-10-16 22:18:32 +00:00
extern FLAC_API const char * FLAC__VERSION_STRING ;
2000-12-10 04:09:52 +00:00
2002-08-25 05:27:15 +00:00
/** The vendor string inserted by the encoder into the VORBIS_COMMENT block.
* This is a nulL - terminated ASCII string ; when inserted into the
* VORBIS_COMMENT the trailing null is stripped .
*/
2002-10-16 22:18:32 +00:00
extern FLAC_API const char * FLAC__VENDOR_STRING ;
2002-08-25 05:27:15 +00:00
2002-07-12 05:42:04 +00:00
/** The byte string representation of the beginning of a FLAC stream. */
2002-10-16 22:18:32 +00:00
extern FLAC_API const FLAC__byte FLAC__STREAM_SYNC_STRING [ 4 ] ; /* = "fLaC" */
2002-07-12 05:42:04 +00:00
/** The 32-bit integer big-endian representation of the beginning of
* a FLAC stream .
*/
2002-10-16 22:18:32 +00:00
extern FLAC_API const unsigned FLAC__STREAM_SYNC ; /* = 0x664C6143 */
2002-07-12 05:42:04 +00:00
/** The length of the FLAC signature in bits. */
2002-10-16 22:18:32 +00:00
extern FLAC_API const unsigned FLAC__STREAM_SYNC_LEN ; /* = 32 bits */
2000-12-10 04:09:52 +00:00
2002-07-12 05:42:04 +00:00
/** The length of the FLAC signature in bytes. */
2002-05-20 05:55:44 +00:00
# define FLAC__STREAM_SYNC_LENGTH (4u)
2000-12-10 04:09:52 +00:00
/*****************************************************************************
*
2001-01-23 00:40:51 +00:00
* Subframe structures
2000-12-10 04:09:52 +00:00
*
2001-01-23 00:40:51 +00:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-12-10 04:09:52 +00:00
/*****************************************************************************/
2002-07-12 05:42:04 +00:00
/** An enumeration of the available entropy coding methods. */
2000-12-10 04:09:52 +00:00
typedef enum {
FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE = 0
2002-07-12 05:42:04 +00:00
/**< Residual is coded by partitioning into contexts, each with it's own
2002-08-27 05:46:11 +00:00
* Rice parameter . */
2000-12-10 04:09:52 +00:00
} FLAC__EntropyCodingMethodType ;
2002-07-12 05:42:04 +00:00
/** Maps a FLAC__EntropyCodingMethodType to a C string.
2000-12-10 04:09:52 +00:00
*
2002-07-12 05:42:04 +00:00
* Using a FLAC__EntropyCodingMethodType as the index to this array will
* give the string equivalent . The contents should not be modified .
*/
2002-10-16 22:18:32 +00:00
extern FLAC_API const char * const FLAC__EntropyCodingMethodTypeString [ ] ;
2002-07-12 05:42:04 +00:00
2002-08-19 21:36:39 +00:00
/** Contents of a Rice partitioned residual
2000-12-10 04:09:52 +00:00
*/
typedef struct {
2002-07-12 05:42:04 +00:00
2002-08-17 15:23:43 +00:00
unsigned * parameters ;
2002-07-12 05:42:04 +00:00
/**< The Rice parameters for each context. */
2002-08-17 15:23:43 +00:00
unsigned * raw_bits ;
2002-07-12 05:42:04 +00:00
/**< Widths for escape-coded partitions. */
2002-08-17 15:23:43 +00:00
unsigned capacity_by_order ;
/**< The capacity of the \a parameters and \a raw_bits arrays
* specified as an order , i . e . the number of array elements
* allocated is 2 ^ \ a capacity_by_order .
*/
2002-08-19 21:36:39 +00:00
} FLAC__EntropyCodingMethod_PartitionedRiceContents ;
/** Header for a Rice partitioned residual. (c.f. <A HREF="../format.html#partitioned_rice">format specification</A>)
*/
typedef struct {
unsigned order ;
/**< The partition order, i.e. # of contexts = 2 ^ \a order. */
const FLAC__EntropyCodingMethod_PartitionedRiceContents * contents ;
/**< The context's Rice parameters and/or raw bits. */
2000-12-10 04:09:52 +00:00
} FLAC__EntropyCodingMethod_PartitionedRice ;
2002-10-16 22:18:32 +00:00
extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN ; /**< == 4 (bits) */
extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN ; /**< == 4 (bits) */
extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN ; /**< == 5 (bits) */
2001-04-12 22:22:34 +00:00
2002-10-16 22:18:32 +00:00
extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER ;
2002-07-12 05:42:04 +00:00
/**< == (1<<FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN)-1 */
2000-12-10 04:09:52 +00:00
2002-07-16 16:14:17 +00:00
/** Header for the entropy coding method. (c.f. <A HREF="../format.html#residual">format specification</A>)
2000-12-10 04:09:52 +00:00
*/
typedef struct {
FLAC__EntropyCodingMethodType type ;
union {
FLAC__EntropyCodingMethod_PartitionedRice partitioned_rice ;
} data ;
} FLAC__EntropyCodingMethod ;
2002-10-16 22:18:32 +00:00
extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_TYPE_LEN ; /**< == 2 (bits) */
2000-12-10 04:09:52 +00:00
/*****************************************************************************/
2002-07-12 05:42:04 +00:00
/** An enumeration of the available subframe types. */
2001-01-23 00:40:51 +00:00
typedef enum {
2002-07-12 05:42:04 +00:00
FLAC__SUBFRAME_TYPE_CONSTANT = 0 , /**< constant signal */
FLAC__SUBFRAME_TYPE_VERBATIM = 1 , /**< uncompressed signal */
FLAC__SUBFRAME_TYPE_FIXED = 2 , /**< fixed polynomial prediction */
FLAC__SUBFRAME_TYPE_LPC = 3 /**< linear prediction */
2001-01-23 00:40:51 +00:00
} FLAC__SubframeType ;
2002-07-12 05:42:04 +00:00
/** Maps a FLAC__SubframeType to a C string.
2001-01-23 00:40:51 +00:00
*
2002-07-12 05:42:04 +00:00
* Using a FLAC__SubframeType as the index to this array will
* give the string equivalent . The contents should not be modified .
*/
2002-10-16 22:18:32 +00:00
extern FLAC_API const char * const FLAC__SubframeTypeString [ ] ;
2002-07-12 05:42:04 +00:00
2002-07-16 16:14:17 +00:00
/** CONSTANT subframe. (c.f. <A HREF="../format.html#subframe_constant">format specification</A>)
2001-01-23 00:40:51 +00:00
*/
typedef struct {
2002-07-15 05:26:50 +00:00
FLAC__int32 value ; /**< The constant signal value. */
2001-01-23 23:07:36 +00:00
} FLAC__Subframe_Constant ;
2001-01-23 00:40:51 +00:00
2002-07-12 05:42:04 +00:00
2002-07-16 16:14:17 +00:00
/** VERBATIM subframe. (c.f. <A HREF="../format.html#subframe_verbatim">format specification</A>)
2001-01-23 00:40:51 +00:00
*/
2001-01-23 23:07:36 +00:00
typedef struct {
2002-07-15 05:26:50 +00:00
const FLAC__int32 * data ; /**< A pointer to verbatim signal. */
2001-01-23 23:07:36 +00:00
} FLAC__Subframe_Verbatim ;
2001-01-23 00:40:51 +00:00
2002-07-12 05:42:04 +00:00
2002-07-16 16:14:17 +00:00
/** FIXED subframe. (c.f. <A HREF="../format.html#subframe_fixed">format specification</A>)
2001-01-23 00:40:51 +00:00
*/
typedef struct {
FLAC__EntropyCodingMethod entropy_coding_method ;
2002-07-15 05:26:50 +00:00
/**< The residual coding method. */
2002-07-12 05:42:04 +00:00
2001-01-23 00:40:51 +00:00
unsigned order ;
2002-07-15 05:26:50 +00:00
/**< The polynomial order. */
2002-07-12 05:42:04 +00:00
2001-06-23 03:03:24 +00:00
FLAC__int32 warmup [ FLAC__MAX_FIXED_ORDER ] ;
2002-07-15 05:26:50 +00:00
/**< Warmup samples to prime the predictor, length == order. */
2002-07-12 05:42:04 +00:00
2001-06-23 03:03:24 +00:00
const FLAC__int32 * residual ;
2002-07-15 05:26:50 +00:00
/**< The residual signal, length == (blocksize minus order) samples. */
2001-01-23 23:07:36 +00:00
} FLAC__Subframe_Fixed ;
2001-01-23 00:40:51 +00:00
2002-07-12 05:42:04 +00:00
2002-07-16 16:14:17 +00:00
/** LPC subframe. (c.f. <A HREF="../format.html#subframe_lpc">format specification</A>)
2001-01-23 00:40:51 +00:00
*/
typedef struct {
FLAC__EntropyCodingMethod entropy_coding_method ;
2002-07-15 05:26:50 +00:00
/**< The residual coding method. */
2002-07-12 05:42:04 +00:00
2001-01-23 00:40:51 +00:00
unsigned order ;
2002-07-15 05:26:50 +00:00
/**< The FIR order. */
2002-07-12 05:42:04 +00:00
2001-01-23 00:40:51 +00:00
unsigned qlp_coeff_precision ;
2002-07-15 05:26:50 +00:00
/**< Quantized FIR filter coefficient precision in bits. */
2002-07-12 05:42:04 +00:00
2001-01-23 00:40:51 +00:00
int quantization_level ;
2002-07-15 05:26:50 +00:00
/**< The qlp coeff shift needed. */
2002-07-12 05:42:04 +00:00
2001-06-23 03:03:24 +00:00
FLAC__int32 qlp_coeff [ FLAC__MAX_LPC_ORDER ] ;
2002-07-15 05:26:50 +00:00
/**< FIR filter coefficients. */
2002-07-12 05:42:04 +00:00
2001-06-23 03:03:24 +00:00
FLAC__int32 warmup [ FLAC__MAX_LPC_ORDER ] ;
2002-07-15 05:26:50 +00:00
/**< Warmup samples to prime the predictor, length == order. */
2002-07-12 05:42:04 +00:00
2001-06-23 03:03:24 +00:00
const FLAC__int32 * residual ;
2002-07-15 05:26:50 +00:00
/**< The residual signal, length == (blocksize minus order) samples. */
2001-01-23 23:07:36 +00:00
} FLAC__Subframe_LPC ;
2001-01-23 00:40:51 +00:00
2002-10-16 22:18:32 +00:00
extern FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN ; /**< == 4 (bits) */
extern FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN ; /**< == 5 (bits) */
2001-01-23 00:40:51 +00:00
2002-07-12 05:42:04 +00:00
2002-07-16 16:14:17 +00:00
/** FLAC subframe structure. (c.f. <A HREF="../format.html#subframe">format specification</A>)
2001-01-23 00:40:51 +00:00
*/
typedef struct {
FLAC__SubframeType type ;
union {
2001-01-23 23:07:36 +00:00
FLAC__Subframe_Constant constant ;
FLAC__Subframe_Fixed fixed ;
FLAC__Subframe_LPC lpc ;
FLAC__Subframe_Verbatim verbatim ;
} data ;
2001-03-27 01:15:58 +00:00
unsigned wasted_bits ;
2001-01-23 00:40:51 +00:00
} FLAC__Subframe ;
2002-10-16 22:18:32 +00:00
extern FLAC_API const unsigned FLAC__SUBFRAME_ZERO_PAD_LEN ; /**< == 1 (bit) */
extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LEN ; /**< == 6 (bits) */
extern FLAC_API const unsigned FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN ; /**< == 1 (bit) */
2001-03-27 01:15:58 +00:00
2002-10-16 22:18:32 +00:00
extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_CONSTANT_BYTE_ALIGNED_MASK ; /* = 0x00 */
extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_VERBATIM_BYTE_ALIGNED_MASK ; /* = 0x02 */
extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_FIXED_BYTE_ALIGNED_MASK ; /* = 0x10 */
extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LPC_BYTE_ALIGNED_MASK ; /* = 0x40 */
2001-01-23 23:07:36 +00:00
2001-01-23 00:40:51 +00:00
/*****************************************************************************/
/*****************************************************************************
*
* Frame structures
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2002-07-12 05:42:04 +00:00
/** An enumeration of the available channel assignments. */
2000-12-10 04:09:52 +00:00
typedef enum {
2002-07-12 05:42:04 +00:00
FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT = 0 , /**< independent channels */
FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE = 1 , /**< left+side stereo */
FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE = 2 , /**< right+side stereo */
FLAC__CHANNEL_ASSIGNMENT_MID_SIDE = 3 /**< mid+side stereo */
2000-12-10 04:09:52 +00:00
} FLAC__ChannelAssignment ;
2002-07-12 05:42:04 +00:00
/** Maps a FLAC__ChannelAssignment to a C string.
*
* Using a FLAC__ChannelAssignment as the index to this array will
* give the string equivalent . The contents should not be modified .
*/
2002-10-16 22:18:32 +00:00
extern FLAC_API const char * const FLAC__ChannelAssignmentString [ ] ;
2000-12-10 04:09:52 +00:00
2002-07-12 05:42:04 +00:00
/** An enumeration of the possible frame numbering methods. */
2001-07-16 18:02:32 +00:00
typedef enum {
2002-07-12 05:42:04 +00:00
FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER , /**< number contains the frame number */
FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER /**< number contains the sample number of first sample in frame */
2001-07-16 18:02:32 +00:00
} FLAC__FrameNumberType ;
2002-07-12 05:42:04 +00:00
/** Maps a FLAC__FrameNumberType to a C string.
2000-12-10 04:09:52 +00:00
*
2002-07-12 05:42:04 +00:00
* Using a FLAC__FrameNumberType as the index to this array will
* give the string equivalent . The contents should not be modified .
*/
2002-10-16 22:18:32 +00:00
extern FLAC_API const char * const FLAC__FrameNumberTypeString [ ] ;
2002-07-12 05:42:04 +00:00
2002-07-16 16:14:17 +00:00
/** FLAC frame header structure. (c.f. <A HREF="../format.html#frame_header">format specification</A>)
2000-12-10 04:09:52 +00:00
*/
typedef struct {
2002-07-12 05:42:04 +00:00
unsigned blocksize ;
2002-07-15 05:26:50 +00:00
/**< The number of samples per subframe. */
2002-07-12 05:42:04 +00:00
unsigned sample_rate ;
2002-07-15 05:26:50 +00:00
/**< The sample rate in Hz. */
2002-07-12 05:42:04 +00:00
2000-12-10 04:09:52 +00:00
unsigned channels ;
2002-07-15 05:26:50 +00:00
/**< The number of channels (== number of subframes). */
2002-07-12 05:42:04 +00:00
2000-12-10 04:09:52 +00:00
FLAC__ChannelAssignment channel_assignment ;
2002-07-15 05:26:50 +00:00
/**< The channel assignment for the frame. */
2002-07-12 05:42:04 +00:00
2000-12-10 04:09:52 +00:00
unsigned bits_per_sample ;
2002-07-15 05:26:50 +00:00
/**< The sample resolution. */
2002-07-12 05:42:04 +00:00
2001-07-16 18:02:32 +00:00
FLAC__FrameNumberType number_type ;
2002-07-15 05:26:50 +00:00
/**< The numbering scheme used for the frame. */
2002-07-12 05:42:04 +00:00
2000-12-10 04:09:52 +00:00
union {
2001-06-23 03:03:24 +00:00
FLAC__uint32 frame_number ;
FLAC__uint64 sample_number ;
2000-12-10 04:09:52 +00:00
} number ;
2002-07-15 05:26:50 +00:00
/**< The frame number or sample number of first sample in frame;
* use the \ a number_type value to determine which to use . */
2002-07-12 05:42:04 +00:00
2001-06-23 03:03:24 +00:00
FLAC__uint8 crc ;
2002-07-16 16:14:17 +00:00
/**< CRC-8 (polynomial = x^8 + x^2 + x^1 + x^0, initialized with 0)
* of the raw frame header bytes , meaning everything before the CRC byte
* including the sync code .
2002-07-12 05:42:04 +00:00
*/
2000-12-10 04:09:52 +00:00
} FLAC__FrameHeader ;
2002-10-16 22:18:32 +00:00
extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC ; /**< == 0x3ffe; the frame header sync code */
extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC_LEN ; /**< == 14 (bits) */
extern FLAC_API const unsigned FLAC__FRAME_HEADER_RESERVED_LEN ; /**< == 2 (bits) */
extern FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCK_SIZE_LEN ; /**< == 4 (bits) */
extern FLAC_API const unsigned FLAC__FRAME_HEADER_SAMPLE_RATE_LEN ; /**< == 4 (bits) */
extern FLAC_API const unsigned FLAC__FRAME_HEADER_CHANNEL_ASSIGNMENT_LEN ; /**< == 4 (bits) */
extern FLAC_API const unsigned FLAC__FRAME_HEADER_BITS_PER_SAMPLE_LEN ; /**< == 3 (bits) */
extern FLAC_API const unsigned FLAC__FRAME_HEADER_ZERO_PAD_LEN ; /**< == 1 (bit) */
extern FLAC_API const unsigned FLAC__FRAME_HEADER_CRC_LEN ; /**< == 8 (bits) */
2001-03-27 01:15:58 +00:00
2002-07-12 05:42:04 +00:00
2002-07-16 16:14:17 +00:00
/** FLAC frame footer structure. (c.f. <A HREF="../format.html#frame_footer">format specification</A>)
2001-03-27 01:15:58 +00:00
*/
typedef struct {
2001-06-23 03:03:24 +00:00
FLAC__uint16 crc ;
2002-07-16 16:14:17 +00:00
/**< CRC-16 (polynomial = x^16 + x^15 + x^2 + x^0, initialized with
* 0 ) of the bytes before the crc , back to and including the frame header
2002-07-15 05:26:50 +00:00
* sync code .
2002-07-12 05:42:04 +00:00
*/
2001-03-27 01:15:58 +00:00
} FLAC__FrameFooter ;
2002-10-16 22:18:32 +00:00
extern FLAC_API const unsigned FLAC__FRAME_FOOTER_CRC_LEN ; /**< == 16 (bits) */
2002-07-12 05:42:04 +00:00
2000-12-10 04:09:52 +00:00
2002-07-16 16:14:17 +00:00
/** FLAC frame structure. (c.f. <A HREF="../format.html#frame">format specification</A>)
2002-07-12 05:42:04 +00:00
*/
2001-01-23 00:40:51 +00:00
typedef struct {
FLAC__FrameHeader header ;
FLAC__Subframe subframes [ FLAC__MAX_CHANNELS ] ;
2001-03-27 01:15:58 +00:00
FLAC__FrameFooter footer ;
2001-01-23 00:40:51 +00:00
} FLAC__Frame ;
2000-12-10 04:09:52 +00:00
/*****************************************************************************/
/*****************************************************************************
*
2001-01-23 00:40:51 +00:00
* Meta - data structures
2000-12-10 04:09:52 +00:00
*
2001-01-23 00:40:51 +00:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2002-07-15 05:26:50 +00:00
/** An enumeration of the available metadata block types. */
2001-01-23 00:40:51 +00:00
typedef enum {
2002-07-27 04:59:54 +00:00
2001-02-23 21:01:14 +00:00
FLAC__METADATA_TYPE_STREAMINFO = 0 ,
2002-07-27 04:59:54 +00:00
/**< <A HREF="../format.html#metadata_block_streaminfo">STREAMINFO</A> block */
2001-02-23 21:01:14 +00:00
FLAC__METADATA_TYPE_PADDING = 1 ,
2002-11-14 05:00:24 +00:00
/**< <A HREF="../format.html#metadata_block_padding">PADDING</A> block */
2002-07-27 04:59:54 +00:00
2001-04-05 21:31:34 +00:00
FLAC__METADATA_TYPE_APPLICATION = 2 ,
2002-11-14 05:00:24 +00:00
/**< <A HREF="../format.html#metadata_block_application">APPLICATION</A> block */
2002-07-27 04:59:54 +00:00
2002-04-25 05:53:09 +00:00
FLAC__METADATA_TYPE_SEEKTABLE = 3 ,
2002-11-14 05:00:24 +00:00
/**< <A HREF="../format.html#metadata_block_seektable">SEEKTABLE</A> block */
2002-07-27 04:59:54 +00:00
FLAC__METADATA_TYPE_VORBIS_COMMENT = 4 ,
2002-11-14 05:00:24 +00:00
/**< <A HREF="../format.html#metadata_block_vorbis_comment">VORBISCOMMENT</A> block */
2002-11-15 05:44:26 +00:00
FLAC__METADATA_TYPE_CUESHEET = 5 ,
2002-11-14 05:00:24 +00:00
/**< <A HREF="../format.html#metadata_block_cuesheet">CUESHEET</A> block */
2002-07-27 04:59:54 +00:00
2002-11-15 05:44:26 +00:00
FLAC__METADATA_TYPE_UNDEFINED = 6
/**< <A HREF="../format.html#metadata_block_cuesheet">marker to denote
* beginning of undefined type range ; this number will increase as new
* metadata types are added < / A > block
*/
2002-06-08 04:53:42 +00:00
} FLAC__MetadataType ;
2000-12-10 04:09:52 +00:00
2002-07-15 05:26:50 +00:00
/** Maps a FLAC__MetadataType to a C string.
2000-12-10 04:09:52 +00:00
*
2002-07-15 05:26:50 +00:00
* Using a FLAC__MetadataType as the index to this array will
* give the string equivalent . The contents should not be modified .
*/
2002-10-16 22:18:32 +00:00
extern FLAC_API const char * const FLAC__MetadataTypeString [ ] ;
2002-07-15 05:26:50 +00:00
2002-07-27 04:59:54 +00:00
2002-07-16 16:14:17 +00:00
/** FLAC STREAMINFO structure. (c.f. <A HREF="../format.html#metadata_block_streaminfo">format specification</A>)
2000-12-10 04:09:52 +00:00
*/
typedef struct {
2001-01-23 00:40:51 +00:00
unsigned min_blocksize , max_blocksize ;
unsigned min_framesize , max_framesize ;
unsigned sample_rate ;
unsigned channels ;
unsigned bits_per_sample ;
2001-06-23 03:03:24 +00:00
FLAC__uint64 total_samples ;
FLAC__byte md5sum [ 16 ] ;
2002-06-08 04:53:42 +00:00
} FLAC__StreamMetadata_StreamInfo ;
2001-02-23 21:01:14 +00:00
2002-10-16 22:18:32 +00:00
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN ; /**< == 16 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN ; /**< == 16 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN ; /**< == 24 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN ; /**< == 24 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN ; /**< == 20 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN ; /**< == 3 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN ; /**< == 5 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN ; /**< == 36 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MD5SUM_LEN ; /**< == 128 (bits) */
2002-05-20 05:55:44 +00:00
2002-07-15 05:26:50 +00:00
/** The total stream length of the STREAMINFO block in bytes. */
2002-05-20 05:55:44 +00:00
# define FLAC__STREAM_METADATA_STREAMINFO_LENGTH (34u)
2001-02-23 21:01:14 +00:00
2002-07-16 16:14:17 +00:00
/** FLAC PADDING structure. (c.f. <A HREF="../format.html#metadata_block_padding">format specification</A>)
2001-02-23 21:01:14 +00:00
*/
typedef struct {
2002-07-15 05:26:50 +00:00
int dummy ;
/**< Conceptually this is an empty struct since we don't store the
* padding bytes . Empty structs are not allowed by some C compilers ,
* hence the dummy .
*/
2002-06-08 04:53:42 +00:00
} FLAC__StreamMetadata_Padding ;
2001-02-23 21:01:14 +00:00
2002-07-15 05:26:50 +00:00
2002-07-16 16:14:17 +00:00
/** FLAC APPLICATION structure. (c.f. <A HREF="../format.html#metadata_block_application">format specification</A>)
2001-02-23 21:01:14 +00:00
*/
typedef struct {
2001-06-23 03:03:24 +00:00
FLAC__byte id [ 4 ] ;
FLAC__byte * data ;
2002-06-08 04:53:42 +00:00
} FLAC__StreamMetadata_Application ;
2001-02-23 21:01:14 +00:00
2002-10-16 22:18:32 +00:00
extern FLAC_API const unsigned FLAC__STREAM_METADATA_APPLICATION_ID_LEN ; /**< == 32 (bits) */
2000-12-10 04:09:52 +00:00
2002-07-16 16:14:17 +00:00
/** SeekPoint structure used in SEEKTABLE blocks. (c.f. <A HREF="../format.html#seekpoint">format specification</A>)
2001-04-05 21:31:34 +00:00
*/
typedef struct {
2001-06-23 03:03:24 +00:00
FLAC__uint64 sample_number ;
2002-07-15 05:26:50 +00:00
/**< The sample number of the target frame. */
2001-06-23 03:03:24 +00:00
FLAC__uint64 stream_offset ;
2002-07-15 05:26:50 +00:00
/**< The offset, in bytes, of the target frame with respect to
* beginning of the first frame . */
2001-04-13 18:22:25 +00:00
unsigned frame_samples ;
2002-07-15 05:26:50 +00:00
/**< The number of samples in the target frame. */
2002-06-08 04:53:42 +00:00
} FLAC__StreamMetadata_SeekPoint ;
2001-04-05 21:31:34 +00:00
2002-10-16 22:18:32 +00:00
extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_SAMPLE_NUMBER_LEN ; /**< == 64 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_STREAM_OFFSET_LEN ; /**< == 64 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN ; /**< == 16 (bits) */
2002-05-20 05:55:44 +00:00
2002-07-15 05:26:50 +00:00
/** The total stream length of a seek point in bytes. */
2002-05-20 05:55:44 +00:00
# define FLAC__STREAM_METADATA_SEEKPOINT_LENGTH (18u)
2001-04-05 21:31:34 +00:00
2002-07-15 05:26:50 +00:00
/** The value used in the \a sample_number field of
* FLAC__StreamMetadataSeekPoint used to indicate a placeholder
* point ( = = 0xffffffffffffffff ) .
*/
2002-10-16 22:18:32 +00:00
extern FLAC_API const FLAC__uint64 FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER ;
2001-04-13 18:22:25 +00:00
2002-07-15 05:26:50 +00:00
2002-07-16 16:14:17 +00:00
/** FLAC SEEKTABLE structure. (c.f. <A HREF="../format.html#metadata_block_seektable">format specification</A>)
2001-04-05 21:31:34 +00:00
*
2002-07-15 05:26:50 +00:00
* \ note From the format specification :
* - The seek points must be sorted by ascending sample number .
* - Each seek point ' s sample number must be the first sample of the
* target frame .
* - Each seek point ' s sample number must be unique within the table .
* - Existence of a SEEKTABLE block implies a correct setting of
* total_samples in the stream_info block .
* - Behavior is undefined when more than one SEEKTABLE block is
* present in a stream .
2001-04-05 21:31:34 +00:00
*/
typedef struct {
unsigned num_points ;
2002-06-08 04:53:42 +00:00
FLAC__StreamMetadata_SeekPoint * points ;
} FLAC__StreamMetadata_SeekTable ;
2001-04-05 21:31:34 +00:00
2002-07-15 05:26:50 +00:00
2002-07-16 16:14:17 +00:00
/** Vorbis comment entry structure used in VORBIS_COMMENT blocks. (c.f. <A HREF="../format.html#metadata_block_vorbis_comment">format specification</A>)
2002-05-04 17:33:35 +00:00
*/
typedef struct {
FLAC__uint32 length ;
FLAC__byte * entry ;
2002-06-08 04:53:42 +00:00
} FLAC__StreamMetadata_VorbisComment_Entry ;
2002-05-04 17:33:35 +00:00
2002-10-16 22:18:32 +00:00
extern FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN ; /**< == 32 (bits) */
2002-05-04 17:33:35 +00:00
2002-07-15 05:26:50 +00:00
2002-07-16 16:14:17 +00:00
/** FLAC VORBIS_COMMENT structure. (c.f. <A HREF="../format.html#metadata_block_vorbis_comment">format specification</A>)
2002-05-04 17:33:35 +00:00
*/
typedef struct {
2002-06-08 04:53:42 +00:00
FLAC__StreamMetadata_VorbisComment_Entry vendor_string ;
2002-05-04 17:33:35 +00:00
FLAC__uint32 num_comments ;
2002-06-08 04:53:42 +00:00
FLAC__StreamMetadata_VorbisComment_Entry * comments ;
} FLAC__StreamMetadata_VorbisComment ;
2002-05-04 17:33:35 +00:00
2002-10-16 22:18:32 +00:00
extern FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN ; /**< == 32 (bits) */
2002-05-04 17:33:35 +00:00
2002-07-15 05:26:50 +00:00
2002-11-14 05:00:24 +00:00
/** XXX. (c.f. <A HREF="../format.html#XXX">format specification</A>)
*/
typedef struct {
FLAC__uint64 offset ;
/**< The index offset from the beginning of the track, in samples.
* For CD - DA , the offset must be evenly divisible by 588 samples ( 588
* samples = 44100 samples / sec * 1 / 75 th of a sec )
*/
FLAC__byte number ;
/**< The index number. For CD-DA, an index number of 0 corresponds
* to the track pregap . There must be at least one index in a track .
* The first index in a track must be 0 or 1 and subsequently index
* numbers must increase by 1.
*/
} FLAC__StreamMetadata_CueSheet_Index ;
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN ; /**< == 64 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN ; /**< == 8 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN ; /**< == @@@@3*8 (bits) */
/** XXX. (c.f. <A HREF="../format.html#XXX">format specification</A>)
*/
typedef struct {
FLAC__uint64 offset ;
/**< The track offset from the beginning of the audio data, in samples.
* This track offset is the offset to the first index point of the
* track . Note that for CD - DA , the track ' s offset in the TOC is that
* of the track ' s INDEX 01 even if there is an INDEX 00.
*
* For CD - DA , the offset must be evenly divisible by 588 samples ( 588
* samples = 44100 samples / sec * 1 / 75 th of a sec )
*/
FLAC__byte number ;
/**< The track number. A track number of 0 is not allowed to avoid
* conflicting with the CD - DA spec , which reserves this for the
* lead - in . For CD - DA the number must be 1 - 99 , or 170 for the lead - out .
* It is not required but encouraged to start with track 1 and increase
* sequentially . A CUESHEET block is required to have a lead - out
* track ; it is always the last track in the cuesheet and the number
* must be 170 for CD - DA .
*/
char isrc [ 13 ] ; /*@@@@ 12 ascii characters plus trailing '\0' */
unsigned type : 1 ; /*@@@@q-channel control bit 3: 0=>audio, 1=>data (undefined for CD-DA, defined for CDROM) */
unsigned pre_emphasis : 1 ; /*@@@@q-channel control bit 5: 0=>no pre-em, 1=>pre-em */
FLAC__byte num_indices ;
FLAC__StreamMetadata_CueSheet_Index * indices ;
} FLAC__StreamMetadata_CueSheet_Track ;
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN ; /**< == 64 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN ; /**< == 8 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN ; /**< == 12*8 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN ; /**< == 1 (bit) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN ; /**< == 1 (bit) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN ; /**< == 6+@@@@12*8 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN ; /**< == 8 (bits) */
/** FLAC CUESHEET structure. (c.f. <A HREF="../format.html#metadata_block_cuesheet">format specification</A>)
*/
typedef struct {
2002-11-15 05:44:26 +00:00
char media_catalog_number [ 129 ] ; /*@@@@ in the stream, the media_catalog_number will be 128 alphanumberic ascii characters; unused digits are padded out to the right with null characters. in memory, the 129th character will be guaranteed to be a null character so that the whole string is always a valid C string. CD-DA: 13 ascii digits ('0'-'9') plus 116 trailing '\0' characters */
2002-11-14 05:00:24 +00:00
FLAC__uint64 lead_in ; /*@@@@ length of lead-in in samples; required to compute some versions of CD TOC hashes; CD-DA says the lead-in must be digital silence and rippers don't save it by convention, so TRACK 00 is disallowed and instead we store only the length. The lead-in is the number of samples up to the first index point of the first track, \b not INDEX 01 of the first track. This is so applications can correctly compute a CD-DA TOC equivalent even when there is TRACK 01 INDEX 00 data. */
unsigned num_tracks ;
FLAC__StreamMetadata_CueSheet_Track * tracks ;
} FLAC__StreamMetadata_CueSheet ;
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN ; /**< == 128*8 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN ; /**< == 64 (bits) */
2002-11-16 06:31:54 +00:00
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN ; /**< == @@@@256*8 (bits) */
2002-11-14 05:00:24 +00:00
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN ; /**< == 8 (bits) */
2002-11-16 06:31:54 +00:00
/*@@@@@ RESERVED SPACE HERE*/
2002-11-14 05:00:24 +00:00
2002-07-24 06:15:56 +00:00
/** FLAC metadata block structure. (c.f. <A HREF="../format.html#metadata_block">format specification</A>)
2000-12-10 04:09:52 +00:00
*/
typedef struct {
2002-06-08 04:53:42 +00:00
FLAC__MetadataType type ;
2002-07-15 05:26:50 +00:00
/**< The type of the metadata block; used determine which member of the
* \ a data union to dereference . */
2001-06-23 03:03:24 +00:00
FLAC__bool is_last ;
2002-07-15 05:26:50 +00:00
/**< \c true if this metadata block is the last, else \a false */
unsigned length ;
/**< Length, in bytes, of the block data as it appears in the stream. */
2001-01-23 00:40:51 +00:00
union {
2002-06-08 04:53:42 +00:00
FLAC__StreamMetadata_StreamInfo stream_info ;
FLAC__StreamMetadata_Padding padding ;
FLAC__StreamMetadata_Application application ;
FLAC__StreamMetadata_SeekTable seek_table ;
FLAC__StreamMetadata_VorbisComment vorbis_comment ;
2002-11-14 05:00:24 +00:00
FLAC__StreamMetadata_CueSheet cue_sheet ;
2001-01-23 00:40:51 +00:00
} data ;
2002-07-15 05:26:50 +00:00
/**< Polymorphic block data; use the \a type value to determine which
* to use . */
2002-06-08 04:53:42 +00:00
} FLAC__StreamMetadata ;
2001-01-23 00:40:51 +00:00
2002-10-16 22:18:32 +00:00
extern FLAC_API const unsigned FLAC__STREAM_METADATA_IS_LAST_LEN ; /**< == 1 (bit) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_TYPE_LEN ; /**< == 7 (bits) */
extern FLAC_API const unsigned FLAC__STREAM_METADATA_LENGTH_LEN ; /**< == 24 (bits) */
2001-01-23 00:40:51 +00:00
2002-07-15 05:26:50 +00:00
/** The total stream length of a metadata block header in bytes. */
2002-05-20 05:55:44 +00:00
# define FLAC__STREAM_METADATA_HEADER_LENGTH (4u)
2001-01-23 00:40:51 +00:00
/*****************************************************************************/
2000-12-10 04:09:52 +00:00
/*****************************************************************************
*
2002-05-04 17:33:35 +00:00
* Utility functions
2001-01-23 00:40:51 +00:00
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-12-10 04:09:52 +00:00
2002-07-15 05:26:50 +00:00
/** Tests that a sample rate is valid for FLAC. Since the rules for valid
* sample rates are slightly complex , they are encapsulated in this function .
2002-07-12 05:42:04 +00:00
*
2002-07-15 05:26:50 +00:00
* \ param sample_rate The sample rate to test for compliance .
2002-07-12 05:42:04 +00:00
* \ retval FLAC__bool
2002-07-15 05:26:50 +00:00
* \ c true if the given sample rate conforms to the specification , else
* \ c false .
2002-07-12 05:42:04 +00:00
*/
2002-10-16 22:18:32 +00:00
FLAC_API FLAC__bool FLAC__format_sample_rate_is_valid ( unsigned sample_rate ) ;
2002-07-12 05:42:04 +00:00
2002-08-16 03:09:06 +00:00
/** Check a seek table to see if it conforms to the FLAC specification.
2002-07-12 05:42:04 +00:00
* See the format specification for limits on the contents of the
2002-08-16 03:09:06 +00:00
* seek table .
2002-07-12 05:42:04 +00:00
*
2002-08-16 03:09:06 +00:00
* \ param seek_table A pointer to a seek table to be checked .
2002-07-12 05:42:04 +00:00
* \ assert
2002-08-16 03:09:06 +00:00
* \ code seek_table ! = NULL \ endcode
2002-07-12 05:42:04 +00:00
* \ retval FLAC__bool
2002-07-15 05:26:50 +00:00
* \ c false if seek table is illegal , else \ c true .
2002-07-12 05:42:04 +00:00
*/
2002-10-16 22:18:32 +00:00
FLAC_API FLAC__bool FLAC__format_seektable_is_legal ( const FLAC__StreamMetadata_SeekTable * seek_table ) ;
2002-07-12 05:42:04 +00:00
2002-08-16 03:09:06 +00:00
/** Sort a seek table's seek points according to the format specification.
* This includes a " unique-ification " step to remove duplicates , i . e .
* seek points with identical \ a sample_number values . Duplicate seek
* points are converted into placeholder points and sorted to the end of
* the table .
*
* \ param seek_table A pointer to a seek table to be sorted .
* \ assert
* \ code seek_table ! = NULL \ endcode
* \ retval unsigned
* The number of duplicate seek points converted into placeholders .
*/
2002-10-16 22:18:32 +00:00
FLAC_API unsigned FLAC__format_seektable_sort ( FLAC__StreamMetadata_SeekTable * seek_table ) ;
2002-08-01 06:37:11 +00:00
2002-11-14 05:00:24 +00:00
/*@@@@ add to unit tests */
/** Check a cue sheet to see if it conforms to the FLAC specification.
* See the format specification for limits on the contents of the
* cue sheet .
*
* \ param cue_sheet A pointer to an existing cue sheet to be checked .
* \ param check_cd_da_subset If \ c true , check CUESHEET against more
* stringent requirements for a CD - DA ( audio ) disc .
* \ param violation Address of a pointer to a string . If there is a
* violation , a pointer to a string explanation of the
* violation will be returned here . \ a violation may be
* \ c NULL if you don ' t need the returned string . Do not
* free the returned string ; it will always point to static
* data .
* \ assert
* \ code cue_sheet ! = NULL \ endcode
* \ retval FLAC__bool
* \ c false if cue sheet is illegal , else \ c true .
*/
FLAC_API FLAC__bool FLAC__format_cuesheet_is_legal ( const FLAC__StreamMetadata_CueSheet * cue_sheet , FLAC__bool check_cd_da_subset , const char * * violation ) ;
2002-07-12 05:42:04 +00:00
/* \} */
2002-07-15 05:26:50 +00:00
# ifdef __cplusplus
}
# endif
2002-07-12 05:42:04 +00:00
# endif