Line | Branch | Exec | Source |
---|---|---|---|
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 <stdio.h> | ||
23 | #include <string.h> | ||
24 | |||
25 | #include "avstring.h" | ||
26 | #include "common.h" | ||
27 | #include "pixfmt.h" | ||
28 | #include "pixdesc.h" | ||
29 | #include "intreadwrite.h" | ||
30 | |||
31 | 1068482 | void av_read_image_line2(void *dst, | |
32 | const uint8_t *data[4], const int linesize[4], | ||
33 | const AVPixFmtDescriptor *desc, | ||
34 | int x, int y, int c, int w, | ||
35 | int read_pal_component, | ||
36 | int dst_element_size) | ||
37 | { | ||
38 | 1068482 | AVComponentDescriptor comp = desc->comp[c]; | |
39 | 1068482 | int plane = comp.plane; | |
40 | 1068482 | int depth = comp.depth; | |
41 | 1068482 | unsigned mask = (1ULL << depth) - 1; | |
42 | 1068482 | int shift = comp.shift; | |
43 | 1068482 | int step = comp.step; | |
44 | 1068482 | int flags = desc->flags; | |
45 | 1068482 | uint16_t *dst16 = dst; | |
46 | 1068482 | uint32_t *dst32 = dst; | |
47 | |||
48 |
2/2✓ Branch 0 taken 237600 times.
✓ Branch 1 taken 830882 times.
|
1068482 | if (!depth) |
49 | 237600 | return; | |
50 | |||
51 |
2/2✓ Branch 0 taken 2896 times.
✓ Branch 1 taken 827986 times.
|
830882 | if (flags & AV_PIX_FMT_FLAG_BITSTREAM) { |
52 |
2/2✓ Branch 0 taken 8 times.
✓ Branch 1 taken 2888 times.
|
2896 | if (step > 8) { |
53 | // Assume all channels are packed into a 32bit value | ||
54 | 8 | const uint8_t *byte_p = data[plane] + y * linesize[plane]; | |
55 | 8 | const uint32_t *p = (uint32_t *)byte_p; | |
56 | |||
57 |
2/2✓ Branch 0 taken 16 times.
✓ Branch 1 taken 8 times.
|
24 | while (w--) { |
58 | 16 | int val = AV_RB32(p); | |
59 | 16 | val = (val >> comp.offset) & mask; | |
60 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
|
16 | if (read_pal_component) |
61 | ✗ | val = data[1][4*val + c]; | |
62 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
|
16 | if (dst_element_size == 4) *dst32++ = val; |
63 | 16 | else *dst16++ = val; | |
64 | 16 | p++; | |
65 | } | ||
66 | } else { | ||
67 | 2888 | int skip = x * step + comp.offset; | |
68 | 2888 | const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3); | |
69 | 2888 | int shift = 8 - depth - (skip & 7); | |
70 | |||
71 |
2/2✓ Branch 0 taken 1013776 times.
✓ Branch 1 taken 2888 times.
|
1016664 | while (w--) { |
72 | 1013776 | int val = (*p >> shift) & mask; | |
73 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1013776 times.
|
1013776 | if (read_pal_component) |
74 | ✗ | val = data[1][4*val + c]; | |
75 | 1013776 | shift -= step; | |
76 | 1013776 | p -= shift >> 3; | |
77 | 1013776 | shift &= 7; | |
78 |
2/2✓ Branch 0 taken 1013760 times.
✓ Branch 1 taken 16 times.
|
1013776 | if (dst_element_size == 4) *dst32++ = val; |
79 | 16 | else *dst16++ = val; | |
80 | } | ||
81 | } | ||
82 | } else { | ||
83 | 827986 | const uint8_t *p = data[plane] + y * linesize[plane] + | |
84 | 827986 | x * step + comp.offset; | |
85 | 827986 | int is_8bit = shift + depth <= 8; | |
86 | 827986 | int is_16bit= shift + depth <=16; | |
87 | |||
88 |
2/2✓ Branch 0 taken 247146 times.
✓ Branch 1 taken 580840 times.
|
827986 | if (is_8bit) |
89 | 247146 | p += !!(flags & AV_PIX_FMT_FLAG_BE); | |
90 | |||
91 |
2/2✓ Branch 0 taken 264402692 times.
✓ Branch 1 taken 827986 times.
|
265230678 | while (w--) { |
92 | unsigned val; | ||
93 |
2/2✓ Branch 0 taken 80404212 times.
✓ Branch 1 taken 183998480 times.
|
264402692 | if (is_8bit) val = *p; |
94 |
4/4✓ Branch 0 taken 175888284 times.
✓ Branch 1 taken 8110196 times.
✓ Branch 2 taken 83382216 times.
✓ Branch 3 taken 92506068 times.
|
183998480 | else if(is_16bit) val = flags & AV_PIX_FMT_FLAG_BE ? AV_RB16(p) : AV_RL16(p); |
95 |
2/2✓ Branch 0 taken 4055098 times.
✓ Branch 1 taken 4055098 times.
|
8110196 | else val = flags & AV_PIX_FMT_FLAG_BE ? AV_RB32(p) : AV_RL32(p); |
96 | 264402692 | val = (val >> shift) & mask; | |
97 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 264402692 times.
|
264402692 | if (read_pal_component) |
98 | ✗ | val = data[1][4 * val + c]; | |
99 | 264402692 | p += step; | |
100 |
2/2✓ Branch 0 taken 264401280 times.
✓ Branch 1 taken 1412 times.
|
264402692 | if (dst_element_size == 4) *dst32++ = val; |
101 | 1412 | else *dst16++ = val; | |
102 | } | ||
103 | } | ||
104 | } | ||
105 | |||
106 | 722 | void av_read_image_line(uint16_t *dst, | |
107 | const uint8_t *data[4], const int linesize[4], | ||
108 | const AVPixFmtDescriptor *desc, | ||
109 | int x, int y, int c, int w, | ||
110 | int read_pal_component) | ||
111 | { | ||
112 | 722 | av_read_image_line2(dst, data, linesize, desc,x, y, c, w, | |
113 | read_pal_component, | ||
114 | 2); | ||
115 | 722 | } | |
116 | |||
117 | 1070705 | void av_write_image_line2(const void *src, | |
118 | uint8_t *data[4], const int linesize[4], | ||
119 | const AVPixFmtDescriptor *desc, | ||
120 | int x, int y, int c, int w, int src_element_size) | ||
121 | { | ||
122 | 1070705 | AVComponentDescriptor comp = desc->comp[c]; | |
123 | 1070705 | int plane = comp.plane; | |
124 | 1070705 | int depth = comp.depth; | |
125 | 1070705 | int step = comp.step; | |
126 | 1070705 | int flags = desc->flags; | |
127 | 1070705 | const uint32_t *src32 = src; | |
128 | 1070705 | const uint16_t *src16 = src; | |
129 | |||
130 |
2/2✓ Branch 0 taken 237600 times.
✓ Branch 1 taken 833105 times.
|
1070705 | if (!depth) |
131 | 237600 | return; | |
132 | |||
133 |
2/2✓ Branch 0 taken 2938 times.
✓ Branch 1 taken 830167 times.
|
833105 | if (flags & AV_PIX_FMT_FLAG_BITSTREAM) { |
134 |
2/2✓ Branch 0 taken 26 times.
✓ Branch 1 taken 2912 times.
|
2938 | if (step > 8) { |
135 | // Assume all channels are packed into a 32bit value | ||
136 | 26 | const uint8_t *byte_p = data[plane] + y * linesize[plane]; | |
137 | 26 | uint32_t *p = (uint32_t *)byte_p; | |
138 | 26 | int offset = comp.offset; | |
139 | 26 | uint32_t mask = ((1ULL << depth) - 1) << offset; | |
140 | |||
141 |
2/2✓ Branch 0 taken 160 times.
✓ Branch 1 taken 26 times.
|
186 | while (w--) { |
142 |
2/2✓ Branch 0 taken 144 times.
✓ Branch 1 taken 16 times.
|
160 | unsigned val = src_element_size == 4 ? *src32++ : *src16++; |
143 | 160 | AV_WB32(p, (AV_RB32(p) & ~mask) | (val << offset)); | |
144 | 160 | p++; | |
145 | } | ||
146 | } else { | ||
147 | 2912 | int skip = x * step + comp.offset; | |
148 | 2912 | uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3); | |
149 | 2912 | int shift = 8 - depth - (skip & 7); | |
150 | |||
151 |
2/2✓ Branch 0 taken 1013968 times.
✓ Branch 1 taken 2912 times.
|
1016880 | while (w--) { |
152 |
2/2✓ Branch 0 taken 1013952 times.
✓ Branch 1 taken 16 times.
|
1013968 | *p |= (src_element_size == 4 ? *src32++ : *src16++) << shift; |
153 | 1013968 | shift -= step; | |
154 | 1013968 | p -= shift >> 3; | |
155 | 1013968 | shift &= 7; | |
156 | } | ||
157 | } | ||
158 | } else { | ||
159 | 830167 | int shift = comp.shift; | |
160 | 830167 | uint8_t *p = data[plane] + y * linesize[plane] + | |
161 | 830167 | x * step + comp.offset; | |
162 | |||
163 |
2/2✓ Branch 0 taken 247779 times.
✓ Branch 1 taken 582388 times.
|
830167 | if (shift + depth <= 8) { |
164 | 247779 | p += !!(flags & AV_PIX_FMT_FLAG_BE); | |
165 |
2/2✓ Branch 0 taken 80404854 times.
✓ Branch 1 taken 247779 times.
|
80652633 | while (w--) { |
166 |
2/2✓ Branch 0 taken 80404482 times.
✓ Branch 1 taken 372 times.
|
80404854 | *p |= ((src_element_size == 4 ? *src32++ : *src16++) << shift); |
167 | 80404854 | p += step; | |
168 | } | ||
169 | } else { | ||
170 |
2/2✓ Branch 0 taken 184000046 times.
✓ Branch 1 taken 582388 times.
|
184582434 | while (w--) { |
171 |
2/2✓ Branch 0 taken 183999006 times.
✓ Branch 1 taken 1040 times.
|
184000046 | unsigned s = (src_element_size == 4 ? *src32++ : *src16++); |
172 |
2/2✓ Branch 0 taken 175889676 times.
✓ Branch 1 taken 8110370 times.
|
184000046 | if (shift + depth <= 16) { |
173 |
2/2✓ Branch 0 taken 83382903 times.
✓ Branch 1 taken 92506773 times.
|
175889676 | if (flags & AV_PIX_FMT_FLAG_BE) { |
174 | 83382903 | uint16_t val = AV_RB16(p) | (s << shift); | |
175 | 83382903 | AV_WB16(p, val); | |
176 | } else { | ||
177 | 92506773 | uint16_t val = AV_RL16(p) | (s << shift); | |
178 | 92506773 | AV_WL16(p, val); | |
179 | } | ||
180 | } else { | ||
181 |
2/2✓ Branch 0 taken 4055185 times.
✓ Branch 1 taken 4055185 times.
|
8110370 | if (flags & AV_PIX_FMT_FLAG_BE) { |
182 | 4055185 | uint32_t val = AV_RB32(p) | (s << shift); | |
183 | 4055185 | AV_WB32(p, val); | |
184 | } else { | ||
185 | 4055185 | uint32_t val = AV_RL32(p) | (s << shift); | |
186 | 4055185 | AV_WL32(p, val); | |
187 | } | ||
188 | } | ||
189 | 184000046 | p += step; | |
190 | } | ||
191 | } | ||
192 | } | ||
193 | } | ||
194 | |||
195 | 722 | void av_write_image_line(const uint16_t *src, | |
196 | uint8_t *data[4], const int linesize[4], | ||
197 | const AVPixFmtDescriptor *desc, | ||
198 | int x, int y, int c, int w) | ||
199 | { | ||
200 | 722 | av_write_image_line2(src, data, linesize, desc, x, y, c, w, 2); | |
201 | 722 | } | |
202 | |||
203 | static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { | ||
204 | [AV_PIX_FMT_YUV420P] = { | ||
205 | .name = "yuv420p", | ||
206 | .nb_components = 3, | ||
207 | .log2_chroma_w = 1, | ||
208 | .log2_chroma_h = 1, | ||
209 | .comp = { | ||
210 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
211 | { 1, 1, 0, 0, 8 }, /* U */ | ||
212 | { 2, 1, 0, 0, 8 }, /* V */ | ||
213 | }, | ||
214 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
215 | }, | ||
216 | [AV_PIX_FMT_YUYV422] = { | ||
217 | .name = "yuyv422", | ||
218 | .nb_components = 3, | ||
219 | .log2_chroma_w = 1, | ||
220 | .log2_chroma_h = 0, | ||
221 | .comp = { | ||
222 | { 0, 2, 0, 0, 8 }, /* Y */ | ||
223 | { 0, 4, 1, 0, 8 }, /* U */ | ||
224 | { 0, 4, 3, 0, 8 }, /* V */ | ||
225 | }, | ||
226 | }, | ||
227 | [AV_PIX_FMT_YVYU422] = { | ||
228 | .name = "yvyu422", | ||
229 | .nb_components = 3, | ||
230 | .log2_chroma_w = 1, | ||
231 | .log2_chroma_h = 0, | ||
232 | .comp = { | ||
233 | { 0, 2, 0, 0, 8 }, /* Y */ | ||
234 | { 0, 4, 3, 0, 8 }, /* U */ | ||
235 | { 0, 4, 1, 0, 8 }, /* V */ | ||
236 | }, | ||
237 | }, | ||
238 | [AV_PIX_FMT_Y210LE] = { | ||
239 | .name = "y210le", | ||
240 | .nb_components = 3, | ||
241 | .log2_chroma_w = 1, | ||
242 | .log2_chroma_h = 0, | ||
243 | .comp = { | ||
244 | { 0, 4, 0, 6, 10 }, /* Y */ | ||
245 | { 0, 8, 2, 6, 10 }, /* U */ | ||
246 | { 0, 8, 6, 6, 10 }, /* V */ | ||
247 | }, | ||
248 | }, | ||
249 | [AV_PIX_FMT_Y210BE] = { | ||
250 | .name = "y210be", | ||
251 | .nb_components = 3, | ||
252 | .log2_chroma_w = 1, | ||
253 | .log2_chroma_h = 0, | ||
254 | .comp = { | ||
255 | { 0, 4, 0, 6, 10 }, /* Y */ | ||
256 | { 0, 8, 2, 6, 10 }, /* U */ | ||
257 | { 0, 8, 6, 6, 10 }, /* V */ | ||
258 | }, | ||
259 | .flags = AV_PIX_FMT_FLAG_BE, | ||
260 | }, | ||
261 | [AV_PIX_FMT_RGB24] = { | ||
262 | .name = "rgb24", | ||
263 | .nb_components = 3, | ||
264 | .log2_chroma_w = 0, | ||
265 | .log2_chroma_h = 0, | ||
266 | .comp = { | ||
267 | { 0, 3, 0, 0, 8 }, /* R */ | ||
268 | { 0, 3, 1, 0, 8 }, /* G */ | ||
269 | { 0, 3, 2, 0, 8 }, /* B */ | ||
270 | }, | ||
271 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
272 | }, | ||
273 | [AV_PIX_FMT_BGR24] = { | ||
274 | .name = "bgr24", | ||
275 | .nb_components = 3, | ||
276 | .log2_chroma_w = 0, | ||
277 | .log2_chroma_h = 0, | ||
278 | .comp = { | ||
279 | { 0, 3, 2, 0, 8 }, /* R */ | ||
280 | { 0, 3, 1, 0, 8 }, /* G */ | ||
281 | { 0, 3, 0, 0, 8 }, /* B */ | ||
282 | }, | ||
283 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
284 | }, | ||
285 | [AV_PIX_FMT_X2RGB10LE] = { | ||
286 | .name = "x2rgb10le", | ||
287 | .nb_components= 3, | ||
288 | .log2_chroma_w= 0, | ||
289 | .log2_chroma_h= 0, | ||
290 | .comp = { | ||
291 | { 0, 4, 2, 4, 10 }, /* R */ | ||
292 | { 0, 4, 1, 2, 10 }, /* G */ | ||
293 | { 0, 4, 0, 0, 10 }, /* B */ | ||
294 | { 0, 4, 3, 6, 2 }, /* X */ | ||
295 | }, | ||
296 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
297 | }, | ||
298 | [AV_PIX_FMT_X2RGB10BE] = { | ||
299 | .name = "x2rgb10be", | ||
300 | .nb_components= 3, | ||
301 | .log2_chroma_w= 0, | ||
302 | .log2_chroma_h= 0, | ||
303 | .comp = { | ||
304 | { 0, 4, 0, 4, 10 }, /* R */ | ||
305 | { 0, 4, 1, 2, 10 }, /* G */ | ||
306 | { 0, 4, 2, 0, 10 }, /* B */ | ||
307 | { 0, 4, 3, 6, 2 }, /* X */ | ||
308 | }, | ||
309 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BE, | ||
310 | }, | ||
311 | [AV_PIX_FMT_X2BGR10LE] = { | ||
312 | .name = "x2bgr10le", | ||
313 | .nb_components= 3, | ||
314 | .log2_chroma_w= 0, | ||
315 | .log2_chroma_h= 0, | ||
316 | .comp = { | ||
317 | { 0, 4, 0, 0, 10 }, /* R */ | ||
318 | { 0, 4, 1, 2, 10 }, /* G */ | ||
319 | { 0, 4, 2, 4, 10 }, /* B */ | ||
320 | { 0, 4, 3, 6, 2 }, /* X */ | ||
321 | }, | ||
322 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
323 | }, | ||
324 | [AV_PIX_FMT_X2BGR10BE] = { | ||
325 | .name = "x2bgr10be", | ||
326 | .nb_components= 3, | ||
327 | .log2_chroma_w= 0, | ||
328 | .log2_chroma_h= 0, | ||
329 | .comp = { | ||
330 | { 0, 4, 2, 0, 10 }, /* R */ | ||
331 | { 0, 4, 1, 2, 10 }, /* G */ | ||
332 | { 0, 4, 0, 4, 10 }, /* B */ | ||
333 | { 0, 4, 3, 6, 2 }, /* X */ | ||
334 | }, | ||
335 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BE, | ||
336 | }, | ||
337 | [AV_PIX_FMT_YUV422P] = { | ||
338 | .name = "yuv422p", | ||
339 | .nb_components = 3, | ||
340 | .log2_chroma_w = 1, | ||
341 | .log2_chroma_h = 0, | ||
342 | .comp = { | ||
343 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
344 | { 1, 1, 0, 0, 8 }, /* U */ | ||
345 | { 2, 1, 0, 0, 8 }, /* V */ | ||
346 | }, | ||
347 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
348 | }, | ||
349 | [AV_PIX_FMT_YUV444P] = { | ||
350 | .name = "yuv444p", | ||
351 | .nb_components = 3, | ||
352 | .log2_chroma_w = 0, | ||
353 | .log2_chroma_h = 0, | ||
354 | .comp = { | ||
355 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
356 | { 1, 1, 0, 0, 8 }, /* U */ | ||
357 | { 2, 1, 0, 0, 8 }, /* V */ | ||
358 | }, | ||
359 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
360 | }, | ||
361 | [AV_PIX_FMT_YUV410P] = { | ||
362 | .name = "yuv410p", | ||
363 | .nb_components = 3, | ||
364 | .log2_chroma_w = 2, | ||
365 | .log2_chroma_h = 2, | ||
366 | .comp = { | ||
367 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
368 | { 1, 1, 0, 0, 8 }, /* U */ | ||
369 | { 2, 1, 0, 0, 8 }, /* V */ | ||
370 | }, | ||
371 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
372 | }, | ||
373 | [AV_PIX_FMT_YUV411P] = { | ||
374 | .name = "yuv411p", | ||
375 | .nb_components = 3, | ||
376 | .log2_chroma_w = 2, | ||
377 | .log2_chroma_h = 0, | ||
378 | .comp = { | ||
379 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
380 | { 1, 1, 0, 0, 8 }, /* U */ | ||
381 | { 2, 1, 0, 0, 8 }, /* V */ | ||
382 | }, | ||
383 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
384 | }, | ||
385 | [AV_PIX_FMT_YUVJ411P] = { | ||
386 | .name = "yuvj411p", | ||
387 | .nb_components = 3, | ||
388 | .log2_chroma_w = 2, | ||
389 | .log2_chroma_h = 0, | ||
390 | .comp = { | ||
391 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
392 | { 1, 1, 0, 0, 8 }, /* U */ | ||
393 | { 2, 1, 0, 0, 8 }, /* V */ | ||
394 | }, | ||
395 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
396 | }, | ||
397 | [AV_PIX_FMT_GRAY8] = { | ||
398 | .name = "gray", | ||
399 | .nb_components = 1, | ||
400 | .log2_chroma_w = 0, | ||
401 | .log2_chroma_h = 0, | ||
402 | .comp = { | ||
403 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
404 | }, | ||
405 | .alias = "gray8,y8", | ||
406 | }, | ||
407 | [AV_PIX_FMT_MONOWHITE] = { | ||
408 | .name = "monow", | ||
409 | .nb_components = 1, | ||
410 | .log2_chroma_w = 0, | ||
411 | .log2_chroma_h = 0, | ||
412 | .comp = { | ||
413 | { 0, 1, 0, 0, 1 }, /* Y */ | ||
414 | }, | ||
415 | .flags = AV_PIX_FMT_FLAG_BITSTREAM, | ||
416 | }, | ||
417 | [AV_PIX_FMT_MONOBLACK] = { | ||
418 | .name = "monob", | ||
419 | .nb_components = 1, | ||
420 | .log2_chroma_w = 0, | ||
421 | .log2_chroma_h = 0, | ||
422 | .comp = { | ||
423 | { 0, 1, 0, 7, 1 }, /* Y */ | ||
424 | }, | ||
425 | .flags = AV_PIX_FMT_FLAG_BITSTREAM, | ||
426 | }, | ||
427 | [AV_PIX_FMT_PAL8] = { | ||
428 | .name = "pal8", | ||
429 | .nb_components = 1, | ||
430 | .log2_chroma_w = 0, | ||
431 | .log2_chroma_h = 0, | ||
432 | .comp = { | ||
433 | { 0, 1, 0, 0, 8 }, | ||
434 | }, | ||
435 | .flags = AV_PIX_FMT_FLAG_PAL | AV_PIX_FMT_FLAG_ALPHA, | ||
436 | }, | ||
437 | [AV_PIX_FMT_YUVJ420P] = { | ||
438 | .name = "yuvj420p", | ||
439 | .nb_components = 3, | ||
440 | .log2_chroma_w = 1, | ||
441 | .log2_chroma_h = 1, | ||
442 | .comp = { | ||
443 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
444 | { 1, 1, 0, 0, 8 }, /* U */ | ||
445 | { 2, 1, 0, 0, 8 }, /* V */ | ||
446 | }, | ||
447 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
448 | }, | ||
449 | [AV_PIX_FMT_YUVJ422P] = { | ||
450 | .name = "yuvj422p", | ||
451 | .nb_components = 3, | ||
452 | .log2_chroma_w = 1, | ||
453 | .log2_chroma_h = 0, | ||
454 | .comp = { | ||
455 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
456 | { 1, 1, 0, 0, 8 }, /* U */ | ||
457 | { 2, 1, 0, 0, 8 }, /* V */ | ||
458 | }, | ||
459 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
460 | }, | ||
461 | [AV_PIX_FMT_YUVJ444P] = { | ||
462 | .name = "yuvj444p", | ||
463 | .nb_components = 3, | ||
464 | .log2_chroma_w = 0, | ||
465 | .log2_chroma_h = 0, | ||
466 | .comp = { | ||
467 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
468 | { 1, 1, 0, 0, 8 }, /* U */ | ||
469 | { 2, 1, 0, 0, 8 }, /* V */ | ||
470 | }, | ||
471 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
472 | }, | ||
473 | [AV_PIX_FMT_UYVY422] = { | ||
474 | .name = "uyvy422", | ||
475 | .nb_components = 3, | ||
476 | .log2_chroma_w = 1, | ||
477 | .log2_chroma_h = 0, | ||
478 | .comp = { | ||
479 | { 0, 2, 1, 0, 8 }, /* Y */ | ||
480 | { 0, 4, 0, 0, 8 }, /* U */ | ||
481 | { 0, 4, 2, 0, 8 }, /* V */ | ||
482 | }, | ||
483 | }, | ||
484 | [AV_PIX_FMT_UYYVYY411] = { | ||
485 | .name = "uyyvyy411", | ||
486 | .nb_components = 3, | ||
487 | .log2_chroma_w = 2, | ||
488 | .log2_chroma_h = 0, | ||
489 | .comp = { | ||
490 | { 0, 4, 1, 0, 8 }, /* Y */ | ||
491 | { 0, 6, 0, 0, 8 }, /* U */ | ||
492 | { 0, 6, 3, 0, 8 }, /* V */ | ||
493 | }, | ||
494 | }, | ||
495 | [AV_PIX_FMT_BGR8] = { | ||
496 | .name = "bgr8", | ||
497 | .nb_components = 3, | ||
498 | .log2_chroma_w = 0, | ||
499 | .log2_chroma_h = 0, | ||
500 | .comp = { | ||
501 | { 0, 1, 0, 0, 3 }, /* R */ | ||
502 | { 0, 1, 0, 3, 3 }, /* G */ | ||
503 | { 0, 1, 0, 6, 2 }, /* B */ | ||
504 | }, | ||
505 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
506 | }, | ||
507 | [AV_PIX_FMT_BGR4] = { | ||
508 | .name = "bgr4", | ||
509 | .nb_components = 3, | ||
510 | .log2_chroma_w = 0, | ||
511 | .log2_chroma_h = 0, | ||
512 | .comp = { | ||
513 | { 0, 4, 3, 0, 1 }, /* R */ | ||
514 | { 0, 4, 1, 0, 2 }, /* G */ | ||
515 | { 0, 4, 0, 0, 1 }, /* B */ | ||
516 | }, | ||
517 | .flags = AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_RGB, | ||
518 | }, | ||
519 | [AV_PIX_FMT_BGR4_BYTE] = { | ||
520 | .name = "bgr4_byte", | ||
521 | .nb_components = 3, | ||
522 | .log2_chroma_w = 0, | ||
523 | .log2_chroma_h = 0, | ||
524 | .comp = { | ||
525 | { 0, 1, 0, 0, 1 }, /* R */ | ||
526 | { 0, 1, 0, 1, 2 }, /* G */ | ||
527 | { 0, 1, 0, 3, 1 }, /* B */ | ||
528 | }, | ||
529 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
530 | }, | ||
531 | [AV_PIX_FMT_RGB8] = { | ||
532 | .name = "rgb8", | ||
533 | .nb_components = 3, | ||
534 | .log2_chroma_w = 0, | ||
535 | .log2_chroma_h = 0, | ||
536 | .comp = { | ||
537 | { 0, 1, 0, 5, 3 }, /* R */ | ||
538 | { 0, 1, 0, 2, 3 }, /* G */ | ||
539 | { 0, 1, 0, 0, 2 }, /* B */ | ||
540 | }, | ||
541 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
542 | }, | ||
543 | [AV_PIX_FMT_RGB4] = { | ||
544 | .name = "rgb4", | ||
545 | .nb_components = 3, | ||
546 | .log2_chroma_w = 0, | ||
547 | .log2_chroma_h = 0, | ||
548 | .comp = { | ||
549 | { 0, 4, 0, 0, 1 }, /* R */ | ||
550 | { 0, 4, 1, 0, 2 }, /* G */ | ||
551 | { 0, 4, 3, 0, 1 }, /* B */ | ||
552 | }, | ||
553 | .flags = AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_RGB, | ||
554 | }, | ||
555 | [AV_PIX_FMT_RGB4_BYTE] = { | ||
556 | .name = "rgb4_byte", | ||
557 | .nb_components = 3, | ||
558 | .log2_chroma_w = 0, | ||
559 | .log2_chroma_h = 0, | ||
560 | .comp = { | ||
561 | { 0, 1, 0, 3, 1 }, /* R */ | ||
562 | { 0, 1, 0, 1, 2 }, /* G */ | ||
563 | { 0, 1, 0, 0, 1 }, /* B */ | ||
564 | }, | ||
565 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
566 | }, | ||
567 | [AV_PIX_FMT_NV12] = { | ||
568 | .name = "nv12", | ||
569 | .nb_components = 3, | ||
570 | .log2_chroma_w = 1, | ||
571 | .log2_chroma_h = 1, | ||
572 | .comp = { | ||
573 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
574 | { 1, 2, 0, 0, 8 }, /* U */ | ||
575 | { 1, 2, 1, 0, 8 }, /* V */ | ||
576 | }, | ||
577 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
578 | }, | ||
579 | [AV_PIX_FMT_NV21] = { | ||
580 | .name = "nv21", | ||
581 | .nb_components = 3, | ||
582 | .log2_chroma_w = 1, | ||
583 | .log2_chroma_h = 1, | ||
584 | .comp = { | ||
585 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
586 | { 1, 2, 1, 0, 8 }, /* U */ | ||
587 | { 1, 2, 0, 0, 8 }, /* V */ | ||
588 | }, | ||
589 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
590 | }, | ||
591 | [AV_PIX_FMT_ARGB] = { | ||
592 | .name = "argb", | ||
593 | .nb_components = 4, | ||
594 | .log2_chroma_w = 0, | ||
595 | .log2_chroma_h = 0, | ||
596 | .comp = { | ||
597 | { 0, 4, 1, 0, 8 }, /* R */ | ||
598 | { 0, 4, 2, 0, 8 }, /* G */ | ||
599 | { 0, 4, 3, 0, 8 }, /* B */ | ||
600 | { 0, 4, 0, 0, 8 }, /* A */ | ||
601 | }, | ||
602 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, | ||
603 | }, | ||
604 | [AV_PIX_FMT_RGBA] = { | ||
605 | .name = "rgba", | ||
606 | .nb_components = 4, | ||
607 | .log2_chroma_w = 0, | ||
608 | .log2_chroma_h = 0, | ||
609 | .comp = { | ||
610 | { 0, 4, 0, 0, 8 }, /* R */ | ||
611 | { 0, 4, 1, 0, 8 }, /* G */ | ||
612 | { 0, 4, 2, 0, 8 }, /* B */ | ||
613 | { 0, 4, 3, 0, 8 }, /* A */ | ||
614 | }, | ||
615 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, | ||
616 | }, | ||
617 | [AV_PIX_FMT_ABGR] = { | ||
618 | .name = "abgr", | ||
619 | .nb_components = 4, | ||
620 | .log2_chroma_w = 0, | ||
621 | .log2_chroma_h = 0, | ||
622 | .comp = { | ||
623 | { 0, 4, 3, 0, 8 }, /* R */ | ||
624 | { 0, 4, 2, 0, 8 }, /* G */ | ||
625 | { 0, 4, 1, 0, 8 }, /* B */ | ||
626 | { 0, 4, 0, 0, 8 }, /* A */ | ||
627 | }, | ||
628 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, | ||
629 | }, | ||
630 | [AV_PIX_FMT_BGRA] = { | ||
631 | .name = "bgra", | ||
632 | .nb_components = 4, | ||
633 | .log2_chroma_w = 0, | ||
634 | .log2_chroma_h = 0, | ||
635 | .comp = { | ||
636 | { 0, 4, 2, 0, 8 }, /* R */ | ||
637 | { 0, 4, 1, 0, 8 }, /* G */ | ||
638 | { 0, 4, 0, 0, 8 }, /* B */ | ||
639 | { 0, 4, 3, 0, 8 }, /* A */ | ||
640 | }, | ||
641 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, | ||
642 | }, | ||
643 | [AV_PIX_FMT_0RGB] = { | ||
644 | .name = "0rgb", | ||
645 | .nb_components= 3, | ||
646 | .log2_chroma_w= 0, | ||
647 | .log2_chroma_h= 0, | ||
648 | .comp = { | ||
649 | { 0, 4, 1, 0, 8 }, /* R */ | ||
650 | { 0, 4, 2, 0, 8 }, /* G */ | ||
651 | { 0, 4, 3, 0, 8 }, /* B */ | ||
652 | { 0, 4, 0, 0, 8 }, /* X */ | ||
653 | }, | ||
654 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
655 | }, | ||
656 | [AV_PIX_FMT_RGB0] = { | ||
657 | .name = "rgb0", | ||
658 | .nb_components= 3, | ||
659 | .log2_chroma_w= 0, | ||
660 | .log2_chroma_h= 0, | ||
661 | .comp = { | ||
662 | { 0, 4, 0, 0, 8 }, /* R */ | ||
663 | { 0, 4, 1, 0, 8 }, /* G */ | ||
664 | { 0, 4, 2, 0, 8 }, /* B */ | ||
665 | { 0, 4, 3, 0, 8 }, /* X */ | ||
666 | }, | ||
667 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
668 | }, | ||
669 | [AV_PIX_FMT_0BGR] = { | ||
670 | .name = "0bgr", | ||
671 | .nb_components= 3, | ||
672 | .log2_chroma_w= 0, | ||
673 | .log2_chroma_h= 0, | ||
674 | .comp = { | ||
675 | { 0, 4, 3, 0, 8 }, /* R */ | ||
676 | { 0, 4, 2, 0, 8 }, /* G */ | ||
677 | { 0, 4, 1, 0, 8 }, /* B */ | ||
678 | { 0, 4, 0, 0, 8 }, /* X */ | ||
679 | }, | ||
680 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
681 | }, | ||
682 | [AV_PIX_FMT_BGR0] = { | ||
683 | .name = "bgr0", | ||
684 | .nb_components= 3, | ||
685 | .log2_chroma_w= 0, | ||
686 | .log2_chroma_h= 0, | ||
687 | .comp = { | ||
688 | { 0, 4, 2, 0, 8 }, /* R */ | ||
689 | { 0, 4, 1, 0, 8 }, /* G */ | ||
690 | { 0, 4, 0, 0, 8 }, /* B */ | ||
691 | { 0, 4, 3, 0, 8 }, /* X */ | ||
692 | }, | ||
693 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
694 | }, | ||
695 | [AV_PIX_FMT_GRAY9BE] = { | ||
696 | .name = "gray9be", | ||
697 | .nb_components = 1, | ||
698 | .log2_chroma_w = 0, | ||
699 | .log2_chroma_h = 0, | ||
700 | .comp = { | ||
701 | { 0, 2, 0, 0, 9 }, /* Y */ | ||
702 | }, | ||
703 | .flags = AV_PIX_FMT_FLAG_BE, | ||
704 | .alias = "y9be", | ||
705 | }, | ||
706 | [AV_PIX_FMT_GRAY9LE] = { | ||
707 | .name = "gray9le", | ||
708 | .nb_components = 1, | ||
709 | .log2_chroma_w = 0, | ||
710 | .log2_chroma_h = 0, | ||
711 | .comp = { | ||
712 | { 0, 2, 0, 0, 9 }, /* Y */ | ||
713 | }, | ||
714 | .alias = "y9le", | ||
715 | }, | ||
716 | [AV_PIX_FMT_GRAY10BE] = { | ||
717 | .name = "gray10be", | ||
718 | .nb_components = 1, | ||
719 | .log2_chroma_w = 0, | ||
720 | .log2_chroma_h = 0, | ||
721 | .comp = { | ||
722 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
723 | }, | ||
724 | .flags = AV_PIX_FMT_FLAG_BE, | ||
725 | .alias = "y10be", | ||
726 | }, | ||
727 | [AV_PIX_FMT_GRAY10LE] = { | ||
728 | .name = "gray10le", | ||
729 | .nb_components = 1, | ||
730 | .log2_chroma_w = 0, | ||
731 | .log2_chroma_h = 0, | ||
732 | .comp = { | ||
733 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
734 | }, | ||
735 | .alias = "y10le", | ||
736 | }, | ||
737 | [AV_PIX_FMT_GRAY12BE] = { | ||
738 | .name = "gray12be", | ||
739 | .nb_components = 1, | ||
740 | .log2_chroma_w = 0, | ||
741 | .log2_chroma_h = 0, | ||
742 | .comp = { | ||
743 | { 0, 2, 0, 0, 12 }, /* Y */ | ||
744 | }, | ||
745 | .flags = AV_PIX_FMT_FLAG_BE, | ||
746 | .alias = "y12be", | ||
747 | }, | ||
748 | [AV_PIX_FMT_GRAY12LE] = { | ||
749 | .name = "gray12le", | ||
750 | .nb_components = 1, | ||
751 | .log2_chroma_w = 0, | ||
752 | .log2_chroma_h = 0, | ||
753 | .comp = { | ||
754 | { 0, 2, 0, 0, 12 }, /* Y */ | ||
755 | }, | ||
756 | .alias = "y12le", | ||
757 | }, | ||
758 | [AV_PIX_FMT_GRAY14BE] = { | ||
759 | .name = "gray14be", | ||
760 | .nb_components = 1, | ||
761 | .log2_chroma_w = 0, | ||
762 | .log2_chroma_h = 0, | ||
763 | .comp = { | ||
764 | { 0, 2, 0, 0, 14 }, /* Y */ | ||
765 | }, | ||
766 | .flags = AV_PIX_FMT_FLAG_BE, | ||
767 | .alias = "y14be", | ||
768 | }, | ||
769 | [AV_PIX_FMT_GRAY14LE] = { | ||
770 | .name = "gray14le", | ||
771 | .nb_components = 1, | ||
772 | .log2_chroma_w = 0, | ||
773 | .log2_chroma_h = 0, | ||
774 | .comp = { | ||
775 | { 0, 2, 0, 0, 14 }, /* Y */ | ||
776 | }, | ||
777 | .alias = "y14le", | ||
778 | }, | ||
779 | [AV_PIX_FMT_GRAY16BE] = { | ||
780 | .name = "gray16be", | ||
781 | .nb_components = 1, | ||
782 | .log2_chroma_w = 0, | ||
783 | .log2_chroma_h = 0, | ||
784 | .comp = { | ||
785 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
786 | }, | ||
787 | .flags = AV_PIX_FMT_FLAG_BE, | ||
788 | .alias = "y16be", | ||
789 | }, | ||
790 | [AV_PIX_FMT_GRAY16LE] = { | ||
791 | .name = "gray16le", | ||
792 | .nb_components = 1, | ||
793 | .log2_chroma_w = 0, | ||
794 | .log2_chroma_h = 0, | ||
795 | .comp = { | ||
796 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
797 | }, | ||
798 | .alias = "y16le", | ||
799 | }, | ||
800 | [AV_PIX_FMT_GRAY32BE] = { | ||
801 | .name = "gray32be", | ||
802 | .nb_components = 1, | ||
803 | .log2_chroma_w = 0, | ||
804 | .log2_chroma_h = 0, | ||
805 | .comp = { | ||
806 | { 0, 4, 0, 0, 32 }, /* Y */ | ||
807 | }, | ||
808 | .flags = AV_PIX_FMT_FLAG_BE, | ||
809 | .alias = "y32be", | ||
810 | }, | ||
811 | [AV_PIX_FMT_GRAY32LE] = { | ||
812 | .name = "gray32le", | ||
813 | .nb_components = 1, | ||
814 | .log2_chroma_w = 0, | ||
815 | .log2_chroma_h = 0, | ||
816 | .comp = { | ||
817 | { 0, 4, 0, 0, 32 }, /* Y */ | ||
818 | }, | ||
819 | .alias = "y32le", | ||
820 | }, | ||
821 | [AV_PIX_FMT_YUV440P] = { | ||
822 | .name = "yuv440p", | ||
823 | .nb_components = 3, | ||
824 | .log2_chroma_w = 0, | ||
825 | .log2_chroma_h = 1, | ||
826 | .comp = { | ||
827 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
828 | { 1, 1, 0, 0, 8 }, /* U */ | ||
829 | { 2, 1, 0, 0, 8 }, /* V */ | ||
830 | }, | ||
831 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
832 | }, | ||
833 | [AV_PIX_FMT_YUVJ440P] = { | ||
834 | .name = "yuvj440p", | ||
835 | .nb_components = 3, | ||
836 | .log2_chroma_w = 0, | ||
837 | .log2_chroma_h = 1, | ||
838 | .comp = { | ||
839 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
840 | { 1, 1, 0, 0, 8 }, /* U */ | ||
841 | { 2, 1, 0, 0, 8 }, /* V */ | ||
842 | }, | ||
843 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
844 | }, | ||
845 | [AV_PIX_FMT_YUV440P10LE] = { | ||
846 | .name = "yuv440p10le", | ||
847 | .nb_components = 3, | ||
848 | .log2_chroma_w = 0, | ||
849 | .log2_chroma_h = 1, | ||
850 | .comp = { | ||
851 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
852 | { 1, 2, 0, 0, 10 }, /* U */ | ||
853 | { 2, 2, 0, 0, 10 }, /* V */ | ||
854 | }, | ||
855 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
856 | }, | ||
857 | [AV_PIX_FMT_YUV440P10BE] = { | ||
858 | .name = "yuv440p10be", | ||
859 | .nb_components = 3, | ||
860 | .log2_chroma_w = 0, | ||
861 | .log2_chroma_h = 1, | ||
862 | .comp = { | ||
863 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
864 | { 1, 2, 0, 0, 10 }, /* U */ | ||
865 | { 2, 2, 0, 0, 10 }, /* V */ | ||
866 | }, | ||
867 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
868 | }, | ||
869 | [AV_PIX_FMT_YUV440P12LE] = { | ||
870 | .name = "yuv440p12le", | ||
871 | .nb_components = 3, | ||
872 | .log2_chroma_w = 0, | ||
873 | .log2_chroma_h = 1, | ||
874 | .comp = { | ||
875 | { 0, 2, 0, 0, 12 }, /* Y */ | ||
876 | { 1, 2, 0, 0, 12 }, /* U */ | ||
877 | { 2, 2, 0, 0, 12 }, /* V */ | ||
878 | }, | ||
879 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
880 | }, | ||
881 | [AV_PIX_FMT_YUV440P12BE] = { | ||
882 | .name = "yuv440p12be", | ||
883 | .nb_components = 3, | ||
884 | .log2_chroma_w = 0, | ||
885 | .log2_chroma_h = 1, | ||
886 | .comp = { | ||
887 | { 0, 2, 0, 0, 12 }, /* Y */ | ||
888 | { 1, 2, 0, 0, 12 }, /* U */ | ||
889 | { 2, 2, 0, 0, 12 }, /* V */ | ||
890 | }, | ||
891 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
892 | }, | ||
893 | [AV_PIX_FMT_YUVA420P] = { | ||
894 | .name = "yuva420p", | ||
895 | .nb_components = 4, | ||
896 | .log2_chroma_w = 1, | ||
897 | .log2_chroma_h = 1, | ||
898 | .comp = { | ||
899 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
900 | { 1, 1, 0, 0, 8 }, /* U */ | ||
901 | { 2, 1, 0, 0, 8 }, /* V */ | ||
902 | { 3, 1, 0, 0, 8 }, /* A */ | ||
903 | }, | ||
904 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
905 | }, | ||
906 | [AV_PIX_FMT_YUVA422P] = { | ||
907 | .name = "yuva422p", | ||
908 | .nb_components = 4, | ||
909 | .log2_chroma_w = 1, | ||
910 | .log2_chroma_h = 0, | ||
911 | .comp = { | ||
912 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
913 | { 1, 1, 0, 0, 8 }, /* U */ | ||
914 | { 2, 1, 0, 0, 8 }, /* V */ | ||
915 | { 3, 1, 0, 0, 8 }, /* A */ | ||
916 | }, | ||
917 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
918 | }, | ||
919 | [AV_PIX_FMT_YUVA444P] = { | ||
920 | .name = "yuva444p", | ||
921 | .nb_components = 4, | ||
922 | .log2_chroma_w = 0, | ||
923 | .log2_chroma_h = 0, | ||
924 | .comp = { | ||
925 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
926 | { 1, 1, 0, 0, 8 }, /* U */ | ||
927 | { 2, 1, 0, 0, 8 }, /* V */ | ||
928 | { 3, 1, 0, 0, 8 }, /* A */ | ||
929 | }, | ||
930 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
931 | }, | ||
932 | [AV_PIX_FMT_YUVA420P9BE] = { | ||
933 | .name = "yuva420p9be", | ||
934 | .nb_components = 4, | ||
935 | .log2_chroma_w = 1, | ||
936 | .log2_chroma_h = 1, | ||
937 | .comp = { | ||
938 | { 0, 2, 0, 0, 9 }, /* Y */ | ||
939 | { 1, 2, 0, 0, 9 }, /* U */ | ||
940 | { 2, 2, 0, 0, 9 }, /* V */ | ||
941 | { 3, 2, 0, 0, 9 }, /* A */ | ||
942 | }, | ||
943 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
944 | }, | ||
945 | [AV_PIX_FMT_YUVA420P9LE] = { | ||
946 | .name = "yuva420p9le", | ||
947 | .nb_components = 4, | ||
948 | .log2_chroma_w = 1, | ||
949 | .log2_chroma_h = 1, | ||
950 | .comp = { | ||
951 | { 0, 2, 0, 0, 9 }, /* Y */ | ||
952 | { 1, 2, 0, 0, 9 }, /* U */ | ||
953 | { 2, 2, 0, 0, 9 }, /* V */ | ||
954 | { 3, 2, 0, 0, 9 }, /* A */ | ||
955 | }, | ||
956 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
957 | }, | ||
958 | [AV_PIX_FMT_YUVA422P9BE] = { | ||
959 | .name = "yuva422p9be", | ||
960 | .nb_components = 4, | ||
961 | .log2_chroma_w = 1, | ||
962 | .log2_chroma_h = 0, | ||
963 | .comp = { | ||
964 | { 0, 2, 0, 0, 9 }, /* Y */ | ||
965 | { 1, 2, 0, 0, 9 }, /* U */ | ||
966 | { 2, 2, 0, 0, 9 }, /* V */ | ||
967 | { 3, 2, 0, 0, 9 }, /* A */ | ||
968 | }, | ||
969 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
970 | }, | ||
971 | [AV_PIX_FMT_YUVA422P9LE] = { | ||
972 | .name = "yuva422p9le", | ||
973 | .nb_components = 4, | ||
974 | .log2_chroma_w = 1, | ||
975 | .log2_chroma_h = 0, | ||
976 | .comp = { | ||
977 | { 0, 2, 0, 0, 9 }, /* Y */ | ||
978 | { 1, 2, 0, 0, 9 }, /* U */ | ||
979 | { 2, 2, 0, 0, 9 }, /* V */ | ||
980 | { 3, 2, 0, 0, 9 }, /* A */ | ||
981 | }, | ||
982 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
983 | }, | ||
984 | [AV_PIX_FMT_YUVA444P9BE] = { | ||
985 | .name = "yuva444p9be", | ||
986 | .nb_components = 4, | ||
987 | .log2_chroma_w = 0, | ||
988 | .log2_chroma_h = 0, | ||
989 | .comp = { | ||
990 | { 0, 2, 0, 0, 9 }, /* Y */ | ||
991 | { 1, 2, 0, 0, 9 }, /* U */ | ||
992 | { 2, 2, 0, 0, 9 }, /* V */ | ||
993 | { 3, 2, 0, 0, 9 }, /* A */ | ||
994 | }, | ||
995 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
996 | }, | ||
997 | [AV_PIX_FMT_YUVA444P9LE] = { | ||
998 | .name = "yuva444p9le", | ||
999 | .nb_components = 4, | ||
1000 | .log2_chroma_w = 0, | ||
1001 | .log2_chroma_h = 0, | ||
1002 | .comp = { | ||
1003 | { 0, 2, 0, 0, 9 }, /* Y */ | ||
1004 | { 1, 2, 0, 0, 9 }, /* U */ | ||
1005 | { 2, 2, 0, 0, 9 }, /* V */ | ||
1006 | { 3, 2, 0, 0, 9 }, /* A */ | ||
1007 | }, | ||
1008 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
1009 | }, | ||
1010 | [AV_PIX_FMT_YUVA420P10BE] = { | ||
1011 | .name = "yuva420p10be", | ||
1012 | .nb_components = 4, | ||
1013 | .log2_chroma_w = 1, | ||
1014 | .log2_chroma_h = 1, | ||
1015 | .comp = { | ||
1016 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
1017 | { 1, 2, 0, 0, 10 }, /* U */ | ||
1018 | { 2, 2, 0, 0, 10 }, /* V */ | ||
1019 | { 3, 2, 0, 0, 10 }, /* A */ | ||
1020 | }, | ||
1021 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
1022 | }, | ||
1023 | [AV_PIX_FMT_YUVA420P10LE] = { | ||
1024 | .name = "yuva420p10le", | ||
1025 | .nb_components = 4, | ||
1026 | .log2_chroma_w = 1, | ||
1027 | .log2_chroma_h = 1, | ||
1028 | .comp = { | ||
1029 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
1030 | { 1, 2, 0, 0, 10 }, /* U */ | ||
1031 | { 2, 2, 0, 0, 10 }, /* V */ | ||
1032 | { 3, 2, 0, 0, 10 }, /* A */ | ||
1033 | }, | ||
1034 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
1035 | }, | ||
1036 | [AV_PIX_FMT_YUVA422P10BE] = { | ||
1037 | .name = "yuva422p10be", | ||
1038 | .nb_components = 4, | ||
1039 | .log2_chroma_w = 1, | ||
1040 | .log2_chroma_h = 0, | ||
1041 | .comp = { | ||
1042 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
1043 | { 1, 2, 0, 0, 10 }, /* U */ | ||
1044 | { 2, 2, 0, 0, 10 }, /* V */ | ||
1045 | { 3, 2, 0, 0, 10 }, /* A */ | ||
1046 | }, | ||
1047 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
1048 | }, | ||
1049 | [AV_PIX_FMT_YUVA422P10LE] = { | ||
1050 | .name = "yuva422p10le", | ||
1051 | .nb_components = 4, | ||
1052 | .log2_chroma_w = 1, | ||
1053 | .log2_chroma_h = 0, | ||
1054 | .comp = { | ||
1055 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
1056 | { 1, 2, 0, 0, 10 }, /* U */ | ||
1057 | { 2, 2, 0, 0, 10 }, /* V */ | ||
1058 | { 3, 2, 0, 0, 10 }, /* A */ | ||
1059 | }, | ||
1060 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
1061 | }, | ||
1062 | [AV_PIX_FMT_YUVA444P10BE] = { | ||
1063 | .name = "yuva444p10be", | ||
1064 | .nb_components = 4, | ||
1065 | .log2_chroma_w = 0, | ||
1066 | .log2_chroma_h = 0, | ||
1067 | .comp = { | ||
1068 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
1069 | { 1, 2, 0, 0, 10 }, /* U */ | ||
1070 | { 2, 2, 0, 0, 10 }, /* V */ | ||
1071 | { 3, 2, 0, 0, 10 }, /* A */ | ||
1072 | }, | ||
1073 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
1074 | }, | ||
1075 | [AV_PIX_FMT_YUVA444P10LE] = { | ||
1076 | .name = "yuva444p10le", | ||
1077 | .nb_components = 4, | ||
1078 | .log2_chroma_w = 0, | ||
1079 | .log2_chroma_h = 0, | ||
1080 | .comp = { | ||
1081 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
1082 | { 1, 2, 0, 0, 10 }, /* U */ | ||
1083 | { 2, 2, 0, 0, 10 }, /* V */ | ||
1084 | { 3, 2, 0, 0, 10 }, /* A */ | ||
1085 | }, | ||
1086 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
1087 | }, | ||
1088 | [AV_PIX_FMT_YUVA420P16BE] = { | ||
1089 | .name = "yuva420p16be", | ||
1090 | .nb_components = 4, | ||
1091 | .log2_chroma_w = 1, | ||
1092 | .log2_chroma_h = 1, | ||
1093 | .comp = { | ||
1094 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
1095 | { 1, 2, 0, 0, 16 }, /* U */ | ||
1096 | { 2, 2, 0, 0, 16 }, /* V */ | ||
1097 | { 3, 2, 0, 0, 16 }, /* A */ | ||
1098 | }, | ||
1099 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
1100 | }, | ||
1101 | [AV_PIX_FMT_YUVA420P16LE] = { | ||
1102 | .name = "yuva420p16le", | ||
1103 | .nb_components = 4, | ||
1104 | .log2_chroma_w = 1, | ||
1105 | .log2_chroma_h = 1, | ||
1106 | .comp = { | ||
1107 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
1108 | { 1, 2, 0, 0, 16 }, /* U */ | ||
1109 | { 2, 2, 0, 0, 16 }, /* V */ | ||
1110 | { 3, 2, 0, 0, 16 }, /* A */ | ||
1111 | }, | ||
1112 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
1113 | }, | ||
1114 | [AV_PIX_FMT_YUVA422P16BE] = { | ||
1115 | .name = "yuva422p16be", | ||
1116 | .nb_components = 4, | ||
1117 | .log2_chroma_w = 1, | ||
1118 | .log2_chroma_h = 0, | ||
1119 | .comp = { | ||
1120 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
1121 | { 1, 2, 0, 0, 16 }, /* U */ | ||
1122 | { 2, 2, 0, 0, 16 }, /* V */ | ||
1123 | { 3, 2, 0, 0, 16 }, /* A */ | ||
1124 | }, | ||
1125 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
1126 | }, | ||
1127 | [AV_PIX_FMT_YUVA422P16LE] = { | ||
1128 | .name = "yuva422p16le", | ||
1129 | .nb_components = 4, | ||
1130 | .log2_chroma_w = 1, | ||
1131 | .log2_chroma_h = 0, | ||
1132 | .comp = { | ||
1133 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
1134 | { 1, 2, 0, 0, 16 }, /* U */ | ||
1135 | { 2, 2, 0, 0, 16 }, /* V */ | ||
1136 | { 3, 2, 0, 0, 16 }, /* A */ | ||
1137 | }, | ||
1138 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
1139 | }, | ||
1140 | [AV_PIX_FMT_YUVA444P16BE] = { | ||
1141 | .name = "yuva444p16be", | ||
1142 | .nb_components = 4, | ||
1143 | .log2_chroma_w = 0, | ||
1144 | .log2_chroma_h = 0, | ||
1145 | .comp = { | ||
1146 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
1147 | { 1, 2, 0, 0, 16 }, /* U */ | ||
1148 | { 2, 2, 0, 0, 16 }, /* V */ | ||
1149 | { 3, 2, 0, 0, 16 }, /* A */ | ||
1150 | }, | ||
1151 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
1152 | }, | ||
1153 | [AV_PIX_FMT_YUVA444P16LE] = { | ||
1154 | .name = "yuva444p16le", | ||
1155 | .nb_components = 4, | ||
1156 | .log2_chroma_w = 0, | ||
1157 | .log2_chroma_h = 0, | ||
1158 | .comp = { | ||
1159 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
1160 | { 1, 2, 0, 0, 16 }, /* U */ | ||
1161 | { 2, 2, 0, 0, 16 }, /* V */ | ||
1162 | { 3, 2, 0, 0, 16 }, /* A */ | ||
1163 | }, | ||
1164 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
1165 | }, | ||
1166 | [AV_PIX_FMT_RGB48BE] = { | ||
1167 | .name = "rgb48be", | ||
1168 | .nb_components = 3, | ||
1169 | .log2_chroma_w = 0, | ||
1170 | .log2_chroma_h = 0, | ||
1171 | .comp = { | ||
1172 | { 0, 6, 0, 0, 16 }, /* R */ | ||
1173 | { 0, 6, 2, 0, 16 }, /* G */ | ||
1174 | { 0, 6, 4, 0, 16 }, /* B */ | ||
1175 | }, | ||
1176 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BE, | ||
1177 | }, | ||
1178 | [AV_PIX_FMT_RGB48LE] = { | ||
1179 | .name = "rgb48le", | ||
1180 | .nb_components = 3, | ||
1181 | .log2_chroma_w = 0, | ||
1182 | .log2_chroma_h = 0, | ||
1183 | .comp = { | ||
1184 | { 0, 6, 0, 0, 16 }, /* R */ | ||
1185 | { 0, 6, 2, 0, 16 }, /* G */ | ||
1186 | { 0, 6, 4, 0, 16 }, /* B */ | ||
1187 | }, | ||
1188 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
1189 | }, | ||
1190 | [AV_PIX_FMT_RGBA64BE] = { | ||
1191 | .name = "rgba64be", | ||
1192 | .nb_components = 4, | ||
1193 | .log2_chroma_w = 0, | ||
1194 | .log2_chroma_h = 0, | ||
1195 | .comp = { | ||
1196 | { 0, 8, 0, 0, 16 }, /* R */ | ||
1197 | { 0, 8, 2, 0, 16 }, /* G */ | ||
1198 | { 0, 8, 4, 0, 16 }, /* B */ | ||
1199 | { 0, 8, 6, 0, 16 }, /* A */ | ||
1200 | }, | ||
1201 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, | ||
1202 | }, | ||
1203 | [AV_PIX_FMT_RGBA64LE] = { | ||
1204 | .name = "rgba64le", | ||
1205 | .nb_components = 4, | ||
1206 | .log2_chroma_w = 0, | ||
1207 | .log2_chroma_h = 0, | ||
1208 | .comp = { | ||
1209 | { 0, 8, 0, 0, 16 }, /* R */ | ||
1210 | { 0, 8, 2, 0, 16 }, /* G */ | ||
1211 | { 0, 8, 4, 0, 16 }, /* B */ | ||
1212 | { 0, 8, 6, 0, 16 }, /* A */ | ||
1213 | }, | ||
1214 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, | ||
1215 | }, | ||
1216 | [AV_PIX_FMT_RGB565BE] = { | ||
1217 | .name = "rgb565be", | ||
1218 | .nb_components = 3, | ||
1219 | .log2_chroma_w = 0, | ||
1220 | .log2_chroma_h = 0, | ||
1221 | .comp = { | ||
1222 | { 0, 2, -1, 3, 5 }, /* R */ | ||
1223 | { 0, 2, 0, 5, 6 }, /* G */ | ||
1224 | { 0, 2, 0, 0, 5 }, /* B */ | ||
1225 | }, | ||
1226 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB, | ||
1227 | }, | ||
1228 | [AV_PIX_FMT_RGB565LE] = { | ||
1229 | .name = "rgb565le", | ||
1230 | .nb_components = 3, | ||
1231 | .log2_chroma_w = 0, | ||
1232 | .log2_chroma_h = 0, | ||
1233 | .comp = { | ||
1234 | { 0, 2, 1, 3, 5 }, /* R */ | ||
1235 | { 0, 2, 0, 5, 6 }, /* G */ | ||
1236 | { 0, 2, 0, 0, 5 }, /* B */ | ||
1237 | }, | ||
1238 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
1239 | }, | ||
1240 | [AV_PIX_FMT_RGB555BE] = { | ||
1241 | .name = "rgb555be", | ||
1242 | .nb_components = 3, | ||
1243 | .log2_chroma_w = 0, | ||
1244 | .log2_chroma_h = 0, | ||
1245 | .comp = { | ||
1246 | { 0, 2, -1, 2, 5 }, /* R */ | ||
1247 | { 0, 2, 0, 5, 5 }, /* G */ | ||
1248 | { 0, 2, 0, 0, 5 }, /* B */ | ||
1249 | }, | ||
1250 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB, | ||
1251 | }, | ||
1252 | [AV_PIX_FMT_RGB555LE] = { | ||
1253 | .name = "rgb555le", | ||
1254 | .nb_components = 3, | ||
1255 | .log2_chroma_w = 0, | ||
1256 | .log2_chroma_h = 0, | ||
1257 | .comp = { | ||
1258 | { 0, 2, 1, 2, 5 }, /* R */ | ||
1259 | { 0, 2, 0, 5, 5 }, /* G */ | ||
1260 | { 0, 2, 0, 0, 5 }, /* B */ | ||
1261 | }, | ||
1262 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
1263 | }, | ||
1264 | [AV_PIX_FMT_RGB444BE] = { | ||
1265 | .name = "rgb444be", | ||
1266 | .nb_components = 3, | ||
1267 | .log2_chroma_w = 0, | ||
1268 | .log2_chroma_h = 0, | ||
1269 | .comp = { | ||
1270 | { 0, 2, -1, 0, 4 }, /* R */ | ||
1271 | { 0, 2, 0, 4, 4 }, /* G */ | ||
1272 | { 0, 2, 0, 0, 4 }, /* B */ | ||
1273 | }, | ||
1274 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB, | ||
1275 | }, | ||
1276 | [AV_PIX_FMT_RGB444LE] = { | ||
1277 | .name = "rgb444le", | ||
1278 | .nb_components = 3, | ||
1279 | .log2_chroma_w = 0, | ||
1280 | .log2_chroma_h = 0, | ||
1281 | .comp = { | ||
1282 | { 0, 2, 1, 0, 4 }, /* R */ | ||
1283 | { 0, 2, 0, 4, 4 }, /* G */ | ||
1284 | { 0, 2, 0, 0, 4 }, /* B */ | ||
1285 | }, | ||
1286 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
1287 | }, | ||
1288 | [AV_PIX_FMT_BGR48BE] = { | ||
1289 | .name = "bgr48be", | ||
1290 | .nb_components = 3, | ||
1291 | .log2_chroma_w = 0, | ||
1292 | .log2_chroma_h = 0, | ||
1293 | .comp = { | ||
1294 | { 0, 6, 4, 0, 16 }, /* R */ | ||
1295 | { 0, 6, 2, 0, 16 }, /* G */ | ||
1296 | { 0, 6, 0, 0, 16 }, /* B */ | ||
1297 | }, | ||
1298 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB, | ||
1299 | }, | ||
1300 | [AV_PIX_FMT_BGR48LE] = { | ||
1301 | .name = "bgr48le", | ||
1302 | .nb_components = 3, | ||
1303 | .log2_chroma_w = 0, | ||
1304 | .log2_chroma_h = 0, | ||
1305 | .comp = { | ||
1306 | { 0, 6, 4, 0, 16 }, /* R */ | ||
1307 | { 0, 6, 2, 0, 16 }, /* G */ | ||
1308 | { 0, 6, 0, 0, 16 }, /* B */ | ||
1309 | }, | ||
1310 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
1311 | }, | ||
1312 | [AV_PIX_FMT_BGRA64BE] = { | ||
1313 | .name = "bgra64be", | ||
1314 | .nb_components = 4, | ||
1315 | .log2_chroma_w = 0, | ||
1316 | .log2_chroma_h = 0, | ||
1317 | .comp = { | ||
1318 | { 0, 8, 4, 0, 16 }, /* R */ | ||
1319 | { 0, 8, 2, 0, 16 }, /* G */ | ||
1320 | { 0, 8, 0, 0, 16 }, /* B */ | ||
1321 | { 0, 8, 6, 0, 16 }, /* A */ | ||
1322 | }, | ||
1323 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, | ||
1324 | }, | ||
1325 | [AV_PIX_FMT_BGRA64LE] = { | ||
1326 | .name = "bgra64le", | ||
1327 | .nb_components = 4, | ||
1328 | .log2_chroma_w = 0, | ||
1329 | .log2_chroma_h = 0, | ||
1330 | .comp = { | ||
1331 | { 0, 8, 4, 0, 16 }, /* R */ | ||
1332 | { 0, 8, 2, 0, 16 }, /* G */ | ||
1333 | { 0, 8, 0, 0, 16 }, /* B */ | ||
1334 | { 0, 8, 6, 0, 16 }, /* A */ | ||
1335 | }, | ||
1336 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, | ||
1337 | }, | ||
1338 | [AV_PIX_FMT_BGR565BE] = { | ||
1339 | .name = "bgr565be", | ||
1340 | .nb_components = 3, | ||
1341 | .log2_chroma_w = 0, | ||
1342 | .log2_chroma_h = 0, | ||
1343 | .comp = { | ||
1344 | { 0, 2, 0, 0, 5 }, /* R */ | ||
1345 | { 0, 2, 0, 5, 6 }, /* G */ | ||
1346 | { 0, 2, -1, 3, 5 }, /* B */ | ||
1347 | }, | ||
1348 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB, | ||
1349 | }, | ||
1350 | [AV_PIX_FMT_BGR565LE] = { | ||
1351 | .name = "bgr565le", | ||
1352 | .nb_components = 3, | ||
1353 | .log2_chroma_w = 0, | ||
1354 | .log2_chroma_h = 0, | ||
1355 | .comp = { | ||
1356 | { 0, 2, 0, 0, 5 }, /* R */ | ||
1357 | { 0, 2, 0, 5, 6 }, /* G */ | ||
1358 | { 0, 2, 1, 3, 5 }, /* B */ | ||
1359 | }, | ||
1360 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
1361 | }, | ||
1362 | [AV_PIX_FMT_BGR555BE] = { | ||
1363 | .name = "bgr555be", | ||
1364 | .nb_components = 3, | ||
1365 | .log2_chroma_w = 0, | ||
1366 | .log2_chroma_h = 0, | ||
1367 | .comp = { | ||
1368 | { 0, 2, 0, 0, 5 }, /* R */ | ||
1369 | { 0, 2, 0, 5, 5 }, /* G */ | ||
1370 | { 0, 2, -1, 2, 5 }, /* B */ | ||
1371 | }, | ||
1372 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB, | ||
1373 | }, | ||
1374 | [AV_PIX_FMT_BGR555LE] = { | ||
1375 | .name = "bgr555le", | ||
1376 | .nb_components = 3, | ||
1377 | .log2_chroma_w = 0, | ||
1378 | .log2_chroma_h = 0, | ||
1379 | .comp = { | ||
1380 | { 0, 2, 0, 0, 5 }, /* R */ | ||
1381 | { 0, 2, 0, 5, 5 }, /* G */ | ||
1382 | { 0, 2, 1, 2, 5 }, /* B */ | ||
1383 | }, | ||
1384 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
1385 | }, | ||
1386 | [AV_PIX_FMT_BGR444BE] = { | ||
1387 | .name = "bgr444be", | ||
1388 | .nb_components = 3, | ||
1389 | .log2_chroma_w = 0, | ||
1390 | .log2_chroma_h = 0, | ||
1391 | .comp = { | ||
1392 | { 0, 2, 0, 0, 4 }, /* R */ | ||
1393 | { 0, 2, 0, 4, 4 }, /* G */ | ||
1394 | { 0, 2, -1, 0, 4 }, /* B */ | ||
1395 | }, | ||
1396 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB, | ||
1397 | }, | ||
1398 | [AV_PIX_FMT_BGR444LE] = { | ||
1399 | .name = "bgr444le", | ||
1400 | .nb_components = 3, | ||
1401 | .log2_chroma_w = 0, | ||
1402 | .log2_chroma_h = 0, | ||
1403 | .comp = { | ||
1404 | { 0, 2, 0, 0, 4 }, /* R */ | ||
1405 | { 0, 2, 0, 4, 4 }, /* G */ | ||
1406 | { 0, 2, 1, 0, 4 }, /* B */ | ||
1407 | }, | ||
1408 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
1409 | }, | ||
1410 | [AV_PIX_FMT_VAAPI] = { | ||
1411 | .name = "vaapi", | ||
1412 | .log2_chroma_w = 1, | ||
1413 | .log2_chroma_h = 1, | ||
1414 | .flags = AV_PIX_FMT_FLAG_HWACCEL, | ||
1415 | }, | ||
1416 | [AV_PIX_FMT_YUV420P9LE] = { | ||
1417 | .name = "yuv420p9le", | ||
1418 | .nb_components = 3, | ||
1419 | .log2_chroma_w = 1, | ||
1420 | .log2_chroma_h = 1, | ||
1421 | .comp = { | ||
1422 | { 0, 2, 0, 0, 9 }, /* Y */ | ||
1423 | { 1, 2, 0, 0, 9 }, /* U */ | ||
1424 | { 2, 2, 0, 0, 9 }, /* V */ | ||
1425 | }, | ||
1426 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
1427 | }, | ||
1428 | [AV_PIX_FMT_YUV420P9BE] = { | ||
1429 | .name = "yuv420p9be", | ||
1430 | .nb_components = 3, | ||
1431 | .log2_chroma_w = 1, | ||
1432 | .log2_chroma_h = 1, | ||
1433 | .comp = { | ||
1434 | { 0, 2, 0, 0, 9 }, /* Y */ | ||
1435 | { 1, 2, 0, 0, 9 }, /* U */ | ||
1436 | { 2, 2, 0, 0, 9 }, /* V */ | ||
1437 | }, | ||
1438 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
1439 | }, | ||
1440 | [AV_PIX_FMT_YUV420P10LE] = { | ||
1441 | .name = "yuv420p10le", | ||
1442 | .nb_components = 3, | ||
1443 | .log2_chroma_w = 1, | ||
1444 | .log2_chroma_h = 1, | ||
1445 | .comp = { | ||
1446 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
1447 | { 1, 2, 0, 0, 10 }, /* U */ | ||
1448 | { 2, 2, 0, 0, 10 }, /* V */ | ||
1449 | }, | ||
1450 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
1451 | }, | ||
1452 | [AV_PIX_FMT_YUV420P10BE] = { | ||
1453 | .name = "yuv420p10be", | ||
1454 | .nb_components = 3, | ||
1455 | .log2_chroma_w = 1, | ||
1456 | .log2_chroma_h = 1, | ||
1457 | .comp = { | ||
1458 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
1459 | { 1, 2, 0, 0, 10 }, /* U */ | ||
1460 | { 2, 2, 0, 0, 10 }, /* V */ | ||
1461 | }, | ||
1462 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
1463 | }, | ||
1464 | [AV_PIX_FMT_YUV420P12LE] = { | ||
1465 | .name = "yuv420p12le", | ||
1466 | .nb_components = 3, | ||
1467 | .log2_chroma_w = 1, | ||
1468 | .log2_chroma_h = 1, | ||
1469 | .comp = { | ||
1470 | { 0, 2, 0, 0, 12 }, /* Y */ | ||
1471 | { 1, 2, 0, 0, 12 }, /* U */ | ||
1472 | { 2, 2, 0, 0, 12 }, /* V */ | ||
1473 | }, | ||
1474 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
1475 | }, | ||
1476 | [AV_PIX_FMT_YUV420P12BE] = { | ||
1477 | .name = "yuv420p12be", | ||
1478 | .nb_components = 3, | ||
1479 | .log2_chroma_w = 1, | ||
1480 | .log2_chroma_h = 1, | ||
1481 | .comp = { | ||
1482 | { 0, 2, 0, 0, 12 }, /* Y */ | ||
1483 | { 1, 2, 0, 0, 12 }, /* U */ | ||
1484 | { 2, 2, 0, 0, 12 }, /* V */ | ||
1485 | }, | ||
1486 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
1487 | }, | ||
1488 | [AV_PIX_FMT_YUV420P14LE] = { | ||
1489 | .name = "yuv420p14le", | ||
1490 | .nb_components = 3, | ||
1491 | .log2_chroma_w = 1, | ||
1492 | .log2_chroma_h = 1, | ||
1493 | .comp = { | ||
1494 | { 0, 2, 0, 0, 14 }, /* Y */ | ||
1495 | { 1, 2, 0, 0, 14 }, /* U */ | ||
1496 | { 2, 2, 0, 0, 14 }, /* V */ | ||
1497 | }, | ||
1498 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
1499 | }, | ||
1500 | [AV_PIX_FMT_YUV420P14BE] = { | ||
1501 | .name = "yuv420p14be", | ||
1502 | .nb_components = 3, | ||
1503 | .log2_chroma_w = 1, | ||
1504 | .log2_chroma_h = 1, | ||
1505 | .comp = { | ||
1506 | { 0, 2, 0, 0, 14 }, /* Y */ | ||
1507 | { 1, 2, 0, 0, 14 }, /* U */ | ||
1508 | { 2, 2, 0, 0, 14 }, /* V */ | ||
1509 | }, | ||
1510 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
1511 | }, | ||
1512 | [AV_PIX_FMT_YUV420P16LE] = { | ||
1513 | .name = "yuv420p16le", | ||
1514 | .nb_components = 3, | ||
1515 | .log2_chroma_w = 1, | ||
1516 | .log2_chroma_h = 1, | ||
1517 | .comp = { | ||
1518 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
1519 | { 1, 2, 0, 0, 16 }, /* U */ | ||
1520 | { 2, 2, 0, 0, 16 }, /* V */ | ||
1521 | }, | ||
1522 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
1523 | }, | ||
1524 | [AV_PIX_FMT_YUV420P16BE] = { | ||
1525 | .name = "yuv420p16be", | ||
1526 | .nb_components = 3, | ||
1527 | .log2_chroma_w = 1, | ||
1528 | .log2_chroma_h = 1, | ||
1529 | .comp = { | ||
1530 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
1531 | { 1, 2, 0, 0, 16 }, /* U */ | ||
1532 | { 2, 2, 0, 0, 16 }, /* V */ | ||
1533 | }, | ||
1534 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
1535 | }, | ||
1536 | [AV_PIX_FMT_YUV422P9LE] = { | ||
1537 | .name = "yuv422p9le", | ||
1538 | .nb_components = 3, | ||
1539 | .log2_chroma_w = 1, | ||
1540 | .log2_chroma_h = 0, | ||
1541 | .comp = { | ||
1542 | { 0, 2, 0, 0, 9 }, /* Y */ | ||
1543 | { 1, 2, 0, 0, 9 }, /* U */ | ||
1544 | { 2, 2, 0, 0, 9 }, /* V */ | ||
1545 | }, | ||
1546 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
1547 | }, | ||
1548 | [AV_PIX_FMT_YUV422P9BE] = { | ||
1549 | .name = "yuv422p9be", | ||
1550 | .nb_components = 3, | ||
1551 | .log2_chroma_w = 1, | ||
1552 | .log2_chroma_h = 0, | ||
1553 | .comp = { | ||
1554 | { 0, 2, 0, 0, 9 }, /* Y */ | ||
1555 | { 1, 2, 0, 0, 9 }, /* U */ | ||
1556 | { 2, 2, 0, 0, 9 }, /* V */ | ||
1557 | }, | ||
1558 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
1559 | }, | ||
1560 | [AV_PIX_FMT_YUV422P10LE] = { | ||
1561 | .name = "yuv422p10le", | ||
1562 | .nb_components = 3, | ||
1563 | .log2_chroma_w = 1, | ||
1564 | .log2_chroma_h = 0, | ||
1565 | .comp = { | ||
1566 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
1567 | { 1, 2, 0, 0, 10 }, /* U */ | ||
1568 | { 2, 2, 0, 0, 10 }, /* V */ | ||
1569 | }, | ||
1570 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
1571 | }, | ||
1572 | [AV_PIX_FMT_YUV422P10BE] = { | ||
1573 | .name = "yuv422p10be", | ||
1574 | .nb_components = 3, | ||
1575 | .log2_chroma_w = 1, | ||
1576 | .log2_chroma_h = 0, | ||
1577 | .comp = { | ||
1578 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
1579 | { 1, 2, 0, 0, 10 }, /* U */ | ||
1580 | { 2, 2, 0, 0, 10 }, /* V */ | ||
1581 | }, | ||
1582 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
1583 | }, | ||
1584 | [AV_PIX_FMT_YUV422P12LE] = { | ||
1585 | .name = "yuv422p12le", | ||
1586 | .nb_components = 3, | ||
1587 | .log2_chroma_w = 1, | ||
1588 | .log2_chroma_h = 0, | ||
1589 | .comp = { | ||
1590 | { 0, 2, 0, 0, 12 }, /* Y */ | ||
1591 | { 1, 2, 0, 0, 12 }, /* U */ | ||
1592 | { 2, 2, 0, 0, 12 }, /* V */ | ||
1593 | }, | ||
1594 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
1595 | }, | ||
1596 | [AV_PIX_FMT_YUV422P12BE] = { | ||
1597 | .name = "yuv422p12be", | ||
1598 | .nb_components = 3, | ||
1599 | .log2_chroma_w = 1, | ||
1600 | .log2_chroma_h = 0, | ||
1601 | .comp = { | ||
1602 | { 0, 2, 0, 0, 12 }, /* Y */ | ||
1603 | { 1, 2, 0, 0, 12 }, /* U */ | ||
1604 | { 2, 2, 0, 0, 12 }, /* V */ | ||
1605 | }, | ||
1606 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
1607 | }, | ||
1608 | [AV_PIX_FMT_YUV422P14LE] = { | ||
1609 | .name = "yuv422p14le", | ||
1610 | .nb_components = 3, | ||
1611 | .log2_chroma_w = 1, | ||
1612 | .log2_chroma_h = 0, | ||
1613 | .comp = { | ||
1614 | { 0, 2, 0, 0, 14 }, /* Y */ | ||
1615 | { 1, 2, 0, 0, 14 }, /* U */ | ||
1616 | { 2, 2, 0, 0, 14 }, /* V */ | ||
1617 | }, | ||
1618 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
1619 | }, | ||
1620 | [AV_PIX_FMT_YUV422P14BE] = { | ||
1621 | .name = "yuv422p14be", | ||
1622 | .nb_components = 3, | ||
1623 | .log2_chroma_w = 1, | ||
1624 | .log2_chroma_h = 0, | ||
1625 | .comp = { | ||
1626 | { 0, 2, 0, 0, 14 }, /* Y */ | ||
1627 | { 1, 2, 0, 0, 14 }, /* U */ | ||
1628 | { 2, 2, 0, 0, 14 }, /* V */ | ||
1629 | }, | ||
1630 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
1631 | }, | ||
1632 | [AV_PIX_FMT_YUV422P16LE] = { | ||
1633 | .name = "yuv422p16le", | ||
1634 | .nb_components = 3, | ||
1635 | .log2_chroma_w = 1, | ||
1636 | .log2_chroma_h = 0, | ||
1637 | .comp = { | ||
1638 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
1639 | { 1, 2, 0, 0, 16 }, /* U */ | ||
1640 | { 2, 2, 0, 0, 16 }, /* V */ | ||
1641 | }, | ||
1642 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
1643 | }, | ||
1644 | [AV_PIX_FMT_YUV422P16BE] = { | ||
1645 | .name = "yuv422p16be", | ||
1646 | .nb_components = 3, | ||
1647 | .log2_chroma_w = 1, | ||
1648 | .log2_chroma_h = 0, | ||
1649 | .comp = { | ||
1650 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
1651 | { 1, 2, 0, 0, 16 }, /* U */ | ||
1652 | { 2, 2, 0, 0, 16 }, /* V */ | ||
1653 | }, | ||
1654 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
1655 | }, | ||
1656 | [AV_PIX_FMT_YUV444P16LE] = { | ||
1657 | .name = "yuv444p16le", | ||
1658 | .nb_components = 3, | ||
1659 | .log2_chroma_w = 0, | ||
1660 | .log2_chroma_h = 0, | ||
1661 | .comp = { | ||
1662 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
1663 | { 1, 2, 0, 0, 16 }, /* U */ | ||
1664 | { 2, 2, 0, 0, 16 }, /* V */ | ||
1665 | }, | ||
1666 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
1667 | }, | ||
1668 | [AV_PIX_FMT_YUV444P16BE] = { | ||
1669 | .name = "yuv444p16be", | ||
1670 | .nb_components = 3, | ||
1671 | .log2_chroma_w = 0, | ||
1672 | .log2_chroma_h = 0, | ||
1673 | .comp = { | ||
1674 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
1675 | { 1, 2, 0, 0, 16 }, /* U */ | ||
1676 | { 2, 2, 0, 0, 16 }, /* V */ | ||
1677 | }, | ||
1678 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
1679 | }, | ||
1680 | [AV_PIX_FMT_YUV444P10LE] = { | ||
1681 | .name = "yuv444p10le", | ||
1682 | .nb_components = 3, | ||
1683 | .log2_chroma_w = 0, | ||
1684 | .log2_chroma_h = 0, | ||
1685 | .comp = { | ||
1686 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
1687 | { 1, 2, 0, 0, 10 }, /* U */ | ||
1688 | { 2, 2, 0, 0, 10 }, /* V */ | ||
1689 | }, | ||
1690 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
1691 | }, | ||
1692 | [AV_PIX_FMT_YUV444P10BE] = { | ||
1693 | .name = "yuv444p10be", | ||
1694 | .nb_components = 3, | ||
1695 | .log2_chroma_w = 0, | ||
1696 | .log2_chroma_h = 0, | ||
1697 | .comp = { | ||
1698 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
1699 | { 1, 2, 0, 0, 10 }, /* U */ | ||
1700 | { 2, 2, 0, 0, 10 }, /* V */ | ||
1701 | }, | ||
1702 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
1703 | }, | ||
1704 | [AV_PIX_FMT_YUV444P9LE] = { | ||
1705 | .name = "yuv444p9le", | ||
1706 | .nb_components = 3, | ||
1707 | .log2_chroma_w = 0, | ||
1708 | .log2_chroma_h = 0, | ||
1709 | .comp = { | ||
1710 | { 0, 2, 0, 0, 9 }, /* Y */ | ||
1711 | { 1, 2, 0, 0, 9 }, /* U */ | ||
1712 | { 2, 2, 0, 0, 9 }, /* V */ | ||
1713 | }, | ||
1714 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
1715 | }, | ||
1716 | [AV_PIX_FMT_YUV444P9BE] = { | ||
1717 | .name = "yuv444p9be", | ||
1718 | .nb_components = 3, | ||
1719 | .log2_chroma_w = 0, | ||
1720 | .log2_chroma_h = 0, | ||
1721 | .comp = { | ||
1722 | { 0, 2, 0, 0, 9 }, /* Y */ | ||
1723 | { 1, 2, 0, 0, 9 }, /* U */ | ||
1724 | { 2, 2, 0, 0, 9 }, /* V */ | ||
1725 | }, | ||
1726 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
1727 | }, | ||
1728 | [AV_PIX_FMT_YUV444P12LE] = { | ||
1729 | .name = "yuv444p12le", | ||
1730 | .nb_components = 3, | ||
1731 | .log2_chroma_w = 0, | ||
1732 | .log2_chroma_h = 0, | ||
1733 | .comp = { | ||
1734 | { 0, 2, 0, 0, 12 }, /* Y */ | ||
1735 | { 1, 2, 0, 0, 12 }, /* U */ | ||
1736 | { 2, 2, 0, 0, 12 }, /* V */ | ||
1737 | }, | ||
1738 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
1739 | }, | ||
1740 | [AV_PIX_FMT_YUV444P12BE] = { | ||
1741 | .name = "yuv444p12be", | ||
1742 | .nb_components = 3, | ||
1743 | .log2_chroma_w = 0, | ||
1744 | .log2_chroma_h = 0, | ||
1745 | .comp = { | ||
1746 | { 0, 2, 0, 0, 12 }, /* Y */ | ||
1747 | { 1, 2, 0, 0, 12 }, /* U */ | ||
1748 | { 2, 2, 0, 0, 12 }, /* V */ | ||
1749 | }, | ||
1750 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
1751 | }, | ||
1752 | [AV_PIX_FMT_YUV444P14LE] = { | ||
1753 | .name = "yuv444p14le", | ||
1754 | .nb_components = 3, | ||
1755 | .log2_chroma_w = 0, | ||
1756 | .log2_chroma_h = 0, | ||
1757 | .comp = { | ||
1758 | { 0, 2, 0, 0, 14 }, /* Y */ | ||
1759 | { 1, 2, 0, 0, 14 }, /* U */ | ||
1760 | { 2, 2, 0, 0, 14 }, /* V */ | ||
1761 | }, | ||
1762 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
1763 | }, | ||
1764 | [AV_PIX_FMT_YUV444P14BE] = { | ||
1765 | .name = "yuv444p14be", | ||
1766 | .nb_components = 3, | ||
1767 | .log2_chroma_w = 0, | ||
1768 | .log2_chroma_h = 0, | ||
1769 | .comp = { | ||
1770 | { 0, 2, 0, 0, 14 }, /* Y */ | ||
1771 | { 1, 2, 0, 0, 14 }, /* U */ | ||
1772 | { 2, 2, 0, 0, 14 }, /* V */ | ||
1773 | }, | ||
1774 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, | ||
1775 | }, | ||
1776 | [AV_PIX_FMT_D3D11VA_VLD] = { | ||
1777 | .name = "d3d11va_vld", | ||
1778 | .log2_chroma_w = 1, | ||
1779 | .log2_chroma_h = 1, | ||
1780 | .flags = AV_PIX_FMT_FLAG_HWACCEL, | ||
1781 | }, | ||
1782 | [AV_PIX_FMT_DXVA2_VLD] = { | ||
1783 | .name = "dxva2_vld", | ||
1784 | .log2_chroma_w = 1, | ||
1785 | .log2_chroma_h = 1, | ||
1786 | .flags = AV_PIX_FMT_FLAG_HWACCEL, | ||
1787 | }, | ||
1788 | [AV_PIX_FMT_YA8] = { | ||
1789 | .name = "ya8", | ||
1790 | .nb_components = 2, | ||
1791 | .comp = { | ||
1792 | { 0, 2, 0, 0, 8 }, /* Y */ | ||
1793 | { 0, 2, 1, 0, 8 }, /* A */ | ||
1794 | }, | ||
1795 | .flags = AV_PIX_FMT_FLAG_ALPHA, | ||
1796 | .alias = "gray8a", | ||
1797 | }, | ||
1798 | [AV_PIX_FMT_YA16LE] = { | ||
1799 | .name = "ya16le", | ||
1800 | .nb_components = 2, | ||
1801 | .comp = { | ||
1802 | { 0, 4, 0, 0, 16 }, /* Y */ | ||
1803 | { 0, 4, 2, 0, 16 }, /* A */ | ||
1804 | }, | ||
1805 | .flags = AV_PIX_FMT_FLAG_ALPHA, | ||
1806 | }, | ||
1807 | [AV_PIX_FMT_YA16BE] = { | ||
1808 | .name = "ya16be", | ||
1809 | .nb_components = 2, | ||
1810 | .comp = { | ||
1811 | { 0, 4, 0, 0, 16 }, /* Y */ | ||
1812 | { 0, 4, 2, 0, 16 }, /* A */ | ||
1813 | }, | ||
1814 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_ALPHA, | ||
1815 | }, | ||
1816 | [AV_PIX_FMT_VIDEOTOOLBOX] = { | ||
1817 | .name = "videotoolbox_vld", | ||
1818 | .flags = AV_PIX_FMT_FLAG_HWACCEL, | ||
1819 | }, | ||
1820 | [AV_PIX_FMT_GBRP] = { | ||
1821 | .name = "gbrp", | ||
1822 | .nb_components = 3, | ||
1823 | .log2_chroma_w = 0, | ||
1824 | .log2_chroma_h = 0, | ||
1825 | .comp = { | ||
1826 | { 2, 1, 0, 0, 8 }, /* R */ | ||
1827 | { 0, 1, 0, 0, 8 }, /* G */ | ||
1828 | { 1, 1, 0, 0, 8 }, /* B */ | ||
1829 | }, | ||
1830 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB, | ||
1831 | }, | ||
1832 | [AV_PIX_FMT_GBRP9LE] = { | ||
1833 | .name = "gbrp9le", | ||
1834 | .nb_components = 3, | ||
1835 | .log2_chroma_w = 0, | ||
1836 | .log2_chroma_h = 0, | ||
1837 | .comp = { | ||
1838 | { 2, 2, 0, 0, 9 }, /* R */ | ||
1839 | { 0, 2, 0, 0, 9 }, /* G */ | ||
1840 | { 1, 2, 0, 0, 9 }, /* B */ | ||
1841 | }, | ||
1842 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB, | ||
1843 | }, | ||
1844 | [AV_PIX_FMT_GBRP9BE] = { | ||
1845 | .name = "gbrp9be", | ||
1846 | .nb_components = 3, | ||
1847 | .log2_chroma_w = 0, | ||
1848 | .log2_chroma_h = 0, | ||
1849 | .comp = { | ||
1850 | { 2, 2, 0, 0, 9 }, /* R */ | ||
1851 | { 0, 2, 0, 0, 9 }, /* G */ | ||
1852 | { 1, 2, 0, 0, 9 }, /* B */ | ||
1853 | }, | ||
1854 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB, | ||
1855 | }, | ||
1856 | [AV_PIX_FMT_GBRP10LE] = { | ||
1857 | .name = "gbrp10le", | ||
1858 | .nb_components = 3, | ||
1859 | .log2_chroma_w = 0, | ||
1860 | .log2_chroma_h = 0, | ||
1861 | .comp = { | ||
1862 | { 2, 2, 0, 0, 10 }, /* R */ | ||
1863 | { 0, 2, 0, 0, 10 }, /* G */ | ||
1864 | { 1, 2, 0, 0, 10 }, /* B */ | ||
1865 | }, | ||
1866 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB, | ||
1867 | }, | ||
1868 | [AV_PIX_FMT_GBRP10BE] = { | ||
1869 | .name = "gbrp10be", | ||
1870 | .nb_components = 3, | ||
1871 | .log2_chroma_w = 0, | ||
1872 | .log2_chroma_h = 0, | ||
1873 | .comp = { | ||
1874 | { 2, 2, 0, 0, 10 }, /* R */ | ||
1875 | { 0, 2, 0, 0, 10 }, /* G */ | ||
1876 | { 1, 2, 0, 0, 10 }, /* B */ | ||
1877 | }, | ||
1878 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB, | ||
1879 | }, | ||
1880 | [AV_PIX_FMT_GBRP12LE] = { | ||
1881 | .name = "gbrp12le", | ||
1882 | .nb_components = 3, | ||
1883 | .log2_chroma_w = 0, | ||
1884 | .log2_chroma_h = 0, | ||
1885 | .comp = { | ||
1886 | { 2, 2, 0, 0, 12 }, /* R */ | ||
1887 | { 0, 2, 0, 0, 12 }, /* G */ | ||
1888 | { 1, 2, 0, 0, 12 }, /* B */ | ||
1889 | }, | ||
1890 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB, | ||
1891 | }, | ||
1892 | [AV_PIX_FMT_GBRP12BE] = { | ||
1893 | .name = "gbrp12be", | ||
1894 | .nb_components = 3, | ||
1895 | .log2_chroma_w = 0, | ||
1896 | .log2_chroma_h = 0, | ||
1897 | .comp = { | ||
1898 | { 2, 2, 0, 0, 12 }, /* R */ | ||
1899 | { 0, 2, 0, 0, 12 }, /* G */ | ||
1900 | { 1, 2, 0, 0, 12 }, /* B */ | ||
1901 | }, | ||
1902 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB, | ||
1903 | }, | ||
1904 | [AV_PIX_FMT_GBRP14LE] = { | ||
1905 | .name = "gbrp14le", | ||
1906 | .nb_components = 3, | ||
1907 | .log2_chroma_w = 0, | ||
1908 | .log2_chroma_h = 0, | ||
1909 | .comp = { | ||
1910 | { 2, 2, 0, 0, 14 }, /* R */ | ||
1911 | { 0, 2, 0, 0, 14 }, /* G */ | ||
1912 | { 1, 2, 0, 0, 14 }, /* B */ | ||
1913 | }, | ||
1914 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB, | ||
1915 | }, | ||
1916 | [AV_PIX_FMT_GBRP14BE] = { | ||
1917 | .name = "gbrp14be", | ||
1918 | .nb_components = 3, | ||
1919 | .log2_chroma_w = 0, | ||
1920 | .log2_chroma_h = 0, | ||
1921 | .comp = { | ||
1922 | { 2, 2, 0, 0, 14 }, /* R */ | ||
1923 | { 0, 2, 0, 0, 14 }, /* G */ | ||
1924 | { 1, 2, 0, 0, 14 }, /* B */ | ||
1925 | }, | ||
1926 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB, | ||
1927 | }, | ||
1928 | [AV_PIX_FMT_GBRP16LE] = { | ||
1929 | .name = "gbrp16le", | ||
1930 | .nb_components = 3, | ||
1931 | .log2_chroma_w = 0, | ||
1932 | .log2_chroma_h = 0, | ||
1933 | .comp = { | ||
1934 | { 2, 2, 0, 0, 16 }, /* R */ | ||
1935 | { 0, 2, 0, 0, 16 }, /* G */ | ||
1936 | { 1, 2, 0, 0, 16 }, /* B */ | ||
1937 | }, | ||
1938 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB, | ||
1939 | }, | ||
1940 | [AV_PIX_FMT_GBRP16BE] = { | ||
1941 | .name = "gbrp16be", | ||
1942 | .nb_components = 3, | ||
1943 | .log2_chroma_w = 0, | ||
1944 | .log2_chroma_h = 0, | ||
1945 | .comp = { | ||
1946 | { 2, 2, 0, 0, 16 }, /* R */ | ||
1947 | { 0, 2, 0, 0, 16 }, /* G */ | ||
1948 | { 1, 2, 0, 0, 16 }, /* B */ | ||
1949 | }, | ||
1950 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB, | ||
1951 | }, | ||
1952 | [AV_PIX_FMT_GBRAP] = { | ||
1953 | .name = "gbrap", | ||
1954 | .nb_components = 4, | ||
1955 | .log2_chroma_w = 0, | ||
1956 | .log2_chroma_h = 0, | ||
1957 | .comp = { | ||
1958 | { 2, 1, 0, 0, 8 }, /* R */ | ||
1959 | { 0, 1, 0, 0, 8 }, /* G */ | ||
1960 | { 1, 1, 0, 0, 8 }, /* B */ | ||
1961 | { 3, 1, 0, 0, 8 }, /* A */ | ||
1962 | }, | ||
1963 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | | ||
1964 | AV_PIX_FMT_FLAG_ALPHA, | ||
1965 | }, | ||
1966 | [AV_PIX_FMT_GBRAP16LE] = { | ||
1967 | .name = "gbrap16le", | ||
1968 | .nb_components = 4, | ||
1969 | .log2_chroma_w = 0, | ||
1970 | .log2_chroma_h = 0, | ||
1971 | .comp = { | ||
1972 | { 2, 2, 0, 0, 16 }, /* R */ | ||
1973 | { 0, 2, 0, 0, 16 }, /* G */ | ||
1974 | { 1, 2, 0, 0, 16 }, /* B */ | ||
1975 | { 3, 2, 0, 0, 16 }, /* A */ | ||
1976 | }, | ||
1977 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | | ||
1978 | AV_PIX_FMT_FLAG_ALPHA, | ||
1979 | }, | ||
1980 | [AV_PIX_FMT_GBRAP16BE] = { | ||
1981 | .name = "gbrap16be", | ||
1982 | .nb_components = 4, | ||
1983 | .log2_chroma_w = 0, | ||
1984 | .log2_chroma_h = 0, | ||
1985 | .comp = { | ||
1986 | { 2, 2, 0, 0, 16 }, /* R */ | ||
1987 | { 0, 2, 0, 0, 16 }, /* G */ | ||
1988 | { 1, 2, 0, 0, 16 }, /* B */ | ||
1989 | { 3, 2, 0, 0, 16 }, /* A */ | ||
1990 | }, | ||
1991 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | | ||
1992 | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, | ||
1993 | }, | ||
1994 | [AV_PIX_FMT_GBRAP32LE] = { | ||
1995 | .name = "gbrap32le", | ||
1996 | .nb_components = 4, | ||
1997 | .log2_chroma_w = 0, | ||
1998 | .log2_chroma_h = 0, | ||
1999 | .comp = { | ||
2000 | { 2, 4, 0, 0, 32 }, /* R */ | ||
2001 | { 0, 4, 0, 0, 32 }, /* G */ | ||
2002 | { 1, 4, 0, 0, 32 }, /* B */ | ||
2003 | { 3, 4, 0, 0, 32 }, /* A */ | ||
2004 | }, | ||
2005 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | | ||
2006 | AV_PIX_FMT_FLAG_ALPHA, | ||
2007 | }, | ||
2008 | [AV_PIX_FMT_GBRAP32BE] = { | ||
2009 | .name = "gbrap32be", | ||
2010 | .nb_components = 4, | ||
2011 | .log2_chroma_w = 0, | ||
2012 | .log2_chroma_h = 0, | ||
2013 | .comp = { | ||
2014 | { 2, 4, 0, 0, 32 }, /* R */ | ||
2015 | { 0, 4, 0, 0, 32 }, /* G */ | ||
2016 | { 1, 4, 0, 0, 32 }, /* B */ | ||
2017 | { 3, 4, 0, 0, 32 }, /* A */ | ||
2018 | }, | ||
2019 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | | ||
2020 | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, | ||
2021 | }, | ||
2022 | [AV_PIX_FMT_VDPAU] = { | ||
2023 | .name = "vdpau", | ||
2024 | .log2_chroma_w = 1, | ||
2025 | .log2_chroma_h = 1, | ||
2026 | .flags = AV_PIX_FMT_FLAG_HWACCEL, | ||
2027 | }, | ||
2028 | [AV_PIX_FMT_XYZ12LE] = { | ||
2029 | .name = "xyz12le", | ||
2030 | .nb_components = 3, | ||
2031 | .log2_chroma_w = 0, | ||
2032 | .log2_chroma_h = 0, | ||
2033 | .comp = { | ||
2034 | { 0, 6, 0, 4, 12 }, /* X */ | ||
2035 | { 0, 6, 2, 4, 12 }, /* Y */ | ||
2036 | { 0, 6, 4, 4, 12 }, /* Z */ | ||
2037 | }, | ||
2038 | .flags = AV_PIX_FMT_FLAG_XYZ, | ||
2039 | }, | ||
2040 | [AV_PIX_FMT_XYZ12BE] = { | ||
2041 | .name = "xyz12be", | ||
2042 | .nb_components = 3, | ||
2043 | .log2_chroma_w = 0, | ||
2044 | .log2_chroma_h = 0, | ||
2045 | .comp = { | ||
2046 | { 0, 6, 0, 4, 12 }, /* X */ | ||
2047 | { 0, 6, 2, 4, 12 }, /* Y */ | ||
2048 | { 0, 6, 4, 4, 12 }, /* Z */ | ||
2049 | }, | ||
2050 | .flags = AV_PIX_FMT_FLAG_XYZ | AV_PIX_FMT_FLAG_BE, | ||
2051 | }, | ||
2052 | |||
2053 | #define BAYER8_DESC_COMMON \ | ||
2054 | .nb_components= 3, \ | ||
2055 | .log2_chroma_w= 0, \ | ||
2056 | .log2_chroma_h= 0, \ | ||
2057 | .comp = { \ | ||
2058 | { 0, 1, 0, 0, 2 }, \ | ||
2059 | { 0, 1, 0, 0, 4 }, \ | ||
2060 | { 0, 1, 0, 0, 2 }, \ | ||
2061 | }, \ | ||
2062 | |||
2063 | #define BAYER16_DESC_COMMON \ | ||
2064 | .nb_components= 3, \ | ||
2065 | .log2_chroma_w= 0, \ | ||
2066 | .log2_chroma_h= 0, \ | ||
2067 | .comp = { \ | ||
2068 | { 0, 2, 0, 0, 4 }, \ | ||
2069 | { 0, 2, 0, 0, 8 }, \ | ||
2070 | { 0, 2, 0, 0, 4 }, \ | ||
2071 | }, \ | ||
2072 | |||
2073 | [AV_PIX_FMT_BAYER_BGGR8] = { | ||
2074 | .name = "bayer_bggr8", | ||
2075 | BAYER8_DESC_COMMON | ||
2076 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER, | ||
2077 | }, | ||
2078 | [AV_PIX_FMT_BAYER_BGGR16LE] = { | ||
2079 | .name = "bayer_bggr16le", | ||
2080 | BAYER16_DESC_COMMON | ||
2081 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER, | ||
2082 | }, | ||
2083 | [AV_PIX_FMT_BAYER_BGGR16BE] = { | ||
2084 | .name = "bayer_bggr16be", | ||
2085 | BAYER16_DESC_COMMON | ||
2086 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER, | ||
2087 | }, | ||
2088 | [AV_PIX_FMT_BAYER_RGGB8] = { | ||
2089 | .name = "bayer_rggb8", | ||
2090 | BAYER8_DESC_COMMON | ||
2091 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER, | ||
2092 | }, | ||
2093 | [AV_PIX_FMT_BAYER_RGGB16LE] = { | ||
2094 | .name = "bayer_rggb16le", | ||
2095 | BAYER16_DESC_COMMON | ||
2096 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER, | ||
2097 | }, | ||
2098 | [AV_PIX_FMT_BAYER_RGGB16BE] = { | ||
2099 | .name = "bayer_rggb16be", | ||
2100 | BAYER16_DESC_COMMON | ||
2101 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER, | ||
2102 | }, | ||
2103 | [AV_PIX_FMT_BAYER_GBRG8] = { | ||
2104 | .name = "bayer_gbrg8", | ||
2105 | BAYER8_DESC_COMMON | ||
2106 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER, | ||
2107 | }, | ||
2108 | [AV_PIX_FMT_BAYER_GBRG16LE] = { | ||
2109 | .name = "bayer_gbrg16le", | ||
2110 | BAYER16_DESC_COMMON | ||
2111 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER, | ||
2112 | }, | ||
2113 | [AV_PIX_FMT_BAYER_GBRG16BE] = { | ||
2114 | .name = "bayer_gbrg16be", | ||
2115 | BAYER16_DESC_COMMON | ||
2116 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER, | ||
2117 | }, | ||
2118 | [AV_PIX_FMT_BAYER_GRBG8] = { | ||
2119 | .name = "bayer_grbg8", | ||
2120 | BAYER8_DESC_COMMON | ||
2121 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER, | ||
2122 | }, | ||
2123 | [AV_PIX_FMT_BAYER_GRBG16LE] = { | ||
2124 | .name = "bayer_grbg16le", | ||
2125 | BAYER16_DESC_COMMON | ||
2126 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER, | ||
2127 | }, | ||
2128 | [AV_PIX_FMT_BAYER_GRBG16BE] = { | ||
2129 | .name = "bayer_grbg16be", | ||
2130 | BAYER16_DESC_COMMON | ||
2131 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER, | ||
2132 | }, | ||
2133 | [AV_PIX_FMT_NV16] = { | ||
2134 | .name = "nv16", | ||
2135 | .nb_components = 3, | ||
2136 | .log2_chroma_w = 1, | ||
2137 | .log2_chroma_h = 0, | ||
2138 | .comp = { | ||
2139 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
2140 | { 1, 2, 0, 0, 8 }, /* U */ | ||
2141 | { 1, 2, 1, 0, 8 }, /* V */ | ||
2142 | }, | ||
2143 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
2144 | }, | ||
2145 | [AV_PIX_FMT_NV20LE] = { | ||
2146 | .name = "nv20le", | ||
2147 | .nb_components = 3, | ||
2148 | .log2_chroma_w = 1, | ||
2149 | .log2_chroma_h = 0, | ||
2150 | .comp = { | ||
2151 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
2152 | { 1, 4, 0, 0, 10 }, /* U */ | ||
2153 | { 1, 4, 2, 0, 10 }, /* V */ | ||
2154 | }, | ||
2155 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
2156 | }, | ||
2157 | [AV_PIX_FMT_NV20BE] = { | ||
2158 | .name = "nv20be", | ||
2159 | .nb_components = 3, | ||
2160 | .log2_chroma_w = 1, | ||
2161 | .log2_chroma_h = 0, | ||
2162 | .comp = { | ||
2163 | { 0, 2, 0, 0, 10 }, /* Y */ | ||
2164 | { 1, 4, 0, 0, 10 }, /* U */ | ||
2165 | { 1, 4, 2, 0, 10 }, /* V */ | ||
2166 | }, | ||
2167 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, | ||
2168 | }, | ||
2169 | [AV_PIX_FMT_QSV] = { | ||
2170 | .name = "qsv", | ||
2171 | .flags = AV_PIX_FMT_FLAG_HWACCEL, | ||
2172 | }, | ||
2173 | [AV_PIX_FMT_MEDIACODEC] = { | ||
2174 | .name = "mediacodec", | ||
2175 | .flags = AV_PIX_FMT_FLAG_HWACCEL, | ||
2176 | }, | ||
2177 | [AV_PIX_FMT_MMAL] = { | ||
2178 | .name = "mmal", | ||
2179 | .flags = AV_PIX_FMT_FLAG_HWACCEL, | ||
2180 | }, | ||
2181 | [AV_PIX_FMT_CUDA] = { | ||
2182 | .name = "cuda", | ||
2183 | .flags = AV_PIX_FMT_FLAG_HWACCEL, | ||
2184 | }, | ||
2185 | [AV_PIX_FMT_AMF_SURFACE] = { | ||
2186 | .name = "amf", | ||
2187 | .flags = AV_PIX_FMT_FLAG_HWACCEL, | ||
2188 | }, | ||
2189 | [AV_PIX_FMT_VYU444] = { | ||
2190 | .name = "vyu444", | ||
2191 | .nb_components = 3, | ||
2192 | .log2_chroma_w = 0, | ||
2193 | .log2_chroma_h = 0, | ||
2194 | .comp = { | ||
2195 | { 0, 3, 1, 0, 8 }, /* Y */ | ||
2196 | { 0, 3, 2, 0, 8 }, /* U */ | ||
2197 | { 0, 3, 0, 0, 8 }, /* V */ | ||
2198 | }, | ||
2199 | }, | ||
2200 | [AV_PIX_FMT_UYVA] = { | ||
2201 | .name = "uyva", | ||
2202 | .nb_components = 4, | ||
2203 | .log2_chroma_w = 0, | ||
2204 | .log2_chroma_h = 0, | ||
2205 | .comp = { | ||
2206 | { 0, 4, 1, 0, 8 }, /* Y */ | ||
2207 | { 0, 4, 0, 0, 8 }, /* U */ | ||
2208 | { 0, 4, 2, 0, 8 }, /* V */ | ||
2209 | { 0, 4, 3, 0, 8 }, /* A */ | ||
2210 | }, | ||
2211 | .flags = AV_PIX_FMT_FLAG_ALPHA, | ||
2212 | }, | ||
2213 | [AV_PIX_FMT_AYUV] = { | ||
2214 | .name = "ayuv", | ||
2215 | .nb_components = 4, | ||
2216 | .log2_chroma_w = 0, | ||
2217 | .log2_chroma_h = 0, | ||
2218 | .comp = { | ||
2219 | { 0, 4, 1, 0, 8 }, /* Y */ | ||
2220 | { 0, 4, 2, 0, 8 }, /* U */ | ||
2221 | { 0, 4, 3, 0, 8 }, /* V */ | ||
2222 | { 0, 4, 0, 0, 8 }, /* A */ | ||
2223 | }, | ||
2224 | .flags = AV_PIX_FMT_FLAG_ALPHA, | ||
2225 | }, | ||
2226 | [AV_PIX_FMT_AYUV64LE] = { | ||
2227 | .name = "ayuv64le", | ||
2228 | .nb_components = 4, | ||
2229 | .log2_chroma_w = 0, | ||
2230 | .log2_chroma_h = 0, | ||
2231 | .comp = { | ||
2232 | { 0, 8, 2, 0, 16 }, /* Y */ | ||
2233 | { 0, 8, 4, 0, 16 }, /* U */ | ||
2234 | { 0, 8, 6, 0, 16 }, /* V */ | ||
2235 | { 0, 8, 0, 0, 16 }, /* A */ | ||
2236 | }, | ||
2237 | .flags = AV_PIX_FMT_FLAG_ALPHA, | ||
2238 | }, | ||
2239 | [AV_PIX_FMT_AYUV64BE] = { | ||
2240 | .name = "ayuv64be", | ||
2241 | .nb_components = 4, | ||
2242 | .log2_chroma_w = 0, | ||
2243 | .log2_chroma_h = 0, | ||
2244 | .comp = { | ||
2245 | { 0, 8, 2, 0, 16 }, /* Y */ | ||
2246 | { 0, 8, 4, 0, 16 }, /* U */ | ||
2247 | { 0, 8, 6, 0, 16 }, /* V */ | ||
2248 | { 0, 8, 0, 0, 16 }, /* A */ | ||
2249 | }, | ||
2250 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_ALPHA, | ||
2251 | }, | ||
2252 | [AV_PIX_FMT_P010LE] = { | ||
2253 | .name = "p010le", | ||
2254 | .nb_components = 3, | ||
2255 | .log2_chroma_w = 1, | ||
2256 | .log2_chroma_h = 1, | ||
2257 | .comp = { | ||
2258 | { 0, 2, 0, 6, 10 }, /* Y */ | ||
2259 | { 1, 4, 0, 6, 10 }, /* U */ | ||
2260 | { 1, 4, 2, 6, 10 }, /* V */ | ||
2261 | }, | ||
2262 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
2263 | }, | ||
2264 | [AV_PIX_FMT_P010BE] = { | ||
2265 | .name = "p010be", | ||
2266 | .nb_components = 3, | ||
2267 | .log2_chroma_w = 1, | ||
2268 | .log2_chroma_h = 1, | ||
2269 | .comp = { | ||
2270 | { 0, 2, 0, 6, 10 }, /* Y */ | ||
2271 | { 1, 4, 0, 6, 10 }, /* U */ | ||
2272 | { 1, 4, 2, 6, 10 }, /* V */ | ||
2273 | }, | ||
2274 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, | ||
2275 | }, | ||
2276 | [AV_PIX_FMT_P012LE] = { | ||
2277 | .name = "p012le", | ||
2278 | .nb_components = 3, | ||
2279 | .log2_chroma_w = 1, | ||
2280 | .log2_chroma_h = 1, | ||
2281 | .comp = { | ||
2282 | { 0, 2, 0, 4, 12 }, /* Y */ | ||
2283 | { 1, 4, 0, 4, 12 }, /* U */ | ||
2284 | { 1, 4, 2, 4, 12 }, /* V */ | ||
2285 | }, | ||
2286 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
2287 | }, | ||
2288 | [AV_PIX_FMT_P012BE] = { | ||
2289 | .name = "p012be", | ||
2290 | .nb_components = 3, | ||
2291 | .log2_chroma_w = 1, | ||
2292 | .log2_chroma_h = 1, | ||
2293 | .comp = { | ||
2294 | { 0, 2, 0, 4, 12 }, /* Y */ | ||
2295 | { 1, 4, 0, 4, 12 }, /* U */ | ||
2296 | { 1, 4, 2, 4, 12 }, /* V */ | ||
2297 | }, | ||
2298 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, | ||
2299 | }, | ||
2300 | [AV_PIX_FMT_P016LE] = { | ||
2301 | .name = "p016le", | ||
2302 | .nb_components = 3, | ||
2303 | .log2_chroma_w = 1, | ||
2304 | .log2_chroma_h = 1, | ||
2305 | .comp = { | ||
2306 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
2307 | { 1, 4, 0, 0, 16 }, /* U */ | ||
2308 | { 1, 4, 2, 0, 16 }, /* V */ | ||
2309 | }, | ||
2310 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
2311 | }, | ||
2312 | [AV_PIX_FMT_P016BE] = { | ||
2313 | .name = "p016be", | ||
2314 | .nb_components = 3, | ||
2315 | .log2_chroma_w = 1, | ||
2316 | .log2_chroma_h = 1, | ||
2317 | .comp = { | ||
2318 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
2319 | { 1, 4, 0, 0, 16 }, /* U */ | ||
2320 | { 1, 4, 2, 0, 16 }, /* V */ | ||
2321 | }, | ||
2322 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, | ||
2323 | }, | ||
2324 | [AV_PIX_FMT_GBRAP14LE] = { | ||
2325 | .name = "gbrap14le", | ||
2326 | .nb_components = 4, | ||
2327 | .log2_chroma_w = 0, | ||
2328 | .log2_chroma_h = 0, | ||
2329 | .comp = { | ||
2330 | { 2, 2, 0, 0, 14 }, /* R */ | ||
2331 | { 0, 2, 0, 0, 14 }, /* G */ | ||
2332 | { 1, 2, 0, 0, 14 }, /* B */ | ||
2333 | { 3, 2, 0, 0, 14 }, /* A */ | ||
2334 | }, | ||
2335 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | | ||
2336 | AV_PIX_FMT_FLAG_ALPHA, | ||
2337 | }, | ||
2338 | [AV_PIX_FMT_GBRAP14BE] = { | ||
2339 | .name = "gbrap14be", | ||
2340 | .nb_components = 4, | ||
2341 | .log2_chroma_w = 0, | ||
2342 | .log2_chroma_h = 0, | ||
2343 | .comp = { | ||
2344 | { 2, 2, 0, 0, 14 }, /* R */ | ||
2345 | { 0, 2, 0, 0, 14 }, /* G */ | ||
2346 | { 1, 2, 0, 0, 14 }, /* B */ | ||
2347 | { 3, 2, 0, 0, 14 }, /* A */ | ||
2348 | }, | ||
2349 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | | ||
2350 | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, | ||
2351 | }, | ||
2352 | [AV_PIX_FMT_GBRAP12LE] = { | ||
2353 | .name = "gbrap12le", | ||
2354 | .nb_components = 4, | ||
2355 | .log2_chroma_w = 0, | ||
2356 | .log2_chroma_h = 0, | ||
2357 | .comp = { | ||
2358 | { 2, 2, 0, 0, 12 }, /* R */ | ||
2359 | { 0, 2, 0, 0, 12 }, /* G */ | ||
2360 | { 1, 2, 0, 0, 12 }, /* B */ | ||
2361 | { 3, 2, 0, 0, 12 }, /* A */ | ||
2362 | }, | ||
2363 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | | ||
2364 | AV_PIX_FMT_FLAG_ALPHA, | ||
2365 | }, | ||
2366 | [AV_PIX_FMT_GBRAP12BE] = { | ||
2367 | .name = "gbrap12be", | ||
2368 | .nb_components = 4, | ||
2369 | .log2_chroma_w = 0, | ||
2370 | .log2_chroma_h = 0, | ||
2371 | .comp = { | ||
2372 | { 2, 2, 0, 0, 12 }, /* R */ | ||
2373 | { 0, 2, 0, 0, 12 }, /* G */ | ||
2374 | { 1, 2, 0, 0, 12 }, /* B */ | ||
2375 | { 3, 2, 0, 0, 12 }, /* A */ | ||
2376 | }, | ||
2377 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | | ||
2378 | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, | ||
2379 | }, | ||
2380 | [AV_PIX_FMT_GBRAP10LE] = { | ||
2381 | .name = "gbrap10le", | ||
2382 | .nb_components = 4, | ||
2383 | .log2_chroma_w = 0, | ||
2384 | .log2_chroma_h = 0, | ||
2385 | .comp = { | ||
2386 | { 2, 2, 0, 0, 10 }, /* R */ | ||
2387 | { 0, 2, 0, 0, 10 }, /* G */ | ||
2388 | { 1, 2, 0, 0, 10 }, /* B */ | ||
2389 | { 3, 2, 0, 0, 10 }, /* A */ | ||
2390 | }, | ||
2391 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | | ||
2392 | AV_PIX_FMT_FLAG_ALPHA, | ||
2393 | }, | ||
2394 | [AV_PIX_FMT_GBRAP10BE] = { | ||
2395 | .name = "gbrap10be", | ||
2396 | .nb_components = 4, | ||
2397 | .log2_chroma_w = 0, | ||
2398 | .log2_chroma_h = 0, | ||
2399 | .comp = { | ||
2400 | { 2, 2, 0, 0, 10 }, /* R */ | ||
2401 | { 0, 2, 0, 0, 10 }, /* G */ | ||
2402 | { 1, 2, 0, 0, 10 }, /* B */ | ||
2403 | { 3, 2, 0, 0, 10 }, /* A */ | ||
2404 | }, | ||
2405 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | | ||
2406 | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, | ||
2407 | }, | ||
2408 | [AV_PIX_FMT_D3D11] = { | ||
2409 | .name = "d3d11", | ||
2410 | .flags = AV_PIX_FMT_FLAG_HWACCEL, | ||
2411 | }, | ||
2412 | [AV_PIX_FMT_D3D12] = { | ||
2413 | .name = "d3d12", | ||
2414 | .flags = AV_PIX_FMT_FLAG_HWACCEL, | ||
2415 | }, | ||
2416 | [AV_PIX_FMT_GBRPF32BE] = { | ||
2417 | .name = "gbrpf32be", | ||
2418 | .nb_components = 3, | ||
2419 | .log2_chroma_w = 0, | ||
2420 | .log2_chroma_h = 0, | ||
2421 | .comp = { | ||
2422 | { 2, 4, 0, 0, 32 }, /* R */ | ||
2423 | { 0, 4, 0, 0, 32 }, /* G */ | ||
2424 | { 1, 4, 0, 0, 32 }, /* B */ | ||
2425 | }, | ||
2426 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | | ||
2427 | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT, | ||
2428 | }, | ||
2429 | [AV_PIX_FMT_GBRPF32LE] = { | ||
2430 | .name = "gbrpf32le", | ||
2431 | .nb_components = 3, | ||
2432 | .log2_chroma_w = 0, | ||
2433 | .log2_chroma_h = 0, | ||
2434 | .comp = { | ||
2435 | { 2, 4, 0, 0, 32 }, /* R */ | ||
2436 | { 0, 4, 0, 0, 32 }, /* G */ | ||
2437 | { 1, 4, 0, 0, 32 }, /* B */ | ||
2438 | }, | ||
2439 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_FLOAT | AV_PIX_FMT_FLAG_RGB, | ||
2440 | }, | ||
2441 | [AV_PIX_FMT_GBRAPF32BE] = { | ||
2442 | .name = "gbrapf32be", | ||
2443 | .nb_components = 4, | ||
2444 | .log2_chroma_w = 0, | ||
2445 | .log2_chroma_h = 0, | ||
2446 | .comp = { | ||
2447 | { 2, 4, 0, 0, 32 }, /* R */ | ||
2448 | { 0, 4, 0, 0, 32 }, /* G */ | ||
2449 | { 1, 4, 0, 0, 32 }, /* B */ | ||
2450 | { 3, 4, 0, 0, 32 }, /* A */ | ||
2451 | }, | ||
2452 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | | ||
2453 | AV_PIX_FMT_FLAG_ALPHA | AV_PIX_FMT_FLAG_RGB | | ||
2454 | AV_PIX_FMT_FLAG_FLOAT, | ||
2455 | }, | ||
2456 | [AV_PIX_FMT_GBRAPF32LE] = { | ||
2457 | .name = "gbrapf32le", | ||
2458 | .nb_components = 4, | ||
2459 | .log2_chroma_w = 0, | ||
2460 | .log2_chroma_h = 0, | ||
2461 | .comp = { | ||
2462 | { 2, 4, 0, 0, 32 }, /* R */ | ||
2463 | { 0, 4, 0, 0, 32 }, /* G */ | ||
2464 | { 1, 4, 0, 0, 32 }, /* B */ | ||
2465 | { 3, 4, 0, 0, 32 }, /* A */ | ||
2466 | }, | ||
2467 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA | | ||
2468 | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT, | ||
2469 | }, | ||
2470 | [AV_PIX_FMT_GBRPF16BE] = { | ||
2471 | .name = "gbrpf16be", | ||
2472 | .nb_components = 3, | ||
2473 | .log2_chroma_w = 0, | ||
2474 | .log2_chroma_h = 0, | ||
2475 | .comp = { | ||
2476 | { 2, 2, 0, 0, 16 }, /* R */ | ||
2477 | { 0, 2, 0, 0, 16 }, /* G */ | ||
2478 | { 1, 2, 0, 0, 16 }, /* B */ | ||
2479 | }, | ||
2480 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | | ||
2481 | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT, | ||
2482 | }, | ||
2483 | [AV_PIX_FMT_GBRPF16LE] = { | ||
2484 | .name = "gbrpf16le", | ||
2485 | .nb_components = 3, | ||
2486 | .log2_chroma_w = 0, | ||
2487 | .log2_chroma_h = 0, | ||
2488 | .comp = { | ||
2489 | { 2, 2, 0, 0, 16 }, /* R */ | ||
2490 | { 0, 2, 0, 0, 16 }, /* G */ | ||
2491 | { 1, 2, 0, 0, 16 }, /* B */ | ||
2492 | }, | ||
2493 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_FLOAT | AV_PIX_FMT_FLAG_RGB, | ||
2494 | }, | ||
2495 | [AV_PIX_FMT_GBRAPF16BE] = { | ||
2496 | .name = "gbrapf16be", | ||
2497 | .nb_components = 4, | ||
2498 | .log2_chroma_w = 0, | ||
2499 | .log2_chroma_h = 0, | ||
2500 | .comp = { | ||
2501 | { 2, 2, 0, 0, 16 }, /* R */ | ||
2502 | { 0, 2, 0, 0, 16 }, /* G */ | ||
2503 | { 1, 2, 0, 0, 16 }, /* B */ | ||
2504 | { 3, 2, 0, 0, 16 }, /* A */ | ||
2505 | }, | ||
2506 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | | ||
2507 | AV_PIX_FMT_FLAG_ALPHA | AV_PIX_FMT_FLAG_RGB | | ||
2508 | AV_PIX_FMT_FLAG_FLOAT, | ||
2509 | }, | ||
2510 | [AV_PIX_FMT_GBRAPF16LE] = { | ||
2511 | .name = "gbrapf16le", | ||
2512 | .nb_components = 4, | ||
2513 | .log2_chroma_w = 0, | ||
2514 | .log2_chroma_h = 0, | ||
2515 | .comp = { | ||
2516 | { 2, 2, 0, 0, 16 }, /* R */ | ||
2517 | { 0, 2, 0, 0, 16 }, /* G */ | ||
2518 | { 1, 2, 0, 0, 16 }, /* B */ | ||
2519 | { 3, 2, 0, 0, 16 }, /* A */ | ||
2520 | }, | ||
2521 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA | | ||
2522 | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT, | ||
2523 | }, | ||
2524 | [AV_PIX_FMT_DRM_PRIME] = { | ||
2525 | .name = "drm_prime", | ||
2526 | .flags = AV_PIX_FMT_FLAG_HWACCEL, | ||
2527 | }, | ||
2528 | [AV_PIX_FMT_OPENCL] = { | ||
2529 | .name = "opencl", | ||
2530 | .flags = AV_PIX_FMT_FLAG_HWACCEL, | ||
2531 | }, | ||
2532 | [AV_PIX_FMT_GRAYF32BE] = { | ||
2533 | .name = "grayf32be", | ||
2534 | .nb_components = 1, | ||
2535 | .log2_chroma_w = 0, | ||
2536 | .log2_chroma_h = 0, | ||
2537 | .comp = { | ||
2538 | { 0, 4, 0, 0, 32 }, /* Y */ | ||
2539 | }, | ||
2540 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_FLOAT, | ||
2541 | .alias = "yf32be", | ||
2542 | }, | ||
2543 | [AV_PIX_FMT_GRAYF32LE] = { | ||
2544 | .name = "grayf32le", | ||
2545 | .nb_components = 1, | ||
2546 | .log2_chroma_w = 0, | ||
2547 | .log2_chroma_h = 0, | ||
2548 | .comp = { | ||
2549 | { 0, 4, 0, 0, 32 }, /* Y */ | ||
2550 | }, | ||
2551 | .flags = AV_PIX_FMT_FLAG_FLOAT, | ||
2552 | .alias = "yf32le", | ||
2553 | }, | ||
2554 | [AV_PIX_FMT_GRAYF16BE] = { | ||
2555 | .name = "grayf16be", | ||
2556 | .nb_components = 1, | ||
2557 | .log2_chroma_w = 0, | ||
2558 | .log2_chroma_h = 0, | ||
2559 | .comp = { | ||
2560 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
2561 | }, | ||
2562 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_FLOAT, | ||
2563 | }, | ||
2564 | [AV_PIX_FMT_GRAYF16LE] = { | ||
2565 | .name = "grayf16le", | ||
2566 | .nb_components = 1, | ||
2567 | .log2_chroma_w = 0, | ||
2568 | .log2_chroma_h = 0, | ||
2569 | .comp = { | ||
2570 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
2571 | }, | ||
2572 | .flags = AV_PIX_FMT_FLAG_FLOAT, | ||
2573 | }, | ||
2574 | [AV_PIX_FMT_YAF32BE] = { | ||
2575 | .name = "yaf32be", | ||
2576 | .nb_components = 2, | ||
2577 | .log2_chroma_w = 0, | ||
2578 | .log2_chroma_h = 0, | ||
2579 | .comp = { | ||
2580 | { 0, 8, 0, 0, 32 }, /* Y */ | ||
2581 | { 0, 8, 4, 0, 32 }, /* A */ | ||
2582 | }, | ||
2583 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_FLOAT | AV_PIX_FMT_FLAG_ALPHA, | ||
2584 | }, | ||
2585 | [AV_PIX_FMT_YAF32LE] = { | ||
2586 | .name = "yaf32le", | ||
2587 | .nb_components = 2, | ||
2588 | .log2_chroma_w = 0, | ||
2589 | .log2_chroma_h = 0, | ||
2590 | .comp = { | ||
2591 | { 0, 8, 0, 0, 32 }, /* Y */ | ||
2592 | { 0, 8, 4, 0, 32 }, /* A */ | ||
2593 | }, | ||
2594 | .flags = AV_PIX_FMT_FLAG_FLOAT | AV_PIX_FMT_FLAG_ALPHA, | ||
2595 | }, | ||
2596 | [AV_PIX_FMT_YAF16BE] = { | ||
2597 | .name = "yaf16be", | ||
2598 | .nb_components = 2, | ||
2599 | .log2_chroma_w = 0, | ||
2600 | .log2_chroma_h = 0, | ||
2601 | .comp = { | ||
2602 | { 0, 4, 0, 0, 16 }, /* Y */ | ||
2603 | { 0, 4, 2, 0, 16 }, /* A */ | ||
2604 | }, | ||
2605 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_FLOAT | AV_PIX_FMT_FLAG_ALPHA, | ||
2606 | }, | ||
2607 | [AV_PIX_FMT_YAF16LE] = { | ||
2608 | .name = "yaf16le", | ||
2609 | .nb_components = 2, | ||
2610 | .log2_chroma_w = 0, | ||
2611 | .log2_chroma_h = 0, | ||
2612 | .comp = { | ||
2613 | { 0, 4, 0, 0, 16 }, /* Y */ | ||
2614 | { 0, 4, 2, 0, 16 }, /* A */ | ||
2615 | }, | ||
2616 | .flags = AV_PIX_FMT_FLAG_FLOAT | AV_PIX_FMT_FLAG_ALPHA, | ||
2617 | }, | ||
2618 | [AV_PIX_FMT_YUVA422P12BE] = { | ||
2619 | .name = "yuva422p12be", | ||
2620 | .nb_components = 4, | ||
2621 | .log2_chroma_w = 1, | ||
2622 | .log2_chroma_h = 0, | ||
2623 | .comp = { | ||
2624 | { 0, 2, 0, 0, 12 }, /* Y */ | ||
2625 | { 1, 2, 0, 0, 12 }, /* U */ | ||
2626 | { 2, 2, 0, 0, 12 }, /* V */ | ||
2627 | { 3, 2, 0, 0, 12 }, /* A */ | ||
2628 | }, | ||
2629 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
2630 | }, | ||
2631 | [AV_PIX_FMT_YUVA422P12LE] = { | ||
2632 | .name = "yuva422p12le", | ||
2633 | .nb_components = 4, | ||
2634 | .log2_chroma_w = 1, | ||
2635 | .log2_chroma_h = 0, | ||
2636 | .comp = { | ||
2637 | { 0, 2, 0, 0, 12 }, /* Y */ | ||
2638 | { 1, 2, 0, 0, 12 }, /* U */ | ||
2639 | { 2, 2, 0, 0, 12 }, /* V */ | ||
2640 | { 3, 2, 0, 0, 12 }, /* A */ | ||
2641 | }, | ||
2642 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
2643 | }, | ||
2644 | [AV_PIX_FMT_YUVA444P12BE] = { | ||
2645 | .name = "yuva444p12be", | ||
2646 | .nb_components = 4, | ||
2647 | .log2_chroma_w = 0, | ||
2648 | .log2_chroma_h = 0, | ||
2649 | .comp = { | ||
2650 | { 0, 2, 0, 0, 12 }, /* Y */ | ||
2651 | { 1, 2, 0, 0, 12 }, /* U */ | ||
2652 | { 2, 2, 0, 0, 12 }, /* V */ | ||
2653 | { 3, 2, 0, 0, 12 }, /* A */ | ||
2654 | }, | ||
2655 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
2656 | }, | ||
2657 | [AV_PIX_FMT_YUVA444P12LE] = { | ||
2658 | .name = "yuva444p12le", | ||
2659 | .nb_components = 4, | ||
2660 | .log2_chroma_w = 0, | ||
2661 | .log2_chroma_h = 0, | ||
2662 | .comp = { | ||
2663 | { 0, 2, 0, 0, 12 }, /* Y */ | ||
2664 | { 1, 2, 0, 0, 12 }, /* U */ | ||
2665 | { 2, 2, 0, 0, 12 }, /* V */ | ||
2666 | { 3, 2, 0, 0, 12 }, /* A */ | ||
2667 | }, | ||
2668 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, | ||
2669 | }, | ||
2670 | [AV_PIX_FMT_NV24] = { | ||
2671 | .name = "nv24", | ||
2672 | .nb_components = 3, | ||
2673 | .log2_chroma_w = 0, | ||
2674 | .log2_chroma_h = 0, | ||
2675 | .comp = { | ||
2676 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
2677 | { 1, 2, 0, 0, 8 }, /* U */ | ||
2678 | { 1, 2, 1, 0, 8 }, /* V */ | ||
2679 | }, | ||
2680 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
2681 | }, | ||
2682 | [AV_PIX_FMT_NV42] = { | ||
2683 | .name = "nv42", | ||
2684 | .nb_components = 3, | ||
2685 | .log2_chroma_w = 0, | ||
2686 | .log2_chroma_h = 0, | ||
2687 | .comp = { | ||
2688 | { 0, 1, 0, 0, 8 }, /* Y */ | ||
2689 | { 1, 2, 1, 0, 8 }, /* U */ | ||
2690 | { 1, 2, 0, 0, 8 }, /* V */ | ||
2691 | }, | ||
2692 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
2693 | }, | ||
2694 | [AV_PIX_FMT_VULKAN] = { | ||
2695 | .name = "vulkan", | ||
2696 | .flags = AV_PIX_FMT_FLAG_HWACCEL, | ||
2697 | }, | ||
2698 | [AV_PIX_FMT_P210BE] = { | ||
2699 | .name = "p210be", | ||
2700 | .nb_components = 3, | ||
2701 | .log2_chroma_w = 1, | ||
2702 | .log2_chroma_h = 0, | ||
2703 | .comp = { | ||
2704 | { 0, 2, 0, 6, 10 }, /* Y */ | ||
2705 | { 1, 4, 0, 6, 10 }, /* U */ | ||
2706 | { 1, 4, 2, 6, 10 }, /* V */ | ||
2707 | }, | ||
2708 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, | ||
2709 | }, | ||
2710 | [AV_PIX_FMT_P210LE] = { | ||
2711 | .name = "p210le", | ||
2712 | .nb_components = 3, | ||
2713 | .log2_chroma_w = 1, | ||
2714 | .log2_chroma_h = 0, | ||
2715 | .comp = { | ||
2716 | { 0, 2, 0, 6, 10 }, /* Y */ | ||
2717 | { 1, 4, 0, 6, 10 }, /* U */ | ||
2718 | { 1, 4, 2, 6, 10 }, /* V */ | ||
2719 | }, | ||
2720 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
2721 | }, | ||
2722 | [AV_PIX_FMT_P410BE] = { | ||
2723 | .name = "p410be", | ||
2724 | .nb_components = 3, | ||
2725 | .log2_chroma_w = 0, | ||
2726 | .log2_chroma_h = 0, | ||
2727 | .comp = { | ||
2728 | { 0, 2, 0, 6, 10 }, /* Y */ | ||
2729 | { 1, 4, 0, 6, 10 }, /* U */ | ||
2730 | { 1, 4, 2, 6, 10 }, /* V */ | ||
2731 | }, | ||
2732 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, | ||
2733 | }, | ||
2734 | [AV_PIX_FMT_P410LE] = { | ||
2735 | .name = "p410le", | ||
2736 | .nb_components = 3, | ||
2737 | .log2_chroma_w = 0, | ||
2738 | .log2_chroma_h = 0, | ||
2739 | .comp = { | ||
2740 | { 0, 2, 0, 6, 10 }, /* Y */ | ||
2741 | { 1, 4, 0, 6, 10 }, /* U */ | ||
2742 | { 1, 4, 2, 6, 10 }, /* V */ | ||
2743 | }, | ||
2744 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
2745 | }, | ||
2746 | [AV_PIX_FMT_P216BE] = { | ||
2747 | .name = "p216be", | ||
2748 | .nb_components = 3, | ||
2749 | .log2_chroma_w = 1, | ||
2750 | .log2_chroma_h = 0, | ||
2751 | .comp = { | ||
2752 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
2753 | { 1, 4, 0, 0, 16 }, /* U */ | ||
2754 | { 1, 4, 2, 0, 16 }, /* V */ | ||
2755 | }, | ||
2756 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, | ||
2757 | }, | ||
2758 | [AV_PIX_FMT_P216LE] = { | ||
2759 | .name = "p216le", | ||
2760 | .nb_components = 3, | ||
2761 | .log2_chroma_w = 1, | ||
2762 | .log2_chroma_h = 0, | ||
2763 | .comp = { | ||
2764 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
2765 | { 1, 4, 0, 0, 16 }, /* U */ | ||
2766 | { 1, 4, 2, 0, 16 }, /* V */ | ||
2767 | }, | ||
2768 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
2769 | }, | ||
2770 | [AV_PIX_FMT_P416BE] = { | ||
2771 | .name = "p416be", | ||
2772 | .nb_components = 3, | ||
2773 | .log2_chroma_w = 0, | ||
2774 | .log2_chroma_h = 0, | ||
2775 | .comp = { | ||
2776 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
2777 | { 1, 4, 0, 0, 16 }, /* U */ | ||
2778 | { 1, 4, 2, 0, 16 }, /* V */ | ||
2779 | }, | ||
2780 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, | ||
2781 | }, | ||
2782 | [AV_PIX_FMT_P416LE] = { | ||
2783 | .name = "p416le", | ||
2784 | .nb_components = 3, | ||
2785 | .log2_chroma_w = 0, | ||
2786 | .log2_chroma_h = 0, | ||
2787 | .comp = { | ||
2788 | { 0, 2, 0, 0, 16 }, /* Y */ | ||
2789 | { 1, 4, 0, 0, 16 }, /* U */ | ||
2790 | { 1, 4, 2, 0, 16 }, /* V */ | ||
2791 | }, | ||
2792 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
2793 | }, | ||
2794 | [AV_PIX_FMT_VUYA] = { | ||
2795 | .name = "vuya", | ||
2796 | .nb_components = 4, | ||
2797 | .log2_chroma_w = 0, | ||
2798 | .log2_chroma_h = 0, | ||
2799 | .comp = { | ||
2800 | { 0, 4, 2, 0, 8 }, /* Y */ | ||
2801 | { 0, 4, 1, 0, 8 }, /* U */ | ||
2802 | { 0, 4, 0, 0, 8 }, /* V */ | ||
2803 | { 0, 4, 3, 0, 8 }, /* A */ | ||
2804 | }, | ||
2805 | .flags = AV_PIX_FMT_FLAG_ALPHA, | ||
2806 | }, | ||
2807 | [AV_PIX_FMT_VUYX] = { | ||
2808 | .name = "vuyx", | ||
2809 | .nb_components = 3, | ||
2810 | .log2_chroma_w = 0, | ||
2811 | .log2_chroma_h = 0, | ||
2812 | .comp = { | ||
2813 | { 0, 4, 2, 0, 8 }, /* Y */ | ||
2814 | { 0, 4, 1, 0, 8 }, /* U */ | ||
2815 | { 0, 4, 0, 0, 8 }, /* V */ | ||
2816 | { 0, 4, 3, 0, 8 }, /* X */ | ||
2817 | }, | ||
2818 | }, | ||
2819 | [AV_PIX_FMT_RGBF16BE] = { | ||
2820 | .name = "rgbf16be", | ||
2821 | .nb_components = 3, | ||
2822 | .log2_chroma_w = 0, | ||
2823 | .log2_chroma_h = 0, | ||
2824 | .comp = { | ||
2825 | { 0, 6, 0, 0, 16 }, /* R */ | ||
2826 | { 0, 6, 2, 0, 16 }, /* G */ | ||
2827 | { 0, 6, 4, 0, 16 }, /* B */ | ||
2828 | }, | ||
2829 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | | ||
2830 | AV_PIX_FMT_FLAG_FLOAT, | ||
2831 | }, | ||
2832 | [AV_PIX_FMT_RGBF16LE] = { | ||
2833 | .name = "rgbf16le", | ||
2834 | .nb_components = 3, | ||
2835 | .log2_chroma_w = 0, | ||
2836 | .log2_chroma_h = 0, | ||
2837 | .comp = { | ||
2838 | { 0, 6, 0, 0, 16 }, /* R */ | ||
2839 | { 0, 6, 2, 0, 16 }, /* G */ | ||
2840 | { 0, 6, 4, 0, 16 }, /* B */ | ||
2841 | }, | ||
2842 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT | ||
2843 | }, | ||
2844 | [AV_PIX_FMT_RGBAF16BE] = { | ||
2845 | .name = "rgbaf16be", | ||
2846 | .nb_components = 4, | ||
2847 | .log2_chroma_w = 0, | ||
2848 | .log2_chroma_h = 0, | ||
2849 | .comp = { | ||
2850 | { 0, 8, 0, 0, 16 }, /* R */ | ||
2851 | { 0, 8, 2, 0, 16 }, /* G */ | ||
2852 | { 0, 8, 4, 0, 16 }, /* B */ | ||
2853 | { 0, 8, 6, 0, 16 }, /* A */ | ||
2854 | }, | ||
2855 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | | ||
2856 | AV_PIX_FMT_FLAG_ALPHA | AV_PIX_FMT_FLAG_FLOAT, | ||
2857 | }, | ||
2858 | [AV_PIX_FMT_RGBAF16LE] = { | ||
2859 | .name = "rgbaf16le", | ||
2860 | .nb_components = 4, | ||
2861 | .log2_chroma_w = 0, | ||
2862 | .log2_chroma_h = 0, | ||
2863 | .comp = { | ||
2864 | { 0, 8, 0, 0, 16 }, /* R */ | ||
2865 | { 0, 8, 2, 0, 16 }, /* G */ | ||
2866 | { 0, 8, 4, 0, 16 }, /* B */ | ||
2867 | { 0, 8, 6, 0, 16 }, /* A */ | ||
2868 | }, | ||
2869 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA | | ||
2870 | AV_PIX_FMT_FLAG_FLOAT, | ||
2871 | }, | ||
2872 | [AV_PIX_FMT_Y212LE] = { | ||
2873 | .name = "y212le", | ||
2874 | .nb_components = 3, | ||
2875 | .log2_chroma_w = 1, | ||
2876 | .log2_chroma_h = 0, | ||
2877 | .comp = { | ||
2878 | { 0, 4, 0, 4, 12 }, /* Y */ | ||
2879 | { 0, 8, 2, 4, 12 }, /* U */ | ||
2880 | { 0, 8, 6, 4, 12 }, /* V */ | ||
2881 | }, | ||
2882 | }, | ||
2883 | [AV_PIX_FMT_Y212BE] = { | ||
2884 | .name = "y212be", | ||
2885 | .nb_components = 3, | ||
2886 | .log2_chroma_w = 1, | ||
2887 | .log2_chroma_h = 0, | ||
2888 | .comp = { | ||
2889 | { 0, 4, 0, 4, 12 }, /* Y */ | ||
2890 | { 0, 8, 2, 4, 12 }, /* U */ | ||
2891 | { 0, 8, 6, 4, 12 }, /* V */ | ||
2892 | }, | ||
2893 | .flags = AV_PIX_FMT_FLAG_BE, | ||
2894 | }, | ||
2895 | [AV_PIX_FMT_XV30LE] = { | ||
2896 | .name = "xv30le", | ||
2897 | .nb_components= 3, | ||
2898 | .log2_chroma_w= 0, | ||
2899 | .log2_chroma_h= 0, | ||
2900 | .comp = { | ||
2901 | { 0, 4, 1, 2, 10 }, /* Y */ | ||
2902 | { 0, 4, 0, 0, 10 }, /* U */ | ||
2903 | { 0, 4, 2, 4, 10 }, /* V */ | ||
2904 | { 0, 4, 3, 6, 2 }, /* X */ | ||
2905 | }, | ||
2906 | }, | ||
2907 | [AV_PIX_FMT_XV30BE] = { | ||
2908 | .name = "xv30be", | ||
2909 | .nb_components= 3, | ||
2910 | .log2_chroma_w= 0, | ||
2911 | .log2_chroma_h= 0, | ||
2912 | .comp = { | ||
2913 | { 0, 32, 10, 0, 10 }, /* Y */ | ||
2914 | { 0, 32, 0, 0, 10 }, /* U */ | ||
2915 | { 0, 32, 20, 0, 10 }, /* V */ | ||
2916 | { 0, 32, 30, 0, 2 }, /* X */ | ||
2917 | }, | ||
2918 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_BITSTREAM, | ||
2919 | }, | ||
2920 | [AV_PIX_FMT_XV36LE] = { | ||
2921 | .name = "xv36le", | ||
2922 | .nb_components= 3, | ||
2923 | .log2_chroma_w= 0, | ||
2924 | .log2_chroma_h= 0, | ||
2925 | .comp = { | ||
2926 | { 0, 8, 2, 4, 12 }, /* Y */ | ||
2927 | { 0, 8, 0, 4, 12 }, /* U */ | ||
2928 | { 0, 8, 4, 4, 12 }, /* V */ | ||
2929 | { 0, 8, 6, 4, 12 }, /* X */ | ||
2930 | }, | ||
2931 | }, | ||
2932 | [AV_PIX_FMT_XV36BE] = { | ||
2933 | .name = "xv36be", | ||
2934 | .nb_components= 3, | ||
2935 | .log2_chroma_w= 0, | ||
2936 | .log2_chroma_h= 0, | ||
2937 | .comp = { | ||
2938 | { 0, 8, 2, 4, 12 }, /* Y */ | ||
2939 | { 0, 8, 0, 4, 12 }, /* U */ | ||
2940 | { 0, 8, 4, 4, 12 }, /* V */ | ||
2941 | { 0, 8, 6, 4, 12 }, /* X */ | ||
2942 | }, | ||
2943 | .flags = AV_PIX_FMT_FLAG_BE, | ||
2944 | }, | ||
2945 | [AV_PIX_FMT_XV48LE] = { | ||
2946 | .name = "xv48le", | ||
2947 | .nb_components = 3, | ||
2948 | .log2_chroma_w = 0, | ||
2949 | .log2_chroma_h = 0, | ||
2950 | .comp = { | ||
2951 | { 0, 8, 2, 0, 16 }, /* Y */ | ||
2952 | { 0, 8, 0, 0, 16 }, /* U */ | ||
2953 | { 0, 8, 4, 0, 16 }, /* V */ | ||
2954 | { 0, 8, 6, 0, 16 }, /* X */ | ||
2955 | }, | ||
2956 | }, | ||
2957 | [AV_PIX_FMT_XV48BE] = { | ||
2958 | .name = "xv48be", | ||
2959 | .nb_components = 3, | ||
2960 | .log2_chroma_w = 0, | ||
2961 | .log2_chroma_h = 0, | ||
2962 | .comp = { | ||
2963 | { 0, 8, 2, 0, 16 }, /* Y */ | ||
2964 | { 0, 8, 0, 0, 16 }, /* U */ | ||
2965 | { 0, 8, 4, 0, 16 }, /* V */ | ||
2966 | { 0, 8, 6, 0, 16 }, /* X */ | ||
2967 | }, | ||
2968 | .flags = AV_PIX_FMT_FLAG_BE, | ||
2969 | }, | ||
2970 | [AV_PIX_FMT_V30XLE] = { | ||
2971 | .name = "v30xle", | ||
2972 | .nb_components = 3, | ||
2973 | .log2_chroma_w = 0, | ||
2974 | .log2_chroma_h = 0, | ||
2975 | .comp = { | ||
2976 | { 0, 4, 1, 4, 10 }, /* Y */ | ||
2977 | { 0, 4, 0, 2, 10 }, /* U */ | ||
2978 | { 0, 4, 2, 6, 10 }, /* V */ | ||
2979 | { 0, 4, 0, 0, 2 }, /* X */ | ||
2980 | }, | ||
2981 | }, | ||
2982 | [AV_PIX_FMT_V30XBE] = { | ||
2983 | .name = "v30xbe", | ||
2984 | .nb_components= 3, | ||
2985 | .log2_chroma_w= 0, | ||
2986 | .log2_chroma_h= 0, | ||
2987 | .comp = { | ||
2988 | { 0, 32, 12, 0, 10 }, /* Y */ | ||
2989 | { 0, 32, 2, 0, 10 }, /* U */ | ||
2990 | { 0, 32, 22, 0, 10 }, /* V */ | ||
2991 | { 0, 32, 0, 0, 2 }, /* X */ | ||
2992 | }, | ||
2993 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_BITSTREAM, | ||
2994 | }, | ||
2995 | [AV_PIX_FMT_RGBF32BE] = { | ||
2996 | .name = "rgbf32be", | ||
2997 | .nb_components = 3, | ||
2998 | .log2_chroma_w = 0, | ||
2999 | .log2_chroma_h = 0, | ||
3000 | .comp = { | ||
3001 | { 0, 12, 0, 0, 32 }, /* R */ | ||
3002 | { 0, 12, 4, 0, 32 }, /* G */ | ||
3003 | { 0, 12, 8, 0, 32 }, /* B */ | ||
3004 | }, | ||
3005 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | | ||
3006 | AV_PIX_FMT_FLAG_FLOAT, | ||
3007 | }, | ||
3008 | [AV_PIX_FMT_RGBF32LE] = { | ||
3009 | .name = "rgbf32le", | ||
3010 | .nb_components = 3, | ||
3011 | .log2_chroma_w = 0, | ||
3012 | .log2_chroma_h = 0, | ||
3013 | .comp = { | ||
3014 | { 0, 12, 0, 0, 32 }, /* R */ | ||
3015 | { 0, 12, 4, 0, 32 }, /* G */ | ||
3016 | { 0, 12, 8, 0, 32 }, /* B */ | ||
3017 | }, | ||
3018 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT, | ||
3019 | }, | ||
3020 | [AV_PIX_FMT_RGB96BE] = { | ||
3021 | .name = "rgb96be", | ||
3022 | .nb_components = 3, | ||
3023 | .log2_chroma_w = 0, | ||
3024 | .log2_chroma_h = 0, | ||
3025 | .comp = { | ||
3026 | { 0, 12, 0, 0, 32 }, /* R */ | ||
3027 | { 0, 12, 4, 0, 32 }, /* G */ | ||
3028 | { 0, 12, 8, 0, 32 }, /* B */ | ||
3029 | }, | ||
3030 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB, | ||
3031 | }, | ||
3032 | [AV_PIX_FMT_RGB96LE] = { | ||
3033 | .name = "rgb96le", | ||
3034 | .nb_components = 3, | ||
3035 | .log2_chroma_w = 0, | ||
3036 | .log2_chroma_h = 0, | ||
3037 | .comp = { | ||
3038 | { 0, 12, 0, 0, 32 }, /* R */ | ||
3039 | { 0, 12, 4, 0, 32 }, /* G */ | ||
3040 | { 0, 12, 8, 0, 32 }, /* B */ | ||
3041 | }, | ||
3042 | .flags = AV_PIX_FMT_FLAG_RGB, | ||
3043 | }, | ||
3044 | [AV_PIX_FMT_RGBAF32BE] = { | ||
3045 | .name = "rgbaf32be", | ||
3046 | .nb_components = 4, | ||
3047 | .log2_chroma_w = 0, | ||
3048 | .log2_chroma_h = 0, | ||
3049 | .comp = { | ||
3050 | { 0, 16, 0, 0, 32 }, /* R */ | ||
3051 | { 0, 16, 4, 0, 32 }, /* G */ | ||
3052 | { 0, 16, 8, 0, 32 }, /* B */ | ||
3053 | { 0, 16, 12, 0, 32 }, /* A */ | ||
3054 | }, | ||
3055 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | | ||
3056 | AV_PIX_FMT_FLAG_FLOAT | AV_PIX_FMT_FLAG_ALPHA, | ||
3057 | }, | ||
3058 | [AV_PIX_FMT_RGBAF32LE] = { | ||
3059 | .name = "rgbaf32le", | ||
3060 | .nb_components = 4, | ||
3061 | .log2_chroma_w = 0, | ||
3062 | .log2_chroma_h = 0, | ||
3063 | .comp = { | ||
3064 | { 0, 16, 0, 0, 32 }, /* R */ | ||
3065 | { 0, 16, 4, 0, 32 }, /* G */ | ||
3066 | { 0, 16, 8, 0, 32 }, /* B */ | ||
3067 | { 0, 16, 12, 0, 32 }, /* A */ | ||
3068 | }, | ||
3069 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT | | ||
3070 | AV_PIX_FMT_FLAG_ALPHA, | ||
3071 | }, | ||
3072 | [AV_PIX_FMT_RGBA128BE] = { | ||
3073 | .name = "rgba128be", | ||
3074 | .nb_components = 4, | ||
3075 | .log2_chroma_w = 0, | ||
3076 | .log2_chroma_h = 0, | ||
3077 | .comp = { | ||
3078 | { 0, 16, 0, 0, 32 }, /* R */ | ||
3079 | { 0, 16, 4, 0, 32 }, /* G */ | ||
3080 | { 0, 16, 8, 0, 32 }, /* B */ | ||
3081 | { 0, 16, 12, 0, 32 }, /* A */ | ||
3082 | }, | ||
3083 | .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | | ||
3084 | AV_PIX_FMT_FLAG_ALPHA, | ||
3085 | }, | ||
3086 | [AV_PIX_FMT_RGBA128LE] = { | ||
3087 | .name = "rgba128le", | ||
3088 | .nb_components = 4, | ||
3089 | .log2_chroma_w = 0, | ||
3090 | .log2_chroma_h = 0, | ||
3091 | .comp = { | ||
3092 | { 0, 16, 0, 0, 32 }, /* R */ | ||
3093 | { 0, 16, 4, 0, 32 }, /* G */ | ||
3094 | { 0, 16, 8, 0, 32 }, /* B */ | ||
3095 | { 0, 16, 12, 0, 32 }, /* A */ | ||
3096 | }, | ||
3097 | .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, | ||
3098 | }, | ||
3099 | [AV_PIX_FMT_P212BE] = { | ||
3100 | .name = "p212be", | ||
3101 | .nb_components = 3, | ||
3102 | .log2_chroma_w = 1, | ||
3103 | .log2_chroma_h = 0, | ||
3104 | .comp = { | ||
3105 | { 0, 2, 0, 4, 12 }, /* Y */ | ||
3106 | { 1, 4, 0, 4, 12 }, /* U */ | ||
3107 | { 1, 4, 2, 4, 12 }, /* V */ | ||
3108 | }, | ||
3109 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, | ||
3110 | }, | ||
3111 | [AV_PIX_FMT_P212LE] = { | ||
3112 | .name = "p212le", | ||
3113 | .nb_components = 3, | ||
3114 | .log2_chroma_w = 1, | ||
3115 | .log2_chroma_h = 0, | ||
3116 | .comp = { | ||
3117 | { 0, 2, 0, 4, 12 }, /* Y */ | ||
3118 | { 1, 4, 0, 4, 12 }, /* U */ | ||
3119 | { 1, 4, 2, 4, 12 }, /* V */ | ||
3120 | }, | ||
3121 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
3122 | }, | ||
3123 | [AV_PIX_FMT_P412BE] = { | ||
3124 | .name = "p412be", | ||
3125 | .nb_components = 3, | ||
3126 | .log2_chroma_w = 0, | ||
3127 | .log2_chroma_h = 0, | ||
3128 | .comp = { | ||
3129 | { 0, 2, 0, 4, 12 }, /* Y */ | ||
3130 | { 1, 4, 0, 4, 12 }, /* U */ | ||
3131 | { 1, 4, 2, 4, 12 }, /* V */ | ||
3132 | }, | ||
3133 | .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, | ||
3134 | }, | ||
3135 | [AV_PIX_FMT_P412LE] = { | ||
3136 | .name = "p412le", | ||
3137 | .nb_components = 3, | ||
3138 | .log2_chroma_w = 0, | ||
3139 | .log2_chroma_h = 0, | ||
3140 | .comp = { | ||
3141 | { 0, 2, 0, 4, 12 }, /* Y */ | ||
3142 | { 1, 4, 0, 4, 12 }, /* U */ | ||
3143 | { 1, 4, 2, 4, 12 }, /* V */ | ||
3144 | }, | ||
3145 | .flags = AV_PIX_FMT_FLAG_PLANAR, | ||
3146 | }, | ||
3147 | [AV_PIX_FMT_Y216LE] = { | ||
3148 | .name = "y216le", | ||
3149 | .nb_components = 3, | ||
3150 | .log2_chroma_w = 1, | ||
3151 | .log2_chroma_h = 0, | ||
3152 | .comp = { | ||
3153 | { 0, 4, 0, 0, 16 }, /* Y */ | ||
3154 | { 0, 8, 2, 0, 16 }, /* U */ | ||
3155 | { 0, 8, 6, 0, 16 }, /* V */ | ||
3156 | }, | ||
3157 | }, | ||
3158 | [AV_PIX_FMT_Y216BE] = { | ||
3159 | .name = "y216be", | ||
3160 | .nb_components = 3, | ||
3161 | .log2_chroma_w = 1, | ||
3162 | .log2_chroma_h = 0, | ||
3163 | .comp = { | ||
3164 | { 0, 4, 0, 0, 16 }, /* Y */ | ||
3165 | { 0, 8, 2, 0, 16 }, /* U */ | ||
3166 | { 0, 8, 6, 0, 16 }, /* V */ | ||
3167 | }, | ||
3168 | .flags = AV_PIX_FMT_FLAG_BE, | ||
3169 | }, | ||
3170 | }; | ||
3171 | |||
3172 | static const char * const color_range_names[] = { | ||
3173 | [AVCOL_RANGE_UNSPECIFIED] = "unknown", | ||
3174 | [AVCOL_RANGE_MPEG] = "tv", | ||
3175 | [AVCOL_RANGE_JPEG] = "pc", | ||
3176 | }; | ||
3177 | |||
3178 | static const char * const color_primaries_names[AVCOL_PRI_NB] = { | ||
3179 | [AVCOL_PRI_RESERVED0] = "reserved", | ||
3180 | [AVCOL_PRI_BT709] = "bt709", | ||
3181 | [AVCOL_PRI_UNSPECIFIED] = "unknown", | ||
3182 | [AVCOL_PRI_RESERVED] = "reserved", | ||
3183 | [AVCOL_PRI_BT470M] = "bt470m", | ||
3184 | [AVCOL_PRI_BT470BG] = "bt470bg", | ||
3185 | [AVCOL_PRI_SMPTE170M] = "smpte170m", | ||
3186 | [AVCOL_PRI_SMPTE240M] = "smpte240m", | ||
3187 | [AVCOL_PRI_FILM] = "film", | ||
3188 | [AVCOL_PRI_BT2020] = "bt2020", | ||
3189 | [AVCOL_PRI_SMPTE428] = "smpte428", | ||
3190 | [AVCOL_PRI_SMPTE431] = "smpte431", | ||
3191 | [AVCOL_PRI_SMPTE432] = "smpte432", | ||
3192 | [AVCOL_PRI_EBU3213] = "ebu3213", | ||
3193 | }; | ||
3194 | |||
3195 | static const char * const color_transfer_names[] = { | ||
3196 | [AVCOL_TRC_RESERVED0] = "reserved", | ||
3197 | [AVCOL_TRC_BT709] = "bt709", | ||
3198 | [AVCOL_TRC_UNSPECIFIED] = "unknown", | ||
3199 | [AVCOL_TRC_RESERVED] = "reserved", | ||
3200 | [AVCOL_TRC_GAMMA22] = "bt470m", | ||
3201 | [AVCOL_TRC_GAMMA28] = "bt470bg", | ||
3202 | [AVCOL_TRC_SMPTE170M] = "smpte170m", | ||
3203 | [AVCOL_TRC_SMPTE240M] = "smpte240m", | ||
3204 | [AVCOL_TRC_LINEAR] = "linear", | ||
3205 | [AVCOL_TRC_LOG] = "log100", | ||
3206 | [AVCOL_TRC_LOG_SQRT] = "log316", | ||
3207 | [AVCOL_TRC_IEC61966_2_4] = "iec61966-2-4", | ||
3208 | [AVCOL_TRC_BT1361_ECG] = "bt1361e", | ||
3209 | [AVCOL_TRC_IEC61966_2_1] = "iec61966-2-1", | ||
3210 | [AVCOL_TRC_BT2020_10] = "bt2020-10", | ||
3211 | [AVCOL_TRC_BT2020_12] = "bt2020-12", | ||
3212 | [AVCOL_TRC_SMPTE2084] = "smpte2084", | ||
3213 | [AVCOL_TRC_SMPTE428] = "smpte428", | ||
3214 | [AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67", | ||
3215 | }; | ||
3216 | |||
3217 | static const char * const color_space_names[] = { | ||
3218 | [AVCOL_SPC_RGB] = "gbr", | ||
3219 | [AVCOL_SPC_BT709] = "bt709", | ||
3220 | [AVCOL_SPC_UNSPECIFIED] = "unknown", | ||
3221 | [AVCOL_SPC_RESERVED] = "reserved", | ||
3222 | [AVCOL_SPC_FCC] = "fcc", | ||
3223 | [AVCOL_SPC_BT470BG] = "bt470bg", | ||
3224 | [AVCOL_SPC_SMPTE170M] = "smpte170m", | ||
3225 | [AVCOL_SPC_SMPTE240M] = "smpte240m", | ||
3226 | [AVCOL_SPC_YCGCO] = "ycgco", | ||
3227 | [AVCOL_SPC_BT2020_NCL] = "bt2020nc", | ||
3228 | [AVCOL_SPC_BT2020_CL] = "bt2020c", | ||
3229 | [AVCOL_SPC_SMPTE2085] = "smpte2085", | ||
3230 | [AVCOL_SPC_CHROMA_DERIVED_NCL] = "chroma-derived-nc", | ||
3231 | [AVCOL_SPC_CHROMA_DERIVED_CL] = "chroma-derived-c", | ||
3232 | [AVCOL_SPC_ICTCP] = "ictcp", | ||
3233 | [AVCOL_SPC_IPT_C2] = "ipt-c2", | ||
3234 | [AVCOL_SPC_YCGCO_RE] = "ycgco-re", | ||
3235 | [AVCOL_SPC_YCGCO_RO] = "ycgco-ro", | ||
3236 | }; | ||
3237 | |||
3238 | static const char * const chroma_location_names[] = { | ||
3239 | [AVCHROMA_LOC_UNSPECIFIED] = "unspecified", | ||
3240 | [AVCHROMA_LOC_LEFT] = "left", | ||
3241 | [AVCHROMA_LOC_CENTER] = "center", | ||
3242 | [AVCHROMA_LOC_TOPLEFT] = "topleft", | ||
3243 | [AVCHROMA_LOC_TOP] = "top", | ||
3244 | [AVCHROMA_LOC_BOTTOMLEFT] = "bottomleft", | ||
3245 | [AVCHROMA_LOC_BOTTOM] = "bottom", | ||
3246 | }; | ||
3247 | |||
3248 | 24700 | static enum AVPixelFormat get_pix_fmt_internal(const char *name) | |
3249 | { | ||
3250 | enum AVPixelFormat pix_fmt; | ||
3251 | |||
3252 |
2/2✓ Branch 0 taken 2511165 times.
✓ Branch 1 taken 1546 times.
|
2512711 | for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) |
3253 |
1/2✓ Branch 0 taken 2511165 times.
✗ Branch 1 not taken.
|
2511165 | if (av_pix_fmt_descriptors[pix_fmt].name && |
3254 |
4/4✓ Branch 0 taken 2488013 times.
✓ Branch 1 taken 23152 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 2488011 times.
|
4999178 | (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) || |
3255 | 2488013 | av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias))) | |
3256 | 23154 | return pix_fmt; | |
3257 | |||
3258 | 1546 | return AV_PIX_FMT_NONE; | |
3259 | } | ||
3260 | |||
3261 | 87775 | const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt) | |
3262 | { | ||
3263 | 87775 | return (unsigned)pix_fmt < AV_PIX_FMT_NB ? | |
3264 |
2/2✓ Branch 0 taken 87773 times.
✓ Branch 1 taken 2 times.
|
87775 | av_pix_fmt_descriptors[pix_fmt].name : NULL; |
3265 | } | ||
3266 | |||
3267 | #if HAVE_BIGENDIAN | ||
3268 | # define X_NE(be, le) be | ||
3269 | #else | ||
3270 | # define X_NE(be, le) le | ||
3271 | #endif | ||
3272 | |||
3273 | 23123 | enum AVPixelFormat av_get_pix_fmt(const char *name) | |
3274 | { | ||
3275 | enum AVPixelFormat pix_fmt; | ||
3276 | |||
3277 |
2/2✓ Branch 0 taken 43 times.
✓ Branch 1 taken 23080 times.
|
23123 | if (!strcmp(name, "rgb32")) |
3278 | 43 | name = X_NE("argb", "bgra"); | |
3279 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 23080 times.
|
23080 | else if (!strcmp(name, "bgr32")) |
3280 | ✗ | name = X_NE("abgr", "rgba"); | |
3281 | |||
3282 | 23123 | pix_fmt = get_pix_fmt_internal(name); | |
3283 |
2/2✓ Branch 0 taken 1544 times.
✓ Branch 1 taken 21579 times.
|
23123 | if (pix_fmt == AV_PIX_FMT_NONE) { |
3284 | char name2[32]; | ||
3285 | |||
3286 | 1544 | snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le")); | |
3287 | 1544 | pix_fmt = get_pix_fmt_internal(name2); | |
3288 | } | ||
3289 | |||
3290 | 23123 | return pix_fmt; | |
3291 | } | ||
3292 | |||
3293 | 226363 | int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc) | |
3294 | { | ||
3295 | 226363 | int c, bits = 0; | |
3296 | 226363 | int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h; | |
3297 | |||
3298 |
2/2✓ Branch 0 taken 671245 times.
✓ Branch 1 taken 226363 times.
|
897608 | for (c = 0; c < pixdesc->nb_components; c++) { |
3299 |
4/4✓ Branch 0 taken 455744 times.
✓ Branch 1 taken 215501 times.
✓ Branch 2 taken 240585 times.
✓ Branch 3 taken 215159 times.
|
671245 | int s = c == 1 || c == 2 ? 0 : log2_pixels; |
3300 | 671245 | bits += pixdesc->comp[c].depth << s; | |
3301 | } | ||
3302 | |||
3303 | 226363 | return bits >> log2_pixels; | |
3304 | } | ||
3305 | |||
3306 | 1198 | int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc) | |
3307 | { | ||
3308 | 1198 | int c, bits = 0; | |
3309 | 1198 | int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h; | |
3310 | 1198 | int steps[4] = {0}; | |
3311 | |||
3312 |
2/2✓ Branch 0 taken 3633 times.
✓ Branch 1 taken 1198 times.
|
4831 | for (c = 0; c < pixdesc->nb_components; c++) { |
3313 | 3633 | const AVComponentDescriptor *comp = &pixdesc->comp[c]; | |
3314 |
4/4✓ Branch 0 taken 2561 times.
✓ Branch 1 taken 1072 times.
✓ Branch 2 taken 1489 times.
✓ Branch 3 taken 1072 times.
|
3633 | int s = c == 1 || c == 2 ? 0 : log2_pixels; |
3315 | 3633 | steps[comp->plane] = comp->step << s; | |
3316 | } | ||
3317 |
2/2✓ Branch 0 taken 4792 times.
✓ Branch 1 taken 1198 times.
|
5990 | for (c = 0; c < 4; c++) |
3318 | 4792 | bits += steps[c]; | |
3319 | |||
3320 |
2/2✓ Branch 0 taken 1104 times.
✓ Branch 1 taken 94 times.
|
1198 | if(!(pixdesc->flags & AV_PIX_FMT_FLAG_BITSTREAM)) |
3321 | 1104 | bits *= 8; | |
3322 | |||
3323 | 1198 | return bits >> log2_pixels; | |
3324 | } | ||
3325 | |||
3326 | ✗ | char *av_get_pix_fmt_string(char *buf, int buf_size, | |
3327 | enum AVPixelFormat pix_fmt) | ||
3328 | { | ||
3329 | /* print header */ | ||
3330 | ✗ | if (pix_fmt < 0) { | |
3331 | ✗ | snprintf (buf, buf_size, "name" " nb_components" " nb_bits"); | |
3332 | } else { | ||
3333 | ✗ | const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt]; | |
3334 | ✗ | snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name, | |
3335 | ✗ | pixdesc->nb_components, av_get_bits_per_pixel(pixdesc)); | |
3336 | } | ||
3337 | |||
3338 | ✗ | return buf; | |
3339 | } | ||
3340 | |||
3341 | 408402148 | const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) | |
3342 | { | ||
3343 |
4/4✓ Branch 0 taken 407452625 times.
✓ Branch 1 taken 949523 times.
✓ Branch 2 taken 72020 times.
✓ Branch 3 taken 407380605 times.
|
408402148 | if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) |
3344 | 1021543 | return NULL; | |
3345 | 407380605 | return &av_pix_fmt_descriptors[pix_fmt]; | |
3346 | } | ||
3347 | |||
3348 | 3366482 | const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev) | |
3349 | { | ||
3350 |
2/2✓ Branch 0 taken 12998 times.
✓ Branch 1 taken 3353484 times.
|
3366482 | if (!prev) |
3351 | 12998 | return &av_pix_fmt_descriptors[0]; | |
3352 |
2/2✓ Branch 0 taken 3340486 times.
✓ Branch 1 taken 12998 times.
|
3353484 | while (prev - av_pix_fmt_descriptors < FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1) { |
3353 | 3340486 | prev++; | |
3354 |
1/2✓ Branch 0 taken 3340486 times.
✗ Branch 1 not taken.
|
3340486 | if (prev->name) |
3355 | 3340486 | return prev; | |
3356 | } | ||
3357 | 12998 | return NULL; | |
3358 | } | ||
3359 | |||
3360 | 3354635 | enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc) | |
3361 | { | ||
3362 |
1/2✓ Branch 0 taken 3354635 times.
✗ Branch 1 not taken.
|
3354635 | if (desc < av_pix_fmt_descriptors || |
3363 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3354635 times.
|
3354635 | desc >= av_pix_fmt_descriptors + FF_ARRAY_ELEMS(av_pix_fmt_descriptors)) |
3364 | ✗ | return AV_PIX_FMT_NONE; | |
3365 | |||
3366 | 3354635 | return desc - av_pix_fmt_descriptors; | |
3367 | } | ||
3368 | |||
3369 | 68866 | int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, | |
3370 | int *h_shift, int *v_shift) | ||
3371 | { | ||
3372 | 68866 | const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); | |
3373 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 68866 times.
|
68866 | if (!desc) |
3374 | ✗ | return AVERROR(ENOSYS); | |
3375 | 68866 | *h_shift = desc->log2_chroma_w; | |
3376 | 68866 | *v_shift = desc->log2_chroma_h; | |
3377 | |||
3378 | 68866 | return 0; | |
3379 | } | ||
3380 | |||
3381 | 157277 | int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt) | |
3382 | { | ||
3383 | 157277 | const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); | |
3384 | 157277 | int i, planes[4] = { 0 }, ret = 0; | |
3385 | |||
3386 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 157277 times.
|
157277 | if (!desc) |
3387 | ✗ | return AVERROR(EINVAL); | |
3388 | |||
3389 |
2/2✓ Branch 0 taken 461902 times.
✓ Branch 1 taken 157277 times.
|
619179 | for (i = 0; i < desc->nb_components; i++) |
3390 | 461902 | planes[desc->comp[i].plane] = 1; | |
3391 |
2/2✓ Branch 0 taken 629108 times.
✓ Branch 1 taken 157277 times.
|
786385 | for (i = 0; i < FF_ARRAY_ELEMS(planes); i++) |
3392 | 629108 | ret += planes[i]; | |
3393 | 157277 | return ret; | |
3394 | } | ||
3395 | |||
3396 | 655 | enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt) | |
3397 | { | ||
3398 | 655 | const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); | |
3399 | char name[16]; | ||
3400 | int i; | ||
3401 | |||
3402 |
2/4✓ Branch 0 taken 655 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 655 times.
|
655 | if (!desc || strlen(desc->name) < 2) |
3403 | ✗ | return AV_PIX_FMT_NONE; | |
3404 | 655 | av_strlcpy(name, desc->name, sizeof(name)); | |
3405 | 655 | i = strlen(name) - 2; | |
3406 |
4/4✓ Branch 0 taken 644 times.
✓ Branch 1 taken 11 times.
✓ Branch 2 taken 622 times.
✓ Branch 3 taken 22 times.
|
655 | if (strcmp(name + i, "be") && strcmp(name + i, "le")) |
3407 | 622 | return AV_PIX_FMT_NONE; | |
3408 | |||
3409 | 33 | name[i] ^= 'b' ^ 'l'; | |
3410 | |||
3411 | 33 | return get_pix_fmt_internal(name); | |
3412 | } | ||
3413 | |||
3414 | #define FF_COLOR_NA -1 | ||
3415 | #define FF_COLOR_RGB 0 /**< RGB color space */ | ||
3416 | #define FF_COLOR_GRAY 1 /**< gray color space */ | ||
3417 | #define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */ | ||
3418 | #define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */ | ||
3419 | #define FF_COLOR_XYZ 4 | ||
3420 | |||
3421 | #define pixdesc_has_alpha(pixdesc) \ | ||
3422 | ((pixdesc)->flags & AV_PIX_FMT_FLAG_ALPHA) | ||
3423 | |||
3424 | |||
3425 | 9672 | static int get_color_type(const AVPixFmtDescriptor *desc) { | |
3426 |
2/2✓ Branch 0 taken 18 times.
✓ Branch 1 taken 9654 times.
|
9672 | if (desc->flags & AV_PIX_FMT_FLAG_PAL) |
3427 | 18 | return FF_COLOR_RGB; | |
3428 | |||
3429 |
4/4✓ Branch 0 taken 8648 times.
✓ Branch 1 taken 1006 times.
✓ Branch 2 taken 87 times.
✓ Branch 3 taken 8561 times.
|
9654 | if(desc->nb_components == 1 || desc->nb_components == 2) |
3430 | 1093 | return FF_COLOR_GRAY; | |
3431 | |||
3432 |
1/2✓ Branch 0 taken 8561 times.
✗ Branch 1 not taken.
|
8561 | if (desc->name) { |
3433 |
2/2✓ Branch 1 taken 242 times.
✓ Branch 2 taken 8319 times.
|
8561 | if (av_strstart(desc->name, "yuvj", NULL)) |
3434 | 242 | return FF_COLOR_YUV_JPEG; | |
3435 | } | ||
3436 | |||
3437 |
2/2✓ Branch 0 taken 2521 times.
✓ Branch 1 taken 5798 times.
|
8319 | if(desc->flags & AV_PIX_FMT_FLAG_RGB) |
3438 | 2521 | return FF_COLOR_RGB; | |
3439 | |||
3440 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 5796 times.
|
5798 | if(desc->flags & AV_PIX_FMT_FLAG_XYZ) |
3441 | 2 | return FF_COLOR_XYZ; | |
3442 | |||
3443 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 5796 times.
|
5796 | if(desc->nb_components == 0) |
3444 | ✗ | return FF_COLOR_NA; | |
3445 | |||
3446 | 5796 | return FF_COLOR_YUV; | |
3447 | } | ||
3448 | |||
3449 | 9672 | static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt) | |
3450 | { | ||
3451 | 9672 | const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); | |
3452 | int i; | ||
3453 | |||
3454 |
2/4✓ Branch 0 taken 9672 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 9672 times.
|
9672 | if (!desc || !desc->nb_components) { |
3455 | ✗ | *min = *max = 0; | |
3456 | ✗ | return AVERROR(EINVAL); | |
3457 | } | ||
3458 | |||
3459 | 9672 | *min = INT_MAX, *max = -INT_MAX; | |
3460 |
2/2✓ Branch 0 taken 28071 times.
✓ Branch 1 taken 9672 times.
|
37743 | for (i = 0; i < desc->nb_components; i++) { |
3461 | 28071 | *min = FFMIN(desc->comp[i].depth, *min); | |
3462 | 28071 | *max = FFMAX(desc->comp[i].depth, *max); | |
3463 | } | ||
3464 | 9672 | return 0; | |
3465 | } | ||
3466 | |||
3467 | 5460 | static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt, | |
3468 | enum AVPixelFormat src_pix_fmt, | ||
3469 | unsigned *lossp, unsigned consider) | ||
3470 | { | ||
3471 | 5460 | const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt); | |
3472 | 5460 | const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt); | |
3473 | int src_color, dst_color; | ||
3474 | int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth; | ||
3475 | int ret, loss, i, nb_components; | ||
3476 | 5460 | int score = INT_MAX - 1; | |
3477 | |||
3478 |
2/4✓ Branch 0 taken 5460 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 5460 times.
|
5460 | if (!src_desc || !dst_desc) |
3479 | ✗ | return -4; | |
3480 | |||
3481 |
2/2✓ Branch 0 taken 5358 times.
✓ Branch 1 taken 102 times.
|
5460 | if ((src_desc->flags & AV_PIX_FMT_FLAG_HWACCEL) || |
3482 |
2/2✓ Branch 0 taken 166 times.
✓ Branch 1 taken 5192 times.
|
5358 | (dst_desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) { |
3483 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 265 times.
|
268 | if (dst_pix_fmt == src_pix_fmt) |
3484 | 3 | return -1; | |
3485 | else | ||
3486 | 265 | return -2; | |
3487 | } | ||
3488 | |||
3489 | /* compute loss */ | ||
3490 | 5192 | *lossp = loss = 0; | |
3491 | |||
3492 |
2/2✓ Branch 0 taken 356 times.
✓ Branch 1 taken 4836 times.
|
5192 | if (dst_pix_fmt == src_pix_fmt) |
3493 | 356 | return INT_MAX; | |
3494 | |||
3495 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 4836 times.
|
4836 | if ((ret = get_pix_fmt_depth(&src_min_depth, &src_max_depth, src_pix_fmt)) < 0) |
3496 | ✗ | return -3; | |
3497 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 4836 times.
|
4836 | if ((ret = get_pix_fmt_depth(&dst_min_depth, &dst_max_depth, dst_pix_fmt)) < 0) |
3498 | ✗ | return -3; | |
3499 | |||
3500 | 4836 | src_color = get_color_type(src_desc); | |
3501 | 4836 | dst_color = get_color_type(dst_desc); | |
3502 |
2/2✓ Branch 0 taken 18 times.
✓ Branch 1 taken 4818 times.
|
4836 | if (dst_pix_fmt == AV_PIX_FMT_PAL8) |
3503 | 18 | nb_components = FFMIN(src_desc->nb_components, 4); | |
3504 | else | ||
3505 | 4818 | nb_components = FFMIN(src_desc->nb_components, dst_desc->nb_components); | |
3506 | |||
3507 |
2/2✓ Branch 0 taken 12831 times.
✓ Branch 1 taken 4836 times.
|
17667 | for (i = 0; i < nb_components; i++) { |
3508 |
2/2✓ Branch 0 taken 54 times.
✓ Branch 1 taken 12777 times.
|
12831 | int depth_minus1 = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components : (dst_desc->comp[i].depth - 1); |
3509 | 12831 | int depth_delta = src_desc->comp[i].depth - 1 - depth_minus1; | |
3510 |
3/4✓ Branch 0 taken 2165 times.
✓ Branch 1 taken 10666 times.
✓ Branch 2 taken 2165 times.
✗ Branch 3 not taken.
|
12831 | if (depth_delta > 0 && (consider & FF_LOSS_DEPTH)) { |
3511 | 2165 | loss |= FF_LOSS_DEPTH; | |
3512 | 2165 | score -= 65536 >> depth_minus1; | |
3513 |
3/4✓ Branch 0 taken 3839 times.
✓ Branch 1 taken 6827 times.
✓ Branch 2 taken 3839 times.
✗ Branch 3 not taken.
|
10666 | } else if (depth_delta < 0 && (consider & FF_LOSS_EXCESS_DEPTH)) { |
3514 | // Favour formats where bit depth exactly matches. If all other | ||
3515 | // scoring is equal, we'd rather use the bit depth that most closely | ||
3516 | // matches the source. | ||
3517 | 3839 | loss |= FF_LOSS_EXCESS_DEPTH; | |
3518 | 3839 | score += depth_delta; | |
3519 | } | ||
3520 | } | ||
3521 | |||
3522 |
1/2✓ Branch 0 taken 4836 times.
✗ Branch 1 not taken.
|
4836 | if (consider & FF_LOSS_RESOLUTION) { |
3523 |
2/2✓ Branch 0 taken 995 times.
✓ Branch 1 taken 3841 times.
|
4836 | if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w) { |
3524 | 995 | loss |= FF_LOSS_RESOLUTION; | |
3525 | 995 | score -= 256 << dst_desc->log2_chroma_w; | |
3526 | } | ||
3527 |
2/2✓ Branch 0 taken 799 times.
✓ Branch 1 taken 4037 times.
|
4836 | if (dst_desc->log2_chroma_h > src_desc->log2_chroma_h) { |
3528 | 799 | loss |= FF_LOSS_RESOLUTION; | |
3529 | 799 | score -= 256 << dst_desc->log2_chroma_h; | |
3530 | } | ||
3531 | // don't favor 422 over 420 if downsampling is needed, because 420 has much better support on the decoder side | ||
3532 |
4/4✓ Branch 0 taken 1924 times.
✓ Branch 1 taken 2912 times.
✓ Branch 2 taken 962 times.
✓ Branch 3 taken 962 times.
|
4836 | if (dst_desc->log2_chroma_w == 1 && src_desc->log2_chroma_w == 0 && |
3533 |
4/4✓ Branch 0 taken 659 times.
✓ Branch 1 taken 303 times.
✓ Branch 2 taken 630 times.
✓ Branch 3 taken 29 times.
|
962 | dst_desc->log2_chroma_h == 1 && src_desc->log2_chroma_h == 0 ) { |
3534 | 630 | score += 512; | |
3535 | } | ||
3536 | } | ||
3537 | |||
3538 |
1/2✓ Branch 0 taken 4836 times.
✗ Branch 1 not taken.
|
4836 | if (consider & FF_LOSS_EXCESS_RESOLUTION) { |
3539 | // Favour formats where chroma subsampling exactly matches. If all other | ||
3540 | // scoring is equal, we'd rather use the subsampling that most closely | ||
3541 | // matches the source. | ||
3542 |
2/2✓ Branch 0 taken 1291 times.
✓ Branch 1 taken 3545 times.
|
4836 | if (dst_desc->log2_chroma_w < src_desc->log2_chroma_w) { |
3543 | 1291 | loss |= FF_LOSS_EXCESS_RESOLUTION; | |
3544 | 1291 | score -= 1 << (src_desc->log2_chroma_w - dst_desc->log2_chroma_w); | |
3545 | } | ||
3546 | |||
3547 |
2/2✓ Branch 0 taken 1342 times.
✓ Branch 1 taken 3494 times.
|
4836 | if (dst_desc->log2_chroma_h < src_desc->log2_chroma_h) { |
3548 | 1342 | loss |= FF_LOSS_EXCESS_RESOLUTION; | |
3549 | 1342 | score -= 1 << (src_desc->log2_chroma_h - dst_desc->log2_chroma_h); | |
3550 | } | ||
3551 | |||
3552 | // don't favour 411 over 420, because 420 has much better support on the | ||
3553 | // decoder side. | ||
3554 |
4/4✓ Branch 0 taken 1924 times.
✓ Branch 1 taken 2912 times.
✓ Branch 2 taken 63 times.
✓ Branch 3 taken 1861 times.
|
4836 | if (dst_desc->log2_chroma_w == 1 && src_desc->log2_chroma_w == 2 && |
3555 |
4/4✓ Branch 0 taken 32 times.
✓ Branch 1 taken 31 times.
✓ Branch 2 taken 19 times.
✓ Branch 3 taken 13 times.
|
63 | dst_desc->log2_chroma_h == 1 && src_desc->log2_chroma_h == 2) { |
3556 | 19 | score += 4; | |
3557 | } | ||
3558 | } | ||
3559 | |||
3560 |
1/2✓ Branch 0 taken 4836 times.
✗ Branch 1 not taken.
|
4836 | if(consider & FF_LOSS_COLORSPACE) |
3561 |
5/5✓ Branch 0 taken 1051 times.
✓ Branch 1 taken 805 times.
✓ Branch 2 taken 2924 times.
✓ Branch 3 taken 54 times.
✓ Branch 4 taken 2 times.
|
4836 | switch(dst_color) { |
3562 | 1051 | case FF_COLOR_RGB: | |
3563 |
4/4✓ Branch 0 taken 690 times.
✓ Branch 1 taken 361 times.
✓ Branch 2 taken 654 times.
✓ Branch 3 taken 36 times.
|
1051 | if (src_color != FF_COLOR_RGB && |
3564 | src_color != FF_COLOR_GRAY) | ||
3565 | 654 | loss |= FF_LOSS_COLORSPACE; | |
3566 | 1051 | break; | |
3567 | 805 | case FF_COLOR_GRAY: | |
3568 |
2/2✓ Branch 0 taken 661 times.
✓ Branch 1 taken 144 times.
|
805 | if (src_color != FF_COLOR_GRAY) |
3569 | 661 | loss |= FF_LOSS_COLORSPACE; | |
3570 | 805 | break; | |
3571 | 2924 | case FF_COLOR_YUV: | |
3572 |
2/2✓ Branch 0 taken 1025 times.
✓ Branch 1 taken 1899 times.
|
2924 | if (src_color != FF_COLOR_YUV) |
3573 | 1025 | loss |= FF_LOSS_COLORSPACE; | |
3574 | 2924 | break; | |
3575 | 54 | case FF_COLOR_YUV_JPEG: | |
3576 |
3/4✓ Branch 0 taken 54 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 38 times.
✓ Branch 3 taken 16 times.
|
54 | if (src_color != FF_COLOR_YUV_JPEG && |
3577 |
1/2✓ Branch 0 taken 38 times.
✗ Branch 1 not taken.
|
38 | src_color != FF_COLOR_YUV && |
3578 | src_color != FF_COLOR_GRAY) | ||
3579 | 38 | loss |= FF_LOSS_COLORSPACE; | |
3580 | 54 | break; | |
3581 | 2 | default: | |
3582 | /* fail safe test */ | ||
3583 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
2 | if (src_color != dst_color) |
3584 | 2 | loss |= FF_LOSS_COLORSPACE; | |
3585 | 2 | break; | |
3586 | } | ||
3587 |
2/2✓ Branch 0 taken 2380 times.
✓ Branch 1 taken 2456 times.
|
4836 | if(loss & FF_LOSS_COLORSPACE) |
3588 |
2/2✓ Branch 0 taken 713 times.
✓ Branch 1 taken 1667 times.
|
2380 | score -= (nb_components * 65536) >> FFMIN(dst_desc->comp[0].depth - 1, src_desc->comp[0].depth - 1); |
3589 | |||
3590 |
4/4✓ Branch 0 taken 805 times.
✓ Branch 1 taken 4031 times.
✓ Branch 2 taken 661 times.
✓ Branch 3 taken 144 times.
|
4836 | if (dst_color == FF_COLOR_GRAY && |
3591 |
1/2✓ Branch 0 taken 661 times.
✗ Branch 1 not taken.
|
661 | src_color != FF_COLOR_GRAY && (consider & FF_LOSS_CHROMA)) { |
3592 | 661 | loss |= FF_LOSS_CHROMA; | |
3593 | 661 | score -= 2 * 65536; | |
3594 | } | ||
3595 |
6/6✓ Branch 0 taken 4413 times.
✓ Branch 1 taken 423 times.
✓ Branch 2 taken 698 times.
✓ Branch 3 taken 3715 times.
✓ Branch 4 taken 154 times.
✓ Branch 5 taken 544 times.
|
4836 | if (!pixdesc_has_alpha(dst_desc) && (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))) { |
3596 | 154 | loss |= FF_LOSS_ALPHA; | |
3597 | 154 | score -= 65536; | |
3598 | } | ||
3599 |
4/6✓ Branch 0 taken 18 times.
✓ Branch 1 taken 4818 times.
✓ Branch 2 taken 18 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 18 times.
✗ Branch 5 not taken.
|
4836 | if (dst_pix_fmt == AV_PIX_FMT_PAL8 && (consider & FF_LOSS_COLORQUANT) && |
3600 |
1/6✗ Branch 0 not taken.
✓ Branch 1 taken 18 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
|
18 | (src_pix_fmt != AV_PIX_FMT_PAL8 && (src_color != FF_COLOR_GRAY || (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))))) { |
3601 | 18 | loss |= FF_LOSS_COLORQUANT; | |
3602 | 18 | score -= 65536; | |
3603 | } | ||
3604 | |||
3605 | 4836 | *lossp = loss; | |
3606 | 4836 | return score; | |
3607 | } | ||
3608 | |||
3609 | ✗ | int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, | |
3610 | enum AVPixelFormat src_pix_fmt, | ||
3611 | int has_alpha) | ||
3612 | { | ||
3613 | int loss; | ||
3614 | ✗ | int ret = get_pix_fmt_score(dst_pix_fmt, src_pix_fmt, &loss, has_alpha ? ~0 : ~FF_LOSS_ALPHA); | |
3615 | ✗ | if (ret < 0) | |
3616 | ✗ | return ret; | |
3617 | ✗ | return loss; | |
3618 | } | ||
3619 | |||
3620 | 2962 | enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, | |
3621 | enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr) | ||
3622 | { | ||
3623 | enum AVPixelFormat dst_pix_fmt; | ||
3624 | int loss1, loss2, loss_mask; | ||
3625 | 2962 | const AVPixFmtDescriptor *desc1 = av_pix_fmt_desc_get(dst_pix_fmt1); | |
3626 | 2962 | const AVPixFmtDescriptor *desc2 = av_pix_fmt_desc_get(dst_pix_fmt2); | |
3627 | int score1, score2; | ||
3628 | |||
3629 |
2/2✓ Branch 0 taken 232 times.
✓ Branch 1 taken 2730 times.
|
2962 | if (!desc1) { |
3630 | 232 | dst_pix_fmt = dst_pix_fmt2; | |
3631 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2730 times.
|
2730 | } else if (!desc2) { |
3632 | ✗ | dst_pix_fmt = dst_pix_fmt1; | |
3633 | } else { | ||
3634 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2730 times.
|
2730 | loss_mask= loss_ptr?~*loss_ptr:~0; /* use loss mask if provided */ |
3635 |
2/2✓ Branch 0 taken 2566 times.
✓ Branch 1 taken 164 times.
|
2730 | if(!has_alpha) |
3636 | 2566 | loss_mask &= ~FF_LOSS_ALPHA; | |
3637 | |||
3638 | 2730 | score1 = get_pix_fmt_score(dst_pix_fmt1, src_pix_fmt, &loss1, loss_mask); | |
3639 | 2730 | score2 = get_pix_fmt_score(dst_pix_fmt2, src_pix_fmt, &loss2, loss_mask); | |
3640 | |||
3641 |
2/2✓ Branch 0 taken 214 times.
✓ Branch 1 taken 2516 times.
|
2730 | if (score1 == score2) { |
3642 |
2/2✓ Branch 2 taken 164 times.
✓ Branch 3 taken 50 times.
|
214 | if(av_get_padded_bits_per_pixel(desc2) != av_get_padded_bits_per_pixel(desc1)) { |
3643 |
2/2✓ Branch 2 taken 8 times.
✓ Branch 3 taken 156 times.
|
164 | dst_pix_fmt = av_get_padded_bits_per_pixel(desc2) < av_get_padded_bits_per_pixel(desc1) ? dst_pix_fmt2 : dst_pix_fmt1; |
3644 | } else { | ||
3645 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 50 times.
|
50 | dst_pix_fmt = desc2->nb_components < desc1->nb_components ? dst_pix_fmt2 : dst_pix_fmt1; |
3646 | } | ||
3647 | } else { | ||
3648 |
2/2✓ Branch 0 taken 509 times.
✓ Branch 1 taken 2007 times.
|
2516 | dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1; |
3649 | } | ||
3650 | } | ||
3651 | |||
3652 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2962 times.
|
2962 | if (loss_ptr) |
3653 | ✗ | *loss_ptr = av_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha); | |
3654 | 2962 | return dst_pix_fmt; | |
3655 | } | ||
3656 | |||
3657 | 32814 | const char *av_color_range_name(enum AVColorRange range) | |
3658 | { | ||
3659 | return (unsigned) range < AVCOL_RANGE_NB ? | ||
3660 |
1/2✓ Branch 0 taken 32814 times.
✗ Branch 1 not taken.
|
32814 | color_range_names[range] : NULL; |
3661 | } | ||
3662 | |||
3663 | 2150 | int av_color_range_from_name(const char *name) | |
3664 | { | ||
3665 | int i; | ||
3666 | |||
3667 |
1/2✓ Branch 0 taken 4383 times.
✗ Branch 1 not taken.
|
4383 | for (i = 0; i < FF_ARRAY_ELEMS(color_range_names); i++) { |
3668 |
2/2✓ Branch 1 taken 2150 times.
✓ Branch 2 taken 2233 times.
|
4383 | if (av_strstart(name, color_range_names[i], NULL)) |
3669 | 2150 | return i; | |
3670 | } | ||
3671 | |||
3672 | ✗ | return AVERROR(EINVAL); | |
3673 | } | ||
3674 | |||
3675 | 3829 | const char *av_color_primaries_name(enum AVColorPrimaries primaries) | |
3676 | { | ||
3677 | return (unsigned) primaries < AVCOL_PRI_NB ? | ||
3678 |
1/2✓ Branch 0 taken 3829 times.
✗ Branch 1 not taken.
|
3829 | color_primaries_names[primaries] : NULL; |
3679 | } | ||
3680 | |||
3681 | ✗ | int av_color_primaries_from_name(const char *name) | |
3682 | { | ||
3683 | int i; | ||
3684 | |||
3685 | ✗ | for (i = 0; i < FF_ARRAY_ELEMS(color_primaries_names); i++) { | |
3686 | ✗ | if (!color_primaries_names[i]) | |
3687 | ✗ | continue; | |
3688 | |||
3689 | ✗ | if (av_strstart(name, color_primaries_names[i], NULL)) | |
3690 | ✗ | return i; | |
3691 | } | ||
3692 | |||
3693 | ✗ | return AVERROR(EINVAL); | |
3694 | } | ||
3695 | |||
3696 | 3867 | const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer) | |
3697 | { | ||
3698 | return (unsigned) transfer < AVCOL_TRC_NB ? | ||
3699 |
1/2✓ Branch 0 taken 3867 times.
✗ Branch 1 not taken.
|
3867 | color_transfer_names[transfer] : NULL; |
3700 | } | ||
3701 | |||
3702 | ✗ | int av_color_transfer_from_name(const char *name) | |
3703 | { | ||
3704 | int i; | ||
3705 | |||
3706 | ✗ | for (i = 0; i < FF_ARRAY_ELEMS(color_transfer_names); i++) { | |
3707 | ✗ | if (!color_transfer_names[i]) | |
3708 | ✗ | continue; | |
3709 | |||
3710 | ✗ | if (av_strstart(name, color_transfer_names[i], NULL)) | |
3711 | ✗ | return i; | |
3712 | } | ||
3713 | |||
3714 | ✗ | return AVERROR(EINVAL); | |
3715 | } | ||
3716 | |||
3717 | 22328 | const char *av_color_space_name(enum AVColorSpace space) | |
3718 | { | ||
3719 | return (unsigned) space < AVCOL_SPC_NB ? | ||
3720 |
1/2✓ Branch 0 taken 22328 times.
✗ Branch 1 not taken.
|
22328 | color_space_names[space] : NULL; |
3721 | } | ||
3722 | |||
3723 | 20 | int av_color_space_from_name(const char *name) | |
3724 | { | ||
3725 | int i; | ||
3726 | |||
3727 |
1/2✓ Branch 0 taken 65 times.
✗ Branch 1 not taken.
|
65 | for (i = 0; i < FF_ARRAY_ELEMS(color_space_names); i++) { |
3728 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 65 times.
|
65 | if (!color_space_names[i]) |
3729 | ✗ | continue; | |
3730 | |||
3731 |
2/2✓ Branch 1 taken 20 times.
✓ Branch 2 taken 45 times.
|
65 | if (av_strstart(name, color_space_names[i], NULL)) |
3732 | 20 | return i; | |
3733 | } | ||
3734 | |||
3735 | ✗ | return AVERROR(EINVAL); | |
3736 | } | ||
3737 | |||
3738 | 698 | const char *av_chroma_location_name(enum AVChromaLocation location) | |
3739 | { | ||
3740 | return (unsigned) location < AVCHROMA_LOC_NB ? | ||
3741 |
1/2✓ Branch 0 taken 698 times.
✗ Branch 1 not taken.
|
698 | chroma_location_names[location] : NULL; |
3742 | } | ||
3743 | |||
3744 | ✗ | int av_chroma_location_from_name(const char *name) | |
3745 | { | ||
3746 | int i; | ||
3747 | |||
3748 | ✗ | for (i = 0; i < FF_ARRAY_ELEMS(chroma_location_names); i++) { | |
3749 | ✗ | if (!chroma_location_names[i]) | |
3750 | ✗ | continue; | |
3751 | |||
3752 | ✗ | if (av_strstart(name, chroma_location_names[i], NULL)) | |
3753 | ✗ | return i; | |
3754 | } | ||
3755 | |||
3756 | ✗ | return AVERROR(EINVAL); | |
3757 | } | ||
3758 | |||
3759 | 12336 | int av_chroma_location_enum_to_pos(int *xpos, int *ypos, enum AVChromaLocation pos) | |
3760 | { | ||
3761 |
2/4✓ Branch 0 taken 12336 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 12336 times.
|
12336 | if (pos <= AVCHROMA_LOC_UNSPECIFIED || pos >= AVCHROMA_LOC_NB) |
3762 | ✗ | return AVERROR(EINVAL); | |
3763 | 12336 | pos--; | |
3764 | |||
3765 | 12336 | *xpos = (pos&1) * 128; | |
3766 | 12336 | *ypos = ((pos>>1)^(pos<4)) * 128; | |
3767 | |||
3768 | 12336 | return 0; | |
3769 | } | ||
3770 | |||
3771 | 37 | enum AVChromaLocation av_chroma_location_pos_to_enum(int xpos, int ypos) | |
3772 | { | ||
3773 | int pos, xout, yout; | ||
3774 | |||
3775 |
1/2✓ Branch 0 taken 67 times.
✗ Branch 1 not taken.
|
67 | for (pos = AVCHROMA_LOC_UNSPECIFIED + 1; pos < AVCHROMA_LOC_NB; pos++) { |
3776 |
5/6✓ Branch 1 taken 67 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 45 times.
✓ Branch 4 taken 22 times.
✓ Branch 5 taken 37 times.
✓ Branch 6 taken 8 times.
|
67 | if (av_chroma_location_enum_to_pos(&xout, &yout, pos) == 0 && xout == xpos && yout == ypos) |
3777 | 37 | return pos; | |
3778 | } | ||
3779 | ✗ | return AVCHROMA_LOC_UNSPECIFIED; | |
3780 | } | ||
3781 |