annotate src/flac-1.2.1/src/libFLAC/include/private/bitreader.h @ 20:ab7c38c4c577

Ranlib
author Chris Cannam
date Mon, 25 Mar 2013 16:28:19 +0000
parents 05aa0afa9217
children
rev   line source
Chris@1 1 /* libFLAC - Free Lossless Audio Codec library
Chris@1 2 * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
Chris@1 3 *
Chris@1 4 * Redistribution and use in source and binary forms, with or without
Chris@1 5 * modification, are permitted provided that the following conditions
Chris@1 6 * are met:
Chris@1 7 *
Chris@1 8 * - Redistributions of source code must retain the above copyright
Chris@1 9 * notice, this list of conditions and the following disclaimer.
Chris@1 10 *
Chris@1 11 * - Redistributions in binary form must reproduce the above copyright
Chris@1 12 * notice, this list of conditions and the following disclaimer in the
Chris@1 13 * documentation and/or other materials provided with the distribution.
Chris@1 14 *
Chris@1 15 * - Neither the name of the Xiph.org Foundation nor the names of its
Chris@1 16 * contributors may be used to endorse or promote products derived from
Chris@1 17 * this software without specific prior written permission.
Chris@1 18 *
Chris@1 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Chris@1 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Chris@1 21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Chris@1 22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
Chris@1 23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
Chris@1 24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
Chris@1 25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
Chris@1 26 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
Chris@1 27 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
Chris@1 28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
Chris@1 29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Chris@1 30 */
Chris@1 31
Chris@1 32 #ifndef FLAC__PRIVATE__BITREADER_H
Chris@1 33 #define FLAC__PRIVATE__BITREADER_H
Chris@1 34
Chris@1 35 #include <stdio.h> /* for FILE */
Chris@1 36 #include "FLAC/ordinals.h"
Chris@1 37 #include "cpu.h"
Chris@1 38
Chris@1 39 /*
Chris@1 40 * opaque structure definition
Chris@1 41 */
Chris@1 42 struct FLAC__BitReader;
Chris@1 43 typedef struct FLAC__BitReader FLAC__BitReader;
Chris@1 44
Chris@1 45 typedef FLAC__bool (*FLAC__BitReaderReadCallback)(FLAC__byte buffer[], size_t *bytes, void *client_data);
Chris@1 46
Chris@1 47 /*
Chris@1 48 * construction, deletion, initialization, etc functions
Chris@1 49 */
Chris@1 50 FLAC__BitReader *FLAC__bitreader_new(void);
Chris@1 51 void FLAC__bitreader_delete(FLAC__BitReader *br);
Chris@1 52 FLAC__bool FLAC__bitreader_init(FLAC__BitReader *br, FLAC__CPUInfo cpu, FLAC__BitReaderReadCallback rcb, void *cd);
Chris@1 53 void FLAC__bitreader_free(FLAC__BitReader *br); /* does not 'free(br)' */
Chris@1 54 FLAC__bool FLAC__bitreader_clear(FLAC__BitReader *br);
Chris@1 55 void FLAC__bitreader_dump(const FLAC__BitReader *br, FILE *out);
Chris@1 56
Chris@1 57 /*
Chris@1 58 * CRC functions
Chris@1 59 */
Chris@1 60 void FLAC__bitreader_reset_read_crc16(FLAC__BitReader *br, FLAC__uint16 seed);
Chris@1 61 FLAC__uint16 FLAC__bitreader_get_read_crc16(FLAC__BitReader *br);
Chris@1 62
Chris@1 63 /*
Chris@1 64 * info functions
Chris@1 65 */
Chris@1 66 FLAC__bool FLAC__bitreader_is_consumed_byte_aligned(const FLAC__BitReader *br);
Chris@1 67 unsigned FLAC__bitreader_bits_left_for_byte_alignment(const FLAC__BitReader *br);
Chris@1 68 unsigned FLAC__bitreader_get_input_bits_unconsumed(const FLAC__BitReader *br);
Chris@1 69
Chris@1 70 /*
Chris@1 71 * read functions
Chris@1 72 */
Chris@1 73
Chris@1 74 FLAC__bool FLAC__bitreader_read_raw_uint32(FLAC__BitReader *br, FLAC__uint32 *val, unsigned bits);
Chris@1 75 FLAC__bool FLAC__bitreader_read_raw_int32(FLAC__BitReader *br, FLAC__int32 *val, unsigned bits);
Chris@1 76 FLAC__bool FLAC__bitreader_read_raw_uint64(FLAC__BitReader *br, FLAC__uint64 *val, unsigned bits);
Chris@1 77 FLAC__bool FLAC__bitreader_read_uint32_little_endian(FLAC__BitReader *br, FLAC__uint32 *val); /*only for bits=32*/
Chris@1 78 FLAC__bool FLAC__bitreader_skip_bits_no_crc(FLAC__BitReader *br, unsigned bits); /* WATCHOUT: does not CRC the skipped data! */ /*@@@@ add to unit tests */
Chris@1 79 FLAC__bool FLAC__bitreader_skip_byte_block_aligned_no_crc(FLAC__BitReader *br, unsigned nvals); /* WATCHOUT: does not CRC the read data! */
Chris@1 80 FLAC__bool FLAC__bitreader_read_byte_block_aligned_no_crc(FLAC__BitReader *br, FLAC__byte *val, unsigned nvals); /* WATCHOUT: does not CRC the read data! */
Chris@1 81 FLAC__bool FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, unsigned *val);
Chris@1 82 FLAC__bool FLAC__bitreader_read_rice_signed(FLAC__BitReader *br, int *val, unsigned parameter);
Chris@1 83 FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter);
Chris@1 84 #ifndef FLAC__NO_ASM
Chris@1 85 # ifdef FLAC__CPU_IA32
Chris@1 86 # ifdef FLAC__HAS_NASM
Chris@1 87 FLAC__bool FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter);
Chris@1 88 # endif
Chris@1 89 # endif
Chris@1 90 #endif
Chris@1 91 #if 0 /* UNUSED */
Chris@1 92 FLAC__bool FLAC__bitreader_read_golomb_signed(FLAC__BitReader *br, int *val, unsigned parameter);
Chris@1 93 FLAC__bool FLAC__bitreader_read_golomb_unsigned(FLAC__BitReader *br, unsigned *val, unsigned parameter);
Chris@1 94 #endif
Chris@1 95 FLAC__bool FLAC__bitreader_read_utf8_uint32(FLAC__BitReader *br, FLAC__uint32 *val, FLAC__byte *raw, unsigned *rawlen);
Chris@1 96 FLAC__bool FLAC__bitreader_read_utf8_uint64(FLAC__BitReader *br, FLAC__uint64 *val, FLAC__byte *raw, unsigned *rawlen);
Chris@1 97
Chris@1 98 FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br);
Chris@1 99 #endif