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 double val(void *priv, double ch)
Public libavutil channel layout APIs header.
#define GET_UTF8(val, GET_BYTE, ERROR)
Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
Public header for CRC hash function implementation.
int ff_flac_decode_frame_header(void *logctx, GetBitContext *gb, FLACFrameInfo *fi, int log_level_offset)
Validate and decode a frame header.
int ff_flac_is_extradata_valid(AVCodecContext *avctx, uint8_t **streaminfo_start)
Validate the FLAC extradata.
static int64_t get_utf8(GetBitContext *gb)
static const int8_t sample_size_table[]
void ff_flac_set_channel_layout(AVCodecContext *avctx, int channels)
int ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, const uint8_t *buffer)
Parse the Streaminfo metadata block.
static const AVChannelLayout flac_channel_layouts[8]
FLAC (Free Lossless Audio Codec) common stuff.
@ FLAC_CHMODE_INDEPENDENT
#define FLAC_MIN_BLOCKSIZE
#define FLAC_MAX_CHANNELS
#define FLAC_STREAMINFO_SIZE
FLAC (Free Lossless Audio Codec) decoder/parser common functions.
const int ff_flac_sample_rate_table[16]
const int32_t ff_flac_blocksize_table[16]
bitstream reader API header.
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
static uint64_t get_bits64(GetBitContext *s, int n)
Read 0-64 bits.
static int get_bits_count(const GetBitContext *s)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
#define AV_CHANNEL_LAYOUT_5POINT0
#define AV_CHANNEL_LAYOUT_STEREO
#define AV_CHANNEL_LAYOUT_5POINT1
#define AV_CHANNEL_LAYOUT_MONO
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_SURROUND
#define AV_CHANNEL_LAYOUT_7POINT1
#define AV_CHANNEL_LAYOUT_QUAD
#define AV_CHANNEL_LAYOUT_6POINT1
@ AV_CHANNEL_ORDER_UNSPEC
Only the channel count is specified, without any further information about the channel order.
const AVCRC * av_crc_get_table(AVCRCId crc_id)
Get an initialized standard CRC table.
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)
Calculate the CRC of a block.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define MKTAG(a, b, c, d)
#define FF_ARRAY_ELEMS(a)
An AVChannelLayout holds information about the channel layout of audio data.
enum AVChannelOrder order
Channel order used in this layout.
int nb_channels
Number of channels in this layout.
main external API structure.
AVChannelLayout ch_layout
Audio channel layout.
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
int sample_rate
samples per second
uint8_t * extradata
Out-of-band global headers that may be used by some codecs.
int blocksize
block size of the frame
int channels
number of channels
int samplerate
sample rate
int is_var_size
specifies if the stream uses variable block sizes or a fixed block size; also determines the meaning ...
int64_t frame_or_sample_num
frame number or sample number
int ch_mode
channel decorrelation mode