FFmpeg
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
libavcodec
dca.h
Go to the documentation of this file.
1
/*
2
* DCA compatible decoder
3
* Copyright (C) 2004 Gildas Bazin
4
* Copyright (C) 2004 Benjamin Zores
5
* Copyright (C) 2006 Benjamin Larsson
6
* Copyright (C) 2007 Konstantin Shishkov
7
* Copyright (C) 2016 foo86
8
*
9
* This file is part of FFmpeg.
10
*
11
* FFmpeg is free software; you can redistribute it and/or
12
* modify it under the terms of the GNU Lesser General Public
13
* License as published by the Free Software Foundation; either
14
* version 2.1 of the License, or (at your option) any later version.
15
*
16
* FFmpeg is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19
* Lesser General Public License for more details.
20
*
21
* You should have received a copy of the GNU Lesser General Public
22
* License along with FFmpeg; if not, write to the Free Software
23
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24
*/
25
26
#ifndef AVCODEC_DCA_H
27
#define AVCODEC_DCA_H
28
29
#include <stdint.h>
30
31
#include "
libavutil/common.h
"
32
#include "
libavutil/internal.h
"
33
#include "
libavutil/intreadwrite.h
"
34
35
enum
DCASpeaker
{
36
DCA_SPEAKER_C
,
DCA_SPEAKER_L
,
DCA_SPEAKER_R
,
DCA_SPEAKER_Ls
,
37
DCA_SPEAKER_Rs
,
DCA_SPEAKER_LFE1
,
DCA_SPEAKER_Cs
,
DCA_SPEAKER_Lsr
,
38
DCA_SPEAKER_Rsr
,
DCA_SPEAKER_Lss
,
DCA_SPEAKER_Rss
,
DCA_SPEAKER_Lc
,
39
DCA_SPEAKER_Rc
,
DCA_SPEAKER_Lh
,
DCA_SPEAKER_Ch
,
DCA_SPEAKER_Rh
,
40
DCA_SPEAKER_LFE2
,
DCA_SPEAKER_Lw
,
DCA_SPEAKER_Rw
,
DCA_SPEAKER_Oh
,
41
DCA_SPEAKER_Lhs
,
DCA_SPEAKER_Rhs
,
DCA_SPEAKER_Chr
,
DCA_SPEAKER_Lhr
,
42
DCA_SPEAKER_Rhr
,
DCA_SPEAKER_Cl
,
DCA_SPEAKER_Ll
,
DCA_SPEAKER_Rl
,
43
DCA_SPEAKER_RSV1
,
DCA_SPEAKER_RSV2
,
DCA_SPEAKER_RSV3
,
DCA_SPEAKER_RSV4
,
44
45
DCA_SPEAKER_COUNT
46
};
47
48
enum
DCASpeakerMask
{
49
DCA_SPEAKER_MASK_C
= 0x00000001,
50
DCA_SPEAKER_MASK_L
= 0x00000002,
51
DCA_SPEAKER_MASK_R
= 0x00000004,
52
DCA_SPEAKER_MASK_Ls
= 0x00000008,
53
DCA_SPEAKER_MASK_Rs
= 0x00000010,
54
DCA_SPEAKER_MASK_LFE1
= 0x00000020,
55
DCA_SPEAKER_MASK_Cs
= 0x00000040,
56
DCA_SPEAKER_MASK_Lsr
= 0x00000080,
57
DCA_SPEAKER_MASK_Rsr
= 0x00000100,
58
DCA_SPEAKER_MASK_Lss
= 0x00000200,
59
DCA_SPEAKER_MASK_Rss
= 0x00000400,
60
DCA_SPEAKER_MASK_Lc
= 0x00000800,
61
DCA_SPEAKER_MASK_Rc
= 0x00001000,
62
DCA_SPEAKER_MASK_Lh
= 0x00002000,
63
DCA_SPEAKER_MASK_Ch
= 0x00004000,
64
DCA_SPEAKER_MASK_Rh
= 0x00008000,
65
DCA_SPEAKER_MASK_LFE2
= 0x00010000,
66
DCA_SPEAKER_MASK_Lw
= 0x00020000,
67
DCA_SPEAKER_MASK_Rw
= 0x00040000,
68
DCA_SPEAKER_MASK_Oh
= 0x00080000,
69
DCA_SPEAKER_MASK_Lhs
= 0x00100000,
70
DCA_SPEAKER_MASK_Rhs
= 0x00200000,
71
DCA_SPEAKER_MASK_Chr
= 0x00400000,
72
DCA_SPEAKER_MASK_Lhr
= 0x00800000,
73
DCA_SPEAKER_MASK_Rhr
= 0x01000000,
74
DCA_SPEAKER_MASK_Cl
= 0x02000000,
75
DCA_SPEAKER_MASK_Ll
= 0x04000000,
76
DCA_SPEAKER_MASK_Rl
= 0x08000000,
77
};
78
79
#define DCA_SPEAKER_LAYOUT_MONO (DCA_SPEAKER_MASK_C)
80
#define DCA_SPEAKER_LAYOUT_STEREO (DCA_SPEAKER_MASK_L | DCA_SPEAKER_MASK_R)
81
#define DCA_SPEAKER_LAYOUT_2POINT1 (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_LFE1)
82
#define DCA_SPEAKER_LAYOUT_3_0 (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_C)
83
#define DCA_SPEAKER_LAYOUT_2_1 (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_Cs)
84
#define DCA_SPEAKER_LAYOUT_3_1 (DCA_SPEAKER_LAYOUT_3_0 | DCA_SPEAKER_MASK_Cs)
85
#define DCA_SPEAKER_LAYOUT_2_2 (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_Ls | DCA_SPEAKER_MASK_Rs)
86
#define DCA_SPEAKER_LAYOUT_5POINT0 (DCA_SPEAKER_LAYOUT_3_0 | DCA_SPEAKER_MASK_Ls | DCA_SPEAKER_MASK_Rs)
87
#define DCA_SPEAKER_LAYOUT_5POINT1 (DCA_SPEAKER_LAYOUT_5POINT0 | DCA_SPEAKER_MASK_LFE1)
88
#define DCA_SPEAKER_LAYOUT_7POINT0_WIDE (DCA_SPEAKER_LAYOUT_5POINT0 | DCA_SPEAKER_MASK_Lw | DCA_SPEAKER_MASK_Rw)
89
#define DCA_SPEAKER_LAYOUT_7POINT1_WIDE (DCA_SPEAKER_LAYOUT_7POINT0_WIDE | DCA_SPEAKER_MASK_LFE1)
90
91
#define DCA_HAS_STEREO(mask) \
92
((mask & DCA_SPEAKER_LAYOUT_STEREO) == DCA_SPEAKER_LAYOUT_STEREO)
93
94
enum
DCASpeakerPair
{
95
DCA_SPEAKER_PAIR_C
= 0x0001,
96
DCA_SPEAKER_PAIR_LR
= 0x0002,
97
DCA_SPEAKER_PAIR_LsRs
= 0x0004,
98
DCA_SPEAKER_PAIR_LFE1
= 0x0008,
99
DCA_SPEAKER_PAIR_Cs
= 0x0010,
100
DCA_SPEAKER_PAIR_LhRh
= 0x0020,
101
DCA_SPEAKER_PAIR_LsrRsr
= 0x0040,
102
DCA_SPEAKER_PAIR_Ch
= 0x0080,
103
DCA_SPEAKER_PAIR_Oh
= 0x0100,
104
DCA_SPEAKER_PAIR_LcRc
= 0x0200,
105
DCA_SPEAKER_PAIR_LwRw
= 0x0400,
106
DCA_SPEAKER_PAIR_LssRss
= 0x0800,
107
DCA_SPEAKER_PAIR_LFE2
= 0x1000,
108
DCA_SPEAKER_PAIR_LhsRhs
= 0x2000,
109
DCA_SPEAKER_PAIR_Chr
= 0x4000,
110
DCA_SPEAKER_PAIR_LhrRhr
= 0x8000
111
};
112
113
/**
114
* Return number of individual channels in DCASpeakerPair mask
115
*/
116
static
inline
int
ff_dca_count_chs_for_mask
(
unsigned
int
mask
)
117
{
118
return
av_popcount((mask & 0xffff) | ((mask & 0xae66) << 16));
119
}
120
121
enum
DCARepresentationType
{
122
DCA_REPR_TYPE_LtRt
= 2,
123
DCA_REPR_TYPE_LhRh
= 3
124
};
125
126
enum
DCAExtensionMask
{
127
DCA_CSS_CORE
= 0x001,
128
DCA_CSS_XXCH
= 0x002,
129
DCA_CSS_X96
= 0x004,
130
DCA_CSS_XCH
= 0x008,
131
DCA_CSS_MASK
= 0x00f,
132
DCA_EXSS_CORE
= 0x010,
133
DCA_EXSS_XBR
= 0x020,
134
DCA_EXSS_XXCH
= 0x040,
135
DCA_EXSS_X96
= 0x080,
136
DCA_EXSS_LBR
= 0x100,
137
DCA_EXSS_XLL
= 0x200,
138
DCA_EXSS_RSV1
= 0x400,
139
DCA_EXSS_RSV2
= 0x800,
140
DCA_EXSS_MASK
= 0xff0,
141
};
142
143
enum
DCADownMixType
{
144
DCA_DMIX_TYPE_1_0
,
145
DCA_DMIX_TYPE_LoRo
,
146
DCA_DMIX_TYPE_LtRt
,
147
DCA_DMIX_TYPE_3_0
,
148
DCA_DMIX_TYPE_2_1
,
149
DCA_DMIX_TYPE_2_2
,
150
DCA_DMIX_TYPE_3_1
,
151
152
DCA_DMIX_TYPE_COUNT
153
};
154
155
extern
av_export
const
uint32_t
avpriv_dca_sample_rates
[16];
156
157
extern
const
uint32_t
ff_dca_sampling_freqs
[16];
158
extern
const
uint8_t
ff_dca_freq_ranges
[16];
159
160
/**
161
* Convert bitstream to one representation based on sync marker
162
*/
163
int
avpriv_dca_convert_bitstream
(
const
uint8_t
*
src
,
int
src_size,
uint8_t
*dst,
164
int
max_size);
165
166
#endif
/* AVCODEC_DCA_H */
DCA_CSS_MASK
Definition:
dca.h:131
DCA_REPR_TYPE_LhRh
Definition:
dca.h:123
DCA_SPEAKER_Rh
Definition:
dca.h:39
DCA_SPEAKER_Cl
Definition:
dca.h:42
DCA_EXSS_XBR
Definition:
dca.h:133
DCA_SPEAKER_RSV2
Definition:
dca.h:43
DCA_SPEAKER_Lhr
Definition:
dca.h:41
DCA_SPEAKER_MASK_Oh
Definition:
dca.h:68
DCA_DMIX_TYPE_3_0
Definition:
dca.h:147
DCASpeaker
DCASpeaker
Definition:
dca.h:35
DCA_CSS_XXCH
Definition:
dca.h:128
DCA_SPEAKER_Ls
Definition:
dca.h:36
DCA_SPEAKER_MASK_Lhs
Definition:
dca.h:69
DCA_EXSS_XLL
Definition:
dca.h:137
DCA_DMIX_TYPE_COUNT
Definition:
dca.h:152
DCA_EXSS_MASK
Definition:
dca.h:140
DCA_SPEAKER_MASK_Rhr
Definition:
dca.h:73
DCA_SPEAKER_MASK_Rss
Definition:
dca.h:59
DCA_SPEAKER_MASK_Ll
Definition:
dca.h:75
DCARepresentationType
DCARepresentationType
Definition:
dca.h:121
DCA_SPEAKER_PAIR_Cs
Definition:
dca.h:99
DCA_SPEAKER_C
Definition:
dca.h:36
DCA_SPEAKER_RSV1
Definition:
dca.h:43
DCA_SPEAKER_Rhs
Definition:
dca.h:41
DCA_SPEAKER_Oh
Definition:
dca.h:40
DCA_SPEAKER_MASK_Ls
Definition:
dca.h:52
DCA_SPEAKER_PAIR_LsRs
Definition:
dca.h:97
DCA_DMIX_TYPE_LtRt
Definition:
dca.h:146
uint8_t
uint8_t
Definition:
audio_convert.c:194
DCA_EXSS_XXCH
Definition:
dca.h:134
DCA_SPEAKER_L
Definition:
dca.h:36
DCA_SPEAKER_MASK_Lc
Definition:
dca.h:60
DCA_EXSS_X96
Definition:
dca.h:135
DCA_SPEAKER_MASK_Rw
Definition:
dca.h:67
DCA_SPEAKER_PAIR_LR
Definition:
dca.h:96
DCASpeakerPair
DCASpeakerPair
Definition:
dca.h:94
DCA_SPEAKER_PAIR_LssRss
Definition:
dca.h:106
DCA_SPEAKER_PAIR_LsrRsr
Definition:
dca.h:101
DCA_SPEAKER_MASK_LFE1
Definition:
dca.h:54
DCA_SPEAKER_Lss
Definition:
dca.h:38
avpriv_dca_convert_bitstream
int avpriv_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst, int max_size)
Convert bitstream to one representation based on sync marker.
Definition:
dca.c:48
DCA_SPEAKER_PAIR_LhrRhr
Definition:
dca.h:110
DCA_SPEAKER_Lc
Definition:
dca.h:38
DCA_SPEAKER_Chr
Definition:
dca.h:41
DCA_SPEAKER_PAIR_LwRw
Definition:
dca.h:105
DCA_SPEAKER_MASK_Rsr
Definition:
dca.h:57
DCA_SPEAKER_MASK_Rh
Definition:
dca.h:64
DCA_CSS_XCH
Definition:
dca.h:130
DCA_SPEAKER_Rw
Definition:
dca.h:40
DCA_SPEAKER_Lhs
Definition:
dca.h:41
mask
static const uint16_t mask[17]
Definition:
lzw.c:38
ff_dca_freq_ranges
const uint8_t ff_dca_freq_ranges[16]
Definition:
dca.c:44
DCA_SPEAKER_Rc
Definition:
dca.h:39
DCA_SPEAKER_PAIR_Chr
Definition:
dca.h:109
DCA_SPEAKER_R
Definition:
dca.h:36
DCA_SPEAKER_Rss
Definition:
dca.h:38
DCA_SPEAKER_Rsr
Definition:
dca.h:38
DCA_SPEAKER_Rhr
Definition:
dca.h:42
internal.h
common internal API header
DCA_SPEAKER_MASK_Lss
Definition:
dca.h:58
DCA_SPEAKER_PAIR_LFE2
Definition:
dca.h:107
avpriv_dca_sample_rates
av_export const uint32_t avpriv_dca_sample_rates[16]
Definition:
dca.c:34
intreadwrite.h
DCA_SPEAKER_MASK_Lhr
Definition:
dca.h:72
DCA_EXSS_RSV2
Definition:
dca.h:139
DCA_SPEAKER_PAIR_Ch
Definition:
dca.h:102
DCA_SPEAKER_MASK_Rs
Definition:
dca.h:53
DCA_SPEAKER_MASK_Lh
Definition:
dca.h:62
DCA_SPEAKER_Ll
Definition:
dca.h:42
src
#define src
Definition:
vp9dsp.c:530
DCA_SPEAKER_RSV4
Definition:
dca.h:43
DCA_SPEAKER_MASK_Rc
Definition:
dca.h:61
DCA_SPEAKER_Rs
Definition:
dca.h:37
DCA_SPEAKER_PAIR_LhsRhs
Definition:
dca.h:108
av_export
#define av_export
Definition:
internal.h:65
DCA_SPEAKER_MASK_Ch
Definition:
dca.h:63
DCA_SPEAKER_Lsr
Definition:
dca.h:37
DCA_REPR_TYPE_LtRt
Definition:
dca.h:122
DCA_SPEAKER_Lw
Definition:
dca.h:40
DCA_SPEAKER_MASK_R
Definition:
dca.h:51
DCA_SPEAKER_MASK_L
Definition:
dca.h:50
DCA_SPEAKER_COUNT
Definition:
dca.h:45
DCA_SPEAKER_Rl
Definition:
dca.h:42
DCA_EXSS_LBR
Definition:
dca.h:136
DCA_SPEAKER_MASK_C
Definition:
dca.h:49
DCA_DMIX_TYPE_LoRo
Definition:
dca.h:145
DCA_SPEAKER_MASK_Cl
Definition:
dca.h:74
DCA_SPEAKER_MASK_Rl
Definition:
dca.h:76
DCA_DMIX_TYPE_2_1
Definition:
dca.h:148
DCA_CSS_X96
Definition:
dca.h:129
ff_dca_count_chs_for_mask
static int ff_dca_count_chs_for_mask(unsigned int mask)
Return number of individual channels in DCASpeakerPair mask.
Definition:
dca.h:116
DCA_DMIX_TYPE_1_0
Definition:
dca.h:144
DCA_SPEAKER_MASK_Lw
Definition:
dca.h:66
DCA_CSS_CORE
Definition:
dca.h:127
DCA_DMIX_TYPE_3_1
Definition:
dca.h:150
DCA_SPEAKER_Ch
Definition:
dca.h:39
common.h
common internal and external API header
DCA_SPEAKER_LFE1
Definition:
dca.h:37
DCA_SPEAKER_MASK_Cs
Definition:
dca.h:55
DCA_SPEAKER_MASK_Rhs
Definition:
dca.h:70
DCA_SPEAKER_PAIR_LcRc
Definition:
dca.h:104
DCA_SPEAKER_PAIR_Oh
Definition:
dca.h:103
DCAExtensionMask
DCAExtensionMask
Definition:
dca.h:126
DCA_SPEAKER_Cs
Definition:
dca.h:37
ff_dca_sampling_freqs
const uint32_t ff_dca_sampling_freqs[16]
Definition:
dca.c:39
DCA_SPEAKER_PAIR_LFE1
Definition:
dca.h:98
DCA_DMIX_TYPE_2_2
Definition:
dca.h:149
DCADownMixType
DCADownMixType
Definition:
dca.h:143
DCA_SPEAKER_LFE2
Definition:
dca.h:40
DCA_SPEAKER_MASK_Chr
Definition:
dca.h:71
DCA_SPEAKER_PAIR_C
Definition:
dca.h:95
DCASpeakerMask
DCASpeakerMask
Definition:
dca.h:48
DCA_SPEAKER_Lh
Definition:
dca.h:39
DCA_EXSS_CORE
Definition:
dca.h:132
DCA_SPEAKER_MASK_Lsr
Definition:
dca.h:56
DCA_SPEAKER_PAIR_LhRh
Definition:
dca.h:100
DCA_SPEAKER_MASK_LFE2
Definition:
dca.h:65
DCA_EXSS_RSV1
Definition:
dca.h:138
DCA_SPEAKER_RSV3
Definition:
dca.h:43
Generated on Mon Jun 27 2016 02:34:34 for FFmpeg by
1.8.6