LMMS
Loading...
Searching...
No Matches
bitwriter.h
Go to the documentation of this file.
1/* libFLAC - Free Lossless Audio Codec library
2 * Copyright (C) 2000-2009 Josh Coalson
3 * Copyright (C) 2011-2014 Xiph.Org Foundation
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * - Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * - Neither the name of the Xiph.org Foundation nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#ifndef FLAC__PRIVATE__BITWRITER_H
34#define FLAC__PRIVATE__BITWRITER_H
35
36#include <stdio.h> /* for FILE */
37#include "../../../ordinals.h"
38
39/*
40 * opaque structure definition
41 */
42struct FLAC__BitWriter;
44
45/*
46 * construction, deletion, initialization, etc functions
47 */
51void FLAC__bitwriter_free(FLAC__BitWriter *bw); /* does not 'free(buffer)' */
53void FLAC__bitwriter_dump(const FLAC__BitWriter *bw, FILE *out);
54
55/*
56 * CRC functions
57 *
58 * non-const *bw because they have to cal FLAC__bitwriter_get_buffer()
59 */
62
63/*
64 * info functions
65 */
67unsigned FLAC__bitwriter_get_input_bits_unconsumed(const FLAC__BitWriter *bw); /* can be called anytime, returns total # of bits unconsumed */
68
69/*
70 * direct buffer access
71 *
72 * there may be no calls on the bitwriter between get and release.
73 * the bitwriter continues to own the returned buffer.
74 * before get, bitwriter MUST be byte aligned: check with FLAC__bitwriter_is_byte_aligned()
75 */
78
79/*
80 * write functions
81 */
89unsigned FLAC__bitwriter_rice_bits(FLAC__int32 val, unsigned parameter);
90#if 0 /* UNUSED */
91unsigned FLAC__bitwriter_golomb_bits_signed(int val, unsigned parameter);
92unsigned FLAC__bitwriter_golomb_bits_unsigned(unsigned val, unsigned parameter);
93#endif
95FLAC__bool FLAC__bitwriter_write_rice_signed_block(FLAC__BitWriter *bw, const FLAC__int32 *vals, unsigned nvals, unsigned parameter);
96#if 0 /* UNUSED */
97FLAC__bool FLAC__bitwriter_write_golomb_signed(FLAC__BitWriter *bw, int val, unsigned parameter);
98FLAC__bool FLAC__bitwriter_write_golomb_unsigned(FLAC__BitWriter *bw, unsigned val, unsigned parameter);
99#endif
103
104#endif
FLAC__bool FLAC__bitwriter_get_buffer(FLAC__BitWriter *bw, const FLAC__byte **buffer, size_t *bytes)
Definition bitwriter.c:238
FLAC__bool FLAC__bitwriter_zero_pad_to_byte_boundary(FLAC__BitWriter *bw)
Definition bitwriter.c:821
FLAC__bool FLAC__bitwriter_write_rice_signed_block(FLAC__BitWriter *bw, const FLAC__int32 *vals, unsigned nvals, unsigned parameter)
Definition bitwriter.c:505
FLAC__bool FLAC__bitwriter_write_utf8_uint64(FLAC__BitWriter *bw, FLAC__uint64 val)
Definition bitwriter.c:766
FLAC__bool FLAC__bitwriter_write_zeroes(FLAC__BitWriter *bw, unsigned bits)
Definition bitwriter.c:266
unsigned FLAC__bitwriter_rice_bits(FLAC__int32 val, unsigned parameter)
Definition bitwriter.c:403
void FLAC__bitwriter_dump(const FLAC__BitWriter *bw, FILE *out)
Definition bitwriter.c:174
FLAC__bool FLAC__bitwriter_init(FLAC__BitWriter *bw)
Definition bitwriter.c:145
FLAC__bool FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter *bw, FLAC__uint32 val, unsigned bits)
Definition bitwriter.c:304
FLAC__bool FLAC__bitwriter_write_raw_uint32_little_endian(FLAC__BitWriter *bw, FLAC__uint32 val)
Definition bitwriter.c:364
FLAC__bool FLAC__bitwriter_write_rice_signed(FLAC__BitWriter *bw, FLAC__int32 val, unsigned parameter)
Definition bitwriter.c:479
void FLAC__bitwriter_clear(FLAC__BitWriter *bw)
Definition bitwriter.c:169
FLAC__bool FLAC__bitwriter_is_byte_aligned(const FLAC__BitWriter *bw)
Definition bitwriter.c:228
unsigned FLAC__bitwriter_get_input_bits_unconsumed(const FLAC__BitWriter *bw)
Definition bitwriter.c:233
FLAC__bool FLAC__bitwriter_write_raw_int32(FLAC__BitWriter *bw, FLAC__int32 val, unsigned bits)
Definition bitwriter.c:343
void FLAC__bitwriter_release_buffer(FLAC__BitWriter *bw)
Definition bitwriter.c:258
FLAC__bool FLAC__bitwriter_write_byte_block(FLAC__BitWriter *bw, const FLAC__byte vals[], unsigned nvals)
Definition bitwriter.c:380
FLAC__bool FLAC__bitwriter_write_raw_uint64(FLAC__BitWriter *bw, FLAC__uint64 val, unsigned bits)
Definition bitwriter.c:352
FLAC__BitWriter * FLAC__bitwriter_new(void)
Definition bitwriter.c:124
FLAC__bool FLAC__bitwriter_write_unary_unsigned(FLAC__BitWriter *bw, unsigned val)
Definition bitwriter.c:393
void FLAC__bitwriter_free(FLAC__BitWriter *bw)
Definition bitwriter.c:158
void FLAC__bitwriter_delete(FLAC__BitWriter *bw)
Definition bitwriter.c:131
FLAC__bool FLAC__bitwriter_get_write_crc16(FLAC__BitWriter *bw, FLAC__uint16 *crc)
Definition bitwriter.c:198
FLAC__bool FLAC__bitwriter_write_utf8_uint32(FLAC__BitWriter *bw, FLAC__uint32 val)
Definition bitwriter.c:720
FLAC__bool FLAC__bitwriter_get_write_crc8(FLAC__BitWriter *bw, FLAC__byte *crc)
Definition bitwriter.c:213
int val
Definition jpeglib.h:956
float out
Definition lilv_test.c:1461
uint16_t FLAC__uint16
Definition ordinals.h:64
int32_t FLAC__int32
Definition ordinals.h:62
FLAC__uint8 FLAC__byte
Definition ordinals.h:72
int FLAC__bool
Definition ordinals.h:70
uint32_t FLAC__uint32
Definition ordinals.h:65
uint64_t FLAC__uint64
Definition ordinals.h:66
png_uint_32 crc
Definition png.c:2247
Definition bitwriter.c:72
uint32_t * buffer
Definition bitwriter.c:73
unsigned bits
Definition bitwriter.c:77