FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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/internal.h"
32 #include "libavutil/intreadwrite.h"
33 
34 enum DCASpeaker {
43 
45 };
46 
48  DCA_SPEAKER_MASK_C = 0x00000001,
49  DCA_SPEAKER_MASK_L = 0x00000002,
50  DCA_SPEAKER_MASK_R = 0x00000004,
51  DCA_SPEAKER_MASK_Ls = 0x00000008,
52  DCA_SPEAKER_MASK_Rs = 0x00000010,
53  DCA_SPEAKER_MASK_LFE1 = 0x00000020,
54  DCA_SPEAKER_MASK_Cs = 0x00000040,
55  DCA_SPEAKER_MASK_Lsr = 0x00000080,
56  DCA_SPEAKER_MASK_Rsr = 0x00000100,
57  DCA_SPEAKER_MASK_Lss = 0x00000200,
58  DCA_SPEAKER_MASK_Rss = 0x00000400,
59  DCA_SPEAKER_MASK_Lc = 0x00000800,
60  DCA_SPEAKER_MASK_Rc = 0x00001000,
61  DCA_SPEAKER_MASK_Lh = 0x00002000,
62  DCA_SPEAKER_MASK_Ch = 0x00004000,
63  DCA_SPEAKER_MASK_Rh = 0x00008000,
64  DCA_SPEAKER_MASK_LFE2 = 0x00010000,
65  DCA_SPEAKER_MASK_Lw = 0x00020000,
66  DCA_SPEAKER_MASK_Rw = 0x00040000,
67  DCA_SPEAKER_MASK_Oh = 0x00080000,
68  DCA_SPEAKER_MASK_Lhs = 0x00100000,
69  DCA_SPEAKER_MASK_Rhs = 0x00200000,
70  DCA_SPEAKER_MASK_Chr = 0x00400000,
71  DCA_SPEAKER_MASK_Lhr = 0x00800000,
72  DCA_SPEAKER_MASK_Rhr = 0x01000000,
73  DCA_SPEAKER_MASK_Cl = 0x02000000,
74  DCA_SPEAKER_MASK_Ll = 0x04000000,
75  DCA_SPEAKER_MASK_Rl = 0x08000000,
76 };
77 
78 #define DCA_SPEAKER_LAYOUT_MONO (DCA_SPEAKER_MASK_C)
79 #define DCA_SPEAKER_LAYOUT_STEREO (DCA_SPEAKER_MASK_L | DCA_SPEAKER_MASK_R)
80 #define DCA_SPEAKER_LAYOUT_2POINT1 (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_LFE1)
81 #define DCA_SPEAKER_LAYOUT_3_0 (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_C)
82 #define DCA_SPEAKER_LAYOUT_2_1 (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_Cs)
83 #define DCA_SPEAKER_LAYOUT_3_1 (DCA_SPEAKER_LAYOUT_3_0 | DCA_SPEAKER_MASK_Cs)
84 #define DCA_SPEAKER_LAYOUT_2_2 (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_Ls | DCA_SPEAKER_MASK_Rs)
85 #define DCA_SPEAKER_LAYOUT_5POINT0 (DCA_SPEAKER_LAYOUT_3_0 | DCA_SPEAKER_MASK_Ls | DCA_SPEAKER_MASK_Rs)
86 #define DCA_SPEAKER_LAYOUT_5POINT1 (DCA_SPEAKER_LAYOUT_5POINT0 | DCA_SPEAKER_MASK_LFE1)
87 #define DCA_SPEAKER_LAYOUT_7POINT0_WIDE (DCA_SPEAKER_LAYOUT_5POINT0 | DCA_SPEAKER_MASK_Lw | DCA_SPEAKER_MASK_Rw)
88 #define DCA_SPEAKER_LAYOUT_7POINT1_WIDE (DCA_SPEAKER_LAYOUT_7POINT0_WIDE | DCA_SPEAKER_MASK_LFE1)
89 
90 #define DCA_HAS_STEREO(mask) \
91  ((mask & DCA_SPEAKER_LAYOUT_STEREO) == DCA_SPEAKER_LAYOUT_STEREO)
92 
96 };
97 
99  DCA_CSS_CORE = 0x001,
100  DCA_CSS_XXCH = 0x002,
101  DCA_CSS_X96 = 0x004,
102  DCA_CSS_XCH = 0x008,
103  DCA_CSS_MASK = 0x00f,
104  DCA_EXSS_CORE = 0x010,
105  DCA_EXSS_XBR = 0x020,
106  DCA_EXSS_XXCH = 0x040,
107  DCA_EXSS_X96 = 0x080,
108  DCA_EXSS_LBR = 0x100,
109  DCA_EXSS_XLL = 0x200,
110  DCA_EXSS_RSV1 = 0x400,
111  DCA_EXSS_RSV2 = 0x800,
112  DCA_EXSS_MASK = 0xff0,
113 };
114 
123 
125 };
126 
127 extern av_export const uint32_t avpriv_dca_sample_rates[16];
128 
129 /**
130  * Convert bitstream to one representation based on sync marker
131  */
132 int avpriv_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst,
133  int max_size);
134 
135 #endif /* AVCODEC_DCA_H */
DCASpeaker
Definition: dca.h:34
DCARepresentationType
Definition: dca.h:93
uint8_t
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:39
common internal API header
av_export const uint32_t avpriv_dca_sample_rates[16]
Definition: dca.c:34
#define src
Definition: vp9dsp.c:530
#define av_export
Definition: internal.h:65
DCAExtensionMask
Definition: dca.h:98
DCADownMixType
Definition: dca.h:115
DCASpeakerMask
Definition: dca.h:47