~ubuntu-branches/ubuntu/quantal/flac/quantal

« back to all changes in this revision

Viewing changes to include/FLAC/format.h

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-12-06 16:57:20 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20071206165720-ldii5tm8dq6zxg0l
Tags: 1.2.1-1ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/control: xmms-dev dropped to allow xmms to move to universe,
    adjust maintainer field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
 
192
192
/** An enumeration of the available entropy coding methods. */
193
193
typedef enum {
194
 
        FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE = 0
195
 
        /**< Residual is coded by partitioning into contexts, each with it's own
196
 
         * Rice parameter. */
 
194
        FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE = 0,
 
195
        /**< Residual is coded by partitioning into contexts, each with it's own
 
196
         * 4-bit Rice parameter. */
 
197
 
 
198
        FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2 = 1
 
199
        /**< Residual is coded by partitioning into contexts, each with it's own
 
200
         * 5-bit Rice parameter. */
197
201
} FLAC__EntropyCodingMethodType;
198
202
 
199
203
/** Maps a FLAC__EntropyCodingMethodType to a C string.
212
216
        /**< The Rice parameters for each context. */
213
217
 
214
218
        unsigned *raw_bits;
215
 
        /**< Widths for escape-coded partitions. */
 
219
        /**< Widths for escape-coded partitions.  Will be non-zero for escaped
 
220
         * partitions and zero for unescaped partitions.
 
221
         */
216
222
 
217
223
        unsigned capacity_by_order;
218
224
        /**< The capacity of the \a parameters and \a raw_bits arrays
235
241
 
236
242
extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN; /**< == 4 (bits) */
237
243
extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN; /**< == 4 (bits) */
 
244
extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN; /**< == 5 (bits) */
238
245
extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN; /**< == 5 (bits) */
239
246
 
240
247
extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER;
241
248
/**< == (1<<FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN)-1 */
 
249
extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_ESCAPE_PARAMETER;
 
250
/**< == (1<<FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN)-1 */
242
251
 
243
252
/** Header for the entropy coding method.  (c.f. <A HREF="../format.html#residual">format specification</A>)
244
253
 */
342
351
        unsigned wasted_bits;
343
352
} FLAC__Subframe;
344
353
 
345
 
extern FLAC_API const unsigned FLAC__SUBFRAME_ZERO_PAD_LEN; /**< == 1 (bit) */
 
354
/** == 1 (bit)
 
355
 *
 
356
 * This used to be a zero-padding bit (hence the name
 
357
 * FLAC__SUBFRAME_ZERO_PAD_LEN) but is now a reserved bit.  It still has a
 
358
 * mandatory value of \c 0 but in the future may take on the value \c 0 or \c 1
 
359
 * to mean something else.
 
360
 */
 
361
extern FLAC_API const unsigned FLAC__SUBFRAME_ZERO_PAD_LEN;
346
362
extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LEN; /**< == 6 (bits) */
347
363
extern FLAC_API const unsigned FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN; /**< == 1 (bit) */
348
364
 
408
424
        /**< The sample resolution. */
409
425
 
410
426
        FLAC__FrameNumberType number_type;
411
 
        /**< The numbering scheme used for the frame. */
 
427
        /**< The numbering scheme used for the frame.  As a convenience, the
 
428
         * decoder will always convert a frame number to a sample number because
 
429
         * the rules are complex. */
412
430
 
413
431
        union {
414
432
                FLAC__uint32 frame_number;
426
444
 
427
445
extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC; /**< == 0x3ffe; the frame header sync code */
428
446
extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC_LEN; /**< == 14 (bits) */
429
 
extern FLAC_API const unsigned FLAC__FRAME_HEADER_RESERVED_LEN; /**< == 2 (bits) */
 
447
extern FLAC_API const unsigned FLAC__FRAME_HEADER_RESERVED_LEN; /**< == 1 (bits) */
 
448
extern FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN; /**< == 1 (bits) */
430
449
extern FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCK_SIZE_LEN; /**< == 4 (bits) */
431
450
extern FLAC_API const unsigned FLAC__FRAME_HEADER_SAMPLE_RATE_LEN; /**< == 4 (bits) */
432
451
extern FLAC_API const unsigned FLAC__FRAME_HEADER_CHANNEL_ASSIGNMENT_LEN; /**< == 4 (bits) */
851
870
 *
852
871
 *****************************************************************************/
853
872
 
854
 
/** Tests that a sample rate is valid for FLAC.  Since the rules for valid
855
 
 *  sample rates are slightly complex, they are encapsulated in this function.
 
873
/** Tests that a sample rate is valid for FLAC.
856
874
 *
857
875
 * \param sample_rate  The sample rate to test for compliance.
858
876
 * \retval FLAC__bool
861
879
 */
862
880
FLAC_API FLAC__bool FLAC__format_sample_rate_is_valid(unsigned sample_rate);
863
881
 
 
882
/** Tests that a sample rate is valid for the FLAC subset.  The subset rules
 
883
 *  for valid sample rates are slightly more complex since the rate has to
 
884
 *  be expressible completely in the frame header.
 
885
 *
 
886
 * \param sample_rate  The sample rate to test for compliance.
 
887
 * \retval FLAC__bool
 
888
 *    \c true if the given sample rate conforms to the specification for the
 
889
 *    subset, else \c false.
 
890
 */
 
891
FLAC_API FLAC__bool FLAC__format_sample_rate_is_subset(unsigned sample_rate);
 
892
 
864
893
/** Check a Vorbis comment entry name to see if it conforms to the Vorbis
865
894
 *  comment specification.
866
895
 *
908
937
 */
909
938
FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_is_legal(const FLAC__byte *entry, unsigned length);
910
939
 
911
 
/* @@@@ add to unit tests; it is already indirectly tested by the metadata_object tests */
912
940
/** Check a seek table to see if it conforms to the FLAC specification.
913
941
 *  See the format specification for limits on the contents of the
914
942
 *  seek table.
921
949
 */
922
950
FLAC_API FLAC__bool FLAC__format_seektable_is_legal(const FLAC__StreamMetadata_SeekTable *seek_table);
923
951
 
924
 
/* @@@@ add to unit tests; it is already indirectly tested by the metadata_object tests */
925
952
/** Sort a seek table's seek points according to the format specification.
926
953
 *  This includes a "unique-ification" step to remove duplicates, i.e.
927
954
 *  seek points with identical \a sample_number values.  Duplicate seek
936
963
 */
937
964
FLAC_API unsigned FLAC__format_seektable_sort(FLAC__StreamMetadata_SeekTable *seek_table);
938
965
 
939
 
/* @@@@ add to unit tests; it is already indirectly tested by the metadata_object tests */
940
966
/** Check a cue sheet to see if it conforms to the FLAC specification.
941
967
 *  See the format specification for limits on the contents of the
942
968
 *  cue sheet.
957
983
 */
958
984
FLAC_API FLAC__bool FLAC__format_cuesheet_is_legal(const FLAC__StreamMetadata_CueSheet *cue_sheet, FLAC__bool check_cd_da_subset, const char **violation);
959
985
 
960
 
/* @@@@ add to unit tests; it is already indirectly tested by the metadata_object tests */
961
986
/** Check picture data to see if it conforms to the FLAC specification.
962
987
 *  See the format specification for limits on the contents of the
963
988
 *  PICTURE block.