Fix planar GBR H264 samples
[vlc.git] / src / misc / fourcc.c
blobf4fa4c7b1924caf69904128d6e5e4755f406cc86
1 /*****************************************************************************
2 * fourcc.c: fourcc helpers functions
3 *****************************************************************************
4 * Copyright © 2009-2011 Laurent Aimar
6 * Authors: Laurent Aimar <fenrir@videolan.org>
7 * Jean-Baptiste Kempf <jb@videolan.org>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 /*****************************************************************************
25 * Preamble
26 *****************************************************************************/
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
31 #include <vlc_common.h>
32 #include <vlc_fourcc.h>
33 #include <vlc_es.h>
34 #include <assert.h>
37 typedef struct
39 char p_class[4];
40 char p_fourcc[4];
41 char psz_description[56];
42 } staticentry_t;
44 typedef struct
46 char p_class[4];
47 char p_fourcc[4];
48 const char *psz_description;
49 } entry_t;
51 #define NULL4 "\x00\x00\x00\x00"
53 /* XXX You don't want to see the preprocessor generated code ;) */
54 #ifdef WORDS_BIGENDIAN
55 # define FCC2STR(f) { ((f)>>24)&0xff, ((f)>>16)&0xff, ((f)>>8)&0xff, ((f)>>0)&0xff }
56 #else
57 # define FCC2STR(f) { ((f)>>0)&0xff, ((f)>>8)&0xff, ((f)>>16)&0xff, ((f)>>24)&0xff }
58 #endif
59 /* Begin a new class */
60 #define B(a, c) { .p_class = FCC2STR(a), .p_fourcc = FCC2STR(a), .psz_description = c }
61 /* Create a sub-class entry with description */
62 #define E(b, c) { .p_class = NULL4, .p_fourcc = b, .psz_description = c }
63 /* Create a sub-class entry without description (alias) */
64 #define A(b) E(b, NULL4)
67 /* */
68 static const staticentry_t p_list_video[] = {
70 B(VLC_CODEC_MP1V, "MPEG-1 Video"),
71 A("mp1v"),
72 A("mpg1"),
74 B(VLC_CODEC_MPGV, "MPEG-1/2 Video"),
75 B(VLC_CODEC_MP2V, "MPEG-2 Video"),
76 A("mpgv"),
77 A("mpeg"),
78 A("mp2v"),
79 A("MPEG"),
80 A("mpg2"),
81 A("MPG2"),
82 A("H262"),
84 E("PIM1", "Pinnacle DC1000 (MPEG-1 Video)"),
86 E("hdv1", "HDV 720p30 (MPEG-2 Video)"),
87 E("hdv2", "Sony HDV 1080i60 (MPEG-2 Video)"),
88 E("hdv3", "FCP HDV 1080i50 (MPEG-2 Video)"),
89 E("hdv4", "HDV 720p24 (MPEG-2 Video)"),
90 E("hdv5", "HDV 720p25 (MPEG-2 Video)"),
91 E("hdv6", "HDV 1080p24 (MPEG-2 Video)"),
92 E("hdv7", "HDV 1080p25 (MPEG-2 Video)"),
93 E("hdv8", "HDV 1080p30 (MPEG-2 Video)"),
94 E("hdv9", "HDV 720p60 JVC (MPEG-2 Video)"),
95 E("hdva", "HDV 720p50 (MPEG-2 Video)"),
97 E("mx5n", "MPEG2 IMX NTSC 525/60 50Mb/s (FCP)"),
98 E("mx5p", "MPEG2 IMX PAL 625/60 50Mb/s (FCP)"),
99 E("mx4n", "MPEG2 IMX NTSC 525/60 40Mb/s (FCP)"),
100 E("mx4p", "MPEG2 IMX PAL 625/50 40Mb/s (FCP)"),
101 E("mx3n", "MPEG2 IMX NTSC 525/60 30Mb/s (FCP)"),
102 E("mx3p", "MPEG2 IMX NTSC 625/50 30Mb/s (FCP)"),
104 E("xdv1", "XDCAM HD 720p30 35Mb/s"),
105 E("xdv2", "XDCAM HD 1080i60 35Mb/s"),
106 E("xdv3", "XDCAM HD 1080i50 35Mb/s"),
107 E("xdv4", "XDCAM HD 720p24 35Mb/s"),
108 E("xdv5", "XDCAM HD 720p25 35Mb/s"),
109 E("xdv6", "XDCAM HD 1080p24 35Mb/s"),
110 E("xdv7", "XDCAM HD 1080p25 35Mb/s"),
111 E("xdv8", "XDCAM HD 1080p30 35Mb/s"),
112 E("xdv9", "XDCAM HD 720p60 35Mb/s"),
113 E("xdva", "XDCAM HD 720p50 35Mb/s"),
115 E("xdvb", "XDCAM EX 1080i60 50Mb/s CBR"),
116 E("xdvc", "XDCAM EX 1080i50 50Mb/s CBR"),
117 E("xdvd", "XDCAM EX 1080p24 50Mb/s CBR"),
118 E("xdve", "XDCAM EX 1080p25 50Mb/s CBR"),
119 E("xdvf", "XDCAM EX 1080p30 50Mb/s CBR"),
121 E("xd51", "XDCAM HD422 720p30 50Mb/s CBR"),
122 E("xd54", "XDCAM HD422 720p24 50Mb/s CBR"),
123 E("xd55", "XDCAM HD422 720p25 50Mb/s CBR"),
124 E("xd59", "XDCAM HD422 720p60 50Mb/s CBR"),
125 E("xd5a", "XDCAM HD422 720p50 50Mb/s CBR"),
126 E("xd5b", "XDCAM HD422 1080i60 50Mb/s CBR"),
127 E("xd5c", "XDCAM HD422 1080i50 50Mb/s CBR"),
128 E("xd5d", "XDCAM HD422 1080p24 50Mb/s CBR"),
129 E("xd5e", "XDCAM HD422 1080p25 50Mb/s CBR"),
130 E("xd5f", "XDCAM HD422 1080p30 50Mb/s CBR"),
132 E("xdhd", "XDCAM HD 540p"),
133 E("xdh2", "XDCAM HD422 540p"),
135 E("AVmp", "AVID IMX PAL"),
136 E("MMES", "Matrox MPEG-2"),
137 E("mmes", "Matrox MPEG-2"),
138 E("PIM2", "Pinnacle MPEG-2"),
139 E("LMP2", "Lead MPEG-2"),
141 E("VCR2", "ATI VCR-2"),
143 B(VLC_CODEC_MP4V, "MPEG-4 Video"),
144 A("mp4v"),
145 A("DIVX"),
146 A("divx"),
147 A("MP4S"),
148 A("mp4s"),
149 A("M4S2"),
150 A("m4s2"),
151 A("MP4V"),
152 A("\x04\x00\x00\x00"),
153 A("m4cc"),
154 A("M4CC"),
155 A("FMP4"),
156 A("fmp4"),
157 A("DCOD"),
158 A("MVXM"),
159 A("PM4V"),
160 A("M4T3"),
161 A("GEOX"),
162 A("GEOV"),
163 A("DMK2"),
164 A("WV1F"),
165 A("DIGI"),
166 A("INMC"),
167 A("SN40"),
168 A("EPHV"),
169 A("DM4V"),
170 A("SM4V"),
171 /* XVID flavours */
172 E("xvid", "Xvid MPEG-4 Video"),
173 E("XVID", "Xvid MPEG-4 Video"),
174 E("XviD", "Xvid MPEG-4 Video"),
175 E("XVIX", "Xvid MPEG-4 Video"),
176 E("xvix", "Xvid MPEG-4 Video"),
177 /* DX50 */
178 E("DX50", "DivX MPEG-4 Video"),
179 E("dx50", "DivX MPEG-4 Video"),
180 E("BLZ0", "Blizzard MPEG-4 Video"),
181 E("DXGM", "Electronic Arts Game MPEG-4 Video"),
182 E("DreX", "DreX Mpeg-4"),
183 /* 3ivx delta 4 */
184 E("3IV2", "3ivx MPEG-4 Video"),
185 E("3iv2", "3ivx MPEG-4 Video"),
186 /* Various */
187 E("UMP4", "UB MPEG-4 Video"),
188 E("SEDG", "Samsung MPEG-4 Video"),
189 E("RMP4", "REALmagic MPEG-4 Video"),
190 E("LMP4", "Lead MPEG-4 Video"),
191 E("HDX4", "Jomigo HDX4 (MPEG-4 Video)"),
192 E("hdx4", "Jomigo HDX4 (MPEG-4 Video)"),
193 E("SMP4", "Samsung SMP4 (MPEG-4 Video)"),
194 E("smp4", "Samsung SMP4 (MPEG-4 Video)"),
195 E("fvfw", "libavcodec MPEG-4"),
196 E("FVFW", "libavcodec MPEG-4"),
197 E("FFDS", "FFDShow MPEG-4"),
198 E("VIDM", "vidm 4.01 codec"),
199 E("DP02", "DynaPel MPEG-4 codec"),
200 E("PLV1", "Pelco DVR MPEG-4"),
201 E("QMP4", "QNAP Systems MPEG-4"),
202 /* 3ivx delta 3.5 Unsupported
203 * putting it here gives extreme distorted images */
204 //E("3IV1", "3ivx delta 3.5 MPEG-4 Video"),
205 //E("3iv1", "3ivx delta 3.5 MPEG-4 Video"),
207 /* MSMPEG4 v1 */
208 B(VLC_CODEC_DIV1, "MS MPEG-4 Video v1"),
209 A("DIV1"),
210 A("div1"),
211 A("MPG4"),
212 A("mpg4"),
213 A("mp41"),
215 /* MSMPEG4 v2 */
216 B(VLC_CODEC_DIV2, "MS MPEG-4 Video v2"),
217 A("DIV2"),
218 A("div2"),
219 A("MP42"),
220 A("mp42"),
222 /* MSMPEG4 v3 / M$ mpeg4 v3 */
223 B(VLC_CODEC_DIV3, "MS MPEG-4 Video v3"),
224 A("DIV3"),
225 A("MPG3"),
226 A("mpg3"),
227 A("div3"),
228 A("MP43"),
229 A("mp43"),
230 /* DivX 3.20 */
231 A("DIV4"),
232 A("div4"),
233 A("DIV5"),
234 A("div5"),
235 A("DIV6"),
236 A("div6"),
237 E("divf", "DivX 4.12"),
238 E("DIVF", "DivX 4.12"),
239 /* Cool Codec */
240 A("COL1"),
241 A("col1"),
242 A("COL0"),
243 A("col0"),
244 /* AngelPotion stuff */
245 A("AP41"),
246 /* 3ivx doctered divx files */
247 A("3IVD"),
248 A("3ivd"),
249 /* who knows? */
250 A("3VID"),
251 A("3vid"),
252 A("DVX1"),
253 A("DVX3"),
255 /* Sorenson v1 */
256 B(VLC_CODEC_SVQ1, "SVQ-1 (Sorenson Video v1)"),
257 A("SVQ1"),
258 A("svq1"),
259 A("svqi"),
261 /* Sorenson v3 */
262 B(VLC_CODEC_SVQ3, "SVQ-3 (Sorenson Video v3)"),
263 A("SVQ3"),
265 /* HEVC / H.265 */
266 B(VLC_CODEC_HEVC, "MPEG-H Part2/HEVC (H.265)"),
267 A("hevc"),
268 A("HEVC"),
269 A("h265"),
270 A("H265"),
271 A("x265"),
273 /* h264 */
274 B(VLC_CODEC_H264, "H264 - MPEG-4 AVC (part 10)"),
275 A("H264"),
276 A("h264"),
277 A("x264"),
278 A("X264"),
279 A("V264"),
280 /* avc1: special case h264 */
281 A("avc1"),
282 A("AVC1"),
283 E("ai5p", "AVC-Intra 50M 720p24/30/60"),
284 E("ai5q", "AVC-Intra 50M 720p25/50"),
285 E("ai52", "AVC-Intra 50M 1080p25/50"),
286 E("ai53", "AVC-Intra 50M 1080p24/30/60"),
287 E("ai55", "AVC-Intra 50M 1080i50"),
288 E("ai56", "AVC-Intra 50M 1080i60"),
289 E("ai1p", "AVC-Intra 100M 720p24/30/60"),
290 E("ai1q", "AVC-Intra 100M 720p25/50"),
291 E("ai12", "AVC-Intra 100M 1080p25/50"),
292 E("ai13", "AVC-Intra 100M 1080p24/30/60"),
293 E("ai15", "AVC-Intra 100M 1080i50"),
294 E("ai16", "AVC-Intra 100M 1080i60"),
295 E("VSSH", "Vanguard VSS H264"),
296 E("VSSW", "Vanguard VSS H264"),
297 E("vssh", "Vanguard VSS H264"),
298 E("DAVC", "Dicas MPEGable H.264/MPEG-4 AVC"),
299 E("davc", "Dicas MPEGable H.264/MPEG-4 AVC"),
300 E("x3eV", "DreX H.264"),
302 /* H263 and H263i */
303 /* H263(+) is also known as Real Video 1.0 */
305 /* H263 */
306 B(VLC_CODEC_H263, "H263"),
307 A("H263"),
308 A("h263"),
309 A("VX1K"),
310 A("s263"),
311 A("S263"),
312 A("U263"),
313 A("u263"),
314 A("lsvm"),
315 E("D263", "DEC H263"),
316 E("d263", "DEC H263"),
317 E("L263", "LEAD H263"),
318 E("M263", "Microsoft H263"),
319 E("X263", "Xirlink H263"),
320 /* Zygo (partial) */
321 E("ZyGo", "ITU H263+"),
323 /* H263i */
324 B(VLC_CODEC_H263I, "I263.I"),
325 A("I263"),
326 A("i263"),
328 /* H263P */
329 B(VLC_CODEC_H263P, "ITU H263+"),
330 E("ILVR", "ITU H263+"),
331 E("viv1", "H263+"),
332 E("vivO", "H263+"),
333 E("viv2", "H263+"),
334 E("VIVO", "H263+"),
335 E("U263", "UB H263+"),
337 /* Flash (H263) variant */
338 B(VLC_CODEC_FLV1, "Flash Video"),
339 A("FLV1"),
340 A("flv "),
342 /* H261 */
343 B(VLC_CODEC_H261, "H.261"),
344 A("H261"),
345 A("h261"),
347 B(VLC_CODEC_FLIC, "Flic Video"),
348 A("FLIC"),
350 /* MJPEG */
351 B(VLC_CODEC_MJPG, "Motion JPEG Video"),
352 A("MJPG"),
353 A("MJPx"),
354 A("mjpg"),
355 A("mJPG"),
356 A("mjpa"),
357 A("jpeg"),
358 A("JPEG"),
359 A("JFIF"),
360 A("JPGL"),
361 A("LJPG"),
362 A("AVDJ"),
363 A("MMJP"),
364 A("FLJP"),
365 A("FMJP"),
366 A("SJPG"),
367 A("QIVG"),
368 E("AVRn", "Avid Motion JPEG"),
369 E("AVDJ", "Avid Motion JPEG"),
370 E("ADJV", "Avid Motion JPEG"),
371 E("dmb1", "Motion JPEG OpenDML Video"),
372 E("DMB1", "Motion JPEG OpenDML Video"),
373 E("ijpg", "Intergraph JPEG Video"),
374 E("IJPG", "Intergraph JPEG Video"),
375 E("ACDV", "ACD Systems Digital"),
376 E("SLMJ", "SL M-JPEG"),
378 B(VLC_CODEC_MJPGB, "Motion JPEG B Video"),
379 A("mjpb"),
381 B(VLC_CODEC_LJPG, "Lead Motion JPEG Video"),
382 A("LJPG"),
383 E("Ljpg", "Lead Motion JPEG"),
385 // ? from avcodec/fourcc.c but makes not sense.
386 //{ VLC_FOURCC( 'L','J','P','G' ), CODEC_ID_MJPEG, VIDEO_ES, "Lead Motion JPEG Video" },
388 /* SP5x */
389 B(VLC_CODEC_SP5X, "Sunplus Motion JPEG Video"),
390 A("SP5X"),
391 A("SP53"),
392 A("SP54"),
393 A("SP55"),
394 A("SP56"),
395 A("SP57"),
396 A("SP58"),
398 /* DV */
399 B(VLC_CODEC_DV, "DV Video"),
400 A("dv "),
401 A("dvsl"),
402 A("DVSD"),
403 A("dvsd"),
404 A("DVCS"),
405 A("dvcs"),
406 A("dvhd"),
407 A("dvhq"),
408 A("dvh1"),
409 E("dvh2", "DV Video 720p24"),
410 E("dvh3", "DV Video 720p25"),
411 E("dvh4", "DV Video 720p30"),
412 A("dv25"),
413 A("dc25"),
414 A("dvs1"),
415 A("dvis"),
416 A("CDV2"),
417 A("CDVP"),
418 A("PDVC"),
419 A("IPDV"),
420 A("ipdv"),
421 E("dvcp", "DV Video PAL"),
422 E("dvc ", "DV Video NTSC" ),
423 E("dvp ", "DV Video Pro"),
424 E("dvpp", "DV Video Pro PAL"),
425 E("dv50", "DV Video C Pro 50"),
426 E("dv5p", "DV Video C Pro 50 PAL"),
427 E("dv5n", "DV Video C Pro 50 NTSC"),
428 E("dv1p", "DV Video C Pro 100 PAL" ),
429 E("dv1n", "DV Video C Pro 100 NTSC" ),
430 E("dvhp", "DV Video C Pro HD 720p" ),
431 E("dvh5", "DV Video C Pro HD 1080i50" ),
432 E("dvh6", "DV Video C Pro HD 1080i60" ),
433 E("AVdv", "AVID DV"),
434 E("AVd1", "AVID DV"),
435 E("CDVC", "Canopus DV Video"),
436 E("cdvc", "Canopus DV Video"),
437 E("CDVH", "Canopus DV Video"),
438 E("cdvh", "Canopus DV Video"),
439 E("CDV5", "Canopus DV Video"),
440 E("SLDV", "SoftLab DVCAM codec"),
442 /* Windows Media Video */
443 B(VLC_CODEC_WMV1, "Windows Media Video 7"),
444 A("WMV1"),
445 A("wmv1"),
447 B(VLC_CODEC_WMV2, "Windows Media Video 8"),
448 A("WMV2"),
449 A("wmv2"),
451 B(VLC_CODEC_WMV3, "Windows Media Video 9"),
452 A("WMV3"),
453 A("wmv3"),
455 /* WMVA is the VC-1 codec before the standardization proces,
456 * it is not bitstream compatible and deprecated */
457 B(VLC_CODEC_WMVA, "Windows Media Video Advanced Profile"),
458 A("WMVA"),
459 A("wmva"),
461 B(VLC_CODEC_VC1, "Windows Media Video VC1"),
462 A("WVC1"),
463 A("wvc1"),
464 A("vc-1"),
465 A("VC-1"),
467 B(VLC_CODEC_WMVP, "Windows Media Video Presentation"),
468 A("WMVP"),
469 A("wmvp"),
471 B(VLC_CODEC_WMVP2, "Windows Media Video Presentation, v2"),
472 A("WVP2"),
473 A("wvp2"),
475 /* Microsoft Video 1 */
476 B(VLC_CODEC_MSVIDEO1, "Microsoft Video 1"),
477 A("MSVC"),
478 A("msvc"),
479 A("CRAM"),
480 A("cram"),
481 A("WHAM"),
482 A("wham"),
484 /* Microsoft RLE */
485 B(VLC_CODEC_MSRLE, "Microsoft RLE Video"),
486 A("mrle"),
487 A("WRLE"),
488 A("\x01\x00\x00\x00"),
489 A("\x02\x00\x00\x00"),
491 /* Indeo Video Codecs (Quality of this decoder on ppc is not good) */
492 B(VLC_CODEC_INDEO3, "Indeo Video v3"),
493 A("IV31"),
494 A("iv31"),
495 A("IV32"),
496 A("iv32"),
498 /* Huff YUV */
499 B(VLC_CODEC_HUFFYUV, "Huff YUV Video"),
500 A("HFYU"),
502 B(VLC_CODEC_FFVHUFF, "Huff YUV Video"),
503 A("FFVH"),
505 /* On2 VP3 Video Codecs */
506 B(VLC_CODEC_VP3, "On2's VP3 Video"),
507 A("VP3 "),
508 A("VP30"),
509 A("vp30"),
510 A("VP31"),
511 A("vp31"),
513 /* On2 VP5, VP6 codecs */
514 B(VLC_CODEC_VP5, "On2's VP5 Video"),
515 A("VP5 "),
516 A("VP50"),
518 B(VLC_CODEC_VP6, "On2's VP6.2 Video"),
519 A("VP62"),
520 A("vp62"),
521 E("VP60", "On2's VP6.0 Video"),
522 E("VP61", "On2's VP6.1 Video"),
524 B(VLC_CODEC_VP6F, "On2's VP6.2 Video (Flash)"),
525 A("VP6F"),
526 A("FLV4"),
528 B(VLC_CODEC_VP6A, "On2's VP6 A Video"),
529 A("VP6A"),
531 B(VLC_CODEC_VP8, "Google/On2's VP8 Video"),
532 A("VP80"),
534 B(VLC_CODEC_VP9, "Google/On2's VP9 Video"),
535 A("VP90"),
538 /* Xiph.org theora */
539 B(VLC_CODEC_THEORA, "Xiph.org's Theora Video"),
540 A("theo"),
541 A("THEO"),
542 A("Thra"),
544 /* Xiph.org tarkin */
545 B(VLC_CODEC_TARKIN, "Xiph.org's Tarkin Video"),
546 A("tark"),
548 /* Asus Video (Another thing that doesn't work on PPC) */
549 B(VLC_CODEC_ASV1, "Asus V1 Video"),
550 A("ASV1"),
551 B(VLC_CODEC_ASV2, "Asus V2 Video"),
552 A("ASV2"),
554 /* FF video codec 1 (lossless codec) */
555 B(VLC_CODEC_FFV1, "FF video codec 1"),
556 A("FFV1"),
558 /* ATI VCR1 */
559 B(VLC_CODEC_VCR1, "ATI VCR1 Video"),
560 A("VCR1"),
562 /* Cirrus Logic AccuPak */
563 B(VLC_CODEC_CLJR, "Creative Logic AccuPak"),
564 A("CLJR"),
566 /* Real Video */
567 B(VLC_CODEC_RV10, "RealVideo 1.0"),
568 A("RV10"),
569 A("rv10"),
571 B(VLC_CODEC_RV13, "RealVideo 1.3"),
572 A("RV13"),
573 A("rv13"),
575 B(VLC_CODEC_RV20, "RealVideo G2 (2.0)"),
576 A("RV20"),
577 A("rv20"),
579 B(VLC_CODEC_RV30, "RealVideo 8 (3.0)"),
580 A("RV30"),
581 A("rv30"),
583 B(VLC_CODEC_RV40, "RealVideo 9/10 (4.0)"),
584 A("RV40"),
585 A("rv40"),
587 /* Apple Video */
588 B(VLC_CODEC_RPZA, "Apple Video"),
589 A("rpza"),
590 A("azpr"),
591 A("RPZA"),
592 A("AZPR"),
594 B(VLC_CODEC_SMC, "Apple graphics"),
595 A("smc "),
597 B(VLC_CODEC_CINEPAK, "Cinepak Video"),
598 A("CVID"),
599 A("cvid"),
601 /* Screen Capture Video Codecs */
602 B(VLC_CODEC_TSCC, "TechSmith Camtasia Screen Capture"),
603 A("TSCC"),
604 A("tscc"),
606 B(VLC_CODEC_CSCD, "CamStudio Screen Codec"),
607 A("CSCD"),
608 A("cscd"),
610 B(VLC_CODEC_ZMBV, "DosBox Capture Codec"),
611 A("ZMBV"),
613 B(VLC_CODEC_VMNC, "VMware Video"),
614 A("VMnc"),
615 B(VLC_CODEC_FRAPS, "FRAPS: Realtime Video Capture"),
616 A("FPS1"),
617 A("fps1"),
619 /* Duck TrueMotion */
620 B(VLC_CODEC_TRUEMOTION1, "Duck TrueMotion v1 Video"),
621 A("DUCK"),
622 A("PVEZ"),
623 B(VLC_CODEC_TRUEMOTION2, "Duck TrueMotion v2.0 Video"),
624 A("TM20"),
626 B(VLC_CODEC_QTRLE, "Apple QuickTime RLE Video"),
627 A("rle "),
629 B(VLC_CODEC_QDRAW, "Apple QuickDraw Video"),
630 A("qdrw"),
632 B(VLC_CODEC_QPEG, "QPEG Video"),
633 A("QPEG"),
634 A("Q1.0"),
635 A("Q1.1"),
637 B(VLC_CODEC_ULTI, "IBM Ultimotion Video"),
638 A("ULTI"),
640 B(VLC_CODEC_VIXL, "Miro/Pinnacle VideoXL Video"),
641 A("VIXL"),
642 A("XIXL"),
643 E("PIXL", "Pinnacle VideoXL Video"),
645 B(VLC_CODEC_LOCO, "LOCO Video"),
646 A("LOCO"),
648 B(VLC_CODEC_WNV1, "Winnov WNV1 Video"),
649 A("WNV1"),
651 B(VLC_CODEC_AASC, "Autodesc RLE Video"),
652 A("AASC"),
654 B(VLC_CODEC_INDEO2, "Indeo Video v2"),
655 A("IV20"),
656 E("RT21", "Indeo Video 2.1" ),
658 /* Flash Screen Video */
659 B(VLC_CODEC_FLASHSV, "Flash Screen Video"),
660 A("FSV1"),
661 B(VLC_CODEC_FLASHSV2, "Flash Screen Video 2"),
662 A("FSV2"),
664 B(VLC_CODEC_KMVC, "Karl Morton's Video Codec (Worms)"),
665 A("KMVC"),
667 B(VLC_CODEC_NUV, "Nuppel Video"),
668 A("RJPG"),
669 A("NUV1"),
671 /* CODEC_ID_SMACKVIDEO */
672 B(VLC_CODEC_SMACKVIDEO, "Smacker Video"),
673 A("SMK2"),
674 A("SMK4"),
676 /* Chinese AVS - Untested */
677 B(VLC_CODEC_CAVS, "Chinese AVS"),
678 A("CAVS"),
679 A("AVs2"),
680 A("avs2"),
682 B(VLC_CODEC_AMV, "AMV"),
684 B(VLC_CODEC_BINKVIDEO, "Bink Video"),
686 B(VLC_CODEC_BINKAUDIO_DCT, "Bink Audio (DCT)"),
688 B(VLC_CODEC_BINKAUDIO_RDFT, "Bink Audio (RDFT)"),
690 /* */
691 B(VLC_CODEC_DNXHD, "DNxHD"),
692 A("AVdn"),
693 B(VLC_CODEC_8BPS, "8BPS"),
694 A("8BPS"),
695 B(VLC_CODEC_MIMIC, "Mimic"),
696 A("ML2O"),
698 B(VLC_CODEC_CDG, "CD-G Video"),
699 A("CDG "),
701 B(VLC_CODEC_FRWU, "Forward Uncompressed" ),
702 A("FRWU"),
704 B(VLC_CODEC_INDEO4, "Indeo Video v4"),
705 A("IV41"),
706 A("iv41"),
708 B(VLC_CODEC_INDEO5, "Indeo Video v5"),
709 A("IV50"),
710 A("iv50"),
712 B(VLC_CODEC_PRORES, "Apple ProRes"),
713 E("apcn", "Apple ProRes 422 Standard"),
714 E("apch", "Apple ProRes 422 HQ"),
715 E("apcs", "Apple ProRes 422 LT"),
716 E("apco", "Apple ProRes 422 Proxy"),
717 E("ap4c", "Apple ProRes 4444"),
718 E("ap4h", "Apple ProRes 4444"),
720 B(VLC_CODEC_ICOD, "Apple Intermediate Codec"),
721 A("icod"),
723 B(VLC_CODEC_G2M2, "GoTo Meeting Codec 2"),
724 A("G2M2"),
726 B(VLC_CODEC_G2M3, "GoTo Meeting Codec 3"),
727 A("G2M3"),
729 B(VLC_CODEC_G2M4, "GoTo Meeting Codec 4"),
730 A("G2M4"),
732 B(VLC_CODEC_FIC, "Mirillis FIC video"),
733 A("FICV"),
735 /* */
736 B(VLC_CODEC_YV12, "Planar 4:2:0 YVU"),
737 A("YV12"),
738 A("yv12"),
739 B(VLC_CODEC_YV9, "Planar 4:1:0 YVU"),
740 A("YVU9"),
741 B(VLC_CODEC_I410, "Planar 4:1:0 YUV"),
742 A("I410"),
743 B(VLC_CODEC_I411, "Planar 4:1:1 YUV"),
744 A("I411"),
745 B(VLC_CODEC_I420, "Planar 4:2:0 YUV"),
746 A("I420"),
747 A("IYUV"),
748 B(VLC_CODEC_I422, "Planar 4:2:2 YUV"),
749 A("I422"),
750 B(VLC_CODEC_I440, "Planar 4:4:0 YUV"),
751 A("I440"),
752 B(VLC_CODEC_I444, "Planar 4:4:4 YUV"),
753 A("I444"),
755 B(VLC_CODEC_J420, "Planar 4:2:0 YUV full scale"),
756 A("J420"),
757 B(VLC_CODEC_J422, "Planar 4:2:2 YUV full scale"),
758 A("J422"),
759 B(VLC_CODEC_J440, "Planar 4:4:0 YUV full scale"),
760 A("J440"),
761 B(VLC_CODEC_J444, "Planar 4:4:4 YUV full scale"),
762 A("J444"),
764 B(VLC_CODEC_YUVP, "Palettized YUV with palette element Y:U:V:A"),
765 A("YUVP"),
767 B(VLC_CODEC_YUVA, "Planar YUV 4:4:4 Y:U:V:A"),
768 A("YUVA"),
769 B(VLC_CODEC_YUV420A, "Planar YUV 4:2:0 Y:U:V:A"),
770 A("I40A"),
771 B(VLC_CODEC_YUV422A, "Planar YUV 4:2:2 Y:U:V:A"),
772 A("I42A"),
774 B(VLC_CODEC_RGBP, "Palettized RGB with palette element R:G:B"),
775 A("RGBP"),
777 B(VLC_CODEC_RGB8, "8 bits RGB"),
778 A("RGB2"),
779 B(VLC_CODEC_RGB12, "12 bits RGB"),
780 A("RV12"),
781 B(VLC_CODEC_RGBA16, "16 bits RGBA"),
782 A("AV16"),
783 B(VLC_CODEC_RGB15, "15 bits RGB"),
784 A("RV15"),
785 B(VLC_CODEC_RGBT, "16 bits RGBT"),
786 A("RGBT"),
787 B(VLC_CODEC_RGB16, "16 bits RGB"),
788 A("RV16"),
789 B(VLC_CODEC_RGB24, "24 bits RGB"),
790 A("RV24"),
791 B(VLC_CODEC_RGB32, "32 bits RGB"),
792 A("RV32"),
793 B(VLC_CODEC_RGBA, "32 bits RGBA"),
794 A("RGBA"),
795 B(VLC_CODEC_RGBA, "32 bits ARGB"),
796 A("ARGB"),
797 A("AV32"),
799 B(VLC_CODEC_GREY, "8 bits greyscale"),
800 A("GREY"),
801 A("Y800"),
802 A("Y8 "),
804 B(VLC_CODEC_UYVY, "Packed YUV 4:2:2, U:Y:V:Y"),
805 A("UYVY"),
806 A("UYNV"),
807 A("UYNY"),
808 A("Y422"),
809 A("HDYC"),
810 A("AVUI"),
811 A("uyv1"),
812 A("2vuy"),
813 A("2Vuy"),
814 A("2Vu1"),
815 B(VLC_CODEC_VYUY, "Packed YUV 4:2:2, V:Y:U:Y"),
816 A("VYUY"),
817 B(VLC_CODEC_YUYV, "Packed YUV 4:2:2, Y:U:Y:V"),
818 A("YUY2"),
819 A("YUYV"),
820 A("YUNV"),
821 A("V422"),
822 B(VLC_CODEC_YVYU, "Packed YUV 4:2:2, Y:V:Y:U"),
823 A("YVYU"),
825 B(VLC_CODEC_Y211, "Packed YUV 2:1:1, Y:U:Y:V "),
826 A("Y211"),
827 B(VLC_CODEC_CYUV, "Creative Packed YUV 4:2:2, U:Y:V:Y, reverted"),
828 A("cyuv"),
829 A("CYUV"),
831 B(VLC_CODEC_V210, "10-bit 4:2:2 Component YCbCr"),
832 A("v210"),
834 B(VLC_CODEC_NV12, "Biplanar 4:2:0 Y/UV"),
835 A("NV12"),
836 B(VLC_CODEC_NV21, "Biplanar 4:2:0 Y/VU"),
837 A("NV21"),
838 B(VLC_CODEC_NV16, "Biplanar 4:2:2 Y/UV"),
839 A("NV16"),
840 B(VLC_CODEC_NV61, "Biplanar 4:2:2 Y/VU"),
841 A("NV61"),
842 B(VLC_CODEC_NV24, "Biplanar 4:4:4 Y/UV"),
843 A("NV24"),
844 B(VLC_CODEC_NV42, "Biplanar 4:4:4 Y/VU"),
845 A("NV42"),
847 B(VLC_CODEC_I420_9L, "Planar 4:2:0 YUV 9-bit LE"),
848 A("I09L"),
849 B(VLC_CODEC_I420_9B, "Planar 4:2:0 YUV 9-bit BE"),
850 A("I09B"),
851 B(VLC_CODEC_I422_9L, "Planar 4:2:2 YUV 9-bit LE"),
852 A("I29L"),
853 B(VLC_CODEC_I422_9B, "Planar 4:2:2 YUV 9-bit BE"),
854 A("I29B"),
855 B(VLC_CODEC_I444_9L, "Planar 4:4:4 YUV 9-bit LE"),
856 A("I49L"),
857 B(VLC_CODEC_I444_9B, "Planar 4:4:4 YUV 9-bit BE"),
858 A("I49B"),
860 B(VLC_CODEC_I420_10L, "Planar 4:2:0 YUV 10-bit LE"),
861 A("I0AL"),
862 B(VLC_CODEC_I420_10B, "Planar 4:2:0 YUV 10-bit BE"),
863 A("I0AB"),
864 B(VLC_CODEC_I422_10L, "Planar 4:2:2 YUV 10-bit LE"),
865 A("I2AL"),
866 B(VLC_CODEC_I422_10B, "Planar 4:2:2 YUV 10-bit BE"),
867 A("I2AB"),
868 B(VLC_CODEC_I444_10L, "Planar 4:4:4 YUV 10-bit LE"),
869 A("I4AL"),
870 B(VLC_CODEC_I444_10B, "Planar 4:4:4 YUV 10-bit BE"),
871 A("I4AB"),
873 B(VLC_CODEC_I444_16L, "Planar 4:4:4 YUV 16-bit LE"),
874 A("I4FL"),
875 B(VLC_CODEC_I444_16B, "Planar 4:4:4 YUV 16-bit BE"),
876 A("I4FB"),
879 /* XYZ color space */
880 B(VLC_CODEC_XYZ12, "Packed XYZ 12-bit BE"),
881 A("XY12"),
883 /* Videogames Codecs */
885 /* Interplay MVE */
886 B(VLC_CODEC_INTERPLAY, "Interplay MVE Video"),
887 A("imve"),
888 A("INPV"),
890 /* Id Quake II CIN */
891 B(VLC_CODEC_IDCIN, "Id Quake II CIN Video"),
892 A("IDCI"),
894 /* 4X Technologies */
895 B(VLC_CODEC_4XM, "4X Technologies Video"),
896 A("4XMV"),
897 A("4xmv"),
899 /* Id RoQ */
900 B(VLC_CODEC_ROQ, "Id RoQ Video"),
901 A("RoQv"),
903 /* Sony Playstation MDEC */
904 B(VLC_CODEC_MDEC, "PSX MDEC Video"),
905 A("MDEC"),
907 /* Sierra VMD */
908 B(VLC_CODEC_VMDVIDEO, "Sierra VMD Video"),
909 A("VMDV"),
910 A("vmdv"),
912 B(VLC_CODEC_DIRAC, "Dirac" ),
913 A("drac"),
915 /* Image */
916 B(VLC_CODEC_PNG, "PNG Image"),
917 A("png "),
919 B(VLC_CODEC_PPM, "PPM Image"),
920 A("ppm "),
922 B(VLC_CODEC_PGM, "PGM Image"),
923 A("pgm "),
925 B(VLC_CODEC_PGMYUV, "PGM YUV Image"),
926 A("pgmy"),
928 B(VLC_CODEC_PAM, "PAM Image"),
929 A("pam "),
931 B(VLC_CODEC_JPEGLS, "JPEG-LS"),
932 A("MJLS"),
934 B(VLC_CODEC_JPEG, "JPEG"),
935 A("jpeg"),
936 A("JPEG"),
938 B(VLC_CODEC_BMP, "BMP Image"),
939 A("bmp "),
941 B(VLC_CODEC_TIFF, "TIFF Image"),
942 A("tiff"),
944 B(VLC_CODEC_GIF, "GIF Image"),
945 A("gif "),
948 B(VLC_CODEC_TARGA, "Truevision Targa Image"),
949 A("tga "),
950 A("mtga"),
951 A("MTGA"),
953 B(VLC_CODEC_SGI, "SGI Image"),
954 A("sgi "),
956 B(VLC_CODEC_PNM, "Portable Anymap Image"),
957 A("pnm "),
959 B(VLC_CODEC_PCX, "Personal Computer Exchange Image"),
960 A("pcx "),
962 B(VLC_CODEC_XWD, "X Window system raster image"),
964 B(VLC_CODEC_JPEG2000, "JPEG 2000 Image"),
965 A("JP2K"),
966 A("mjp2"),
967 A("MJP2"),
968 A("MJ2C"),
969 A("LJ2C"),
970 A("LJ2K"),
972 B(VLC_CODEC_LAGARITH, "Lagarith Lossless"),
973 A("LAGS"),
975 B(VLC_CODEC_MXPEG, "Mxpeg"),
976 A("MXPG"),
978 B(VLC_CODEC_CDXL, "Commodore CDXL video format"),
979 A("CDXL"),
981 B(VLC_CODEC_BMVVIDEO, "Discworld II BMV video"),
982 A("BMVV"),
984 B(VLC_CODEC_UTVIDEO, "Ut Video"),
985 A("ULRA"),
986 A("ULRG"),
987 A("ULY0"),
988 A("ULY2"),
990 B(VLC_CODEC_VBLE, "VBLE Lossless"),
991 A("VBLE"),
993 B(VLC_CODEC_DXTORY, "Dxtory capture format"),
994 A("xtor"),
996 B(VLC_CODEC_MSS1, "Windows Media Video 7 Screen"),
997 A("MSS1"),
998 A("mss1"),
1000 B(VLC_CODEC_MSS2, "Windows Media Video 9 Screen"),
1001 A("MSS2"),
1002 A("mss2"),
1004 B(VLC_CODEC_MSA1, "Microsoft Application Screen Decoder 1"),
1005 A("MSA1"),
1007 B(VLC_CODEC_TSC2, "TechSmith Screen Codec 2"),
1008 A("MSA1"),
1009 A("tsc2"),
1011 B(VLC_CODEC_MTS2, "Microsoft Expression Encoder Screen"),
1012 A("MTS2"),
1014 B(VLC_CODEC_XAN_WC4, "Wing Commander IV Xan video"),
1015 A("Xxan"),
1017 B(VLC_CODEC_LCL_MSZH, "Loss-Less Codec Library AVImszh"),
1018 A("MSZH"),
1020 B(VLC_CODEC_LCL_ZLIB, "Loss-Less Codec Library AVIzlib"),
1021 A("ZLIB"),
1023 B(VLC_CODEC_THP, "GameCube THP video"),
1025 B(VLC_CODEC_TXD, "RenderWare TXD"),
1027 B(VLC_CODEC_ESCAPE124, "Escape 124 video"),
1029 B(VLC_CODEC_KGV1, "Kega Game Video (KGV1)"),
1030 A("KGV1"),
1032 B(VLC_CODEC_CLLC, "Canopus Lossless"),
1033 A("CLLC"),
1035 B(VLC_CODEC_AURA, "Auravision Aura"),
1036 A("AURA"),
1038 B(0, "")
1040 static const staticentry_t p_list_audio[] = {
1042 /* Windows Media Audio 1 */
1043 B(VLC_CODEC_WMA1, "Windows Media Audio 1"),
1044 A("WMA1"),
1045 A("wma1"),
1047 /* Windows Media Audio 2 */
1048 B(VLC_CODEC_WMA2, "Windows Media Audio 2"),
1049 A("WMA2"),
1050 A("wma2"),
1051 A("wma "),
1053 /* Windows Media Audio Professional */
1054 B(VLC_CODEC_WMAP, "Windows Media Audio Professional"),
1055 A("WMAP"),
1056 A("wmap"),
1058 /* Windows Media Audio Lossless */
1059 B(VLC_CODEC_WMAL, "Windows Media Audio Lossless"),
1060 A("WMAL"),
1061 A("wmal"),
1063 /* Windows Media Audio Speech */
1064 B(VLC_CODEC_WMAS, "Windows Media Audio Voice (Speech)"),
1065 A("WMAS"),
1066 A("wmas"),
1068 /* DV Audio */
1069 B(VLC_CODEC_DVAUDIO, "DV Audio"),
1070 A("dvau"),
1071 A("vdva"),
1072 A("dvca"),
1073 A("RADV"),
1075 /* MACE-3 Audio */
1076 B(VLC_CODEC_MACE3, "MACE-3 Audio"),
1077 A("MAC3"),
1079 /* MACE-6 Audio */
1080 B(VLC_CODEC_MACE6, "MACE-6 Audio"),
1081 A("MAC6"),
1083 /* MUSEPACK7 Audio */
1084 B(VLC_CODEC_MUSEPACK7, "MUSEPACK7 Audio"),
1085 A("MPC "),
1087 /* MUSEPACK8 Audio */
1088 B(VLC_CODEC_MUSEPACK8, "MUSEPACK8 Audio"),
1089 A("MPCK"),
1090 A("MPC8"),
1092 /* RealAudio 1.0 */
1093 B(VLC_CODEC_RA_144, "RealAudio 1.0"),
1094 A("14_4"),
1095 A("lpcJ"),
1097 /* RealAudio 2.0 */
1098 B(VLC_CODEC_RA_288, "RealAudio 2.0"),
1099 A("28_8"),
1101 B(VLC_CODEC_SIPR, "RealAudio Sipr"),
1102 A("sipr"),
1104 /* MPEG Audio layer 1/2 */
1105 B(VLC_CODEC_MPGA, "MPEG Audio layer 1/2"),
1106 A("mpga"),
1107 A("mp2a"),
1108 A(".mp1"),
1109 A(".mp2"),
1110 A("LAME"),
1111 A("ms\x00\x50"),
1112 A("ms\x00\x55"),
1114 /* MPEG Audio layer 3 */
1115 B(VLC_CODEC_MP3, "MPEG Audio layer 3"),
1116 A("mp3 "),
1117 A(".mp3"),
1118 A("MP3 "),
1120 /* A52 Audio (aka AC3) */
1121 B(VLC_CODEC_A52, "A52 Audio (aka AC3)"),
1122 A("a52 "),
1123 A("a52b"),
1124 A("ac-3"),
1125 A("sac3"),
1126 A("ms\x20\x00"),
1128 B(VLC_CODEC_EAC3, "A/52 B Audio (aka E-AC3)"),
1129 A("eac3"),
1131 /* DTS Audio */
1132 B(VLC_CODEC_DTS, "DTS Audio"),
1133 A("dts "),
1134 A("DTS "),
1135 A("dtsb"),
1136 A("dtsc"),
1137 E("dtse", "DTS Express"),
1138 E("dtsh", "DTS-HD High Resolution Audio"),
1139 E("dtsl", "DTS-HD Lossless"),
1140 A("ms\x20\x01"),
1142 /* AAC audio */
1143 B(VLC_CODEC_MP4A, "MPEG AAC Audio"),
1144 A("mp4a"),
1145 A("aac "),
1146 A("AACL"),
1147 A("AACH"),
1149 /* ALS audio */
1150 B(VLC_CODEC_ALS, "MPEG-4 Audio Lossless (ALS)"),
1151 A("als "),
1153 /* 4X Technologies */
1154 B(VLC_CODEC_ADPCM_4XM, "4X Technologies Audio"),
1155 A("4xma"),
1157 /* EA ADPCM */
1158 B(VLC_CODEC_ADPCM_EA, "EA ADPCM Audio"),
1159 A("ADEA"),
1161 /* Interplay DPCM */
1162 B(VLC_CODEC_INTERPLAY_DPCM, "Interplay DPCM Audio"),
1163 A("idpc"),
1165 /* Id RoQ */
1166 B(VLC_CODEC_ROQ_DPCM, "Id RoQ DPCM Audio"),
1167 A("RoQa"),
1169 /* DCIN Audio */
1170 B(VLC_CODEC_DSICINAUDIO, "Delphine CIN Audio"),
1171 A("DCIA"),
1173 /* Sony Playstation XA ADPCM */
1174 B(VLC_CODEC_ADPCM_XA, "PSX XA ADPCM Audio"),
1175 A("xa "),
1177 /* ADX ADPCM */
1178 B(VLC_CODEC_ADPCM_ADX, "ADX ADPCM Audio"),
1179 A("adx "),
1181 /* Westwood ADPCM */
1182 B(VLC_CODEC_ADPCM_IMA_WS, "Westwood IMA ADPCM audio"),
1183 A("AIWS"),
1185 /* MS ADPCM */
1186 B(VLC_CODEC_ADPCM_MS, "MS ADPCM audio"),
1187 A("ms\x00\x02"),
1189 /* Sierra VMD */
1190 B(VLC_CODEC_VMDAUDIO, "Sierra VMD Audio"),
1191 A("vmda"),
1193 /* G.726 ADPCM */
1194 B(VLC_CODEC_ADPCM_G726, "G.726 ADPCM Audio"),
1195 A("g726"),
1197 /* G.722 ADPCM */
1198 B(VLC_CODEC_ADPCM_G722, "G.722 ADPCM Audio"),
1199 A("g722"),
1201 /* Flash ADPCM */
1202 B(VLC_CODEC_ADPCM_SWF, "Flash ADPCM Audio"),
1203 A("SWFa"),
1205 B(VLC_CODEC_ADPCM_IMA_WAV, "IMA WAV ADPCM Audio"),
1206 A("ms\x00\x11"),
1208 B(VLC_CODEC_ADPCM_IMA_AMV, "IMA AMV ADPCM Audio"),
1209 A("imav"),
1211 B(VLC_CODEC_ADPCM_IMA_QT, "IMA QT ADPCM Audio"),
1212 A("ima4"),
1214 B(VLC_CODEC_ADPCM_YAMAHA, "Yamaha ADPCM Audio" ),
1215 A("ms\x00\x20"),
1217 B(VLC_CODEC_ADPCM_DK3, "Duck DK3 ADPCM"),
1218 A("ms\x00\x62"),
1220 B(VLC_CODEC_ADPCM_DK4, "Duck DK4 ADPCM"),
1221 A("ms\x00\x61"),
1223 B(VLC_CODEC_ADPCM_THP, "GameCube THP ADPCM"),
1225 /* AMR */
1226 B(VLC_CODEC_AMR_NB, "AMR narrow band"),
1227 A("samr"),
1229 B(VLC_CODEC_AMR_WB, "AMR wide band"),
1230 A("sawb"),
1232 /* FLAC */
1233 B(VLC_CODEC_FLAC, "FLAC (Free Lossless Audio Codec)"),
1234 A("flac"),
1236 /* ALAC */
1237 B(VLC_CODEC_ALAC, "Apple Lossless Audio Codec"),
1238 A("alac"),
1240 /* QDM2 */
1241 B(VLC_CODEC_QDM2, "QDM2 Audio"),
1242 A("QDM2"),
1244 /* COOK */
1245 B(VLC_CODEC_COOK, "Cook Audio"),
1246 A("cook"),
1248 /* TTA: The Lossless True Audio */
1249 B(VLC_CODEC_TTA, "The Lossless True Audio"),
1250 A("TTA1"),
1252 /* Shorten */
1253 B(VLC_CODEC_SHORTEN, "Shorten Lossless Audio"),
1254 A("shn "),
1255 A("shrn"),
1257 B(VLC_CODEC_WAVPACK, "WavPack"),
1258 A("WVPK"),
1259 A("wvpk"),
1261 B(VLC_CODEC_GSM, "GSM Audio"),
1262 A("gsm "),
1264 B(VLC_CODEC_GSM_MS, "Microsoft GSM Audio"),
1265 A("agsm"),
1267 B(VLC_CODEC_ATRAC1, "atrac 1"),
1268 A("atr1"),
1270 B(VLC_CODEC_ATRAC3, "atrac 3"),
1271 A("atrc"),
1272 A("\x70\x02\x00\x00"),
1274 B(VLC_CODEC_ATRAC3P, "atrac 3+"),
1275 A("atrp"),
1277 B(VLC_CODEC_IMC, "IMC" ),
1278 A("\x01\x04\x00\x00"),
1280 B(VLC_CODEC_TRUESPEECH,"TrueSpeech"),
1281 A("\x22\x00\x00\x00"),
1283 B(VLC_CODEC_NELLYMOSER, "NellyMoser ASAO"),
1284 A("NELL"),
1285 A("nmos"),
1287 B(VLC_CODEC_APE, "Monkey's Audio"),
1288 A("APE "),
1290 B(VLC_CODEC_MLP, "MLP/TrueHD Audio"),
1291 A("mlp "),
1293 B(VLC_CODEC_TRUEHD, "TrueHD Audio"),
1294 A("trhd"),
1296 B(VLC_CODEC_QCELP, "QCELP Audio"),
1297 A("Qclp"),
1298 A("Qclq"),
1299 A("sqcp"),
1301 B(VLC_CODEC_SPEEX, "Speex Audio"),
1302 A("spx "),
1303 A("spxr"),
1305 B(VLC_CODEC_VORBIS, "Vorbis Audio"),
1306 A("vorb"),
1307 A("vor1"),
1309 B(VLC_CODEC_OPUS, "Opus Audio"),
1310 A("Opus"),
1311 A("opus"),
1313 B(VLC_CODEC_302M, "302M Audio"),
1314 A("302m"),
1316 B(VLC_CODEC_DVD_LPCM, "DVD LPCM Audio"),
1317 A("lpcm"),
1319 B(VLC_CODEC_DVDA_LPCM, "DVD-Audio LPCM Audio"),
1320 A("apcm"),
1322 B(VLC_CODEC_BD_LPCM, "BD LPCM Audio"),
1323 A("bpcm"),
1325 B(VLC_CODEC_SDDS, "SDDS Audio"),
1326 A("sdds"),
1327 A("sddb"),
1329 B(VLC_CODEC_MIDI, "MIDI Audio"),
1330 A("MIDI"),
1332 B(VLC_CODEC_RALF, "RealAudio Lossless"),
1333 A("LSD:"),
1335 /* G.723.1 */
1336 B(VLC_CODEC_G723_1, "G.723.1 Audio"),
1337 A("g72\x31"),
1339 /* PCM */
1340 B(VLC_CODEC_S8, "PCM S8"),
1341 A("s8 "),
1343 B(VLC_CODEC_U8, "PCM U8"),
1344 A("u8 "),
1346 B(VLC_CODEC_S16L, "PCM S16 LE"),
1347 A("s16l"),
1349 B(VLC_CODEC_S16B, "PCM S16 BE"),
1350 A("s16b"),
1352 B(VLC_CODEC_U16L, "PCM U16 LE"),
1353 A("u16l"),
1355 B(VLC_CODEC_U16B, "PCM U16 BE"),
1356 A("u16b"),
1358 B(VLC_CODEC_S20B, "PCM S20 BE"),
1360 B(VLC_CODEC_S24L, "PCM S24 LE"),
1361 A("s24l"),
1362 A("42ni"), /* Quicktime */
1364 B(VLC_CODEC_S24B, "PCM S24 BE"),
1365 A("s24b"),
1366 A("in24"), /* Quicktime */
1368 B(VLC_CODEC_U24L, "PCM U24 LE"),
1369 A("u24l"),
1371 B(VLC_CODEC_U24B, "PCM U24 BE"),
1372 A("u24b"),
1374 B(VLC_CODEC_S24L32, "PCM S24 in 32 LE"),
1376 B(VLC_CODEC_S24B32, "PCM S24 in 32 BE"),
1378 B(VLC_CODEC_S32L, "PCM S32 LE"),
1379 A("s32l"),
1380 A("23ni"), /* Quicktime */
1382 B(VLC_CODEC_S32B, "PCM S32 BE"),
1383 A("s32b"),
1384 A("in32"), /* Quicktime */
1386 B(VLC_CODEC_U32L, "PCM U32 LE"),
1387 A("u32l"),
1389 B(VLC_CODEC_U32B, "PCM U32 BE"),
1390 A("u32b"),
1392 B(VLC_CODEC_ALAW, "PCM ALAW"),
1393 A("alaw"),
1395 B(VLC_CODEC_MULAW, "PCM MU-LAW"),
1396 A("mlaw"),
1397 A("ulaw"),
1399 B(VLC_CODEC_DAT12, "12 bits DAT audio"),
1401 B(VLC_CODEC_S24DAUD, "PCM DAUD"),
1402 A("daud"),
1404 B(VLC_CODEC_F32L, "32 bits float LE"),
1405 A("f32l"),
1406 A("fl32"),
1408 B(VLC_CODEC_F32B, "32 bits float BE"),
1409 A("f32b"),
1411 B(VLC_CODEC_F64L, "64 bits float LE"),
1412 A("f64l"),
1414 B(VLC_CODEC_F64L, "64 bits float BE"),
1415 A("f64b"),
1417 B(VLC_CODEC_TWINVQ, "TwinVQ"),
1418 A("TWIN"),
1420 B(VLC_CODEC_BMVAUDIO, "Discworld II BMV audio"),
1421 A("BMVA"),
1423 B(VLC_CODEC_ULEAD_DV_AUDIO_NTSC, "Ulead DV audio NTSC"),
1424 A("ms\x02\x15"),
1425 B(VLC_CODEC_ULEAD_DV_AUDIO_PAL, "Ulead DV audio PAL"),
1426 A("ms\x02\x16"),
1428 B(VLC_CODEC_INDEO_AUDIO, "Indeo Audio Coder"),
1429 A("ms\x04\x02"),
1431 B(0, "")
1433 static const staticentry_t p_list_spu[] = {
1435 B(VLC_CODEC_SPU, "DVD Subtitles"),
1436 A("spu "),
1437 A("spub"),
1439 B(VLC_CODEC_DVBS, "DVB Subtitles"),
1440 A("dvbs"),
1442 B(VLC_CODEC_SUBT, "Text subtitles with various tags"),
1443 A("subt"),
1445 B(VLC_CODEC_XSUB, "DivX XSUB subtitles"),
1446 A("XSUB"),
1447 A("xsub"),
1448 A("DXSB"),
1450 B(VLC_CODEC_SSA, "SubStation Alpha subtitles"),
1451 A("ssa "),
1453 B(VLC_CODEC_TEXT, "Plain text subtitles"),
1454 A("TEXT"),
1456 B(VLC_CODEC_TELETEXT, "Teletext"),
1457 A("telx"),
1459 B(VLC_CODEC_KATE, "Kate subtitles"),
1460 A("kate"),
1462 B(VLC_CODEC_CMML, "CMML annotations/metadata"),
1463 A("cmml"),
1465 B(VLC_CODEC_ITU_T140, "ITU T.140 subtitles"),
1466 A("t140"),
1468 B(VLC_CODEC_USF, "USF subtitles"),
1469 A("usf "),
1471 B(VLC_CODEC_OGT, "OGT subtitles"),
1472 A("ogt "),
1474 B(VLC_CODEC_CVD, "CVD subtitles"),
1475 A("cvd "),
1477 B(VLC_CODEC_BD_PG, "BD subtitles"),
1478 A("bdpg"),
1480 B(VLC_CODEC_EBU_STL, "EBU STL subtitles"),
1481 A("STL "),
1483 B(VLC_CODEC_SCTE_27, "SCTE-27 subtitles"),
1484 A("SC27"),
1486 B(0, "")
1489 /* Create a fourcc from a string.
1490 * XXX it assumes that the string is at least four bytes */
1491 static inline vlc_fourcc_t CreateFourcc( const char *psz_fourcc )
1493 return VLC_FOURCC( psz_fourcc[0], psz_fourcc[1],
1494 psz_fourcc[2], psz_fourcc[3] );
1497 /* */
1498 static entry_t Lookup( const staticentry_t p_list[], vlc_fourcc_t i_fourcc )
1500 const char *p_class = NULL;
1501 const char *psz_description = NULL;
1503 entry_t e = B(0, "");
1505 for( int i = 0; ; i++ )
1507 const staticentry_t *p = &p_list[i];
1508 const vlc_fourcc_t i_entry_fourcc = CreateFourcc( p->p_fourcc );
1509 const vlc_fourcc_t i_entry_class = CreateFourcc( p->p_class );
1511 if( i_entry_fourcc == 0 )
1512 break;
1514 if( i_entry_class != 0 )
1516 p_class = p->p_class;
1517 psz_description = p->psz_description;
1520 if( i_entry_fourcc == i_fourcc )
1522 assert( p_class != NULL );
1524 memcpy( e.p_class, p_class, 4 );
1525 memcpy( e.p_fourcc, p->p_fourcc, 4 );
1526 e.psz_description = p->psz_description[0] != '\0' ?
1527 p->psz_description : psz_description;
1528 break;
1531 return e;
1534 /* */
1535 static entry_t Find( int i_cat, vlc_fourcc_t i_fourcc )
1537 entry_t e;
1539 switch( i_cat )
1541 case VIDEO_ES:
1542 return Lookup( p_list_video, i_fourcc );
1543 case AUDIO_ES:
1544 return Lookup( p_list_audio, i_fourcc );
1545 case SPU_ES:
1546 return Lookup( p_list_spu, i_fourcc );
1548 default:
1549 e = Find( VIDEO_ES, i_fourcc );
1550 if( CreateFourcc( e.p_class ) == 0 )
1551 e = Find( AUDIO_ES, i_fourcc );
1552 if( CreateFourcc( e.p_class ) == 0 )
1553 e = Find( SPU_ES, i_fourcc );
1554 return e;
1558 /* */
1559 vlc_fourcc_t vlc_fourcc_GetCodec( int i_cat, vlc_fourcc_t i_fourcc )
1561 entry_t e = Find( i_cat, i_fourcc );
1563 if( CreateFourcc( e.p_class ) == 0 )
1564 return i_fourcc;
1565 return CreateFourcc( e.p_class );
1568 vlc_fourcc_t vlc_fourcc_GetCodecFromString( int i_cat, const char *psz_fourcc )
1570 if( !psz_fourcc || strlen(psz_fourcc) != 4 )
1571 return 0;
1572 return vlc_fourcc_GetCodec( i_cat,
1573 VLC_FOURCC( psz_fourcc[0], psz_fourcc[1],
1574 psz_fourcc[2], psz_fourcc[3] ) );
1577 vlc_fourcc_t vlc_fourcc_GetCodecAudio( vlc_fourcc_t i_fourcc, int i_bits )
1579 const int i_bytes = ( i_bits + 7 ) / 8;
1581 if( i_fourcc == VLC_FOURCC( 'a', 'f', 'l', 't' ) )
1583 switch( i_bytes )
1585 case 4:
1586 return VLC_CODEC_FL32;
1587 case 8:
1588 return VLC_CODEC_FL64;
1589 default:
1590 return 0;
1593 else if( i_fourcc == VLC_FOURCC( 'a', 'r', 'a', 'w' ) )
1595 switch( i_bytes )
1597 case 1:
1598 return VLC_CODEC_U8;
1599 case 2:
1600 return VLC_CODEC_S16L;
1601 case 3:
1602 return VLC_CODEC_S24L;
1603 break;
1604 case 4:
1605 return VLC_CODEC_S32L;
1606 default:
1607 return 0;
1610 else if( i_fourcc == VLC_FOURCC( 't', 'w', 'o', 's' ) )
1612 switch( i_bytes )
1614 case 1:
1615 return VLC_CODEC_S8;
1616 case 2:
1617 return VLC_CODEC_S16B;
1618 case 3:
1619 return VLC_CODEC_S24B;
1620 case 4:
1621 return VLC_CODEC_S32B;
1622 default:
1623 return 0;
1626 else if( i_fourcc == VLC_FOURCC( 's', 'o', 'w', 't' ) )
1628 switch( i_bytes )
1630 case 1:
1631 return VLC_CODEC_S8;
1632 case 2:
1633 return VLC_CODEC_S16L;
1634 case 3:
1635 return VLC_CODEC_S24L;
1636 case 4:
1637 return VLC_CODEC_S32L;
1638 default:
1639 return 0;
1642 else
1644 return vlc_fourcc_GetCodec( AUDIO_ES, i_fourcc );
1648 /* */
1649 const char *vlc_fourcc_GetDescription( int i_cat, vlc_fourcc_t i_fourcc )
1651 entry_t e = Find( i_cat, i_fourcc );
1653 return e.psz_description;
1657 /* */
1658 #define VLC_CODEC_YUV_PLANAR_410 \
1659 VLC_CODEC_I410, VLC_CODEC_YV9
1661 #define VLC_CODEC_YUV_PLANAR_420 \
1662 VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420
1664 #define VLC_CODEC_YUV_SEMIPLANAR_420 \
1665 VLC_CODEC_NV12, VLC_CODEC_NV21
1667 #define VLC_CODEC_YUV_PLANAR_420_16 \
1668 VLC_CODEC_I420_10L, VLC_CODEC_I420_10B, VLC_CODEC_I420_9L, VLC_CODEC_I420_9B
1670 #define VLC_CODEC_YUV_PLANAR_422 \
1671 VLC_CODEC_I422, VLC_CODEC_J422
1673 #define VLC_CODEC_YUV_SEMIPLANAR_422 \
1674 VLC_CODEC_NV16, VLC_CODEC_NV61
1676 #define VLC_CODEC_YUV_PLANAR_422_16 \
1677 VLC_CODEC_I422_10L, VLC_CODEC_I422_10B, VLC_CODEC_I422_9L, VLC_CODEC_I422_9B
1679 #define VLC_CODEC_YUV_PLANAR_440 \
1680 VLC_CODEC_I440, VLC_CODEC_J440
1682 #define VLC_CODEC_YUV_PLANAR_444 \
1683 VLC_CODEC_I444, VLC_CODEC_J444
1685 #define VLC_CODEC_YUV_SEMIPLANAR_444 \
1686 VLC_CODEC_NV24, VLC_CODEC_NV42
1688 #define VLC_CODEC_YUV_PLANAR_444_16 \
1689 VLC_CODEC_I444_10L, VLC_CODEC_I444_10B, VLC_CODEC_I444_9L, VLC_CODEC_I444_9B, \
1690 VLC_CODEC_I444_16L, VLC_CODEC_I444_16B
1692 #define VLC_CODEC_YUV_PACKED \
1693 VLC_CODEC_YUYV, VLC_CODEC_YVYU, \
1694 VLC_CODEC_UYVY, VLC_CODEC_VYUY
1696 #define VLC_CODEC_FALLBACK_420 \
1697 VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PACKED, \
1698 VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
1699 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1701 static const vlc_fourcc_t p_I420_fallback[] = {
1702 VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420, 0
1704 static const vlc_fourcc_t p_J420_fallback[] = {
1705 VLC_CODEC_J420, VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_FALLBACK_420, 0
1707 static const vlc_fourcc_t p_YV12_fallback[] = {
1708 VLC_CODEC_YV12, VLC_CODEC_I420, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420, 0
1711 #define VLC_CODEC_FALLBACK_420_16 \
1712 VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420
1714 static const vlc_fourcc_t p_I420_9L_fallback[] = {
1715 VLC_CODEC_I420_9L, VLC_CODEC_I420_9B, VLC_CODEC_FALLBACK_420_16, 0
1717 static const vlc_fourcc_t p_I420_9B_fallback[] = {
1718 VLC_CODEC_I420_9B, VLC_CODEC_I420_9L, VLC_CODEC_FALLBACK_420_16, 0
1720 static const vlc_fourcc_t p_I420_10L_fallback[] = {
1721 VLC_CODEC_I420_10L, VLC_CODEC_I420_10B, VLC_CODEC_FALLBACK_420_16, 0
1723 static const vlc_fourcc_t p_I420_10B_fallback[] = {
1724 VLC_CODEC_I420_10B, VLC_CODEC_I420_10L, VLC_CODEC_FALLBACK_420_16, 0
1727 #define VLC_CODEC_FALLBACK_422 \
1728 VLC_CODEC_YUV_PACKED, VLC_CODEC_YUV_PLANAR_420, \
1729 VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
1730 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1732 static const vlc_fourcc_t p_I422_fallback[] = {
1733 VLC_CODEC_I422, VLC_CODEC_J422, VLC_CODEC_FALLBACK_422, 0
1735 static const vlc_fourcc_t p_J422_fallback[] = {
1736 VLC_CODEC_J422, VLC_CODEC_I422, VLC_CODEC_FALLBACK_422, 0
1739 #define VLC_CODEC_FALLBACK_422_16 \
1740 VLC_CODEC_I422, VLC_CODEC_J422, VLC_CODEC_FALLBACK_422
1742 static const vlc_fourcc_t p_I422_9L_fallback[] = {
1743 VLC_CODEC_I422_9L, VLC_CODEC_I422_9B, VLC_CODEC_FALLBACK_422_16, 0
1745 static const vlc_fourcc_t p_I422_9B_fallback[] = {
1746 VLC_CODEC_I422_9B, VLC_CODEC_I422_9L, VLC_CODEC_FALLBACK_422_16, 0
1748 static const vlc_fourcc_t p_I422_10L_fallback[] = {
1749 VLC_CODEC_I422_10L, VLC_CODEC_I422_10B, VLC_CODEC_FALLBACK_422_16, 0
1751 static const vlc_fourcc_t p_I422_10B_fallback[] = {
1752 VLC_CODEC_I422_10B, VLC_CODEC_I422_10L, VLC_CODEC_FALLBACK_422_16, 0
1755 #define VLC_CODEC_FALLBACK_444 \
1756 VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PACKED, \
1757 VLC_CODEC_YUV_PLANAR_420, VLC_CODEC_YUV_PLANAR_440, \
1758 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1760 static const vlc_fourcc_t p_I444_fallback[] = {
1761 VLC_CODEC_I444, VLC_CODEC_J444, VLC_CODEC_FALLBACK_444, 0
1763 static const vlc_fourcc_t p_J444_fallback[] = {
1764 VLC_CODEC_J444, VLC_CODEC_I444, VLC_CODEC_FALLBACK_444, 0
1767 #define VLC_CODEC_FALLBACK_444_16 \
1768 VLC_CODEC_I444, VLC_CODEC_J444, VLC_CODEC_FALLBACK_444
1770 static const vlc_fourcc_t p_I444_9L_fallback[] = {
1771 VLC_CODEC_I444_9L, VLC_CODEC_I444_9B, VLC_CODEC_FALLBACK_444_16, 0
1773 static const vlc_fourcc_t p_I444_9B_fallback[] = {
1774 VLC_CODEC_I444_9B, VLC_CODEC_I444_9L, VLC_CODEC_FALLBACK_444_16, 0
1776 static const vlc_fourcc_t p_I444_10L_fallback[] = {
1777 VLC_CODEC_I444_10L, VLC_CODEC_I444_10B, VLC_CODEC_FALLBACK_444_16, 0
1779 static const vlc_fourcc_t p_I444_10B_fallback[] = {
1780 VLC_CODEC_I444_10B, VLC_CODEC_I444_10L, VLC_CODEC_FALLBACK_444_16, 0
1782 static const vlc_fourcc_t p_I444_16L_fallback[] = {
1783 VLC_CODEC_I444_16L, VLC_CODEC_I444_16B, VLC_CODEC_FALLBACK_444_16, 0
1785 static const vlc_fourcc_t p_I444_16B_fallback[] = {
1786 VLC_CODEC_I444_16B, VLC_CODEC_I444_16L, VLC_CODEC_FALLBACK_444_16, 0
1790 static const vlc_fourcc_t p_I440_fallback[] = {
1791 VLC_CODEC_I440,
1792 VLC_CODEC_YUV_PLANAR_420,
1793 VLC_CODEC_YUV_PLANAR_422,
1794 VLC_CODEC_YUV_PLANAR_444,
1795 VLC_CODEC_YUV_PACKED,
1796 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211, 0
1799 #define VLC_CODEC_FALLBACK_PACKED \
1800 VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PLANAR_420, \
1801 VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
1802 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1804 static const vlc_fourcc_t p_YUYV_fallback[] = {
1805 VLC_CODEC_YUYV,
1806 VLC_CODEC_YVYU,
1807 VLC_CODEC_UYVY,
1808 VLC_CODEC_VYUY,
1809 VLC_CODEC_FALLBACK_PACKED, 0
1811 static const vlc_fourcc_t p_YVYU_fallback[] = {
1812 VLC_CODEC_YVYU,
1813 VLC_CODEC_YUYV,
1814 VLC_CODEC_UYVY,
1815 VLC_CODEC_VYUY,
1816 VLC_CODEC_FALLBACK_PACKED, 0
1818 static const vlc_fourcc_t p_UYVY_fallback[] = {
1819 VLC_CODEC_UYVY,
1820 VLC_CODEC_VYUY,
1821 VLC_CODEC_YUYV,
1822 VLC_CODEC_YVYU,
1823 VLC_CODEC_FALLBACK_PACKED, 0
1825 static const vlc_fourcc_t p_VYUY_fallback[] = {
1826 VLC_CODEC_VYUY,
1827 VLC_CODEC_UYVY,
1828 VLC_CODEC_YUYV,
1829 VLC_CODEC_YVYU,
1830 VLC_CODEC_FALLBACK_PACKED, 0
1833 static const vlc_fourcc_t *pp_YUV_fallback[] = {
1834 p_YV12_fallback,
1835 p_I420_fallback,
1836 p_I420_9L_fallback,
1837 p_I420_9B_fallback,
1838 p_I420_10L_fallback,
1839 p_I420_10B_fallback,
1840 p_J420_fallback,
1841 p_I422_fallback,
1842 p_I422_9L_fallback,
1843 p_I422_9B_fallback,
1844 p_I422_10L_fallback,
1845 p_I422_10B_fallback,
1846 p_J422_fallback,
1847 p_I444_fallback,
1848 p_J444_fallback,
1849 p_I444_9L_fallback,
1850 p_I444_9B_fallback,
1851 p_I444_10L_fallback,
1852 p_I444_10B_fallback,
1853 p_I444_16L_fallback,
1854 p_I444_16B_fallback,
1855 p_I440_fallback,
1856 p_YUYV_fallback,
1857 p_YVYU_fallback,
1858 p_UYVY_fallback,
1859 p_VYUY_fallback,
1862 NULL,
1865 static const vlc_fourcc_t p_list_YUV[] = {
1866 VLC_CODEC_YUV_PLANAR_420,
1867 VLC_CODEC_YUV_SEMIPLANAR_420,
1868 VLC_CODEC_YUV_PLANAR_422,
1869 VLC_CODEC_YUV_SEMIPLANAR_422,
1870 VLC_CODEC_YUV_PLANAR_440,
1871 VLC_CODEC_YUV_PLANAR_444,
1872 VLC_CODEC_YUV_SEMIPLANAR_444,
1873 VLC_CODEC_YUV_PACKED,
1874 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211,
1875 VLC_CODEC_YUV_PLANAR_420_16,
1876 VLC_CODEC_YUV_PLANAR_422_16,
1877 VLC_CODEC_YUV_PLANAR_444_16,
1878 VLC_CODEC_VDPAU_VIDEO_420,
1879 VLC_CODEC_VDPAU_VIDEO_422,
1880 VLC_CODEC_VDPAU_VIDEO_444,
1884 /* */
1885 static const vlc_fourcc_t p_RGB32_fallback[] = {
1886 VLC_CODEC_RGB32,
1887 VLC_CODEC_RGB24,
1888 VLC_CODEC_RGB16,
1889 VLC_CODEC_RGB15,
1890 VLC_CODEC_RGB8,
1893 static const vlc_fourcc_t p_RGB24_fallback[] = {
1894 VLC_CODEC_RGB24,
1895 VLC_CODEC_RGB32,
1896 VLC_CODEC_RGB16,
1897 VLC_CODEC_RGB15,
1898 VLC_CODEC_RGB8,
1901 static const vlc_fourcc_t p_RGB16_fallback[] = {
1902 VLC_CODEC_RGB16,
1903 VLC_CODEC_RGB24,
1904 VLC_CODEC_RGB32,
1905 VLC_CODEC_RGB15,
1906 VLC_CODEC_RGB8,
1909 static const vlc_fourcc_t p_RGB15_fallback[] = {
1910 VLC_CODEC_RGB15,
1911 VLC_CODEC_RGB16,
1912 VLC_CODEC_RGB24,
1913 VLC_CODEC_RGB32,
1914 VLC_CODEC_RGB8,
1917 static const vlc_fourcc_t p_RGB8_fallback[] = {
1918 VLC_CODEC_RGB8,
1919 VLC_CODEC_RGB15,
1920 VLC_CODEC_RGB16,
1921 VLC_CODEC_RGB24,
1922 VLC_CODEC_RGB32,
1925 static const vlc_fourcc_t *pp_RGB_fallback[] = {
1926 p_RGB32_fallback,
1927 p_RGB24_fallback,
1928 p_RGB16_fallback,
1929 p_RGB15_fallback,
1930 p_RGB8_fallback,
1931 NULL,
1935 /* */
1936 static const vlc_fourcc_t *GetFallback( vlc_fourcc_t i_fourcc,
1937 const vlc_fourcc_t *pp_fallback[],
1938 const vlc_fourcc_t p_list[] )
1940 for( unsigned i = 0; pp_fallback[i]; i++ )
1942 if( pp_fallback[i][0] == i_fourcc )
1943 return pp_fallback[i];
1945 return p_list;
1948 const vlc_fourcc_t *vlc_fourcc_GetYUVFallback( vlc_fourcc_t i_fourcc )
1950 return GetFallback( i_fourcc, pp_YUV_fallback, p_list_YUV );
1952 const vlc_fourcc_t *vlc_fourcc_GetRGBFallback( vlc_fourcc_t i_fourcc )
1954 return GetFallback( i_fourcc, pp_RGB_fallback, p_RGB32_fallback );
1957 bool vlc_fourcc_AreUVPlanesSwapped( vlc_fourcc_t a, vlc_fourcc_t b )
1959 static const vlc_fourcc_t pp_swapped[][4] = {
1960 { VLC_CODEC_YV12, VLC_CODEC_I420, VLC_CODEC_J420, 0 },
1961 { VLC_CODEC_YV9, VLC_CODEC_I410, 0 },
1962 { 0 }
1965 for( int i = 0; pp_swapped[i][0]; i++ )
1967 if( pp_swapped[i][0] == b )
1969 vlc_fourcc_t t = a;
1970 a = b;
1971 b = t;
1973 if( pp_swapped[i][0] != a )
1974 continue;
1975 for( int j = 1; pp_swapped[i][j]; j++ )
1977 if( pp_swapped[i][j] == b )
1978 return true;
1981 return false;
1984 bool vlc_fourcc_IsYUV(vlc_fourcc_t fcc)
1986 for( unsigned i = 0; p_list_YUV[i]; i++ )
1988 if( p_list_YUV[i] == fcc )
1989 return true;
1991 return false;
1994 #define PLANAR(n, w_den, h_den, size, bits) \
1995 { .plane_count = n, \
1996 .p = { {.w = {1, 1}, .h = {1, 1}}, \
1997 {.w = {1,w_den}, .h = {1,h_den}}, \
1998 {.w = {1,w_den}, .h = {1,h_den}}, \
1999 {.w = {1, 1}, .h = {1, 1}} }, \
2000 .pixel_size = size, \
2001 .pixel_bits = bits }
2003 #define PLANAR_8(n, w_den, h_den) PLANAR(n, w_den, h_den, 1, 8)
2004 #define PLANAR_16(n, w_den, h_den, bits) PLANAR(n, w_den, h_den, 2, bits)
2006 #define PACKED_FMT(size, bits) \
2007 { .plane_count = 1, \
2008 .p = { {.w = {1,1}, .h = {1,1}} }, \
2009 .pixel_size = size, \
2010 .pixel_bits = bits }
2012 /* Zero planes for hardware picture handles. Cannot be manipulated directly. */
2013 #define FAKE_FMT() \
2014 { .plane_count = 0, \
2015 .p = { {.w = {1,1}, .h = {1,1}} }, \
2016 .pixel_size = 0, \
2017 .pixel_bits = 0 }
2019 static const struct
2021 vlc_fourcc_t p_fourcc[6];
2022 vlc_chroma_description_t description;
2023 } p_list_chroma_description[] = {
2024 { { VLC_CODEC_I411, 0 }, PLANAR_8(3, 4, 1) },
2025 { { VLC_CODEC_YUV_PLANAR_410, 0 }, PLANAR_8(3, 4, 4) },
2026 { { VLC_CODEC_YUV_PLANAR_420, 0 }, PLANAR_8(3, 2, 2) },
2027 { { VLC_CODEC_NV12, VLC_CODEC_NV21, 0 }, PLANAR_8(2, 1, 2) },
2028 { { VLC_CODEC_YUV_PLANAR_422, 0 }, PLANAR_8(3, 2, 1) },
2029 { { VLC_CODEC_NV16, VLC_CODEC_NV61, 0 }, PLANAR_8(2, 1, 1) },
2030 { { VLC_CODEC_YUV_PLANAR_440, 0 }, PLANAR_8(3, 1, 2) },
2031 { { VLC_CODEC_YUV_PLANAR_444, 0 }, PLANAR_8(3, 1, 1) },
2032 { { VLC_CODEC_YUVA, 0 }, PLANAR_8(4, 1, 1) },
2033 { { VLC_CODEC_YUV420A, 0 }, PLANAR_8(4, 2, 2) },
2034 { { VLC_CODEC_YUV422A, 0 }, PLANAR_8(4, 2, 1) },
2036 { { VLC_CODEC_GBR_PLANAR, 0 }, PLANAR_8(3, 1, 1) },
2038 { { VLC_CODEC_I420_10L,
2039 VLC_CODEC_I420_10B, 0 }, PLANAR_16(3, 2, 2, 10) },
2040 { { VLC_CODEC_I420_9L,
2041 VLC_CODEC_I420_9B, 0 }, PLANAR_16(3, 2, 2, 9) },
2042 { { VLC_CODEC_I422_10L,
2043 VLC_CODEC_I422_10B, 0 }, PLANAR_16(3, 2, 1, 10) },
2044 { { VLC_CODEC_I422_9L,
2045 VLC_CODEC_I422_9B, 0 }, PLANAR_16(3, 2, 1, 9) },
2046 { { VLC_CODEC_I444_10L,
2047 VLC_CODEC_I444_10B, 0 }, PLANAR_16(3, 1, 1, 10) },
2048 { { VLC_CODEC_I444_9L,
2049 VLC_CODEC_I444_9B, 0 }, PLANAR_16(3, 1, 1, 9) },
2050 { { VLC_CODEC_I444_16L,
2051 VLC_CODEC_I444_16B, 0 }, PLANAR_16(3, 1, 1, 16) },
2053 { { VLC_CODEC_YUV_PACKED, 0 }, PACKED_FMT(2, 16) },
2054 { { VLC_CODEC_RGB8, VLC_CODEC_GREY,
2055 VLC_CODEC_YUVP, VLC_CODEC_RGBP, 0 }, PACKED_FMT(1, 8) },
2057 { { VLC_CODEC_RGB15, 0 }, PACKED_FMT(2, 15) },
2058 { { VLC_CODEC_RGB12, 0 }, PACKED_FMT(2, 12) },
2059 { { VLC_CODEC_RGB16, VLC_CODEC_RGBT,
2060 VLC_CODEC_RGBA16, 0 }, PACKED_FMT(2, 16) },
2061 { { VLC_CODEC_RGB24, 0 }, PACKED_FMT(3, 24) },
2062 { { VLC_CODEC_RGB32, 0 }, PACKED_FMT(4, 24) },
2063 { { VLC_CODEC_RGBA, VLC_CODEC_ARGB, 0 }, PACKED_FMT(4, 32) },
2065 { { VLC_CODEC_Y211, 0 }, { 1, { {{1,4}, {1,1}} }, 4, 32 } },
2066 { { VLC_CODEC_XYZ12, 0 }, PACKED_FMT(6, 48) },
2068 { { VLC_CODEC_VDPAU_VIDEO_420, VLC_CODEC_VDPAU_VIDEO_422,
2069 VLC_CODEC_VDPAU_VIDEO_444,
2070 VLC_CODEC_VDPAU_OUTPUT,
2071 VLC_CODEC_ANDROID_OPAQUE, 0 }, FAKE_FMT() },
2073 { {0}, { 0, { 0 }, 0, 0 } }
2076 #undef PACKED_FMT
2077 #undef PLANAR_16
2078 #undef PLANAR_8
2079 #undef PLANAR
2081 const vlc_chroma_description_t *vlc_fourcc_GetChromaDescription( vlc_fourcc_t i_fourcc )
2083 for( unsigned i = 0; p_list_chroma_description[i].p_fourcc[0]; i++ )
2085 const vlc_fourcc_t *p_fourcc = p_list_chroma_description[i].p_fourcc;
2086 for( unsigned j = 0; p_fourcc[j]; j++ )
2088 if( p_fourcc[j] == i_fourcc )
2089 return &p_list_chroma_description[i].description;
2092 return NULL;