avcodec/allcodecs: make avcodec_register_all thread safe
[ffmpeg.git] / libavcodec / allcodecs.c
1 /*
2  * Provide registration of all codecs, parsers and bitstream filters for libavcodec.
3  * Copyright (c) 2002 Fabrice Bellard
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21
22 /**
23  * @file
24  * Provide registration of all codecs, parsers and bitstream filters for libavcodec.
25  */
26
27 #include "config.h"
28 #include "libavutil/thread.h"
29 #include "avcodec.h"
30 #include "version.h"
31
32 #define REGISTER_HWACCEL(X, x)                                          \
33     {                                                                   \
34         extern AVHWAccel ff_##x##_hwaccel;                              \
35         if (CONFIG_##X##_HWACCEL)                                       \
36             av_register_hwaccel(&ff_##x##_hwaccel);                     \
37     }
38
39 #define REGISTER_ENCODER(X, x)                                          \
40     {                                                                   \
41         extern AVCodec ff_##x##_encoder;                                \
42         if (CONFIG_##X##_ENCODER)                                       \
43             avcodec_register(&ff_##x##_encoder);                        \
44     }
45
46 #define REGISTER_DECODER(X, x)                                          \
47     {                                                                   \
48         extern AVCodec ff_##x##_decoder;                                \
49         if (CONFIG_##X##_DECODER)                                       \
50             avcodec_register(&ff_##x##_decoder);                        \
51     }
52
53 #define REGISTER_ENCDEC(X, x) REGISTER_ENCODER(X, x); REGISTER_DECODER(X, x)
54
55 #define REGISTER_PARSER(X, x)                                           \
56     {                                                                   \
57         extern AVCodecParser ff_##x##_parser;                           \
58         if (CONFIG_##X##_PARSER)                                        \
59             av_register_codec_parser(&ff_##x##_parser);                 \
60     }
61
62 static void register_all(void)
63 {
64     /* hardware accelerators */
65     REGISTER_HWACCEL(H263_VAAPI,        h263_vaapi);
66     REGISTER_HWACCEL(H263_VIDEOTOOLBOX, h263_videotoolbox);
67     REGISTER_HWACCEL(H264_CUVID,        h264_cuvid);
68     REGISTER_HWACCEL(H264_D3D11VA,      h264_d3d11va);
69     REGISTER_HWACCEL(H264_DXVA2,        h264_dxva2);
70     REGISTER_HWACCEL(H264_MEDIACODEC,   h264_mediacodec);
71     REGISTER_HWACCEL(H264_MMAL,         h264_mmal);
72     REGISTER_HWACCEL(H264_QSV,          h264_qsv);
73     REGISTER_HWACCEL(H264_VAAPI,        h264_vaapi);
74     REGISTER_HWACCEL(H264_VDA,          h264_vda);
75     REGISTER_HWACCEL(H264_VDA_OLD,      h264_vda_old);
76     REGISTER_HWACCEL(H264_VDPAU,        h264_vdpau);
77     REGISTER_HWACCEL(H264_VIDEOTOOLBOX, h264_videotoolbox);
78     REGISTER_HWACCEL(HEVC_CUVID,        hevc_cuvid);
79     REGISTER_HWACCEL(HEVC_D3D11VA,      hevc_d3d11va);
80     REGISTER_HWACCEL(HEVC_DXVA2,        hevc_dxva2);
81     REGISTER_HWACCEL(HEVC_MEDIACODEC,   hevc_mediacodec);
82     REGISTER_HWACCEL(HEVC_QSV,          hevc_qsv);
83     REGISTER_HWACCEL(HEVC_VAAPI,        hevc_vaapi);
84     REGISTER_HWACCEL(HEVC_VDPAU,        hevc_vdpau);
85     REGISTER_HWACCEL(MJPEG_CUVID,       mjpeg_cuvid);
86     REGISTER_HWACCEL(MPEG1_CUVID,       mpeg1_cuvid);
87     REGISTER_HWACCEL(MPEG1_XVMC,        mpeg1_xvmc);
88     REGISTER_HWACCEL(MPEG1_VDPAU,       mpeg1_vdpau);
89     REGISTER_HWACCEL(MPEG1_VIDEOTOOLBOX, mpeg1_videotoolbox);
90     REGISTER_HWACCEL(MPEG2_CUVID,       mpeg2_cuvid);
91     REGISTER_HWACCEL(MPEG2_XVMC,        mpeg2_xvmc);
92     REGISTER_HWACCEL(MPEG2_D3D11VA,     mpeg2_d3d11va);
93     REGISTER_HWACCEL(MPEG2_DXVA2,       mpeg2_dxva2);
94     REGISTER_HWACCEL(MPEG2_MMAL,        mpeg2_mmal);
95     REGISTER_HWACCEL(MPEG2_QSV,         mpeg2_qsv);
96     REGISTER_HWACCEL(MPEG2_VAAPI,       mpeg2_vaapi);
97     REGISTER_HWACCEL(MPEG2_VDPAU,       mpeg2_vdpau);
98     REGISTER_HWACCEL(MPEG2_VIDEOTOOLBOX, mpeg2_videotoolbox);
99     REGISTER_HWACCEL(MPEG4_CUVID,       mpeg4_cuvid);
100     REGISTER_HWACCEL(MPEG4_MEDIACODEC,  mpeg4_mediacodec);
101     REGISTER_HWACCEL(MPEG4_MMAL,        mpeg4_mmal);
102     REGISTER_HWACCEL(MPEG4_VAAPI,       mpeg4_vaapi);
103     REGISTER_HWACCEL(MPEG4_VDPAU,       mpeg4_vdpau);
104     REGISTER_HWACCEL(MPEG4_VIDEOTOOLBOX, mpeg4_videotoolbox);
105     REGISTER_HWACCEL(VC1_CUVID,         vc1_cuvid);
106     REGISTER_HWACCEL(VC1_D3D11VA,       vc1_d3d11va);
107     REGISTER_HWACCEL(VC1_DXVA2,         vc1_dxva2);
108     REGISTER_HWACCEL(VC1_VAAPI,         vc1_vaapi);
109     REGISTER_HWACCEL(VC1_VDPAU,         vc1_vdpau);
110     REGISTER_HWACCEL(VC1_MMAL,          vc1_mmal);
111     REGISTER_HWACCEL(VC1_QSV,           vc1_qsv);
112     REGISTER_HWACCEL(VP8_CUVID,         vp8_cuvid);
113     REGISTER_HWACCEL(VP8_MEDIACODEC,    vp8_mediacodec);
114     REGISTER_HWACCEL(VP9_CUVID,         vp9_cuvid);
115     REGISTER_HWACCEL(VP9_D3D11VA,       vp9_d3d11va);
116     REGISTER_HWACCEL(VP9_DXVA2,         vp9_dxva2);
117     REGISTER_HWACCEL(VP9_MEDIACODEC,    vp9_mediacodec);
118     REGISTER_HWACCEL(VP9_VAAPI,         vp9_vaapi);
119     REGISTER_HWACCEL(WMV3_D3D11VA,      wmv3_d3d11va);
120     REGISTER_HWACCEL(WMV3_DXVA2,        wmv3_dxva2);
121     REGISTER_HWACCEL(WMV3_VAAPI,        wmv3_vaapi);
122     REGISTER_HWACCEL(WMV3_VDPAU,        wmv3_vdpau);
123
124     /* video codecs */
125     REGISTER_ENCODER(A64MULTI,          a64multi);
126     REGISTER_ENCODER(A64MULTI5,         a64multi5);
127     REGISTER_DECODER(AASC,              aasc);
128     REGISTER_DECODER(AIC,               aic);
129     REGISTER_ENCDEC (ALIAS_PIX,         alias_pix);
130     REGISTER_ENCDEC (AMV,               amv);
131     REGISTER_DECODER(ANM,               anm);
132     REGISTER_DECODER(ANSI,              ansi);
133     REGISTER_ENCDEC (APNG,              apng);
134     REGISTER_ENCDEC (ASV1,              asv1);
135     REGISTER_ENCDEC (ASV2,              asv2);
136     REGISTER_DECODER(AURA,              aura);
137     REGISTER_DECODER(AURA2,             aura2);
138     REGISTER_ENCDEC (AVRP,              avrp);
139     REGISTER_DECODER(AVRN,              avrn);
140     REGISTER_DECODER(AVS,               avs);
141     REGISTER_ENCDEC (AVUI,              avui);
142     REGISTER_ENCDEC (AYUV,              ayuv);
143     REGISTER_DECODER(BETHSOFTVID,       bethsoftvid);
144     REGISTER_DECODER(BFI,               bfi);
145     REGISTER_DECODER(BINK,              bink);
146     REGISTER_ENCDEC (BMP,               bmp);
147     REGISTER_DECODER(BMV_VIDEO,         bmv_video);
148     REGISTER_DECODER(BRENDER_PIX,       brender_pix);
149     REGISTER_DECODER(C93,               c93);
150     REGISTER_DECODER(CAVS,              cavs);
151     REGISTER_DECODER(CDGRAPHICS,        cdgraphics);
152     REGISTER_DECODER(CDXL,              cdxl);
153     REGISTER_DECODER(CFHD,              cfhd);
154     REGISTER_ENCDEC (CINEPAK,           cinepak);
155     REGISTER_DECODER(CLEARVIDEO,        clearvideo);
156     REGISTER_ENCDEC (CLJR,              cljr);
157     REGISTER_DECODER(CLLC,              cllc);
158     REGISTER_ENCDEC (COMFORTNOISE,      comfortnoise);
159     REGISTER_DECODER(CPIA,              cpia);
160     REGISTER_DECODER(CSCD,              cscd);
161     REGISTER_DECODER(CYUV,              cyuv);
162     REGISTER_DECODER(DDS,               dds);
163     REGISTER_DECODER(DFA,               dfa);
164     REGISTER_DECODER(DIRAC,             dirac);
165     REGISTER_ENCDEC (DNXHD,             dnxhd);
166     REGISTER_ENCDEC (DPX,               dpx);
167     REGISTER_DECODER(DSICINVIDEO,       dsicinvideo);
168     REGISTER_DECODER(DVAUDIO,           dvaudio);
169     REGISTER_ENCDEC (DVVIDEO,           dvvideo);
170     REGISTER_DECODER(DXA,               dxa);
171     REGISTER_DECODER(DXTORY,            dxtory);
172     REGISTER_DECODER(DXV,               dxv);
173     REGISTER_DECODER(EACMV,             eacmv);
174     REGISTER_DECODER(EAMAD,             eamad);
175     REGISTER_DECODER(EATGQ,             eatgq);
176     REGISTER_DECODER(EATGV,             eatgv);
177     REGISTER_DECODER(EATQI,             eatqi);
178     REGISTER_DECODER(EIGHTBPS,          eightbps);
179     REGISTER_DECODER(EIGHTSVX_EXP,      eightsvx_exp);
180     REGISTER_DECODER(EIGHTSVX_FIB,      eightsvx_fib);
181     REGISTER_DECODER(ESCAPE124,         escape124);
182     REGISTER_DECODER(ESCAPE130,         escape130);
183     REGISTER_DECODER(EXR,               exr);
184     REGISTER_ENCDEC (FFV1,              ffv1);
185     REGISTER_ENCDEC (FFVHUFF,           ffvhuff);
186     REGISTER_DECODER(FIC,               fic);
187     REGISTER_ENCDEC (FLASHSV,           flashsv);
188     REGISTER_ENCDEC (FLASHSV2,          flashsv2);
189     REGISTER_DECODER(FLIC,              flic);
190     REGISTER_ENCDEC (FLV,               flv);
191     REGISTER_DECODER(FMVC,              fmvc);
192     REGISTER_DECODER(FOURXM,            fourxm);
193     REGISTER_DECODER(FRAPS,             fraps);
194     REGISTER_DECODER(FRWU,              frwu);
195     REGISTER_DECODER(G2M,               g2m);
196     REGISTER_ENCDEC (GIF,               gif);
197     REGISTER_ENCDEC (H261,              h261);
198     REGISTER_ENCDEC (H263,              h263);
199     REGISTER_DECODER(H263I,             h263i);
200     REGISTER_ENCDEC (H263P,             h263p);
201     REGISTER_DECODER(H264,              h264);
202     REGISTER_DECODER(H264_CRYSTALHD,    h264_crystalhd);
203     REGISTER_DECODER(H264_MEDIACODEC,   h264_mediacodec);
204     REGISTER_DECODER(H264_MMAL,         h264_mmal);
205     REGISTER_DECODER(H264_QSV,          h264_qsv);
206     REGISTER_DECODER(H264_VDA,          h264_vda);
207 #if FF_API_VDPAU
208     REGISTER_DECODER(H264_VDPAU,        h264_vdpau);
209 #endif
210     REGISTER_ENCDEC (HAP,               hap);
211     REGISTER_DECODER(HEVC,              hevc);
212     REGISTER_DECODER(HEVC_QSV,          hevc_qsv);
213     REGISTER_DECODER(HNM4_VIDEO,        hnm4_video);
214     REGISTER_DECODER(HQ_HQA,            hq_hqa);
215     REGISTER_DECODER(HQX,               hqx);
216     REGISTER_ENCDEC (HUFFYUV,           huffyuv);
217     REGISTER_DECODER(IDCIN,             idcin);
218     REGISTER_DECODER(IFF_ILBM,          iff_ilbm);
219     REGISTER_DECODER(INDEO2,            indeo2);
220     REGISTER_DECODER(INDEO3,            indeo3);
221     REGISTER_DECODER(INDEO4,            indeo4);
222     REGISTER_DECODER(INDEO5,            indeo5);
223     REGISTER_DECODER(INTERPLAY_VIDEO,   interplay_video);
224     REGISTER_ENCDEC (JPEG2000,          jpeg2000);
225     REGISTER_ENCDEC (JPEGLS,            jpegls);
226     REGISTER_DECODER(JV,                jv);
227     REGISTER_DECODER(KGV1,              kgv1);
228     REGISTER_DECODER(KMVC,              kmvc);
229     REGISTER_DECODER(LAGARITH,          lagarith);
230     REGISTER_ENCODER(LJPEG,             ljpeg);
231     REGISTER_DECODER(LOCO,              loco);
232     REGISTER_DECODER(M101,              m101);
233     REGISTER_DECODER(MAGICYUV,          magicyuv);
234     REGISTER_DECODER(MDEC,              mdec);
235     REGISTER_DECODER(MIMIC,             mimic);
236     REGISTER_ENCDEC (MJPEG,             mjpeg);
237     REGISTER_DECODER(MJPEGB,            mjpegb);
238     REGISTER_DECODER(MMVIDEO,           mmvideo);
239     REGISTER_DECODER(MOTIONPIXELS,      motionpixels);
240 #if FF_API_XVMC
241     REGISTER_DECODER(MPEG_XVMC,         mpeg_xvmc);
242 #endif /* FF_API_XVMC */
243     REGISTER_ENCDEC (MPEG1VIDEO,        mpeg1video);
244     REGISTER_ENCDEC (MPEG2VIDEO,        mpeg2video);
245     REGISTER_ENCDEC (MPEG4,             mpeg4);
246     REGISTER_DECODER(MPEG4_CRYSTALHD,   mpeg4_crystalhd);
247     REGISTER_DECODER(MPEG4_MMAL,        mpeg4_mmal);
248 #if FF_API_VDPAU
249     REGISTER_DECODER(MPEG4_VDPAU,       mpeg4_vdpau);
250 #endif
251     REGISTER_DECODER(MPEGVIDEO,         mpegvideo);
252 #if FF_API_VDPAU
253     REGISTER_DECODER(MPEG_VDPAU,        mpeg_vdpau);
254     REGISTER_DECODER(MPEG1_VDPAU,       mpeg1_vdpau);
255 #endif
256     REGISTER_DECODER(MPEG2_MMAL,        mpeg2_mmal);
257     REGISTER_DECODER(MPEG2_CRYSTALHD,   mpeg2_crystalhd);
258     REGISTER_DECODER(MPEG2_QSV,         mpeg2_qsv);
259     REGISTER_DECODER(MSA1,              msa1);
260     REGISTER_DECODER(MSMPEG4V1,         msmpeg4v1);
261     REGISTER_ENCDEC (MSMPEG4V2,         msmpeg4v2);
262     REGISTER_ENCDEC (MSMPEG4V3,         msmpeg4v3);
263     REGISTER_DECODER(MSMPEG4_CRYSTALHD, msmpeg4_crystalhd);
264     REGISTER_DECODER(MSRLE,             msrle);
265     REGISTER_DECODER(MSS1,              mss1);
266     REGISTER_DECODER(MSS2,              mss2);
267     REGISTER_ENCDEC (MSVIDEO1,          msvideo1);
268     REGISTER_DECODER(MSZH,              mszh);
269     REGISTER_DECODER(MTS2,              mts2);
270     REGISTER_DECODER(MVC1,              mvc1);
271     REGISTER_DECODER(MVC2,              mvc2);
272     REGISTER_DECODER(MXPEG,             mxpeg);
273     REGISTER_DECODER(NUV,               nuv);
274     REGISTER_DECODER(PAF_VIDEO,         paf_video);
275     REGISTER_ENCDEC (PAM,               pam);
276     REGISTER_ENCDEC (PBM,               pbm);
277     REGISTER_ENCDEC (PCX,               pcx);
278     REGISTER_ENCDEC (PGM,               pgm);
279     REGISTER_ENCDEC (PGMYUV,            pgmyuv);
280     REGISTER_DECODER(PICTOR,            pictor);
281     REGISTER_DECODER(PIXLET,            pixlet);
282     REGISTER_ENCDEC (PNG,               png);
283     REGISTER_ENCDEC (PPM,               ppm);
284     REGISTER_ENCDEC (PRORES,            prores);
285     REGISTER_ENCODER(PRORES_AW,         prores_aw);
286     REGISTER_ENCODER(PRORES_KS,         prores_ks);
287     REGISTER_DECODER(PRORES_LGPL,       prores_lgpl);
288     REGISTER_DECODER(PSD,               psd);
289     REGISTER_DECODER(PTX,               ptx);
290     REGISTER_DECODER(QDRAW,             qdraw);
291     REGISTER_DECODER(QPEG,              qpeg);
292     REGISTER_ENCDEC (QTRLE,             qtrle);
293     REGISTER_ENCDEC (R10K,              r10k);
294     REGISTER_ENCDEC (R210,              r210);
295     REGISTER_ENCDEC (RAWVIDEO,          rawvideo);
296     REGISTER_DECODER(RL2,               rl2);
297     REGISTER_ENCDEC (ROQ,               roq);
298     REGISTER_DECODER(RPZA,              rpza);
299     REGISTER_DECODER(RSCC,              rscc);
300     REGISTER_ENCDEC (RV10,              rv10);
301     REGISTER_ENCDEC (RV20,              rv20);
302     REGISTER_DECODER(RV30,              rv30);
303     REGISTER_DECODER(RV40,              rv40);
304     REGISTER_ENCDEC (S302M,             s302m);
305     REGISTER_DECODER(SANM,              sanm);
306     REGISTER_DECODER(SCPR,              scpr);
307     REGISTER_DECODER(SCREENPRESSO,      screenpresso);
308     REGISTER_DECODER(SDX2_DPCM,         sdx2_dpcm);
309     REGISTER_ENCDEC (SGI,               sgi);
310     REGISTER_DECODER(SGIRLE,            sgirle);
311     REGISTER_DECODER(SHEERVIDEO,        sheervideo);
312     REGISTER_DECODER(SMACKER,           smacker);
313     REGISTER_DECODER(SMC,               smc);
314     REGISTER_DECODER(SMVJPEG,           smvjpeg);
315     REGISTER_ENCDEC (SNOW,              snow);
316     REGISTER_DECODER(SP5X,              sp5x);
317     REGISTER_DECODER(SPEEDHQ,           speedhq);
318     REGISTER_ENCDEC (SUNRAST,           sunrast);
319     REGISTER_ENCDEC (SVQ1,              svq1);
320     REGISTER_DECODER(SVQ3,              svq3);
321     REGISTER_ENCDEC (TARGA,             targa);
322     REGISTER_DECODER(TARGA_Y216,        targa_y216);
323     REGISTER_DECODER(TDSC,              tdsc);
324     REGISTER_DECODER(THEORA,            theora);
325     REGISTER_DECODER(THP,               thp);
326     REGISTER_DECODER(TIERTEXSEQVIDEO,   tiertexseqvideo);
327     REGISTER_ENCDEC (TIFF,              tiff);
328     REGISTER_DECODER(TMV,               tmv);
329     REGISTER_DECODER(TRUEMOTION1,       truemotion1);
330     REGISTER_DECODER(TRUEMOTION2,       truemotion2);
331     REGISTER_DECODER(TRUEMOTION2RT,     truemotion2rt);
332     REGISTER_DECODER(TSCC,              tscc);
333     REGISTER_DECODER(TSCC2,             tscc2);
334     REGISTER_DECODER(TXD,               txd);
335     REGISTER_DECODER(ULTI,              ulti);
336     REGISTER_ENCDEC (UTVIDEO,           utvideo);
337     REGISTER_ENCDEC (V210,              v210);
338     REGISTER_DECODER(V210X,             v210x);
339     REGISTER_ENCDEC (V308,              v308);
340     REGISTER_ENCDEC (V408,              v408);
341     REGISTER_ENCDEC (V410,              v410);
342     REGISTER_DECODER(VB,                vb);
343     REGISTER_DECODER(VBLE,              vble);
344     REGISTER_DECODER(VC1,               vc1);
345     REGISTER_DECODER(VC1_CRYSTALHD,     vc1_crystalhd);
346 #if FF_API_VDPAU
347     REGISTER_DECODER(VC1_VDPAU,         vc1_vdpau);
348 #endif
349     REGISTER_DECODER(VC1IMAGE,          vc1image);
350     REGISTER_DECODER(VC1_MMAL,          vc1_mmal);
351     REGISTER_DECODER(VC1_QSV,           vc1_qsv);
352     REGISTER_ENCODER(VC2,               vc2);
353     REGISTER_DECODER(VCR1,              vcr1);
354     REGISTER_DECODER(VMDVIDEO,          vmdvideo);
355     REGISTER_DECODER(VMNC,              vmnc);
356     REGISTER_DECODER(VP3,               vp3);
357     REGISTER_DECODER(VP5,               vp5);
358     REGISTER_DECODER(VP6,               vp6);
359     REGISTER_DECODER(VP6A,              vp6a);
360     REGISTER_DECODER(VP6F,              vp6f);
361     REGISTER_DECODER(VP7,               vp7);
362     REGISTER_DECODER(VP8,               vp8);
363     REGISTER_DECODER(VP9,               vp9);
364     REGISTER_DECODER(VQA,               vqa);
365     REGISTER_DECODER(WEBP,              webp);
366     REGISTER_ENCODER(WRAPPED_AVFRAME,   wrapped_avframe);
367     REGISTER_ENCDEC (WMV1,              wmv1);
368     REGISTER_ENCDEC (WMV2,              wmv2);
369     REGISTER_DECODER(WMV3,              wmv3);
370     REGISTER_DECODER(WMV3_CRYSTALHD,    wmv3_crystalhd);
371 #if FF_API_VDPAU
372     REGISTER_DECODER(WMV3_VDPAU,        wmv3_vdpau);
373 #endif
374     REGISTER_DECODER(WMV3IMAGE,         wmv3image);
375     REGISTER_DECODER(WNV1,              wnv1);
376     REGISTER_DECODER(XAN_WC3,           xan_wc3);
377     REGISTER_DECODER(XAN_WC4,           xan_wc4);
378     REGISTER_ENCDEC (XBM,               xbm);
379     REGISTER_ENCDEC (XFACE,             xface);
380     REGISTER_DECODER(XL,                xl);
381     REGISTER_ENCDEC (XWD,               xwd);
382     REGISTER_ENCDEC (Y41P,              y41p);
383     REGISTER_DECODER(YLC,               ylc);
384     REGISTER_DECODER(YOP,               yop);
385     REGISTER_ENCDEC (YUV4,              yuv4);
386     REGISTER_DECODER(ZERO12V,           zero12v);
387     REGISTER_DECODER(ZEROCODEC,         zerocodec);
388     REGISTER_ENCDEC (ZLIB,              zlib);
389     REGISTER_ENCDEC (ZMBV,              zmbv);
390
391     /* audio codecs */
392     REGISTER_ENCDEC (AAC,               aac);
393     REGISTER_DECODER(AAC_FIXED,         aac_fixed);
394     REGISTER_DECODER(AAC_LATM,          aac_latm);
395     REGISTER_ENCDEC (AC3,               ac3);
396     REGISTER_ENCDEC (AC3_FIXED,         ac3_fixed);
397     REGISTER_ENCDEC (ALAC,              alac);
398     REGISTER_DECODER(ALS,               als);
399     REGISTER_DECODER(AMRNB,             amrnb);
400     REGISTER_DECODER(AMRWB,             amrwb);
401     REGISTER_DECODER(APE,               ape);
402     REGISTER_DECODER(ATRAC1,            atrac1);
403     REGISTER_DECODER(ATRAC3,            atrac3);
404     REGISTER_DECODER(ATRAC3AL,          atrac3al);
405     REGISTER_DECODER(ATRAC3P,           atrac3p);
406     REGISTER_DECODER(ATRAC3PAL,         atrac3pal);
407     REGISTER_DECODER(BINKAUDIO_DCT,     binkaudio_dct);
408     REGISTER_DECODER(BINKAUDIO_RDFT,    binkaudio_rdft);
409     REGISTER_DECODER(BMV_AUDIO,         bmv_audio);
410     REGISTER_DECODER(COOK,              cook);
411     REGISTER_ENCDEC (DCA,               dca);
412     REGISTER_DECODER(DSD_LSBF,          dsd_lsbf);
413     REGISTER_DECODER(DSD_MSBF,          dsd_msbf);
414     REGISTER_DECODER(DSD_LSBF_PLANAR,   dsd_lsbf_planar);
415     REGISTER_DECODER(DSD_MSBF_PLANAR,   dsd_msbf_planar);
416     REGISTER_DECODER(DSICINAUDIO,       dsicinaudio);
417     REGISTER_DECODER(DSS_SP,            dss_sp);
418     REGISTER_DECODER(DST,               dst);
419     REGISTER_ENCDEC (EAC3,              eac3);
420     REGISTER_DECODER(EVRC,              evrc);
421     REGISTER_DECODER(FFWAVESYNTH,       ffwavesynth);
422     REGISTER_ENCDEC (FLAC,              flac);
423     REGISTER_ENCDEC (G723_1,            g723_1);
424     REGISTER_DECODER(G729,              g729);
425     REGISTER_DECODER(GSM,               gsm);
426     REGISTER_DECODER(GSM_MS,            gsm_ms);
427     REGISTER_DECODER(IAC,               iac);
428     REGISTER_DECODER(IMC,               imc);
429     REGISTER_DECODER(INTERPLAY_ACM,     interplay_acm);
430     REGISTER_DECODER(MACE3,             mace3);
431     REGISTER_DECODER(MACE6,             mace6);
432     REGISTER_DECODER(METASOUND,         metasound);
433     REGISTER_ENCDEC (MLP,               mlp);
434     REGISTER_DECODER(MP1,               mp1);
435     REGISTER_DECODER(MP1FLOAT,          mp1float);
436     REGISTER_ENCDEC (MP2,               mp2);
437     REGISTER_DECODER(MP2FLOAT,          mp2float);
438     REGISTER_ENCODER(MP2FIXED,          mp2fixed);
439     REGISTER_DECODER(MP3,               mp3);
440     REGISTER_DECODER(MP3FLOAT,          mp3float);
441     REGISTER_DECODER(MP3ADU,            mp3adu);
442     REGISTER_DECODER(MP3ADUFLOAT,       mp3adufloat);
443     REGISTER_DECODER(MP3ON4,            mp3on4);
444     REGISTER_DECODER(MP3ON4FLOAT,       mp3on4float);
445     REGISTER_DECODER(MPC7,              mpc7);
446     REGISTER_DECODER(MPC8,              mpc8);
447     REGISTER_ENCDEC (NELLYMOSER,        nellymoser);
448     REGISTER_DECODER(ON2AVC,            on2avc);
449     REGISTER_ENCDEC (OPUS,              opus);
450     REGISTER_DECODER(PAF_AUDIO,         paf_audio);
451     REGISTER_DECODER(QCELP,             qcelp);
452     REGISTER_DECODER(QDM2,              qdm2);
453     REGISTER_DECODER(QDMC,              qdmc);
454     REGISTER_ENCDEC (RA_144,            ra_144);
455     REGISTER_DECODER(RA_288,            ra_288);
456     REGISTER_DECODER(RALF,              ralf);
457     REGISTER_DECODER(SHORTEN,           shorten);
458     REGISTER_DECODER(SIPR,              sipr);
459     REGISTER_DECODER(SMACKAUD,          smackaud);
460     REGISTER_ENCDEC (SONIC,             sonic);
461     REGISTER_ENCODER(SONIC_LS,          sonic_ls);
462     REGISTER_DECODER(TAK,               tak);
463     REGISTER_ENCDEC (TRUEHD,            truehd);
464     REGISTER_DECODER(TRUESPEECH,        truespeech);
465     REGISTER_ENCDEC (TTA,               tta);
466     REGISTER_DECODER(TWINVQ,            twinvq);
467     REGISTER_DECODER(VMDAUDIO,          vmdaudio);
468     REGISTER_ENCDEC (VORBIS,            vorbis);
469     REGISTER_ENCDEC (WAVPACK,           wavpack);
470     REGISTER_DECODER(WMALOSSLESS,       wmalossless);
471     REGISTER_DECODER(WMAPRO,            wmapro);
472     REGISTER_ENCDEC (WMAV1,             wmav1);
473     REGISTER_ENCDEC (WMAV2,             wmav2);
474     REGISTER_DECODER(WMAVOICE,          wmavoice);
475     REGISTER_DECODER(WS_SND1,           ws_snd1);
476     REGISTER_DECODER(XMA1,              xma1);
477     REGISTER_DECODER(XMA2,              xma2);
478
479     /* PCM codecs */
480     REGISTER_ENCDEC (PCM_ALAW,          pcm_alaw);
481     REGISTER_DECODER(PCM_BLURAY,        pcm_bluray);
482     REGISTER_DECODER(PCM_DVD,           pcm_dvd);
483     REGISTER_DECODER(PCM_F16LE,         pcm_f16le);
484     REGISTER_DECODER(PCM_F24LE,         pcm_f24le);
485     REGISTER_ENCDEC (PCM_F32BE,         pcm_f32be);
486     REGISTER_ENCDEC (PCM_F32LE,         pcm_f32le);
487     REGISTER_ENCDEC (PCM_F64BE,         pcm_f64be);
488     REGISTER_ENCDEC (PCM_F64LE,         pcm_f64le);
489     REGISTER_DECODER(PCM_LXF,           pcm_lxf);
490     REGISTER_ENCDEC (PCM_MULAW,         pcm_mulaw);
491     REGISTER_ENCDEC (PCM_S8,            pcm_s8);
492     REGISTER_ENCDEC (PCM_S8_PLANAR,     pcm_s8_planar);
493     REGISTER_ENCDEC (PCM_S16BE,         pcm_s16be);
494     REGISTER_ENCDEC (PCM_S16BE_PLANAR,  pcm_s16be_planar);
495     REGISTER_ENCDEC (PCM_S16LE,         pcm_s16le);
496     REGISTER_ENCDEC (PCM_S16LE_PLANAR,  pcm_s16le_planar);
497     REGISTER_ENCDEC (PCM_S24BE,         pcm_s24be);
498     REGISTER_ENCDEC (PCM_S24DAUD,       pcm_s24daud);
499     REGISTER_ENCDEC (PCM_S24LE,         pcm_s24le);
500     REGISTER_ENCDEC (PCM_S24LE_PLANAR,  pcm_s24le_planar);
501     REGISTER_ENCDEC (PCM_S32BE,         pcm_s32be);
502     REGISTER_ENCDEC (PCM_S32LE,         pcm_s32le);
503     REGISTER_ENCDEC (PCM_S32LE_PLANAR,  pcm_s32le_planar);
504     REGISTER_ENCDEC (PCM_S64BE,         pcm_s64be);
505     REGISTER_ENCDEC (PCM_S64LE,         pcm_s64le);
506     REGISTER_ENCDEC (PCM_U8,            pcm_u8);
507     REGISTER_ENCDEC (PCM_U16BE,         pcm_u16be);
508     REGISTER_ENCDEC (PCM_U16LE,         pcm_u16le);
509     REGISTER_ENCDEC (PCM_U24BE,         pcm_u24be);
510     REGISTER_ENCDEC (PCM_U24LE,         pcm_u24le);
511     REGISTER_ENCDEC (PCM_U32BE,         pcm_u32be);
512     REGISTER_ENCDEC (PCM_U32LE,         pcm_u32le);
513     REGISTER_DECODER(PCM_ZORK,          pcm_zork);
514
515     /* DPCM codecs */
516     REGISTER_DECODER(INTERPLAY_DPCM,    interplay_dpcm);
517     REGISTER_ENCDEC (ROQ_DPCM,          roq_dpcm);
518     REGISTER_DECODER(SOL_DPCM,          sol_dpcm);
519     REGISTER_DECODER(XAN_DPCM,          xan_dpcm);
520
521     /* ADPCM codecs */
522     REGISTER_DECODER(ADPCM_4XM,         adpcm_4xm);
523     REGISTER_ENCDEC (ADPCM_ADX,         adpcm_adx);
524     REGISTER_DECODER(ADPCM_AFC,         adpcm_afc);
525     REGISTER_DECODER(ADPCM_AICA,        adpcm_aica);
526     REGISTER_DECODER(ADPCM_CT,          adpcm_ct);
527     REGISTER_DECODER(ADPCM_DTK,         adpcm_dtk);
528     REGISTER_DECODER(ADPCM_EA,          adpcm_ea);
529     REGISTER_DECODER(ADPCM_EA_MAXIS_XA, adpcm_ea_maxis_xa);
530     REGISTER_DECODER(ADPCM_EA_R1,       adpcm_ea_r1);
531     REGISTER_DECODER(ADPCM_EA_R2,       adpcm_ea_r2);
532     REGISTER_DECODER(ADPCM_EA_R3,       adpcm_ea_r3);
533     REGISTER_DECODER(ADPCM_EA_XAS,      adpcm_ea_xas);
534     REGISTER_ENCDEC (ADPCM_G722,        adpcm_g722);
535     REGISTER_ENCDEC (ADPCM_G726,        adpcm_g726);
536     REGISTER_DECODER(ADPCM_G726LE,      adpcm_g726le);
537     REGISTER_DECODER(ADPCM_IMA_AMV,     adpcm_ima_amv);
538     REGISTER_DECODER(ADPCM_IMA_APC,     adpcm_ima_apc);
539     REGISTER_DECODER(ADPCM_IMA_DAT4,    adpcm_ima_dat4);
540     REGISTER_DECODER(ADPCM_IMA_DK3,     adpcm_ima_dk3);
541     REGISTER_DECODER(ADPCM_IMA_DK4,     adpcm_ima_dk4);
542     REGISTER_DECODER(ADPCM_IMA_EA_EACS, adpcm_ima_ea_eacs);
543     REGISTER_DECODER(ADPCM_IMA_EA_SEAD, adpcm_ima_ea_sead);
544     REGISTER_DECODER(ADPCM_IMA_ISS,     adpcm_ima_iss);
545     REGISTER_DECODER(ADPCM_IMA_OKI,     adpcm_ima_oki);
546     REGISTER_ENCDEC (ADPCM_IMA_QT,      adpcm_ima_qt);
547     REGISTER_DECODER(ADPCM_IMA_RAD,     adpcm_ima_rad);
548     REGISTER_DECODER(ADPCM_IMA_SMJPEG,  adpcm_ima_smjpeg);
549     REGISTER_ENCDEC (ADPCM_IMA_WAV,     adpcm_ima_wav);
550     REGISTER_DECODER(ADPCM_IMA_WS,      adpcm_ima_ws);
551     REGISTER_ENCDEC (ADPCM_MS,          adpcm_ms);
552     REGISTER_DECODER(ADPCM_MTAF,        adpcm_mtaf);
553     REGISTER_DECODER(ADPCM_PSX,         adpcm_psx);
554     REGISTER_DECODER(ADPCM_SBPRO_2,     adpcm_sbpro_2);
555     REGISTER_DECODER(ADPCM_SBPRO_3,     adpcm_sbpro_3);
556     REGISTER_DECODER(ADPCM_SBPRO_4,     adpcm_sbpro_4);
557     REGISTER_ENCDEC (ADPCM_SWF,         adpcm_swf);
558     REGISTER_DECODER(ADPCM_THP,         adpcm_thp);
559     REGISTER_DECODER(ADPCM_THP_LE,      adpcm_thp_le);
560     REGISTER_DECODER(ADPCM_VIMA,        adpcm_vima);
561     REGISTER_DECODER(ADPCM_XA,          adpcm_xa);
562     REGISTER_ENCDEC (ADPCM_YAMAHA,      adpcm_yamaha);
563
564     /* subtitles */
565     REGISTER_ENCDEC (SSA,               ssa);
566     REGISTER_ENCDEC (ASS,               ass);
567     REGISTER_DECODER(CCAPTION,          ccaption);
568     REGISTER_ENCDEC (DVBSUB,            dvbsub);
569     REGISTER_ENCDEC (DVDSUB,            dvdsub);
570     REGISTER_DECODER(JACOSUB,           jacosub);
571     REGISTER_DECODER(MICRODVD,          microdvd);
572     REGISTER_ENCDEC (MOVTEXT,           movtext);
573     REGISTER_DECODER(MPL2,              mpl2);
574     REGISTER_DECODER(PGSSUB,            pgssub);
575     REGISTER_DECODER(PJS,               pjs);
576     REGISTER_DECODER(REALTEXT,          realtext);
577     REGISTER_DECODER(SAMI,              sami);
578     REGISTER_ENCDEC (SRT,               srt);
579     REGISTER_DECODER(STL,               stl);
580     REGISTER_ENCDEC (SUBRIP,            subrip);
581     REGISTER_DECODER(SUBVIEWER,         subviewer);
582     REGISTER_DECODER(SUBVIEWER1,        subviewer1);
583     REGISTER_ENCDEC (TEXT,              text);
584     REGISTER_DECODER(VPLAYER,           vplayer);
585     REGISTER_ENCDEC (WEBVTT,            webvtt);
586     REGISTER_ENCDEC (XSUB,              xsub);
587
588     /* external libraries */
589     REGISTER_ENCDEC (AAC_AT,            aac_at);
590     REGISTER_DECODER(AC3_AT,            ac3_at);
591     REGISTER_DECODER(ADPCM_IMA_QT_AT,   adpcm_ima_qt_at);
592     REGISTER_ENCDEC (ALAC_AT,           alac_at);
593     REGISTER_DECODER(AMR_NB_AT,         amr_nb_at);
594     REGISTER_DECODER(EAC3_AT,           eac3_at);
595     REGISTER_DECODER(GSM_MS_AT,         gsm_ms_at);
596     REGISTER_ENCDEC (ILBC_AT,           ilbc_at);
597     REGISTER_DECODER(MP1_AT,            mp1_at);
598     REGISTER_DECODER(MP2_AT,            mp2_at);
599     REGISTER_DECODER(MP3_AT,            mp3_at);
600     REGISTER_ENCDEC (PCM_ALAW_AT,       pcm_alaw_at);
601     REGISTER_ENCDEC (PCM_MULAW_AT,      pcm_mulaw_at);
602     REGISTER_DECODER(QDMC_AT,           qdmc_at);
603     REGISTER_DECODER(QDM2_AT,           qdm2_at);
604     REGISTER_DECODER(LIBCELT,           libcelt);
605     REGISTER_ENCDEC (LIBFDK_AAC,        libfdk_aac);
606     REGISTER_ENCDEC (LIBGSM,            libgsm);
607     REGISTER_ENCDEC (LIBGSM_MS,         libgsm_ms);
608     REGISTER_ENCDEC (LIBILBC,           libilbc);
609     REGISTER_ENCODER(LIBMP3LAME,        libmp3lame);
610     REGISTER_ENCDEC (LIBOPENCORE_AMRNB, libopencore_amrnb);
611     REGISTER_DECODER(LIBOPENCORE_AMRWB, libopencore_amrwb);
612     REGISTER_ENCDEC (LIBOPENJPEG,       libopenjpeg);
613     REGISTER_ENCDEC (LIBOPUS,           libopus);
614     REGISTER_ENCDEC (LIBSCHROEDINGER,   libschroedinger);
615     REGISTER_ENCODER(LIBSHINE,          libshine);
616     REGISTER_ENCDEC (LIBSPEEX,          libspeex);
617     REGISTER_ENCODER(LIBTHEORA,         libtheora);
618     REGISTER_ENCODER(LIBTWOLAME,        libtwolame);
619     REGISTER_ENCODER(LIBVO_AMRWBENC,    libvo_amrwbenc);
620     REGISTER_ENCDEC (LIBVORBIS,         libvorbis);
621     REGISTER_ENCDEC (LIBVPX_VP8,        libvpx_vp8);
622     REGISTER_ENCDEC (LIBVPX_VP9,        libvpx_vp9);
623     REGISTER_ENCODER(LIBWAVPACK,        libwavpack);
624     REGISTER_ENCODER(LIBWEBP_ANIM,      libwebp_anim);  /* preferred over libwebp */
625     REGISTER_ENCODER(LIBWEBP,           libwebp);
626     REGISTER_ENCODER(LIBX262,           libx262);
627     REGISTER_ENCODER(LIBX264,           libx264);
628     REGISTER_ENCODER(LIBX264RGB,        libx264rgb);
629     REGISTER_ENCODER(LIBX265,           libx265);
630     REGISTER_ENCODER(LIBXAVS,           libxavs);
631     REGISTER_ENCODER(LIBXVID,           libxvid);
632     REGISTER_DECODER(LIBZVBI_TELETEXT,  libzvbi_teletext);
633
634     /* text */
635     REGISTER_DECODER(BINTEXT,           bintext);
636     REGISTER_DECODER(XBIN,              xbin);
637     REGISTER_DECODER(IDF,               idf);
638
639     /* external libraries, that shouldn't be used by default if one of the
640      * above is available */
641     REGISTER_ENCDEC (LIBOPENH264,       libopenh264);
642     REGISTER_DECODER(H264_CUVID,        h264_cuvid);
643     REGISTER_ENCODER(H264_NVENC,        h264_nvenc);
644     REGISTER_ENCODER(H264_OMX,          h264_omx);
645     REGISTER_ENCODER(H264_QSV,          h264_qsv);
646     REGISTER_ENCODER(H264_VAAPI,        h264_vaapi);
647     REGISTER_ENCODER(H264_VIDEOTOOLBOX, h264_videotoolbox);
648 #if FF_API_NVENC_OLD_NAME
649     REGISTER_ENCODER(NVENC,             nvenc);
650     REGISTER_ENCODER(NVENC_H264,        nvenc_h264);
651     REGISTER_ENCODER(NVENC_HEVC,        nvenc_hevc);
652 #endif
653     REGISTER_DECODER(HEVC_CUVID,        hevc_cuvid);
654     REGISTER_DECODER(HEVC_MEDIACODEC,   hevc_mediacodec);
655     REGISTER_ENCODER(HEVC_NVENC,        hevc_nvenc);
656     REGISTER_ENCODER(HEVC_QSV,          hevc_qsv);
657     REGISTER_ENCODER(HEVC_VAAPI,        hevc_vaapi);
658     REGISTER_ENCODER(LIBKVAZAAR,        libkvazaar);
659     REGISTER_DECODER(MJPEG_CUVID,       mjpeg_cuvid);
660     REGISTER_ENCODER(MJPEG_VAAPI,       mjpeg_vaapi);
661     REGISTER_DECODER(MPEG1_CUVID,       mpeg1_cuvid);
662     REGISTER_DECODER(MPEG2_CUVID,       mpeg2_cuvid);
663     REGISTER_ENCODER(MPEG2_QSV,         mpeg2_qsv);
664     REGISTER_ENCODER(MPEG2_VAAPI,       mpeg2_vaapi);
665     REGISTER_DECODER(MPEG4_CUVID,       mpeg4_cuvid);
666     REGISTER_DECODER(MPEG4_MEDIACODEC,  mpeg4_mediacodec);
667     REGISTER_DECODER(VC1_CUVID,         vc1_cuvid);
668     REGISTER_DECODER(VP8_CUVID,         vp8_cuvid);
669     REGISTER_DECODER(VP8_MEDIACODEC,    vp8_mediacodec);
670     REGISTER_ENCODER(VP8_VAAPI,         vp8_vaapi);
671     REGISTER_DECODER(VP9_CUVID,         vp9_cuvid);
672     REGISTER_DECODER(VP9_MEDIACODEC,    vp9_mediacodec);
673
674     /* parsers */
675     REGISTER_PARSER(AAC,                aac);
676     REGISTER_PARSER(AAC_LATM,           aac_latm);
677     REGISTER_PARSER(AC3,                ac3);
678     REGISTER_PARSER(ADX,                adx);
679     REGISTER_PARSER(BMP,                bmp);
680     REGISTER_PARSER(CAVSVIDEO,          cavsvideo);
681     REGISTER_PARSER(COOK,               cook);
682     REGISTER_PARSER(DCA,                dca);
683     REGISTER_PARSER(DIRAC,              dirac);
684     REGISTER_PARSER(DNXHD,              dnxhd);
685     REGISTER_PARSER(DPX,                dpx);
686     REGISTER_PARSER(DVAUDIO,            dvaudio);
687     REGISTER_PARSER(DVBSUB,             dvbsub);
688     REGISTER_PARSER(DVDSUB,             dvdsub);
689     REGISTER_PARSER(DVD_NAV,            dvd_nav);
690     REGISTER_PARSER(FLAC,               flac);
691     REGISTER_PARSER(G729,               g729);
692     REGISTER_PARSER(GSM,                gsm);
693     REGISTER_PARSER(H261,               h261);
694     REGISTER_PARSER(H263,               h263);
695     REGISTER_PARSER(H264,               h264);
696     REGISTER_PARSER(HEVC,               hevc);
697     REGISTER_PARSER(MJPEG,              mjpeg);
698     REGISTER_PARSER(MLP,                mlp);
699     REGISTER_PARSER(MPEG4VIDEO,         mpeg4video);
700     REGISTER_PARSER(MPEGAUDIO,          mpegaudio);
701     REGISTER_PARSER(MPEGVIDEO,          mpegvideo);
702     REGISTER_PARSER(OPUS,               opus);
703     REGISTER_PARSER(PNG,                png);
704     REGISTER_PARSER(PNM,                pnm);
705     REGISTER_PARSER(RV30,               rv30);
706     REGISTER_PARSER(RV40,               rv40);
707     REGISTER_PARSER(SIPR,               sipr);
708     REGISTER_PARSER(TAK,                tak);
709     REGISTER_PARSER(VC1,                vc1);
710     REGISTER_PARSER(VORBIS,             vorbis);
711     REGISTER_PARSER(VP3,                vp3);
712     REGISTER_PARSER(VP8,                vp8);
713     REGISTER_PARSER(VP9,                vp9);
714     REGISTER_PARSER(XMA,                xma);
715 }
716
717 void avcodec_register_all(void)
718 {
719     static AVOnce control = AV_ONCE_INIT;
720
721     ff_thread_once(&control, register_all);
722 }