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_MPGV, "MPEG-1/2 Video"),
81 E("PIM1", "Pinnacle DC1000 (MPEG-1 Video)"),
83 E("hdv1", "HDV 720p30 (MPEG-2 Video)"),
84 E("hdv2", "Sony HDV 1080i60 (MPEG-2 Video)"),
85 E("hdv3", "FCP HDV 1080i50 (MPEG-2 Video)"),
86 E("hdv4", "HDV 720p24 (MPEG-2 Video)"),
87 E("hdv5", "HDV 720p25 (MPEG-2 Video)"),
88 E("hdv6", "HDV 1080p24 (MPEG-2 Video)"),
89 E("hdv7", "HDV 1080p25 (MPEG-2 Video)"),
90 E("hdv8", "HDV 1080p30 (MPEG-2 Video)"),
91 E("hdv9", "HDV 720p60 JVC (MPEG-2 Video)"),
92 E("hdva", "HDV 720p50 (MPEG-2 Video)"),
94 E("mx5n", "MPEG2 IMX NTSC 525/60 50Mb/s (FCP)"),
95 E("mx5p", "MPEG2 IMX PAL 625/60 50Mb/s (FCP)"),
96 E("mx4n", "MPEG2 IMX NTSC 525/60 40Mb/s (FCP)"),
97 E("mx4p", "MPEG2 IMX PAL 625/50 40Mb/s (FCP)"),
98 E("mx3n", "MPEG2 IMX NTSC 525/60 30Mb/s (FCP)"),
99 E("mx3p", "MPEG2 IMX NTSC 625/50 30Mb/s (FCP)"),
101 E("xdv1", "XDCAM HD 720p30 35Mb/s"),
102 E("xdv2", "XDCAM HD 1080i60 35Mb/s"),
103 E("xdv3", "XDCAM HD 1080i50 35Mb/s"),
104 E("xdv4", "XDCAM HD 720p24 35Mb/s"),
105 E("xdv5", "XDCAM HD 720p25 35Mb/s"),
106 E("xdv6", "XDCAM HD 1080p24 35Mb/s"),
107 E("xdv7", "XDCAM HD 1080p25 35Mb/s"),
108 E("xdv8", "XDCAM HD 1080p30 35Mb/s"),
109 E("xdv9", "XDCAM HD 720p60 35Mb/s"),
110 E("xdva", "XDCAM HD 720p50 35Mb/s"),
112 E("xdvb", "XDCAM EX 1080i60 50Mb/s CBR"),
113 E("xdvc", "XDCAM EX 1080i50 50Mb/s CBR"),
114 E("xdvd", "XDCAM EX 1080p24 50Mb/s CBR"),
115 E("xdve", "XDCAM EX 1080p25 50Mb/s CBR"),
116 E("xdvf", "XDCAM EX 1080p30 50Mb/s CBR"),
118 E("xd51", "XDCAM HD422 720p30 50Mb/s CBR"),
119 E("xd54", "XDCAM HD422 720p24 50Mb/s CBR"),
120 E("xd55", "XDCAM HD422 720p25 50Mb/s CBR"),
121 E("xd59", "XDCAM HD422 720p60 50Mb/s CBR"),
122 E("xd5a", "XDCAM HD422 720p50 50Mb/s CBR"),
123 E("xd5b", "XDCAM HD422 1080i60 50Mb/s CBR"),
124 E("xd5c", "XDCAM HD422 1080i50 50Mb/s CBR"),
125 E("xd5d", "XDCAM HD422 1080p24 50Mb/s CBR"),
126 E("xd5e", "XDCAM HD422 1080p25 50Mb/s CBR"),
127 E("xd5f", "XDCAM HD422 1080p30 50Mb/s CBR"),
129 E("xdhd", "XDCAM HD 540p"),
130 E("xdh2", "XDCAM HD422 540p"),
132 E("AVmp", "AVID IMX PAL"),
133 E("MMES", "Matrox MPEG-2"),
134 E("mmes", "Matrox MPEG-2"),
135 E("PIM2", "Pinnacle MPEG-2"),
136 E("LMP2", "Lead MPEG-2"),
138 E("VCR2", "ATI VCR-2"),
140 B(VLC_CODEC_MP4V, "MPEG-4 Video"),
149 A("\x04\x00\x00\x00"),
169 E("xvid", "Xvid MPEG-4 Video"),
170 E("XVID", "Xvid MPEG-4 Video"),
171 E("XviD", "Xvid MPEG-4 Video"),
172 E("XVIX", "Xvid MPEG-4 Video"),
173 E("xvix", "Xvid MPEG-4 Video"),
175 E("DX50", "DivX MPEG-4 Video"),
176 E("dx50", "DivX MPEG-4 Video"),
177 E("BLZ0", "Blizzard MPEG-4 Video"),
178 E("DXGM", "Electronic Arts Game MPEG-4 Video"),
179 E("DreX", "DreX Mpeg-4"),
181 E("3IV2", "3ivx MPEG-4 Video"),
182 E("3iv2", "3ivx MPEG-4 Video"),
184 E("UMP4", "UB MPEG-4 Video"),
185 E("SEDG", "Samsung MPEG-4 Video"),
186 E("RMP4", "REALmagic MPEG-4 Video"),
187 E("LMP4", "Lead MPEG-4 Video"),
188 E("HDX4", "Jomigo HDX4 (MPEG-4 Video)"),
189 E("hdx4", "Jomigo HDX4 (MPEG-4 Video)"),
190 E("SMP4", "Samsung SMP4 (MPEG-4 Video)"),
191 E("smp4", "Samsung SMP4 (MPEG-4 Video)"),
192 E("fvfw", "FFmpeg MPEG-4"),
193 E("FVFW", "FFmpeg MPEG-4"),
194 E("FFDS", "FFDShow MPEG-4"),
195 E("VIDM", "vidm 4.01 codec"),
196 E("DP02", "DynaPel MPEG-4 codec"),
197 E("PLV1", "Pelco DVR MPEG-4"),
198 E("QMP4", "QNAP Systems MPEG-4"),
199 /* 3ivx delta 3.5 Unsupported
200 * putting it here gives extreme distorted images */
201 //E("3IV1", "3ivx delta 3.5 MPEG-4 Video"),
202 //E("3iv1", "3ivx delta 3.5 MPEG-4 Video"),
205 B(VLC_CODEC_DIV1, "MS MPEG-4 Video v1"),
213 B(VLC_CODEC_DIV2, "MS MPEG-4 Video v2"),
219 /* MSMPEG4 v3 / M$ mpeg4 v3 */
220 B(VLC_CODEC_DIV3, "MS MPEG-4 Video v3"),
234 E("divf", "DivX 4.12"),
235 E("DIVF", "DivX 4.12"),
241 /* AngelPotion stuff */
243 /* 3ivx doctered divx files */
253 B(VLC_CODEC_SVQ1, "SVQ-1 (Sorenson Video v1)"),
259 B(VLC_CODEC_SVQ3, "SVQ-3 (Sorenson Video v3)"),
263 B(VLC_CODEC_HEVC, "MPEG-H Part2/HEVC (H.265)"),
271 B(VLC_CODEC_H264, "H264 - MPEG-4 AVC (part 10)"),
277 /* avc1: special case h264 */
280 E("ai5p", "AVC-Intra 50M 720p24/30/60"),
281 E("ai5q", "AVC-Intra 50M 720p25/50"),
282 E("ai52", "AVC-Intra 50M 1080p25/50"),
283 E("ai53", "AVC-Intra 50M 1080p24/30/60"),
284 E("ai55", "AVC-Intra 50M 1080i50"),
285 E("ai56", "AVC-Intra 50M 1080i60"),
286 E("ai1p", "AVC-Intra 100M 720p24/30/60"),
287 E("ai1q", "AVC-Intra 100M 720p25/50"),
288 E("ai12", "AVC-Intra 100M 1080p25/50"),
289 E("ai13", "AVC-Intra 100M 1080p24/30/60"),
290 E("ai15", "AVC-Intra 100M 1080i50"),
291 E("ai16", "AVC-Intra 100M 1080i60"),
292 E("VSSH", "Vanguard VSS H264"),
293 E("VSSW", "Vanguard VSS H264"),
294 E("vssh", "Vanguard VSS H264"),
295 E("DAVC", "Dicas MPEGable H.264/MPEG-4 AVC"),
296 E("davc", "Dicas MPEGable H.264/MPEG-4 AVC"),
297 E("x3eV", "DreX H.264"),
300 /* H263(+) is also known as Real Video 1.0 */
303 B(VLC_CODEC_H263, "H263"),
312 E("D263", "DEC H263"),
313 E("d263", "DEC H263"),
314 E("L263", "LEAD H263"),
315 E("M263", "Microsoft H263"),
316 E("X263", "Xirlink H263"),
318 E("ZyGo", "ITU H263+"),
321 B(VLC_CODEC_H263I, "I263.I"),
326 B(VLC_CODEC_H263P, "ITU H263+"),
327 E("ILVR", "ITU H263+"),
332 E("U263", "UB H263+"),
334 /* Flash (H263) variant */
335 B(VLC_CODEC_FLV1, "Flash Video"),
340 B(VLC_CODEC_H261, "H.261"),
344 B(VLC_CODEC_FLIC, "Flic Video"),
348 B(VLC_CODEC_MJPG, "Motion JPEG Video"),
364 E("AVRn", "Avid Motion JPEG"),
365 E("AVDJ", "Avid Motion JPEG"),
366 E("ADJV", "Avid Motion JPEG"),
367 E("dmb1", "Motion JPEG OpenDML Video"),
368 E("DMB1", "Motion JPEG OpenDML Video"),
369 E("ijpg", "Intergraph JPEG Video"),
370 E("IJPG", "Intergraph JPEG Video"),
371 E("ACDV", "ACD Systems Digital"),
372 E("SLMJ", "SL M-JPEG"),
374 B(VLC_CODEC_MJPGB, "Motion JPEG B Video"),
377 B(VLC_CODEC_LJPG, "Lead Motion JPEG Video"),
379 E("Ljpg", "Lead Motion JPEG"),
381 // ? from avcodec/fourcc.c but makes not sense.
382 //{ VLC_FOURCC( 'L','J','P','G' ), CODEC_ID_MJPEG, VIDEO_ES, "Lead Motion JPEG Video" },
385 B(VLC_CODEC_SP5X, "Sunplus Motion JPEG Video"),
395 B(VLC_CODEC_DV, "DV Video"),
405 E("dvh2", "DV Video 720p24"),
406 E("dvh3", "DV Video 720p25"),
407 E("dvh4", "DV Video 720p30"),
417 E("dvcp", "DV Video PAL"),
418 E("dvc ", "DV Video NTSC" ),
419 E("dvp ", "DV Video Pro"),
420 E("dvpp", "DV Video Pro PAL"),
421 E("dv50", "DV Video C Pro 50"),
422 E("dv5p", "DV Video C Pro 50 PAL"),
423 E("dv5n", "DV Video C Pro 50 NTSC"),
424 E("dv1p", "DV Video C Pro 100 PAL" ),
425 E("dv1n", "DV Video C Pro 100 NTSC" ),
426 E("dvhp", "DV Video C Pro HD 720p" ),
427 E("dvh5", "DV Video C Pro HD 1080i50" ),
428 E("dvh6", "DV Video C Pro HD 1080i60" ),
429 E("AVdv", "AVID DV"),
430 E("AVd1", "AVID DV"),
431 E("CDVC", "Canopus DV Video"),
432 E("cdvc", "Canopus DV Video"),
433 E("CDVH", "Canopus DV Video"),
434 E("cdvh", "Canopus DV Video"),
435 E("CDV5", "Canopus DV Video"),
436 E("SLDV", "SoftLab DVCAM codec"),
438 /* Windows Media Video */
439 B(VLC_CODEC_WMV1, "Windows Media Video 7"),
443 B(VLC_CODEC_WMV2, "Windows Media Video 8"),
447 B(VLC_CODEC_WMV3, "Windows Media Video 9"),
451 /* WMVA is the VC-1 codec before the standardization proces,
452 * it is not bitstream compatible and deprecated */
453 B(VLC_CODEC_WMVA, "Windows Media Video Advanced Profile"),
457 B(VLC_CODEC_VC1, "Windows Media Video VC1"),
463 B(VLC_CODEC_WMVP, "Windows Media Video Presentation"),
467 B(VLC_CODEC_WMVP2, "Windows Media Video Presentation, v2"),
471 /* Microsoft Video 1 */
472 B(VLC_CODEC_MSVIDEO1, "Microsoft Video 1"),
481 B(VLC_CODEC_MSRLE, "Microsoft RLE Video"),
484 A("\x01\x00\x00\x00"),
485 A("\x02\x00\x00\x00"),
487 /* Indeo Video Codecs (Quality of this decoder on ppc is not good) */
488 B(VLC_CODEC_INDEO3, "Indeo Video v3"),
495 B(VLC_CODEC_HUFFYUV, "Huff YUV Video"),
498 B(VLC_CODEC_FFVHUFF, "Huff YUV Video"),
501 /* On2 VP3 Video Codecs */
502 B(VLC_CODEC_VP3, "On2's VP3 Video"),
509 /* On2 VP5, VP6 codecs */
510 B(VLC_CODEC_VP5, "On2's VP5 Video"),
514 B(VLC_CODEC_VP6, "On2's VP6.2 Video"),
517 E("VP60", "On2's VP6.0 Video"),
518 E("VP61", "On2's VP6.1 Video"),
520 B(VLC_CODEC_VP6F, "On2's VP6.2 Video (Flash)"),
524 B(VLC_CODEC_VP6A, "On2's VP6 A Video"),
527 B(VLC_CODEC_VP8, "Google/On2's VP8 Video"),
530 B(VLC_CODEC_VP9, "Google/On2's VP9 Video"),
534 /* Xiph.org theora */
535 B(VLC_CODEC_THEORA, "Xiph.org's Theora Video"),
540 /* Xiph.org tarkin */
541 B(VLC_CODEC_TARKIN, "Xiph.org's Tarkin Video"),
544 /* Asus Video (Another thing that doesn't work on PPC) */
545 B(VLC_CODEC_ASV1, "Asus V1 Video"),
547 B(VLC_CODEC_ASV2, "Asus V2 Video"),
550 /* FFMPEG Video 1 (lossless codec) */
551 B(VLC_CODEC_FFV1, "FFMpeg Video 1"),
555 B(VLC_CODEC_VCR1, "ATI VCR1 Video"),
558 /* Cirrus Logic AccuPak */
559 B(VLC_CODEC_CLJR, "Creative Logic AccuPak"),
563 B(VLC_CODEC_RV10, "RealVideo 1.0"),
567 B(VLC_CODEC_RV13, "RealVideo 1.3"),
571 B(VLC_CODEC_RV20, "RealVideo G2 (2.0)"),
575 B(VLC_CODEC_RV30, "RealVideo 8 (3.0)"),
579 B(VLC_CODEC_RV40, "RealVideo 9/10 (4.0)"),
584 B(VLC_CODEC_RPZA, "Apple Video"),
590 B(VLC_CODEC_SMC, "Apple graphics"),
593 B(VLC_CODEC_CINEPAK, "Cinepak Video"),
597 /* Screen Capture Video Codecs */
598 B(VLC_CODEC_TSCC, "TechSmith Camtasia Screen Capture"),
602 B(VLC_CODEC_CSCD, "CamStudio Screen Codec"),
606 B(VLC_CODEC_ZMBV, "DosBox Capture Codec"),
609 B(VLC_CODEC_VMNC, "VMware Video"),
611 B(VLC_CODEC_FRAPS, "FRAPS: Realtime Video Capture"),
615 /* Duck TrueMotion */
616 B(VLC_CODEC_TRUEMOTION1, "Duck TrueMotion v1 Video"),
619 B(VLC_CODEC_TRUEMOTION2, "Duck TrueMotion v2.0 Video"),
622 B(VLC_CODEC_QTRLE, "Apple QuickTime RLE Video"),
625 B(VLC_CODEC_QDRAW, "Apple QuickDraw Video"),
628 B(VLC_CODEC_QPEG, "QPEG Video"),
633 B(VLC_CODEC_ULTI, "IBM Ultimotion Video"),
636 B(VLC_CODEC_VIXL, "Miro/Pinnacle VideoXL Video"),
639 E("PIXL", "Pinnacle VideoXL Video"),
641 B(VLC_CODEC_LOCO, "LOCO Video"),
644 B(VLC_CODEC_WNV1, "Winnov WNV1 Video"),
647 B(VLC_CODEC_AASC, "Autodesc RLE Video"),
650 B(VLC_CODEC_INDEO2, "Indeo Video v2"),
652 E("RT21", "Indeo Video 2.1" ),
654 /* Flash Screen Video */
655 B(VLC_CODEC_FLASHSV, "Flash Screen Video"),
657 B(VLC_CODEC_FLASHSV2, "Flash Screen Video 2"),
660 B(VLC_CODEC_KMVC, "Karl Morton's Video Codec (Worms)"),
663 B(VLC_CODEC_NUV, "Nuppel Video"),
667 /* CODEC_ID_SMACKVIDEO */
668 B(VLC_CODEC_SMACKVIDEO, "Smacker Video"),
672 /* Chinese AVS - Untested */
673 B(VLC_CODEC_CAVS, "Chinese AVS"),
678 B(VLC_CODEC_AMV, "AMV"),
681 B(VLC_CODEC_DNXHD, "DNxHD"),
683 B(VLC_CODEC_8BPS, "8BPS"),
685 B(VLC_CODEC_MIMIC, "Mimic"),
688 B(VLC_CODEC_CDG, "CD-G Video"),
691 B(VLC_CODEC_FRWU, "Forward Uncompressed" ),
694 B(VLC_CODEC_INDEO4, "Indeo Video v4"),
698 B(VLC_CODEC_INDEO5, "Indeo Video v5"),
702 B(VLC_CODEC_PRORES, "Apple ProRes"),
703 E("apcn", "Apple ProRes 422 Standard"),
704 E("apch", "Apple ProRes 422 HQ"),
705 E("apcs", "Apple ProRes 422 LT"),
706 E("apco", "Apple ProRes 422 Proxy"),
707 E("ap4c", "Apple ProRes 4444"),
708 E("ap4h", "Apple ProRes 4444"),
710 B(VLC_CODEC_ICOD, "Apple Intermediate Codec"),
713 B(VLC_CODEC_G2M2, "GoTo Meeting Codec 2"),
716 B(VLC_CODEC_G2M3, "GoTo Meeting Codec 3"),
719 B(VLC_CODEC_G2M4, "GoTo Meeting Codec 4"),
723 B(VLC_CODEC_YV12, "Planar 4:2:0 YVU"),
726 B(VLC_CODEC_YV9, "Planar 4:1:0 YVU"),
728 B(VLC_CODEC_I410, "Planar 4:1:0 YUV"),
730 B(VLC_CODEC_I411, "Planar 4:1:1 YUV"),
732 B(VLC_CODEC_I420, "Planar 4:2:0 YUV"),
735 B(VLC_CODEC_I422, "Planar 4:2:2 YUV"),
737 B(VLC_CODEC_I440, "Planar 4:4:0 YUV"),
739 B(VLC_CODEC_I444, "Planar 4:4:4 YUV"),
742 B(VLC_CODEC_J420, "Planar 4:2:0 YUV full scale"),
744 B(VLC_CODEC_J422, "Planar 4:2:2 YUV full scale"),
746 B(VLC_CODEC_J440, "Planar 4:4:0 YUV full scale"),
748 B(VLC_CODEC_J444, "Planar 4:4:4 YUV full scale"),
751 B(VLC_CODEC_YUVP, "Palettized YUV with palette element Y:U:V:A"),
754 B(VLC_CODEC_YUVA, "Planar YUV 4:4:4 Y:U:V:A"),
756 B(VLC_CODEC_YUV420A, "Planar YUV 4:2:0 Y:U:V:A"),
758 B(VLC_CODEC_YUV422A, "Planar YUV 4:2:2 Y:U:V:A"),
761 B(VLC_CODEC_RGBP, "Palettized RGB with palette element R:G:B"),
764 B(VLC_CODEC_RGB8, "8 bits RGB"),
766 B(VLC_CODEC_RGB12, "12 bits RGB"),
768 B(VLC_CODEC_RGBA16, "16 bits RGBA"),
770 B(VLC_CODEC_RGB15, "15 bits RGB"),
772 B(VLC_CODEC_RGBT, "16 bits RGBT"),
774 B(VLC_CODEC_RGB16, "16 bits RGB"),
776 B(VLC_CODEC_RGB24, "24 bits RGB"),
778 B(VLC_CODEC_RGB32, "32 bits RGB"),
780 B(VLC_CODEC_RGBA, "32 bits RGBA"),
784 B(VLC_CODEC_GREY, "8 bits greyscale"),
789 B(VLC_CODEC_UYVY, "Packed YUV 4:2:2, U:Y:V:Y"),
800 B(VLC_CODEC_VYUY, "Packed YUV 4:2:2, V:Y:U:Y"),
802 B(VLC_CODEC_YUYV, "Packed YUV 4:2:2, Y:U:Y:V"),
807 B(VLC_CODEC_YVYU, "Packed YUV 4:2:2, Y:V:Y:U"),
810 B(VLC_CODEC_Y211, "Packed YUV 2:1:1, Y:U:Y:V "),
812 B(VLC_CODEC_CYUV, "Creative Packed YUV 4:2:2, U:Y:V:Y, reverted"),
816 B(VLC_CODEC_V210, "10-bit 4:2:2 Component YCbCr"),
819 B(VLC_CODEC_NV12, "Biplanar 4:2:0 Y/UV"),
821 B(VLC_CODEC_NV21, "Biplanar 4:2:0 Y/VU"),
823 B(VLC_CODEC_NV16, "Biplanar 4:2:2 Y/UV"),
825 B(VLC_CODEC_NV61, "Biplanar 4:2:2 Y/VU"),
827 B(VLC_CODEC_NV24, "Biplanar 4:4:4 Y/UV"),
829 B(VLC_CODEC_NV42, "Biplanar 4:4:4 Y/VU"),
832 B(VLC_CODEC_I420_9L, "Planar 4:2:0 YUV 9-bit LE"),
834 B(VLC_CODEC_I420_9B, "Planar 4:2:0 YUV 9-bit BE"),
836 B(VLC_CODEC_I422_9L, "Planar 4:2:2 YUV 9-bit LE"),
838 B(VLC_CODEC_I422_9B, "Planar 4:2:2 YUV 9-bit BE"),
840 B(VLC_CODEC_I444_9L, "Planar 4:4:4 YUV 9-bit LE"),
842 B(VLC_CODEC_I444_9B, "Planar 4:4:4 YUV 9-bit BE"),
845 B(VLC_CODEC_I420_10L, "Planar 4:2:0 YUV 10-bit LE"),
847 B(VLC_CODEC_I420_10B, "Planar 4:2:0 YUV 10-bit BE"),
849 B(VLC_CODEC_I422_10L, "Planar 4:2:2 YUV 10-bit LE"),
851 B(VLC_CODEC_I422_10B, "Planar 4:2:2 YUV 10-bit BE"),
853 B(VLC_CODEC_I444_10L, "Planar 4:4:4 YUV 10-bit LE"),
855 B(VLC_CODEC_I444_10B, "Planar 4:4:4 YUV 10-bit BE"),
858 /* XYZ color space */
859 B(VLC_CODEC_XYZ12, "Packed XYZ 12-bit BE"),
862 /* Videogames Codecs */
865 B(VLC_CODEC_INTERPLAY, "Interplay MVE Video"),
869 /* Id Quake II CIN */
870 B(VLC_CODEC_IDCIN, "Id Quake II CIN Video"),
873 /* 4X Technologies */
874 B(VLC_CODEC_4XM, "4X Technologies Video"),
879 B(VLC_CODEC_ROQ, "Id RoQ Video"),
882 /* Sony Playstation MDEC */
883 B(VLC_CODEC_MDEC, "PSX MDEC Video"),
887 B(VLC_CODEC_VMDVIDEO, "Sierra VMD Video"),
891 B(VLC_CODEC_DIRAC, "Dirac" ),
895 B(VLC_CODEC_PNG, "PNG Image"),
898 B(VLC_CODEC_PPM, "PPM Image"),
901 B(VLC_CODEC_PGM, "PGM Image"),
904 B(VLC_CODEC_PGMYUV, "PGM YUV Image"),
907 B(VLC_CODEC_PAM, "PAM Image"),
910 B(VLC_CODEC_JPEGLS, "JPEG-LS"),
913 B(VLC_CODEC_JPEG, "JPEG"),
917 B(VLC_CODEC_BMP, "BMP Image"),
920 B(VLC_CODEC_TIFF, "TIFF Image"),
923 B(VLC_CODEC_GIF, "GIF Image"),
927 B(VLC_CODEC_TARGA, "Truevision Targa Image"),
932 B(VLC_CODEC_SGI, "SGI Image"),
935 B(VLC_CODEC_PNM, "Portable Anymap Image"),
938 B(VLC_CODEC_PCX, "Personal Computer Exchange Image"),
941 B(VLC_CODEC_XWD, "X Window system raster image"),
943 B(VLC_CODEC_JPEG2000, "JPEG 2000 Image"),
951 B(VLC_CODEC_LAGARITH, "Lagarith Lossless"),
954 B(VLC_CODEC_MXPEG, "Mxpeg"),
957 B(VLC_CODEC_CDXL, "Commodore CDXL video format"),
960 B(VLC_CODEC_BMVVIDEO, "Discworld II BMV video"),
963 B(VLC_CODEC_UTVIDEO, "Ut Video"),
969 B(VLC_CODEC_VBLE, "VBLE Lossless"),
972 B(VLC_CODEC_DXTORY, "Dxtory capture format"),
975 B(VLC_CODEC_MSS1, "Windows Media Video 7 Screen"),
979 B(VLC_CODEC_MSS2, "Windows Media Video 9 Screen"),
983 B(VLC_CODEC_MSA1, "Microsoft Application Screen Decoder 1"),
986 B(VLC_CODEC_TSC2, "TechSmith Screen Codec 2"),
990 B(VLC_CODEC_MTS2, "Microsoft Expression Encoder Screen"),
995 static const staticentry_t p_list_audio[] = {
997 /* Windows Media Audio 1 */
998 B(VLC_CODEC_WMA1, "Windows Media Audio 1"),
1002 /* Windows Media Audio 2 */
1003 B(VLC_CODEC_WMA2, "Windows Media Audio 2"),
1008 /* Windows Media Audio Professional */
1009 B(VLC_CODEC_WMAP, "Windows Media Audio Professional"),
1013 /* Windows Media Audio Lossless */
1014 B(VLC_CODEC_WMAL, "Windows Media Audio Lossless"),
1018 /* Windows Media Audio Speech */
1019 B(VLC_CODEC_WMAS, "Windows Media Audio Voice (Speech)"),
1024 B(VLC_CODEC_DVAUDIO, "DV Audio"),
1031 B(VLC_CODEC_MACE3, "MACE-3 Audio"),
1035 B(VLC_CODEC_MACE6, "MACE-6 Audio"),
1038 /* MUSEPACK7 Audio */
1039 B(VLC_CODEC_MUSEPACK7, "MUSEPACK7 Audio"),
1042 /* MUSEPACK8 Audio */
1043 B(VLC_CODEC_MUSEPACK8, "MUSEPACK8 Audio"),
1048 B(VLC_CODEC_RA_144, "RealAudio 1.0"),
1053 B(VLC_CODEC_RA_288, "RealAudio 2.0"),
1056 B(VLC_CODEC_SIPR, "RealAudio Sipr"),
1059 /* MPEG Audio layer 1/2/3 */
1060 B(VLC_CODEC_MPGA, "MPEG Audio layer 1/2/3"),
1072 /* A52 Audio (aka AC3) */
1073 B(VLC_CODEC_A52, "A52 Audio (aka AC3)"),
1080 B(VLC_CODEC_EAC3, "A/52 B Audio (aka E-AC3)"),
1084 B(VLC_CODEC_DTS, "DTS Audio"),
1089 E("dtse", "DTS Express"),
1090 E("dtsh", "DTS-HD High Resolution Audio"),
1091 E("dtsl", "DTS-HD Lossless"),
1095 B(VLC_CODEC_MP4A, "MPEG AAC Audio"),
1102 B(VLC_CODEC_ALS, "MPEG-4 Audio Lossless (ALS)"),
1105 /* 4X Technologies */
1106 B(VLC_CODEC_ADPCM_4XM, "4X Technologies Audio"),
1110 B(VLC_CODEC_ADPCM_EA, "EA ADPCM Audio"),
1113 /* Interplay DPCM */
1114 B(VLC_CODEC_INTERPLAY_DPCM, "Interplay DPCM Audio"),
1118 B(VLC_CODEC_ROQ_DPCM, "Id RoQ DPCM Audio"),
1122 B(VLC_CODEC_DSICINAUDIO, "Delphine CIN Audio"),
1125 /* Sony Playstation XA ADPCM */
1126 B(VLC_CODEC_ADPCM_XA, "PSX XA ADPCM Audio"),
1130 B(VLC_CODEC_ADPCM_ADX, "ADX ADPCM Audio"),
1133 /* Westwood ADPCM */
1134 B(VLC_CODEC_ADPCM_IMA_WS, "Westwood IMA ADPCM audio"),
1138 B(VLC_CODEC_ADPCM_MS, "MS ADPCM audio"),
1142 B(VLC_CODEC_VMDAUDIO, "Sierra VMD Audio"),
1146 B(VLC_CODEC_ADPCM_G726, "G.726 ADPCM Audio"),
1150 B(VLC_CODEC_ADPCM_G722, "G.722 ADPCM Audio"),
1154 B(VLC_CODEC_ADPCM_SWF, "Flash ADPCM Audio"),
1157 B(VLC_CODEC_ADPCM_IMA_WAV, "IMA WAV ADPCM Audio"),
1160 B(VLC_CODEC_ADPCM_IMA_AMV, "IMA AMV ADPCM Audio"),
1163 B(VLC_CODEC_ADPCM_IMA_QT, "IMA QT ADPCM Audio"),
1166 B(VLC_CODEC_ADPCM_YAMAHA, "Yamaha ADPCM Audio" ),
1170 B(VLC_CODEC_AMR_NB, "AMR narrow band"),
1173 B(VLC_CODEC_AMR_WB, "AMR wide band"),
1177 B(VLC_CODEC_FLAC, "FLAC (Free Lossless Audio Codec)"),
1181 B(VLC_CODEC_ALAC, "Apple Lossless Audio Codec"),
1185 B(VLC_CODEC_QDM2, "QDM2 Audio"),
1189 B(VLC_CODEC_COOK, "Cook Audio"),
1192 /* TTA: The Lossless True Audio */
1193 B(VLC_CODEC_TTA, "The Lossless True Audio"),
1197 B(VLC_CODEC_SHORTEN, "Shorten Lossless Audio"),
1201 B(VLC_CODEC_WAVPACK, "WavPack"),
1205 B(VLC_CODEC_GSM, "GSM Audio"),
1208 B(VLC_CODEC_GSM_MS, "Microsoft GSM Audio"),
1211 B(VLC_CODEC_ATRAC1, "atrac 1"),
1214 B(VLC_CODEC_ATRAC3, "atrac 3"),
1216 A("\x70\x02\x00\x00"),
1218 B(VLC_CODEC_IMC, "IMC" ),
1219 A("\x01\x04\x00\x00"),
1221 B(VLC_CODEC_TRUESPEECH,"TrueSpeech"),
1222 A("\x22\x00\x00\x00"),
1224 B(VLC_CODEC_NELLYMOSER, "NellyMoser ASAO"),
1228 B(VLC_CODEC_APE, "Monkey's Audio"),
1231 B(VLC_CODEC_MLP, "MLP/TrueHD Audio"),
1234 B(VLC_CODEC_TRUEHD, "TrueHD Audio"),
1237 B(VLC_CODEC_QCELP, "QCELP Audio"),
1242 B(VLC_CODEC_SPEEX, "Speex Audio"),
1246 B(VLC_CODEC_VORBIS, "Vorbis Audio"),
1250 B(VLC_CODEC_OPUS, "Opus Audio"),
1253 B(VLC_CODEC_302M, "302M Audio"),
1256 B(VLC_CODEC_DVD_LPCM, "DVD LPCM Audio"),
1259 B(VLC_CODEC_DVDA_LPCM, "DVD-Audio LPCM Audio"),
1262 B(VLC_CODEC_BD_LPCM, "BD LPCM Audio"),
1265 B(VLC_CODEC_SDDS, "SDDS Audio"),
1269 B(VLC_CODEC_MIDI, "MIDI Audio"),
1272 B(VLC_CODEC_RALF, "RealAudio Lossless"),
1276 B(VLC_CODEC_G723_1, "G.723.1 Audio"),
1280 B(VLC_CODEC_S8, "PCM S8"),
1283 B(VLC_CODEC_U8, "PCM U8"),
1286 B(VLC_CODEC_S16L, "PCM S16 LE"),
1289 B(VLC_CODEC_S16B, "PCM S16 BE"),
1292 B(VLC_CODEC_U16L, "PCM U16 LE"),
1295 B(VLC_CODEC_U16B, "PCM U16 BE"),
1298 B(VLC_CODEC_S20B, "PCM S20 BE"),
1300 B(VLC_CODEC_S24L, "PCM S24 LE"),
1302 A("42ni"), /* Quicktime */
1304 B(VLC_CODEC_S24B, "PCM S24 BE"),
1306 A("in24"), /* Quicktime */
1308 B(VLC_CODEC_U24L, "PCM U24 LE"),
1311 B(VLC_CODEC_U24B, "PCM U24 BE"),
1314 B(VLC_CODEC_S24L32, "PCM S24 in 32 LE"),
1316 B(VLC_CODEC_S24B32, "PCM S24 in 32 BE"),
1318 B(VLC_CODEC_S32L, "PCM S32 LE"),
1320 A("23ni"), /* Quicktime */
1322 B(VLC_CODEC_S32B, "PCM S32 BE"),
1324 A("in32"), /* Quicktime */
1326 B(VLC_CODEC_U32L, "PCM U32 LE"),
1329 B(VLC_CODEC_U32B, "PCM U32 BE"),
1332 B(VLC_CODEC_ALAW, "PCM ALAW"),
1335 B(VLC_CODEC_MULAW, "PCM MU-LAW"),
1339 B(VLC_CODEC_DAT12, "12 bits DAT audio"),
1341 B(VLC_CODEC_S24DAUD, "PCM DAUD"),
1344 B(VLC_CODEC_F32L, "32 bits float LE"),
1348 B(VLC_CODEC_F32B, "32 bits float BE"),
1351 B(VLC_CODEC_F64L, "64 bits float LE"),
1354 B(VLC_CODEC_F64L, "64 bits float BE"),
1357 B(VLC_CODEC_TWINVQ, "TwinVQ"),
1360 B(VLC_CODEC_BMVAUDIO, "Discworld II BMV audio"),
1363 B(VLC_CODEC_ULEAD_DV_AUDIO_NTSC, "Ulead DV audio NTSC"),
1365 B(VLC_CODEC_ULEAD_DV_AUDIO_PAL, "Ulead DV audio PAL"),
1368 B(VLC_CODEC_INDEO_AUDIO, "Indeo Audio Coder"),
1373 static const staticentry_t p_list_spu[] = {
1375 B(VLC_CODEC_SPU, "DVD Subtitles"),
1379 B(VLC_CODEC_DVBS, "DVB Subtitles"),
1382 B(VLC_CODEC_SUBT, "Text subtitles with various tags"),
1385 B(VLC_CODEC_XSUB, "DivX XSUB subtitles"),
1390 B(VLC_CODEC_SSA, "SubStation Alpha subtitles"),
1393 B(VLC_CODEC_TEXT, "Plain text subtitles"),
1396 B(VLC_CODEC_TELETEXT, "Teletext"),
1399 B(VLC_CODEC_KATE, "Kate subtitles"),
1402 B(VLC_CODEC_CMML, "CMML annotations/metadata"),
1405 B(VLC_CODEC_ITU_T140, "ITU T.140 subtitles"),
1408 B(VLC_CODEC_USF, "USF subtitles"),
1411 B(VLC_CODEC_OGT, "OGT subtitles"),
1414 B(VLC_CODEC_CVD, "CVD subtitles"),
1417 B(VLC_CODEC_BD_PG, "BD subtitles"),
1420 B(VLC_CODEC_EBU_STL, "EBU STL subtitles"),
1423 B(VLC_CODEC_SCTE_27, "SCTE-27 subtitles"),
1429 /* Create a fourcc from a string.
1430 * XXX it assumes that the string is at least four bytes */
1431 static inline vlc_fourcc_t CreateFourcc( const char *psz_fourcc )
1433 return VLC_FOURCC( psz_fourcc[0], psz_fourcc[1],
1434 psz_fourcc[2], psz_fourcc[3] );
1438 static entry_t Lookup( const staticentry_t p_list[], vlc_fourcc_t i_fourcc )
1440 const char *p_class = NULL;
1441 const char *psz_description = NULL;
1443 entry_t e = B(0, "");
1445 for( int i = 0; ; i++ )
1447 const staticentry_t *p = &p_list[i];
1448 const vlc_fourcc_t i_entry_fourcc = CreateFourcc( p->p_fourcc );
1449 const vlc_fourcc_t i_entry_class = CreateFourcc( p->p_class );
1451 if( i_entry_fourcc == 0 )
1454 if( i_entry_class != 0 )
1456 p_class = p->p_class;
1457 psz_description = p->psz_description;
1460 if( i_entry_fourcc == i_fourcc )
1462 assert( p_class != NULL );
1464 memcpy( e.p_class, p_class, 4 );
1465 memcpy( e.p_fourcc, p->p_fourcc, 4 );
1466 e.psz_description = p->psz_description[0] != '\0' ?
1467 p->psz_description : psz_description;
1475 static entry_t Find( int i_cat, vlc_fourcc_t i_fourcc )
1482 return Lookup( p_list_video, i_fourcc );
1484 return Lookup( p_list_audio, i_fourcc );
1486 return Lookup( p_list_spu, i_fourcc );
1489 e = Find( VIDEO_ES, i_fourcc );
1490 if( CreateFourcc( e.p_class ) == 0 )
1491 e = Find( AUDIO_ES, i_fourcc );
1492 if( CreateFourcc( e.p_class ) == 0 )
1493 e = Find( SPU_ES, i_fourcc );
1499 vlc_fourcc_t vlc_fourcc_GetCodec( int i_cat, vlc_fourcc_t i_fourcc )
1501 entry_t e = Find( i_cat, i_fourcc );
1503 if( CreateFourcc( e.p_class ) == 0 )
1505 return CreateFourcc( e.p_class );
1508 vlc_fourcc_t vlc_fourcc_GetCodecFromString( int i_cat, const char *psz_fourcc )
1510 if( !psz_fourcc || strlen(psz_fourcc) != 4 )
1512 return vlc_fourcc_GetCodec( i_cat,
1513 VLC_FOURCC( psz_fourcc[0], psz_fourcc[1],
1514 psz_fourcc[2], psz_fourcc[3] ) );
1517 vlc_fourcc_t vlc_fourcc_GetCodecAudio( vlc_fourcc_t i_fourcc, int i_bits )
1519 const int i_bytes = ( i_bits + 7 ) / 8;
1521 if( i_fourcc == VLC_FOURCC( 'a', 'f', 'l', 't' ) )
1526 return VLC_CODEC_FL32;
1528 return VLC_CODEC_FL64;
1533 else if( i_fourcc == VLC_FOURCC( 'a', 'r', 'a', 'w' ) )
1538 return VLC_CODEC_U8;
1540 return VLC_CODEC_S16L;
1542 return VLC_CODEC_S24L;
1545 return VLC_CODEC_S32L;
1550 else if( i_fourcc == VLC_FOURCC( 't', 'w', 'o', 's' ) )
1555 return VLC_CODEC_S8;
1557 return VLC_CODEC_S16B;
1559 return VLC_CODEC_S24B;
1561 return VLC_CODEC_S32B;
1566 else if( i_fourcc == VLC_FOURCC( 's', 'o', 'w', 't' ) )
1571 return VLC_CODEC_S8;
1573 return VLC_CODEC_S16L;
1575 return VLC_CODEC_S24L;
1577 return VLC_CODEC_S32L;
1584 return vlc_fourcc_GetCodec( AUDIO_ES, i_fourcc );
1589 const char *vlc_fourcc_GetDescription( int i_cat, vlc_fourcc_t i_fourcc )
1591 entry_t e = Find( i_cat, i_fourcc );
1593 return e.psz_description;
1598 #define VLC_CODEC_YUV_PLANAR_410 \
1599 VLC_CODEC_I410, VLC_CODEC_YV9
1601 #define VLC_CODEC_YUV_PLANAR_420 \
1602 VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420
1604 #define VLC_CODEC_YUV_SEMIPLANAR_420 \
1605 VLC_CODEC_NV12, VLC_CODEC_NV21
1607 #define VLC_CODEC_YUV_PLANAR_420_16 \
1608 VLC_CODEC_I420_10L, VLC_CODEC_I420_10B, VLC_CODEC_I420_9L, VLC_CODEC_I420_9B
1610 #define VLC_CODEC_YUV_PLANAR_422 \
1611 VLC_CODEC_I422, VLC_CODEC_J422
1613 #define VLC_CODEC_YUV_SEMIPLANAR_422 \
1614 VLC_CODEC_NV16, VLC_CODEC_NV61
1616 #define VLC_CODEC_YUV_PLANAR_422_16 \
1617 VLC_CODEC_I422_10L, VLC_CODEC_I422_10B, VLC_CODEC_I422_9L, VLC_CODEC_I422_9B
1619 #define VLC_CODEC_YUV_PLANAR_440 \
1620 VLC_CODEC_I440, VLC_CODEC_J440
1622 #define VLC_CODEC_YUV_PLANAR_444 \
1623 VLC_CODEC_I444, VLC_CODEC_J444
1625 #define VLC_CODEC_YUV_SEMIPLANAR_444 \
1626 VLC_CODEC_NV24, VLC_CODEC_NV42
1628 #define VLC_CODEC_YUV_PLANAR_444_16 \
1629 VLC_CODEC_I444_10L, VLC_CODEC_I444_10B, VLC_CODEC_I444_9L, VLC_CODEC_I444_9B
1631 #define VLC_CODEC_YUV_PACKED \
1632 VLC_CODEC_YUYV, VLC_CODEC_YVYU, \
1633 VLC_CODEC_UYVY, VLC_CODEC_VYUY
1635 #define VLC_CODEC_FALLBACK_420 \
1636 VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PACKED, \
1637 VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
1638 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1640 static const vlc_fourcc_t p_I420_fallback[] = {
1641 VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420, 0
1643 static const vlc_fourcc_t p_J420_fallback[] = {
1644 VLC_CODEC_J420, VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_FALLBACK_420, 0
1646 static const vlc_fourcc_t p_YV12_fallback[] = {
1647 VLC_CODEC_YV12, VLC_CODEC_I420, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420, 0
1650 #define VLC_CODEC_FALLBACK_420_16 \
1651 VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420
1653 static const vlc_fourcc_t p_I420_9L_fallback[] = {
1654 VLC_CODEC_I420_9L, VLC_CODEC_I420_9B, VLC_CODEC_FALLBACK_420_16, 0
1656 static const vlc_fourcc_t p_I420_9B_fallback[] = {
1657 VLC_CODEC_I420_9B, VLC_CODEC_I420_9L, VLC_CODEC_FALLBACK_420_16, 0
1659 static const vlc_fourcc_t p_I420_10L_fallback[] = {
1660 VLC_CODEC_I420_10L, VLC_CODEC_I420_10B, VLC_CODEC_FALLBACK_420_16, 0
1662 static const vlc_fourcc_t p_I420_10B_fallback[] = {
1663 VLC_CODEC_I420_10B, VLC_CODEC_I420_10L, VLC_CODEC_FALLBACK_420_16, 0
1666 #define VLC_CODEC_FALLBACK_422 \
1667 VLC_CODEC_YUV_PACKED, VLC_CODEC_YUV_PLANAR_420, \
1668 VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
1669 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1671 static const vlc_fourcc_t p_I422_fallback[] = {
1672 VLC_CODEC_I422, VLC_CODEC_J422, VLC_CODEC_FALLBACK_422, 0
1674 static const vlc_fourcc_t p_J422_fallback[] = {
1675 VLC_CODEC_J422, VLC_CODEC_I422, VLC_CODEC_FALLBACK_422, 0
1678 #define VLC_CODEC_FALLBACK_422_16 \
1679 VLC_CODEC_I422, VLC_CODEC_J422, VLC_CODEC_FALLBACK_422
1681 static const vlc_fourcc_t p_I422_9L_fallback[] = {
1682 VLC_CODEC_I422_9L, VLC_CODEC_I422_9B, VLC_CODEC_FALLBACK_422_16, 0
1684 static const vlc_fourcc_t p_I422_9B_fallback[] = {
1685 VLC_CODEC_I422_9B, VLC_CODEC_I422_9L, VLC_CODEC_FALLBACK_422_16, 0
1687 static const vlc_fourcc_t p_I422_10L_fallback[] = {
1688 VLC_CODEC_I422_10L, VLC_CODEC_I422_10B, VLC_CODEC_FALLBACK_422_16, 0
1690 static const vlc_fourcc_t p_I422_10B_fallback[] = {
1691 VLC_CODEC_I422_10B, VLC_CODEC_I422_10L, VLC_CODEC_FALLBACK_422_16, 0
1694 #define VLC_CODEC_FALLBACK_444 \
1695 VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PACKED, \
1696 VLC_CODEC_YUV_PLANAR_420, VLC_CODEC_YUV_PLANAR_440, \
1697 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1699 static const vlc_fourcc_t p_I444_fallback[] = {
1700 VLC_CODEC_I444, VLC_CODEC_J444, VLC_CODEC_FALLBACK_444, 0
1702 static const vlc_fourcc_t p_J444_fallback[] = {
1703 VLC_CODEC_J444, VLC_CODEC_I444, VLC_CODEC_FALLBACK_444, 0
1706 #define VLC_CODEC_FALLBACK_444_16 \
1707 VLC_CODEC_I444, VLC_CODEC_J444, VLC_CODEC_FALLBACK_444
1709 static const vlc_fourcc_t p_I444_9L_fallback[] = {
1710 VLC_CODEC_I444_9L, VLC_CODEC_I444_9B, VLC_CODEC_FALLBACK_444_16, 0
1712 static const vlc_fourcc_t p_I444_9B_fallback[] = {
1713 VLC_CODEC_I444_9B, VLC_CODEC_I444_9L, VLC_CODEC_FALLBACK_444_16, 0
1715 static const vlc_fourcc_t p_I444_10L_fallback[] = {
1716 VLC_CODEC_I444_10L, VLC_CODEC_I444_10B, VLC_CODEC_FALLBACK_444_16, 0
1718 static const vlc_fourcc_t p_I444_10B_fallback[] = {
1719 VLC_CODEC_I444_10B, VLC_CODEC_I444_10L, VLC_CODEC_FALLBACK_444_16, 0
1722 static const vlc_fourcc_t p_I440_fallback[] = {
1724 VLC_CODEC_YUV_PLANAR_420,
1725 VLC_CODEC_YUV_PLANAR_422,
1726 VLC_CODEC_YUV_PLANAR_444,
1727 VLC_CODEC_YUV_PACKED,
1728 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211, 0
1731 #define VLC_CODEC_FALLBACK_PACKED \
1732 VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PLANAR_420, \
1733 VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
1734 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1736 static const vlc_fourcc_t p_YUYV_fallback[] = {
1741 VLC_CODEC_FALLBACK_PACKED, 0
1743 static const vlc_fourcc_t p_YVYU_fallback[] = {
1748 VLC_CODEC_FALLBACK_PACKED, 0
1750 static const vlc_fourcc_t p_UYVY_fallback[] = {
1755 VLC_CODEC_FALLBACK_PACKED, 0
1757 static const vlc_fourcc_t p_VYUY_fallback[] = {
1762 VLC_CODEC_FALLBACK_PACKED, 0
1765 static const vlc_fourcc_t *pp_YUV_fallback[] = {
1770 p_I420_10L_fallback,
1771 p_I420_10B_fallback,
1776 p_I422_10L_fallback,
1777 p_I422_10B_fallback,
1783 p_I444_10L_fallback,
1784 p_I444_10B_fallback,
1795 static const vlc_fourcc_t p_list_YUV[] = {
1796 VLC_CODEC_YUV_PLANAR_420,
1797 VLC_CODEC_YUV_SEMIPLANAR_420,
1798 VLC_CODEC_YUV_PLANAR_422,
1799 VLC_CODEC_YUV_SEMIPLANAR_422,
1800 VLC_CODEC_YUV_PLANAR_440,
1801 VLC_CODEC_YUV_PLANAR_444,
1802 VLC_CODEC_YUV_SEMIPLANAR_444,
1803 VLC_CODEC_YUV_PACKED,
1804 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211,
1805 VLC_CODEC_YUV_PLANAR_420_16,
1806 VLC_CODEC_YUV_PLANAR_422_16,
1807 VLC_CODEC_YUV_PLANAR_444_16,
1808 VLC_CODEC_VDPAU_VIDEO_420,
1809 VLC_CODEC_VDPAU_VIDEO_422,
1810 VLC_CODEC_VDPAU_VIDEO_444,
1815 static const vlc_fourcc_t p_RGB32_fallback[] = {
1823 static const vlc_fourcc_t p_RGB24_fallback[] = {
1831 static const vlc_fourcc_t p_RGB16_fallback[] = {
1839 static const vlc_fourcc_t p_RGB15_fallback[] = {
1847 static const vlc_fourcc_t p_RGB8_fallback[] = {
1855 static const vlc_fourcc_t *pp_RGB_fallback[] = {
1866 static const vlc_fourcc_t *GetFallback( vlc_fourcc_t i_fourcc,
1867 const vlc_fourcc_t *pp_fallback[],
1868 const vlc_fourcc_t p_list[] )
1870 for( unsigned i = 0; pp_fallback[i]; i++ )
1872 if( pp_fallback[i][0] == i_fourcc )
1873 return pp_fallback[i];
1878 const vlc_fourcc_t *vlc_fourcc_GetYUVFallback( vlc_fourcc_t i_fourcc )
1880 return GetFallback( i_fourcc, pp_YUV_fallback, p_list_YUV );
1882 const vlc_fourcc_t *vlc_fourcc_GetRGBFallback( vlc_fourcc_t i_fourcc )
1884 return GetFallback( i_fourcc, pp_RGB_fallback, p_RGB32_fallback );
1887 bool vlc_fourcc_AreUVPlanesSwapped( vlc_fourcc_t a, vlc_fourcc_t b )
1889 static const vlc_fourcc_t pp_swapped[][4] = {
1890 { VLC_CODEC_YV12, VLC_CODEC_I420, VLC_CODEC_J420, 0 },
1891 { VLC_CODEC_YV9, VLC_CODEC_I410, 0 },
1895 for( int i = 0; pp_swapped[i][0]; i++ )
1897 if( pp_swapped[i][0] == b )
1903 if( pp_swapped[i][0] != a )
1905 for( int j = 1; pp_swapped[i][j]; j++ )
1907 if( pp_swapped[i][j] == b )
1914 bool vlc_fourcc_IsYUV(vlc_fourcc_t fcc)
1916 for( unsigned i = 0; p_list_YUV[i]; i++ )
1918 if( p_list_YUV[i] == fcc )
1924 #define PLANAR(n, w_den, h_den, size, bits) \
1925 { .plane_count = n, \
1926 .p = { {.w = {1, 1}, .h = {1, 1}}, \
1927 {.w = {1,w_den}, .h = {1,h_den}}, \
1928 {.w = {1,w_den}, .h = {1,h_den}}, \
1929 {.w = {1, 1}, .h = {1, 1}} }, \
1930 .pixel_size = size, \
1931 .pixel_bits = bits }
1933 #define PLANAR_8(n, w_den, h_den) PLANAR(n, w_den, h_den, 1, 8)
1934 #define PLANAR_16(n, w_den, h_den, bits) PLANAR(n, w_den, h_den, 2, bits)
1936 #define PACKED_FMT(size, bits) \
1937 { .plane_count = 1, \
1938 .p = { {.w = {1,1}, .h = {1,1}} }, \
1939 .pixel_size = size, \
1940 .pixel_bits = bits }
1942 /* Zero planes for hardware picture handles. Cannot be manipulated directly. */
1943 #define FAKE_FMT() \
1944 { .plane_count = 0, \
1945 .p = { {.w = {1,1}, .h = {1,1}} }, \
1951 vlc_fourcc_t p_fourcc[6];
1952 vlc_chroma_description_t description;
1953 } p_list_chroma_description[] = {
1954 { { VLC_CODEC_I411, 0 }, PLANAR_8(3, 4, 1) },
1955 { { VLC_CODEC_YUV_PLANAR_410, 0 }, PLANAR_8(3, 4, 4) },
1956 { { VLC_CODEC_YUV_PLANAR_420, 0 }, PLANAR_8(3, 2, 2) },
1957 { { VLC_CODEC_NV12, VLC_CODEC_NV21, 0 }, PLANAR_8(2, 1, 2) },
1958 { { VLC_CODEC_YUV_PLANAR_422, 0 }, PLANAR_8(3, 2, 1) },
1959 { { VLC_CODEC_NV16, VLC_CODEC_NV61, 0 }, PLANAR_8(2, 1, 1) },
1960 { { VLC_CODEC_YUV_PLANAR_440, 0 }, PLANAR_8(3, 1, 2) },
1961 { { VLC_CODEC_YUV_PLANAR_444, 0 }, PLANAR_8(3, 1, 1) },
1962 { { VLC_CODEC_YUVA, 0 }, PLANAR_8(4, 1, 1) },
1963 { { VLC_CODEC_YUV420A, 0 }, PLANAR_8(4, 2, 2) },
1964 { { VLC_CODEC_YUV422A, 0 }, PLANAR_8(4, 2, 1) },
1966 { { VLC_CODEC_I420_10L,
1967 VLC_CODEC_I420_10B, 0 }, PLANAR_16(3, 2, 2, 10) },
1968 { { VLC_CODEC_I420_9L,
1969 VLC_CODEC_I420_9B, 0 }, PLANAR_16(3, 2, 2, 9) },
1970 { { VLC_CODEC_I422_10L,
1971 VLC_CODEC_I422_10B, 0 }, PLANAR_16(3, 2, 1, 10) },
1972 { { VLC_CODEC_I422_9L,
1973 VLC_CODEC_I422_9B, 0 }, PLANAR_16(3, 2, 1, 9) },
1974 { { VLC_CODEC_I444_10L,
1975 VLC_CODEC_I444_10B, 0 }, PLANAR_16(3, 1, 1, 10) },
1976 { { VLC_CODEC_I444_9L,
1977 VLC_CODEC_I444_9B, 0 }, PLANAR_16(3, 1, 1, 9) },
1979 { { VLC_CODEC_YUV_PACKED, 0 }, PACKED_FMT(2, 16) },
1980 { { VLC_CODEC_RGB8, VLC_CODEC_GREY,
1981 VLC_CODEC_YUVP, VLC_CODEC_RGBP, 0 }, PACKED_FMT(1, 8) },
1983 { { VLC_CODEC_RGB15, 0 }, PACKED_FMT(2, 15) },
1984 { { VLC_CODEC_RGB12, 0 }, PACKED_FMT(2, 12) },
1985 { { VLC_CODEC_RGB16, VLC_CODEC_RGBT,
1986 VLC_CODEC_RGBA16, 0 }, PACKED_FMT(2, 16) },
1987 { { VLC_CODEC_RGB24, 0 }, PACKED_FMT(3, 24) },
1988 { { VLC_CODEC_RGB32, 0 }, PACKED_FMT(4, 24) },
1989 { { VLC_CODEC_RGBA, 0 }, PACKED_FMT(4, 32) },
1991 { { VLC_CODEC_Y211, 0 }, { 1, { {{1,4}, {1,1}} }, 4, 32 } },
1992 { { VLC_CODEC_XYZ12, 0 }, PACKED_FMT(6, 48) },
1994 { { VLC_CODEC_VDPAU_VIDEO_420, VLC_CODEC_VDPAU_VIDEO_422,
1995 VLC_CODEC_VDPAU_VIDEO_444,
1996 VLC_CODEC_VDPAU_OUTPUT, 0 }, FAKE_FMT() },
1998 { {0}, { 0, {}, 0, 0 } }
2006 const vlc_chroma_description_t *vlc_fourcc_GetChromaDescription( vlc_fourcc_t i_fourcc )
2008 for( unsigned i = 0; p_list_chroma_description[i].p_fourcc[0]; i++ )
2010 const vlc_fourcc_t *p_fourcc = p_list_chroma_description[i].p_fourcc;
2011 for( unsigned j = 0; p_fourcc[j]; j++ )
2013 if( p_fourcc[j] == i_fourcc )
2014 return &p_list_chroma_description[i].description;