FFmpeg  4.3
Data Structures | Macros | Enumerations | Functions
flac.h File Reference
#include "avcodec.h"
#include "bytestream.h"
#include "get_bits.h"

Go to the source code of this file.

Data Structures

struct  FLACStreaminfo
 
struct  FLACFrameInfo
 

Macros

#define FLAC_STREAMINFO_SIZE   34
 
#define FLAC_MAX_CHANNELS   8
 
#define FLAC_MIN_BLOCKSIZE   16
 
#define FLAC_MAX_BLOCKSIZE   65535
 
#define FLAC_MIN_FRAME_SIZE   11
 
#define FLACCOMMONINFO
 bits-per-sample
More...
 
#define FLACSTREAMINFO
 Data needed from the Streaminfo header for use by the raw FLAC demuxer and/or the FLAC decoder. More...
 

Enumerations

enum  { FLAC_CHMODE_INDEPENDENT = 0, FLAC_CHMODE_LEFT_SIDE = 1, FLAC_CHMODE_RIGHT_SIDE = 2, FLAC_CHMODE_MID_SIDE = 3 }
 
enum  {
  FLAC_METADATA_TYPE_STREAMINFO = 0, FLAC_METADATA_TYPE_PADDING, FLAC_METADATA_TYPE_APPLICATION, FLAC_METADATA_TYPE_SEEKTABLE,
  FLAC_METADATA_TYPE_VORBIS_COMMENT, FLAC_METADATA_TYPE_CUESHEET, FLAC_METADATA_TYPE_PICTURE, FLAC_METADATA_TYPE_INVALID = 127
}
 
enum  FLACExtradataFormat { FLAC_EXTRADATA_FORMAT_STREAMINFO = 0, FLAC_EXTRADATA_FORMAT_FULL_HEADER = 1 }
 

Functions

int ff_flac_parse_streaminfo (AVCodecContext *avctx, struct FLACStreaminfo *s, const uint8_t *buffer)
 Parse the Streaminfo metadata block. More...
 
int ff_flac_is_extradata_valid (AVCodecContext *avctx, enum FLACExtradataFormat *format, uint8_t **streaminfo_start)
 Validate the FLAC extradata. More...
 
int ff_flac_get_max_frame_size (int blocksize, int ch, int bps)
 Calculate an estimate for the maximum frame size based on verbatim mode. More...
 
int ff_flac_decode_frame_header (AVCodecContext *avctx, GetBitContext *gb, FLACFrameInfo *fi, int log_level_offset)
 Validate and decode a frame header. More...
 
void ff_flac_set_channel_layout (AVCodecContext *avctx)
 
static av_always_inline void flac_parse_block_header (const uint8_t *block_header, int *last, int *type, int *size)
 Parse the metadata block parameters from the header. More...
 

Detailed Description

FLAC (Free Lossless Audio Codec) decoder/demuxer common functions

Definition in file flac.h.

Macro Definition Documentation

◆ FLAC_STREAMINFO_SIZE

#define FLAC_STREAMINFO_SIZE   34

Definition at line 34 of file flac.h.

◆ FLAC_MAX_CHANNELS

#define FLAC_MAX_CHANNELS   8

Definition at line 35 of file flac.h.

◆ FLAC_MIN_BLOCKSIZE

#define FLAC_MIN_BLOCKSIZE   16

Definition at line 36 of file flac.h.

◆ FLAC_MAX_BLOCKSIZE

#define FLAC_MAX_BLOCKSIZE   65535

Definition at line 37 of file flac.h.

◆ FLAC_MIN_FRAME_SIZE

#define FLAC_MIN_FRAME_SIZE   11

Definition at line 38 of file flac.h.

◆ FLACCOMMONINFO

#define FLACCOMMONINFO
Value:
int samplerate; /**< sample rate */\
int channels; /**< number of channels */\
int bps;

bits-per-sample

Definition at line 63 of file flac.h.

◆ FLACSTREAMINFO

#define FLACSTREAMINFO
Value:
FLACCOMMONINFO \
int max_blocksize; /**< maximum block size, in samples */\
int max_framesize; /**< maximum frame size, in bytes */\
int64_t samples;

