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>
40 const char *psz_description;
43 #define NULL4 "\x00\x00\x00\x00"
45 /* XXX You don't want to see the preprocessor generated code ;) */
46 #ifdef WORDS_BIGENDIAN
47 # define FCC2STR(f) { ((f)>>24)&0xff, ((f)>>16)&0xff, ((f)>>8)&0xff, ((f)>>0)&0xff }
49 # define FCC2STR(f) { ((f)>>0)&0xff, ((f)>>8)&0xff, ((f)>>16)&0xff, ((f)>>24)&0xff }
51 /* Begin a new class */
52 #define B(a, c) { .p_class = FCC2STR(a), .p_fourcc = FCC2STR(a), .psz_description = c }
53 /* Create a sub-class entry with description */
54 #define E(b, c) { .p_class = NULL4, .p_fourcc = b, .psz_description = c }
55 /* Create a sub-class entry without description (alias) */
56 #define A(b) E(b, NULL4)
60 static const entry_t p_list_video[] = {
62 B(VLC_CODEC_MPGV, "MPEG-1/2 Video"),
73 E("PIM1", "Pinnacle DC1000 (MPEG-1 Video)"),
75 E("hdv1", "HDV 720p30 (MPEG-2 Video)"),
76 E("hdv2", "Sony HDV 1080i60 (MPEG-2 Video)"),
77 E("hdv3", "FCP HDV 1080i50 (MPEG-2 Video)"),
78 E("hdv4", "HDV 720p24 (MPEG-2 Video)"),
79 E("hdv5", "HDV 720p25 (MPEG-2 Video)"),
80 E("hdv6", "HDV 1080p24 (MPEG-2 Video)"),
81 E("hdv7", "HDV 1080p25 (MPEG-2 Video)"),
82 E("hdv8", "HDV 1080p30 (MPEG-2 Video)"),
83 E("hdv9", "HDV 720p60 JVC (MPEG-2 Video)"),
84 E("hdva", "HDV 720p50 (MPEG-2 Video)"),
86 E("mx5n", "MPEG2 IMX NTSC 525/60 50Mb/s (FCP)"),
87 E("mx5p", "MPEG2 IMX PAL 625/60 50Mb/s (FCP)"),
88 E("mx4n", "MPEG2 IMX NTSC 525/60 40Mb/s (FCP)"),
89 E("mx4p", "MPEG2 IMX PAL 625/50 40Mb/s (FCP)"),
90 E("mx3n", "MPEG2 IMX NTSC 525/60 30Mb/s (FCP)"),
91 E("mx3p", "MPEG2 IMX NTSC 625/50 30Mb/s (FCP)"),
93 E("xdv1", "XDCAM HD 720p30 35Mb/s"),
94 E("xdv2", "XDCAM HD 1080i60 35Mb/s"),
95 E("xdv3", "XDCAM HD 1080i50 35Mb/s"),
96 E("xdv4", "XDCAM HD 720p24 35Mb/s"),
97 E("xdv5", "XDCAM HD 720p25 35Mb/s"),
98 E("xdv6", "XDCAM HD 1080p24 35Mb/s"),
99 E("xdv7", "XDCAM HD 1080p25 35Mb/s"),
100 E("xdv8", "XDCAM HD 1080p30 35Mb/s"),
101 E("xdv9", "XDCAM HD 720p60 35Mb/s"),
102 E("xdva", "XDCAM HD 720p50 35Mb/s"),
104 E("xdvb", "XDCAM EX 1080i60 50Mb/s CBR"),
105 E("xdvc", "XDCAM EX 1080i50 50Mb/s CBR"),
106 E("xdvd", "XDCAM EX 1080p24 50Mb/s CBR"),
107 E("xdve", "XDCAM EX 1080p25 50Mb/s CBR"),
108 E("xdvf", "XDCAM EX 1080p30 50Mb/s CBR"),
110 E("xd54", "XDCAM HD422 720p24 50Mb/s CBR"),
111 E("xd55", "XDCAM HD422 720p25 50Mb/s CBR"),
112 E("xd59", "XDCAM HD422 720p60 50Mb/s CBR"),
113 E("xd5a", "XDCAM HD422 720p50 50Mb/s CBR"),
114 E("xd5b", "XDCAM HD422 1080i60 50Mb/s CBR"),
115 E("xd5c", "XDCAM HD422 1080i50 50Mb/s CBR"),
116 E("xd5d", "XDCAM HD422 1080p24 50Mb/s CBR"),
117 E("xd5e", "XDCAM HD422 1080p25 50Mb/s CBR"),
118 E("xd5f", "XDCAM HD422 1080p30 50Mb/s CBR"),
120 E("xdhd", "XDCAM HD 540p"),
121 E("xdh2", "XDCAM HD422 540p"),
123 E("AVmp", "AVID IMX PAL"),
124 E("MMES", "Matrox MPEG-2"),
125 E("mmes", "Matrox MPEG-2"),
126 E("PIM2", "Pinnacle MPEG-2"),
127 E("LMP2", "Lead MPEG-2"),
129 E("VCR2", "ATI VCR-2"),
131 B(VLC_CODEC_MP4V, "MPEG-4 Video"),
140 A("\x04\x00\x00\x00"),
159 E("xvid", "Xvid MPEG-4 Video"),
160 E("XVID", "Xvid MPEG-4 Video"),
161 E("XviD", "Xvid MPEG-4 Video"),
162 E("XVIX", "Xvid MPEG-4 Video"),
163 E("xvix", "Xvid MPEG-4 Video"),
165 E("DX50", "DivX MPEG-4 Video"),
166 E("dx50", "DivX MPEG-4 Video"),
167 E("BLZ0", "Blizzard MPEG-4 Video"),
168 E("DXGM", "Electronic Arts Game MPEG-4 Video"),
169 E("DreX", "DreX Mpeg-4"),
171 E("3IV2", "3ivx MPEG-4 Video"),
172 E("3iv2", "3ivx MPEG-4 Video"),
174 E("UMP4", "UB MPEG-4 Video"),
175 E("SEDG", "Samsung MPEG-4 Video"),
176 E("RMP4", "REALmagic MPEG-4 Video"),
177 E("LMP4", "Lead MPEG-4 Video"),
178 E("HDX4", "Jomigo HDX4 (MPEG-4 Video)"),
179 E("hdx4", "Jomigo HDX4 (MPEG-4 Video)"),
180 E("SMP4", "Samsung SMP4 (MPEG-4 Video)"),
181 E("smp4", "Samsung SMP4 (MPEG-4 Video)"),
182 E("fvfw", "FFmpeg MPEG-4"),
183 E("FVFW", "FFmpeg MPEG-4"),
184 E("FFDS", "FFDShow MPEG-4"),
185 E("VIDM", "vidm 4.01 codec"),
186 E("DP02", "DynaPel MPEG-4 codec"),
187 /* 3ivx delta 3.5 Unsupported
188 * putting it here gives extreme distorted images */
189 //E("3IV1", "3ivx delta 3.5 MPEG-4 Video"),
190 //E("3iv1", "3ivx delta 3.5 MPEG-4 Video"),
193 B(VLC_CODEC_DIV1, "MS MPEG-4 Video v1"),
201 B(VLC_CODEC_DIV2, "MS MPEG-4 Video v2"),
207 /* MSMPEG4 v3 / M$ mpeg4 v3 */
208 B(VLC_CODEC_DIV3, "MS MPEG-4 Video v3"),
222 E("divf", "DivX 4.12"),
223 E("DIVF", "DivX 4.12"),
229 /* AngelPotion stuff */
231 /* 3ivx doctered divx files */
241 B(VLC_CODEC_SVQ1, "SVQ-1 (Sorenson Video v1)"),
247 B(VLC_CODEC_SVQ3, "SVQ-3 (Sorenson Video v3)"),
251 B(VLC_CODEC_H264, "H264 - MPEG-4 AVC (part 10)"),
256 /* avc1: special case h264 */
259 E("ai5p", "AVC-Intra 50M 720p24/30/60"),
260 E("ai5q", "AVC-Intra 50M 720p25/50"),
261 E("ai52", "AVC-Intra 50M 1080p25/50"),
262 E("ai53", "AVC-Intra 50M 1080p24/30/60"),
263 E("ai55", "AVC-Intra 50M 1080i50"),
264 E("ai56", "AVC-Intra 50M 1080i60"),
265 E("ai1p", "AVC-Intra 100M 720p24/30/60"),
266 E("ai1q", "AVC-Intra 100M 720p25/50"),
267 E("ai12", "AVC-Intra 100M 1080p25/50"),
268 E("ai13", "AVC-Intra 100M 1080p24/30/60"),
269 E("ai15", "AVC-Intra 100M 1080i50"),
270 E("ai16", "AVC-Intra 100M 1080i60"),
271 E("VSSH", "Vanguard VSS H264"),
272 E("VSSW", "Vanguard VSS H264"),
273 E("vssh", "Vanguard VSS H264"),
274 E("DAVC", "Dicas MPEGable H.264/MPEG-4 AVC"),
275 E("davc", "Dicas MPEGable H.264/MPEG-4 AVC"),
276 E("x3eV", "DreX H.264"),
279 /* H263(+) is also known as Real Video 1.0 */
282 B(VLC_CODEC_H263, "H263"),
290 E("D263", "DEC H263"),
291 E("d263", "DEC H263"),
292 E("L263", "LEAD H263"),
293 E("M263", "Microsoft H263"),
294 E("X263", "Xirlink H263"),
296 E("ZyGo", "ITU H263+"),
299 B(VLC_CODEC_H263I, "I263.I"),
304 B(VLC_CODEC_H263P, "ITU H263+"),
305 E("ILVR", "ITU H263+"),
310 E("U263", "UB H263+"),
312 /* Flash (H263) variant */
313 B(VLC_CODEC_FLV1, "Flash Video"),
318 B(VLC_CODEC_H261, "H.261"),
322 B(VLC_CODEC_FLIC, "Flic Video"),
326 B(VLC_CODEC_MJPG, "Motion JPEG Video"),
342 E("AVRn", "Avid Motion JPEG"),
343 E("AVDJ", "Avid Motion JPEG"),
344 E("ADJV", "Avid Motion JPEG"),
345 E("dmb1", "Motion JPEG OpenDML Video"),
346 E("DMB1", "Motion JPEG OpenDML Video"),
347 E("ijpg", "Intergraph JPEG Video"),
348 E("IJPG", "Intergraph JPEG Video"),
349 E("ACDV", "ACD Systems Digital"),
350 E("SLMJ", "SL M-JPEG"),
352 B(VLC_CODEC_MJPGB, "Motion JPEG B Video"),
355 B(VLC_CODEC_LJPG, "Lead Motion JPEG Video"),
357 E("Ljpg", "Lead Motion JPEG"),
359 // ? from avcodec/fourcc.c but makes not sense.
360 //{ VLC_FOURCC( 'L','J','P','G' ), CODEC_ID_MJPEG, VIDEO_ES, "Lead Motion JPEG Video" },
363 B(VLC_CODEC_SP5X, "Sunplus Motion JPEG Video"),
373 B(VLC_CODEC_DV, "DV Video"),
383 E("dvh2", "DV Video 720p24"),
384 E("dvh3", "DV Video 720p25"),
385 E("dvh4", "DV Video 720p30"),
395 E("dvcp", "DV Video PAL"),
396 E("dvc ", "DV Video NTSC" ),
397 E("dvp ", "DV Video Pro"),
398 E("dvpp", "DV Video Pro PAL"),
399 E("dv50", "DV Video C Pro 50"),
400 E("dv5p", "DV Video C Pro 50 PAL"),
401 E("dv5n", "DV Video C Pro 50 NTSC"),
402 E("dv1p", "DV Video C Pro 100 PAL" ),
403 E("dv1n", "DV Video C Pro 100 NTSC" ),
404 E("dvhp", "DV Video C Pro HD 720p" ),
405 E("dvh5", "DV Video C Pro HD 1080i50" ),
406 E("dvh6", "DV Video C Pro HD 1080i60" ),
407 E("AVdv", "AVID DV"),
408 E("AVd1", "AVID DV"),
409 E("CDVC", "Canopus DV Video"),
410 E("cdvc", "Canopus DV Video"),
411 E("CDVH", "Canopus DV Video"),
412 E("cdvh", "Canopus DV Video"),
413 E("CDV5", "Canopus DV Video"),
415 /* Windows Media Video */
416 B(VLC_CODEC_WMV1, "Windows Media Video 7"),
420 B(VLC_CODEC_WMV2, "Windows Media Video 8"),
424 B(VLC_CODEC_WMV3, "Windows Media Video 9"),
428 /* WMVA is the VC-1 codec before the standardization proces,
429 * it is not bitstream compatible and deprecated */
430 B(VLC_CODEC_WMVA, "Windows Media Video Advanced Profile"),
434 B(VLC_CODEC_VC1, "Windows Media Video VC1"),
440 B(VLC_CODEC_WMVP, "Windows Media Video Presentation"),
444 B(VLC_CODEC_WMVP2, "Windows Media Video Presentation, v2"),
448 /* Microsoft Video 1 */
449 B(VLC_CODEC_MSVIDEO1, "Microsoft Video 1"),
458 B(VLC_CODEC_MSRLE, "Microsoft RLE Video"),
461 A("\x01\x00\x00\x00"),
462 A("\x02\x00\x00\x00"),
464 /* Indeo Video Codecs (Quality of this decoder on ppc is not good) */
465 B(VLC_CODEC_INDEO3, "Indeo Video v3"),
472 B(VLC_CODEC_HUFFYUV, "Huff YUV Video"),
475 B(VLC_CODEC_FFVHUFF, "Huff YUV Video"),
478 /* On2 VP3 Video Codecs */
479 B(VLC_CODEC_VP3, "On2's VP3 Video"),
486 /* On2 VP5, VP6 codecs */
487 B(VLC_CODEC_VP5, "On2's VP5 Video"),
491 B(VLC_CODEC_VP6, "On2's VP6.2 Video"),
494 E("VP60", "On2's VP6.0 Video"),
495 E("VP61", "On2's VP6.1 Video"),
497 B(VLC_CODEC_VP6F, "On2's VP6.2 Video (Flash)"),
501 B(VLC_CODEC_VP6A, "On2's VP6 A Video"),
504 B(VLC_CODEC_VP8, "Google/On2's VP8 Video"),
508 /* Xiph.org theora */
509 B(VLC_CODEC_THEORA, "Xiph.org's Theora Video"),
513 /* Xiph.org tarkin */
514 B(VLC_CODEC_TARKIN, "Xiph.org's Tarkin Video"),
517 /* Asus Video (Another thing that doesn't work on PPC) */
518 B(VLC_CODEC_ASV1, "Asus V1 Video"),
520 B(VLC_CODEC_ASV2, "Asus V2 Video"),
523 /* FFMPEG Video 1 (lossless codec) */
524 B(VLC_CODEC_FFV1, "FFMpeg Video 1"),
528 B(VLC_CODEC_VCR1, "ATI VCR1 Video"),
531 /* Cirrus Logic AccuPak */
532 B(VLC_CODEC_CLJR, "Creative Logic AccuPak"),
536 B(VLC_CODEC_RV10, "Real Video 1.0"),
540 B(VLC_CODEC_RV13, "Real Video 1.3"),
544 B(VLC_CODEC_RV20, "Real Video 2.0"),
548 B(VLC_CODEC_RV30, "Real Video 3.0"),
552 B(VLC_CODEC_RV40, "Real Video 4.0"),
557 B(VLC_CODEC_RPZA, "Apple Video"),
563 B(VLC_CODEC_SMC, "Apple graphics"),
566 B(VLC_CODEC_CINEPAK, "Cinepak Video"),
570 /* Screen Capture Video Codecs */
571 B(VLC_CODEC_TSCC, "TechSmith Camtasia Screen Capture"),
575 B(VLC_CODEC_CSCD, "CamStudio Screen Codec"),
579 B(VLC_CODEC_ZMBV, "DosBox Capture Codec"),
582 B(VLC_CODEC_VMNC, "VMware Video"),
584 B(VLC_CODEC_FRAPS, "FRAPS: Realtime Video Capture"),
588 /* Duck TrueMotion */
589 B(VLC_CODEC_TRUEMOTION1, "Duck TrueMotion v1 Video"),
592 B(VLC_CODEC_TRUEMOTION2, "Duck TrueMotion v2.0 Video"),
595 /* FFMPEG's SNOW wavelet codec */
596 B(VLC_CODEC_SNOW, "FFMpeg SNOW wavelet Video"),
600 B(VLC_CODEC_QTRLE, "Apple QuickTime RLE Video"),
603 B(VLC_CODEC_QDRAW, "Apple QuickDraw Video"),
606 B(VLC_CODEC_QPEG, "QPEG Video"),
611 B(VLC_CODEC_ULTI, "IBM Ultimotion Video"),
614 B(VLC_CODEC_VIXL, "Miro/Pinnacle VideoXL Video"),
617 E("PIXL", "Pinnacle VideoXL Video"),
619 B(VLC_CODEC_LOCO, "LOCO Video"),
622 B(VLC_CODEC_WNV1, "Winnov WNV1 Video"),
625 B(VLC_CODEC_AASC, "Autodesc RLE Video"),
628 B(VLC_CODEC_INDEO2, "Indeo Video v2"),
630 E("RT21", "Indeo Video 2.1" ),
632 /* Flash Screen Video */
633 B(VLC_CODEC_FLASHSV, "Flash Screen Video"),
635 B(VLC_CODEC_FLASHSV2, "Flash Screen Video 2"),
638 B(VLC_CODEC_KMVC, "Karl Morton's Video Codec (Worms)"),
641 B(VLC_CODEC_NUV, "Nuppel Video"),
645 /* CODEC_ID_SMACKVIDEO */
646 B(VLC_CODEC_SMACKVIDEO, "Smacker Video"),
650 /* Chinese AVS - Untested */
651 B(VLC_CODEC_CAVS, "Chinese AVS"),
656 B(VLC_CODEC_AMV, "AMV"),
659 B(VLC_CODEC_DNXHD, "DNxHD"),
661 B(VLC_CODEC_8BPS, "8BPS"),
663 B(VLC_CODEC_MIMIC, "Mimic"),
666 B(VLC_CODEC_CDG, "CD-G Video"),
669 B(VLC_CODEC_FRWU, "Forward Uncompressed" ),
672 B(VLC_CODEC_INDEO4, "Indeo Video v4"),
676 B(VLC_CODEC_INDEO5, "Indeo Video v5"),
680 B(VLC_CODEC_PRORES, "Apple ProRes 422"),
681 E("apch", "Apple ProRes 422 HQ"),
682 E("apcs", "Apple ProRes 422 LT"),
683 E("apco", "Apple ProRes 422 Proxy"),
684 E("ap4c", "Apple ProRes 4444"),
687 B(VLC_CODEC_YV12, "Planar 4:2:0 YVU"),
690 B(VLC_CODEC_YV9, "Planar 4:1:0 YVU"),
692 B(VLC_CODEC_I410, "Planar 4:1:0 YUV"),
694 B(VLC_CODEC_I411, "Planar 4:1:1 YUV"),
696 B(VLC_CODEC_I420, "Planar 4:2:0 YUV"),
699 B(VLC_CODEC_I422, "Planar 4:2:2 YUV"),
701 B(VLC_CODEC_I444, "Planar 4:4:0 YUV"),
703 B(VLC_CODEC_I444, "Planar 4:4:4 YUV"),
706 B(VLC_CODEC_J420, "Planar 4:2:0 YUV full scale"),
708 B(VLC_CODEC_J422, "Planar 4:2:2 YUV full scale"),
710 B(VLC_CODEC_J440, "Planar 4:4:0 YUV full scale"),
712 B(VLC_CODEC_J444, "Planar 4:4:4 YUV full scale"),
715 B(VLC_CODEC_YUVP, "Palettized YUV with palette element Y:U:V:A"),
718 B(VLC_CODEC_YUVA, "Planar YUV 4:4:4 Y:U:V:A"),
721 B(VLC_CODEC_RGBP, "Palettized RGB with palette element R:G:B"),
724 B(VLC_CODEC_RGB8, "8 bits RGB"),
726 B(VLC_CODEC_RGB12, "12 bits RGB"),
728 B(VLC_CODEC_RGBA16, "16 bits RGBA"),
730 B(VLC_CODEC_RGB15, "15 bits RGB"),
732 B(VLC_CODEC_RGBT, "16 bits RGBT"),
734 B(VLC_CODEC_RGB16, "16 bits RGB"),
736 B(VLC_CODEC_RGB24, "24 bits RGB"),
738 B(VLC_CODEC_RGB32, "32 bits RGB"),
740 B(VLC_CODEC_RGBA, "32 bits RGBA"),
744 B(VLC_CODEC_GREY, "8 bits greyscale"),
749 B(VLC_CODEC_UYVY, "Packed YUV 4:2:2, U:Y:V:Y"),
760 B(VLC_CODEC_VYUY, "Packed YUV 4:2:2, V:Y:U:Y"),
762 B(VLC_CODEC_YUYV, "Packed YUV 4:2:2, Y:U:Y:V"),
767 B(VLC_CODEC_YVYU, "Packed YUV 4:2:2, Y:V:Y:U"),
770 B(VLC_CODEC_Y211, "Packed YUV 2:1:1, Y:U:Y:V "),
772 B(VLC_CODEC_CYUV, "Creative Packed YUV 4:2:2, U:Y:V:Y, reverted"),
776 B(VLC_CODEC_V210, "10-bit 4:2:2 Component YCbCr"),
779 B(VLC_CODEC_NV12, "Biplanar 4:2:0 Y/UV"),
781 B(VLC_CODEC_NV21, "Biplanar 4:2:0 Y/VU"),
783 B(VLC_CODEC_NV16, "Biplanar 4:2:2 Y/UV"),
785 B(VLC_CODEC_NV61, "Biplanar 4:2:2 Y/VU"),
788 B(VLC_CODEC_I420_9L, "Planar 4:2:0 YUV 9-bit LE"),
790 B(VLC_CODEC_I420_9B, "Planar 4:2:0 YUV 9-bit BE"),
792 B(VLC_CODEC_I422_9L, "Planar 4:2:2 YUV 9-bit LE"),
794 B(VLC_CODEC_I422_9B, "Planar 4:2:2 YUV 9-bit BE"),
796 B(VLC_CODEC_I444_9L, "Planar 4:4:4 YUV 9-bit LE"),
798 B(VLC_CODEC_I444_9B, "Planar 4:4:4 YUV 9-bit BE"),
801 B(VLC_CODEC_I420_10L, "Planar 4:2:0 YUV 10-bit LE"),
803 B(VLC_CODEC_I420_10B, "Planar 4:2:0 YUV 10-bit BE"),
805 B(VLC_CODEC_I422_10L, "Planar 4:2:2 YUV 10-bit LE"),
807 B(VLC_CODEC_I422_10B, "Planar 4:2:2 YUV 10-bit BE"),
809 B(VLC_CODEC_I444_10L, "Planar 4:4:4 YUV 10-bit LE"),
811 B(VLC_CODEC_I444_10B, "Planar 4:4:4 YUV 10-bit BE"),
814 /* Videogames Codecs */
817 B(VLC_CODEC_INTERPLAY, "Interplay MVE Video"),
821 /* Id Quake II CIN */
822 B(VLC_CODEC_IDCIN, "Id Quake II CIN Video"),
825 /* 4X Technologies */
826 B(VLC_CODEC_4XM, "4X Technologies Video"),
831 B(VLC_CODEC_ROQ, "Id RoQ Video"),
834 /* Sony Playstation MDEC */
835 B(VLC_CODEC_MDEC, "PSX MDEC Video"),
839 B(VLC_CODEC_VMDVIDEO, "Sierra VMD Video"),
843 B(VLC_CODEC_DIRAC, "Dirac" ),
847 B(VLC_CODEC_PNG, "PNG Image"),
850 B(VLC_CODEC_PPM, "PPM Image"),
853 B(VLC_CODEC_PGM, "PGM Image"),
856 B(VLC_CODEC_PGMYUV, "PGM YUV Image"),
859 B(VLC_CODEC_PAM, "PAM Image"),
862 B(VLC_CODEC_JPEGLS, "JPEG-LS"),
865 B(VLC_CODEC_JPEG, "JPEG"),
869 B(VLC_CODEC_BMP, "BMP Image"),
872 B(VLC_CODEC_TIFF, "TIFF Image"),
875 B(VLC_CODEC_GIF, "GIF Image"),
879 B(VLC_CODEC_TARGA, "Truevision Targa Image"),
884 B(VLC_CODEC_SGI, "SGI Image"),
887 B(VLC_CODEC_PNM, "Portable Anymap Image"),
890 B(VLC_CODEC_PCX, "Personal Computer Exchange Image"),
893 B(VLC_CODEC_JPEG2000, "JPEG 2000 Image"),
901 B(VLC_CODEC_LAGARITH, "Lagarith Lossless"),
904 B(VLC_CODEC_MXPEG, "Mxpeg"),
909 static const entry_t p_list_audio[] = {
911 /* Windows Media Audio 1 */
912 B(VLC_CODEC_WMA1, "Windows Media Audio 1"),
916 /* Windows Media Audio 2 */
917 B(VLC_CODEC_WMA2, "Windows Media Audio 2"),
922 /* Windows Media Audio Professional */
923 B(VLC_CODEC_WMAP, "Windows Media Audio Professional"),
927 /* Windows Media Audio Lossless */
928 B(VLC_CODEC_WMAL, "Windows Media Audio Lossless"),
932 /* Windows Media Audio Speech */
933 B(VLC_CODEC_WMAS, "Windows Media Audio Voice (Speech)"),
938 B(VLC_CODEC_DVAUDIO, "DV Audio"),
945 B(VLC_CODEC_MACE3, "MACE-3 Audio"),
949 B(VLC_CODEC_MACE6, "MACE-6 Audio"),
952 /* MUSEPACK7 Audio */
953 B(VLC_CODEC_MUSEPACK7, "MUSEPACK7 Audio"),
956 /* MUSEPACK8 Audio */
957 B(VLC_CODEC_MUSEPACK8, "MUSEPACK8 Audio"),
962 B(VLC_CODEC_RA_144, "RealAudio 1.0"),
967 B(VLC_CODEC_RA_288, "RealAudio 2.0"),
970 B(VLC_CODEC_SIPR, "RealAudio Sipr"),
973 /* MPEG Audio layer 1/2/3 */
974 B(VLC_CODEC_MPGA, "MPEG Audio layer 1/2/3"),
985 /* A52 Audio (aka AC3) */
986 B(VLC_CODEC_A52, "A52 Audio (aka AC3)"),
993 B(VLC_CODEC_EAC3, "A/52 B Audio (aka E-AC3)"),
997 B(VLC_CODEC_DTS, "DTS Audio"),
1005 B(VLC_CODEC_MP4A, "MPEG AAC Audio"),
1010 B(VLC_CODEC_ALS, "MPEG-4 Audio Lossless (ALS)"),
1013 /* 4X Technologies */
1014 B(VLC_CODEC_ADPCM_4XM, "4X Technologies Audio"),
1018 B(VLC_CODEC_ADPCM_EA, "EA ADPCM Audio"),
1021 /* Interplay DPCM */
1022 B(VLC_CODEC_INTERPLAY_DPCM, "Interplay DPCM Audio"),
1026 B(VLC_CODEC_ROQ_DPCM, "Id RoQ DPCM Audio"),
1030 B(VLC_CODEC_DSICINAUDIO, "Delphine CIN Audio"),
1033 /* Sony Playstation XA ADPCM */
1034 B(VLC_CODEC_ADPCM_XA, "PSX XA ADPCM Audio"),
1038 B(VLC_CODEC_ADPCM_ADX, "ADX ADPCM Audio"),
1041 /* Westwood ADPCM */
1042 B(VLC_CODEC_ADPCM_IMA_WS, "Westwood IMA ADPCM audio"),
1046 B(VLC_CODEC_ADPCM_MS, "MS ADPCM audio"),
1050 B(VLC_CODEC_VMDAUDIO, "Sierra VMD Audio"),
1054 B(VLC_CODEC_ADPCM_G726, "G.726 ADPCM Audio"),
1058 B(VLC_CODEC_ADPCM_G722, "G.722 ADPCM Audio"),
1062 B(VLC_CODEC_ADPCM_SWF, "Flash ADPCM Audio"),
1065 B(VLC_CODEC_ADPCM_IMA_WAV, "IMA WAV ADPCM Audio"),
1068 B(VLC_CODEC_ADPCM_IMA_AMV, "IMA AMV ADPCM Audio"),
1072 B(VLC_CODEC_AMR_NB, "AMR narrow band"),
1075 B(VLC_CODEC_AMR_WB, "AMR wide band"),
1079 B(VLC_CODEC_FLAC, "FLAC (Free Lossless Audio Codec)"),
1083 B(VLC_CODEC_ALAC, "Apple Lossless Audio Codec"),
1087 B(VLC_CODEC_QDM2, "QDM2 Audio"),
1091 B(VLC_CODEC_COOK, "Cook Audio"),
1094 /* TTA: The Lossless True Audio */
1095 B(VLC_CODEC_TTA, "The Lossless True Audio"),
1099 B(VLC_CODEC_SHORTEN, "Shorten Lossless Audio"),
1103 B(VLC_CODEC_WAVPACK, "WavPack"),
1107 B(VLC_CODEC_GSM, "GSM Audio"),
1110 B(VLC_CODEC_GSM_MS, "Microsoft GSM Audio"),
1113 B(VLC_CODEC_ATRAC1, "atrac 1"),
1116 B(VLC_CODEC_ATRAC3, "atrac 3"),
1118 A("\x70\x02\x00\x00"),
1120 B(VLC_CODEC_SONIC, "Sonic"),
1123 B(VLC_CODEC_IMC, "IMC" ),
1124 A("\x01\x04\x00\x00"),
1126 B(VLC_CODEC_TRUESPEECH,"TrueSpeech"),
1127 A("\x22\x00\x00\x00"),
1129 B(VLC_CODEC_NELLYMOSER, "NellyMoser ASAO"),
1133 B(VLC_CODEC_APE, "Monkey's Audio"),
1136 B(VLC_CODEC_MLP, "MLP/TrueHD Audio"),
1139 B(VLC_CODEC_TRUEHD, "TrueHD Audio"),
1142 B(VLC_CODEC_QCELP, "QCELP Audio"),
1147 B(VLC_CODEC_SPEEX, "Speex Audio"),
1151 B(VLC_CODEC_VORBIS, "Vorbis Audio"),
1154 B(VLC_CODEC_302M, "302M Audio"),
1157 B(VLC_CODEC_DVD_LPCM, "DVD LPCM Audio"),
1160 B(VLC_CODEC_DVDA_LPCM, "DVD-Audio LPCM Audio"),
1163 B(VLC_CODEC_BD_LPCM, "BD LPCM Audio"),
1166 B(VLC_CODEC_SDDS, "SDDS Audio"),
1170 B(VLC_CODEC_MIDI, "MIDI Audio"),
1174 B(VLC_CODEC_S8, "PCM S8"),
1177 B(VLC_CODEC_U8, "PCM U8"),
1180 B(VLC_CODEC_S16L, "PCM S16 LE"),
1183 B(VLC_CODEC_S16B, "PCM S16 BE"),
1186 B(VLC_CODEC_U16L, "PCM U16 LE"),
1189 B(VLC_CODEC_U16B, "PCM U16 BE"),
1192 B(VLC_CODEC_S20B, "PCM S20 BE"),
1194 B(VLC_CODEC_S24L, "PCM S24 LE"),
1196 A("42ni"), /* Quicktime */
1198 B(VLC_CODEC_S24B, "PCM S24 BE"),
1200 A("in24"), /* Quicktime */
1202 B(VLC_CODEC_U24L, "PCM U24 LE"),
1205 B(VLC_CODEC_U24B, "PCM U24 BE"),
1208 B(VLC_CODEC_S32L, "PCM S32 LE"),
1210 A("23ni"), /* Quicktime */
1212 B(VLC_CODEC_S32B, "PCM S32 BE"),
1214 A("in32"), /* Quicktime */
1216 B(VLC_CODEC_U32L, "PCM U32 LE"),
1219 B(VLC_CODEC_U32B, "PCM U32 BE"),
1222 B(VLC_CODEC_ALAW, "PCM ALAW"),
1225 B(VLC_CODEC_MULAW, "PCM MU-LAW"),
1229 B(VLC_CODEC_DAT12, "12 bits DAT audio"),
1231 B(VLC_CODEC_S24DAUD, "PCM DAUD"),
1234 B(VLC_CODEC_FI32, "32 bits fixed float"),
1237 B(VLC_CODEC_F32L, "32 bits float LE"),
1241 B(VLC_CODEC_F32B, "32 bits float BE"),
1244 B(VLC_CODEC_F64L, "64 bits float LE"),
1247 B(VLC_CODEC_F64L, "64 bits float BE"),
1250 B(VLC_CODEC_TWINVQ, "TwinVQ"),
1255 static const entry_t p_list_spu[] = {
1257 B(VLC_CODEC_SPU, "DVD Subtitles"),
1261 B(VLC_CODEC_DVBS, "DVB Subtitles"),
1264 B(VLC_CODEC_SUBT, "Text subtitles with various tags"),
1267 B(VLC_CODEC_XSUB, "DivX XSUB subtitles"),
1272 B(VLC_CODEC_SSA, "SubStation Alpha subtitles"),
1275 B(VLC_CODEC_TEXT, "Plain text subtitles"),
1278 B(VLC_CODEC_TELETEXT, "Teletext"),
1281 B(VLC_CODEC_KATE, "Kate subtitles"),
1284 B(VLC_CODEC_CMML, "CMML annotations/metadata"),
1287 B(VLC_CODEC_ITU_T140, "ITU T.140 subtitles"),
1290 B(VLC_CODEC_USF, "USF subtitles"),
1293 B(VLC_CODEC_OGT, "OGT subtitles"),
1296 B(VLC_CODEC_CVD, "CVD subtitles"),
1299 B(VLC_CODEC_BD_PG, "BD subtitles"),
1302 B(VLC_CODEC_EBU_STL, "EBU STL subtitles"),
1308 /* Create a fourcc from a string.
1309 * XXX it assumes that the string is at least four bytes */
1310 static inline vlc_fourcc_t CreateFourcc( const char *psz_fourcc )
1312 return VLC_FOURCC( psz_fourcc[0], psz_fourcc[1],
1313 psz_fourcc[2], psz_fourcc[3] );
1317 static entry_t Lookup( const entry_t p_list[], vlc_fourcc_t i_fourcc )
1319 const char *p_class = NULL;
1320 const char *psz_description = NULL;
1322 entry_t e = B(0, "");
1324 for( int i = 0; ; i++ )
1326 const entry_t *p = &p_list[i];
1327 const vlc_fourcc_t i_entry_fourcc = CreateFourcc( p->p_fourcc );
1328 const vlc_fourcc_t i_entry_class = CreateFourcc( p->p_class );
1330 if( i_entry_fourcc == 0 )
1333 if( i_entry_class != 0 )
1335 p_class = p->p_class;
1336 psz_description = p->psz_description;
1339 if( i_entry_fourcc == i_fourcc )
1341 assert( p_class != NULL );
1343 memcpy( e.p_class, p_class, 4 );
1344 memcpy( e.p_fourcc, p->p_fourcc, 4 );
1345 e.psz_description = p->psz_description ?
1346 p->psz_description : psz_description;
1354 static entry_t Find( int i_cat, vlc_fourcc_t i_fourcc )
1361 return Lookup( p_list_video, i_fourcc );
1363 return Lookup( p_list_audio, i_fourcc );
1365 return Lookup( p_list_spu, i_fourcc );
1368 e = Find( VIDEO_ES, i_fourcc );
1369 if( CreateFourcc( e.p_class ) == 0 )
1370 e = Find( AUDIO_ES, i_fourcc );
1371 if( CreateFourcc( e.p_class ) == 0 )
1372 e = Find( SPU_ES, i_fourcc );
1378 vlc_fourcc_t vlc_fourcc_GetCodec( int i_cat, vlc_fourcc_t i_fourcc )
1380 entry_t e = Find( i_cat, i_fourcc );
1382 if( CreateFourcc( e.p_class ) == 0 )
1384 return CreateFourcc( e.p_class );
1387 vlc_fourcc_t vlc_fourcc_GetCodecFromString( int i_cat, const char *psz_fourcc )
1389 if( !psz_fourcc || strlen(psz_fourcc) != 4 )
1391 return vlc_fourcc_GetCodec( i_cat,
1392 VLC_FOURCC( psz_fourcc[0], psz_fourcc[1],
1393 psz_fourcc[2], psz_fourcc[3] ) );
1396 vlc_fourcc_t vlc_fourcc_GetCodecAudio( vlc_fourcc_t i_fourcc, int i_bits )
1398 const int i_bytes = ( i_bits + 7 ) / 8;
1400 if( i_fourcc == VLC_FOURCC( 'a', 'f', 'l', 't' ) )
1405 return VLC_CODEC_FL32;
1407 return VLC_CODEC_FL64;
1412 else if( i_fourcc == VLC_FOURCC( 'a', 'r', 'a', 'w' ) ||
1413 i_fourcc == VLC_FOURCC( 'p', 'c', 'm', ' ' ) )
1418 return VLC_CODEC_U8;
1420 return VLC_CODEC_S16L;
1422 return VLC_CODEC_S24L;
1425 return VLC_CODEC_S32L;
1430 else if( i_fourcc == VLC_FOURCC( 't', 'w', 'o', 's' ) )
1435 return VLC_CODEC_S8;
1437 return VLC_CODEC_S16B;
1439 return VLC_CODEC_S24B;
1441 return VLC_CODEC_S32B;
1446 else if( i_fourcc == VLC_FOURCC( 's', 'o', 'w', 't' ) )
1451 return VLC_CODEC_S8;
1453 return VLC_CODEC_S16L;
1455 return VLC_CODEC_S24L;
1457 return VLC_CODEC_S32L;
1464 return vlc_fourcc_GetCodec( AUDIO_ES, i_fourcc );
1469 const char *vlc_fourcc_GetDescription( int i_cat, vlc_fourcc_t i_fourcc )
1471 entry_t e = Find( i_cat, i_fourcc );
1473 return e.psz_description;
1478 #define VLC_CODEC_YUV_PLANAR_410 \
1479 VLC_CODEC_I410, VLC_CODEC_YV9
1481 #define VLC_CODEC_YUV_PLANAR_420 \
1482 VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420
1484 #define VLC_CODEC_YUV_PLANAR_420_16 \
1485 VLC_CODEC_I420_10L, VLC_CODEC_I420_10B, VLC_CODEC_I420_9L, VLC_CODEC_I420_9B
1487 #define VLC_CODEC_YUV_PLANAR_422 \
1488 VLC_CODEC_I422, VLC_CODEC_J422
1490 #define VLC_CODEC_YUV_PLANAR_422_16 \
1491 VLC_CODEC_I422_10L, VLC_CODEC_I422_10B, VLC_CODEC_I422_9L, VLC_CODEC_I422_9B
1493 #define VLC_CODEC_YUV_PLANAR_440 \
1494 VLC_CODEC_I440, VLC_CODEC_J440
1496 #define VLC_CODEC_YUV_PLANAR_444 \
1497 VLC_CODEC_I444, VLC_CODEC_J444
1499 #define VLC_CODEC_YUV_PLANAR_444_16 \
1500 VLC_CODEC_I444_10L, VLC_CODEC_I444_10B, VLC_CODEC_I444_9L, VLC_CODEC_I444_9B
1502 #define VLC_CODEC_YUV_PACKED \
1503 VLC_CODEC_YUYV, VLC_CODEC_YVYU, \
1504 VLC_CODEC_UYVY, VLC_CODEC_VYUY
1506 #define VLC_CODEC_FALLBACK_420 \
1507 VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PACKED, \
1508 VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
1509 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1511 static const vlc_fourcc_t p_I420_fallback[] = {
1512 VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420, 0
1514 static const vlc_fourcc_t p_J420_fallback[] = {
1515 VLC_CODEC_J420, VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_FALLBACK_420, 0
1517 static const vlc_fourcc_t p_YV12_fallback[] = {
1518 VLC_CODEC_YV12, VLC_CODEC_I420, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420, 0
1521 #define VLC_CODEC_FALLBACK_420_16 \
1522 VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420
1524 static const vlc_fourcc_t p_I420_9L_fallback[] = {
1525 VLC_CODEC_I420_9L, VLC_CODEC_I420_9B, VLC_CODEC_FALLBACK_420_16, 0
1527 static const vlc_fourcc_t p_I420_9B_fallback[] = {
1528 VLC_CODEC_I420_9B, VLC_CODEC_I420_9L, VLC_CODEC_FALLBACK_420_16, 0
1530 static const vlc_fourcc_t p_I420_10L_fallback[] = {
1531 VLC_CODEC_I420_10L, VLC_CODEC_I420_10B, VLC_CODEC_FALLBACK_420_16, 0
1533 static const vlc_fourcc_t p_I420_10B_fallback[] = {
1534 VLC_CODEC_I420_10B, VLC_CODEC_I420_10L, VLC_CODEC_FALLBACK_420_16, 0
1537 #define VLC_CODEC_FALLBACK_422 \
1538 VLC_CODEC_YUV_PACKED, VLC_CODEC_YUV_PLANAR_420, \
1539 VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
1540 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1542 static const vlc_fourcc_t p_I422_fallback[] = {
1543 VLC_CODEC_I422, VLC_CODEC_J422, VLC_CODEC_FALLBACK_422, 0
1545 static const vlc_fourcc_t p_J422_fallback[] = {
1546 VLC_CODEC_J422, VLC_CODEC_I422, VLC_CODEC_FALLBACK_422, 0
1549 #define VLC_CODEC_FALLBACK_422_16 \
1550 VLC_CODEC_I422, VLC_CODEC_J422, VLC_CODEC_FALLBACK_422
1552 static const vlc_fourcc_t p_I422_9L_fallback[] = {
1553 VLC_CODEC_I422_9L, VLC_CODEC_I422_9B, VLC_CODEC_FALLBACK_422_16, 0
1555 static const vlc_fourcc_t p_I422_9B_fallback[] = {
1556 VLC_CODEC_I422_9B, VLC_CODEC_I422_9L, VLC_CODEC_FALLBACK_422_16, 0
1558 static const vlc_fourcc_t p_I422_10L_fallback[] = {
1559 VLC_CODEC_I422_10L, VLC_CODEC_I422_10B, VLC_CODEC_FALLBACK_422_16, 0
1561 static const vlc_fourcc_t p_I422_10B_fallback[] = {
1562 VLC_CODEC_I422_10B, VLC_CODEC_I422_10L, VLC_CODEC_FALLBACK_422_16, 0
1565 #define VLC_CODEC_FALLBACK_444 \
1566 VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PACKED, \
1567 VLC_CODEC_YUV_PLANAR_420, VLC_CODEC_YUV_PLANAR_440, \
1568 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1570 static const vlc_fourcc_t p_I444_fallback[] = {
1571 VLC_CODEC_I444, VLC_CODEC_J444, VLC_CODEC_FALLBACK_444, 0
1573 static const vlc_fourcc_t p_J444_fallback[] = {
1574 VLC_CODEC_J444, VLC_CODEC_I444, VLC_CODEC_FALLBACK_444, 0
1577 #define VLC_CODEC_FALLBACK_444_16 \
1578 VLC_CODEC_I444, VLC_CODEC_J444, VLC_CODEC_FALLBACK_444
1580 static const vlc_fourcc_t p_I444_9L_fallback[] = {
1581 VLC_CODEC_I444_9L, VLC_CODEC_I444_9B, VLC_CODEC_FALLBACK_444_16, 0
1583 static const vlc_fourcc_t p_I444_9B_fallback[] = {
1584 VLC_CODEC_I444_9B, VLC_CODEC_I444_9L, VLC_CODEC_FALLBACK_444_16, 0
1586 static const vlc_fourcc_t p_I444_10L_fallback[] = {
1587 VLC_CODEC_I444_10L, VLC_CODEC_I444_10B, VLC_CODEC_FALLBACK_444_16, 0
1589 static const vlc_fourcc_t p_I444_10B_fallback[] = {
1590 VLC_CODEC_I444_10B, VLC_CODEC_I444_10L, VLC_CODEC_FALLBACK_444_16, 0
1593 static const vlc_fourcc_t p_I440_fallback[] = {
1595 VLC_CODEC_YUV_PLANAR_420,
1596 VLC_CODEC_YUV_PLANAR_422,
1597 VLC_CODEC_YUV_PLANAR_444,
1598 VLC_CODEC_YUV_PACKED,
1599 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211, 0
1602 #define VLC_CODEC_FALLBACK_PACKED \
1603 VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PLANAR_420, \
1604 VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
1605 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211
1607 static const vlc_fourcc_t p_YUYV_fallback[] = {
1612 VLC_CODEC_FALLBACK_PACKED, 0
1614 static const vlc_fourcc_t p_YVYU_fallback[] = {
1619 VLC_CODEC_FALLBACK_PACKED, 0
1621 static const vlc_fourcc_t p_UYVY_fallback[] = {
1626 VLC_CODEC_FALLBACK_PACKED, 0
1628 static const vlc_fourcc_t p_VYUY_fallback[] = {
1633 VLC_CODEC_FALLBACK_PACKED, 0
1636 static const vlc_fourcc_t *pp_YUV_fallback[] = {
1641 p_I420_10L_fallback,
1642 p_I420_10B_fallback,
1647 p_I422_10L_fallback,
1648 p_I422_10B_fallback,
1654 p_I444_10L_fallback,
1655 p_I444_10B_fallback,
1666 static const vlc_fourcc_t p_list_YUV[] = {
1667 VLC_CODEC_YUV_PLANAR_420,
1668 VLC_CODEC_YUV_PLANAR_422,
1669 VLC_CODEC_YUV_PLANAR_440,
1670 VLC_CODEC_YUV_PLANAR_444,
1671 VLC_CODEC_YUV_PACKED,
1672 VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211,
1673 VLC_CODEC_YUV_PLANAR_420_16,
1674 VLC_CODEC_YUV_PLANAR_422_16,
1675 VLC_CODEC_YUV_PLANAR_444_16,
1680 static const vlc_fourcc_t p_RGB32_fallback[] = {
1688 static const vlc_fourcc_t p_RGB24_fallback[] = {
1696 static const vlc_fourcc_t p_RGB16_fallback[] = {
1704 static const vlc_fourcc_t p_RGB15_fallback[] = {
1712 static const vlc_fourcc_t p_RGB8_fallback[] = {
1720 static const vlc_fourcc_t *pp_RGB_fallback[] = {
1731 static const vlc_fourcc_t *GetFallback( vlc_fourcc_t i_fourcc,
1732 const vlc_fourcc_t *pp_fallback[],
1733 const vlc_fourcc_t p_list[] )
1735 for( unsigned i = 0; pp_fallback[i]; i++ )
1737 if( pp_fallback[i][0] == i_fourcc )
1738 return pp_fallback[i];
1743 const vlc_fourcc_t *vlc_fourcc_GetYUVFallback( vlc_fourcc_t i_fourcc )
1745 return GetFallback( i_fourcc, pp_YUV_fallback, p_list_YUV );
1747 const vlc_fourcc_t *vlc_fourcc_GetRGBFallback( vlc_fourcc_t i_fourcc )
1749 return GetFallback( i_fourcc, pp_RGB_fallback, p_RGB32_fallback );
1752 bool vlc_fourcc_AreUVPlanesSwapped( vlc_fourcc_t a, vlc_fourcc_t b )
1754 static const vlc_fourcc_t pp_swapped[][4] = {
1755 { VLC_CODEC_YV12, VLC_CODEC_I420, VLC_CODEC_J420, 0 },
1756 { VLC_CODEC_YV9, VLC_CODEC_I410, 0 },
1760 for( int i = 0; pp_swapped[i][0]; i++ )
1762 if( pp_swapped[i][0] == b )
1768 if( pp_swapped[i][0] != a )
1770 for( int j = 1; pp_swapped[i][j]; j++ )
1772 if( pp_swapped[i][j] == b )
1779 bool vlc_fourcc_IsYUV(vlc_fourcc_t fcc)
1781 for( unsigned i = 0; p_list_YUV[i]; i++ )
1783 if( p_list_YUV[i] == fcc )
1789 #define PLANAR(n, w_den, h_den, size, bits) \
1790 { .plane_count = n, \
1791 .p = { {.w = {1, 1}, .h = {1, 1}}, \
1792 {.w = {1,w_den}, .h = {1,h_den}}, \
1793 {.w = {1,w_den}, .h = {1,h_den}}, \
1794 {.w = {1, 1}, .h = {1, 1}} }, \
1795 .pixel_size = size, \
1796 .pixel_bits = bits }
1798 #define PLANAR_8(n, w_den, h_den) PLANAR(n, w_den, h_den, 1, 8)
1799 #define PLANAR_16(n, w_den, h_den, bits) PLANAR(n, w_den, h_den, 2, bits)
1801 #define PACKED_FMT(size, bits) \
1802 { .plane_count = 1, \
1803 .p = { {.w = {1,1}, .h = {1,1}} }, \
1804 .pixel_size = size, \
1805 .pixel_bits = bits }
1809 vlc_fourcc_t p_fourcc[6];
1810 vlc_chroma_description_t description;
1811 } p_list_chroma_description[] = {
1812 { { VLC_CODEC_I411, 0 }, PLANAR_8(3, 4, 1) },
1813 { { VLC_CODEC_YUV_PLANAR_410, 0 }, PLANAR_8(3, 4, 4) },
1814 { { VLC_CODEC_YUV_PLANAR_420, 0 }, PLANAR_8(3, 2, 2) },
1815 { { VLC_CODEC_NV12, VLC_CODEC_NV21, 0 }, PLANAR_8(2, 1, 2) },
1816 { { VLC_CODEC_YUV_PLANAR_422, 0 }, PLANAR_8(3, 2, 1) },
1817 { { VLC_CODEC_YUV_PLANAR_440, 0 }, PLANAR_8(3, 1, 2) },
1818 { { VLC_CODEC_YUV_PLANAR_444, 0 }, PLANAR_8(3, 1, 1) },
1819 { { VLC_CODEC_YUVA, 0 }, PLANAR_8(4, 1, 1) },
1821 { { VLC_CODEC_I420_10L,
1822 VLC_CODEC_I420_10B, 0 }, PLANAR_16(3, 2, 2, 10) },
1823 { { VLC_CODEC_I420_9L,
1824 VLC_CODEC_I420_9B, 0 }, PLANAR_16(3, 2, 2, 9) },
1825 { { VLC_CODEC_I422_10L,
1826 VLC_CODEC_I422_10B, 0 }, PLANAR_16(3, 2, 1, 10) },
1827 { { VLC_CODEC_I422_9L,
1828 VLC_CODEC_I422_9B, 0 }, PLANAR_16(3, 2, 1, 9) },
1829 { { VLC_CODEC_I444_10L,
1830 VLC_CODEC_I444_10B, 0 }, PLANAR_16(3, 1, 1, 10) },
1831 { { VLC_CODEC_I444_9L,
1832 VLC_CODEC_I444_9B, 0 }, PLANAR_16(3, 1, 1, 9) },
1834 { { VLC_CODEC_YUV_PACKED, 0 }, PACKED_FMT(2, 16) },
1835 { { VLC_CODEC_RGB8, VLC_CODEC_GREY,
1836 VLC_CODEC_YUVP, VLC_CODEC_RGBP, 0 }, PACKED_FMT(1, 8) },
1838 { { VLC_CODEC_RGB15, 0 }, PACKED_FMT(2, 15) },
1839 { { VLC_CODEC_RGB12, 0 }, PACKED_FMT(2, 12) },
1840 { { VLC_CODEC_RGB16, VLC_CODEC_RGBT,
1841 VLC_CODEC_RGBA16, 0 }, PACKED_FMT(2, 16) },
1842 { { VLC_CODEC_RGB24, 0 }, PACKED_FMT(3, 24) },
1843 { { VLC_CODEC_RGB32, 0 }, PACKED_FMT(4, 24) },
1844 { { VLC_CODEC_RGBA, 0 }, PACKED_FMT(4, 32) },
1846 { { VLC_CODEC_Y211, 0 }, { 1, { {{1,4}, {1,1}} }, 4, 32 } },
1848 { {0}, { 0, {}, 0, 0 } }
1856 const vlc_chroma_description_t *vlc_fourcc_GetChromaDescription( vlc_fourcc_t i_fourcc )
1858 for( unsigned i = 0; p_list_chroma_description[i].p_fourcc[0]; i++ )
1860 const vlc_fourcc_t *p_fourcc = p_list_chroma_description[i].p_fourcc;
1861 for( unsigned j = 0; p_fourcc[j]; j++ )
1863 if( p_fourcc[j] == i_fourcc )
1864 return &p_list_chroma_description[i].description;