139341540b153ce6a0b4735095aa2da92b73b913
[ffmpeg.git] / libavcodec / pixdesc.c
1 /*
2  * pixel format descriptor
3  * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
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 #include "libavutil/pixfmt.h"
23 #include "pixdesc.h"
24
25 const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
26     [PIX_FMT_YUV422P] = {
27         .name = "yuv422p",
28         .nb_channels  = 3,
29         .log2_chroma_w= 1,
30         .log2_chroma_h= 0,
31         .comp = {
32             {0,0,1,0,7},        /* Y */
33             {1,0,1,0,7},        /* U */
34             {2,0,1,0,7},        /* V */
35         },
36     },
37     [PIX_FMT_YUV420P] = {
38         .name = "yuv420p",
39         .nb_channels  = 3,
40         .log2_chroma_w= 1,
41         .log2_chroma_h= 1,
42         .comp = {
43             {0,0,1,0,7},        /* Y */
44             {1,0,1,0,7},        /* U */
45             {2,0,1,0,7},        /* V */
46         },
47     },
48     [PIX_FMT_YUV410P] = {
49         .name = "yuv410p",
50         .nb_channels  = 3,
51         .log2_chroma_w= 2,
52         .log2_chroma_h= 2,
53         .comp = {
54             {0,0,1,0,7},        /* Y */
55             {1,0,1,0,7},        /* U */
56             {2,0,1,0,7},        /* V */
57         },
58     },
59     [PIX_FMT_NV12] = {
60         .name = "nv12",
61         .nb_channels  = 3,
62         .log2_chroma_w= 1,
63         .log2_chroma_h= 1,
64         .comp = {
65             {0,0,1,0,7},        /* Y */
66             {1,1,1,0,7},        /* U */
67             {1,1,2,0,7},        /* V */
68         },
69     },
70     [PIX_FMT_YUYV422] = {
71         .name = "yuyv422",
72         .nb_channels  = 3,
73         .log2_chroma_w= 1,
74         .log2_chroma_h= 0,
75         .comp = {
76             {0,1,1,0,7},        /* Y */
77             {0,3,2,0,7},        /* U */
78             {0,3,4,0,7},        /* V */
79         },
80     },
81     [PIX_FMT_UYVY422] = {
82         .name = "uyvy422",
83         .nb_channels  = 3,
84         .log2_chroma_w= 1,
85         .log2_chroma_h= 0,
86         .comp = {
87             {0,1,2,0,7},        /* Y */
88             {0,3,1,0,7},        /* U */
89             {0,3,3,0,7},        /* V */
90         },
91     },
92     [PIX_FMT_GRAY16LE] = {
93         .name = "gray16le",
94         .nb_channels  = 1,
95         .log2_chroma_w= 0,
96         .log2_chroma_h= 0,
97         .comp = {
98             {0,1,1,0,15},       /* Y */
99         },
100     },
101     [PIX_FMT_GRAY16BE] = {
102         .name = "gray16be",
103         .nb_channels  = 1,
104         .log2_chroma_w= 0,
105         .log2_chroma_h= 0,
106         .comp = {
107             {0,1,1,0,15},       /* Y */
108         },
109         .flags = PIX_FMT_BE,
110     },
111     [PIX_FMT_RGB24] = {
112         .name = "rgb24",
113         .nb_channels  = 3,
114         .log2_chroma_w= 0,
115         .log2_chroma_h= 0,
116         .comp = {
117             {0,2,1,0,7},        /* R */
118             {0,2,2,0,7},        /* G */
119             {0,2,3,0,7},        /* B */
120         },
121     },
122     [PIX_FMT_RGBA] = {
123         .name = "rgba",
124         .nb_channels  = 4,
125         .log2_chroma_w= 0,
126         .log2_chroma_h= 0,
127         .comp = {
128             {0,3,1,0,7},        /* R */
129             {0,3,2,0,7},        /* G */
130             {0,3,3,0,7},        /* B */
131             {0,3,4,0,7},        /* A */
132         },
133     },
134     [PIX_FMT_RGB48LE] = {
135         .name = "rgb48le",
136         .nb_channels  = 3,
137         .log2_chroma_w= 0,
138         .log2_chroma_h= 0,
139         .comp = {
140             {0,5,1,0,15},       /* R */
141             {0,5,3,0,15},       /* G */
142             {0,5,5,0,15},       /* B */
143         },
144     },
145     [PIX_FMT_RGB48BE] = {
146         .name = "rgb48be",
147         .nb_channels  = 3,
148         .log2_chroma_w= 0,
149         .log2_chroma_h= 0,
150         .comp = {
151             {0,5,1,0,15},       /* R */
152             {0,5,3,0,15},       /* G */
153             {0,5,5,0,15},       /* B */
154         },
155         .flags = PIX_FMT_BE,
156     },
157     [PIX_FMT_RGB565LE] = {
158         .name = "rgb565le",
159         .nb_channels  = 3,
160         .log2_chroma_w= 0,
161         .log2_chroma_h= 0,
162         .comp = {
163             {0,1,1,0,4},        /* B */
164             {0,1,1,5,5},        /* G */
165             {0,1,2,3,4},        /* R */
166         },
167     },
168     [PIX_FMT_RGB565BE] = {
169         .name = "rgb565be",
170         .nb_channels  = 3,
171         .log2_chroma_w= 0,
172         .log2_chroma_h= 0,
173         .comp = {
174             {0,1,1,0,4},        /* B */
175             {0,1,1,5,5},        /* G */
176             {0,1,0,3,4},        /* R */
177         },
178         .flags = PIX_FMT_BE,
179     },
180     [PIX_FMT_MONOBLACK] = {
181         .name = "monoblack",
182         .nb_channels  = 1,
183         .log2_chroma_w= 0,
184         .log2_chroma_h= 0,
185         .comp = {
186             {0,0,1,7,0},        /* Y */
187         },
188         .flags = PIX_FMT_BITSTREAM,
189     },
190     [PIX_FMT_PAL8] = {
191         .name = "pal8",
192         .nb_channels  = 1,
193         .log2_chroma_w= 0,
194         .log2_chroma_h= 0,
195         .comp = {
196             {0,0,1,0,7},
197         },
198         .flags = PIX_FMT_PAL,
199     },
200 };