Go to the documentation of this file.
54 int bs_code, sr_code, bps_code;
57 if ((
get_bits(gb, 15) & 0x7FFF) != 0x7FFC) {
79 "invalid channel mode: %d\n", fi->
ch_mode);
87 "invalid sample size code (%d)\n",
96 "broken stream, invalid padding\n");
104 "sample/frame number invalid; utf8 fscked\n");
111 "reserved blocksize code: 0\n");
113 }
else if (bs_code == 6) {
115 }
else if (bs_code == 7) {
124 }
else if (sr_code == 12) {
126 }
else if (sr_code == 13) {
128 }
else if (sr_code == 14) {
132 "illegal sample rate code %d\n",
142 "header crc mismatch\n");
150 uint8_t **streaminfo_start)
168 *streaminfo_start = &avctx->
extradata[8];
198 s->max_blocksize = 16;
static const int8_t sample_size_table[]
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_CHANNEL_LAYOUT_STEREO
int sample_rate
samples per second
static int get_bits_count(const GetBitContext *s)
int64_t frame_or_sample_num
frame number or sample number
int is_var_size
specifies if the stream uses variable block sizes or a fixed block size; also determines the meaning ...
int ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, const uint8_t *buffer)
Parse the Streaminfo metadata block.
enum AVChannelOrder order
Channel order used in this layout.
int nb_channels
Number of channels in this layout.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static void skip_bits(GetBitContext *s, int n)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
void ff_flac_set_channel_layout(AVCodecContext *avctx, int channels)
AVChannelLayout ch_layout
Audio channel layout.
static const AVChannelLayout flac_channel_layouts[8]
int ff_flac_decode_frame_header(void *logctx, GetBitContext *gb, FLACFrameInfo *fi, int log_level_offset)
Validate and decode a frame header.
static double val(void *priv, double ch)
#define AV_CHANNEL_LAYOUT_SURROUND
const int32_t ff_flac_blocksize_table[16]
#define GET_UTF8(val, GET_BYTE, ERROR)
Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
int channels
number of channels
#define AV_CHANNEL_LAYOUT_7POINT1
int blocksize
block size of the frame
@ AV_CHANNEL_ORDER_UNSPEC
Only the channel count is specified, without any further information about the channel order.
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
int ff_flac_is_extradata_valid(AVCodecContext *avctx, uint8_t **streaminfo_start)
Validate the FLAC extradata.
const int ff_flac_sample_rate_table[16]
static unsigned int get_bits1(GetBitContext *s)
#define FLAC_STREAMINFO_SIZE
An AVChannelLayout holds information about the channel layout of audio data.
const AVCRC * av_crc_get_table(AVCRCId crc_id)
Get an initialized standard CRC table.
static int64_t get_utf8(GetBitContext *gb)
static uint64_t get_bits64(GetBitContext *s, int n)
Read 0-64 bits.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
#define AV_CHANNEL_LAYOUT_QUAD
int ch_mode
channel decorrelation mode
int samplerate
sample rate
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
#define FLAC_MAX_CHANNELS
main external API structure.
the frame and frame reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFrame structures Several references can point to the same frame buffer
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)
Calculate the CRC of a block.
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
#define AV_CHANNEL_LAYOUT_MONO
#define AV_CHANNEL_LAYOUT_6POINT1
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define MKTAG(a, b, c, d)
#define AV_CHANNEL_LAYOUT_5POINT0
#define FLAC_MIN_BLOCKSIZE
#define AV_CHANNEL_LAYOUT_5POINT1
@ FLAC_CHMODE_INDEPENDENT