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("xd54", "XDCAM HD422 720p24 50Mb/s CBR"),
119 E("xd55", "XDCAM HD422 720p25 50Mb/s CBR"),
120 E("xd59", "XDCAM HD422 720p60 50Mb/s CBR"),
121 E("xd5a", "XDCAM HD422 720p50 50Mb/s CBR"),
122 E("xd5b", "XDCAM HD422 1080i60 50Mb/s CBR"),
123 E("xd5c", "XDCAM HD422 1080i50 50Mb/s CBR"),
124 E("xd5d", "XDCAM HD422 1080p24 50Mb/s CBR"),
125 E("xd5e", "XDCAM HD422 1080p25 50Mb/s CBR"),
126 E("xd5f", "XDCAM HD422 1080p30 50Mb/s CBR"),
128 E("xdhd", "XDCAM HD 540p"),
129 E("xdh2", "XDCAM HD422 540p"),
131 E("AVmp", "AVID IMX PAL"),
132 E("MMES", "Matrox MPEG-2"),
133 E("mmes", "Matrox MPEG-2"),
134 E("PIM2", "Pinnacle MPEG-2"),
135 E("LMP2", "Lead MPEG-2"),
137 E("VCR2", "ATI VCR-2"),
139 B(VLC_CODEC_MP4V, "MPEG-4 Video"),
148 A("\x04\x00\x00\x00"),
168 E("xvid", "Xvid MPEG-4 Video"),
169 E("XVID", "Xvid MPEG-4 Video"),
170 E("XviD", "Xvid MPEG-4 Video"),
171 E("XVIX", "Xvid MPEG-4 Video"),
172 E("xvix", "Xvid MPEG-4 Video"),
174 E("DX50", "DivX MPEG-4 Video"),
175 E("dx50", "DivX MPEG-4 Video"),
176 E("BLZ0", "Blizzard MPEG-4 Video"),
177 E("DXGM", "Electronic Arts Game MPEG-4 Video"),
178 E("DreX", "DreX Mpeg-4"),
180 E("3IV2", "3ivx MPEG-4 Video"),
181 E("3iv2", "3ivx MPEG-4 Video"),
183 E("UMP4", "UB MPEG-4 Video"),
184 E("SEDG", "Samsung MPEG-4 Video"),
185 E("RMP4", "REALmagic MPEG-4 Video"),
186 E("LMP4", "Lead MPEG-4 Video"),
187 E("HDX4", "Jomigo HDX4 (MPEG-4 Video)"),
188 E("hdx4", "Jomigo HDX4 (MPEG-4 Video)"),
189 E("SMP4", "Samsung SMP4 (MPEG-4 Video)"),
190 E("smp4", "Samsung SMP4 (MPEG-4 Video)"),
191 E("fvfw", "FFmpeg MPEG-4"),
192 E("FVFW", "FFmpeg MPEG-4"),
193 E("FFDS", "FFDShow MPEG-4"),
194 E("VIDM", "vidm 4.01 codec"),
195 E("DP02", "DynaPel MPEG-4 codec"),
196 E("PLV1", "Pelco DVR MPEG-4"),
197 E("QMP4", "QNAP Systems MPEG-4"),
198 /* 3ivx delta 3.5 Unsupported
199 * putting it here gives extreme distorted images */
200 //E("3IV1", "3ivx delta 3.5 MPEG-4 Video"),
201 //E("3iv1", "3ivx delta 3.5 MPEG-4 Video"),
204 B(VLC_CODEC_DIV1, "MS MPEG-4 Video v1"),
212 B(VLC_CODEC_DIV2, "MS MPEG-4 Video v2"),
218 /* MSMPEG4 v3 / M$ mpeg4 v3 */
219 B(VLC_CODEC_DIV3, "MS MPEG-4 Video v3"),
233 E("divf", "DivX 4.12"),
234 E("DIVF", "DivX 4.12"),
240 /* AngelPotion stuff */
242 /* 3ivx doctered divx files */
252 B(VLC_CODEC_SVQ1, "SVQ-1 (Sorenson Video v1)"),
258 B(VLC_CODEC_SVQ3, "SVQ-3 (Sorenson Video v3)"),
262 B(VLC_CODEC_H264, "H264 - MPEG-4 AVC (part 10)"),
267 /* avc1: special case h264 */
270 E("ai5p", "AVC-Intra 50M 720p24/30/60"),
271 E("ai5q", "AVC-Intra 50M 720p25/50"),
272 E("ai52", "AVC-Intra 50M 1080p25/50"),
273 E("ai53", "AVC-Intra 50M 1080p24/30/60"),
274 E("ai55", "AVC-Intra 50M 1080i50"),
275 E("ai56", "AVC-Intra 50M 1080i60"),
276 E("ai1p", "AVC-Intra 100M 720p24/30/60"),
277 E("ai1q", "AVC-Intra 100M 720p25/50"),
278 E("ai12", "AVC-Intra 100M 1080p25/50"),
279 E("ai13", "AVC-Intra 100M 1080p24/30/60"),
280 E("ai15", "AVC-Intra 100M 1080i50"),
281 E("ai16", "AVC-Intra 100M 1080i60"),
282 E("VSSH", "Vanguard VSS H264"),
283 E("VSSW", "Vanguard VSS H264"),
284 E("vssh", "Vanguard VSS H264"),
285 E("DAVC", "Dicas MPEGable H.264/MPEG-4 AVC"),
286 E("davc", "Dicas MPEGable H.264/MPEG-4 AVC"),
287 E("x3eV", "DreX H.264"),
290 /* H263(+) is also known as Real Video 1.0 */
293 B(VLC_CODEC_H263, "H263"),
301 E("D263", "DEC H263"),
302 E("d263", "DEC H263"),
303 E("L263", "LEAD H263"),
304 E("M263", "Microsoft H263"),
305 E("X263", "Xirlink H263"),
307 E("ZyGo", "ITU H263+"),
310 B(VLC_CODEC_H263I, "I263.I"),
315 B(VLC_CODEC_H263P, "ITU H263+"),
316 E("ILVR", "ITU H263+"),
321 E("U263", "UB H263+"),
323 /* Flash (H263) variant */
324 B(VLC_CODEC_FLV1, "Flash Video"),
329 B(VLC_CODEC_H261, "H.261"),
333 B(VLC_CODEC_FLIC, "Flic Video"),
337 B(VLC_CODEC_MJPG, "Motion JPEG Video"),
353 E("AVRn", "Avid Motion JPEG"),
354 E("AVDJ", "Avid Motion JPEG"),
355 E("ADJV", "Avid Motion JPEG"),
356 E("dmb1", "Motion JPEG OpenDML Video"),
357 E("DMB1", "Motion JPEG OpenDML Video"),
358 E("ijpg", "Intergraph JPEG Video"),
359 E("IJPG", "Intergraph JPEG Video"),
360 E("ACDV", "ACD Systems Digital"),
361 E("SLMJ", "SL M-JPEG"),
363 B(VLC_CODEC_MJPGB, "Motion JPEG B Video"),
366 B(VLC_CODEC_LJPG, "Lead Motion JPEG Video"),
368 E("Ljpg", "Lead Motion JPEG"),
370 // ? from avcodec/fourcc.c but makes not sense.
371 //{ VLC_FOURCC( 'L','J','P','G' ), CODEC_ID_MJPEG, VIDEO_ES, "Lead Motion JPEG Video" },
374 B(VLC_CODEC_SP5X, "Sunplus Motion JPEG Video"),
384 B(VLC_CODEC_DV, "DV Video"),
394 E("dvh2", "DV Video 720p24"),
395 E("dvh3", "DV Video 720p25"),
396 E("dvh4", "DV Video 720p30"),
406 E("dvcp", "DV Video PAL"),
407 E("dvc ", "DV Video NTSC" ),
408 E("dvp ", "DV Video Pro"),
409 E("dvpp", "DV Video Pro PAL"),
410 E("dv50", "DV Video C Pro 50"),
411 E("dv5p", "DV Video C Pro 50 PAL"),
412 E("dv5n", "DV Video C Pro 50 NTSC"),
413 E("dv1p", "DV Video C Pro 100 PAL" ),
414 E("dv1n", "DV Video C Pro 100 NTSC" ),
415 E("dvhp", "DV Video C Pro HD 720p" ),
416 E("dvh5", "DV Video C Pro HD 1080i50" ),
417 E("dvh6", "DV Video C Pro HD 1080i60" ),
418 E("AVdv", "AVID DV"),
419 E("AVd1", "AVID DV"),
420 E("CDVC", "Canopus DV Video"),
421 E("cdvc", "Canopus DV Video"),
422 E("CDVH", "Canopus DV Video"),
423 E("cdvh", "Canopus DV Video"),
424 E("CDV5", "Canopus DV Video"),
425 E("SLDV", "SoftLab DVCAM codec"),
427 /* Windows Media Video */
428 B(VLC_CODEC_WMV1, "Windows Media Video 7"),
432 B(VLC_CODEC_WMV2, "Windows Media Video 8"),
436 B(VLC_CODEC_WMV3, "Windows Media Video 9"),
440 /* WMVA is the VC-1 codec before the standardization proces,
441 * it is not bitstream compatible and deprecated */
442 B(VLC_CODEC_WMVA, "Windows Media Video Advanced Profile"),
446 B(VLC_CODEC_VC1, "Windows Media Video VC1"),
452 B(VLC_CODEC_WMVP, "Windows Media Video Presentation"),
456 B(VLC_CODEC_WMVP2, "Windows Media Video Presentation, v2"),
460 /* Microsoft Video 1 */
461 B(VLC_CODEC_MSVIDEO1, "Microsoft Video 1"),
470 B(VLC_CODEC_MSRLE, "Microsoft RLE Video"),
473 A("\x01\x00\x00\x00"),
474 A("\x02\x00\x00\x00"),
476 /* Indeo Video Codecs (Quality of this decoder on ppc is not good) */
477 B(VLC_CODEC_INDEO3, "Indeo Video v3"),
484 B(VLC_CODEC_HUFFYUV, "Huff YUV Video"),
487 B(VLC_CODEC_FFVHUFF, "Huff YUV Video"),
490 /* On2 VP3 Video Codecs */
491 B(VLC_CODEC_VP3, "On2's VP3 Video"),
498 /* On2 VP5, VP6 codecs */
499 B(VLC_CODEC_VP5, "On2's VP5 Video"),
503 B(VLC_CODEC_VP6, "On2's VP6.2 Video"),
506 E("VP60", "On2's VP6.0 Video"),
507 E("VP61", "On2's VP6.1 Video"),
509 B(VLC_CODEC_VP6F, "On2's VP6.2 Video (Flash)"),
513 B(VLC_CODEC_VP6A, "On2's VP6 A Video"),
516 B(VLC_CODEC_VP8, "Google/On2's VP8 Video"),
520 /* Xiph.org theora */
521 B(VLC_CODEC_THEORA, "Xiph.org's Theora Video"),
525 /* Xiph.org tarkin */
526 B(VLC_CODEC_TARKIN, "Xiph.org's Tarkin Video"),
529 /* Asus Video (Another thing that doesn't work on PPC) */
530 B(VLC_CODEC_ASV1, "Asus V1 Video"),
532 B(VLC_CODEC_ASV2, "Asus V2 Video"),
535 /* FFMPEG Video 1 (lossless codec) */
536 B(VLC_CODEC_FFV1, "FFMpeg Video 1"),
540 B(VLC_CODEC_VCR1, "ATI VCR1 Video"),
543 /* Cirrus Logic AccuPak */
544 B(VLC_CODEC_CLJR, "Creative Logic AccuPak"),
548 B(VLC_CODEC_RV10, "RealVideo 1.0"),
552 B(VLC_CODEC_RV13, "RealVideo 1.3"),
556 B(VLC_CODEC_RV20, "RealVideo G2 (2.0)"),
560 B(VLC_CODEC_RV30, "RealVideo 8 (3.0)"),
564 B(VLC_CODEC_RV40, "RealVideo 9/10 (4.0)"),
569 B(VLC_CODEC_RPZA, "Apple Video"),
575 B(VLC_CODEC_SMC, "Apple graphics"),
578 B(VLC_CODEC_CINEPAK, "Cinepak Video"),
582 /* Screen Capture Video Codecs */
583 B(VLC_CODEC_TSCC, "TechSmith Camtasia Screen Capture"),
587 B(VLC_CODEC_CSCD, "CamStudio Screen Codec"),
591 B(VLC_CODEC_ZMBV, "DosBox Capture Codec"),
594 B(VLC_CODEC_VMNC, "VMware Video"),
596 B(VLC_CODEC_FRAPS, "FRAPS: Realtime Video Capture"),
600 /* Duck TrueMotion */
601 B(VLC_CODEC_TRUEMOTION1, "Duck TrueMotion v1 Video"),
604 B(VLC_CODEC_TRUEMOTION2, "Duck TrueMotion v2.0 Video"),
607 /* FFMPEG's SNOW wavelet codec */
608 B(VLC_CODEC_SNOW, "FFMpeg SNOW wavelet Video"),
612 B(VLC_CODEC_QTRLE, "Apple QuickTime RLE Video"),
615 B(VLC_CODEC_QDRAW, "Apple QuickDraw Video"),
618 B(VLC_CODEC_QPEG, "QPEG Video"),
623 B(VLC_CODEC_ULTI, "IBM Ultimotion Video"),
626 B(VLC_CODEC_VIXL, "Miro/Pinnacle VideoXL Video"),
629 E("PIXL", "Pinnacle VideoXL Video"),
631 B(VLC_CODEC_LOCO, "LOCO Video"),
634 B(VLC_CODEC_WNV1, "Winnov WNV1 Video"),
637 B(VLC_CODEC_AASC, "Autodesc RLE Video"),
640 B(VLC_CODEC_INDEO2, "Indeo Video v2"),
642 E("RT21", "Indeo Video 2.1" ),
644 /* Flash Screen Video */
645 B(VLC_CODEC_FLASHSV, "Flash Screen Video"),
647 B(VLC_CODEC_FLASHSV2, "Flash Screen Video 2"),
650 B(VLC_CODEC_KMVC, "Karl Morton's Video Codec (Worms)"),
653 B(VLC_CODEC_NUV, "Nuppel Video"),
657 /* CODEC_ID_SMACKVIDEO */
658 B(VLC_CODEC_SMACKVIDEO, "Smacker Video"),
662 /* Chinese AVS - Untested */
663 B(VLC_CODEC_CAVS, "Chinese AVS"),
668 B(VLC_CODEC_AMV, "AMV"),
671 B(VLC_CODEC_DNXHD, "DNxHD"),
673 B(VLC_CODEC_8BPS, "8BPS"),
675 B(VLC_CODEC_MIMIC, "Mimic"),
678 B(VLC_CODEC_CDG, "CD-G Video"),
681 B(VLC_CODEC_FRWU, "Forward Uncompressed" ),
684 B(VLC_CODEC_INDEO4, "Indeo Video v4"),
688 B(VLC_CODEC_INDEO5, "Indeo Video v5"),
692 B(VLC_CODEC_PRORES, "Apple ProRes 422"),
693 E("apcn", "Apple ProRes 422 Standard"),
694 E("apch", "Apple ProRes 422 HQ"),
695 E("apcs", "Apple ProRes 422 LT"),
696 E("apco", "Apple ProRes 422 Proxy"),
697 E("ap4c", "Apple ProRes 4444"),
698 E("ap4h", "Apple ProRes 4444"),
701 B(VLC_CODEC_YV12, "Planar 4:2:0 YVU"),
704 B(VLC_CODEC_YV9, "Planar 4:1:0 YVU"),
706 B(VLC_CODEC_I410, "Planar 4:1:0 YUV"),
708 B(VLC_CODEC_I411, "Planar 4:1:1 YUV"),
710 B(VLC_CODEC_I420, "Planar 4:2:0 YUV"),
713 B(VLC_CODEC_I422, "Planar 4:2:2 YUV"),
715 B(VLC_CODEC_I440, "Planar 4:4:0 YUV"),
717 B(VLC_CODEC_I444, "Planar 4:4:4 YUV"),
720 B(VLC_CODEC_J420, "Planar 4:2:0 YUV full scale"),
722 B(VLC_CODEC_J422, "Planar 4:2:2 YUV full scale"),
724 B(VLC_CODEC_J440, "Planar 4:4:0 YUV full scale"),
726 B(VLC_CODEC_J444, "Planar 4:4:4 YUV full scale"),
729 B(VLC_CODEC_YUVP, "Palettized YUV with palette element Y:U:V:A"),
732 B(VLC_CODEC_YUVA, "Planar YUV 4:4:4 Y:U:V:A"),
735 B(VLC_CODEC_RGBP, "Palettized RGB with palette element R:G:B"),
738 B(VLC_CODEC_RGB8, "8 bits RGB"),
740 B(VLC_CODEC_RGB12, "12 bits RGB"),
742 B(VLC_CODEC_RGBA16, "16 bits RGBA"),
744 B(VLC_CODEC_RGB15, "15 bits RGB"),
746 B(VLC_CODEC_RGBT, "16 bits RGBT"),
748 B(VLC_CODEC_RGB16, "16 bits RGB"),
750 B(VLC_CODEC_RGB24, "24 bits RGB"),
752 B(VLC_CODEC_RGB32, "32 bits RGB"),
754 B(VLC_CODEC_RGBA, "32 bits RGBA"),
758 B(VLC_CODEC_GREY, "8 bits greyscale"),
763 B(VLC_CODEC_UYVY, "Packed YUV 4:2:2, U:Y:V:Y"),
774 B(VLC_CODEC_VYUY, "Packed YUV 4:2:2, V:Y:U:Y"),
776 B(VLC_CODEC_YUYV, "Packed YUV 4:2:2, Y:U:Y:V"),
781 B(VLC_CODEC_YVYU, "Packed YUV 4:2:2, Y:V:Y:U"),
784 B(VLC_CODEC_Y211, "Packed YUV 2:1:1, Y:U:Y:V "),
786 B(VLC_CODEC_CYUV, "Creative Packed YUV 4:2:2, U:Y:V:Y, reverted"),
790 B(VLC_CODEC_V210, "10-bit 4:2:2 Component YCbCr"),
793 B(VLC_CODEC_NV12, "Biplanar 4:2:0 Y/UV"),
795 B(VLC_CODEC_NV21, "Biplanar 4:2:0 Y/VU"),
797 B(VLC_CODEC_NV16, "Biplanar 4:2:2 Y/UV"),
799 B(VLC_CODEC_NV61, "Biplanar 4:2:2 Y/VU"),
802 B(VLC_CODEC_I420_9L, "Planar 4:2:0 YUV 9-bit LE"),
804 B(VLC_CODEC_I420_9B, "Planar 4:2:0 YUV 9-bit BE"),
806 B(VLC_CODEC_I422_9L, "Planar 4:2:2 YUV 9-bit LE"),
808 B(VLC_CODEC_I422_9B, "Planar 4:2:2 YUV 9-bit BE"),
810 B(VLC_CODEC_I444_9L, "Planar 4:4:4 YUV 9-bit LE"),
812 B(VLC_CODEC_I444_9B, "Planar 4:4:4 YUV 9-bit BE"),
815 B(VLC_CODEC_I420_10L, "Planar 4:2:0 YUV 10-bit LE"),
817 B(VLC_CODEC_I420_10B, "Planar 4:2:0 YUV 10-bit BE"),
819 B(VLC_CODEC_I422_10L, "Planar 4:2:2 YUV 10-bit LE"),
821 B(VLC_CODEC_I422_10B, "Planar 4:2:2 YUV 10-bit BE"),
823 B(VLC_CODEC_I444_10L, "Planar 4:4:4 YUV 10-bit LE"),
825 B(VLC_CODEC_I444_10B, "Planar 4:4:4 YUV 10-bit BE"),
828 /* Videogames Codecs */
831 B(VLC_CODEC_INTERPLAY, "Interplay MVE Video"),
835 /* Id Quake II CIN */
836 B(VLC_CODEC_IDCIN, "Id Quake II CIN Video"),
839 /* 4X Technologies */
840 B(VLC_CODEC_4XM, "4X Technologies Video"),
845 B(VLC_CODEC_ROQ, "Id RoQ Video"),
848 /* Sony Playstation MDEC */
849 B(VLC_CODEC_MDEC, "PSX MDEC Video"),
853 B(VLC_CODEC_VMDVIDEO, "Sierra VMD Video"),
857 B(VLC_CODEC_DIRAC, "Dirac" ),
861 B(VLC_CODEC_PNG, "PNG Image"),
864 B(VLC_CODEC_PPM, "PPM Image"),
867 B(VLC_CODEC_PGM, "PGM Image"),
870 B(VLC_CODEC_PGMYUV, "PGM YUV Image"),
873 B(VLC_CODEC_PAM, "PAM Image"),
876 B(VLC_CODEC_JPEGLS, "JPEG-LS"),
879 B(VLC_CODEC_JPEG, "JPEG"),
883 B(VLC_CODEC_BMP, "BMP Image"),
886 B(VLC_CODEC_TIFF, "TIFF Image"),
889 B(VLC_CODEC_GIF, "GIF Image"),
893 B(VLC_CODEC_TARGA, "Truevision Targa Image"),
898 B(VLC_CODEC_SGI, "SGI Image"),
901 B(VLC_CODEC_PNM, "Portable Anymap Image"),
904 B(VLC_CODEC_PCX, "Personal Computer Exchange Image"),
907 B(VLC_CODEC_JPEG2000, "JPEG 2000 Image"),
915 B(VLC_CODEC_LAGARITH, "Lagarith Lossless"),
918 B(VLC_CODEC_MXPEG, "Mxpeg"),
921 B(VLC_CODEC_CDXL, "Commodore CDXL video format"),
924 B(VLC_CODEC_BMVVIDEO, "Discworld II BMV video"),
927 B(VLC_CODEC_UTVIDEO, "Ut Video"),
933 B(VLC_CODEC_VBLE, "VBLE Lossless"),
936 B(VLC_CODEC_DXTORY, "Dxtory capture format"),
939 B(VLC_CODEC_MSS1, "Windows Media Video 7 Screen"),
943 B(VLC_CODEC_MSS2, "Windows Media Video 9 Screen"),
947 B(VLC_CODEC_MSA1, "Microsoft Application Screen Decoder 1"),
950 B(VLC_CODEC_TSC2, "TechSmith Screen Codec 2"),
954 B(VLC_CODEC_MTS2, "Microsoft Expression Encoder Screen"),
959 static const staticentry_t p_list_audio[] = {
961 /* Windows Media Audio 1 */
962 B(VLC_CODEC_WMA1, "Windows Media Audio 1"),
966 /* Windows Media Audio 2 */
967 B(VLC_CODEC_WMA2, "Windows Media Audio 2"),
972 /* Windows Media Audio Professional */
973 B(VLC_CODEC_WMAP, "Windows Media Audio Professional"),
977 /* Windows Media Audio Lossless */
978 B(VLC_CODEC_WMAL, "Windows Media Audio Lossless"),
982 /* Windows Media Audio Speech */
983 B(VLC_CODEC_WMAS, "Windows Media Audio Voice (Speech)"),
988 B(VLC_CODEC_DVAUDIO, "DV Audio"),
995 B(VLC_CODEC_MACE3, "MACE-3 Audio"),
999 B(VLC_CODEC_MACE6, "MACE-6 Audio"),
1002 /* MUSEPACK7 Audio */
1003 B(VLC_CODEC_MUSEPACK7, "MUSEPACK7 Audio"),
1006 /* MUSEPACK8 Audio */
1007 B(VLC_CODEC_MUSEPACK8, "MUSEPACK8 Audio"),
1012 B(VLC_CODEC_RA_144, "RealAudio 1.0"),
1017 B(VLC_CODEC_RA_288, "RealAudio 2.0"),
1020 B(VLC_CODEC_SIPR, "RealAudio Sipr"),
1023 /* MPEG Audio layer 1/2/3 */
1024 B(VLC_CODEC_MPGA, "MPEG Audio layer 1/2/3"),
1036 /* A52 Audio (aka AC3) */
1037 B(VLC_CODEC_A52, "A52 Audio (aka AC3)"),
1044 B(VLC_CODEC_EAC3, "A/52 B Audio (aka E-AC3)"),
1048 B(VLC_CODEC_DTS, "DTS Audio"),
1053 E("dtse", "DTS Express"),
1054 E("dtsh", "DTS-HD High Resolution Audio"),
1055 E("dtsl", "DTS-HD Lossless"),
1059 B(VLC_CODEC_MP4A, "MPEG AAC Audio"),
1064 B(VLC_CODEC_ALS, "MPEG-4 Audio Lossless (ALS)"),
1067 /* 4X Technologies */
1068 B(VLC_CODEC_ADPCM_4XM, "4X Technologies Audio"),
1072 B(VLC_CODEC_ADPCM_EA, "EA ADPCM Audio"),
1075 /* Interplay DPCM */
1076 B(VLC_CODEC_INTERPLAY_DPCM, "Interplay DPCM Audio"),
1080 B(VLC_CODEC_ROQ_DPCM, "Id RoQ DPCM Audio"),
1084 B(VLC_CODEC_DSICINAUDIO, "Delphine CIN Audio"),
1087 /* Sony Playstation XA ADPCM */
1088 B(VLC_CODEC_ADPCM_XA, "PSX XA ADPCM Audio"),
1092 B(VLC_CODEC_ADPCM_ADX, "ADX ADPCM Audio"),
1095 /* Westwood ADPCM */
1096 B(VLC_CODEC_ADPCM_IMA_WS, "Westwood IMA ADPCM audio"),
1100 B(VLC_CODEC_ADPCM_MS, "MS ADPCM audio"),
1104 B(VLC_CODEC_VMDAUDIO, "Sierra VMD Audio"),
1108 B(VLC_CODEC_ADPCM_G726, "G.726 ADPCM Audio"),
1112 B(VLC_CODEC_ADPCM_G722, "G.722 ADPCM Audio"),
1116 B(VLC_CODEC_ADPCM_SWF, "Flash ADPCM Audio"),
1119 B(VLC_CODEC_ADPCM_IMA_WAV, "IMA WAV ADPCM Audio"),
1122 B(VLC_CODEC_ADPCM_IMA_AMV, "IMA AMV ADPCM Audio"),
1125 B(VLC_CODEC_ADPCM_IMA_QT, "IMA QT ADPCM Audio"),
1128 B(VLC_CODEC_ADPCM_YAMAHA, "Yamaha ADPCM Audio" ),
1132 B(VLC_CODEC_AMR_NB, "AMR narrow band"),
1135 B(VLC_CODEC_AMR_WB, "AMR wide band"),
1139 B(VLC_CODEC_FLAC, "FLAC (Free Lossless Audio Codec)"),
1143 B(VLC_CODEC_ALAC, "Apple Lossless Audio Codec"),
1147 B(VLC_CODEC_QDM2, "QDM2 Audio"),
1151 B(VLC_CODEC_COOK, "Cook Audio"),
1154 /* TTA: The Lossless True Audio */
1155 B(VLC_CODEC_TTA, "The Lossless True Audio"),
1159 B(VLC_CODEC_SHORTEN, "Shorten Lossless Audio"),
1163 B(VLC_CODEC_WAVPACK, "WavPack"),
1167 B(VLC_CODEC_GSM, "GSM Audio"),
1170 B(VLC_CODEC_GSM_MS, "Microsoft GSM Audio"),
1173 B(VLC_CODEC_ATRAC1, "atrac 1"),
1176 B(VLC_CODEC_ATRAC3, "atrac 3"),
1178 A("\x70\x02\x00\x00"),
1180 B(VLC_CODEC_SONIC, "Sonic"),
1183 B(VLC_CODEC_IMC, "IMC" ),
1184 A("\x01\x04\x00\x00"),
1186 B(VLC_CODEC_TRUESPEECH,"TrueSpeech"),
1187 A("\x22\x00\x00\x00"),
1189 B(VLC_CODEC_NELLYMOSER, "NellyMoser ASAO"),
1193 B(VLC_CODEC_APE, "Monkey's Audio"),
1196 B(VLC_CODEC_MLP, "MLP/TrueHD Audio"),
1199 B(VLC_CODEC_TRUEHD, "TrueHD Audio"),
1202 B(VLC_CODEC_QCELP, "QCELP Audio"),
1207 B(VLC_CODEC_SPEEX, "Speex Audio"),
1211 B(VLC_CODEC_VORBIS, "Vorbis Audio"),
1215 B(VLC_CODEC_OPUS, "Opus Audio"),
1218 B(VLC_CODEC_302M, "302M Audio"),
1221 B(VLC_CODEC_DVD_LPCM, "DVD LPCM Audio"),
1224 B(VLC_CODEC_DVDA_LPCM, "DVD-Audio LPCM Audio"),
1227 B(VLC_CODEC_BD_LPCM, "BD LPCM Audio"),
1230 B(VLC_CODEC_SDDS, "SDDS Audio"),
1234 B(VLC_CODEC_MIDI, "MIDI Audio"),
1237 B(VLC_CODEC_RALF, "RealAudio Lossless"),
1241 B(VLC_CODEC_S8, "PCM S8"),
1244 B(VLC_CODEC_U8, "PCM U8"),
1247 B(VLC_CODEC_S16L, "PCM S16 LE"),
1250 B(VLC_CODEC_S16B, "PCM S16 BE"),
1253 B(VLC_CODEC_U16L, "PCM U16 LE"),
1256 B(VLC_CODEC_U16B, "PCM U16 BE"),
1259 B(VLC_CODEC_S20B, "PCM S20 BE"),
1261 B(VLC_CODEC_S24L, "PCM S24 LE"),
1263 A("42ni"), /* Quicktime */
1265 B(VLC_CODEC_S24B, "PCM S24 BE"),
1267 A("in24"), /* Quicktime */
1269 B(VLC_CODEC_U24L, "PCM U24 LE"),
1272 B(VLC_CODEC_U24B, "PCM U24 BE"),
1275 B(VLC_CODEC_S32L, "PCM S32 LE"),
1277 A("23ni"), /* Quicktime */
1279 B(VLC_CODEC_S32B, "PCM S32 BE"),
1281 A("in32"), /* Quicktime */
1283 B(VLC_CODEC_U32L, "PCM U32 LE"),
1286 B(VLC_CODEC_U32B, "PCM U32 BE"),
1289 B(VLC_CODEC_ALAW, "PCM ALAW"),
1292 B(VLC_CODEC_MULAW, "PCM MU-LAW"),
1296 B(VLC_CODEC_DAT12, "12 bits DAT audio"),
1298 B(VLC_CODEC_S24DAUD, "PCM DAUD"),
1301 B(VLC_CODEC_FI32, "32 bits fixed float"),
1304 B(VLC_CODEC_F32L, "32 bits float LE"),
1308 B(VLC_CODEC_F32B, "32 bits float BE"),
1311 B(VLC_CODEC_F64L, "64 bits float LE"),
1314 B(VLC_CODEC_F64L, "64 bits float BE"),
1317 B(VLC_CODEC_TWINVQ, "TwinVQ"),
1320 B(VLC_CODEC_BMVAUDIO, "Discworld II BMV audio"),
1323 B(VLC_CODEC_ULEAD_DV_AUDIO_NTSC, "Ulead DV audio NTSC"),
1325 B(VLC_CODEC_ULEAD_DV_AUDIO_PAL, "Ulead DV audio PAL"),
1328 B(VLC_CODEC_INDEO_AUDIO, "Indeo Audio Coder"),
1333 static const staticentry_t p_list_spu[] = {
1335 B(VLC_CODEC_SPU, "DVD Subtitles"),
1339 B(VLC_CODEC_DVBS, "DVB Subtitles"),
1342 B(VLC_CODEC_SUBT, "Text subtitles with various tags"),
1345 B(VLC_CODEC_XSUB, "DivX XSUB subtitles"),
1350 B(VLC_CODEC_SSA, "SubStation Alpha subtitles"),
1353 B(VLC_CODEC_TEXT, "Plain text subtitles"),
1356 B(VLC_CODEC_TELETEXT, "Teletext"),
1359 B(VLC_CODEC_KATE, "Kate subtitles"),
1362 B(VLC_CODEC_CMML, "CMML annotations/metadata"),
1365 B(VLC_CODEC_ITU_T140, "ITU T.140 subtitles"),
1368 B(VLC_CODEC_USF, "USF subtitles"),
1371 B(VLC_CODEC_OGT, "OGT subtitles"),
1374 B(VLC_CODEC_CVD, "CVD subtitles"),
1377 B(VLC_CODEC_BD_PG, "BD subtitles"),
1380 B(VLC_CODEC_EBU_STL, "EBU STL subtitles"),
1386 /* Create a fourcc from a string.
1387 * XXX it assumes that the string is at least four bytes */
1388 static inline vlc_fourcc_t CreateFourcc( const char *psz_fourcc )
1390 return VLC_FOURCC( psz_fourcc[0], psz_fourcc[1],
1391 psz_fourcc[2], psz_fourcc[3] );
1395 static entry_t Lookup( const staticentry_t p_list[], vlc_fourcc_t i_fourcc )
1397 const char *p_class = NULL;
1398 const char *psz_description = NULL;
1400 entry_t e = B(0, "");
1402 for( int i = 0; ; i++ )
1404 const staticentry_t *p = &p_list[i];
1405 const vlc_fourcc_t i_entry_fourcc = CreateFourcc( p->p_fourcc );
1406 const vlc_fourcc_t i_entry_class = CreateFourcc( p->p_class );
1408 if( i_entry_fourcc == 0 )
1411 if( i_entry_class != 0 )
1413 p_class = p->p_class;
1414 psz_description = p->psz_description;
1417 if( i_entry_fourcc == i_fourcc )
1419 assert( p_class != NULL );
1421 memcpy( e.p_class, p_class, 4 );
1422 memcpy( e.p_fourcc, p->p_fourcc, 4 );
1423 e.psz_description = p->psz_description ?
1424 p->psz_description : psz_description;
1432 static entry_t Find( int i_cat, vlc_fourcc_t i_fourcc )
1439 return Lookup( p_list_video, i_fourcc );
1441 return Lookup( p_list_audio, i_fourcc );
1443 return Lookup( p_list_spu, i_fourcc );
1446 e = Find( VIDEO_ES, i_fourcc );
1447 if( CreateFourcc( e.p_class ) == 0 )
1448 e = Find( AUDIO_ES, i_fourcc );
1449 if( CreateFourcc( e.p_class ) == 0 )
1450 e = Find( SPU_ES, i_fourcc );
1456 vlc_fourcc_t vlc_fourcc_GetCodec( int i_cat, vlc_fourcc_t i_fourcc )
1458 entry_t e = Find( i_cat, i_fourcc );
1460 if( CreateFourcc( e.p_class ) == 0 )
1462 return CreateFourcc( e.p_class );
1465 vlc_fourcc_t vlc_fourcc_GetCodecFromString( int i_cat, const char *psz_fourcc )
1467 if( !psz_fourcc || strlen(psz_fourcc) != 4 )
1469 return vlc_fourcc_GetCodec( i_cat,
1470 VLC_FOURCC( psz_fourcc[0], psz_fourcc[1],
1471 psz_fourcc[2], psz_fourcc[3] ) );
1474 vlc_fourcc_t vlc_fourcc_GetCodecAudio( vlc_fourcc_t i_fourcc, int i_bits )
1476 const int i_bytes = ( i_bits + 7 ) / 8;
1478 if( i_fourcc == VLC_FOURCC( 'a', 'f', 'l', 't' ) )
1483 return VLC_CODEC_FL32;
1485 return VLC_CODEC_FL64;
1490 else if( i_fourcc == VLC_FOURCC( 'a', 'r', 'a', 'w' ) ||
1491 i_fourcc == VLC_FOURCC( 'p', 'c', 'm', ' ' ) )
1496 return VLC_CODEC_U8;
1498 return VLC_CODEC_S16L;
1500 return VLC_CODEC_S24L;
1503 return VLC_CODEC_S32L;
1508 else if( i_fourcc == VLC_FOURCC( 't', 'w', 'o', 's' ) )
1513 return VLC_CODEC_S8;
1515 return VLC_CODEC_S16B;
1517 return VLC_CODEC_S24B;
1519 return VLC_CODEC_S32B;
1524 else if( i_fourcc == VLC_FOURCC( 's', 'o', 'w', 't' ) )
1529 return VLC_CODEC_S8;
1531 return VLC_CODEC_S16L;
1533 return VLC_CODEC_S24L;
1535 return VLC_CODEC_S32L;
1542 return vlc_fourcc_GetCodec( AUDIO_ES, i_fourcc );
1547 const char *vlc_fourcc_GetDescription( int i_cat, vlc_fourcc_t i_fourcc )
1549 entry_t e = Find( i_cat, i_fourcc );
1551 return e.psz_description;
1556 #define VLC_CODEC_YUV_PLANAR_410 \
1557 VLC_CODEC_I410, VLC_CODEC_YV9
1559 #define VLC_CODEC_YUV_PLANAR_420 \
1560 VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420
1562 #define VLC_CODEC_YUV_PLANAR_420_16 \
1563 VLC_CODEC_I420_10L, VLC_CODEC_I420_10B, VLC_CODEC_I420_9L, VLC_CODEC_I420_9B
1565 #define VLC_CODEC_YUV_PLANAR_422 \
1566 VLC_CODEC_I422, VLC_CODEC_J422
1568 #define VLC_CODEC_YUV_PLANAR_422_16 \
1569 VLC_CODEC_I422_10L, VLC_CODEC_I422_10B, VLC_CODEC_I422_9L, VLC_CODEC_I422_9B
1571 #define VLC_CODEC_YUV_PLANAR_440 \
1572 VLC_CODEC_I440, VLC_CODEC_J440
1574 #define VLC_CODEC_YUV_PLANAR_444 \
1575 VLC_CODEC_I444, VLC_CODEC_J444
1577 #define VLC_CODEC_YUV_PLANAR_444_16 \
1578 VLC_CODEC_I444_10L, VLC_CODEC_I444_10B, VLC_CODEC_I444_9L, VLC_CODEC_I444_9B
1580 #define VLC_CODEC_YUV_PACKED \
1581 VLC_CODEC_YUYV, VLC_CODEC_YVYU, \
1582 VLC_CODEC_UYVY, VLC_CODEC_VYUY
1584 #define VLC_CODEC_FALLBACK_420 \
1585 VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PACKED, \
1586 VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
1587 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1589 static const vlc_fourcc_t p_I420_fallback[] = {
1590 VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420, 0
1592 static const vlc_fourcc_t p_J420_fallback[] = {
1593 VLC_CODEC_J420, VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_FALLBACK_420, 0
1595 static const vlc_fourcc_t p_YV12_fallback[] = {
1596 VLC_CODEC_YV12, VLC_CODEC_I420, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420, 0
1599 #define VLC_CODEC_FALLBACK_420_16 \
1600 VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420
1602 static const vlc_fourcc_t p_I420_9L_fallback[] = {
1603 VLC_CODEC_I420_9L, VLC_CODEC_I420_9B, VLC_CODEC_FALLBACK_420_16, 0
1605 static const vlc_fourcc_t p_I420_9B_fallback[] = {
1606 VLC_CODEC_I420_9B, VLC_CODEC_I420_9L, VLC_CODEC_FALLBACK_420_16, 0
1608 static const vlc_fourcc_t p_I420_10L_fallback[] = {
1609 VLC_CODEC_I420_10L, VLC_CODEC_I420_10B, VLC_CODEC_FALLBACK_420_16, 0
1611 static const vlc_fourcc_t p_I420_10B_fallback[] = {
1612 VLC_CODEC_I420_10B, VLC_CODEC_I420_10L, VLC_CODEC_FALLBACK_420_16, 0
1615 #define VLC_CODEC_FALLBACK_422 \
1616 VLC_CODEC_YUV_PACKED, VLC_CODEC_YUV_PLANAR_420, \
1617 VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
1618 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1620 static const vlc_fourcc_t p_I422_fallback[] = {
1621 VLC_CODEC_I422, VLC_CODEC_J422, VLC_CODEC_FALLBACK_422, 0
1623 static const vlc_fourcc_t p_J422_fallback[] = {
1624 VLC_CODEC_J422, VLC_CODEC_I422, VLC_CODEC_FALLBACK_422, 0
1627 #define VLC_CODEC_FALLBACK_422_16 \
1628 VLC_CODEC_I422, VLC_CODEC_J422, VLC_CODEC_FALLBACK_422
1630 static const vlc_fourcc_t p_I422_9L_fallback[] = {
1631 VLC_CODEC_I422_9L, VLC_CODEC_I422_9B, VLC_CODEC_FALLBACK_422_16, 0
1633 static const vlc_fourcc_t p_I422_9B_fallback[] = {
1634 VLC_CODEC_I422_9B, VLC_CODEC_I422_9L, VLC_CODEC_FALLBACK_422_16, 0
1636 static const vlc_fourcc_t p_I422_10L_fallback[] = {
1637 VLC_CODEC_I422_10L, VLC_CODEC_I422_10B, VLC_CODEC_FALLBACK_422_16, 0
1639 static const vlc_fourcc_t p_I422_10B_fallback[] = {
1640 VLC_CODEC_I422_10B, VLC_CODEC_I422_10L, VLC_CODEC_FALLBACK_422_16, 0
1643 #define VLC_CODEC_FALLBACK_444 \
1644 VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PACKED, \
1645 VLC_CODEC_YUV_PLANAR_420, VLC_CODEC_YUV_PLANAR_440, \
1646 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1648 static const vlc_fourcc_t p_I444_fallback[] = {
1649 VLC_CODEC_I444, VLC_CODEC_J444, VLC_CODEC_FALLBACK_444, 0
1651 static const vlc_fourcc_t p_J444_fallback[] = {
1652 VLC_CODEC_J444, VLC_CODEC_I444, VLC_CODEC_FALLBACK_444, 0
1655 #define VLC_CODEC_FALLBACK_444_16 \
1656 VLC_CODEC_I444, VLC_CODEC_J444, VLC_CODEC_FALLBACK_444
1658 static const vlc_fourcc_t p_I444_9L_fallback[] = {
1659 VLC_CODEC_I444_9L, VLC_CODEC_I444_9B, VLC_CODEC_FALLBACK_444_16, 0
1661 static const vlc_fourcc_t p_I444_9B_fallback[] = {
1662 VLC_CODEC_I444_9B, VLC_CODEC_I444_9L, VLC_CODEC_FALLBACK_444_16, 0
1664 static const vlc_fourcc_t p_I444_10L_fallback[] = {
1665 VLC_CODEC_I444_10L, VLC_CODEC_I444_10B, VLC_CODEC_FALLBACK_444_16, 0
1667 static const vlc_fourcc_t p_I444_10B_fallback[] = {
1668 VLC_CODEC_I444_10B, VLC_CODEC_I444_10L, VLC_CODEC_FALLBACK_444_16, 0
1671 static const vlc_fourcc_t p_I440_fallback[] = {
1673 VLC_CODEC_YUV_PLANAR_420,
1674 VLC_CODEC_YUV_PLANAR_422,
1675 VLC_CODEC_YUV_PLANAR_444,
1676 VLC_CODEC_YUV_PACKED,
1677 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211, 0
1680 #define VLC_CODEC_FALLBACK_PACKED \
1681 VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PLANAR_420, \
1682 VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
1683 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1685 static const vlc_fourcc_t p_YUYV_fallback[] = {
1690 VLC_CODEC_FALLBACK_PACKED, 0
1692 static const vlc_fourcc_t p_YVYU_fallback[] = {
1697 VLC_CODEC_FALLBACK_PACKED, 0
1699 static const vlc_fourcc_t p_UYVY_fallback[] = {
1704 VLC_CODEC_FALLBACK_PACKED, 0
1706 static const vlc_fourcc_t p_VYUY_fallback[] = {
1711 VLC_CODEC_FALLBACK_PACKED, 0
1714 static const vlc_fourcc_t *pp_YUV_fallback[] = {
1719 p_I420_10L_fallback,
1720 p_I420_10B_fallback,
1725 p_I422_10L_fallback,
1726 p_I422_10B_fallback,
1732 p_I444_10L_fallback,
1733 p_I444_10B_fallback,
1744 static const vlc_fourcc_t p_list_YUV[] = {
1745 VLC_CODEC_YUV_PLANAR_420,
1746 VLC_CODEC_YUV_PLANAR_422,
1747 VLC_CODEC_YUV_PLANAR_440,
1748 VLC_CODEC_YUV_PLANAR_444,
1749 VLC_CODEC_YUV_PACKED,
1750 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211,
1751 VLC_CODEC_YUV_PLANAR_420_16,
1752 VLC_CODEC_YUV_PLANAR_422_16,
1753 VLC_CODEC_YUV_PLANAR_444_16,
1758 static const vlc_fourcc_t p_RGB32_fallback[] = {
1766 static const vlc_fourcc_t p_RGB24_fallback[] = {
1774 static const vlc_fourcc_t p_RGB16_fallback[] = {
1782 static const vlc_fourcc_t p_RGB15_fallback[] = {
1790 static const vlc_fourcc_t p_RGB8_fallback[] = {
1798 static const vlc_fourcc_t *pp_RGB_fallback[] = {
1809 static const vlc_fourcc_t *GetFallback( vlc_fourcc_t i_fourcc,
1810 const vlc_fourcc_t *pp_fallback[],
1811 const vlc_fourcc_t p_list[] )
1813 for( unsigned i = 0; pp_fallback[i]; i++ )
1815 if( pp_fallback[i][0] == i_fourcc )
1816 return pp_fallback[i];
1821 const vlc_fourcc_t *vlc_fourcc_GetYUVFallback( vlc_fourcc_t i_fourcc )
1823 return GetFallback( i_fourcc, pp_YUV_fallback, p_list_YUV );
1825 const vlc_fourcc_t *vlc_fourcc_GetRGBFallback( vlc_fourcc_t i_fourcc )
1827 return GetFallback( i_fourcc, pp_RGB_fallback, p_RGB32_fallback );
1830 bool vlc_fourcc_AreUVPlanesSwapped( vlc_fourcc_t a, vlc_fourcc_t b )
1832 static const vlc_fourcc_t pp_swapped[][4] = {
1833 { VLC_CODEC_YV12, VLC_CODEC_I420, VLC_CODEC_J420, 0 },
1834 { VLC_CODEC_YV9, VLC_CODEC_I410, 0 },
1838 for( int i = 0; pp_swapped[i][0]; i++ )
1840 if( pp_swapped[i][0] == b )
1846 if( pp_swapped[i][0] != a )
1848 for( int j = 1; pp_swapped[i][j]; j++ )
1850 if( pp_swapped[i][j] == b )
1857 bool vlc_fourcc_IsYUV(vlc_fourcc_t fcc)
1859 for( unsigned i = 0; p_list_YUV[i]; i++ )
1861 if( p_list_YUV[i] == fcc )
1867 #define PLANAR(n, w_den, h_den, size, bits) \
1868 { .plane_count = n, \
1869 .p = { {.w = {1, 1}, .h = {1, 1}}, \
1870 {.w = {1,w_den}, .h = {1,h_den}}, \
1871 {.w = {1,w_den}, .h = {1,h_den}}, \
1872 {.w = {1, 1}, .h = {1, 1}} }, \
1873 .pixel_size = size, \
1874 .pixel_bits = bits }
1876 #define PLANAR_8(n, w_den, h_den) PLANAR(n, w_den, h_den, 1, 8)
1877 #define PLANAR_16(n, w_den, h_den, bits) PLANAR(n, w_den, h_den, 2, bits)
1879 #define PACKED_FMT(size, bits) \
1880 { .plane_count = 1, \
1881 .p = { {.w = {1,1}, .h = {1,1}} }, \
1882 .pixel_size = size, \
1883 .pixel_bits = bits }
1887 vlc_fourcc_t p_fourcc[6];
1888 vlc_chroma_description_t description;
1889 } p_list_chroma_description[] = {
1890 { { VLC_CODEC_I411, 0 }, PLANAR_8(3, 4, 1) },
1891 { { VLC_CODEC_YUV_PLANAR_410, 0 }, PLANAR_8(3, 4, 4) },
1892 { { VLC_CODEC_YUV_PLANAR_420, 0 }, PLANAR_8(3, 2, 2) },
1893 { { VLC_CODEC_NV12, VLC_CODEC_NV21, 0 }, PLANAR_8(2, 1, 2) },
1894 { { VLC_CODEC_YUV_PLANAR_422, 0 }, PLANAR_8(3, 2, 1) },
1895 { { VLC_CODEC_YUV_PLANAR_440, 0 }, PLANAR_8(3, 1, 2) },
1896 { { VLC_CODEC_YUV_PLANAR_444, 0 }, PLANAR_8(3, 1, 1) },
1897 { { VLC_CODEC_YUVA, 0 }, PLANAR_8(4, 1, 1) },
1899 { { VLC_CODEC_I420_10L,
1900 VLC_CODEC_I420_10B, 0 }, PLANAR_16(3, 2, 2, 10) },
1901 { { VLC_CODEC_I420_9L,
1902 VLC_CODEC_I420_9B, 0 }, PLANAR_16(3, 2, 2, 9) },
1903 { { VLC_CODEC_I422_10L,
1904 VLC_CODEC_I422_10B, 0 }, PLANAR_16(3, 2, 1, 10) },
1905 { { VLC_CODEC_I422_9L,
1906 VLC_CODEC_I422_9B, 0 }, PLANAR_16(3, 2, 1, 9) },
1907 { { VLC_CODEC_I444_10L,
1908 VLC_CODEC_I444_10B, 0 }, PLANAR_16(3, 1, 1, 10) },
1909 { { VLC_CODEC_I444_9L,
1910 VLC_CODEC_I444_9B, 0 }, PLANAR_16(3, 1, 1, 9) },
1912 { { VLC_CODEC_YUV_PACKED, 0 }, PACKED_FMT(2, 16) },
1913 { { VLC_CODEC_RGB8, VLC_CODEC_GREY,
1914 VLC_CODEC_YUVP, VLC_CODEC_RGBP, 0 }, PACKED_FMT(1, 8) },
1916 { { VLC_CODEC_RGB15, 0 }, PACKED_FMT(2, 15) },
1917 { { VLC_CODEC_RGB12, 0 }, PACKED_FMT(2, 12) },
1918 { { VLC_CODEC_RGB16, VLC_CODEC_RGBT,
1919 VLC_CODEC_RGBA16, 0 }, PACKED_FMT(2, 16) },
1920 { { VLC_CODEC_RGB24, 0 }, PACKED_FMT(3, 24) },
1921 { { VLC_CODEC_RGB32, 0 }, PACKED_FMT(4, 24) },
1922 { { VLC_CODEC_RGBA, 0 }, PACKED_FMT(4, 32) },
1924 { { VLC_CODEC_Y211, 0 }, { 1, { {{1,4}, {1,1}} }, 4, 32 } },
1926 { {0}, { 0, {}, 0, 0 } }
1934 const vlc_chroma_description_t *vlc_fourcc_GetChromaDescription( vlc_fourcc_t i_fourcc )
1936 for( unsigned i = 0; p_list_chroma_description[i].p_fourcc[0]; i++ )
1938 const vlc_fourcc_t *p_fourcc = p_list_chroma_description[i].p_fourcc;
1939 for( unsigned j = 0; p_fourcc[j]; j++ )
1941 if( p_fourcc[j] == i_fourcc )
1942 return &p_list_chroma_description[i].description;