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