Get rid of monstrous static table and initialize VLCs for RV3/4 dynamically.
[libav.git] / libavcodec / pixdesc.c
CommitLineData
9b61d838 1/*
e0cffbe7 2 * pixel format descriptor
9b61d838
MN
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
d2863e72 25const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
bcbd9a14
SS
26 [PIX_FMT_YUV420P] = {
27 .name = "yuv420p",
9b61d838
MN
28 .nb_channels = 3,
29 .log2_chroma_w= 1,
bcbd9a14 30 .log2_chroma_h= 1,
9b61d838 31 .comp = {
eb39fb51
SS
32 {0,0,1,0,7}, /* Y */
33 {1,0,1,0,7}, /* U */
34 {2,0,1,0,7}, /* V */
9b61d838
MN
35 },
36 },
bcbd9a14
SS
37 [PIX_FMT_YUYV422] = {
38 .name = "yuyv422",
9b61d838
MN
39 .nb_channels = 3,
40 .log2_chroma_w= 1,
bcbd9a14
SS
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,
9b61d838 64 .comp = {
eb39fb51
SS
65 {0,0,1,0,7}, /* Y */
66 {1,0,1,0,7}, /* U */
67 {2,0,1,0,7}, /* V */
9b61d838
MN
68 },
69 },
70 [PIX_FMT_YUV410P] = {
1e896640 71 .name = "yuv410p",
9b61d838
MN
72 .nb_channels = 3,
73 .log2_chroma_w= 2,
74 .log2_chroma_h= 2,
75 .comp = {
eb39fb51
SS
76 {0,0,1,0,7}, /* Y */
77 {1,0,1,0,7}, /* U */
78 {2,0,1,0,7}, /* V */
9b61d838
MN
79 },
80 },
bcbd9a14
SS
81 [PIX_FMT_MONOBLACK] = {
82 .name = "monoblack",
83 .nb_channels = 1,
84 .log2_chroma_w= 0,
85 .log2_chroma_h= 0,
9b61d838 86 .comp = {
bcbd9a14 87 {0,0,1,7,0}, /* Y */
9b61d838 88 },
bcbd9a14 89 .flags = PIX_FMT_BITSTREAM,
9b61d838 90 },
bcbd9a14
SS
91 [PIX_FMT_PAL8] = {
92 .name = "pal8",
93 .nb_channels = 1,
94 .log2_chroma_w= 0,
9b61d838
MN
95 .log2_chroma_h= 0,
96 .comp = {
bcbd9a14 97 {0,0,1,0,7},
9b61d838 98 },
bcbd9a14 99 .flags = PIX_FMT_PAL,
9b61d838
MN
100 },
101 [PIX_FMT_UYVY422] = {
1e896640 102 .name = "uyvy422",
9b61d838
MN
103 .nb_channels = 3,
104 .log2_chroma_w= 1,
105 .log2_chroma_h= 0,
106 .comp = {
eb39fb51
SS
107 {0,1,2,0,7}, /* Y */
108 {0,3,1,0,7}, /* U */
109 {0,3,3,0,7}, /* V */
9b61d838
MN
110 },
111 },
bcbd9a14
SS
112 [PIX_FMT_NV12] = {
113 .name = "nv12",
9b61d838 114 .nb_channels = 3,
bcbd9a14
SS
115 .log2_chroma_w= 1,
116 .log2_chroma_h= 1,
9b61d838 117 .comp = {
bcbd9a14
SS
118 {0,0,1,0,7}, /* Y */
119 {1,1,1,0,7}, /* U */
120 {1,1,2,0,7}, /* V */
9b61d838
MN
121 },
122 },
123 [PIX_FMT_RGBA] = {
1e896640 124 .name = "rgba",
9b61d838
MN
125 .nb_channels = 4,
126 .log2_chroma_w= 0,
127 .log2_chroma_h= 0,
128 .comp = {
eb39fb51
SS
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 */
9b61d838
MN
133 },
134 },
bcbd9a14
SS
135 [PIX_FMT_GRAY16BE] = {
136 .name = "gray16be",
137 .nb_channels = 1,
9b61d838
MN
138 .log2_chroma_w= 0,
139 .log2_chroma_h= 0,
140 .comp = {
bcbd9a14
SS
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 */
9b61d838
MN
152 },
153 },
154 [PIX_FMT_RGB48BE] = {
1e896640 155 .name = "rgb48be",
9b61d838
MN
156 .nb_channels = 3,
157 .log2_chroma_w= 0,
158 .log2_chroma_h= 0,
159 .comp = {
eb39fb51
SS
160 {0,5,1,0,15}, /* R */
161 {0,5,3,0,15}, /* G */
162 {0,5,5,0,15}, /* B */
9b61d838
MN
163 },
164 .flags = PIX_FMT_BE,
165 },
bcbd9a14
SS
166 [PIX_FMT_RGB48LE] = {
167 .name = "rgb48le",
9b61d838
MN
168 .nb_channels = 3,
169 .log2_chroma_w= 0,
170 .log2_chroma_h= 0,
171 .comp = {
bcbd9a14
SS
172 {0,5,1,0,15}, /* R */
173 {0,5,3,0,15}, /* G */
174 {0,5,5,0,15}, /* B */
9b61d838
MN
175 },
176 },
e5681ba0 177 [PIX_FMT_RGB565BE] = {
1e896640 178 .name = "rgb565be",
9b61d838
MN
179 .nb_channels = 3,
180 .log2_chroma_w= 0,
181 .log2_chroma_h= 0,
182 .comp = {
eb39fb51 183 {0,1,0,3,4}, /* R */
f938cbf9
SS
184 {0,1,1,5,5}, /* G */
185 {0,1,1,0,4}, /* B */
9b61d838
MN
186 },
187 .flags = PIX_FMT_BE,
188 },
bcbd9a14
SS
189 [PIX_FMT_RGB565LE] = {
190 .name = "rgb565le",
191 .nb_channels = 3,
9b61d838
MN
192 .log2_chroma_w= 0,
193 .log2_chroma_h= 0,
194 .comp = {
bcbd9a14
SS
195 {0,1,2,3,4}, /* R */
196 {0,1,1,5,5}, /* G */
197 {0,1,1,0,4}, /* B */
9b61d838 198 },
9b61d838
MN
199 },
200};