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 /*****************************************************************************
26 *****************************************************************************/
31 #include <vlc_common.h>
32 #include <vlc_fourcc.h>
41 char psz_description[56];
48 const char *psz_description;
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 }
57 # define FCC2STR(f) { ((f)>>0)&0xff, ((f)>>8)&0xff, ((f)>>16)&0xff, ((f)>>24)&0xff }
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)
68 static const staticentry_t p_list_video[] = {
70 B(VLC_CODEC_MP1V, "MPEG-1 Video"),
74 E("XMPG", "Xing MPEG-1 Intra"),
76 B(VLC_CODEC_MPGV, "MPEG-1/2 Video"),
77 B(VLC_CODEC_MP2V, "MPEG-2 Video"),
86 E("PIM1", "Pinnacle DC1000 (MPEG-1 Video)"),
88 E("hdv1", "HDV 720p30 (MPEG-2 Video)"),
89 E("hdv2", "Sony HDV 1080i60 (MPEG-2 Video)"),
90 E("hdv3", "FCP HDV 1080i50 (MPEG-2 Video)"),
91 E("hdv4", "HDV 720p24 (MPEG-2 Video)"),
92 E("hdv5", "HDV 720p25 (MPEG-2 Video)"),
93 E("hdv6", "HDV 1080p24 (MPEG-2 Video)"),
94 E("hdv7", "HDV 1080p25 (MPEG-2 Video)"),
95 E("hdv8", "HDV 1080p30 (MPEG-2 Video)"),
96 E("hdv9", "HDV 720p60 JVC (MPEG-2 Video)"),
97 E("hdva", "HDV 720p50 (MPEG-2 Video)"),
99 E("mx5n", "MPEG2 IMX NTSC 525/60 50Mb/s (FCP)"),
100 E("mx5p", "MPEG2 IMX PAL 625/60 50Mb/s (FCP)"),
101 E("mx4n", "MPEG2 IMX NTSC 525/60 40Mb/s (FCP)"),
102 E("mx4p", "MPEG2 IMX PAL 625/50 40Mb/s (FCP)"),
103 E("mx3n", "MPEG2 IMX NTSC 525/60 30Mb/s (FCP)"),
104 E("mx3p", "MPEG2 IMX NTSC 625/50 30Mb/s (FCP)"),
106 E("xdv1", "XDCAM HD 720p30 35Mb/s"),
107 E("xdv2", "XDCAM HD 1080i60 35Mb/s"),
108 E("xdv3", "XDCAM HD 1080i50 35Mb/s"),
109 E("xdv4", "XDCAM HD 720p24 35Mb/s"),
110 E("xdv5", "XDCAM HD 720p25 35Mb/s"),
111 E("xdv6", "XDCAM HD 1080p24 35Mb/s"),
112 E("xdv7", "XDCAM HD 1080p25 35Mb/s"),
113 E("xdv8", "XDCAM HD 1080p30 35Mb/s"),
114 E("xdv9", "XDCAM HD 720p60 35Mb/s"),
115 E("xdva", "XDCAM HD 720p50 35Mb/s"),
117 E("xdvb", "XDCAM EX 1080i60 50Mb/s CBR"),
118 E("xdvc", "XDCAM EX 1080i50 50Mb/s CBR"),
119 E("xdvd", "XDCAM EX 1080p24 50Mb/s CBR"),
120 E("xdve", "XDCAM EX 1080p25 50Mb/s CBR"),
121 E("xdvf", "XDCAM EX 1080p30 50Mb/s CBR"),
123 E("xd51", "XDCAM HD422 720p30 50Mb/s CBR"),
124 E("xd54", "XDCAM HD422 720p24 50Mb/s CBR"),
125 E("xd55", "XDCAM HD422 720p25 50Mb/s CBR"),
126 E("xd59", "XDCAM HD422 720p60 50Mb/s CBR"),
127 E("xd5a", "XDCAM HD422 720p50 50Mb/s CBR"),
128 E("xd5b", "XDCAM HD422 1080i60 50Mb/s CBR"),
129 E("xd5c", "XDCAM HD422 1080i50 50Mb/s CBR"),
130 E("xd5d", "XDCAM HD422 1080p24 50Mb/s CBR"),
131 E("xd5e", "XDCAM HD422 1080p25 50Mb/s CBR"),
132 E("xd5f", "XDCAM HD422 1080p30 50Mb/s CBR"),
134 E("xdhd", "XDCAM HD 540p"),
135 E("xdh2", "XDCAM HD422 540p"),
137 E("AVmp", "AVID IMX PAL"),
138 E("MMES", "Matrox MPEG-2"),
139 E("mmes", "Matrox MPEG-2"),
140 E("PIM2", "Pinnacle MPEG-2"),
141 E("LMP2", "Lead MPEG-2"),
143 E("VCR2", "ATI VCR-2"),
145 B(VLC_CODEC_MP4V, "MPEG-4 Video"),
154 A("\x04\x00\x00\x00"),
175 E("xvid", "Xvid MPEG-4 Video"),
176 E("XVID", "Xvid MPEG-4 Video"),
177 E("XviD", "Xvid MPEG-4 Video"),
178 E("XVIX", "Xvid MPEG-4 Video"),
179 E("xvix", "Xvid MPEG-4 Video"),
181 E("DX50", "DivX MPEG-4 Video"),
182 E("dx50", "DivX MPEG-4 Video"),
183 E("BLZ0", "Blizzard MPEG-4 Video"),
184 E("DXGM", "Electronic Arts Game MPEG-4 Video"),
185 E("DreX", "DreX Mpeg-4"),
187 E("3IV2", "3ivx MPEG-4 Video"),
188 E("3iv2", "3ivx MPEG-4 Video"),
190 E("UMP4", "UB MPEG-4 Video"),
191 E("SEDG", "Samsung MPEG-4 Video"),
192 E("RMP4", "REALmagic MPEG-4 Video"),
193 E("LMP4", "Lead MPEG-4 Video"),
194 E("HDX4", "Jomigo HDX4 (MPEG-4 Video)"),
195 E("hdx4", "Jomigo HDX4 (MPEG-4 Video)"),
196 E("SMP4", "Samsung SMP4 (MPEG-4 Video)"),
197 E("smp4", "Samsung SMP4 (MPEG-4 Video)"),
198 E("fvfw", "libavcodec MPEG-4"),
199 E("FVFW", "libavcodec MPEG-4"),
200 E("FFDS", "FFDShow MPEG-4"),
201 E("VIDM", "vidm 4.01 codec"),
202 E("DP02", "DynaPel MPEG-4 codec"),
203 E("PLV1", "Pelco DVR MPEG-4"),
204 E("QMP4", "QNAP Systems MPEG-4"),
205 E("qMP4", "QNAP Systems MPEG-4"),
206 /* 3ivx delta 3.5 Unsupported
207 * putting it here gives extreme distorted images */
208 //E("3IV1", "3ivx delta 3.5 MPEG-4 Video"),
209 //E("3iv1", "3ivx delta 3.5 MPEG-4 Video"),
212 B(VLC_CODEC_DIV1, "MS MPEG-4 Video v1"),
220 B(VLC_CODEC_DIV2, "MS MPEG-4 Video v2"),
226 /* MSMPEG4 v3 / M$ mpeg4 v3 */
227 B(VLC_CODEC_DIV3, "MS MPEG-4 Video v3"),
241 E("divf", "DivX 4.12"),
242 E("DIVF", "DivX 4.12"),
248 /* AngelPotion stuff */
250 /* 3ivx doctered divx files */
260 B(VLC_CODEC_SVQ1, "SVQ-1 (Sorenson Video v1)"),
266 B(VLC_CODEC_SVQ3, "SVQ-3 (Sorenson Video v3)"),
270 B(VLC_CODEC_HEVC, "MPEG-H Part2/HEVC (H.265)"),
280 B(VLC_CODEC_H264, "H264 - MPEG-4 AVC (part 10)"),
286 /* avc1: special case h264 */
290 E("ai5p", "AVC-Intra 50M 720p24/30/60"),
291 E("ai5q", "AVC-Intra 50M 720p25/50"),
292 E("ai52", "AVC-Intra 50M 1080p25/50"),
293 E("ai53", "AVC-Intra 50M 1080p24/30/60"),
294 E("ai55", "AVC-Intra 50M 1080i50"),
295 E("ai56", "AVC-Intra 50M 1080i60"),
296 E("ai1p", "AVC-Intra 100M 720p24/30/60"),
297 E("ai1q", "AVC-Intra 100M 720p25/50"),
298 E("ai12", "AVC-Intra 100M 1080p25/50"),
299 E("ai13", "AVC-Intra 100M 1080p24/30/60"),
300 E("ai15", "AVC-Intra 100M 1080i50"),
301 E("ai16", "AVC-Intra 100M 1080i60"),
302 E("VSSH", "Vanguard VSS H264"),
303 E("VSSW", "Vanguard VSS H264"),
304 E("vssh", "Vanguard VSS H264"),
305 E("DAVC", "Dicas MPEGable H.264/MPEG-4 AVC"),
306 E("davc", "Dicas MPEGable H.264/MPEG-4 AVC"),
307 E("x3eV", "DreX H.264"),
308 E("GAVC", "GeoVision MPEG-4 AVC"),
309 E("Q264", "QNAP H.264/MPEG-4 AVC"),
316 /* H263(+) is also known as Real Video 1.0 */
319 B(VLC_CODEC_H263, "H263"),
328 E("D263", "DEC H263"),
329 E("d263", "DEC H263"),
330 E("L263", "LEAD H263"),
331 E("M263", "Microsoft H263"),
332 E("X263", "Xirlink H263"),
334 E("ZyGo", "ITU H263+"),
337 B(VLC_CODEC_H263I, "I263.I"),
342 B(VLC_CODEC_H263P, "ITU H263+"),
343 E("ILVR", "ITU H263+"),
348 E("U263", "UB H263+"),
350 /* Flash (H263) variant */
351 B(VLC_CODEC_FLV1, "Flash Video"),
356 B(VLC_CODEC_H261, "H.261"),
360 B(VLC_CODEC_FLIC, "Flic Video"),
365 B(VLC_CODEC_MJPG, "Motion JPEG Video"),
383 E("AVRn", "Avid Motion JPEG"),
384 E("AVDJ", "Avid Motion JPEG"),
385 E("ADJV", "Avid Motion JPEG"),
386 E("dmb1", "Motion JPEG OpenDML Video"),
387 E("DMB1", "Motion JPEG OpenDML Video"),
388 E("ijpg", "Intergraph JPEG Video"),
389 E("IJPG", "Intergraph JPEG Video"),
390 E("ACDV", "ACD Systems Digital"),
391 E("SLMJ", "SL M-JPEG"),
393 B(VLC_CODEC_MJPGB, "Motion JPEG B Video"),
396 B(VLC_CODEC_LJPG, "Lead Motion JPEG Video"),
398 E("Ljpg", "Lead Motion JPEG"),
400 // ? from avcodec/fourcc.c but makes not sense.
401 //{ VLC_FOURCC( 'L','J','P','G' ), CODEC_ID_MJPEG, VIDEO_ES, "Lead Motion JPEG Video" },
404 B(VLC_CODEC_SP5X, "Sunplus Motion JPEG Video"),
414 B(VLC_CODEC_DV, "DV Video"),
424 E("dvh2", "DV Video 720p24"),
425 E("dvh3", "DV Video 720p25"),
426 E("dvh4", "DV Video 720p30"),
438 E("dvcp", "DV Video PAL"),
439 E("dvc ", "DV Video NTSC" ),
440 E("dvp ", "DV Video Pro"),
441 E("dvpp", "DV Video Pro PAL"),
442 E("dv50", "DV Video C Pro 50"),
443 E("dv5p", "DV Video C Pro 50 PAL"),
444 E("dv5n", "DV Video C Pro 50 NTSC"),
445 E("dv1p", "DV Video C Pro 100 PAL" ),
446 E("dv1n", "DV Video C Pro 100 NTSC" ),
447 E("dvhp", "DV Video C Pro HD 720p" ),
448 E("dvh5", "DV Video C Pro HD 1080i50" ),
449 E("dvh6", "DV Video C Pro HD 1080i60" ),
450 E("AVdv", "AVID DV"),
451 E("AVd1", "AVID DV"),
452 E("CDVC", "Canopus DV Video"),
453 E("cdvc", "Canopus DV Video"),
454 E("CDVH", "Canopus DV Video"),
455 E("cdvh", "Canopus DV Video"),
456 E("CDV5", "Canopus DV Video"),
457 E("SLDV", "SoftLab DVCAM codec"),
459 /* Windows Media Video */
460 B(VLC_CODEC_WMV1, "Windows Media Video 7"),
464 B(VLC_CODEC_WMV2, "Windows Media Video 8"),
469 B(VLC_CODEC_WMV3, "Windows Media Video 9"),
473 /* WMVA is the VC-1 codec before the standardization proces,
474 * it is not bitstream compatible and deprecated */
475 B(VLC_CODEC_WMVA, "Windows Media Video Advanced Profile"),
479 B(VLC_CODEC_VC1, "Windows Media Video VC1"),
485 B(VLC_CODEC_WMVP, "Windows Media Video Presentation"),
489 B(VLC_CODEC_WMVP2, "Windows Media Video Presentation, v2"),
493 /* Microsoft Video 1 */
494 B(VLC_CODEC_MSVIDEO1, "Microsoft Video 1"),
503 B(VLC_CODEC_MSRLE, "Microsoft RLE Video"),
506 A("\x01\x00\x00\x00"),
507 A("\x02\x00\x00\x00"),
509 /* Indeo Video Codecs (Quality of this decoder on ppc is not good) */
510 B(VLC_CODEC_INDEO3, "Indeo Video v3"),
517 B(VLC_CODEC_HUFFYUV, "Huff YUV Video"),
520 B(VLC_CODEC_FFVHUFF, "Huff YUV Video"),
523 /* On2 VP3 Video Codecs */
524 B(VLC_CODEC_VP3, "On2's VP3 Video"),
531 /* On2 VP5, VP6 codecs */
532 B(VLC_CODEC_VP5, "On2's VP5 Video"),
536 B(VLC_CODEC_VP6, "On2's VP6.2 Video"),
539 E("VP60", "On2's VP6.0 Video"),
540 E("VP61", "On2's VP6.1 Video"),
542 B(VLC_CODEC_VP6F, "On2's VP6.2 Video (Flash)"),
546 B(VLC_CODEC_VP6A, "On2's VP6 A Video"),
549 B(VLC_CODEC_VP7, "Google/On2's VP7 Video"),
553 B(VLC_CODEC_VP8, "Google/On2's VP8 Video"),
556 B(VLC_CODEC_VP9, "Google/On2's VP9 Video"),
560 /* Xiph.org theora */
561 B(VLC_CODEC_THEORA, "Xiph.org's Theora Video"),
566 /* Xiph.org tarkin */
567 B(VLC_CODEC_TARKIN, "Xiph.org's Tarkin Video"),
570 /* Asus Video (Another thing that doesn't work on PPC) */
571 B(VLC_CODEC_ASV1, "Asus V1 Video"),
573 B(VLC_CODEC_ASV2, "Asus V2 Video"),
576 /* FF video codec 1 (lossless codec) */
577 B(VLC_CODEC_FFV1, "FF video codec 1"),
581 B(VLC_CODEC_VCR1, "ATI VCR1 Video"),
584 /* Cirrus Logic AccuPak */
585 B(VLC_CODEC_CLJR, "Creative Logic AccuPak"),
589 B(VLC_CODEC_RV10, "RealVideo 1.0"),
593 B(VLC_CODEC_RV13, "RealVideo 1.3"),
597 B(VLC_CODEC_RV20, "RealVideo G2 (2.0)"),
601 B(VLC_CODEC_RV30, "RealVideo 8 (3.0)"),
605 B(VLC_CODEC_RV40, "RealVideo 9/10 (4.0)"),
610 B(VLC_CODEC_RPZA, "Apple Video"),
616 B(VLC_CODEC_SMC, "Apple graphics"),
619 B(VLC_CODEC_CINEPAK, "Cinepak Video"),
623 /* Screen Capture Video Codecs */
624 B(VLC_CODEC_TSCC, "TechSmith Camtasia Screen Capture"),
628 B(VLC_CODEC_CSCD, "CamStudio Screen Codec"),
632 B(VLC_CODEC_ZMBV, "DosBox Capture Codec"),
635 B(VLC_CODEC_VMNC, "VMware Video"),
637 B(VLC_CODEC_FRAPS, "FRAPS: Realtime Video Capture"),
641 /* Duck TrueMotion */
642 B(VLC_CODEC_TRUEMOTION1, "Duck TrueMotion v1 Video"),
645 B(VLC_CODEC_TRUEMOTION2, "Duck TrueMotion v2.0 Video"),
648 B(VLC_CODEC_QTRLE, "Apple QuickTime RLE Video"),
651 B(VLC_CODEC_QDRAW, "Apple QuickDraw Video"),
654 B(VLC_CODEC_QPEG, "QPEG Video"),
659 B(VLC_CODEC_ULTI, "IBM Ultimotion Video"),
662 B(VLC_CODEC_VIXL, "Miro/Pinnacle VideoXL Video"),
665 E("PIXL", "Pinnacle VideoXL Video"),
667 B(VLC_CODEC_LOCO, "LOCO Video"),
670 B(VLC_CODEC_WNV1, "Winnov WNV1 Video"),
674 B(VLC_CODEC_AASC, "Autodesc RLE Video"),
676 E("AAS4", "Autodesc RLE Video 24bit"),
678 B(VLC_CODEC_INDEO2, "Indeo Video v2"),
680 E("RT21", "Indeo Video 2.1" ),
682 /* Flash Screen Video */
683 B(VLC_CODEC_FLASHSV, "Flash Screen Video"),
685 B(VLC_CODEC_FLASHSV2, "Flash Screen Video 2"),
688 B(VLC_CODEC_KMVC, "Karl Morton's Video Codec (Worms)"),
691 B(VLC_CODEC_NUV, "Nuppel Video"),
695 /* CODEC_ID_SMACKVIDEO */
696 B(VLC_CODEC_SMACKVIDEO, "Smacker Video"),
700 /* Chinese AVS - Untested */
701 B(VLC_CODEC_CAVS, "Chinese AVS"),
706 B(VLC_CODEC_AMV, "AMV"),
708 B(VLC_CODEC_BINKVIDEO, "Bink Video"),
710 B(VLC_CODEC_BINKAUDIO_DCT, "Bink Audio (DCT)"),
712 B(VLC_CODEC_BINKAUDIO_RDFT, "Bink Audio (RDFT)"),
715 B(VLC_CODEC_DNXHD, "DNxHD"),
717 B(VLC_CODEC_8BPS, "8BPS"),
719 B(VLC_CODEC_MIMIC, "Mimic"),
722 B(VLC_CODEC_CDG, "CD-G Video"),
725 B(VLC_CODEC_FRWU, "Forward Uncompressed" ),
728 B(VLC_CODEC_INDEO4, "Indeo Video v4"),
732 B(VLC_CODEC_INDEO5, "Indeo Video v5"),
736 B(VLC_CODEC_PRORES, "Apple ProRes"),
737 E("apcn", "Apple ProRes 422 Standard"),
738 E("apch", "Apple ProRes 422 HQ"),
739 E("apcs", "Apple ProRes 422 LT"),
740 E("apco", "Apple ProRes 422 Proxy"),
741 E("ap4c", "Apple ProRes 4444"),
742 E("ap4h", "Apple ProRes 4444"),
744 B(VLC_CODEC_ICOD, "Apple Intermediate Codec"),
747 B(VLC_CODEC_G2M2, "GoTo Meeting Codec 2"),
750 B(VLC_CODEC_G2M3, "GoTo Meeting Codec 3"),
753 B(VLC_CODEC_G2M4, "GoTo Meeting Codec 4"),
756 B(VLC_CODEC_FIC, "Mirillis FIC video"),
759 B(VLC_CODEC_TDSC, "TDSC"),
761 B(VLC_CODEC_HQX, "Canopux HQX"),
764 B(VLC_CODEC_YV12, "Planar 4:2:0 YVU"),
767 B(VLC_CODEC_YV9, "Planar 4:1:0 YVU"),
769 B(VLC_CODEC_I410, "Planar 4:1:0 YUV"),
771 B(VLC_CODEC_I411, "Planar 4:1:1 YUV"),
774 B(VLC_CODEC_I420, "Planar 4:2:0 YUV"),
777 B(VLC_CODEC_I422, "Planar 4:2:2 YUV"),
780 B(VLC_CODEC_I440, "Planar 4:4:0 YUV"),
782 B(VLC_CODEC_I444, "Planar 4:4:4 YUV"),
785 B(VLC_CODEC_J420, "Planar 4:2:0 YUV full scale"),
787 B(VLC_CODEC_J422, "Planar 4:2:2 YUV full scale"),
789 B(VLC_CODEC_J440, "Planar 4:4:0 YUV full scale"),
791 B(VLC_CODEC_J444, "Planar 4:4:4 YUV full scale"),
794 B(VLC_CODEC_YUVP, "Palettized YUV with palette element Y:U:V:A"),
797 B(VLC_CODEC_YUVA, "Planar YUV 4:4:4 Y:U:V:A"),
799 B(VLC_CODEC_YUV420A, "Planar YUV 4:2:0 Y:U:V:A"),
801 B(VLC_CODEC_YUV422A, "Planar YUV 4:2:2 Y:U:V:A"),
803 B(VLC_CODEC_YUVA_444_10L, "Planar YUV 4:4:4 Y:U:V:A 10bits"),
806 B(VLC_CODEC_RGBP, "Palettized RGB with palette element R:G:B"),
809 B(VLC_CODEC_RGB8, "8 bits RGB"),
811 B(VLC_CODEC_RGB12, "12 bits RGB"),
813 B(VLC_CODEC_RGB15, "15 bits RGB"),
815 B(VLC_CODEC_RGB16, "16 bits RGB"),
817 B(VLC_CODEC_RGB24, "24 bits RGB"),
819 B(VLC_CODEC_RGB32, "32 bits RGB"),
821 B(VLC_CODEC_RGBA, "32 bits RGBA"),
823 B(VLC_CODEC_RGBA, "32 bits ARGB"),
826 B(VLC_CODEC_BGRA, "32 bits BGRA"),
829 B(VLC_CODEC_GREY, "8 bits greyscale"),
834 B(VLC_CODEC_UYVY, "Packed YUV 4:2:2, U:Y:V:Y"),
845 B(VLC_CODEC_VYUY, "Packed YUV 4:2:2, V:Y:U:Y"),
847 B(VLC_CODEC_YUYV, "Packed YUV 4:2:2, Y:U:Y:V"),
852 B(VLC_CODEC_YVYU, "Packed YUV 4:2:2, Y:V:Y:U"),
855 B(VLC_CODEC_Y211, "Packed YUV 2:1:1, Y:U:Y:V "),
857 B(VLC_CODEC_CYUV, "Creative Packed YUV 4:2:2, U:Y:V:Y, reverted"),
861 B(VLC_CODEC_V210, "10-bit 4:2:2 Component YCbCr"),
864 B(VLC_CODEC_NV12, "Biplanar 4:2:0 Y/UV"),
866 B(VLC_CODEC_NV21, "Biplanar 4:2:0 Y/VU"),
868 B(VLC_CODEC_NV16, "Biplanar 4:2:2 Y/UV"),
870 B(VLC_CODEC_NV61, "Biplanar 4:2:2 Y/VU"),
872 B(VLC_CODEC_NV24, "Biplanar 4:4:4 Y/UV"),
874 B(VLC_CODEC_NV42, "Biplanar 4:4:4 Y/VU"),
877 B(VLC_CODEC_I420_9L, "Planar 4:2:0 YUV 9-bit LE"),
879 B(VLC_CODEC_I420_9B, "Planar 4:2:0 YUV 9-bit BE"),
881 B(VLC_CODEC_I422_9L, "Planar 4:2:2 YUV 9-bit LE"),
883 B(VLC_CODEC_I422_9B, "Planar 4:2:2 YUV 9-bit BE"),
885 B(VLC_CODEC_I444_9L, "Planar 4:4:4 YUV 9-bit LE"),
887 B(VLC_CODEC_I444_9B, "Planar 4:4:4 YUV 9-bit BE"),
890 B(VLC_CODEC_I420_10L, "Planar 4:2:0 YUV 10-bit LE"),
892 B(VLC_CODEC_I420_10B, "Planar 4:2:0 YUV 10-bit BE"),
894 B(VLC_CODEC_I422_10L, "Planar 4:2:2 YUV 10-bit LE"),
896 B(VLC_CODEC_I422_10B, "Planar 4:2:2 YUV 10-bit BE"),
898 B(VLC_CODEC_I444_10L, "Planar 4:4:4 YUV 10-bit LE"),
900 B(VLC_CODEC_I444_10B, "Planar 4:4:4 YUV 10-bit BE"),
903 B(VLC_CODEC_I444_16L, "Planar 4:4:4 YUV 16-bit LE"),
905 B(VLC_CODEC_I444_16B, "Planar 4:4:4 YUV 16-bit BE"),
909 /* XYZ color space */
910 B(VLC_CODEC_XYZ12, "Packed XYZ 12-bit BE"),
913 /* Videogames Codecs */
916 B(VLC_CODEC_INTERPLAY, "Interplay MVE Video"),
920 /* Id Quake II CIN */
921 B(VLC_CODEC_IDCIN, "Id Quake II CIN Video"),
924 /* 4X Technologies */
925 B(VLC_CODEC_4XM, "4X Technologies Video"),
930 B(VLC_CODEC_ROQ, "Id RoQ Video"),
933 /* Sony Playstation MDEC */
934 B(VLC_CODEC_MDEC, "PSX MDEC Video"),
938 B(VLC_CODEC_VMDVIDEO, "Sierra VMD Video"),
942 B(VLC_CODEC_DIRAC, "Dirac" ),
946 B(VLC_CODEC_PNG, "PNG Image"),
949 B(VLC_CODEC_PPM, "PPM Image"),
952 B(VLC_CODEC_PGM, "PGM Image"),
955 B(VLC_CODEC_PGMYUV, "PGM YUV Image"),
958 B(VLC_CODEC_PAM, "PAM Image"),
961 B(VLC_CODEC_JPEGLS, "JPEG-LS"),
964 B(VLC_CODEC_JPEG, "JPEG"),
968 B(VLC_CODEC_BPG, "BPG Image"),
971 B(VLC_CODEC_BMP, "BMP Image"),
974 B(VLC_CODEC_TIFF, "TIFF Image"),
977 B(VLC_CODEC_GIF, "GIF Image"),
981 B(VLC_CODEC_TARGA, "Truevision Targa Image"),
986 B(VLC_CODEC_SGI, "SGI Image"),
989 B(VLC_CODEC_SVG, "SVG Scalable Vector Graphics Image"),
992 B(VLC_CODEC_PNM, "Portable Anymap Image"),
995 B(VLC_CODEC_PCX, "Personal Computer Exchange Image"),
998 B(VLC_CODEC_XWD, "X Window system raster image"),
1000 B(VLC_CODEC_JPEG2000, "JPEG 2000 Image"),
1008 B(VLC_CODEC_LAGARITH, "Lagarith Lossless"),
1011 B(VLC_CODEC_MXPEG, "Mxpeg"),
1014 B(VLC_CODEC_CDXL, "Commodore CDXL video format"),
1017 B(VLC_CODEC_BMVVIDEO, "Discworld II BMV video"),
1020 B(VLC_CODEC_UTVIDEO, "Ut Video"),
1028 B(VLC_CODEC_VBLE, "VBLE Lossless"),
1031 B(VLC_CODEC_DXTORY, "Dxtory capture format"),
1034 B(VLC_CODEC_MSS1, "Windows Media Video 7 Screen"),
1038 B(VLC_CODEC_MSS2, "Windows Media Video 9 Screen"),
1042 B(VLC_CODEC_MSA1, "Microsoft Application Screen Decoder 1"),
1045 B(VLC_CODEC_TSC2, "TechSmith Screen Codec 2"),
1049 B(VLC_CODEC_MTS2, "Microsoft Expression Encoder Screen"),
1052 B(VLC_CODEC_XAN_WC4, "Wing Commander IV Xan video"),
1055 B(VLC_CODEC_LCL_MSZH, "Loss-Less Codec Library AVImszh"),
1058 B(VLC_CODEC_LCL_ZLIB, "Loss-Less Codec Library AVIzlib"),
1061 B(VLC_CODEC_THP, "GameCube THP video"),
1063 B(VLC_CODEC_TXD, "RenderWare TXD"),
1065 B(VLC_CODEC_ESCAPE124, "Escape 124 video"),
1067 B(VLC_CODEC_KGV1, "Kega Game Video (KGV1)"),
1070 B(VLC_CODEC_CLLC, "Canopus Lossless"),
1073 B(VLC_CODEC_AURA, "Auravision Aura"),
1076 B(VLC_CODEC_TMV, "8088flex TMV"),
1078 B(VLC_CODEC_XAN_WC3, "Wing Commander III video"),
1080 B(VLC_CODEC_WS_VQA, "Westwood Studios VQA"),
1082 B(VLC_CODEC_MMVIDEO, "American Laser Games MM Video"),
1084 B(VLC_CODEC_AVS, "Creature Shock AVS"),
1086 B(VLC_CODEC_DSICINVIDEO, "Delphine CIN video"),
1088 B(VLC_CODEC_TIERTEXSEQVIDEO, "Tiertex Limited SEQ video"),
1090 B(VLC_CODEC_DXA, "Feeble Files/ScummVM DXA"),
1092 B(VLC_CODEC_C93, "Interplay C93"),
1094 B(VLC_CODEC_BETHSOFTVID, "Bethesda VID"),
1096 B(VLC_CODEC_VB, "Beam Software VB"),
1098 B(VLC_CODEC_RL2, "RL2 video"),
1100 B(VLC_CODEC_BFI, "Brute Force & Ignorance (BFI) video"),
1102 B(VLC_CODEC_CMV, "Electronic Arts CMV"),
1104 B(VLC_CODEC_MOTIONPIXELS, "Sirius Publishing Motion Pixels"),
1106 B(VLC_CODEC_TGV, "Electronic Arts TGV"),
1108 B(VLC_CODEC_TGQ, "Electronic Arts TGQ"),
1110 B(VLC_CODEC_TQI, "Electronic Arts TQI"),
1112 B(VLC_CODEC_MAD, "Electronic Arts MAD"),
1114 B(VLC_CODEC_ANM, "DeluxePaint animation"),
1116 B(VLC_CODEC_YOP, "Psygnosis YOP"),
1118 B(VLC_CODEC_JV, "Bitmap Brothers JV"),
1120 B(VLC_CODEC_DFA, "Chronomaster DFA"),
1122 B(VLC_CODEC_HNM4_VIDEO, "Cryo Interactive Entertainment HNM4"),
1126 static const staticentry_t p_list_audio[] = {
1128 /* Windows Media Audio 1 */
1129 B(VLC_CODEC_WMA1, "Windows Media Audio 1"),
1133 /* Windows Media Audio 2 */
1134 B(VLC_CODEC_WMA2, "Windows Media Audio 2"),
1139 /* Windows Media Audio Professional */
1140 B(VLC_CODEC_WMAP, "Windows Media Audio Professional"),
1144 /* Windows Media Audio Lossless */
1145 B(VLC_CODEC_WMAL, "Windows Media Audio Lossless"),
1149 /* Windows Media Audio Speech */
1150 B(VLC_CODEC_WMAS, "Windows Media Audio Voice (Speech)"),
1155 B(VLC_CODEC_DVAUDIO, "DV Audio"),
1162 B(VLC_CODEC_MACE3, "MACE-3 Audio"),
1166 B(VLC_CODEC_MACE6, "MACE-6 Audio"),
1169 /* MUSEPACK7 Audio */
1170 B(VLC_CODEC_MUSEPACK7, "MUSEPACK7 Audio"),
1173 /* MUSEPACK8 Audio */
1174 B(VLC_CODEC_MUSEPACK8, "MUSEPACK8 Audio"),
1179 B(VLC_CODEC_RA_144, "RealAudio 1.0"),
1184 B(VLC_CODEC_RA_288, "RealAudio 2.0"),
1187 B(VLC_CODEC_SIPR, "RealAudio Sipr"),
1190 /* MPEG Audio layer 1/2 */
1191 B(VLC_CODEC_MPGA, "MPEG Audio layer 1/2"),
1200 /* MPEG Audio layer 3 */
1201 B(VLC_CODEC_MP3, "MPEG Audio layer 3"),
1206 /* A52 Audio (aka AC3) */
1207 B(VLC_CODEC_A52, "A52 Audio (aka AC3)"),
1214 B(VLC_CODEC_EAC3, "A/52 B Audio (aka E-AC3)"),
1218 B(VLC_CODEC_DTS, "DTS Audio"),
1223 E("dtse", "DTS Express"),
1224 E("dtsh", "DTS-HD High Resolution Audio"),
1225 E("dtsl", "DTS-HD Lossless"),
1229 B(VLC_CODEC_MP4A, "MPEG AAC Audio"),
1236 B(VLC_CODEC_ALS, "MPEG-4 Audio Lossless (ALS)"),
1239 /* 4X Technologies */
1240 B(VLC_CODEC_ADPCM_4XM, "4X Technologies Audio"),
1244 B(VLC_CODEC_ADPCM_EA, "EA ADPCM Audio"),
1247 /* Interplay DPCM */
1248 B(VLC_CODEC_INTERPLAY_DPCM, "Interplay DPCM Audio"),
1252 B(VLC_CODEC_ROQ_DPCM, "Id RoQ DPCM Audio"),
1256 B(VLC_CODEC_DSICINAUDIO, "Delphine CIN Audio"),
1259 /* Sony Playstation XA ADPCM */
1260 B(VLC_CODEC_ADPCM_XA, "PSX XA ADPCM Audio"),
1264 B(VLC_CODEC_ADPCM_ADX, "ADX ADPCM Audio"),
1267 /* Westwood ADPCM */
1268 B(VLC_CODEC_ADPCM_IMA_WS, "Westwood IMA ADPCM audio"),
1272 B(VLC_CODEC_ADPCM_MS, "MS ADPCM audio"),
1276 B(VLC_CODEC_VMDAUDIO, "Sierra VMD Audio"),
1280 B(VLC_CODEC_ADPCM_G726, "G.726 ADPCM Audio"),
1284 B(VLC_CODEC_ADPCM_G722, "G.722 ADPCM Audio"),
1288 B(VLC_CODEC_ADPCM_SWF, "Flash ADPCM Audio"),
1291 B(VLC_CODEC_ADPCM_IMA_WAV, "IMA WAV ADPCM Audio"),
1294 B(VLC_CODEC_ADPCM_IMA_AMV, "IMA AMV ADPCM Audio"),
1297 B(VLC_CODEC_ADPCM_IMA_QT, "IMA QT ADPCM Audio"),
1300 B(VLC_CODEC_ADPCM_YAMAHA, "Yamaha ADPCM Audio" ),
1303 B(VLC_CODEC_ADPCM_DK3, "Duck DK3 ADPCM"),
1306 B(VLC_CODEC_ADPCM_DK4, "Duck DK4 ADPCM"),
1309 B(VLC_CODEC_ADPCM_THP, "GameCube THP ADPCM"),
1312 B(VLC_CODEC_AMR_NB, "AMR narrow band"),
1315 B(VLC_CODEC_AMR_WB, "AMR wide band"),
1319 B(VLC_CODEC_FLAC, "FLAC (Free Lossless Audio Codec)"),
1323 B(VLC_CODEC_ALAC, "Apple Lossless Audio Codec"),
1327 B(VLC_CODEC_QDM2, "QDM2 Audio"),
1331 B(VLC_CODEC_COOK, "Cook Audio"),
1334 /* TTA: The Lossless True Audio */
1335 B(VLC_CODEC_TTA, "The Lossless True Audio"),
1339 B(VLC_CODEC_SHORTEN, "Shorten Lossless Audio"),
1343 B(VLC_CODEC_WAVPACK, "WavPack"),
1347 B(VLC_CODEC_GSM, "GSM Audio"),
1350 B(VLC_CODEC_GSM_MS, "Microsoft GSM Audio"),
1353 B(VLC_CODEC_ATRAC1, "atrac 1"),
1356 B(VLC_CODEC_ATRAC3, "atrac 3"),
1358 A("\x70\x02\x00\x00"),
1360 B(VLC_CODEC_ATRAC3P, "atrac 3+"),
1363 B(VLC_CODEC_IMC, "IMC" ),
1364 A("\x01\x04\x00\x00"),
1366 B(VLC_CODEC_TRUESPEECH,"TrueSpeech"),
1367 A("\x22\x00\x00\x00"),
1369 B(VLC_CODEC_NELLYMOSER, "NellyMoser ASAO"),
1373 B(VLC_CODEC_APE, "Monkey's Audio"),
1376 B(VLC_CODEC_MLP, "MLP/TrueHD Audio"),
1379 B(VLC_CODEC_TRUEHD, "TrueHD Audio"),
1382 B(VLC_CODEC_QCELP, "QCELP Audio"),
1387 B(VLC_CODEC_SPEEX, "Speex Audio"),
1391 B(VLC_CODEC_VORBIS, "Vorbis Audio"),
1395 B(VLC_CODEC_OPUS, "Opus Audio"),
1399 B(VLC_CODEC_302M, "302M Audio"),
1402 B(VLC_CODEC_DVD_LPCM, "DVD LPCM Audio"),
1405 B(VLC_CODEC_DVDA_LPCM, "DVD-Audio LPCM Audio"),
1408 B(VLC_CODEC_BD_LPCM, "BD LPCM Audio"),
1411 B(VLC_CODEC_SDDS, "SDDS Audio"),
1415 B(VLC_CODEC_MIDI, "MIDI Audio"),
1418 B(VLC_CODEC_RALF, "RealAudio Lossless"),
1422 B(VLC_CODEC_G723_1, "G.723.1 Audio"),
1426 B(VLC_CODEC_S8, "PCM S8"),
1429 B(VLC_CODEC_U8, "PCM U8"),
1432 B(VLC_CODEC_S16L, "PCM S16 LE"),
1435 B(VLC_CODEC_S16L_PLANAR, "PCM S16 LE planar"),
1437 B(VLC_CODEC_S16B, "PCM S16 BE"),
1440 B(VLC_CODEC_U16L, "PCM U16 LE"),
1443 B(VLC_CODEC_U16B, "PCM U16 BE"),
1446 B(VLC_CODEC_S20B, "PCM S20 BE"),
1448 B(VLC_CODEC_S24L, "PCM S24 LE"),
1450 A("42ni"), /* Quicktime */
1452 B(VLC_CODEC_S24B, "PCM S24 BE"),
1454 A("in24"), /* Quicktime */
1456 B(VLC_CODEC_U24L, "PCM U24 LE"),
1459 B(VLC_CODEC_U24B, "PCM U24 BE"),
1462 B(VLC_CODEC_S24L32, "PCM S24 in 32 LE"),
1464 B(VLC_CODEC_S24B32, "PCM S24 in 32 BE"),
1466 B(VLC_CODEC_S32L, "PCM S32 LE"),
1468 A("23ni"), /* Quicktime */
1470 B(VLC_CODEC_S32B, "PCM S32 BE"),
1472 A("in32"), /* Quicktime */
1474 B(VLC_CODEC_U32L, "PCM U32 LE"),
1477 B(VLC_CODEC_U32B, "PCM U32 BE"),
1480 B(VLC_CODEC_ALAW, "PCM ALAW"),
1483 B(VLC_CODEC_MULAW, "PCM MU-LAW"),
1487 B(VLC_CODEC_DAT12, "12 bits DAT audio"),
1489 B(VLC_CODEC_S24DAUD, "PCM DAUD"),
1492 B(VLC_CODEC_F32L, "32 bits float LE"),
1496 B(VLC_CODEC_F32B, "32 bits float BE"),
1499 B(VLC_CODEC_F64L, "64 bits float LE"),
1502 B(VLC_CODEC_F64L, "64 bits float BE"),
1505 B(VLC_CODEC_TWINVQ, "TwinVQ"),
1508 B(VLC_CODEC_BMVAUDIO, "Discworld II BMV audio"),
1511 B(VLC_CODEC_ULEAD_DV_AUDIO_NTSC, "Ulead DV audio NTSC"),
1513 B(VLC_CODEC_ULEAD_DV_AUDIO_PAL, "Ulead DV audio PAL"),
1516 B(VLC_CODEC_INDEO_AUDIO, "Indeo Audio Coder"),
1519 B(VLC_CODEC_TAK, "TAK (Tom's lossless Audio Kompressor)"),
1521 B(VLC_CODEC_SMACKAUDIO, "Smacker audio"),
1523 B(VLC_CODEC_ADPCM_IMA_EA_SEAD, "ADPCM IMA Electronic Arts SEAD"),
1525 B(VLC_CODEC_ADPCM_EA_R1, "ADPCM Electronic Arts R1"),
1527 B(VLC_CODEC_ADPCM_IMA_APC, "ADPCM APC"),
1531 static const staticentry_t p_list_spu[] = {
1533 B(VLC_CODEC_SPU, "DVD Subtitles"),
1537 B(VLC_CODEC_DVBS, "DVB Subtitles"),
1540 B(VLC_CODEC_SUBT, "Text subtitles with various tags"),
1543 B(VLC_CODEC_XSUB, "DivX XSUB subtitles"),
1549 B(VLC_CODEC_SSA, "SubStation Alpha subtitles"),
1552 B(VLC_CODEC_TEXT, "Plain text subtitles"),
1555 B(VLC_CODEC_TELETEXT, "Teletext"),
1558 B(VLC_CODEC_KATE, "Kate subtitles"),
1561 B(VLC_CODEC_CMML, "CMML annotations/metadata"),
1564 B(VLC_CODEC_ITU_T140, "ITU T.140 subtitles"),
1567 B(VLC_CODEC_USF, "USF subtitles"),
1570 B(VLC_CODEC_OGT, "OGT subtitles"),
1573 B(VLC_CODEC_CVD, "CVD subtitles"),
1576 B(VLC_CODEC_ARIB_A, "ARIB subtitles (A-profile)"),
1579 B(VLC_CODEC_ARIB_C, "ARIB subtitles (C-profile)"),
1582 B(VLC_CODEC_BD_PG, "BD subtitles"),
1585 B(VLC_CODEC_EBU_STL, "EBU STL subtitles"),
1588 B(VLC_CODEC_SCTE_27, "SCTE-27 subtitles"),
1591 B(VLC_CODEC_EIA608_1, "EIA-608 subtitles"),
1597 B(VLC_CODEC_TTML, "TTML subtitles"),
1603 /* Create a fourcc from a string.
1604 * XXX it assumes that the string is at least four bytes */
1605 static inline vlc_fourcc_t CreateFourcc( const char *psz_fourcc )
1607 return VLC_FOURCC( psz_fourcc[0], psz_fourcc[1],
1608 psz_fourcc[2], psz_fourcc[3] );
1612 static entry_t Lookup( const staticentry_t p_list[], vlc_fourcc_t i_fourcc )
1614 const char *p_class = NULL;
1615 const char *psz_description = NULL;
1617 entry_t e = B(0, "");
1619 for( int i = 0; ; i++ )
1621 const staticentry_t *p = &p_list[i];
1622 const vlc_fourcc_t i_entry_fourcc = CreateFourcc( p->p_fourcc );
1623 const vlc_fourcc_t i_entry_class = CreateFourcc( p->p_class );
1625 if( i_entry_fourcc == 0 )
1628 if( i_entry_class != 0 )
1630 p_class = p->p_class;
1631 psz_description = p->psz_description;
1634 if( i_entry_fourcc == i_fourcc )
1636 assert( p_class != NULL );
1638 memcpy( e.p_class, p_class, 4 );
1639 memcpy( e.p_fourcc, p->p_fourcc, 4 );
1640 e.psz_description = p->psz_description[0] != '\0' ?
1641 p->psz_description : psz_description;
1649 static entry_t Find( int i_cat, vlc_fourcc_t i_fourcc )
1656 return Lookup( p_list_video, i_fourcc );
1658 return Lookup( p_list_audio, i_fourcc );
1660 return Lookup( p_list_spu, i_fourcc );
1663 e = Find( VIDEO_ES, i_fourcc );
1664 if( CreateFourcc( e.p_class ) == 0 )
1665 e = Find( AUDIO_ES, i_fourcc );
1666 if( CreateFourcc( e.p_class ) == 0 )
1667 e = Find( SPU_ES, i_fourcc );
1673 vlc_fourcc_t vlc_fourcc_GetCodec( int i_cat, vlc_fourcc_t i_fourcc )
1675 entry_t e = Find( i_cat, i_fourcc );
1677 if( CreateFourcc( e.p_class ) == 0 )
1679 return CreateFourcc( e.p_class );
1682 vlc_fourcc_t vlc_fourcc_GetCodecFromString( int i_cat, const char *psz_fourcc )
1684 if( !psz_fourcc || strlen(psz_fourcc) != 4 )
1686 return vlc_fourcc_GetCodec( i_cat,
1687 VLC_FOURCC( psz_fourcc[0], psz_fourcc[1],
1688 psz_fourcc[2], psz_fourcc[3] ) );
1691 vlc_fourcc_t vlc_fourcc_GetCodecAudio( vlc_fourcc_t i_fourcc, int i_bits )
1693 const int i_bytes = ( i_bits + 7 ) / 8;
1695 if( i_fourcc == VLC_FOURCC( 'a', 'f', 'l', 't' ) )
1700 return VLC_CODEC_FL32;
1702 return VLC_CODEC_FL64;
1707 else if( i_fourcc == VLC_FOURCC( 'a', 'r', 'a', 'w' ) )
1712 return VLC_CODEC_U8;
1714 return VLC_CODEC_S16L;
1716 return VLC_CODEC_S24L;
1719 return VLC_CODEC_S32L;
1724 else if( i_fourcc == VLC_FOURCC( 't', 'w', 'o', 's' ) )
1729 return VLC_CODEC_S8;
1731 return VLC_CODEC_S16B;
1733 return VLC_CODEC_S24B;
1735 return VLC_CODEC_S32B;
1740 else if( i_fourcc == VLC_FOURCC( 's', 'o', 'w', 't' ) )
1745 return VLC_CODEC_S8;
1747 return VLC_CODEC_S16L;
1749 return VLC_CODEC_S24L;
1751 return VLC_CODEC_S32L;
1758 return vlc_fourcc_GetCodec( AUDIO_ES, i_fourcc );
1763 const char *vlc_fourcc_GetDescription( int i_cat, vlc_fourcc_t i_fourcc )
1765 entry_t e = Find( i_cat, i_fourcc );
1767 return e.psz_description;
1772 #define VLC_CODEC_YUV_PLANAR_410 \
1773 VLC_CODEC_I410, VLC_CODEC_YV9
1775 #define VLC_CODEC_YUV_PLANAR_420 \
1776 VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420
1778 #define VLC_CODEC_YUV_SEMIPLANAR_420 \
1779 VLC_CODEC_NV12, VLC_CODEC_NV21
1781 #define VLC_CODEC_YUV_PLANAR_420_16 \
1782 VLC_CODEC_I420_10L, VLC_CODEC_I420_10B, VLC_CODEC_I420_9L, VLC_CODEC_I420_9B
1784 #define VLC_CODEC_YUV_PLANAR_422 \
1785 VLC_CODEC_I422, VLC_CODEC_J422
1787 #define VLC_CODEC_YUV_SEMIPLANAR_422 \
1788 VLC_CODEC_NV16, VLC_CODEC_NV61
1790 #define VLC_CODEC_YUV_PLANAR_422_16 \
1791 VLC_CODEC_I422_10L, VLC_CODEC_I422_10B, VLC_CODEC_I422_9L, VLC_CODEC_I422_9B
1793 #define VLC_CODEC_YUV_PLANAR_440 \
1794 VLC_CODEC_I440, VLC_CODEC_J440
1796 #define VLC_CODEC_YUV_PLANAR_444 \
1797 VLC_CODEC_I444, VLC_CODEC_J444
1799 #define VLC_CODEC_YUV_SEMIPLANAR_444 \
1800 VLC_CODEC_NV24, VLC_CODEC_NV42
1802 #define VLC_CODEC_YUV_PLANAR_444_16 \
1803 VLC_CODEC_I444_10L, VLC_CODEC_I444_10B, VLC_CODEC_I444_9L, VLC_CODEC_I444_9B, \
1804 VLC_CODEC_I444_16L, VLC_CODEC_I444_16B
1806 #define VLC_CODEC_YUV_PACKED \
1807 VLC_CODEC_YUYV, VLC_CODEC_YVYU, \
1808 VLC_CODEC_UYVY, VLC_CODEC_VYUY
1810 #define VLC_CODEC_FALLBACK_420 \
1811 VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PACKED, \
1812 VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
1813 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1815 static const vlc_fourcc_t p_I420_fallback[] = {
1816 VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420, 0
1818 static const vlc_fourcc_t p_J420_fallback[] = {
1819 VLC_CODEC_J420, VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_FALLBACK_420, 0
1821 static const vlc_fourcc_t p_YV12_fallback[] = {
1822 VLC_CODEC_YV12, VLC_CODEC_I420, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420, 0
1825 #define VLC_CODEC_FALLBACK_420_16 \
1826 VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420
1828 static const vlc_fourcc_t p_I420_9L_fallback[] = {
1829 VLC_CODEC_I420_9L, VLC_CODEC_I420_9B, VLC_CODEC_FALLBACK_420_16, 0
1831 static const vlc_fourcc_t p_I420_9B_fallback[] = {
1832 VLC_CODEC_I420_9B, VLC_CODEC_I420_9L, VLC_CODEC_FALLBACK_420_16, 0
1834 static const vlc_fourcc_t p_I420_10L_fallback[] = {
1835 VLC_CODEC_I420_10L, VLC_CODEC_I420_10B, VLC_CODEC_FALLBACK_420_16, 0
1837 static const vlc_fourcc_t p_I420_10B_fallback[] = {
1838 VLC_CODEC_I420_10B, VLC_CODEC_I420_10L, VLC_CODEC_FALLBACK_420_16, 0
1841 #define VLC_CODEC_FALLBACK_422 \
1842 VLC_CODEC_YUV_PACKED, VLC_CODEC_YUV_PLANAR_420, \
1843 VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
1844 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1846 static const vlc_fourcc_t p_I422_fallback[] = {
1847 VLC_CODEC_I422, VLC_CODEC_J422, VLC_CODEC_FALLBACK_422, 0
1849 static const vlc_fourcc_t p_J422_fallback[] = {
1850 VLC_CODEC_J422, VLC_CODEC_I422, VLC_CODEC_FALLBACK_422, 0
1853 #define VLC_CODEC_FALLBACK_422_16 \
1854 VLC_CODEC_I422, VLC_CODEC_J422, VLC_CODEC_FALLBACK_422
1856 static const vlc_fourcc_t p_I422_9L_fallback[] = {
1857 VLC_CODEC_I422_9L, VLC_CODEC_I422_9B, VLC_CODEC_FALLBACK_422_16, 0
1859 static const vlc_fourcc_t p_I422_9B_fallback[] = {
1860 VLC_CODEC_I422_9B, VLC_CODEC_I422_9L, VLC_CODEC_FALLBACK_422_16, 0
1862 static const vlc_fourcc_t p_I422_10L_fallback[] = {
1863 VLC_CODEC_I422_10L, VLC_CODEC_I422_10B, VLC_CODEC_FALLBACK_422_16, 0
1865 static const vlc_fourcc_t p_I422_10B_fallback[] = {
1866 VLC_CODEC_I422_10B, VLC_CODEC_I422_10L, VLC_CODEC_FALLBACK_422_16, 0
1869 #define VLC_CODEC_FALLBACK_444 \
1870 VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PACKED, \
1871 VLC_CODEC_YUV_PLANAR_420, VLC_CODEC_YUV_PLANAR_440, \
1872 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1874 static const vlc_fourcc_t p_I444_fallback[] = {
1875 VLC_CODEC_I444, VLC_CODEC_J444, VLC_CODEC_FALLBACK_444, 0
1877 static const vlc_fourcc_t p_J444_fallback[] = {
1878 VLC_CODEC_J444, VLC_CODEC_I444, VLC_CODEC_FALLBACK_444, 0
1881 #define VLC_CODEC_FALLBACK_444_16 \
1882 VLC_CODEC_I444, VLC_CODEC_J444, VLC_CODEC_FALLBACK_444
1884 static const vlc_fourcc_t p_I444_9L_fallback[] = {
1885 VLC_CODEC_I444_9L, VLC_CODEC_I444_9B, VLC_CODEC_FALLBACK_444_16, 0
1887 static const vlc_fourcc_t p_I444_9B_fallback[] = {
1888 VLC_CODEC_I444_9B, VLC_CODEC_I444_9L, VLC_CODEC_FALLBACK_444_16, 0
1890 static const vlc_fourcc_t p_I444_10L_fallback[] = {
1891 VLC_CODEC_I444_10L, VLC_CODEC_I444_10B, VLC_CODEC_FALLBACK_444_16, 0
1893 static const vlc_fourcc_t p_I444_10B_fallback[] = {
1894 VLC_CODEC_I444_10B, VLC_CODEC_I444_10L, VLC_CODEC_FALLBACK_444_16, 0
1896 static const vlc_fourcc_t p_I444_16L_fallback[] = {
1897 VLC_CODEC_I444_16L, VLC_CODEC_I444_16B, VLC_CODEC_FALLBACK_444_16, 0
1899 static const vlc_fourcc_t p_I444_16B_fallback[] = {
1900 VLC_CODEC_I444_16B, VLC_CODEC_I444_16L, VLC_CODEC_FALLBACK_444_16, 0
1904 static const vlc_fourcc_t p_I440_fallback[] = {
1906 VLC_CODEC_YUV_PLANAR_420,
1907 VLC_CODEC_YUV_PLANAR_422,
1908 VLC_CODEC_YUV_PLANAR_444,
1909 VLC_CODEC_YUV_PACKED,
1910 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211, 0
1913 #define VLC_CODEC_FALLBACK_PACKED \
1914 VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PLANAR_420, \
1915 VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
1916 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1918 static const vlc_fourcc_t p_YUYV_fallback[] = {
1923 VLC_CODEC_FALLBACK_PACKED, 0
1925 static const vlc_fourcc_t p_YVYU_fallback[] = {
1930 VLC_CODEC_FALLBACK_PACKED, 0
1932 static const vlc_fourcc_t p_UYVY_fallback[] = {
1937 VLC_CODEC_FALLBACK_PACKED, 0
1939 static const vlc_fourcc_t p_VYUY_fallback[] = {
1944 VLC_CODEC_FALLBACK_PACKED, 0
1947 static const vlc_fourcc_t *pp_YUV_fallback[] = {
1952 p_I420_10L_fallback,
1953 p_I420_10B_fallback,
1958 p_I422_10L_fallback,
1959 p_I422_10B_fallback,
1965 p_I444_10L_fallback,
1966 p_I444_10B_fallback,
1967 p_I444_16L_fallback,
1968 p_I444_16B_fallback,
1979 static const vlc_fourcc_t p_list_YUV[] = {
1980 VLC_CODEC_YUV_PLANAR_420,
1981 VLC_CODEC_YUV_SEMIPLANAR_420,
1982 VLC_CODEC_YUV_PLANAR_422,
1983 VLC_CODEC_YUV_SEMIPLANAR_422,
1984 VLC_CODEC_YUV_PLANAR_440,
1985 VLC_CODEC_YUV_PLANAR_444,
1986 VLC_CODEC_YUV_SEMIPLANAR_444,
1987 VLC_CODEC_YUV_PACKED,
1988 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211,
1989 VLC_CODEC_YUV_PLANAR_420_16,
1990 VLC_CODEC_YUV_PLANAR_422_16,
1991 VLC_CODEC_YUV_PLANAR_444_16,
1992 VLC_CODEC_VDPAU_VIDEO_420,
1993 VLC_CODEC_VDPAU_VIDEO_422,
1994 VLC_CODEC_VDPAU_VIDEO_444,
1999 static const vlc_fourcc_t p_RGB32_fallback[] = {
2007 static const vlc_fourcc_t p_RGB24_fallback[] = {
2015 static const vlc_fourcc_t p_RGB16_fallback[] = {
2023 static const vlc_fourcc_t p_RGB15_fallback[] = {
2031 static const vlc_fourcc_t p_RGB8_fallback[] = {
2039 static const vlc_fourcc_t *pp_RGB_fallback[] = {
2050 static const vlc_fourcc_t *GetFallback( vlc_fourcc_t i_fourcc,
2051 const vlc_fourcc_t *pp_fallback[],
2052 const vlc_fourcc_t p_list[] )
2054 for( unsigned i = 0; pp_fallback[i]; i++ )
2056 if( pp_fallback[i][0] == i_fourcc )
2057 return pp_fallback[i];
2062 const vlc_fourcc_t *vlc_fourcc_GetYUVFallback( vlc_fourcc_t i_fourcc )
2064 return GetFallback( i_fourcc, pp_YUV_fallback, p_list_YUV );
2066 const vlc_fourcc_t *vlc_fourcc_GetRGBFallback( vlc_fourcc_t i_fourcc )
2068 return GetFallback( i_fourcc, pp_RGB_fallback, p_RGB32_fallback );
2071 bool vlc_fourcc_AreUVPlanesSwapped( vlc_fourcc_t a, vlc_fourcc_t b )
2073 static const vlc_fourcc_t pp_swapped[][4] = {
2074 { VLC_CODEC_YV12, VLC_CODEC_I420, VLC_CODEC_J420, 0 },
2075 { VLC_CODEC_YV9, VLC_CODEC_I410, 0 },
2079 for( int i = 0; pp_swapped[i][0]; i++ )
2081 if( pp_swapped[i][0] == b )
2087 if( pp_swapped[i][0] != a )
2089 for( int j = 1; pp_swapped[i][j]; j++ )
2091 if( pp_swapped[i][j] == b )
2098 bool vlc_fourcc_IsYUV(vlc_fourcc_t fcc)
2100 for( unsigned i = 0; p_list_YUV[i]; i++ )
2102 if( p_list_YUV[i] == fcc )
2108 #define PLANAR(n, w_den, h_den, size, bits) \
2109 { .plane_count = n, \
2110 .p = { {.w = {1, 1}, .h = {1, 1}}, \
2111 {.w = {1,w_den}, .h = {1,h_den}}, \
2112 {.w = {1,w_den}, .h = {1,h_den}}, \
2113 {.w = {1, 1}, .h = {1, 1}} }, \
2114 .pixel_size = size, \
2115 .pixel_bits = bits }
2117 #define PLANAR_8(n, w_den, h_den) PLANAR(n, w_den, h_den, 1, 8)
2118 #define PLANAR_16(n, w_den, h_den, bits) PLANAR(n, w_den, h_den, 2, bits)
2120 #define PACKED_FMT(size, bits) \
2121 { .plane_count = 1, \
2122 .p = { {.w = {1,1}, .h = {1,1}} }, \
2123 .pixel_size = size, \
2124 .pixel_bits = bits }
2126 /* Zero planes for hardware picture handles. Cannot be manipulated directly. */
2127 #define FAKE_FMT() \
2128 { .plane_count = 0, \
2129 .p = { {.w = {1,1}, .h = {1,1}} }, \
2135 vlc_fourcc_t p_fourcc[4];
2136 vlc_chroma_description_t description;
2137 } p_list_chroma_description[] = {
2138 { { VLC_CODEC_I411 }, PLANAR_8(3, 4, 1) },
2139 { { VLC_CODEC_YUV_PLANAR_410 }, PLANAR_8(3, 4, 4) },
2140 { { VLC_CODEC_YUV_PLANAR_420 }, PLANAR_8(3, 2, 2) },
2141 { { VLC_CODEC_NV12, VLC_CODEC_NV21 }, PLANAR_8(2, 1, 2) },
2142 { { VLC_CODEC_YUV_PLANAR_422 }, PLANAR_8(3, 2, 1) },
2143 { { VLC_CODEC_NV16, VLC_CODEC_NV61 }, PLANAR_8(2, 1, 1) },
2144 { { VLC_CODEC_YUV_PLANAR_440 }, PLANAR_8(3, 1, 2) },
2145 { { VLC_CODEC_YUV_PLANAR_444 }, PLANAR_8(3, 1, 1) },
2146 { { VLC_CODEC_YUVA }, PLANAR_8(4, 1, 1) },
2147 { { VLC_CODEC_YUV420A }, PLANAR_8(4, 2, 2) },
2148 { { VLC_CODEC_YUV422A }, PLANAR_8(4, 2, 1) },
2150 { { VLC_CODEC_GBR_PLANAR }, PLANAR_8(3, 1, 1) },
2152 { { VLC_CODEC_I420_10L,
2153 VLC_CODEC_I420_10B }, PLANAR_16(3, 2, 2, 10) },
2154 { { VLC_CODEC_I420_9L,
2155 VLC_CODEC_I420_9B }, PLANAR_16(3, 2, 2, 9) },
2156 { { VLC_CODEC_I422_10L,
2157 VLC_CODEC_I422_10B }, PLANAR_16(3, 2, 1, 10) },
2158 { { VLC_CODEC_I422_9L,
2159 VLC_CODEC_I422_9B }, PLANAR_16(3, 2, 1, 9) },
2160 { { VLC_CODEC_I444_10L,
2161 VLC_CODEC_I444_10B }, PLANAR_16(3, 1, 1, 10) },
2162 { { VLC_CODEC_I444_9L,
2163 VLC_CODEC_I444_9B }, PLANAR_16(3, 1, 1, 9) },
2164 { { VLC_CODEC_I444_16L,
2165 VLC_CODEC_I444_16B }, PLANAR_16(3, 1, 1, 16) },
2166 { { VLC_CODEC_YUVA_444_10L,
2167 VLC_CODEC_YUVA_444_10B }, PLANAR_16(4, 1, 1, 10) },
2169 { { VLC_CODEC_YUV_PACKED }, PACKED_FMT(2, 16) },
2170 { { VLC_CODEC_RGB8, VLC_CODEC_GREY,
2171 VLC_CODEC_YUVP, VLC_CODEC_RGBP }, PACKED_FMT(1, 8) },
2173 { { VLC_CODEC_RGB15, 0 }, PACKED_FMT(2, 15) },
2174 { { VLC_CODEC_RGB12, 0 }, PACKED_FMT(2, 12) },
2175 { { VLC_CODEC_RGB16, 0 }, PACKED_FMT(2, 16) },
2176 { { VLC_CODEC_RGB24, 0 }, PACKED_FMT(3, 24) },
2177 { { VLC_CODEC_RGB32, 0 }, PACKED_FMT(4, 24) },
2178 { { VLC_CODEC_RGBA, VLC_CODEC_ARGB,
2179 VLC_CODEC_BGRA, }, PACKED_FMT(4, 32) },
2181 { { VLC_CODEC_Y211, 0 }, { 1, { {{1,4}, {1,1}} }, 4, 32 } },
2182 { { VLC_CODEC_XYZ12, 0 }, PACKED_FMT(6, 48) },
2184 { { VLC_CODEC_VDPAU_VIDEO_420, VLC_CODEC_VDPAU_VIDEO_422,
2185 VLC_CODEC_VDPAU_VIDEO_444, VLC_CODEC_VDPAU_OUTPUT },
2187 { { VLC_CODEC_ANDROID_OPAQUE, VLC_CODEC_MMAL_OPAQUE, },
2190 { { 0 }, FAKE_FMT() }
2198 const vlc_chroma_description_t *vlc_fourcc_GetChromaDescription( vlc_fourcc_t i_fourcc )
2200 for( unsigned i = 0; p_list_chroma_description[i].p_fourcc[0]; i++ )
2202 const vlc_fourcc_t *p_fourcc = p_list_chroma_description[i].p_fourcc;
2203 for( unsigned j = 0; j < 4 && p_fourcc[j] != 0; j++ )
2205 if( p_fourcc[j] == i_fourcc )
2206 return &p_list_chroma_description[i].description;