Data needed from the Streaminfo header for use by the raw FLAC demuxer and/or the FLAC decoder.

total number of samples

Definition at line 73 of file flac.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FLAC_CHMODE_INDEPENDENT 
FLAC_CHMODE_LEFT_SIDE 
FLAC_CHMODE_RIGHT_SIDE 
FLAC_CHMODE_MID_SIDE 

Definition at line 40 of file flac.h.

◆ anonymous enum

anonymous enum
Enumerator
FLAC_METADATA_TYPE_STREAMINFO 
FLAC_METADATA_TYPE_PADDING 
FLAC_METADATA_TYPE_APPLICATION 
FLAC_METADATA_TYPE_SEEKTABLE 
FLAC_METADATA_TYPE_VORBIS_COMMENT 
FLAC_METADATA_TYPE_CUESHEET 
FLAC_METADATA_TYPE_PICTURE 
FLAC_METADATA_TYPE_INVALID 

Definition at line 47 of file flac.h.

◆ FLACExtradataFormat

Enumerator
FLAC_EXTRADATA_FORMAT_STREAMINFO 
FLAC_EXTRADATA_FORMAT_FULL_HEADER 

Definition at line 58 of file flac.h.

Function Documentation

◆ ff_flac_parse_streaminfo()

int ff_flac_parse_streaminfo ( AVCodecContext avctx,
struct FLACStreaminfo s,
const uint8_t buffer 
)

Parse the Streaminfo metadata block.

Parameters
[out]avctxcodec context to set basic stream parameters
[out]swhere parsed information is stored
[in]bufferpointer to start of 34-byte streaminfo data
Returns
negative error code on faiure or >= 0 on success

Definition at line 204 of file flac.c.

Referenced by flac_decode_init(), and parse_streaminfo().

◆ ff_flac_is_extradata_valid()

int ff_flac_is_extradata_valid ( AVCodecContext avctx,
enum FLACExtradataFormat format,
uint8_t **  streaminfo_start 
)

Validate the FLAC extradata.

Parameters
[in]avctxcodec context containing the extradata.
[out]formatextradata format.
[out]streaminfo_startpointer to start of 34-byte STREAMINFO data.
Returns
1 if valid, 0 if not valid.

Definition at line 169 of file flac.c.

Referenced by flac_decode_init().

◆ ff_flac_get_max_frame_size()

int ff_flac_get_max_frame_size ( int  blocksize,
int  ch,
int  bps 
)

Calculate an estimate for the maximum frame size based on verbatim mode.

Parameters
blocksizeblock size, in samples
chnumber of channels
bpsbits-per-sample

Definition at line 148 of file flac.c.

Referenced by flac_decode_frame(), flac_encode_frame(), and flac_encode_init().

◆ ff_flac_decode_frame_header()

int ff_flac_decode_frame_header ( AVCodecContext avctx,
GetBitContext gb,
FLACFrameInfo fi,
int  log_level_offset 
)

Validate and decode a frame header.

Parameters
avctxAVCodecContext to use as av_log() context
gbGetBitContext from which to read frame header
[out]fiframe information
log_level_offsetlog level offset. can be used to silence error messages.
Returns
non-zero on error, 0 if ok

Definition at line 50 of file flac.c.

Referenced by decode_frame(), and frame_header_is_valid().

◆ ff_flac_set_channel_layout()

void ff_flac_set_channel_layout ( AVCodecContext avctx)

Definition at line 196 of file flac.c.

Referenced by decode_frame(), ff_flac_parse_streaminfo(), and get_best_header().

◆ flac_parse_block_header()

static av_always_inline void flac_parse_block_header ( const uint8_t block_header,
int last,
int type,
int size 
)
static

Parse the metadata block parameters from the header.

Parameters
[in]block_headerheader data, at least 4 bytes
[out]lastindicator for last metadata block
[out]typemetadata block type
[out]sizemetadata block size

Definition at line 145 of file flac.h.

Referenced by flac_read_header(), get_metadata_size(), mov_read_dfla(), and parse_streaminfo().

samples
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new samples
Definition: fate.txt:139
channels
channels
Definition: aptx.h:33
bps
unsigned bps
Definition: movenc.c:1533