FFmpeg
libavcodec
flac.h
Go to the documentation of this file.
1
/*
2
* FLAC (Free Lossless Audio Codec) common stuff
3
* Copyright (c) 2008 Justin Ruggles
4
*
5
* This file is part of FFmpeg.
6
*
7
* FFmpeg is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2.1 of the License, or (at your option) any later version.
11
*
12
* FFmpeg is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
16
*
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with FFmpeg; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
*/
21
22
/**
23
* @file
24
* FLAC (Free Lossless Audio Codec) common stuff
25
*/
26
27
#ifndef AVCODEC_FLAC_H
28
#define AVCODEC_FLAC_H
29
30
#include "
libavutil/intreadwrite.h
"
31
32
#define FLAC_STREAMINFO_SIZE 34
33
#define FLAC_MAX_CHANNELS 8
34
#define FLAC_MIN_BLOCKSIZE 16
35
#define FLAC_MAX_BLOCKSIZE 65535
36
#define FLAC_MIN_FRAME_SIZE 10
37
38
enum
{
39
FLAC_CHMODE_INDEPENDENT
= 0,
40
FLAC_CHMODE_LEFT_SIDE
= 1,
41
FLAC_CHMODE_RIGHT_SIDE
= 2,
42
FLAC_CHMODE_MID_SIDE
= 3,
43
};
44
45
enum
{
46
FLAC_METADATA_TYPE_STREAMINFO
= 0,
47
FLAC_METADATA_TYPE_PADDING
,
48
FLAC_METADATA_TYPE_APPLICATION
,
49
FLAC_METADATA_TYPE_SEEKTABLE
,
50
FLAC_METADATA_TYPE_VORBIS_COMMENT
,
51
FLAC_METADATA_TYPE_CUESHEET
,
52
FLAC_METADATA_TYPE_PICTURE
,
53
FLAC_METADATA_TYPE_INVALID
= 127
54
};
55
56
/**
57
* Parse the metadata block parameters from the header.
58
* @param[in] block_header header data, at least 4 bytes
59
* @param[out] last indicator for last metadata block
60
* @param[out] type metadata block type
61
* @param[out] size metadata block size
62
*/
63
static
av_always_inline
void
flac_parse_block_header
(
const
uint8_t *block_header,
64
int
*last,
int
*
type
,
int
*
size
)
65
{
66
int
tmp
= *block_header;
67
if
(last)
68
*last =
tmp
& 0x80;
69
if
(
type
)
70
*
type
=
tmp
& 0x7F;
71
if
(
size
)
72
*
size
=
AV_RB24
(block_header + 1);
73
}
74
75
#endif
/* AVCODEC_FLAC_H */
tmp
static uint8_t tmp[11]
Definition:
aes_ctr.c:28
FLAC_METADATA_TYPE_INVALID
@ FLAC_METADATA_TYPE_INVALID
Definition:
flac.h:53
FLAC_CHMODE_MID_SIDE
@ FLAC_CHMODE_MID_SIDE
Definition:
flac.h:42
FLAC_CHMODE_RIGHT_SIDE
@ FLAC_CHMODE_RIGHT_SIDE
Definition:
flac.h:41
FLAC_METADATA_TYPE_CUESHEET
@ FLAC_METADATA_TYPE_CUESHEET
Definition:
flac.h:51
FLAC_METADATA_TYPE_VORBIS_COMMENT
@ FLAC_METADATA_TYPE_VORBIS_COMMENT
Definition:
flac.h:50
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition:
writing_filters.txt:86
FLAC_METADATA_TYPE_STREAMINFO
@ FLAC_METADATA_TYPE_STREAMINFO
Definition:
flac.h:46
intreadwrite.h
FLAC_METADATA_TYPE_PADDING
@ FLAC_METADATA_TYPE_PADDING
Definition:
flac.h:47
FLAC_METADATA_TYPE_SEEKTABLE
@ FLAC_METADATA_TYPE_SEEKTABLE
Definition:
flac.h:49
FLAC_METADATA_TYPE_PICTURE
@ FLAC_METADATA_TYPE_PICTURE
Definition:
flac.h:52
flac_parse_block_header
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.
Definition:
flac.h:63
FLAC_CHMODE_LEFT_SIDE
@ FLAC_CHMODE_LEFT_SIDE
Definition:
flac.h:40
size
int size
Definition:
twinvq_data.h:10344
av_always_inline
#define av_always_inline
Definition:
attributes.h:49
FLAC_METADATA_TYPE_APPLICATION
@ FLAC_METADATA_TYPE_APPLICATION
Definition:
flac.h:48
FLAC_CHMODE_INDEPENDENT
@ FLAC_CHMODE_INDEPENDENT
Definition:
flac.h:39
AV_RB24
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_RB24
Definition:
bytestream.h:97
Generated on Sun Nov 24 2024 19:21:35 for FFmpeg by
1.8.17