pixfmt: Add GRAY12
[libav.git] / libavutil / pixdesc.c
CommitLineData
9b61d838 1/*
e0cffbe7 2 * pixel format descriptor
9b61d838
MN
3 * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
4 *
2912e87a 5 * This file is part of Libav.
9b61d838 6 *
2912e87a 7 * Libav is free software; you can redistribute it and/or
9b61d838
MN
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 *
2912e87a 12 * Libav is distributed in the hope that it will be useful,
9b61d838
MN
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
2912e87a 18 * License along with Libav; if not, write to the Free Software
9b61d838
MN
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
47bfd50a
MR
22#include <stdio.h>
23#include <string.h>
d2fcb356 24
d2962e9f 25#include "avstring.h"
d2fcb356 26#include "common.h"
51135d1d 27#include "pixfmt.h"
9b61d838 28#include "pixdesc.h"
7950e519 29#include "internal.h"
f47a7cb7 30#include "intreadwrite.h"
19e30a58 31#include "version.h"
f47a7cb7 32
a6842670
LB
33void av_read_image_line(uint16_t *dst,
34 const uint8_t *data[4], const int linesize[4],
35 const AVPixFmtDescriptor *desc,
36 int x, int y, int c, int w,
4a59eca9 37 int read_pal_component)
f47a7cb7 38{
4a59eca9
TB
39 AVComponentDescriptor comp = desc->comp[c];
40 int plane = comp.plane;
2268db2c 41 int depth = comp.depth;
4a59eca9
TB
42 int mask = (1 << depth) - 1;
43 int shift = comp.shift;
2268db2c 44 int step = comp.step;
4a59eca9 45 int flags = desc->flags;
f47a7cb7 46
e6c4ac7b 47 if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
2268db2c 48 int skip = x * step + comp.offset;
4a59eca9
TB
49 const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
50 int shift = 8 - depth - (skip & 7);
f47a7cb7 51
4a59eca9 52 while (w--) {
f47a7cb7 53 int val = (*p >> shift) & mask;
4a59eca9
TB
54 if (read_pal_component)
55 val = data[1][4*val + c];
f47a7cb7 56 shift -= step;
4a59eca9 57 p -= shift >> 3;
f47a7cb7 58 shift &= 7;
4a59eca9 59 *dst++ = val;
f47a7cb7
SS
60 }
61 } else {
a6842670 62 const uint8_t *p = data[plane] + y * linesize[plane] +
2268db2c 63 x * step + comp.offset;
4660143a 64 int is_8bit = shift + depth <= 8;
f47a7cb7 65
4660143a 66 if (is_8bit)
e6c4ac7b 67 p += !!(flags & AV_PIX_FMT_FLAG_BE);
4660143a 68
4a59eca9 69 while (w--) {
9525243f 70 int val = is_8bit ? *p :
e6c4ac7b 71 flags & AV_PIX_FMT_FLAG_BE ? AV_RB16(p) : AV_RL16(p);
4a59eca9
TB
72 val = (val >> shift) & mask;
73 if (read_pal_component)
74 val = data[1][4 * val + c];
75 p += step;
76 *dst++ = val;
f47a7cb7
SS
77 }
78 }
79}
80
a6842670
LB
81void av_write_image_line(const uint16_t *src,
82 uint8_t *data[4], const int linesize[4],
83 const AVPixFmtDescriptor *desc,
84 int x, int y, int c, int w)
f47a7cb7
SS
85{
86 AVComponentDescriptor comp = desc->comp[c];
87 int plane = comp.plane;
2268db2c
VG
88 int depth = comp.depth;
89 int step = comp.step;
f47a7cb7
SS
90 int flags = desc->flags;
91
e6c4ac7b 92 if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
2268db2c 93 int skip = x * step + comp.offset;
4a59eca9
TB
94 uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
95 int shift = 8 - depth - (skip & 7);
f47a7cb7
SS
96
97 while (w--) {
98 *p |= *src++ << shift;
99 shift -= step;
4a59eca9 100 p -= shift >> 3;
f47a7cb7
SS
101 shift &= 7;
102 }
103 } else {
104 int shift = comp.shift;
a6842670 105 uint8_t *p = data[plane] + y * linesize[plane] +
2268db2c 106 x * step + comp.offset;
f47a7cb7 107
9525243f 108 if (shift + depth <= 8) {
e6c4ac7b 109 p += !!(flags & AV_PIX_FMT_FLAG_BE);
9525243f 110 while (w--) {
4a59eca9 111 *p |= (*src++ << shift);
9525243f
MR
112 p += step;
113 }
114 } else {
78b19cf0 115 while (w--) {
e6c4ac7b 116 if (flags & AV_PIX_FMT_FLAG_BE) {
4a59eca9 117 uint16_t val = AV_RB16(p) | (*src++ << shift);
78b19cf0
MR
118 AV_WB16(p, val);
119 } else {
4a59eca9 120 uint16_t val = AV_RL16(p) | (*src++ << shift);
78b19cf0
MR
121 AV_WL16(p, val);
122 }
4a59eca9 123 p += step;
f47a7cb7 124 }
9525243f 125 }
f47a7cb7
SS
126 }
127}
128
2268db2c
VG
129#if FF_API_PLUS1_MINUS1
130FF_DISABLE_DEPRECATION_WARNINGS
131#endif
2f8cbbc9 132static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
716d413c 133 [AV_PIX_FMT_YUV420P] = {
bcbd9a14 134 .name = "yuv420p",
4a59eca9
TB
135 .nb_components = 3,
136 .log2_chroma_w = 1,
137 .log2_chroma_h = 1,
9b61d838 138 .comp = {
2268db2c
VG
139 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
140 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
141 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
9b61d838 142 },
e6c4ac7b 143 .flags = AV_PIX_FMT_FLAG_PLANAR,
9b61d838 144 },
716d413c 145 [AV_PIX_FMT_YUYV422] = {
bcbd9a14 146 .name = "yuyv422",
4a59eca9
TB
147 .nb_components = 3,
148 .log2_chroma_w = 1,
149 .log2_chroma_h = 0,
bcbd9a14 150 .comp = {
2268db2c
VG
151 { 0, 2, 0, 0, 8, 1, 7, 1 }, /* Y */
152 { 0, 4, 1, 0, 8, 3, 7, 2 }, /* U */
153 { 0, 4, 3, 0, 8, 3, 7, 4 }, /* V */
bcbd9a14
SS
154 },
155 },
8b17243d
VG
156 [AV_PIX_FMT_YVYU422] = {
157 .name = "yvyu422",
158 .nb_components = 3,
159 .log2_chroma_w = 1,
160 .log2_chroma_h = 0,
161 .comp = {
2268db2c 162 { 0, 2, 0, 0, 8, 1, 7, 1 }, /* Y */
2268db2c 163 { 0, 4, 3, 0, 8, 3, 7, 4 }, /* U */
e336c51e 164 { 0, 4, 1, 0, 8, 3, 7, 2 }, /* V */
8b17243d
VG
165 },
166 },
716d413c 167 [AV_PIX_FMT_RGB24] = {
bcbd9a14 168 .name = "rgb24",
4a59eca9
TB
169 .nb_components = 3,
170 .log2_chroma_w = 0,
171 .log2_chroma_h = 0,
bcbd9a14 172 .comp = {
2268db2c
VG
173 { 0, 3, 0, 0, 8, 2, 7, 1 }, /* R */
174 { 0, 3, 1, 0, 8, 2, 7, 2 }, /* G */
175 { 0, 3, 2, 0, 8, 2, 7, 3 }, /* B */
bcbd9a14 176 },
e6c4ac7b 177 .flags = AV_PIX_FMT_FLAG_RGB,
bcbd9a14 178 },
716d413c 179 [AV_PIX_FMT_BGR24] = {
10151b13 180 .name = "bgr24",
4a59eca9
TB
181 .nb_components = 3,
182 .log2_chroma_w = 0,
183 .log2_chroma_h = 0,
10151b13 184 .comp = {
2268db2c 185 { 0, 3, 2, 0, 8, 2, 7, 3 }, /* R */
e336c51e
HL
186 { 0, 3, 1, 0, 8, 2, 7, 2 }, /* G */
187 { 0, 3, 0, 0, 8, 2, 7, 1 }, /* B */
10151b13 188 },
e6c4ac7b 189 .flags = AV_PIX_FMT_FLAG_RGB,
10151b13 190 },
716d413c 191 [AV_PIX_FMT_YUV422P] = {
bcbd9a14 192 .name = "yuv422p",
4a59eca9
TB
193 .nb_components = 3,
194 .log2_chroma_w = 1,
195 .log2_chroma_h = 0,
9b61d838 196 .comp = {
2268db2c
VG
197 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
198 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
199 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
9b61d838 200 },
e6c4ac7b 201 .flags = AV_PIX_FMT_FLAG_PLANAR,
9b61d838 202 },
716d413c 203 [AV_PIX_FMT_YUV444P] = {
10151b13 204 .name = "yuv444p",
4a59eca9
TB
205 .nb_components = 3,
206 .log2_chroma_w = 0,
207 .log2_chroma_h = 0,
10151b13 208 .comp = {
2268db2c
VG
209 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
210 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
211 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
10151b13 212 },
e6c4ac7b 213 .flags = AV_PIX_FMT_FLAG_PLANAR,
10151b13 214 },
716d413c 215 [AV_PIX_FMT_YUV410P] = {
1e896640 216 .name = "yuv410p",
4a59eca9
TB
217 .nb_components = 3,
218 .log2_chroma_w = 2,
219 .log2_chroma_h = 2,
9b61d838 220 .comp = {
2268db2c
VG
221 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
222 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
223 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
9b61d838 224 },
e6c4ac7b 225 .flags = AV_PIX_FMT_FLAG_PLANAR,
9b61d838 226 },
716d413c 227 [AV_PIX_FMT_YUV411P] = {
10151b13 228 .name = "yuv411p",
4a59eca9
TB
229 .nb_components = 3,
230 .log2_chroma_w = 2,
231 .log2_chroma_h = 0,
10151b13 232 .comp = {
2268db2c
VG
233 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
234 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
235 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
10151b13 236 },
e6c4ac7b 237 .flags = AV_PIX_FMT_FLAG_PLANAR,
10151b13 238 },
716d413c 239 [AV_PIX_FMT_GRAY8] = {
382cb115 240 .name = "gray",
4a59eca9
TB
241 .nb_components = 1,
242 .log2_chroma_w = 0,
243 .log2_chroma_h = 0,
10151b13 244 .comp = {
2268db2c 245 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
10151b13 246 },
78b4bfdb 247 .flags = AV_PIX_FMT_FLAG_PSEUDOPAL,
e0d73fda 248 .alias = "gray8,y8",
10151b13 249 },
716d413c 250 [AV_PIX_FMT_MONOWHITE] = {
382cb115 251 .name = "monow",
4a59eca9
TB
252 .nb_components = 1,
253 .log2_chroma_w = 0,
254 .log2_chroma_h = 0,
10151b13 255 .comp = {
2268db2c 256 { 0, 1, 0, 0, 1, 0, 0, 1 }, /* Y */
10151b13 257 },
e6c4ac7b 258 .flags = AV_PIX_FMT_FLAG_BITSTREAM,
10151b13 259 },
716d413c 260 [AV_PIX_FMT_MONOBLACK] = {
382cb115 261 .name = "monob",
4a59eca9
TB
262 .nb_components = 1,
263 .log2_chroma_w = 0,
264 .log2_chroma_h = 0,
9b61d838 265 .comp = {
2268db2c 266 { 0, 1, 0, 7, 1, 0, 0, 1 }, /* Y */
9b61d838 267 },
e6c4ac7b 268 .flags = AV_PIX_FMT_FLAG_BITSTREAM,
9b61d838 269 },
716d413c 270 [AV_PIX_FMT_PAL8] = {
bcbd9a14 271 .name = "pal8",
4a59eca9
TB
272 .nb_components = 1,
273 .log2_chroma_w = 0,
274 .log2_chroma_h = 0,
9b61d838 275 .comp = {
2268db2c 276 { 0, 1, 0, 0, 8, 0, 7, 1 },
9b61d838 277 },
e6c4ac7b 278 .flags = AV_PIX_FMT_FLAG_PAL,
9b61d838 279 },
716d413c 280 [AV_PIX_FMT_YUVJ420P] = {
10151b13 281 .name = "yuvj420p",
4a59eca9
TB
282 .nb_components = 3,
283 .log2_chroma_w = 1,
284 .log2_chroma_h = 1,
10151b13 285 .comp = {
2268db2c
VG
286 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
287 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
288 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
10151b13 289 },
e6c4ac7b 290 .flags = AV_PIX_FMT_FLAG_PLANAR,
10151b13 291 },
716d413c 292 [AV_PIX_FMT_YUVJ422P] = {
10151b13 293 .name = "yuvj422p",
4a59eca9
TB
294 .nb_components = 3,
295 .log2_chroma_w = 1,
296 .log2_chroma_h = 0,
10151b13 297 .comp = {
2268db2c
VG
298 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
299 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
300 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
10151b13 301 },
e6c4ac7b 302 .flags = AV_PIX_FMT_FLAG_PLANAR,
10151b13 303 },
716d413c 304 [AV_PIX_FMT_YUVJ444P] = {
10151b13 305 .name = "yuvj444p",
4a59eca9
TB
306 .nb_components = 3,
307 .log2_chroma_w = 0,
308 .log2_chroma_h = 0,
10151b13 309 .comp = {
2268db2c
VG
310 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
311 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
312 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
10151b13 313 },
e6c4ac7b 314 .flags = AV_PIX_FMT_FLAG_PLANAR,
10151b13 315 },
19e30a58 316#if FF_API_XVMC
716d413c 317 [AV_PIX_FMT_XVMC_MPEG2_MC] = {
382cb115 318 .name = "xvmcmc",
e6c4ac7b 319 .flags = AV_PIX_FMT_FLAG_HWACCEL,
3fa70a3b 320 },
716d413c 321 [AV_PIX_FMT_XVMC_MPEG2_IDCT] = {
382cb115 322 .name = "xvmcidct",
e6c4ac7b 323 .flags = AV_PIX_FMT_FLAG_HWACCEL,
3fa70a3b 324 },
19e30a58 325#endif /* FF_API_XVMC */
716d413c 326 [AV_PIX_FMT_UYVY422] = {
1e896640 327 .name = "uyvy422",
4a59eca9
TB
328 .nb_components = 3,
329 .log2_chroma_w = 1,
330 .log2_chroma_h = 0,
9b61d838 331 .comp = {
2268db2c
VG
332 { 0, 2, 1, 0, 8, 1, 7, 2 }, /* Y */
333 { 0, 4, 0, 0, 8, 3, 7, 1 }, /* U */
334 { 0, 4, 2, 0, 8, 3, 7, 3 }, /* V */
9b61d838
MN
335 },
336 },
716d413c 337 [AV_PIX_FMT_UYYVYY411] = {
10151b13 338 .name = "uyyvyy411",
4a59eca9
TB
339 .nb_components = 3,
340 .log2_chroma_w = 2,
341 .log2_chroma_h = 0,
10151b13 342 .comp = {
2268db2c
VG
343 { 0, 4, 1, 0, 8, 3, 7, 2 }, /* Y */
344 { 0, 6, 0, 0, 8, 5, 7, 1 }, /* U */
345 { 0, 6, 3, 0, 8, 5, 7, 4 }, /* V */
10151b13
SS
346 },
347 },
716d413c 348 [AV_PIX_FMT_BGR8] = {
10151b13 349 .name = "bgr8",
4a59eca9
TB
350 .nb_components = 3,
351 .log2_chroma_w = 0,
352 .log2_chroma_h = 0,
10151b13 353 .comp = {
2268db2c 354 { 0, 1, 0, 0, 3, 0, 2, 1 }, /* R */
e336c51e
HL
355 { 0, 1, 0, 3, 3, 0, 2, 1 }, /* G */
356 { 0, 1, 0, 6, 2, 0, 1, 1 }, /* B */
10151b13 357 },
e6c4ac7b 358 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
10151b13 359 },
716d413c 360 [AV_PIX_FMT_BGR4] = {
10151b13 361 .name = "bgr4",
4a59eca9
TB
362 .nb_components = 3,
363 .log2_chroma_w = 0,
364 .log2_chroma_h = 0,
10151b13 365 .comp = {
2268db2c 366 { 0, 4, 3, 0, 1, 3, 0, 4 }, /* R */
e336c51e
HL
367 { 0, 4, 1, 0, 2, 3, 1, 2 }, /* G */
368 { 0, 4, 0, 0, 1, 3, 0, 1 }, /* B */
10151b13 369 },
e6c4ac7b 370 .flags = AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_RGB,
10151b13 371 },
716d413c 372 [AV_PIX_FMT_BGR4_BYTE] = {
10151b13 373 .name = "bgr4_byte",
4a59eca9
TB
374 .nb_components = 3,
375 .log2_chroma_w = 0,
376 .log2_chroma_h = 0,
10151b13 377 .comp = {
2268db2c 378 { 0, 1, 0, 0, 1, 0, 0, 1 }, /* R */
e336c51e
HL
379 { 0, 1, 0, 1, 2, 0, 1, 1 }, /* G */
380 { 0, 1, 0, 3, 1, 0, 0, 1 }, /* B */
10151b13 381 },
e6c4ac7b 382 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
10151b13 383 },
716d413c 384 [AV_PIX_FMT_RGB8] = {
10151b13 385 .name = "rgb8",
4a59eca9
TB
386 .nb_components = 3,
387 .log2_chroma_w = 0,
388 .log2_chroma_h = 0,
10151b13 389 .comp = {
2268db2c
VG
390 { 0, 1, 0, 6, 2, 0, 1, 1 }, /* R */
391 { 0, 1, 0, 3, 3, 0, 2, 1 }, /* G */
392 { 0, 1, 0, 0, 3, 0, 2, 1 }, /* B */
10151b13 393 },
e6c4ac7b 394 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
10151b13 395 },
716d413c 396 [AV_PIX_FMT_RGB4] = {
10151b13 397 .name = "rgb4",
4a59eca9
TB
398 .nb_components = 3,
399 .log2_chroma_w = 0,
400 .log2_chroma_h = 0,
10151b13 401 .comp = {
2268db2c
VG
402 { 0, 4, 0, 0, 1, 3, 0, 1 }, /* R */
403 { 0, 4, 1, 0, 2, 3, 1, 2 }, /* G */
404 { 0, 4, 3, 0, 1, 3, 0, 4 }, /* B */
10151b13 405 },
e6c4ac7b 406 .flags = AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_RGB,
10151b13 407 },
716d413c 408 [AV_PIX_FMT_RGB4_BYTE] = {
10151b13 409 .name = "rgb4_byte",
4a59eca9
TB
410 .nb_components = 3,
411 .log2_chroma_w = 0,
412 .log2_chroma_h = 0,
10151b13 413 .comp = {
2268db2c
VG
414 { 0, 1, 0, 3, 1, 0, 0, 1 }, /* R */
415 { 0, 1, 0, 1, 2, 0, 1, 1 }, /* G */
416 { 0, 1, 0, 0, 1, 0, 0, 1 }, /* B */
10151b13 417 },
e6c4ac7b 418 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
10151b13 419 },
716d413c 420 [AV_PIX_FMT_NV12] = {
bcbd9a14 421 .name = "nv12",
4a59eca9
TB
422 .nb_components = 3,
423 .log2_chroma_w = 1,
424 .log2_chroma_h = 1,
9b61d838 425 .comp = {
2268db2c
VG
426 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
427 { 1, 2, 0, 0, 8, 1, 7, 1 }, /* U */
428 { 1, 2, 1, 0, 8, 1, 7, 2 }, /* V */
9b61d838 429 },
e6c4ac7b 430 .flags = AV_PIX_FMT_FLAG_PLANAR,
9b61d838 431 },
716d413c 432 [AV_PIX_FMT_NV21] = {
10151b13 433 .name = "nv21",
4a59eca9
TB
434 .nb_components = 3,
435 .log2_chroma_w = 1,
436 .log2_chroma_h = 1,
10151b13 437 .comp = {
2268db2c 438 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
2268db2c 439 { 1, 2, 1, 0, 8, 1, 7, 2 }, /* U */
e336c51e 440 { 1, 2, 0, 0, 8, 1, 7, 1 }, /* V */
10151b13 441 },
e6c4ac7b 442 .flags = AV_PIX_FMT_FLAG_PLANAR,
10151b13 443 },
716d413c 444 [AV_PIX_FMT_ARGB] = {
10151b13 445 .name = "argb",
4a59eca9
TB
446 .nb_components = 4,
447 .log2_chroma_w = 0,
448 .log2_chroma_h = 0,
10151b13 449 .comp = {
2268db2c
VG
450 { 0, 4, 1, 0, 8, 3, 7, 2 }, /* R */
451 { 0, 4, 2, 0, 8, 3, 7, 3 }, /* G */
452 { 0, 4, 3, 0, 8, 3, 7, 4 }, /* B */
e336c51e 453 { 0, 4, 0, 0, 8, 3, 7, 1 }, /* A */
10151b13 454 },
e6c4ac7b 455 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
10151b13 456 },
716d413c 457 [AV_PIX_FMT_RGBA] = {
1e896640 458 .name = "rgba",
4a59eca9
TB
459 .nb_components = 4,
460 .log2_chroma_w = 0,
461 .log2_chroma_h = 0,
9b61d838 462 .comp = {
2268db2c
VG
463 { 0, 4, 0, 0, 8, 3, 7, 1 }, /* R */
464 { 0, 4, 1, 0, 8, 3, 7, 2 }, /* G */
465 { 0, 4, 2, 0, 8, 3, 7, 3 }, /* B */
466 { 0, 4, 3, 0, 8, 3, 7, 4 }, /* A */
9b61d838 467 },
e6c4ac7b 468 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
9b61d838 469 },
716d413c 470 [AV_PIX_FMT_ABGR] = {
10151b13 471 .name = "abgr",
4a59eca9
TB
472 .nb_components = 4,
473 .log2_chroma_w = 0,
474 .log2_chroma_h = 0,
10151b13 475 .comp = {
2268db2c 476 { 0, 4, 3, 0, 8, 3, 7, 4 }, /* R */
e336c51e
HL
477 { 0, 4, 2, 0, 8, 3, 7, 3 }, /* G */
478 { 0, 4, 1, 0, 8, 3, 7, 2 }, /* B */
479 { 0, 4, 0, 0, 8, 3, 7, 1 }, /* A */
10151b13 480 },
e6c4ac7b 481 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
10151b13 482 },
716d413c 483 [AV_PIX_FMT_BGRA] = {
10151b13 484 .name = "bgra",
4a59eca9
TB
485 .nb_components = 4,
486 .log2_chroma_w = 0,
487 .log2_chroma_h = 0,
10151b13 488 .comp = {
2268db2c 489 { 0, 4, 2, 0, 8, 3, 7, 3 }, /* R */
e336c51e
HL
490 { 0, 4, 1, 0, 8, 3, 7, 2 }, /* G */
491 { 0, 4, 0, 0, 8, 3, 7, 1 }, /* B */
2268db2c 492 { 0, 4, 3, 0, 8, 3, 7, 4 }, /* A */
10151b13 493 },
e6c4ac7b 494 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
10151b13 495 },
7471352f
LB
496 [AV_PIX_FMT_GRAY12BE] = {
497 .name = "gray12be",
498 .nb_components = 1,
499 .log2_chroma_w = 0,
500 .log2_chroma_h = 0,
501 .comp = {
502 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
503 },
504 .flags = AV_PIX_FMT_FLAG_BE,
505 .alias = "y12be",
506 },
507 [AV_PIX_FMT_GRAY12LE] = {
508 .name = "gray12le",
509 .nb_components = 1,
510 .log2_chroma_w = 0,
511 .log2_chroma_h = 0,
512 .comp = {
513 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
514 },
515 .alias = "y12le",
516 },
716d413c 517 [AV_PIX_FMT_GRAY16BE] = {
bcbd9a14 518 .name = "gray16be",
4a59eca9
TB
519 .nb_components = 1,
520 .log2_chroma_w = 0,
521 .log2_chroma_h = 0,
9b61d838 522 .comp = {
2268db2c 523 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
bcbd9a14 524 },
e6c4ac7b 525 .flags = AV_PIX_FMT_FLAG_BE,
e0d73fda 526 .alias = "y16be",
bcbd9a14 527 },
716d413c 528 [AV_PIX_FMT_GRAY16LE] = {
bcbd9a14 529 .name = "gray16le",
4a59eca9
TB
530 .nb_components = 1,
531 .log2_chroma_w = 0,
532 .log2_chroma_h = 0,
bcbd9a14 533 .comp = {
2268db2c 534 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
9b61d838 535 },
e0d73fda 536 .alias = "y16le",
9b61d838 537 },
716d413c 538 [AV_PIX_FMT_YUV440P] = {
10151b13 539 .name = "yuv440p",
4a59eca9
TB
540 .nb_components = 3,
541 .log2_chroma_w = 0,
542 .log2_chroma_h = 1,
10151b13 543 .comp = {
2268db2c
VG
544 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
545 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
546 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
10151b13 547 },
e6c4ac7b 548 .flags = AV_PIX_FMT_FLAG_PLANAR,
10151b13 549 },
716d413c 550 [AV_PIX_FMT_YUVJ440P] = {
10151b13 551 .name = "yuvj440p",
4a59eca9
TB
552 .nb_components = 3,
553 .log2_chroma_w = 0,
554 .log2_chroma_h = 1,
10151b13 555 .comp = {
2268db2c
VG
556 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
557 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
558 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
10151b13 559 },
e6c4ac7b 560 .flags = AV_PIX_FMT_FLAG_PLANAR,
10151b13 561 },
716d413c 562 [AV_PIX_FMT_YUVA420P] = {
10151b13 563 .name = "yuva420p",
4a59eca9
TB
564 .nb_components = 4,
565 .log2_chroma_w = 1,
566 .log2_chroma_h = 1,
10151b13 567 .comp = {
2268db2c
VG
568 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
569 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
570 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
571 { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
6d5600e8 572 },
e6c4ac7b 573 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
6d5600e8
LB
574 },
575 [AV_PIX_FMT_YUVA422P] = {
576 .name = "yuva422p",
577 .nb_components = 4,
578 .log2_chroma_w = 1,
579 .log2_chroma_h = 0,
580 .comp = {
2268db2c
VG
581 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
582 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
583 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
584 { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
6d5600e8 585 },
e6c4ac7b 586 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
6d5600e8
LB
587 },
588 [AV_PIX_FMT_YUVA444P] = {
589 .name = "yuva444p",
590 .nb_components = 4,
591 .log2_chroma_w = 0,
592 .log2_chroma_h = 0,
593 .comp = {
2268db2c
VG
594 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
595 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
596 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
597 { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
10151b13 598 },
e6c4ac7b 599 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
10151b13 600 },
7658295b
LB
601 [AV_PIX_FMT_YUVA420P9BE] = {
602 .name = "yuva420p9be",
603 .nb_components = 4,
604 .log2_chroma_w = 1,
605 .log2_chroma_h = 1,
606 .comp = {
2268db2c
VG
607 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
608 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
609 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
610 { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
7658295b 611 },
c7ed26ad 612 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
613 },
614 [AV_PIX_FMT_YUVA420P9LE] = {
615 .name = "yuva420p9le",
616 .nb_components = 4,
617 .log2_chroma_w = 1,
618 .log2_chroma_h = 1,
619 .comp = {
2268db2c
VG
620 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
621 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
622 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
623 { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
7658295b 624 },
e6c4ac7b 625 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
626 },
627 [AV_PIX_FMT_YUVA422P9BE] = {
628 .name = "yuva422p9be",
629 .nb_components = 4,
630 .log2_chroma_w = 1,
631 .log2_chroma_h = 0,
632 .comp = {
2268db2c
VG
633 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
634 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
635 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
636 { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
7658295b 637 },
e6c4ac7b 638 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
639 },
640 [AV_PIX_FMT_YUVA422P9LE] = {
641 .name = "yuva422p9le",
642 .nb_components = 4,
643 .log2_chroma_w = 1,
644 .log2_chroma_h = 0,
645 .comp = {
2268db2c
VG
646 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
647 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
648 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
649 { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
7658295b 650 },
e6c4ac7b 651 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
652 },
653 [AV_PIX_FMT_YUVA444P9BE] = {
654 .name = "yuva444p9be",
655 .nb_components = 4,
656 .log2_chroma_w = 0,
657 .log2_chroma_h = 0,
658 .comp = {
2268db2c
VG
659 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
660 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
661 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
662 { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
7658295b 663 },
e6c4ac7b 664 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
665 },
666 [AV_PIX_FMT_YUVA444P9LE] = {
667 .name = "yuva444p9le",
668 .nb_components = 4,
669 .log2_chroma_w = 0,
670 .log2_chroma_h = 0,
671 .comp = {
2268db2c
VG
672 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
673 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
674 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
675 { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
7658295b 676 },
e6c4ac7b 677 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
678 },
679 [AV_PIX_FMT_YUVA420P10BE] = {
680 .name = "yuva420p10be",
681 .nb_components = 4,
682 .log2_chroma_w = 1,
683 .log2_chroma_h = 1,
684 .comp = {
2268db2c
VG
685 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
686 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
687 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
688 { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
7658295b 689 },
e6c4ac7b 690 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
691 },
692 [AV_PIX_FMT_YUVA420P10LE] = {
693 .name = "yuva420p10le",
694 .nb_components = 4,
695 .log2_chroma_w = 1,
696 .log2_chroma_h = 1,
697 .comp = {
2268db2c
VG
698 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
699 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
700 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
701 { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
7658295b 702 },
e6c4ac7b 703 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
704 },
705 [AV_PIX_FMT_YUVA422P10BE] = {
706 .name = "yuva422p10be",
707 .nb_components = 4,
708 .log2_chroma_w = 1,
709 .log2_chroma_h = 0,
710 .comp = {
2268db2c
VG
711 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
712 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
713 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
714 { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
7658295b 715 },
e6c4ac7b 716 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
717 },
718 [AV_PIX_FMT_YUVA422P10LE] = {
719 .name = "yuva422p10le",
720 .nb_components = 4,
721 .log2_chroma_w = 1,
722 .log2_chroma_h = 0,
723 .comp = {
2268db2c
VG
724 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
725 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
726 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
727 { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
7658295b 728 },
e6c4ac7b 729 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
730 },
731 [AV_PIX_FMT_YUVA444P10BE] = {
732 .name = "yuva444p10be",
733 .nb_components = 4,
734 .log2_chroma_w = 0,
735 .log2_chroma_h = 0,
736 .comp = {
2268db2c
VG
737 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
738 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
739 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
740 { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
7658295b 741 },
e6c4ac7b 742 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
743 },
744 [AV_PIX_FMT_YUVA444P10LE] = {
745 .name = "yuva444p10le",
746 .nb_components = 4,
747 .log2_chroma_w = 0,
748 .log2_chroma_h = 0,
749 .comp = {
2268db2c
VG
750 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
751 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
752 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
753 { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
7658295b 754 },
e6c4ac7b 755 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
756 },
757 [AV_PIX_FMT_YUVA420P16BE] = {
758 .name = "yuva420p16be",
759 .nb_components = 4,
760 .log2_chroma_w = 1,
761 .log2_chroma_h = 1,
762 .comp = {
2268db2c
VG
763 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
764 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
765 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
766 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
7658295b 767 },
e6c4ac7b 768 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
769 },
770 [AV_PIX_FMT_YUVA420P16LE] = {
771 .name = "yuva420p16le",
772 .nb_components = 4,
773 .log2_chroma_w = 1,
774 .log2_chroma_h = 1,
775 .comp = {
2268db2c
VG
776 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
777 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
778 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
779 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
7658295b 780 },
e6c4ac7b 781 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
782 },
783 [AV_PIX_FMT_YUVA422P16BE] = {
784 .name = "yuva422p16be",
785 .nb_components = 4,
786 .log2_chroma_w = 1,
787 .log2_chroma_h = 0,
788 .comp = {
2268db2c
VG
789 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
790 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
791 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
792 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
7658295b 793 },
e6c4ac7b 794 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
795 },
796 [AV_PIX_FMT_YUVA422P16LE] = {
797 .name = "yuva422p16le",
798 .nb_components = 4,
799 .log2_chroma_w = 1,
800 .log2_chroma_h = 0,
801 .comp = {
2268db2c
VG
802 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
803 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
804 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
805 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
7658295b 806 },
e6c4ac7b 807 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
808 },
809 [AV_PIX_FMT_YUVA444P16BE] = {
810 .name = "yuva444p16be",
811 .nb_components = 4,
812 .log2_chroma_w = 0,
813 .log2_chroma_h = 0,
814 .comp = {
2268db2c
VG
815 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
816 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
817 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
818 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
7658295b 819 },
e6c4ac7b 820 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
821 },
822 [AV_PIX_FMT_YUVA444P16LE] = {
823 .name = "yuva444p16le",
824 .nb_components = 4,
825 .log2_chroma_w = 0,
826 .log2_chroma_h = 0,
827 .comp = {
2268db2c
VG
828 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
829 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
830 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
831 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
7658295b 832 },
e6c4ac7b 833 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b 834 },
a0ad5d01 835#if FF_API_VDPAU
716d413c 836 [AV_PIX_FMT_VDPAU_H264] = {
3fa70a3b
SS
837 .name = "vdpau_h264",
838 .log2_chroma_w = 1,
839 .log2_chroma_h = 1,
e6c4ac7b 840 .flags = AV_PIX_FMT_FLAG_HWACCEL,
3fa70a3b 841 },
716d413c 842 [AV_PIX_FMT_VDPAU_MPEG1] = {
3fa70a3b
SS
843 .name = "vdpau_mpeg1",
844 .log2_chroma_w = 1,
845 .log2_chroma_h = 1,
e6c4ac7b 846 .flags = AV_PIX_FMT_FLAG_HWACCEL,
3fa70a3b 847 },
716d413c 848 [AV_PIX_FMT_VDPAU_MPEG2] = {
3fa70a3b
SS
849 .name = "vdpau_mpeg2",
850 .log2_chroma_w = 1,
851 .log2_chroma_h = 1,
e6c4ac7b 852 .flags = AV_PIX_FMT_FLAG_HWACCEL,
3fa70a3b 853 },
716d413c 854 [AV_PIX_FMT_VDPAU_WMV3] = {
3fa70a3b
SS
855 .name = "vdpau_wmv3",
856 .log2_chroma_w = 1,
857 .log2_chroma_h = 1,
e6c4ac7b 858 .flags = AV_PIX_FMT_FLAG_HWACCEL,
3fa70a3b 859 },
716d413c 860 [AV_PIX_FMT_VDPAU_VC1] = {
3fa70a3b
SS
861 .name = "vdpau_vc1",
862 .log2_chroma_w = 1,
863 .log2_chroma_h = 1,
e6c4ac7b 864 .flags = AV_PIX_FMT_FLAG_HWACCEL,
3fa70a3b 865 },
716d413c 866 [AV_PIX_FMT_VDPAU_MPEG4] = {
dd6308ad
CEH
867 .name = "vdpau_mpeg4",
868 .log2_chroma_w = 1,
869 .log2_chroma_h = 1,
e6c4ac7b 870 .flags = AV_PIX_FMT_FLAG_HWACCEL,
dd6308ad 871 },
a0ad5d01 872#endif
716d413c 873 [AV_PIX_FMT_RGB48BE] = {
1e896640 874 .name = "rgb48be",
4a59eca9
TB
875 .nb_components = 3,
876 .log2_chroma_w = 0,
877 .log2_chroma_h = 0,
9b61d838 878 .comp = {
2268db2c
VG
879 { 0, 6, 0, 0, 16, 5, 15, 1 }, /* R */
880 { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
881 { 0, 6, 4, 0, 16, 5, 15, 5 }, /* B */
9b61d838 882 },
e6c4ac7b 883 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BE,
9b61d838 884 },
716d413c 885 [AV_PIX_FMT_RGB48LE] = {
bcbd9a14 886 .name = "rgb48le",
4a59eca9
TB
887 .nb_components = 3,
888 .log2_chroma_w = 0,
889 .log2_chroma_h = 0,
9b61d838 890 .comp = {
2268db2c
VG
891 { 0, 6, 0, 0, 16, 5, 15, 1 }, /* R */
892 { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
893 { 0, 6, 4, 0, 16, 5, 15, 5 }, /* B */
9b61d838 894 },
e6c4ac7b 895 .flags = AV_PIX_FMT_FLAG_RGB,
9b61d838 896 },
1481d24c
JF
897 [AV_PIX_FMT_RGBA64BE] = {
898 .name = "rgba64be",
899 .nb_components = 4,
900 .log2_chroma_w = 0,
901 .log2_chroma_h = 0,
902 .comp = {
2268db2c
VG
903 { 0, 8, 0, 0, 16, 7, 15, 1 }, /* R */
904 { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
905 { 0, 8, 4, 0, 16, 7, 15, 5 }, /* B */
906 { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1481d24c
JF
907 },
908 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
909 },
910 [AV_PIX_FMT_RGBA64LE] = {
911 .name = "rgba64le",
912 .nb_components = 4,
913 .log2_chroma_w = 0,
914 .log2_chroma_h = 0,
915 .comp = {
2268db2c
VG
916 { 0, 8, 0, 0, 16, 7, 15, 1 }, /* R */
917 { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
918 { 0, 8, 4, 0, 16, 7, 15, 5 }, /* B */
919 { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1481d24c
JF
920 },
921 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
922 },
716d413c 923 [AV_PIX_FMT_RGB565BE] = {
1e896640 924 .name = "rgb565be",
4a59eca9
TB
925 .nb_components = 3,
926 .log2_chroma_w = 0,
927 .log2_chroma_h = 0,
9b61d838 928 .comp = {
2268db2c
VG
929 { 0, 2, -1, 3, 5, 1, 4, 0 }, /* R */
930 { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
931 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
9b61d838 932 },
e6c4ac7b 933 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
9b61d838 934 },
716d413c 935 [AV_PIX_FMT_RGB565LE] = {
bcbd9a14 936 .name = "rgb565le",
4a59eca9
TB
937 .nb_components = 3,
938 .log2_chroma_w = 0,
939 .log2_chroma_h = 0,
9b61d838 940 .comp = {
2268db2c
VG
941 { 0, 2, 1, 3, 5, 1, 4, 2 }, /* R */
942 { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
943 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
9b61d838 944 },
e6c4ac7b 945 .flags = AV_PIX_FMT_FLAG_RGB,
9b61d838 946 },
716d413c 947 [AV_PIX_FMT_RGB555BE] = {
10151b13 948 .name = "rgb555be",
4a59eca9
TB
949 .nb_components = 3,
950 .log2_chroma_w = 0,
951 .log2_chroma_h = 0,
10151b13 952 .comp = {
2268db2c
VG
953 { 0, 2, -1, 2, 5, 1, 4, 0 }, /* R */
954 { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
955 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
10151b13 956 },
e6c4ac7b 957 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
10151b13 958 },
716d413c 959 [AV_PIX_FMT_RGB555LE] = {
10151b13 960 .name = "rgb555le",
4a59eca9
TB
961 .nb_components = 3,
962 .log2_chroma_w = 0,
963 .log2_chroma_h = 0,
10151b13 964 .comp = {
2268db2c
VG
965 { 0, 2, 1, 2, 5, 1, 4, 2 }, /* R */
966 { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
967 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
10151b13 968 },
e6c4ac7b 969 .flags = AV_PIX_FMT_FLAG_RGB,
10151b13 970 },
716d413c 971 [AV_PIX_FMT_RGB444BE] = {
2b7cf167 972 .name = "rgb444be",
4a59eca9
TB
973 .nb_components = 3,
974 .log2_chroma_w = 0,
975 .log2_chroma_h = 0,
2b7cf167 976 .comp = {
2268db2c
VG
977 { 0, 2, -1, 0, 4, 1, 3, 0 }, /* R */
978 { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
979 { 0, 2, 0, 0, 4, 1, 3, 1 }, /* B */
2b7cf167 980 },
e6c4ac7b 981 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
2b7cf167 982 },
716d413c 983 [AV_PIX_FMT_RGB444LE] = {
2b7cf167 984 .name = "rgb444le",
4a59eca9
TB
985 .nb_components = 3,
986 .log2_chroma_w = 0,
987 .log2_chroma_h = 0,
2b7cf167 988 .comp = {
2268db2c
VG
989 { 0, 2, 1, 0, 4, 1, 3, 2 }, /* R */
990 { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
991 { 0, 2, 0, 0, 4, 1, 3, 1 }, /* B */
2b7cf167 992 },
e6c4ac7b 993 .flags = AV_PIX_FMT_FLAG_RGB,
2b7cf167 994 },
716d413c 995 [AV_PIX_FMT_BGR48BE] = {
73389754 996 .name = "bgr48be",
4a59eca9
TB
997 .nb_components = 3,
998 .log2_chroma_w = 0,
999 .log2_chroma_h = 0,
73389754 1000 .comp = {
2268db2c 1001 { 0, 6, 4, 0, 16, 5, 15, 5 }, /* R */
e336c51e
HL
1002 { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
1003 { 0, 6, 0, 0, 16, 5, 15, 1 }, /* B */
73389754 1004 },
e6c4ac7b 1005 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
73389754 1006 },
716d413c 1007 [AV_PIX_FMT_BGR48LE] = {
73389754 1008 .name = "bgr48le",
4a59eca9
TB
1009 .nb_components = 3,
1010 .log2_chroma_w = 0,
1011 .log2_chroma_h = 0,
73389754 1012 .comp = {
2268db2c 1013 { 0, 6, 4, 0, 16, 5, 15, 5 }, /* R */
e336c51e
HL
1014 { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
1015 { 0, 6, 0, 0, 16, 5, 15, 1 }, /* B */
73389754 1016 },
e6c4ac7b 1017 .flags = AV_PIX_FMT_FLAG_RGB,
73389754 1018 },
1481d24c
JF
1019 [AV_PIX_FMT_BGRA64BE] = {
1020 .name = "bgra64be",
1021 .nb_components = 4,
1022 .log2_chroma_w = 0,
1023 .log2_chroma_h = 0,
1024 .comp = {
e336c51e
HL
1025 { 0, 8, 4, 0, 16, 7, 15, 5 }, /* R */
1026 { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
1027 { 0, 8, 0, 0, 16, 7, 15, 1 }, /* B */
1028 { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1481d24c
JF
1029 },
1030 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
1031 },
1032 [AV_PIX_FMT_BGRA64LE] = {
1033 .name = "bgra64le",
1034 .nb_components = 4,
1035 .log2_chroma_w = 0,
1036 .log2_chroma_h = 0,
1037 .comp = {
e336c51e
HL
1038 { 0, 8, 4, 0, 16, 7, 15, 5 }, /* R */
1039 { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
1040 { 0, 8, 0, 0, 16, 7, 15, 1 }, /* B */
1041 { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1481d24c
JF
1042 },
1043 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
1044 },
716d413c 1045 [AV_PIX_FMT_BGR565BE] = {
10151b13 1046 .name = "bgr565be",
4a59eca9
TB
1047 .nb_components = 3,
1048 .log2_chroma_w = 0,
1049 .log2_chroma_h = 0,
10151b13 1050 .comp = {
2268db2c 1051 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
e336c51e
HL
1052 { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
1053 { 0, 2, -1, 3, 5, 1, 4, 0 }, /* B */
10151b13 1054 },
e6c4ac7b 1055 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
10151b13 1056 },
716d413c 1057 [AV_PIX_FMT_BGR565LE] = {
10151b13 1058 .name = "bgr565le",
4a59eca9
TB
1059 .nb_components = 3,
1060 .log2_chroma_w = 0,
1061 .log2_chroma_h = 0,
10151b13 1062 .comp = {
2268db2c 1063 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
e336c51e
HL
1064 { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
1065 { 0, 2, 1, 3, 5, 1, 4, 2 }, /* B */
10151b13 1066 },
e6c4ac7b 1067 .flags = AV_PIX_FMT_FLAG_RGB,
10151b13 1068 },
716d413c 1069 [AV_PIX_FMT_BGR555BE] = {
10151b13 1070 .name = "bgr555be",
4a59eca9
TB
1071 .nb_components = 3,
1072 .log2_chroma_w = 0,
1073 .log2_chroma_h = 0,
10151b13 1074 .comp = {
2268db2c 1075 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
e336c51e
HL
1076 { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
1077 { 0, 2, -1, 2, 5, 1, 4, 0 }, /* B */
10151b13 1078 },
e6c4ac7b 1079 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
10151b13 1080 },
716d413c 1081 [AV_PIX_FMT_BGR555LE] = {
10151b13 1082 .name = "bgr555le",
4a59eca9
TB
1083 .nb_components = 3,
1084 .log2_chroma_w = 0,
1085 .log2_chroma_h = 0,
10151b13 1086 .comp = {
2268db2c 1087 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
e336c51e
HL
1088 { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
1089 { 0, 2, 1, 2, 5, 1, 4, 2 }, /* B */
10151b13 1090 },
e6c4ac7b 1091 .flags = AV_PIX_FMT_FLAG_RGB,
10151b13 1092 },
716d413c 1093 [AV_PIX_FMT_BGR444BE] = {
2b7cf167 1094 .name = "bgr444be",
4a59eca9
TB
1095 .nb_components = 3,
1096 .log2_chroma_w = 0,
1097 .log2_chroma_h = 0,
2b7cf167 1098 .comp = {
2268db2c 1099 { 0, 2, 0, 0, 4, 1, 3, 1 }, /* R */
e336c51e
HL
1100 { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
1101 { 0, 2, -1, 0, 4, 1, 3, 0 }, /* B */
2b7cf167 1102 },
e6c4ac7b 1103 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
2b7cf167 1104 },
716d413c 1105 [AV_PIX_FMT_BGR444LE] = {
2b7cf167 1106 .name = "bgr444le",
4a59eca9
TB
1107 .nb_components = 3,
1108 .log2_chroma_w = 0,
1109 .log2_chroma_h = 0,
2b7cf167 1110 .comp = {
2268db2c 1111 { 0, 2, 0, 0, 4, 1, 3, 1 }, /* R */
e336c51e
HL
1112 { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
1113 { 0, 2, 1, 0, 4, 1, 3, 2 }, /* B */
2b7cf167 1114 },
e6c4ac7b 1115 .flags = AV_PIX_FMT_FLAG_RGB,
2b7cf167 1116 },
d264c720 1117#if FF_API_VAAPI
716d413c 1118 [AV_PIX_FMT_VAAPI_MOCO] = {
3fa70a3b
SS
1119 .name = "vaapi_moco",
1120 .log2_chroma_w = 1,
1121 .log2_chroma_h = 1,
e6c4ac7b 1122 .flags = AV_PIX_FMT_FLAG_HWACCEL,
3fa70a3b 1123 },
716d413c 1124 [AV_PIX_FMT_VAAPI_IDCT] = {
3fa70a3b
SS
1125 .name = "vaapi_idct",
1126 .log2_chroma_w = 1,
1127 .log2_chroma_h = 1,
e6c4ac7b 1128 .flags = AV_PIX_FMT_FLAG_HWACCEL,
3fa70a3b 1129 },
716d413c 1130 [AV_PIX_FMT_VAAPI_VLD] = {
3fa70a3b
SS
1131 .name = "vaapi_vld",
1132 .log2_chroma_w = 1,
1133 .log2_chroma_h = 1,
e6c4ac7b 1134 .flags = AV_PIX_FMT_FLAG_HWACCEL,
3fa70a3b 1135 },
d264c720
MT
1136#else
1137 [AV_PIX_FMT_VAAPI] = {
1138 .name = "vaapi",
1139 .log2_chroma_w = 1,
1140 .log2_chroma_h = 1,
1141 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1142 },
1143#endif
716d413c 1144 [AV_PIX_FMT_VDA_VLD] = {
ac3dbb4d
SZ
1145 .name = "vda_vld",
1146 .log2_chroma_w = 1,
1147 .log2_chroma_h = 1,
e6c4ac7b 1148 .flags = AV_PIX_FMT_FLAG_HWACCEL,
ac3dbb4d 1149 },
716d413c 1150 [AV_PIX_FMT_YUV420P9LE] = {
42239ced 1151 .name = "yuv420p9le",
4a59eca9
TB
1152 .nb_components = 3,
1153 .log2_chroma_w = 1,
1154 .log2_chroma_h = 1,
42239ced 1155 .comp = {
2268db2c
VG
1156 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1157 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1158 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
42239ced 1159 },
e6c4ac7b 1160 .flags = AV_PIX_FMT_FLAG_PLANAR,
42239ced 1161 },
716d413c 1162 [AV_PIX_FMT_YUV420P9BE] = {
42239ced 1163 .name = "yuv420p9be",
4a59eca9
TB
1164 .nb_components = 3,
1165 .log2_chroma_w = 1,
1166 .log2_chroma_h = 1,
42239ced 1167 .comp = {
2268db2c
VG
1168 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1169 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1170 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
42239ced 1171 },
e6c4ac7b 1172 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
42239ced 1173 },
716d413c 1174 [AV_PIX_FMT_YUV420P10LE] = {
42239ced 1175 .name = "yuv420p10le",
4a59eca9
TB
1176 .nb_components = 3,
1177 .log2_chroma_w = 1,
1178 .log2_chroma_h = 1,
42239ced 1179 .comp = {
2268db2c
VG
1180 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1181 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1182 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
42239ced 1183 },
e6c4ac7b 1184 .flags = AV_PIX_FMT_FLAG_PLANAR,
42239ced 1185 },
716d413c 1186 [AV_PIX_FMT_YUV420P10BE] = {
42239ced 1187 .name = "yuv420p10be",
4a59eca9
TB
1188 .nb_components = 3,
1189 .log2_chroma_w = 1,
1190 .log2_chroma_h = 1,
42239ced 1191 .comp = {
2268db2c
VG
1192 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1193 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1194 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
42239ced 1195 },
e6c4ac7b 1196 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
42239ced 1197 },
85406e7a
LB
1198 [AV_PIX_FMT_YUV420P12LE] = {
1199 .name = "yuv420p12le",
1200 .nb_components = 3,
1201 .log2_chroma_w = 1,
1202 .log2_chroma_h = 1,
1203 .comp = {
1204 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1205 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1206 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1207 },
1208 .flags = AV_PIX_FMT_FLAG_PLANAR,
1209 },
1210 [AV_PIX_FMT_YUV420P12BE] = {
1211 .name = "yuv420p12be",
1212 .nb_components = 3,
1213 .log2_chroma_w = 1,
1214 .log2_chroma_h = 1,
1215 .comp = {
1216 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1217 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1218 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1219 },
1220 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1221 },
716d413c 1222 [AV_PIX_FMT_YUV420P16LE] = {
35f6c154 1223 .name = "yuv420p16le",
4a59eca9
TB
1224 .nb_components = 3,
1225 .log2_chroma_w = 1,
1226 .log2_chroma_h = 1,
75801da5 1227 .comp = {
2268db2c
VG
1228 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1229 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1230 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
75801da5 1231 },
e6c4ac7b 1232 .flags = AV_PIX_FMT_FLAG_PLANAR,
75801da5 1233 },
716d413c 1234 [AV_PIX_FMT_YUV420P16BE] = {
35f6c154 1235 .name = "yuv420p16be",
4a59eca9
TB
1236 .nb_components = 3,
1237 .log2_chroma_w = 1,
1238 .log2_chroma_h = 1,
75801da5 1239 .comp = {
2268db2c
VG
1240 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1241 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1242 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
75801da5 1243 },
e6c4ac7b 1244 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
75801da5 1245 },
716d413c 1246 [AV_PIX_FMT_YUV422P9LE] = {
dc49bf12 1247 .name = "yuv422p9le",
4a59eca9
TB
1248 .nb_components = 3,
1249 .log2_chroma_w = 1,
1250 .log2_chroma_h = 0,
dc49bf12 1251 .comp = {
2268db2c
VG
1252 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1253 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1254 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
dc49bf12 1255 },
e6c4ac7b 1256 .flags = AV_PIX_FMT_FLAG_PLANAR,
dc49bf12 1257 },
716d413c 1258 [AV_PIX_FMT_YUV422P9BE] = {
dc49bf12 1259 .name = "yuv422p9be",
4a59eca9
TB
1260 .nb_components = 3,
1261 .log2_chroma_w = 1,
1262 .log2_chroma_h = 0,
dc49bf12 1263 .comp = {
2268db2c
VG
1264 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1265 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1266 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
dc49bf12 1267 },
e6c4ac7b 1268 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
dc49bf12 1269 },
716d413c 1270 [AV_PIX_FMT_YUV422P10LE] = {
5c511ad4 1271 .name = "yuv422p10le",
4a59eca9
TB
1272 .nb_components = 3,
1273 .log2_chroma_w = 1,
1274 .log2_chroma_h = 0,
5c511ad4 1275 .comp = {
2268db2c
VG
1276 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1277 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1278 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
5c511ad4 1279 },
e6c4ac7b 1280 .flags = AV_PIX_FMT_FLAG_PLANAR,
5c511ad4 1281 },
716d413c 1282 [AV_PIX_FMT_YUV422P10BE] = {
5c511ad4 1283 .name = "yuv422p10be",
4a59eca9
TB
1284 .nb_components = 3,
1285 .log2_chroma_w = 1,
1286 .log2_chroma_h = 0,
5c511ad4 1287 .comp = {
2268db2c
VG
1288 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1289 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1290 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
5c511ad4 1291 },
e6c4ac7b 1292 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
5c511ad4 1293 },
0aebbbd0
LB
1294 [AV_PIX_FMT_YUV422P12LE] = {
1295 .name = "yuv422p12le",
1296 .nb_components = 3,
1297 .log2_chroma_w = 1,
1298 .log2_chroma_h = 0,
1299 .comp = {
1300 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1301 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1302 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1303 },
1304 .flags = AV_PIX_FMT_FLAG_PLANAR,
1305 },
1306 [AV_PIX_FMT_YUV422P12BE] = {
1307 .name = "yuv422p12be",
1308 .nb_components = 3,
1309 .log2_chroma_w = 1,
1310 .log2_chroma_h = 0,
1311 .comp = {
1312 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1313 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1314 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1315 },
1316 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1317 },
716d413c 1318 [AV_PIX_FMT_YUV422P16LE] = {
35f6c154 1319 .name = "yuv422p16le",
4a59eca9
TB
1320 .nb_components = 3,
1321 .log2_chroma_w = 1,
1322 .log2_chroma_h = 0,
75801da5 1323 .comp = {
2268db2c
VG
1324 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1325 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1326 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
75801da5 1327 },
e6c4ac7b 1328 .flags = AV_PIX_FMT_FLAG_PLANAR,
75801da5 1329 },
716d413c 1330 [AV_PIX_FMT_YUV422P16BE] = {
35f6c154 1331 .name = "yuv422p16be",
4a59eca9
TB
1332 .nb_components = 3,
1333 .log2_chroma_w = 1,
1334 .log2_chroma_h = 0,
75801da5 1335 .comp = {
2268db2c
VG
1336 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1337 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1338 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
75801da5 1339 },
e6c4ac7b 1340 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
75801da5 1341 },
716d413c 1342 [AV_PIX_FMT_YUV444P16LE] = {
35f6c154 1343 .name = "yuv444p16le",
4a59eca9
TB
1344 .nb_components = 3,
1345 .log2_chroma_w = 0,
1346 .log2_chroma_h = 0,
75801da5 1347 .comp = {
2268db2c
VG
1348 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1349 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1350 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
75801da5 1351 },
e6c4ac7b 1352 .flags = AV_PIX_FMT_FLAG_PLANAR,
75801da5 1353 },
716d413c 1354 [AV_PIX_FMT_YUV444P16BE] = {
35f6c154 1355 .name = "yuv444p16be",
4a59eca9
TB
1356 .nb_components = 3,
1357 .log2_chroma_w = 0,
1358 .log2_chroma_h = 0,
75801da5 1359 .comp = {
2268db2c
VG
1360 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1361 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1362 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
75801da5 1363 },
e6c4ac7b 1364 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
75801da5 1365 },
9bd6ea56
LB
1366 [AV_PIX_FMT_YUV444P12LE] = {
1367 .name = "yuv444p12le",
1368 .nb_components = 3,
1369 .log2_chroma_w = 0,
1370 .log2_chroma_h = 0,
1371 .comp = {
1372 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1373 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1374 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1375 },
1376 .flags = AV_PIX_FMT_FLAG_PLANAR,
1377 },
1378 [AV_PIX_FMT_YUV444P12BE] = {
1379 .name = "yuv444p12be",
1380 .nb_components = 3,
1381 .log2_chroma_w = 0,
1382 .log2_chroma_h = 0,
1383 .comp = {
1384 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1385 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1386 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1387 },
1388 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1389 },
716d413c 1390 [AV_PIX_FMT_YUV444P10LE] = {
103278f7 1391 .name = "yuv444p10le",
4a59eca9
TB
1392 .nb_components = 3,
1393 .log2_chroma_w = 0,
1394 .log2_chroma_h = 0,
103278f7 1395 .comp = {
2268db2c
VG
1396 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1397 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1398 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
103278f7 1399 },
e6c4ac7b 1400 .flags = AV_PIX_FMT_FLAG_PLANAR,
103278f7 1401 },
716d413c 1402 [AV_PIX_FMT_YUV444P10BE] = {
103278f7 1403 .name = "yuv444p10be",
4a59eca9
TB
1404 .nb_components = 3,
1405 .log2_chroma_w = 0,
1406 .log2_chroma_h = 0,
103278f7 1407 .comp = {
2268db2c
VG
1408 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1409 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1410 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
103278f7 1411 },
e6c4ac7b 1412 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
103278f7 1413 },
716d413c 1414 [AV_PIX_FMT_YUV444P9LE] = {
103278f7 1415 .name = "yuv444p9le",
4a59eca9
TB
1416 .nb_components = 3,
1417 .log2_chroma_w = 0,
1418 .log2_chroma_h = 0,
103278f7 1419 .comp = {
2268db2c
VG
1420 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1421 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1422 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
103278f7 1423 },
e6c4ac7b 1424 .flags = AV_PIX_FMT_FLAG_PLANAR,
103278f7 1425 },
716d413c 1426 [AV_PIX_FMT_YUV444P9BE] = {
103278f7 1427 .name = "yuv444p9be",
4a59eca9
TB
1428 .nb_components = 3,
1429 .log2_chroma_w = 0,
1430 .log2_chroma_h = 0,
103278f7 1431 .comp = {
2268db2c
VG
1432 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1433 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1434 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
103278f7 1435 },
e6c4ac7b 1436 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
103278f7 1437 },
d8039ef8
SL
1438 [AV_PIX_FMT_D3D11VA_VLD] = {
1439 .name = "d3d11va_vld",
1440 .log2_chroma_w = 1,
1441 .log2_chroma_h = 1,
1442 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1443 },
716d413c 1444 [AV_PIX_FMT_DXVA2_VLD] = {
92c6a099
LA
1445 .name = "dxva2_vld",
1446 .log2_chroma_w = 1,
1447 .log2_chroma_h = 1,
e6c4ac7b 1448 .flags = AV_PIX_FMT_FLAG_HWACCEL,
92c6a099 1449 },
e96c3b81
VG
1450 [AV_PIX_FMT_YA8] = {
1451 .name = "ya8",
4a59eca9 1452 .nb_components = 2,
4744f896 1453 .comp = {
2268db2c
VG
1454 { 0, 2, 0, 0, 8, 1, 7, 1 }, /* Y */
1455 { 0, 2, 1, 0, 8, 1, 7, 2 }, /* A */
4744f896 1456 },
e6c4ac7b 1457 .flags = AV_PIX_FMT_FLAG_ALPHA,
e96c3b81 1458 .alias = "gray8a",
4744f896 1459 },
e9abafca
VG
1460 [AV_PIX_FMT_YA16LE] = {
1461 .name = "ya16le",
1462 .nb_components = 2,
1463 .comp = {
2268db2c
VG
1464 { 0, 4, 0, 0, 16, 3, 15, 1 }, /* Y */
1465 { 0, 4, 2, 0, 16, 3, 15, 3 }, /* A */
e9abafca
VG
1466 },
1467 .flags = AV_PIX_FMT_FLAG_ALPHA,
1468 },
1469 [AV_PIX_FMT_YA16BE] = {
1470 .name = "ya16be",
1471 .nb_components = 2,
1472 .comp = {
2268db2c
VG
1473 { 0, 4, 0, 0, 16, 3, 15, 1 }, /* Y */
1474 { 0, 4, 2, 0, 16, 3, 15, 3 }, /* A */
e9abafca
VG
1475 },
1476 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_ALPHA,
1477 },
716d413c 1478 [AV_PIX_FMT_GBRP] = {
bd97b2e1 1479 .name = "gbrp",
4a59eca9
TB
1480 .nb_components = 3,
1481 .log2_chroma_w = 0,
1482 .log2_chroma_h = 0,
bd97b2e1 1483 .comp = {
e336c51e 1484 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* R */
2268db2c
VG
1485 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* G */
1486 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* B */
bd97b2e1 1487 },
e6c4ac7b 1488 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
bd97b2e1 1489 },
716d413c 1490 [AV_PIX_FMT_GBRP9LE] = {
bd97b2e1 1491 .name = "gbrp9le",
4a59eca9
TB
1492 .nb_components = 3,
1493 .log2_chroma_w = 0,
1494 .log2_chroma_h = 0,
bd97b2e1 1495 .comp = {
e336c51e 1496 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* R */
2268db2c
VG
1497 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* G */
1498 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* B */
bd97b2e1 1499 },
e6c4ac7b 1500 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
bd97b2e1 1501 },
716d413c 1502 [AV_PIX_FMT_GBRP9BE] = {
bd97b2e1 1503 .name = "gbrp9be",
4a59eca9
TB
1504 .nb_components = 3,
1505 .log2_chroma_w = 0,
1506 .log2_chroma_h = 0,
bd97b2e1 1507 .comp = {
e336c51e 1508 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* R */
2268db2c
VG
1509 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* G */
1510 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* B */
bd97b2e1 1511 },
e6c4ac7b 1512 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
bd97b2e1 1513 },
716d413c 1514 [AV_PIX_FMT_GBRP10LE] = {
bd97b2e1 1515 .name = "gbrp10le",
4a59eca9
TB
1516 .nb_components = 3,
1517 .log2_chroma_w = 0,
1518 .log2_chroma_h = 0,
bd97b2e1 1519 .comp = {
e336c51e 1520 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
2268db2c
VG
1521 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
1522 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
bd97b2e1 1523 },
e6c4ac7b 1524 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
bd97b2e1 1525 },
716d413c 1526 [AV_PIX_FMT_GBRP10BE] = {
bd97b2e1 1527 .name = "gbrp10be",
4a59eca9
TB
1528 .nb_components = 3,
1529 .log2_chroma_w = 0,
1530 .log2_chroma_h = 0,
bd97b2e1 1531 .comp = {
e336c51e 1532 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
2268db2c
VG
1533 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
1534 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
bd97b2e1 1535 },
e6c4ac7b 1536 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
bd97b2e1 1537 },
1e93aa69
MN
1538 [AV_PIX_FMT_GBRP12LE] = {
1539 .name = "gbrp12le",
1540 .nb_components = 3,
1541 .log2_chroma_w = 0,
1542 .log2_chroma_h = 0,
1543 .comp = {
1544 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
1545 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
1546 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
1547 },
1548 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1549 },
1550 [AV_PIX_FMT_GBRP12BE] = {
1551 .name = "gbrp12be",
1552 .nb_components = 3,
1553 .log2_chroma_w = 0,
1554 .log2_chroma_h = 0,
1555 .comp = {
1556 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
1557 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
1558 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
1559 },
1560 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1561 },
716d413c 1562 [AV_PIX_FMT_GBRP16LE] = {
bd97b2e1 1563 .name = "gbrp16le",
4a59eca9
TB
1564 .nb_components = 3,
1565 .log2_chroma_w = 0,
1566 .log2_chroma_h = 0,
bd97b2e1 1567 .comp = {
e336c51e 1568 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
2268db2c
VG
1569 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1570 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
bd97b2e1 1571 },
e6c4ac7b 1572 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
bd97b2e1 1573 },
716d413c 1574 [AV_PIX_FMT_GBRP16BE] = {
bd97b2e1 1575 .name = "gbrp16be",
4a59eca9
TB
1576 .nb_components = 3,
1577 .log2_chroma_w = 0,
1578 .log2_chroma_h = 0,
bd97b2e1 1579 .comp = {
e336c51e 1580 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
2268db2c
VG
1581 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1582 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
bd97b2e1 1583 },
e6c4ac7b 1584 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
bd97b2e1 1585 },
0e6c7dfa
PM
1586 [AV_PIX_FMT_GBRAP] = {
1587 .name = "gbrap",
1588 .nb_components = 4,
1589 .log2_chroma_w = 0,
1590 .log2_chroma_h = 0,
1591 .comp = {
e336c51e 1592 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* R */
2268db2c
VG
1593 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* G */
1594 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* B */
2268db2c 1595 { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
0e6c7dfa 1596 },
592a0405
VG
1597 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB |
1598 AV_PIX_FMT_FLAG_ALPHA,
0e6c7dfa
PM
1599 },
1600 [AV_PIX_FMT_GBRAP16LE] = {
1601 .name = "gbrap16le",
1602 .nb_components = 4,
1603 .log2_chroma_w = 0,
1604 .log2_chroma_h = 0,
1605 .comp = {
e336c51e 1606 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
2268db2c
VG
1607 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1608 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
2268db2c 1609 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
0e6c7dfa 1610 },
592a0405
VG
1611 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB |
1612 AV_PIX_FMT_FLAG_ALPHA,
0e6c7dfa
PM
1613 },
1614 [AV_PIX_FMT_GBRAP16BE] = {
1615 .name = "gbrap16be",
1616 .nb_components = 4,
1617 .log2_chroma_w = 0,
1618 .log2_chroma_h = 0,
1619 .comp = {
e336c51e 1620 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
2268db2c
VG
1621 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1622 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
2268db2c 1623 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
0e6c7dfa 1624 },
592a0405
VG
1625 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
1626 AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
0e6c7dfa 1627 },
169fb94f
RDC
1628 [AV_PIX_FMT_VDPAU] = {
1629 .name = "vdpau",
1630 .log2_chroma_w = 1,
1631 .log2_chroma_h = 1,
e6c4ac7b 1632 .flags = AV_PIX_FMT_FLAG_HWACCEL,
169fb94f 1633 },
8c652645
NB
1634 [AV_PIX_FMT_XYZ12LE] = {
1635 .name = "xyz12le",
1636 .nb_components = 3,
1637 .log2_chroma_w = 0,
1638 .log2_chroma_h = 0,
1639 .comp = {
2268db2c
VG
1640 { 0, 6, 0, 4, 12, 5, 11, 1 }, /* X */
1641 { 0, 6, 2, 4, 12, 5, 11, 3 }, /* Y */
1642 { 0, 6, 4, 4, 12, 5, 11, 5 }, /* Z */
8c652645
NB
1643 },
1644 /*.flags = -- not used*/
1645 },
1646 [AV_PIX_FMT_XYZ12BE] = {
1647 .name = "xyz12be",
1648 .nb_components = 3,
1649 .log2_chroma_w = 0,
1650 .log2_chroma_h = 0,
1651 .comp = {
2268db2c
VG
1652 { 0, 6, 0, 4, 12, 5, 11, 1 }, /* X */
1653 { 0, 6, 2, 4, 12, 5, 11, 3 }, /* Y */
1654 { 0, 6, 4, 4, 12, 5, 11, 5 }, /* Z */
8c652645 1655 },
e6c4ac7b 1656 .flags = AV_PIX_FMT_FLAG_BE,
8c652645 1657 },
e208e6d2
KK
1658 [AV_PIX_FMT_NV16] = {
1659 .name = "nv16",
1660 .nb_components = 3,
1661 .log2_chroma_w = 1,
1662 .log2_chroma_h = 0,
1663 .comp = {
2268db2c
VG
1664 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
1665 { 1, 2, 0, 0, 8, 1, 7, 1 }, /* U */
1666 { 1, 2, 1, 0, 8, 1, 7, 2 }, /* V */
e208e6d2
KK
1667 },
1668 .flags = AV_PIX_FMT_FLAG_PLANAR,
1669 },
1670 [AV_PIX_FMT_NV20LE] = {
1671 .name = "nv20le",
1672 .nb_components = 3,
1673 .log2_chroma_w = 1,
1674 .log2_chroma_h = 0,
1675 .comp = {
2268db2c
VG
1676 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1677 { 1, 4, 0, 0, 10, 3, 9, 1 }, /* U */
1678 { 1, 4, 2, 0, 10, 3, 9, 3 }, /* V */
e208e6d2
KK
1679 },
1680 .flags = AV_PIX_FMT_FLAG_PLANAR,
1681 },
1682 [AV_PIX_FMT_NV20BE] = {
1683 .name = "nv20be",
1684 .nb_components = 3,
1685 .log2_chroma_w = 1,
1686 .log2_chroma_h = 0,
1687 .comp = {
2268db2c
VG
1688 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1689 { 1, 4, 0, 0, 10, 3, 9, 1 }, /* U */
1690 { 1, 4, 2, 0, 10, 3, 9, 3 }, /* V */
e208e6d2
KK
1691 },
1692 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE,
1693 },
66e6c8a7
AK
1694 [AV_PIX_FMT_VDA] = {
1695 .name = "vda",
1696 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1697 },
5b1d9cee
AK
1698 [AV_PIX_FMT_QSV] = {
1699 .name = "qsv",
1700 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1701 },
c4845616 1702 [AV_PIX_FMT_MMAL] = {
1703 .name = "mmal",
1704 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1705 },
7bc780cd
AK
1706 [AV_PIX_FMT_CUDA] = {
1707 .name = "cuda",
1708 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1709 },
b7c5f885
HL
1710 [AV_PIX_FMT_P010LE] = {
1711 .name = "p010le",
1712 .nb_components = 3,
1713 .log2_chroma_w = 1,
1714 .log2_chroma_h = 1,
1715 .comp = {
1716 { 0, 2, 0, 6, 10, 1, 9, 1 }, /* Y */
1717 { 1, 4, 0, 6, 10, 3, 9, 1 }, /* U */
1718 { 1, 4, 2, 6, 10, 3, 9, 3 }, /* V */
1719 },
1720 .flags = AV_PIX_FMT_FLAG_PLANAR,
1721 },
1722 [AV_PIX_FMT_P010BE] = {
1723 .name = "p010be",
1724 .nb_components = 3,
1725 .log2_chroma_w = 1,
1726 .log2_chroma_h = 1,
1727 .comp = {
1728 { 0, 2, 0, 6, 10, 1, 9, 1 }, /* Y */
1729 { 1, 4, 0, 6, 10, 3, 9, 1 }, /* U */
1730 { 1, 4, 2, 6, 10, 3, 9, 3 }, /* V */
1731 },
1732 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE,
1733 },
81f1f6c3
KK
1734 [AV_PIX_FMT_GBRAP12LE] = {
1735 .name = "gbrap12le",
1736 .nb_components = 4,
1737 .log2_chroma_w = 0,
1738 .log2_chroma_h = 0,
1739 .comp = {
1740 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
1741 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
1742 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
1743 { 3, 2, 0, 0, 12, 1, 11, 1 }, /* A */
1744 },
1745 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB |
1746 AV_PIX_FMT_FLAG_ALPHA,
1747 },
1748 [AV_PIX_FMT_GBRAP12BE] = {
1749 .name = "gbrap12be",
1750 .nb_components = 4,
1751 .log2_chroma_w = 0,
1752 .log2_chroma_h = 0,
1753 .comp = {
1754 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
1755 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
1756 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
1757 { 3, 2, 0, 0, 12, 1, 11, 1 }, /* A */
1758 },
1759 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
1760 AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
1761 },
9b61d838 1762};
2268db2c
VG
1763#if FF_API_PLUS1_MINUS1
1764FF_ENABLE_DEPRECATION_WARNINGS
1765#endif
5efccce2 1766
bcc07e25
VG
1767static const char *color_range_names[] = {
1768 [AVCOL_RANGE_UNSPECIFIED] = "unknown",
1769 [AVCOL_RANGE_MPEG] = "tv",
1770 [AVCOL_RANGE_JPEG] = "pc",
5a419b2d
VG
1771};
1772
bcc07e25
VG
1773static const char *color_primaries_names[] = {
1774 [AVCOL_PRI_RESERVED0] = "reserved",
1775 [AVCOL_PRI_BT709] = "bt709",
1776 [AVCOL_PRI_UNSPECIFIED] = "unknown",
1777 [AVCOL_PRI_RESERVED] = "reserved",
1778 [AVCOL_PRI_BT470M] = "bt470m",
1779 [AVCOL_PRI_BT470BG] = "bt470bg",
1780 [AVCOL_PRI_SMPTE170M] = "smpte170m",
1781 [AVCOL_PRI_SMPTE240M] = "smpte240m",
1782 [AVCOL_PRI_FILM] = "film",
1783 [AVCOL_PRI_BT2020] = "bt2020",
f172e22d 1784 [AVCOL_PRI_SMPTE428] = "smpte428",
a8164323
VG
1785 [AVCOL_PRI_SMPTE431] = "smpte431",
1786 [AVCOL_PRI_SMPTE432] = "smpte432",
0d9b9bd3 1787 [AVCOL_PRI_JEDEC_P22] = "jedec-p22",
5a419b2d
VG
1788};
1789
bcc07e25
VG
1790static const char *color_transfer_names[] = {
1791 [AVCOL_TRC_RESERVED0] = "reserved",
1792 [AVCOL_TRC_BT709] = "bt709",
1793 [AVCOL_TRC_UNSPECIFIED] = "unknown",
1794 [AVCOL_TRC_RESERVED] = "reserved",
1795 [AVCOL_TRC_GAMMA22] = "bt470m",
1796 [AVCOL_TRC_GAMMA28] = "bt470bg",
1797 [AVCOL_TRC_SMPTE170M] = "smpte170m",
1798 [AVCOL_TRC_SMPTE240M] = "smpte240m",
1799 [AVCOL_TRC_LINEAR] = "linear",
1800 [AVCOL_TRC_LOG] = "log100",
1801 [AVCOL_TRC_LOG_SQRT] = "log316",
1802 [AVCOL_TRC_IEC61966_2_4] = "iec61966-2-4",
1803 [AVCOL_TRC_BT1361_ECG] = "bt1361e",
1804 [AVCOL_TRC_IEC61966_2_1] = "iec61966-2-1",
1805 [AVCOL_TRC_BT2020_10] = "bt2020-10",
444a3626 1806 [AVCOL_TRC_BT2020_12] = "bt2020-12",
f172e22d
VG
1807 [AVCOL_TRC_SMPTE2084] = "smpte2084",
1808 [AVCOL_TRC_SMPTE428] = "smpte428",
5d560d38 1809 [AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",
5a419b2d
VG
1810};
1811
bcc07e25
VG
1812static const char *color_space_names[] = {
1813 [AVCOL_SPC_RGB] = "gbr",
1814 [AVCOL_SPC_BT709] = "bt709",
1815 [AVCOL_SPC_UNSPECIFIED] = "unknown",
1816 [AVCOL_SPC_RESERVED] = "reserved",
1817 [AVCOL_SPC_FCC] = "fcc",
1818 [AVCOL_SPC_BT470BG] = "bt470bg",
1819 [AVCOL_SPC_SMPTE170M] = "smpte170m",
1820 [AVCOL_SPC_SMPTE240M] = "smpte240m",
1821 [AVCOL_SPC_YCOCG] = "ycgco",
1822 [AVCOL_SPC_BT2020_NCL] = "bt2020nc",
1823 [AVCOL_SPC_BT2020_CL] = "bt2020c",
a8164323 1824 [AVCOL_SPC_SMPTE2085] = "smpte2085",
5a419b2d
VG
1825};
1826
bcc07e25
VG
1827static const char *chroma_location_names[] = {
1828 [AVCHROMA_LOC_UNSPECIFIED] = "unspecified",
1829 [AVCHROMA_LOC_LEFT] = "left",
1830 [AVCHROMA_LOC_CENTER] = "center",
1831 [AVCHROMA_LOC_TOPLEFT] = "topleft",
1832 [AVCHROMA_LOC_TOP] = "top",
1833 [AVCHROMA_LOC_BOTTOMLEFT] = "bottomleft",
1834 [AVCHROMA_LOC_BOTTOM] = "bottom",
5a419b2d
VG
1835};
1836
716d413c 1837static enum AVPixelFormat get_pix_fmt_internal(const char *name)
80a07f6e 1838{
716d413c 1839 enum AVPixelFormat pix_fmt;
80a07f6e 1840
716d413c 1841 for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
80a07f6e 1842 if (av_pix_fmt_descriptors[pix_fmt].name &&
d2962e9f
LB
1843 (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
1844 av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias)))
80a07f6e
SS
1845 return pix_fmt;
1846
716d413c 1847 return AV_PIX_FMT_NONE;
80a07f6e
SS
1848}
1849
716d413c 1850const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
8f653e28 1851{
716d413c 1852 return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
8f653e28
SS
1853 av_pix_fmt_descriptors[pix_fmt].name : NULL;
1854}
1855
80a07f6e
SS
1856#if HAVE_BIGENDIAN
1857# define X_NE(be, le) be
1858#else
1859# define X_NE(be, le) le
1860#endif
1861
716d413c 1862enum AVPixelFormat av_get_pix_fmt(const char *name)
80a07f6e 1863{
716d413c 1864 enum AVPixelFormat pix_fmt;
80a07f6e
SS
1865
1866 if (!strcmp(name, "rgb32"))
1867 name = X_NE("argb", "bgra");
1868 else if (!strcmp(name, "bgr32"))
1869 name = X_NE("abgr", "rgba");
1870
1871 pix_fmt = get_pix_fmt_internal(name);
716d413c 1872 if (pix_fmt == AV_PIX_FMT_NONE) {
80a07f6e
SS
1873 char name2[32];
1874
1875 snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
1876 pix_fmt = get_pix_fmt_internal(name2);
1877 }
d264c720
MT
1878
1879#if FF_API_VAAPI
1880 if (pix_fmt == AV_PIX_FMT_NONE && !strcmp(name, "vaapi"))
1881 pix_fmt = AV_PIX_FMT_VAAPI;
1882#endif
80a07f6e
SS
1883 return pix_fmt;
1884}
1885
5efccce2
SS
1886int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
1887{
1888 int c, bits = 0;
1889 int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
1890
b8873c2a 1891 for (c = 0; c < pixdesc->nb_components; c++) {
4a59eca9 1892 int s = c == 1 || c == 2 ? 0 : log2_pixels;
2268db2c 1893 bits += pixdesc->comp[c].depth << s;
5efccce2
SS
1894 }
1895
1896 return bits >> log2_pixels;
1897}
bb4afa13 1898
b2e059a1
LB
1899char *av_get_pix_fmt_string(char *buf, int buf_size,
1900 enum AVPixelFormat pix_fmt)
bb4afa13
SS
1901{
1902 /* print header */
1903 if (pix_fmt < 0) {
4a59eca9 1904 snprintf (buf, buf_size, "name" " nb_components" " nb_bits");
bb4afa13
SS
1905 } else {
1906 const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
4a59eca9
TB
1907 snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name,
1908 pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
bb4afa13
SS
1909 }
1910
1911 return buf;
1912}
d2fcb356
AK
1913
1914const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
1915{
1916 if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
1917 return NULL;
1918 return &av_pix_fmt_descriptors[pix_fmt];
1919}
1920
1921const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
1922{
1923 if (!prev)
1924 return &av_pix_fmt_descriptors[0];
1925 if (prev - av_pix_fmt_descriptors < FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1)
1926 return prev + 1;
1927 return NULL;
1928}
1929
1930enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
1931{
1932 if (desc < av_pix_fmt_descriptors ||
1933 desc >= av_pix_fmt_descriptors + FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
1934 return AV_PIX_FMT_NONE;
1935
1936 return desc - av_pix_fmt_descriptors;
1937}
c1a02e88
LB
1938
1939int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
1940 int *h_shift, int *v_shift)
1941{
1942 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
1943 if (!desc)
1944 return AVERROR(ENOSYS);
1945 *h_shift = desc->log2_chroma_w;
1946 *v_shift = desc->log2_chroma_h;
1947
1948 return 0;
1949}
2c328a90
AK
1950
1951int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
1952{
1953 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
1954 int i, planes[4] = { 0 }, ret = 0;
1955
1956 if (!desc)
1957 return AVERROR(EINVAL);
1958
1959 for (i = 0; i < desc->nb_components; i++)
1960 planes[desc->comp[i].plane] = 1;
1961 for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
1962 ret += planes[i];
1963 return ret;
1964}
74652af8
JG
1965
1966
1967enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
1968{
1969#define PIX_FMT_SWAP_ENDIANNESS(fmt) \
1970 case AV_PIX_FMT_ ## fmt ## BE: return AV_PIX_FMT_ ## fmt ## LE; \
1971 case AV_PIX_FMT_ ## fmt ## LE: return AV_PIX_FMT_ ## fmt ## BE
1972
1973 switch (pix_fmt) {
7471352f 1974 PIX_FMT_SWAP_ENDIANNESS(GRAY12);
74652af8 1975 PIX_FMT_SWAP_ENDIANNESS(GRAY16);
e9abafca 1976 PIX_FMT_SWAP_ENDIANNESS(YA16);
74652af8
JG
1977 PIX_FMT_SWAP_ENDIANNESS(RGB48);
1978 PIX_FMT_SWAP_ENDIANNESS(RGB565);
1979 PIX_FMT_SWAP_ENDIANNESS(RGB555);
1980 PIX_FMT_SWAP_ENDIANNESS(RGB444);
1981 PIX_FMT_SWAP_ENDIANNESS(BGR48);
1982 PIX_FMT_SWAP_ENDIANNESS(BGR565);
1983 PIX_FMT_SWAP_ENDIANNESS(BGR555);
1984 PIX_FMT_SWAP_ENDIANNESS(BGR444);
1985
1986 PIX_FMT_SWAP_ENDIANNESS(YUV420P9);
1987 PIX_FMT_SWAP_ENDIANNESS(YUV422P9);
1988 PIX_FMT_SWAP_ENDIANNESS(YUV444P9);
1989 PIX_FMT_SWAP_ENDIANNESS(YUV420P10);
1990 PIX_FMT_SWAP_ENDIANNESS(YUV422P10);
1991 PIX_FMT_SWAP_ENDIANNESS(YUV444P10);
85406e7a 1992 PIX_FMT_SWAP_ENDIANNESS(YUV420P12);
0aebbbd0 1993 PIX_FMT_SWAP_ENDIANNESS(YUV422P12);
9bd6ea56 1994 PIX_FMT_SWAP_ENDIANNESS(YUV444P12);
74652af8
JG
1995 PIX_FMT_SWAP_ENDIANNESS(YUV420P16);
1996 PIX_FMT_SWAP_ENDIANNESS(YUV422P16);
1997 PIX_FMT_SWAP_ENDIANNESS(YUV444P16);
1998
1999 PIX_FMT_SWAP_ENDIANNESS(GBRP9);
2000 PIX_FMT_SWAP_ENDIANNESS(GBRP10);
1e93aa69 2001 PIX_FMT_SWAP_ENDIANNESS(GBRP12);
74652af8
JG
2002 PIX_FMT_SWAP_ENDIANNESS(GBRP16);
2003 PIX_FMT_SWAP_ENDIANNESS(YUVA420P9);
2004 PIX_FMT_SWAP_ENDIANNESS(YUVA422P9);
2005 PIX_FMT_SWAP_ENDIANNESS(YUVA444P9);
2006 PIX_FMT_SWAP_ENDIANNESS(YUVA420P10);
2007 PIX_FMT_SWAP_ENDIANNESS(YUVA422P10);
2008 PIX_FMT_SWAP_ENDIANNESS(YUVA444P10);
2009 PIX_FMT_SWAP_ENDIANNESS(YUVA420P16);
2010 PIX_FMT_SWAP_ENDIANNESS(YUVA422P16);
2011 PIX_FMT_SWAP_ENDIANNESS(YUVA444P16);
2012
2013 PIX_FMT_SWAP_ENDIANNESS(XYZ12);
80035db8
JG
2014 PIX_FMT_SWAP_ENDIANNESS(NV20);
2015 PIX_FMT_SWAP_ENDIANNESS(RGBA64);
2016 PIX_FMT_SWAP_ENDIANNESS(BGRA64);
74652af8
JG
2017 default:
2018 return AV_PIX_FMT_NONE;
2019 }
2020#undef PIX_FMT_SWAP_ENDIANNESS
2021}
5a419b2d
VG
2022
2023const char *av_color_range_name(enum AVColorRange range)
2024{
2025 return (unsigned) range < AVCOL_RANGE_NB ?
2026 color_range_names[range] : NULL;
2027}
2028
2029const char *av_color_primaries_name(enum AVColorPrimaries primaries)
2030{
2031 return (unsigned) primaries < AVCOL_PRI_NB ?
2032 color_primaries_names[primaries] : NULL;
2033}
2034
2035const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
2036{
2037 return (unsigned) transfer < AVCOL_TRC_NB ?
2038 color_transfer_names[transfer] : NULL;
2039}
2040
2041const char *av_color_space_name(enum AVColorSpace space)
2042{
2043 return (unsigned) space < AVCOL_SPC_NB ?
2044 color_space_names[space] : NULL;
2045}
2046
2047const char *av_chroma_location_name(enum AVChromaLocation location)
2048{
2049 return (unsigned) location < AVCHROMA_LOC_NB ?
2050 chroma_location_names[location] : NULL;
2051}
2052