diff mbox series

[FFmpeg-devel,1/3] avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.h

Message ID AS1PR01MB9564621E92A6F42E563B74A38F119@AS1PR01MB9564.eurprd01.prod.exchangelabs.com
State Accepted
Headers show
Series [FFmpeg-devel,1/3] avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.h | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt March 16, 2022, 9:45 p.m. UTC
Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault.
This reduces the amount of files that have to include internal.h
(which comes with quite a lot of indirect inclusions), as e.g.
most encoders don't need it. It is furthemore in preparation
for moving the private part of AVCodec out of the public codec.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/012v.c               |  1 +
 libavcodec/4xm.c                |  1 +
 libavcodec/8bps.c               |  1 +
 libavcodec/8svx.c               |  1 +
 libavcodec/a64multienc.c        |  2 +-
 libavcodec/aacdec.c             |  2 +-
 libavcodec/aacdec_fixed.c       |  2 +-
 libavcodec/aacdec_template.c    |  1 +
 libavcodec/aacenc.c             |  2 +-
 libavcodec/aasc.c               |  1 +
 libavcodec/ac3dec_fixed.c       |  1 +
 libavcodec/ac3dec_float.c       |  1 +
 libavcodec/ac3enc.c             |  1 +
 libavcodec/ac3enc.h             |  2 +-
 libavcodec/ac3enc_fixed.c       |  2 +-
 libavcodec/ac3enc_float.c       |  2 +-
 libavcodec/ac3enc_template.c    |  1 -
 libavcodec/adpcm.c              |  1 +
 libavcodec/adpcmenc.c           |  2 +-
 libavcodec/adxdec.c             |  1 +
 libavcodec/adxenc.c             |  2 +-
 libavcodec/agm.c                |  1 +
 libavcodec/aic.c                |  2 +-
 libavcodec/alac.c               |  2 +-
 libavcodec/alacenc.c            |  2 +-
 libavcodec/alsdec.c             |  1 +
 libavcodec/amfenc_h264.c        |  1 +
 libavcodec/amfenc_hevc.c        |  1 +
 libavcodec/amrnbdec.c           |  1 +
 libavcodec/amrwbdec.c           |  1 +
 libavcodec/anm.c                |  1 +
 libavcodec/ansi.c               |  1 +
 libavcodec/apedec.c             |  1 +
 libavcodec/aptx.c               |  1 +
 libavcodec/aptx.h               |  1 -
 libavcodec/aptxdec.c            |  2 +
 libavcodec/aptxenc.c            |  1 +
 libavcodec/arbc.c               |  1 +
 libavcodec/argo.c               |  1 +
 libavcodec/assdec.c             |  2 +-
 libavcodec/assenc.c             |  2 +-
 libavcodec/asvdec.c             |  1 +
 libavcodec/asvenc.c             |  2 +-
 libavcodec/atrac1.c             |  1 +
 libavcodec/atrac3.c             |  1 +
 libavcodec/atrac3plusdec.c      |  1 +
 libavcodec/atrac9dec.c          |  1 +
 libavcodec/audiotoolboxdec.c    |  1 +
 libavcodec/audiotoolboxenc.c    |  1 +
 libavcodec/aura.c               |  1 +
 libavcodec/av1dec.c             |  1 +
 libavcodec/avcodec.c            |  1 +
 libavcodec/avrndec.c            |  1 +
 libavcodec/avs.c                |  1 +
 libavcodec/avuidec.c            |  1 +
 libavcodec/avuienc.c            |  2 +-
 libavcodec/bethsoftvideo.c      |  1 +
 libavcodec/bfi.c                |  1 +
 libavcodec/bink.c               |  1 +
 libavcodec/binkaudio.c          |  1 +
 libavcodec/bintext.c            |  1 +
 libavcodec/bitpacked_dec.c      |  2 +-
 libavcodec/bitpacked_enc.c      |  1 +
 libavcodec/bmpenc.c             |  2 +-
 libavcodec/bmvaudio.c           |  1 +
 libavcodec/bmvvideo.c           |  1 +
 libavcodec/c93.c                |  1 +
 libavcodec/cavsdec.c            |  1 +
 libavcodec/ccaption_dec.c       |  2 +-
 libavcodec/cdgraphics.c         |  1 +
 libavcodec/cdtoons.c            |  1 +
 libavcodec/cdxl.c               |  1 +
 libavcodec/cfhd.c               |  1 +
 libavcodec/cfhdenc.c            |  2 +-
 libavcodec/cinepak.c            |  1 +
 libavcodec/cinepakenc.c         |  2 +-
 libavcodec/clearvideo.c         |  1 +
 libavcodec/cljrdec.c            |  1 +
 libavcodec/cllc.c               |  2 +-
 libavcodec/cngdec.c             |  1 +
 libavcodec/cngenc.c             |  2 +-
 libavcodec/codec_internal.h     | 82 +++++++++++++++++++++++++++++++++
 libavcodec/cook.c               |  1 +
 libavcodec/cpia.c               |  1 +
 libavcodec/cri.c                |  1 +
 libavcodec/crystalhd.c          |  1 +
 libavcodec/cscd.c               |  1 +
 libavcodec/cuviddec.c           |  1 +
 libavcodec/cyuv.c               |  1 +
 libavcodec/dcadec.c             |  2 +-
 libavcodec/dcaenc.c             |  1 +
 libavcodec/dds.c                |  1 +
 libavcodec/decode.c             |  1 +
 libavcodec/dfa.c                |  1 +
 libavcodec/dfpwmdec.c           |  1 +
 libavcodec/dfpwmenc.c           |  2 +-
 libavcodec/diracdec.c           |  1 +
 libavcodec/dnxhddec.c           |  1 +
 libavcodec/dnxhdenc.c           |  1 +
 libavcodec/dolby_e.c            |  1 +
 libavcodec/dpcm.c               |  1 +
 libavcodec/dpxenc.c             |  2 +-
 libavcodec/dsddec.c             |  1 +
 libavcodec/dsicinaudio.c        |  1 +
 libavcodec/dsicinvideo.c        |  1 +
 libavcodec/dss_sp.c             |  1 +
 libavcodec/dstdec.c             |  1 +
 libavcodec/dvaudiodec.c         |  1 +
 libavcodec/dvbsubdec.c          |  1 +
 libavcodec/dvdec.c              |  1 +
 libavcodec/dvdsubdec.c          |  1 +
 libavcodec/dvdsubenc.c          |  1 +
 libavcodec/dvenc.c              |  2 +-
 libavcodec/dxa.c                |  1 +
 libavcodec/dxv.c                |  2 +-
 libavcodec/eac3dec.c            |  1 -
 libavcodec/eac3enc.c            |  1 +
 libavcodec/eacmv.c              |  1 +
 libavcodec/eamad.c              |  1 +
 libavcodec/eatgq.c              |  1 +
 libavcodec/eatgv.c              |  1 +
 libavcodec/eatqi.c              |  1 +
 libavcodec/escape124.c          |  1 +
 libavcodec/escape130.c          |  1 +
 libavcodec/evrcdec.c            |  1 +
 libavcodec/exr.c                |  1 +
 libavcodec/exrenc.c             |  2 +-
 libavcodec/fastaudio.c          |  1 +
 libavcodec/ffv1dec.c            |  1 +
 libavcodec/ffv1enc.c            |  1 +
 libavcodec/ffwavesynth.c        |  1 +
 libavcodec/fic.c                |  1 +
 libavcodec/flacdec.c            |  2 +-
 libavcodec/flacenc.c            |  1 +
 libavcodec/flashsv.c            |  1 +
 libavcodec/flashsv2enc.c        |  2 +-
 libavcodec/flashsvenc.c         |  2 +-
 libavcodec/flicvideo.c          |  1 +
 libavcodec/flvdec.c             |  2 +-
 libavcodec/flvenc.c             |  1 +
 libavcodec/fmvc.c               |  1 +
 libavcodec/fraps.c              |  2 +-
 libavcodec/frwu.c               |  1 +
 libavcodec/g2meet.c             |  1 +
 libavcodec/g722dec.c            |  1 +
 libavcodec/g722enc.c            |  1 +
 libavcodec/g723_1dec.c          |  1 +
 libavcodec/g723_1enc.c          |  2 +-
 libavcodec/g726.c               |  1 +
 libavcodec/g729dec.c            |  1 +
 libavcodec/gdv.c                |  1 +
 libavcodec/gif.c                |  2 +-
 libavcodec/gifdec.c             |  1 +
 libavcodec/gsmdec.c             |  1 +
 libavcodec/h261dec.c            |  1 +
 libavcodec/h261enc.c            |  1 +
 libavcodec/h263dec.c            |  1 +
 libavcodec/h264dec.c            |  1 +
 libavcodec/hapdec.c             |  2 +-
 libavcodec/hapenc.c             |  2 +-
 libavcodec/hcadec.c             |  1 +
 libavcodec/hcom.c               |  1 +
 libavcodec/hevcdec.c            |  1 +
 libavcodec/hnm4video.c          |  1 +
 libavcodec/hq_hqa.c             |  1 +
 libavcodec/hqx.c                |  2 +-
 libavcodec/huffyuvdec.c         |  2 +-
 libavcodec/huffyuvenc.c         |  2 +-
 libavcodec/idcinvideo.c         |  1 +
 libavcodec/iff.c                |  1 +
 libavcodec/ilbcdec.c            |  1 +
 libavcodec/imc.c                |  1 +
 libavcodec/imm4.c               |  1 +
 libavcodec/imm5.c               |  2 +-
 libavcodec/imx.c                |  1 +
 libavcodec/indeo2.c             |  1 +
 libavcodec/indeo3.c             |  1 +
 libavcodec/indeo4.c             |  2 +-
 libavcodec/indeo5.c             |  2 +-
 libavcodec/intelh263dec.c       |  2 +-
 libavcodec/internal.h           | 61 ------------------------
 libavcodec/interplayacm.c       |  1 +
 libavcodec/interplayvideo.c     |  1 +
 libavcodec/ituh263enc.c         |  1 +
 libavcodec/j2kenc.c             |  2 +-
 libavcodec/jacosubdec.c         |  2 +-
 libavcodec/jpeg2000dec.c        |  1 +
 libavcodec/jpeglsdec.c          |  1 +
 libavcodec/jpeglsenc.c          |  1 +
 libavcodec/jvdec.c              |  1 +
 libavcodec/kgv1dec.c            |  1 +
 libavcodec/kmvc.c               |  1 +
 libavcodec/lagarith.c           |  2 +-
 libavcodec/lcldec.c             |  2 +-
 libavcodec/lclenc.c             |  2 +-
 libavcodec/libaomdec.c          |  1 +
 libavcodec/libaomenc.c          |  1 +
 libavcodec/libdav1d.c           |  1 +
 libavcodec/libdavs2.c           |  2 +-
 libavcodec/libfdk-aacdec.c      |  1 +
 libavcodec/libfdk-aacenc.c      |  2 +-
 libavcodec/libgsmenc.c          |  2 +-
 libavcodec/libilbc.c            |  1 +
 libavcodec/libkvazaar.c         |  2 +-
 libavcodec/libmp3lame.c         |  2 +-
 libavcodec/libopenh264dec.c     |  1 +
 libavcodec/libopenh264enc.c     |  1 +
 libavcodec/libopusdec.c         |  1 +
 libavcodec/libopusenc.c         |  2 +-
 libavcodec/librav1e.c           |  1 +
 libavcodec/libspeexenc.c        |  2 +-
 libavcodec/libsvtav1.c          |  1 +
 libavcodec/libtwolame.c         |  1 +
 libavcodec/libuavs3d.c          |  1 +
 libavcodec/libvorbisenc.c       |  1 +
 libavcodec/libvpxdec.c          |  1 +
 libavcodec/libvpxenc.c          |  1 +
 libavcodec/libwebpenc_common.h  |  2 +-
 libavcodec/libx264.c            |  1 +
 libavcodec/libx265.c            |  1 +
 libavcodec/libxavs.c            |  2 +-
 libavcodec/libxavs2.c           |  2 +-
 libavcodec/libxvid.c            |  2 +-
 libavcodec/ljpegenc.c           |  2 +-
 libavcodec/loco.c               |  1 +
 libavcodec/lscrdec.c            |  1 +
 libavcodec/m101.c               |  1 +
 libavcodec/mace.c               |  1 +
 libavcodec/magicyuv.c           |  1 +
 libavcodec/magicyuvenc.c        |  2 +-
 libavcodec/mdec.c               |  2 +-
 libavcodec/mediacodecdec.c      |  1 +
 libavcodec/metasound.c          |  2 +-
 libavcodec/mfenc.c              |  1 +
 libavcodec/microdvddec.c        |  2 +-
 libavcodec/midivid.c            |  1 +
 libavcodec/mimic.c              |  1 +
 libavcodec/mjpegbdec.c          |  2 +-
 libavcodec/mjpegdec.c           |  1 +
 libavcodec/mjpegenc.c           |  1 +
 libavcodec/mlpdec.c             |  1 +
 libavcodec/mlpenc.c             |  2 +-
 libavcodec/mmaldec.c            |  1 +
 libavcodec/mmvideo.c            |  1 +
 libavcodec/mobiclip.c           |  1 +
 libavcodec/motionpixels.c       |  1 +
 libavcodec/movtextdec.c         |  2 +-
 libavcodec/movtextenc.c         |  2 +-
 libavcodec/mpc7.c               |  1 +
 libavcodec/mpc8.c               |  1 +
 libavcodec/mpeg12dec.c          |  1 +
 libavcodec/mpeg12enc.c          |  1 +
 libavcodec/mpeg4videodec.c      |  2 +-
 libavcodec/mpeg4videoenc.c      |  1 +
 libavcodec/mpegaudiodec_fixed.c |  1 +
 libavcodec/mpegaudiodec_float.c |  1 +
 libavcodec/mpegaudioenc_fixed.c |  1 +
 libavcodec/mpegaudioenc_float.c |  1 +
 libavcodec/mpl2dec.c            |  2 +-
 libavcodec/mscc.c               |  1 +
 libavcodec/msmpeg4dec.c         |  2 +-
 libavcodec/msmpeg4enc.c         |  2 +-
 libavcodec/msrle.c              |  1 +
 libavcodec/mss1.c               |  1 +
 libavcodec/mss2.c               |  1 +
 libavcodec/mss3.c               |  1 +
 libavcodec/mss4.c               |  1 +
 libavcodec/msvideo1.c           |  1 +
 libavcodec/msvideo1enc.c        |  2 +-
 libavcodec/mv30.c               |  1 +
 libavcodec/mvcdec.c             |  1 +
 libavcodec/mvha.c               |  1 +
 libavcodec/mwsc.c               |  1 +
 libavcodec/mxpegdec.c           |  1 +
 libavcodec/nellymoserdec.c      |  1 +
 libavcodec/nellymoserenc.c      |  2 +-
 libavcodec/notchlc.c            |  1 +
 libavcodec/nuv.c                |  1 +
 libavcodec/nvenc_h264.c         |  2 +-
 libavcodec/nvenc_hevc.c         |  2 +-
 libavcodec/omx.c                |  2 +-
 libavcodec/on2avc.c             |  1 +
 libavcodec/options.c            |  2 +-
 libavcodec/opusdec.c            |  1 +
 libavcodec/opusenc.c            |  2 +-
 libavcodec/pafaudio.c           |  1 +
 libavcodec/pafvideo.c           |  1 +
 libavcodec/pamenc.c             |  2 +-
 libavcodec/pcm-blurayenc.c      |  1 +
 libavcodec/pcm-dvd.c            |  1 +
 libavcodec/pcm-dvdenc.c         |  1 +
 libavcodec/pcm.c                |  1 +
 libavcodec/pcxenc.c             |  2 +-
 libavcodec/pgssubdec.c          |  1 +
 libavcodec/photocd.c            |  1 +
 libavcodec/pixlet.c             |  1 +
 libavcodec/pngdec.c             |  1 +
 libavcodec/pngenc.c             |  2 +-
 libavcodec/pnmenc.c             |  2 +-
 libavcodec/proresdec2.c         |  1 +
 libavcodec/proresenc_anatoliy.c |  1 +
 libavcodec/proresenc_kostya.c   |  2 +-
 libavcodec/prosumer.c           |  1 +
 libavcodec/pthread.c            |  2 +-
 libavcodec/pthread_frame.c      |  1 +
 libavcodec/pthread_slice.c      |  1 +
 libavcodec/qcelpdec.c           |  1 +
 libavcodec/qdm2.c               |  1 +
 libavcodec/qdmc.c               |  1 +
 libavcodec/qpeg.c               |  1 +
 libavcodec/qsvenc_h264.c        |  2 +-
 libavcodec/qsvenc_hevc.c        |  2 +-
 libavcodec/qsvenc_jpeg.c        |  2 +-
 libavcodec/qsvenc_mpeg2.c       |  2 +-
 libavcodec/qsvenc_vp9.c         |  2 +-
 libavcodec/qtrle.c              |  1 +
 libavcodec/qtrleenc.c           |  2 +-
 libavcodec/r210dec.c            |  1 +
 libavcodec/r210enc.c            |  1 +
 libavcodec/ra144dec.c           |  1 +
 libavcodec/ra144enc.c           |  2 +-
 libavcodec/ra288.c              |  1 +
 libavcodec/ralf.c               |  1 +
 libavcodec/rasc.c               |  1 +
 libavcodec/rawdec.c             |  1 +
 libavcodec/rawenc.c             |  1 +
 libavcodec/realtextdec.c        |  2 +-
 libavcodec/rl2.c                |  1 +
 libavcodec/roqaudioenc.c        |  2 +-
 libavcodec/roqvideodec.c        |  1 +
 libavcodec/roqvideoenc.c        |  1 +
 libavcodec/rpza.c               |  1 +
 libavcodec/rpzaenc.c            |  2 +-
 libavcodec/rscc.c               |  1 +
 libavcodec/rv10.c               |  1 +
 libavcodec/rv10enc.c            |  1 +
 libavcodec/rv20enc.c            |  1 +
 libavcodec/rv30.c               |  2 +-
 libavcodec/rv40.c               |  2 +-
 libavcodec/s302menc.c           |  2 +-
 libavcodec/samidec.c            |  2 +-
 libavcodec/sanm.c               |  1 +
 libavcodec/sbcdec.c             |  1 +
 libavcodec/sbcenc.c             |  2 +-
 libavcodec/scpr.c               |  1 +
 libavcodec/screenpresso.c       |  1 +
 libavcodec/sga.c                |  1 +
 libavcodec/sgidec.c             |  1 +
 libavcodec/sgienc.c             |  2 +-
 libavcodec/sgirledec.c          |  1 +
 libavcodec/shorten.c            |  1 +
 libavcodec/sipr.c               |  1 +
 libavcodec/siren.c              |  1 +
 libavcodec/smacker.c            |  1 +
 libavcodec/smc.c                |  1 +
 libavcodec/smcenc.c             |  2 +-
 libavcodec/snowdec.c            |  2 +-
 libavcodec/snowenc.c            |  2 +-
 libavcodec/sonic.c              |  1 +
 libavcodec/sp5xdec.c            |  2 +-
 libavcodec/speedhq.c            |  1 +
 libavcodec/speedhqenc.c         |  1 +
 libavcodec/speexdec.c           |  1 +
 libavcodec/srtdec.c             |  2 +-
 libavcodec/srtenc.c             |  2 +-
 libavcodec/subviewerdec.c       |  2 +-
 libavcodec/sunrastenc.c         |  2 +-
 libavcodec/svq1dec.c            |  1 +
 libavcodec/svq1enc.c            |  1 +
 libavcodec/svq3.c               |  1 +
 libavcodec/takdec.c             |  2 +-
 libavcodec/targa_y216dec.c      |  1 +
 libavcodec/targaenc.c           |  2 +-
 libavcodec/tdsc.c               |  1 +
 libavcodec/tests/avcodec.c      |  1 +
 libavcodec/textdec.c            |  2 +-
 libavcodec/tiertexseqv.c        |  1 +
 libavcodec/tiff.c               |  1 +
 libavcodec/tiffenc.c            |  2 +-
 libavcodec/tmv.c                |  1 +
 libavcodec/truemotion1.c        |  1 +
 libavcodec/truemotion2.c        |  1 +
 libavcodec/truemotion2rt.c      |  1 +
 libavcodec/truespeech.c         |  1 +
 libavcodec/tscc.c               |  1 +
 libavcodec/tscc2.c              |  1 +
 libavcodec/tta.c                |  2 +-
 libavcodec/ttaenc.c             |  1 +
 libavcodec/ttmlenc.c            |  2 +-
 libavcodec/twinvqdec.c          |  2 +-
 libavcodec/ulti.c               |  1 +
 libavcodec/utils.c              |  1 +
 libavcodec/utvideodec.c         |  2 +-
 libavcodec/utvideoenc.c         |  2 +-
 libavcodec/v210dec.c            |  2 +-
 libavcodec/v210enc.c            |  1 +
 libavcodec/v210x.c              |  1 +
 libavcodec/v308dec.c            |  1 +
 libavcodec/v308enc.c            |  1 +
 libavcodec/v408dec.c            |  1 +
 libavcodec/v408enc.c            |  1 +
 libavcodec/v410dec.c            |  2 +-
 libavcodec/v410enc.c            |  1 +
 libavcodec/v4l2_m2m_dec.c       |  2 +-
 libavcodec/v4l2_m2m_enc.c       |  2 +-
 libavcodec/vaapi_encode_h264.c  |  2 +-
 libavcodec/vaapi_encode_h265.c  |  2 +-
 libavcodec/vaapi_encode_mjpeg.c |  2 +-
 libavcodec/vaapi_encode_mpeg2.c |  2 +-
 libavcodec/vaapi_encode_vp8.c   |  2 +-
 libavcodec/vaapi_encode_vp9.c   |  2 +-
 libavcodec/vb.c                 |  1 +
 libavcodec/vble.c               |  2 +-
 libavcodec/vc1dec.c             |  1 +
 libavcodec/vc2enc.c             |  2 +-
 libavcodec/vcr1.c               |  1 +
 libavcodec/videotoolboxenc.c    |  1 +
 libavcodec/vima.c               |  1 +
 libavcodec/vmdaudio.c           |  1 +
 libavcodec/vmdvideo.c           |  1 +
 libavcodec/vmnc.c               |  1 +
 libavcodec/vorbisdec.c          |  1 +
 libavcodec/vorbisenc.c          |  2 +-
 libavcodec/vp3.c                |  1 +
 libavcodec/vp5.c                |  1 +
 libavcodec/vp6.c                |  1 +
 libavcodec/vp8.c                |  1 +
 libavcodec/vp9.c                |  1 +
 libavcodec/vqavideo.c           |  1 +
 libavcodec/wavpack.c            |  2 +-
 libavcodec/wavpackenc.c         |  1 +
 libavcodec/wcmv.c               |  1 +
 libavcodec/webp.c               |  1 +
 libavcodec/webvttdec.c          |  2 +-
 libavcodec/webvttenc.c          |  2 +-
 libavcodec/wmadec.c             |  1 +
 libavcodec/wmaenc.c             |  1 +
 libavcodec/wmalosslessdec.c     |  1 +
 libavcodec/wmaprodec.c          |  1 +
 libavcodec/wmavoice.c           |  1 +
 libavcodec/wmv2dec.c            |  2 +-
 libavcodec/wmv2enc.c            |  1 +
 libavcodec/wnv1.c               |  1 +
 libavcodec/wrapped_avframe.c    |  2 +-
 libavcodec/ws-snd1.c            |  1 +
 libavcodec/xan.c                |  1 +
 libavcodec/xfacedec.c           |  1 +
 libavcodec/xl.c                 |  1 +
 libavcodec/xsubdec.c            |  2 +-
 libavcodec/xsubenc.c            |  2 +-
 libavcodec/xxan.c               |  1 +
 libavcodec/y41pdec.c            |  1 +
 libavcodec/y41penc.c            |  1 +
 libavcodec/ylc.c                |  2 +-
 libavcodec/yop.c                |  1 +
 libavcodec/yuv4dec.c            |  1 +
 libavcodec/zerocodec.c          |  1 +
 libavcodec/zmbv.c               |  1 +
 libavcodec/zmbvenc.c            |  2 +-
 459 files changed, 537 insertions(+), 206 deletions(-)
 create mode 100644 libavcodec/codec_internal.h
diff mbox series

Patch

diff --git a/libavcodec/012v.c b/libavcodec/012v.c
index 08c9938b12..999d39fd33 100644
--- a/libavcodec/012v.c
+++ b/libavcodec/012v.c
@@ -21,6 +21,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/intreadwrite.h"
 
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index cb361772d2..7996c7a89e 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -36,6 +36,7 @@ 
 #include "blockdsp.h"
 #include "bswapdsp.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c
index 46419b978b..61bb6797f0 100644
--- a/libavcodec/8bps.c
+++ b/libavcodec/8bps.c
@@ -37,6 +37,7 @@ 
 #include "libavutil/internal.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "internal.h"
 
diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c
index e92bc39e16..414b3a5793 100644
--- a/libavcodec/8svx.c
+++ b/libavcodec/8svx.c
@@ -41,6 +41,7 @@ 
 
 #include "libavutil/avassert.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/common.h"
 
diff --git a/libavcodec/a64multienc.c b/libavcodec/a64multienc.c
index a1e0d711ba..e1bc677a9d 100644
--- a/libavcodec/a64multienc.c
+++ b/libavcodec/a64multienc.c
@@ -28,9 +28,9 @@ 
 
 #include "a64colors.h"
 #include "a64tables.h"
+#include "codec_internal.h"
 #include "elbg.h"
 #include "encode.h"
-#include "internal.h"
 #include "libavutil/avassert.h"
 #include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 611f9e4be1..dcbdd4880d 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -38,7 +38,7 @@ 
 #include "libavutil/float_dsp.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "fft.h"
 #include "mdct15.h"
diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c
index 8af7e994ae..fd067d0ad5 100644
--- a/libavcodec/aacdec_fixed.c
+++ b/libavcodec/aacdec_fixed.c
@@ -64,7 +64,7 @@ 
 #include "libavutil/fixed_dsp.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "fft.h"
 #include "lpc.h"
diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index 349ecdefb3..524f656cff 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -91,6 +91,7 @@ 
 
 #include "libavutil/channel_layout.h"
 #include "libavutil/thread.h"
+#include "internal.h"
 
 static VLC vlc_scalefactors;
 static VLC vlc_spectral[11];
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 2890389bf8..b7d538ca2c 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -35,9 +35,9 @@ 
 #include "libavutil/float_dsp.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "put_bits.h"
-#include "internal.h"
 #include "mpeg4audio.h"
 #include "sinewin.h"
 #include "profiles.h"
diff --git a/libavcodec/aasc.c b/libavcodec/aasc.c
index 2177aa8f56..60cd839613 100644
--- a/libavcodec/aasc.c
+++ b/libavcodec/aasc.c
@@ -29,6 +29,7 @@ 
 #include <string.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "msrledec.h"
 
diff --git a/libavcodec/ac3dec_fixed.c b/libavcodec/ac3dec_fixed.c
index ae433c5cc7..08109296b5 100644
--- a/libavcodec/ac3dec_fixed.c
+++ b/libavcodec/ac3dec_fixed.c
@@ -50,6 +50,7 @@ 
 #define FFT_FLOAT 0
 #define USE_FIXED 1
 #include "ac3dec.h"
+#include "codec_internal.h"
 
 
 static const int end_freq_inv_tab[8] =
diff --git a/libavcodec/ac3dec_float.c b/libavcodec/ac3dec_float.c
index 6611103c50..8b2efbc225 100644
--- a/libavcodec/ac3dec_float.c
+++ b/libavcodec/ac3dec_float.c
@@ -31,6 +31,7 @@ 
 #include "config_components.h"
 
 #include "ac3dec.h"
+#include "codec_internal.h"
 #include "eac3dec.c"
 #include "ac3dec.c"
 
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 473c8f0a45..76e2331d80 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -38,6 +38,7 @@ 
 #include "libavutil/opt.h"
 #include "libavutil/thread.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "config_components.h"
 #include "encode.h"
 #include "internal.h"
diff --git a/libavcodec/ac3enc.h b/libavcodec/ac3enc.h
index 647a7769ec..e259bdd55e 100644
--- a/libavcodec/ac3enc.h
+++ b/libavcodec/ac3enc.h
@@ -34,8 +34,8 @@ 
 #include "ac3.h"
 #include "ac3dsp.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "fft.h"
-#include "internal.h"
 #include "mathops.h"
 #include "me_cmp.h"
 #include "put_bits.h"
diff --git a/libavcodec/ac3enc_fixed.c b/libavcodec/ac3enc_fixed.c
index 6e0abf4a26..d29e1cc47c 100644
--- a/libavcodec/ac3enc_fixed.c
+++ b/libavcodec/ac3enc_fixed.c
@@ -28,9 +28,9 @@ 
 
 #define AC3ENC_FLOAT 0
 #define FFT_FLOAT 0
-#include "internal.h"
 #include "audiodsp.h"
 #include "ac3enc.h"
+#include "codec_internal.h"
 #include "eac3enc.h"
 #include "kbdwin.h"
 
diff --git a/libavcodec/ac3enc_float.c b/libavcodec/ac3enc_float.c
index 0e605cdf2c..1c13920175 100644
--- a/libavcodec/ac3enc_float.c
+++ b/libavcodec/ac3enc_float.c
@@ -27,9 +27,9 @@ 
  */
 
 #define AC3ENC_FLOAT 1
-#include "internal.h"
 #include "audiodsp.h"
 #include "ac3enc.h"
+#include "codec_internal.h"
 #include "eac3enc.h"
 #include "kbdwin.h"
 
diff --git a/libavcodec/ac3enc_template.c b/libavcodec/ac3enc_template.c
index fbe1dd1e04..de66964d0d 100644
--- a/libavcodec/ac3enc_template.c
+++ b/libavcodec/ac3enc_template.c
@@ -35,7 +35,6 @@ 
 #include "libavutil/mem_internal.h"
 
 #include "audiodsp.h"
-#include "internal.h"
 #include "ac3enc.h"
 #include "eac3enc.h"
 
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 0058091729..85ba88ebbf 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -42,6 +42,7 @@ 
 #include "bytestream.h"
 #include "adpcm.h"
 #include "adpcm_data.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 /**
diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index 8c44285d2b..b15d97fda2 100644
--- a/libavcodec/adpcmenc.c
+++ b/libavcodec/adpcmenc.c
@@ -31,8 +31,8 @@ 
 #include "bytestream.h"
 #include "adpcm.h"
 #include "adpcm_data.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 
 /**
  * @file
diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c
index b3d946e81c..20c670b8f0 100644
--- a/libavcodec/adxdec.c
+++ b/libavcodec/adxdec.c
@@ -22,6 +22,7 @@ 
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 #include "adx.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/adxenc.c b/libavcodec/adxenc.c
index 3736e746a9..acf12790fe 100644
--- a/libavcodec/adxenc.c
+++ b/libavcodec/adxenc.c
@@ -22,8 +22,8 @@ 
 #include "avcodec.h"
 #include "adx.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "put_bits.h"
 
 /**
diff --git a/libavcodec/agm.c b/libavcodec/agm.c
index 7579d9765d..b37a160d38 100644
--- a/libavcodec/agm.c
+++ b/libavcodec/agm.c
@@ -30,6 +30,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "copy_block.h"
 #include "get_bits.h"
 #include "idctdsp.h"
diff --git a/libavcodec/aic.c b/libavcodec/aic.c
index 552e7e9c10..ea4be0d45f 100644
--- a/libavcodec/aic.c
+++ b/libavcodec/aic.c
@@ -26,7 +26,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "golomb.h"
 #include "idctdsp.h"
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index c37ed92d9a..a66346ab34 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -52,7 +52,7 @@ 
 #include "avcodec.h"
 #include "get_bits.h"
 #include "bytestream.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "thread.h"
 #include "unary.h"
 #include "mathops.h"
diff --git a/libavcodec/alacenc.c b/libavcodec/alacenc.c
index 258460bc68..541b0fbd9a 100644
--- a/libavcodec/alacenc.c
+++ b/libavcodec/alacenc.c
@@ -22,9 +22,9 @@ 
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "put_bits.h"
-#include "internal.h"
 #include "lpc.h"
 #include "mathops.h"
 #include "alac_data.h"
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 822cf211b0..e1231681c8 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -33,6 +33,7 @@ 
 #include "mpeg4audio.h"
 #include "bgmc.h"
 #include "bswapdsp.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "mlz.h"
 #include "libavutil/samplefmt.h"
diff --git a/libavcodec/amfenc_h264.c b/libavcodec/amfenc_h264.c
index aeca99f7c6..ce31d1333a 100644
--- a/libavcodec/amfenc_h264.c
+++ b/libavcodec/amfenc_h264.c
@@ -20,6 +20,7 @@ 
 #include "libavutil/internal.h"
 #include "libavutil/opt.h"
 #include "amfenc.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #define OFFSET(x) offsetof(AmfContext, x)
diff --git a/libavcodec/amfenc_hevc.c b/libavcodec/amfenc_hevc.c
index 79541b9b2f..cfdff34716 100644
--- a/libavcodec/amfenc_hevc.c
+++ b/libavcodec/amfenc_hevc.c
@@ -19,6 +19,7 @@ 
 #include "libavutil/internal.h"
 #include "libavutil/opt.h"
 #include "amfenc.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #define OFFSET(x) offsetof(AmfContext, x)
diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c
index 1844ad1925..e0143ce2b1 100644
--- a/libavcodec/amrnbdec.c
+++ b/libavcodec/amrnbdec.c
@@ -55,6 +55,7 @@ 
 #include "acelp_pitch_delay.h"
 #include "lsp.h"
 #include "amr.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #include "amrnbdata.h"
diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index 261ef02255..fe2412bc83 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -36,6 +36,7 @@ 
 #include "acelp_filters.h"
 #include "acelp_vectors.h"
 #include "acelp_pitch_delay.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #define AMR_USE_16BIT_TABLES
diff --git a/libavcodec/anm.c b/libavcodec/anm.c
index 494903235d..f01943f6f3 100644
--- a/libavcodec/anm.c
+++ b/libavcodec/anm.c
@@ -26,6 +26,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct AnmContext {
diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c
index 0965f8cd56..312f1c532a 100644
--- a/libavcodec/ansi.c
+++ b/libavcodec/ansi.c
@@ -30,6 +30,7 @@ 
 #include "libavutil/xga_font_data.h"
 #include "avcodec.h"
 #include "cga_data.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #define ATTR_BOLD         0x01  /**< Bold/Bright-foreground (mode 1) */
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index ab788c0669..416b01063f 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -30,6 +30,7 @@ 
 #include "avcodec.h"
 #include "bswapdsp.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "get_bits.h"
 #include "unary.h"
diff --git a/libavcodec/aptx.c b/libavcodec/aptx.c
index d8e0c207cf..b1a78c5f77 100644
--- a/libavcodec/aptx.c
+++ b/libavcodec/aptx.c
@@ -21,6 +21,7 @@ 
  */
 
 #include "aptx.h"
+#include "internal.h"
 
 
 static const int32_t quantize_intervals_LF[65] = {
diff --git a/libavcodec/aptx.h b/libavcodec/aptx.h
index ce3d7dc6c1..abb49e6faa 100644
--- a/libavcodec/aptx.h
+++ b/libavcodec/aptx.h
@@ -25,7 +25,6 @@ 
 
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
-#include "internal.h"
 #include "mathops.h"
 #include "audio_frame_queue.h"
 
diff --git a/libavcodec/aptxdec.c b/libavcodec/aptxdec.c
index a1e7cfa218..3e4c6d55c6 100644
--- a/libavcodec/aptxdec.c
+++ b/libavcodec/aptxdec.c
@@ -24,6 +24,8 @@ 
 
 #include "libavutil/channel_layout.h"
 #include "aptx.h"
+#include "codec_internal.h"
+#include "internal.h"
 
 /*
  * Half-band QMF synthesis filter realized with a polyphase FIR filter.
diff --git a/libavcodec/aptxenc.c b/libavcodec/aptxenc.c
index 69265a589b..35ce896220 100644
--- a/libavcodec/aptxenc.c
+++ b/libavcodec/aptxenc.c
@@ -24,6 +24,7 @@ 
 
 #include "libavutil/channel_layout.h"
 #include "aptx.h"
+#include "codec_internal.h"
 #include "encode.h"
 
 /*
diff --git a/libavcodec/arbc.c b/libavcodec/arbc.c
index d03fdf214b..0dfc9d5526 100644
--- a/libavcodec/arbc.c
+++ b/libavcodec/arbc.c
@@ -29,6 +29,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct ARBCContext {
diff --git a/libavcodec/argo.c b/libavcodec/argo.c
index 58cc9984bc..b83aee2884 100644
--- a/libavcodec/argo.c
+++ b/libavcodec/argo.c
@@ -29,6 +29,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct ArgoContext {
diff --git a/libavcodec/assdec.c b/libavcodec/assdec.c
index a9697d045d..538d8bf490 100644
--- a/libavcodec/assdec.c
+++ b/libavcodec/assdec.c
@@ -23,8 +23,8 @@ 
 
 #include "avcodec.h"
 #include "ass.h"
+#include "codec_internal.h"
 #include "config_components.h"
-#include "internal.h"
 #include "libavutil/internal.h"
 #include "libavutil/mem.h"
 
diff --git a/libavcodec/assenc.c b/libavcodec/assenc.c
index b7a88f9d44..6e5b4bb4a8 100644
--- a/libavcodec/assenc.c
+++ b/libavcodec/assenc.c
@@ -25,7 +25,7 @@ 
 
 #include "avcodec.h"
 #include "ass.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "libavutil/avstring.h"
 #include "libavutil/internal.h"
 #include "libavutil/mem.h"
diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c
index 36bedb5928..aa8ad9f703 100644
--- a/libavcodec/asvdec.c
+++ b/libavcodec/asvdec.c
@@ -30,6 +30,7 @@ 
 #include "asv.h"
 #include "avcodec.h"
 #include "blockdsp.h"
+#include "codec_internal.h"
 #include "config_components.h"
 #include "idctdsp.h"
 #include "internal.h"
diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c
index 96700aa9e3..cdbfbf62fd 100644
--- a/libavcodec/asvenc.c
+++ b/libavcodec/asvenc.c
@@ -31,10 +31,10 @@ 
 #include "aandcttab.h"
 #include "asv.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "dct.h"
 #include "encode.h"
 #include "fdctdsp.h"
-#include "internal.h"
 #include "mpeg12data.h"
 
 static inline void asv1_put_level(PutBitContext *pb, int level)
diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c
index 6ec96a4644..f57c5cc1fb 100644
--- a/libavcodec/atrac1.c
+++ b/libavcodec/atrac1.c
@@ -36,6 +36,7 @@ 
 #include "libavutil/mem_internal.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "fft.h"
 #include "internal.h"
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index 772937f5a3..9010c8d4f6 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -44,6 +44,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "fft.h"
 #include "get_bits.h"
 #include "internal.h"
diff --git a/libavcodec/atrac3plusdec.c b/libavcodec/atrac3plusdec.c
index 3f0f08ee00..f0b0a1fa73 100644
--- a/libavcodec/atrac3plusdec.c
+++ b/libavcodec/atrac3plusdec.c
@@ -42,6 +42,7 @@ 
 #include "libavutil/mem_internal.h"
 #include "libavutil/thread.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "atrac.h"
diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c
index b13235cfb9..932710e001 100644
--- a/libavcodec/atrac9dec.c
+++ b/libavcodec/atrac9dec.c
@@ -22,6 +22,7 @@ 
 #include "libavutil/channel_layout.h"
 #include "libavutil/thread.h"
 
+#include "codec_internal.h"
 #include "internal.h"
 #include "get_bits.h"
 #include "fft.h"
diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c
index 9b0fafe320..9c2a969e57 100644
--- a/libavcodec/audiotoolboxdec.c
+++ b/libavcodec/audiotoolboxdec.c
@@ -27,6 +27,7 @@ 
 #include "avcodec.h"
 #include "ac3_parser_internal.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "mpegaudiodecheader.h"
 #include "libavutil/avassert.h"
diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c
index 78ff45f972..5deedcab73 100644
--- a/libavcodec/audiotoolboxenc.c
+++ b/libavcodec/audiotoolboxenc.c
@@ -29,6 +29,7 @@ 
 #include "audio_frame_queue.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 #include "libavformat/isom.h"
diff --git a/libavcodec/aura.c b/libavcodec/aura.c
index 585c710f5a..f32d820cf2 100644
--- a/libavcodec/aura.c
+++ b/libavcodec/aura.c
@@ -24,6 +24,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/internal.h"
 
diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index 87f0ebb3bd..1995deada9 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -26,6 +26,7 @@ 
 #include "avcodec.h"
 #include "av1dec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "hwconfig.h"
 #include "internal.h"
 #include "profiles.h"
diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index 38bdaad4fa..3374142394 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -34,6 +34,7 @@ 
 #include "libavutil/thread.h"
 #include "avcodec.h"
 #include "bsf.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "encode.h"
 #include "frame_thread_encoder.h"
diff --git a/libavcodec/avrndec.c b/libavcodec/avrndec.c
index 70e34c617d..7e19db3705 100644
--- a/libavcodec/avrndec.c
+++ b/libavcodec/avrndec.c
@@ -20,6 +20,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/imgutils.h"
 
diff --git a/libavcodec/avs.c b/libavcodec/avs.c
index 28f5f0b137..d697b567fa 100644
--- a/libavcodec/avs.c
+++ b/libavcodec/avs.c
@@ -20,6 +20,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/avuidec.c b/libavcodec/avuidec.c
index f7172845c3..5ebe4f306e 100644
--- a/libavcodec/avuidec.c
+++ b/libavcodec/avuidec.c
@@ -21,6 +21,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/intreadwrite.h"
 
diff --git a/libavcodec/avuienc.c b/libavcodec/avuienc.c
index dac56d1ae5..e941afba63 100644
--- a/libavcodec/avuienc.c
+++ b/libavcodec/avuienc.c
@@ -21,8 +21,8 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "libavutil/intreadwrite.h"
 
 static av_cold int avui_encode_init(AVCodecContext *avctx)
diff --git a/libavcodec/bethsoftvideo.c b/libavcodec/bethsoftvideo.c
index b529aba7e9..2c6328c1ea 100644
--- a/libavcodec/bethsoftvideo.c
+++ b/libavcodec/bethsoftvideo.c
@@ -31,6 +31,7 @@ 
 #include "avcodec.h"
 #include "bethsoftvideo.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct BethsoftvidContext {
diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c
index 78685e8777..3dce7d6eb8 100644
--- a/libavcodec/bfi.c
+++ b/libavcodec/bfi.c
@@ -29,6 +29,7 @@ 
 #include "libavutil/common.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct BFIContext {
diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index 45dd8d156d..6a2e5e79e1 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -31,6 +31,7 @@ 
 #include "binkdata.h"
 #include "binkdsp.h"
 #include "blockdsp.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "hpeldsp.h"
 #include "internal.h"
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index b4ff15beeb..7398cb3c3e 100644
--- a/libavcodec/binkaudio.c
+++ b/libavcodec/binkaudio.c
@@ -39,6 +39,7 @@ 
 #include "dct.h"
 #include "decode.h"
 #include "get_bits.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "rdft.h"
 #include "wma_freqs.h"
diff --git a/libavcodec/bintext.c b/libavcodec/bintext.c
index d9e95a95b4..59f99f7ebd 100644
--- a/libavcodec/bintext.c
+++ b/libavcodec/bintext.c
@@ -35,6 +35,7 @@ 
 #include "avcodec.h"
 #include "cga_data.h"
 #include "bintext.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #define FONT_WIDTH 8
diff --git a/libavcodec/bitpacked_dec.c b/libavcodec/bitpacked_dec.c
index fa554d99af..751f55493d 100644
--- a/libavcodec/bitpacked_dec.c
+++ b/libavcodec/bitpacked_dec.c
@@ -27,7 +27,7 @@ 
  */
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "libavutil/imgutils.h"
 #include "thread.h"
diff --git a/libavcodec/bitpacked_enc.c b/libavcodec/bitpacked_enc.c
index 6f540f1aed..ddada1f03f 100644
--- a/libavcodec/bitpacked_enc.c
+++ b/libavcodec/bitpacked_enc.c
@@ -21,6 +21,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 #include "put_bits.h"
diff --git a/libavcodec/bmpenc.c b/libavcodec/bmpenc.c
index 672c0e4980..a11f2fb2b4 100644
--- a/libavcodec/bmpenc.c
+++ b/libavcodec/bmpenc.c
@@ -27,8 +27,8 @@ 
 #include "avcodec.h"
 #include "bytestream.h"
 #include "bmp.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 
 static const uint32_t monoblack_pal[] = { 0x000000, 0xFFFFFF };
 static const uint32_t rgb565_masks[]  = { 0xF800, 0x07E0, 0x001F };
diff --git a/libavcodec/bmvaudio.c b/libavcodec/bmvaudio.c
index d81dba8821..c3a7d954e2 100644
--- a/libavcodec/bmvaudio.c
+++ b/libavcodec/bmvaudio.c
@@ -23,6 +23,7 @@ 
 #include "libavutil/common.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 static const int bmv_aud_mults[16] = {
diff --git a/libavcodec/bmvvideo.c b/libavcodec/bmvvideo.c
index d76ba442be..befcbbd6b4 100644
--- a/libavcodec/bmvvideo.c
+++ b/libavcodec/bmvvideo.c
@@ -24,6 +24,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 enum BMVFlags{
diff --git a/libavcodec/c93.c b/libavcodec/c93.c
index 3464c85e23..23c02ef5bb 100644
--- a/libavcodec/c93.c
+++ b/libavcodec/c93.c
@@ -21,6 +21,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct C93DecoderContext {
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 6f4856ce97..8fd485f5e1 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -30,6 +30,7 @@ 
 #include "get_bits.h"
 #include "golomb.h"
 #include "cavs.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "mpeg12data.h"
 #include "startcode.h"
diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index 27c61527f6..4c61af7f7e 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -21,7 +21,7 @@ 
 
 #include "avcodec.h"
 #include "ass.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "libavutil/opt.h"
 
 #define SCREEN_ROWS 15
diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c
index a83babdf1e..ebbc83711c 100644
--- a/libavcodec/cdgraphics.c
+++ b/libavcodec/cdgraphics.c
@@ -21,6 +21,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 /**
diff --git a/libavcodec/cdtoons.c b/libavcodec/cdtoons.c
index 14c15c4579..b9d4e6429c 100644
--- a/libavcodec/cdtoons.c
+++ b/libavcodec/cdtoons.c
@@ -31,6 +31,7 @@ 
 #include "libavutil/internal.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #define CDTOONS_HEADER_SIZE   44
diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c
index 860dc639f6..533b10d660 100644
--- a/libavcodec/cdxl.c
+++ b/libavcodec/cdxl.c
@@ -31,6 +31,7 @@ 
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index ff38106fac..5ebecd49d2 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -32,6 +32,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "thread.h"
diff --git a/libavcodec/cfhdenc.c b/libavcodec/cfhdenc.c
index 3d87064a40..9cc08bfea3 100644
--- a/libavcodec/cfhdenc.c
+++ b/libavcodec/cfhdenc.c
@@ -33,9 +33,9 @@ 
 #include "bytestream.h"
 #include "cfhd.h"
 #include "cfhdencdsp.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "put_bits.h"
-#include "internal.h"
 #include "thread.h"
 
 /* Derived from existing tables from decoder */
diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
index 090ab9cea0..1ba50c5243 100644
--- a/libavcodec/cinepak.c
+++ b/libavcodec/cinepak.c
@@ -40,6 +40,7 @@ 
 #include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "internal.h"
 
diff --git a/libavcodec/cinepakenc.c b/libavcodec/cinepakenc.c
index 0574b125d7..00e96f989a 100644
--- a/libavcodec/cinepakenc.c
+++ b/libavcodec/cinepakenc.c
@@ -44,9 +44,9 @@ 
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "elbg.h"
 #include "encode.h"
-#include "internal.h"
 
 #define CVID_HEADER_SIZE 10
 #define STRIP_HEADER_SIZE 12
diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c
index 5ed8ac71dc..a3cc3815b5 100644
--- a/libavcodec/clearvideo.c
+++ b/libavcodec/clearvideo.c
@@ -29,6 +29,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "idctdsp.h"
 #include "internal.h"
diff --git a/libavcodec/cljrdec.c b/libavcodec/cljrdec.c
index 4a8c9d2ae1..b5c4690160 100644
--- a/libavcodec/cljrdec.c
+++ b/libavcodec/cljrdec.c
@@ -25,6 +25,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/cllc.c b/libavcodec/cllc.c
index 2ad5d77adc..64d3709958 100644
--- a/libavcodec/cllc.c
+++ b/libavcodec/cllc.c
@@ -27,7 +27,7 @@ 
 #include "canopus.h"
 #include "get_bits.h"
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "thread.h"
 
 #define VLC_BITS 7
diff --git a/libavcodec/cngdec.c b/libavcodec/cngdec.c
index 30d36f7326..5271b3e61a 100644
--- a/libavcodec/cngdec.c
+++ b/libavcodec/cngdec.c
@@ -26,6 +26,7 @@ 
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 #include "celp_filters.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/lfg.h"
 
diff --git a/libavcodec/cngenc.c b/libavcodec/cngenc.c
index d77bbac40e..6452d2e6a8 100644
--- a/libavcodec/cngenc.c
+++ b/libavcodec/cngenc.c
@@ -23,8 +23,8 @@ 
 
 #include "libavutil/common.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "lpc.h"
 
 typedef struct CNGContext {
diff --git a/libavcodec/codec_internal.h b/libavcodec/codec_internal.h
new file mode 100644
index 0000000000..07c8e943e2
--- /dev/null
+++ b/libavcodec/codec_internal.h
@@ -0,0 +1,82 @@ 
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_CODEC_INTERNAL_H
+#define AVCODEC_CODEC_INTERNAL_H
+
+/**
+ * The codec does not modify any global variables in the init function,
+ * allowing to call the init function without locking any global mutexes.
+ */
+#define FF_CODEC_CAP_INIT_THREADSAFE        (1 << 0)
+/**
+ * The codec allows calling the close function for deallocation even if
+ * the init function returned a failure. Without this capability flag, a
+ * codec does such cleanup internally when returning failures from the
+ * init function and does not expect the close function to be called at
+ * all.
+ */
+#define FF_CODEC_CAP_INIT_CLEANUP           (1 << 1)
+/**
+ * Decoders marked with FF_CODEC_CAP_SETS_PKT_DTS want to set
+ * AVFrame.pkt_dts manually. If the flag is set, decode.c won't overwrite
+ * this field. If it's unset, decode.c tries to guess the pkt_dts field
+ * from the input AVPacket.
+ */
+#define FF_CODEC_CAP_SETS_PKT_DTS           (1 << 2)
+/**
+ * The decoder extracts and fills its parameters even if the frame is
+ * skipped due to the skip_frame setting.
+ */
+#define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM  (1 << 3)
+/**
+ * The decoder sets the cropping fields in the output frames manually.
+ * If this cap is set, the generic code will initialize output frame
+ * dimensions to coded rather than display values.
+ */
+#define FF_CODEC_CAP_EXPORTS_CROPPING       (1 << 4)
+/**
+ * Codec initializes slice-based threading with a main function
+ */
+#define FF_CODEC_CAP_SLICE_THREAD_HAS_MF    (1 << 5)
+/*
+ * The codec supports frame threading and has inter-frame dependencies, so it
+ * uses ff_thread_report/await_progress().
+ */
+#define FF_CODEC_CAP_ALLOCATE_PROGRESS      (1 << 6)
+/**
+ * Codec handles avctx->thread_count == 0 (auto) internally.
+ */
+#define FF_CODEC_CAP_AUTO_THREADS           (1 << 7)
+/**
+ * Codec handles output frame properties internally instead of letting the
+ * internal logic derive them from AVCodecInternal.last_pkt_props.
+ */
+#define FF_CODEC_CAP_SETS_FRAME_PROPS       (1 << 8)
+
+/**
+ * AVCodec.codec_tags termination value
+ */
+#define FF_CODEC_TAGS_END -1
+
+struct AVCodecDefault {
+    const char *key;
+    const char *value;
+};
+
+#endif /* AVCODEC_CODEC_INTERNAL_H */
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index 7cb02fc2fa..ebdc7be906 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -51,6 +51,7 @@ 
 #include "avcodec.h"
 #include "get_bits.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "fft.h"
 #include "internal.h"
 #include "sinewin.h"
diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c
index a2ae16ec2c..cd72d63c2b 100644
--- a/libavcodec/cpia.c
+++ b/libavcodec/cpia.c
@@ -23,6 +23,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/cri.c b/libavcodec/cri.c
index 3b2c955dd8..f0a2238a30 100644
--- a/libavcodec/cri.c
+++ b/libavcodec/cri.c
@@ -31,6 +31,7 @@ 
 #include "libavutil/display.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "thread.h"
diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c
index 4fe34b737c..61ddf68ccc 100644
--- a/libavcodec/crystalhd.c
+++ b/libavcodec/crystalhd.c
@@ -57,6 +57,7 @@ 
 #include <libcrystalhd/libcrystalhd_if.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "internal.h"
 #include "libavutil/imgutils.h"
diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c
index 1b82626582..b852624d83 100644
--- a/libavcodec/cscd.c
+++ b/libavcodec/cscd.c
@@ -22,6 +22,7 @@ 
 #include <stdlib.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/common.h"
 
diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c
index f3a3ddda7c..8db4daa022 100644
--- a/libavcodec/cuviddec.c
+++ b/libavcodec/cuviddec.c
@@ -34,6 +34,7 @@ 
 #include "libavutil/pixdesc.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "hwconfig.h"
 #include "nvdec.h"
diff --git a/libavcodec/cyuv.c b/libavcodec/cyuv.c
index 50aa2322e9..c851c0392e 100644
--- a/libavcodec/cyuv.c
+++ b/libavcodec/cyuv.c
@@ -35,6 +35,7 @@ 
 #include <string.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/internal.h"
 
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index ad56554f46..fb91711bf9 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -22,10 +22,10 @@ 
 #include "libavutil/channel_layout.h"
 #include "libavutil/thread.h"
 
+#include "codec_internal.h"
 #include "dcadec.h"
 #include "dcahuff.h"
 #include "dca_syncwords.h"
-#include "internal.h"
 #include "profiles.h"
 
 #define MIN_PACKET_SIZE     16
diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c
index a3aae93dc9..02a071e9d5 100644
--- a/libavcodec/dcaenc.c
+++ b/libavcodec/dcaenc.c
@@ -30,6 +30,7 @@ 
 #include "libavutil/mem_internal.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "dca.h"
 #include "dcaadpcm.h"
 #include "dcamath.h"
diff --git a/libavcodec/dds.c b/libavcodec/dds.c
index e5183cade1..5a2516edff 100644
--- a/libavcodec/dds.c
+++ b/libavcodec/dds.c
@@ -33,6 +33,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "texturedsp.h"
 #include "thread.h"
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index ca7e5872fb..c13de8081b 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -42,6 +42,7 @@ 
 #include "avcodec.h"
 #include "bytestream.h"
 #include "bsf.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "hwconfig.h"
 #include "internal.h"
diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c
index 0cf3641a38..96122d9c11 100644
--- a/libavcodec/dfa.c
+++ b/libavcodec/dfa.c
@@ -24,6 +24,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #include "libavutil/avassert.h"
diff --git a/libavcodec/dfpwmdec.c b/libavcodec/dfpwmdec.c
index 27b60a4ea4..ee17cfc4d1 100644
--- a/libavcodec/dfpwmdec.c
+++ b/libavcodec/dfpwmdec.c
@@ -28,6 +28,7 @@ 
 #include "libavutil/internal.h"
 #include "avcodec.h"
 #include "codec_id.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct {
diff --git a/libavcodec/dfpwmenc.c b/libavcodec/dfpwmenc.c
index 8efd23e094..5b94a02672 100644
--- a/libavcodec/dfpwmenc.c
+++ b/libavcodec/dfpwmenc.c
@@ -28,8 +28,8 @@ 
 #include "libavutil/internal.h"
 #include "avcodec.h"
 #include "codec_id.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 
 typedef struct {
     int fq, q, s, lt;
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 7ffb8a3496..0c8325e586 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -32,6 +32,7 @@ 
 #include "avcodec.h"
 #include "get_bits.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "golomb.h"
 #include "dirac_arith.h"
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 78c7b72730..7a5de737ed 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -29,6 +29,7 @@ 
 
 #include "avcodec.h"
 #include "blockdsp.h"
+#include "codec_internal.h"
 #define  UNCHECKED_BITSTREAM_READER 1
 #include "get_bits.h"
 #include "dnxhddata.h"
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 9928ba0525..93dd789914 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -30,6 +30,7 @@ 
 
 #include "avcodec.h"
 #include "blockdsp.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "fdctdsp.h"
 #include "internal.h"
diff --git a/libavcodec/dolby_e.c b/libavcodec/dolby_e.c
index a9106a7632..0652a8c031 100644
--- a/libavcodec/dolby_e.c
+++ b/libavcodec/dolby_e.c
@@ -25,6 +25,7 @@ 
 #include "libavutil/mem_internal.h"
 #include "libavutil/opt.h"
 
+#include "codec_internal.h"
 #include "internal.h"
 #include "get_bits.h"
 #include "dolby_e.h"
diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c
index 95052282ae..9cbc571a15 100644
--- a/libavcodec/dpcm.c
+++ b/libavcodec/dpcm.c
@@ -40,6 +40,7 @@ 
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "mathops.h"
 
diff --git a/libavcodec/dpxenc.c b/libavcodec/dpxenc.c
index c4f9ae09bb..e32e0ba269 100644
--- a/libavcodec/dpxenc.c
+++ b/libavcodec/dpxenc.c
@@ -23,8 +23,8 @@ 
 #include "libavutil/intreadwrite.h"
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "version.h"
 
 typedef struct DPXContext {
diff --git a/libavcodec/dsddec.c b/libavcodec/dsddec.c
index 02698ee116..b5450120d7 100644
--- a/libavcodec/dsddec.c
+++ b/libavcodec/dsddec.c
@@ -28,6 +28,7 @@ 
 
 #include "libavcodec/internal.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "dsd.h"
 
 #define DSD_SILENCE 0x69
diff --git a/libavcodec/dsicinaudio.c b/libavcodec/dsicinaudio.c
index a543f6dd09..efc5252a80 100644
--- a/libavcodec/dsicinaudio.c
+++ b/libavcodec/dsicinaudio.c
@@ -28,6 +28,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "mathops.h"
 
diff --git a/libavcodec/dsicinvideo.c b/libavcodec/dsicinvideo.c
index c58f9a9efc..6851078426 100644
--- a/libavcodec/dsicinvideo.c
+++ b/libavcodec/dsicinvideo.c
@@ -26,6 +26,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef enum CinVideoBitmapIndex {
diff --git a/libavcodec/dss_sp.c b/libavcodec/dss_sp.c
index c8da3bffaf..067e0e2ce3 100644
--- a/libavcodec/dss_sp.c
+++ b/libavcodec/dss_sp.c
@@ -25,6 +25,7 @@ 
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/dstdec.c b/libavcodec/dstdec.c
index 78427bd15c..d262e3e0fd 100644
--- a/libavcodec/dstdec.c
+++ b/libavcodec/dstdec.c
@@ -27,6 +27,7 @@ 
 
 #include "libavutil/intreadwrite.h"
 #include "libavutil/mem_internal.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "get_bits.h"
 #include "avcodec.h"
diff --git a/libavcodec/dvaudiodec.c b/libavcodec/dvaudiodec.c
index f3b1dee075..92abfee8ba 100644
--- a/libavcodec/dvaudiodec.c
+++ b/libavcodec/dvaudiodec.c
@@ -21,6 +21,7 @@ 
 #include "libavutil/channel_layout.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "dvaudio.h"
 
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index bc741a1de6..4948f0b6f9 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -22,6 +22,7 @@ 
 #include "avcodec.h"
 #include "get_bits.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/colorspace.h"
 #include "libavutil/imgutils.h"
diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index 03249d6fa3..052d5b5a38 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -43,6 +43,7 @@ 
 #include "libavutil/thread.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "dv.h"
 #include "dv_profile_internal.h"
 #include "dvdata.h"
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 52259f0730..f8c2e4e431 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -20,6 +20,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/dvdsubenc.c b/libavcodec/dvdsubenc.c
index ff4fbed39d..8858b633f0 100644
--- a/libavcodec/dvdsubenc.c
+++ b/libavcodec/dvdsubenc.c
@@ -20,6 +20,7 @@ 
  */
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/avassert.h"
 #include "libavutil/bprint.h"
diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c
index 045a29b833..cafd2f3943 100644
--- a/libavcodec/dvenc.c
+++ b/libavcodec/dvenc.c
@@ -36,12 +36,12 @@ 
 #include "libavutil/thread.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "dv.h"
 #include "dv_profile_internal.h"
 #include "dv_tablegen.h"
 #include "encode.h"
 #include "fdctdsp.h"
-#include "internal.h"
 #include "mathops.h"
 #include "me_cmp.h"
 #include "pixblockdsp.h"
diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c
index 5615a7d1cc..29b6e8c1cd 100644
--- a/libavcodec/dxa.c
+++ b/libavcodec/dxa.c
@@ -31,6 +31,7 @@ 
 #include "libavutil/intreadwrite.h"
 #include "bytestream.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #include <zlib.h>
diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c
index e2c0cde85e..0e98e74b1c 100644
--- a/libavcodec/dxv.c
+++ b/libavcodec/dxv.c
@@ -27,7 +27,7 @@ 
 #include "mathops.h"
 #include "avcodec.h"
 #include "bytestream.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "lzf.h"
 #include "texturedsp.h"
 #include "thread.h"
diff --git a/libavcodec/eac3dec.c b/libavcodec/eac3dec.c
index 3a5c7989b9..d360b02691 100644
--- a/libavcodec/eac3dec.c
+++ b/libavcodec/eac3dec.c
@@ -39,7 +39,6 @@ 
 
 
 #include "avcodec.h"
-#include "internal.h"
 #include "aac_ac3_parser.h"
 #include "ac3.h"
 #include "ac3dec.h"
diff --git a/libavcodec/eac3enc.c b/libavcodec/eac3enc.c
index c959aec55c..5964eeee5a 100644
--- a/libavcodec/eac3enc.c
+++ b/libavcodec/eac3enc.c
@@ -28,6 +28,7 @@ 
 
 #include "libavutil/attributes.h"
 #include "ac3enc.h"
+#include "codec_internal.h"
 #include "eac3enc.h"
 #include "eac3_data.h"
 
diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c
index 572eb8e1bb..790c513b02 100644
--- a/libavcodec/eacmv.c
+++ b/libavcodec/eacmv.c
@@ -32,6 +32,7 @@ 
 #include "libavutil/intreadwrite.h"
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct CmvContext {
diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index 896f940735..7a27a57582 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -34,6 +34,7 @@ 
 #include "blockdsp.h"
 #include "bytestream.h"
 #include "bswapdsp.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "aandcttab.h"
 #include "eaidct.h"
diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c
index 2658f0cf87..29bde5a6e3 100644
--- a/libavcodec/eatgq.c
+++ b/libavcodec/eatgq.c
@@ -35,6 +35,7 @@ 
 #include "aandcttab.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "eaidct.h"
 #include "get_bits.h"
 #include "idctdsp.h"
diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c
index 20a90a090f..e32438442c 100644
--- a/libavcodec/eatgv.c
+++ b/libavcodec/eatgv.c
@@ -34,6 +34,7 @@ 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
 #include "get_bits.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #define EA_PREAMBLE_SIZE    8
diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c
index 51eff20b65..625e99f0ae 100644
--- a/libavcodec/eatqi.c
+++ b/libavcodec/eatqi.c
@@ -31,6 +31,7 @@ 
 #include "avcodec.h"
 #include "blockdsp.h"
 #include "bswapdsp.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "aandcttab.h"
 #include "eaidct.h"
diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c
index ab5c8d2243..066875f5e3 100644
--- a/libavcodec/escape124.c
+++ b/libavcodec/escape124.c
@@ -21,6 +21,7 @@ 
 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/escape130.c b/libavcodec/escape130.c
index ee1eafe861..5fa8997219 100644
--- a/libavcodec/escape130.c
+++ b/libavcodec/escape130.c
@@ -24,6 +24,7 @@ 
 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/evrcdec.c b/libavcodec/evrcdec.c
index a17f3bc2be..d2df28e3e9 100644
--- a/libavcodec/evrcdec.c
+++ b/libavcodec/evrcdec.c
@@ -29,6 +29,7 @@ 
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "get_bits.h"
 #include "evrcdata.h"
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index fc32ef1dde..f5e1456a25 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -49,6 +49,7 @@ 
 #include "bswapdsp.h"
 #endif
 
+#include "codec_internal.h"
 #include "exrdsp.h"
 #include "get_bits.h"
 #include "internal.h"
diff --git a/libavcodec/exrenc.c b/libavcodec/exrenc.c
index 8bb2ea8386..fc7d2c3d6b 100644
--- a/libavcodec/exrenc.c
+++ b/libavcodec/exrenc.c
@@ -33,8 +33,8 @@ 
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "float2half.h"
 
 enum ExrCompr {
diff --git a/libavcodec/fastaudio.c b/libavcodec/fastaudio.c
index 7a8ff7dec3..6c10a31ce2 100644
--- a/libavcodec/fastaudio.c
+++ b/libavcodec/fastaudio.c
@@ -25,6 +25,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "mathops.h"
 
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 201630167d..87d1c7b009 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -31,6 +31,7 @@ 
 #include "libavutil/imgutils.h"
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "get_bits.h"
 #include "rangecoder.h"
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index d29f62bf56..c209911fa8 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -34,6 +34,7 @@ 
 
 #include "avcodec.h"
 #include "encode.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "put_bits.h"
 #include "put_golomb.h"
diff --git a/libavcodec/ffwavesynth.c b/libavcodec/ffwavesynth.c
index 229a89663d..b614634038 100644
--- a/libavcodec/ffwavesynth.c
+++ b/libavcodec/ffwavesynth.c
@@ -22,6 +22,7 @@ 
 #include "libavutil/intreadwrite.h"
 #include "libavutil/log.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 
diff --git a/libavcodec/fic.c b/libavcodec/fic.c
index d29f6d16fb..b75ded72f2 100644
--- a/libavcodec/fic.c
+++ b/libavcodec/fic.c
@@ -25,6 +25,7 @@ 
 #include "libavutil/mem_internal.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "get_bits.h"
 #include "golomb.h"
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index d8597303a2..f012424ced 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -37,7 +37,7 @@ 
 #include "libavutil/crc.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "bytestream.h"
 #include "golomb.h"
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
index 0912ca2f47..e4e4d5ea15 100644
--- a/libavcodec/flacenc.c
+++ b/libavcodec/flacenc.c
@@ -28,6 +28,7 @@ 
 
 #include "avcodec.h"
 #include "bswapdsp.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "put_bits.h"
 #include "put_golomb.h"
diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c
index 64d3d85eae..31d8ea083c 100644
--- a/libavcodec/flashsv.c
+++ b/libavcodec/flashsv.c
@@ -42,6 +42,7 @@ 
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/flashsv2enc.c b/libavcodec/flashsv2enc.c
index 56ea0ed0a4..fa6ec30fd3 100644
--- a/libavcodec/flashsv2enc.c
+++ b/libavcodec/flashsv2enc.c
@@ -48,8 +48,8 @@ 
 
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "put_bits.h"
 #include "bytestream.h"
 
diff --git a/libavcodec/flashsvenc.c b/libavcodec/flashsvenc.c
index 171a66ee15..f3178da7a1 100644
--- a/libavcodec/flashsvenc.c
+++ b/libavcodec/flashsvenc.c
@@ -49,8 +49,8 @@ 
 #include <zlib.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "put_bits.h"
 #include "bytestream.h"
 
diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c
index e122fe231f..eacb4b1b03 100644
--- a/libavcodec/flicvideo.c
+++ b/libavcodec/flicvideo.c
@@ -41,6 +41,7 @@ 
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "mathops.h"
 
diff --git a/libavcodec/flvdec.c b/libavcodec/flvdec.c
index b083d05037..8b30d0078c 100644
--- a/libavcodec/flvdec.c
+++ b/libavcodec/flvdec.c
@@ -20,9 +20,9 @@ 
 
 #include "libavutil/imgutils.h"
 
+#include "codec_internal.h"
 #include "flvdec.h"
 #include "h263dec.h"
-#include "internal.h"
 #include "mpegvideo.h"
 #include "mpegvideodata.h"
 
diff --git a/libavcodec/flvenc.c b/libavcodec/flvenc.c
index 663a33c959..8a1e5d6076 100644
--- a/libavcodec/flvenc.c
+++ b/libavcodec/flvenc.c
@@ -18,6 +18,7 @@ 
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "codec_internal.h"
 #include "flvenc.h"
 #include "h263data.h"
 #include "mpegvideo.h"
diff --git a/libavcodec/fmvc.c b/libavcodec/fmvc.c
index aab46da9cf..f43aea1514 100644
--- a/libavcodec/fmvc.c
+++ b/libavcodec/fmvc.c
@@ -26,6 +26,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #define BLOCK_HEIGHT 112u
diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c
index 18e85eed41..a9db56d1fe 100644
--- a/libavcodec/fraps.c
+++ b/libavcodec/fraps.c
@@ -40,7 +40,7 @@ 
 #include "huffman.h"
 #include "bytestream.h"
 #include "bswapdsp.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "thread.h"
 
 #define FPS_TAG MKTAG('F', 'P', 'S', 'x')
diff --git a/libavcodec/frwu.c b/libavcodec/frwu.c
index 82a8ec2111..12b56f976a 100644
--- a/libavcodec/frwu.c
+++ b/libavcodec/frwu.c
@@ -22,6 +22,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/opt.h"
 
diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c
index 8628016ef4..578b5d9b93 100644
--- a/libavcodec/g2meet.c
+++ b/libavcodec/g2meet.c
@@ -35,6 +35,7 @@ 
 #include "avcodec.h"
 #include "blockdsp.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "elsdec.h"
 #include "get_bits.h"
 #include "idctdsp.h"
diff --git a/libavcodec/g722dec.c b/libavcodec/g722dec.c
index 879ea296cb..c3927f8221 100644
--- a/libavcodec/g722dec.c
+++ b/libavcodec/g722dec.c
@@ -37,6 +37,7 @@ 
 #include "libavutil/channel_layout.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "g722.h"
 #include "internal.h"
diff --git a/libavcodec/g722enc.c b/libavcodec/g722enc.c
index 6010a6d5ae..8cb41be37a 100644
--- a/libavcodec/g722enc.c
+++ b/libavcodec/g722enc.c
@@ -30,6 +30,7 @@ 
 #include "libavutil/avassert.h"
 #include "libavutil/channel_layout.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 #include "g722.h"
diff --git a/libavcodec/g723_1dec.c b/libavcodec/g723_1dec.c
index 8f381b1331..a0d2df7a93 100644
--- a/libavcodec/g723_1dec.c
+++ b/libavcodec/g723_1dec.c
@@ -34,6 +34,7 @@ 
 #include "avcodec.h"
 #include "celp_filters.h"
 #include "celp_math.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "g723_1.h"
diff --git a/libavcodec/g723_1enc.c b/libavcodec/g723_1enc.c
index 7e893fafc7..9f91d282f5 100644
--- a/libavcodec/g723_1enc.c
+++ b/libavcodec/g723_1enc.c
@@ -34,9 +34,9 @@ 
 
 #include "avcodec.h"
 #include "celp_math.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "g723_1.h"
-#include "internal.h"
 
 #define BITSTREAM_WRITER_LE
 #include "put_bits.h"
diff --git a/libavcodec/g726.c b/libavcodec/g726.c
index 233fe47b31..ef5a21a253 100644
--- a/libavcodec/g726.c
+++ b/libavcodec/g726.c
@@ -29,6 +29,7 @@ 
 #include "libavutil/channel_layout.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 #include "get_bits.h"
diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c
index 5a90f9fc1c..f96ecbda5f 100644
--- a/libavcodec/g729dec.c
+++ b/libavcodec/g729dec.c
@@ -26,6 +26,7 @@ 
 #include "libavutil/avutil.h"
 #include "get_bits.h"
 #include "audiodsp.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 
diff --git a/libavcodec/gdv.c b/libavcodec/gdv.c
index 222e604c8b..4c012ce309 100644
--- a/libavcodec/gdv.c
+++ b/libavcodec/gdv.c
@@ -23,6 +23,7 @@ 
 #include "libavutil/common.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "internal.h"
 
diff --git a/libavcodec/gif.c b/libavcodec/gif.c
index 5e7cc47206..d6a39fe210 100644
--- a/libavcodec/gif.c
+++ b/libavcodec/gif.c
@@ -35,8 +35,8 @@ 
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "lzw.h"
 #include "gif.h"
 
diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
index 80f1ba0cce..d652666225 100644
--- a/libavcodec/gifdec.c
+++ b/libavcodec/gifdec.c
@@ -25,6 +25,7 @@ 
 #include "libavutil/opt.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "lzw.h"
 #include "gif.h"
diff --git a/libavcodec/gsmdec.c b/libavcodec/gsmdec.c
index 15eae63e33..cf91ff11e9 100644
--- a/libavcodec/gsmdec.c
+++ b/libavcodec/gsmdec.c
@@ -28,6 +28,7 @@ 
 
 #include "libavutil/channel_layout.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "msgsmdec.h"
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 5e732b05bf..60e7430376 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -28,6 +28,7 @@ 
 #include "libavutil/avassert.h"
 #include "libavutil/thread.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "mpeg_er.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c
index 7d6a559f46..33bb689571 100644
--- a/libavcodec/h261enc.c
+++ b/libavcodec/h261enc.c
@@ -29,6 +29,7 @@ 
 #include "libavutil/avassert.h"
 #include "libavutil/thread.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
 #include "h261.h"
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 399b67d76b..9ffce5d865 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -30,6 +30,7 @@ 
 #include "config_components.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "error_resilience.h"
 #include "flvdec.h"
 #include "h263.h"
diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index cc77c3169d..9cad57d88b 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -35,6 +35,7 @@ 
 #include "libavutil/thread.h"
 #include "libavutil/video_enc_params.h"
 
+#include "codec_internal.h"
 #include "internal.h"
 #include "error_resilience.h"
 #include "avcodec.h"
diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c
index 9f8dadc43d..ed080549a6 100644
--- a/libavcodec/hapdec.c
+++ b/libavcodec/hapdec.c
@@ -37,8 +37,8 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "hap.h"
-#include "internal.h"
 #include "snappy.h"
 #include "texturedsp.h"
 #include "thread.h"
diff --git a/libavcodec/hapenc.c b/libavcodec/hapenc.c
index 8db0af3a43..6f07ce081d 100644
--- a/libavcodec/hapenc.c
+++ b/libavcodec/hapenc.c
@@ -39,9 +39,9 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "hap.h"
-#include "internal.h"
 #include "texturedsp.h"
 
 #define HAP_MAX_CHUNKS 64
diff --git a/libavcodec/hcadec.c b/libavcodec/hcadec.c
index 3aa6cbaf03..b51f19139c 100644
--- a/libavcodec/hcadec.c
+++ b/libavcodec/hcadec.c
@@ -23,6 +23,7 @@ 
 #include "libavutil/tx.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "hca_data.h"
diff --git a/libavcodec/hcom.c b/libavcodec/hcom.c
index d30d6402d1..bc004dc98c 100644
--- a/libavcodec/hcom.c
+++ b/libavcodec/hcom.c
@@ -21,6 +21,7 @@ 
 #include "libavutil/intreadwrite.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 4f49d95960..ed6548e403 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -40,6 +40,7 @@ 
 #include "bswapdsp.h"
 #include "bytestream.h"
 #include "cabac_functions.h"
+#include "codec_internal.h"
 #include "golomb.h"
 #include "hevc.h"
 #include "hevc_data.h"
diff --git a/libavcodec/hnm4video.c b/libavcodec/hnm4video.c
index dd7504c514..c03ea97913 100644
--- a/libavcodec/hnm4video.c
+++ b/libavcodec/hnm4video.c
@@ -28,6 +28,7 @@ 
 #include "libavutil/mem.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #define HNM4_CHUNK_ID_PL 19536
diff --git a/libavcodec/hq_hqa.c b/libavcodec/hq_hqa.c
index 71753e7cc2..6e9d7bf4c4 100644
--- a/libavcodec/hq_hqa.c
+++ b/libavcodec/hq_hqa.c
@@ -25,6 +25,7 @@ 
 
 #include "avcodec.h"
 #include "canopus.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c
index 09310b69e8..b89b6e58f6 100644
--- a/libavcodec/hqx.c
+++ b/libavcodec/hqx.c
@@ -25,8 +25,8 @@ 
 
 #include "avcodec.h"
 #include "canopus.h"
+#include "codec_internal.h"
 #include "get_bits.h"
-#include "internal.h"
 #include "thread.h"
 
 #include "hqx.h"
diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index 8dc7864dd0..d43d333ede 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -35,10 +35,10 @@ 
 #include "config_components.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "huffyuv.h"
 #include "huffyuvdsp.h"
-#include "internal.h"
 #include "lossless_videodsp.h"
 #include "thread.h"
 #include "libavutil/imgutils.h"
diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c
index 39a434c720..2e226d41ea 100644
--- a/libavcodec/huffyuvenc.c
+++ b/libavcodec/huffyuvenc.c
@@ -31,11 +31,11 @@ 
 #include "config_components.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "huffyuv.h"
 #include "huffman.h"
 #include "huffyuvencdsp.h"
-#include "internal.h"
 #include "lossless_videoencdsp.h"
 #include "put_bits.h"
 #include "libavutil/opt.h"
diff --git a/libavcodec/idcinvideo.c b/libavcodec/idcinvideo.c
index 41df545542..35c4818fbe 100644
--- a/libavcodec/idcinvideo.c
+++ b/libavcodec/idcinvideo.c
@@ -49,6 +49,7 @@ 
 #include <string.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "internal.h"
 #include "libavutil/internal.h"
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index 6596130727..e95cf22150 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -34,6 +34,7 @@ 
 
 #include "bytestream.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "mathops.h"
 
diff --git a/libavcodec/ilbcdec.c b/libavcodec/ilbcdec.c
index 27423d12f8..590e728257 100644
--- a/libavcodec/ilbcdec.c
+++ b/libavcodec/ilbcdec.c
@@ -32,6 +32,7 @@ 
 
 #include "libavutil/channel_layout.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "get_bits.h"
 #include "ilbcdata.h"
diff --git a/libavcodec/imc.c b/libavcodec/imc.c
index 924111ea80..cf7b2206d1 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -44,6 +44,7 @@ 
 
 #include "avcodec.h"
 #include "bswapdsp.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "fft.h"
 #include "internal.h"
diff --git a/libavcodec/imm4.c b/libavcodec/imm4.c
index a47c1e1ed8..685966774a 100644
--- a/libavcodec/imm4.c
+++ b/libavcodec/imm4.c
@@ -29,6 +29,7 @@ 
 
 #include "avcodec.h"
 #include "bswapdsp.h"
+#include "codec_internal.h"
 #include "copy_block.h"
 #include "get_bits.h"
 #include "idctdsp.h"
diff --git a/libavcodec/imm5.c b/libavcodec/imm5.c
index cb8a619a4a..26ad2a4f21 100644
--- a/libavcodec/imm5.c
+++ b/libavcodec/imm5.c
@@ -21,7 +21,7 @@ 
 #include "libavutil/intreadwrite.h"
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 
 typedef struct IMM5Context {
     AVCodecContext *h264_avctx;   // wrapper context for H264
diff --git a/libavcodec/imx.c b/libavcodec/imx.c
index d81a0de7be..5d8f40baf9 100644
--- a/libavcodec/imx.c
+++ b/libavcodec/imx.c
@@ -21,6 +21,7 @@ 
 #include "libavutil/common.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "internal.h"
 
diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c
index 02fc7fefa1..e8b99a457c 100644
--- a/libavcodec/indeo2.c
+++ b/libavcodec/indeo2.c
@@ -29,6 +29,7 @@ 
 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "indeo2data.h"
 #include "internal.h"
diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index 326b3141eb..1a84de2398 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -33,6 +33,7 @@ 
 #include "libavutil/intreadwrite.h"
 #include "libavutil/thread.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "copy_block.h"
 #include "bytestream.h"
 #include "get_bits.h"
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c
index 3d3579d76b..5b3d00631a 100644
--- a/libavcodec/indeo4.c
+++ b/libavcodec/indeo4.c
@@ -29,10 +29,10 @@ 
 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "libavutil/imgutils.h"
 #include "indeo4data.h"
-#include "internal.h"
 #include "ivi.h"
 #include "ivi_dsp.h"
 
diff --git a/libavcodec/indeo5.c b/libavcodec/indeo5.c
index fbf0c004d8..afa7cec8ed 100644
--- a/libavcodec/indeo5.c
+++ b/libavcodec/indeo5.c
@@ -29,8 +29,8 @@ 
 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
-#include "internal.h"
 #include "ivi.h"
 #include "ivi_dsp.h"
 #include "indeo5data.h"
diff --git a/libavcodec/intelh263dec.c b/libavcodec/intelh263dec.c
index b278995561..6ec8ed38d6 100644
--- a/libavcodec/intelh263dec.c
+++ b/libavcodec/intelh263dec.c
@@ -18,7 +18,7 @@ 
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "internal.h"
+#include "codec_internal.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
 #include "h263data.h"
diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index 3766fe05bc..d16a87db2c 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -35,62 +35,6 @@ 
 #include "bsf.h"
 #include "config.h"
 
-/**
- * The codec does not modify any global variables in the init function,
- * allowing to call the init function without locking any global mutexes.
- */
-#define FF_CODEC_CAP_INIT_THREADSAFE        (1 << 0)
-/**
- * The codec allows calling the close function for deallocation even if
- * the init function returned a failure. Without this capability flag, a
- * codec does such cleanup internally when returning failures from the
- * init function and does not expect the close function to be called at
- * all.
- */
-#define FF_CODEC_CAP_INIT_CLEANUP           (1 << 1)
-/**
- * Decoders marked with FF_CODEC_CAP_SETS_PKT_DTS want to set
- * AVFrame.pkt_dts manually. If the flag is set, decode.c won't overwrite
- * this field. If it's unset, decode.c tries to guess the pkt_dts field
- * from the input AVPacket.
- */
-#define FF_CODEC_CAP_SETS_PKT_DTS           (1 << 2)
-/**
- * The decoder extracts and fills its parameters even if the frame is
- * skipped due to the skip_frame setting.
- */
-#define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM  (1 << 3)
-/**
- * The decoder sets the cropping fields in the output frames manually.
- * If this cap is set, the generic code will initialize output frame
- * dimensions to coded rather than display values.
- */
-#define FF_CODEC_CAP_EXPORTS_CROPPING       (1 << 4)
-/**
- * Codec initializes slice-based threading with a main function
- */
-#define FF_CODEC_CAP_SLICE_THREAD_HAS_MF    (1 << 5)
-/*
- * The codec supports frame threading and has inter-frame dependencies, so it
- * uses ff_thread_report/await_progress().
- */
-#define FF_CODEC_CAP_ALLOCATE_PROGRESS      (1 << 6)
-/**
- * Codec handles avctx->thread_count == 0 (auto) internally.
- */
-#define FF_CODEC_CAP_AUTO_THREADS           (1 << 7)
-/**
- * Codec handles output frame properties internally instead of letting the
- * internal logic derive them from AVCodecInternal.last_pkt_props.
- */
-#define FF_CODEC_CAP_SETS_FRAME_PROPS       (1 << 8)
-
-/**
- * AVCodec.codec_tags termination value
- */
-#define FF_CODEC_TAGS_END -1
-
-
 #define FF_DEFAULT_QUANT_BIAS 999999
 
 #define FF_QSCALE_TYPE_MPEG1 0
@@ -215,11 +159,6 @@  typedef struct AVCodecInternal {
     AVChannelLayout initial_ch_layout;
 } AVCodecInternal;
 
-struct AVCodecDefault {
-    const uint8_t *key;
-    const uint8_t *value;
-};
-
 extern const uint8_t ff_log2_run[41];
 
 /**
diff --git a/libavcodec/interplayacm.c b/libavcodec/interplayacm.c
index 7b4e539239..6ab77dcfd1 100644
--- a/libavcodec/interplayacm.c
+++ b/libavcodec/interplayacm.c
@@ -23,6 +23,7 @@ 
 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c
index 6da7538b35..c4c22f7bc3 100644
--- a/libavcodec/interplayvideo.c
+++ b/libavcodec/interplayvideo.c
@@ -43,6 +43,7 @@ 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "get_bits.h"
 #include "hpeldsp.h"
diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c
index dc8dd8c9ea..2c06a5f66e 100644
--- a/libavcodec/ituh263enc.c
+++ b/libavcodec/ituh263enc.c
@@ -34,6 +34,7 @@ 
 #include "libavutil/attributes.h"
 #include "libavutil/thread.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "mpegvideo.h"
 #include "mpegvideodata.h"
 #include "flvenc.h"
diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c
index 95573c6799..b9f0a3c546 100644
--- a/libavcodec/j2kenc.c
+++ b/libavcodec/j2kenc.c
@@ -66,8 +66,8 @@ 
 
 #include <float.h>
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "bytestream.h"
 #include "jpeg2000.h"
 #include "version.h"
diff --git a/libavcodec/jacosubdec.c b/libavcodec/jacosubdec.c
index 698895a86b..dfb9866665 100644
--- a/libavcodec/jacosubdec.c
+++ b/libavcodec/jacosubdec.c
@@ -26,7 +26,7 @@ 
 
 #include <time.h>
 #include "ass.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "jacosub.h"
 #include "libavutil/avstring.h"
 #include "libavutil/bprint.h"
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index d96ec3a275..db994a710c 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -36,6 +36,7 @@ 
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "thread.h"
 #include "jpeg2000.h"
diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index b611c0ec3b..4213c32905 100644
--- a/libavcodec/jpeglsdec.c
+++ b/libavcodec/jpeglsdec.c
@@ -26,6 +26,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "golomb.h"
 #include "internal.h"
diff --git a/libavcodec/jpeglsenc.c b/libavcodec/jpeglsenc.c
index 83b2350a15..7c702da172 100644
--- a/libavcodec/jpeglsenc.c
+++ b/libavcodec/jpeglsenc.c
@@ -29,6 +29,7 @@ 
 #include "libavutil/opt.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "get_bits.h"
 #include "put_bits.h"
diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c
index 71049bbeb0..c0f810f4fd 100644
--- a/libavcodec/jvdec.c
+++ b/libavcodec/jvdec.c
@@ -29,6 +29,7 @@ 
 
 #include "avcodec.h"
 #include "blockdsp.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c
index f865771b72..9efb9f6fed 100644
--- a/libavcodec/kgv1dec.c
+++ b/libavcodec/kgv1dec.c
@@ -28,6 +28,7 @@ 
 #include "libavutil/intreadwrite.h"
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct KgvContext {
diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c
index a47afed8fb..0db316ccd6 100644
--- a/libavcodec/kmvc.c
+++ b/libavcodec/kmvc.c
@@ -29,6 +29,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "internal.h"
 #include "libavutil/common.h"
diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c
index b8f330cf34..1eab4cc8e3 100644
--- a/libavcodec/lagarith.c
+++ b/libavcodec/lagarith.c
@@ -28,8 +28,8 @@ 
 #include <inttypes.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
-#include "internal.h"
 #include "mathops.h"
 #include "lagarithrac.h"
 #include "lossless_videodsp.h"
diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c
index b2ef85e5f9..9d37b08478 100644
--- a/libavcodec/lcldec.c
+++ b/libavcodec/lcldec.c
@@ -46,7 +46,7 @@ 
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
 #include "bytestream.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "lcl.h"
 #include "thread.h"
 
diff --git a/libavcodec/lclenc.c b/libavcodec/lclenc.c
index 7deea4f20a..c4af573a46 100644
--- a/libavcodec/lclenc.c
+++ b/libavcodec/lclenc.c
@@ -42,8 +42,8 @@ 
 
 #include "libavutil/avassert.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "lcl.h"
 #include "libavutil/internal.h"
 #include "libavutil/mem.h"
diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c
index 64a627ed1c..4bc64b8f7f 100644
--- a/libavcodec/libaomdec.c
+++ b/libavcodec/libaomdec.c
@@ -31,6 +31,7 @@ 
 #include "libavutil/imgutils.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "profiles.h"
 
diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index 963cc1bcbc..d62653135c 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -38,6 +38,7 @@ 
 #include "av1.h"
 #include "avcodec.h"
 #include "bsf.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 #include "packet_internal.h"
diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 872e60e000..960c129606 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -31,6 +31,7 @@ 
 #include "atsc_a53.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "internal.h"
 
diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
index a1672d1c95..a5424829a1 100644
--- a/libavcodec/libdavs2.c
+++ b/libavcodec/libdavs2.c
@@ -24,7 +24,7 @@ 
 
 #include "libavutil/cpu.h"
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "davs2.h"
 
 typedef struct DAVS2Context {
diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c
index d7b84015be..00d7bdead1 100644
--- a/libavcodec/libfdk-aacdec.c
+++ b/libavcodec/libfdk-aacdec.c
@@ -23,6 +23,7 @@ 
 #include "libavutil/common.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #ifdef AACDECODER_LIB_VL0
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
index 936049f12b..40161d5738 100644
--- a/libavcodec/libfdk-aacenc.c
+++ b/libavcodec/libfdk-aacenc.c
@@ -24,8 +24,8 @@ 
 #include "libavutil/opt.h"
 #include "avcodec.h"
 #include "audio_frame_queue.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "profiles.h"
 
 #ifdef AACENCODER_LIB_VL0
diff --git a/libavcodec/libgsmenc.c b/libavcodec/libgsmenc.c
index 30638f9650..90aaecc2f8 100644
--- a/libavcodec/libgsmenc.c
+++ b/libavcodec/libgsmenc.c
@@ -39,8 +39,8 @@ 
 #include "libavutil/common.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "gsm.h"
 
 static av_cold int libgsm_encode_close(AVCodecContext *avctx) {
diff --git a/libavcodec/libilbc.c b/libavcodec/libilbc.c
index cfffe7d520..9c2edb9a3e 100644
--- a/libavcodec/libilbc.c
+++ b/libavcodec/libilbc.c
@@ -25,6 +25,7 @@ 
 #include "libavutil/common.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 
diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index 5f9ab43093..aa54d70841 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -36,8 +36,8 @@ 
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "packet_internal.h"
 
 typedef struct LibkvazaarContext {
diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index 8d296d7ea4..4e3fb81a81 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -34,8 +34,8 @@ 
 #include "libavutil/opt.h"
 #include "avcodec.h"
 #include "audio_frame_queue.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "mpegaudio.h"
 #include "mpegaudiodecheader.h"
 
diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c
index 7f5e85402a..78528b9c0b 100644
--- a/libavcodec/libopenh264dec.c
+++ b/libavcodec/libopenh264dec.c
@@ -30,6 +30,7 @@ 
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libopenh264.h"
 
diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index 7c0501a2eb..ceb4c49cb7 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -30,6 +30,7 @@ 
 #include "libavutil/mathematics.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 #include "libopenh264.h"
diff --git a/libavcodec/libopusdec.c b/libavcodec/libopusdec.c
index e4d127ad74..2493776ea8 100644
--- a/libavcodec/libopusdec.c
+++ b/libavcodec/libopusdec.c
@@ -28,6 +28,7 @@ 
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "vorbis.h"
 #include "mathops.h"
diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c
index d63d630328..47fd658ac8 100644
--- a/libavcodec/libopusenc.c
+++ b/libavcodec/libopusenc.c
@@ -26,8 +26,8 @@ 
 #include "libavutil/opt.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "libopus.h"
 #include "vorbis.h"
 #include "audio_frame_queue.h"
diff --git a/libavcodec/librav1e.c b/libavcodec/librav1e.c
index a368ee508f..3b0b12debf 100644
--- a/libavcodec/librav1e.c
+++ b/libavcodec/librav1e.c
@@ -31,6 +31,7 @@ 
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
 #include "bsf.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 
diff --git a/libavcodec/libspeexenc.c b/libavcodec/libspeexenc.c
index 41c116a362..eef2485001 100644
--- a/libavcodec/libspeexenc.c
+++ b/libavcodec/libspeexenc.c
@@ -89,8 +89,8 @@ 
 #include "libavutil/common.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "audio_frame_queue.h"
 
 /* TODO: Think about converting abr, vad, dtx and such flags to a bit field */
diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index b150723b7b..16fdba149a 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -31,6 +31,7 @@ 
 #include "libavutil/pixdesc.h"
 #include "libavutil/avassert.h"
 
+#include "codec_internal.h"
 #include "internal.h"
 #include "encode.h"
 #include "packet_internal.h"
diff --git a/libavcodec/libtwolame.c b/libavcodec/libtwolame.c
index c68e0301b3..cb803de1f3 100644
--- a/libavcodec/libtwolame.c
+++ b/libavcodec/libtwolame.c
@@ -31,6 +31,7 @@ 
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 #include "mpegaudio.h"
diff --git a/libavcodec/libuavs3d.c b/libavcodec/libuavs3d.c
index 0b5c6268a4..24737e800c 100644
--- a/libavcodec/libuavs3d.c
+++ b/libavcodec/libuavs3d.c
@@ -29,6 +29,7 @@ 
 #include "libavutil/opt.h"
 #include "avcodec.h"
 #include "avs3.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "uavs3d.h"
 
diff --git a/libavcodec/libvorbisenc.c b/libavcodec/libvorbisenc.c
index fcacd13c52..1162909550 100644
--- a/libavcodec/libvorbisenc.c
+++ b/libavcodec/libvorbisenc.c
@@ -26,6 +26,7 @@ 
 #include "libavutil/opt.h"
 #include "avcodec.h"
 #include "audio_frame_queue.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 #include "version.h"
diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index f59a03fc2f..f613d09737 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -35,6 +35,7 @@ 
 #include "libavutil/imgutils.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "internal.h"
 #include "libvpx.h"
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 77b96a5cde..3bbb9013ee 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -31,6 +31,7 @@ 
 #include <vpx/vp8cx.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 #include "libavutil/avassert.h"
diff --git a/libavcodec/libwebpenc_common.h b/libavcodec/libwebpenc_common.h
index 0c13176b79..5e96ef6acd 100644
--- a/libavcodec/libwebpenc_common.h
+++ b/libavcodec/libwebpenc_common.h
@@ -35,7 +35,7 @@ 
 #include "libavutil/pixfmt.h"
 #include "avcodec.h"
 #include "codec.h"
-#include "internal.h"
+#include "codec_internal.h"
 
 typedef struct LibWebPContextCommon {
     AVClass *class;         // class for AVOptions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index b8800db946..019eb81ab7 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -30,6 +30,7 @@ 
 #include "libavutil/time.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 #include "packet_internal.h"
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 851f099343..3217d45284 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -32,6 +32,7 @@ 
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 #include "packet_internal.h"
diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c
index 20b3b0f804..14891f7c62 100644
--- a/libavcodec/libxavs.c
+++ b/libavcodec/libxavs.c
@@ -27,8 +27,8 @@ 
 #include <float.h>
 #include <xavs.h>
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "packet_internal.h"
 #include "libavutil/internal.h"
 #include "libavutil/mem.h"
diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c
index 4742b18f9f..0fc7a623e5 100644
--- a/libavcodec/libxavs2.c
+++ b/libavcodec/libxavs2.c
@@ -23,8 +23,8 @@ 
  */
 
 #include "xavs2.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "mpeg12.h"
 #include "libavutil/avstring.h"
 #include "libavutil/opt.h"
diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c
index 94746d0bda..453f6f7d37 100644
--- a/libavcodec/libxvid.c
+++ b/libavcodec/libxvid.c
@@ -38,8 +38,8 @@ 
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "mpegutils.h"
 #include "packet_internal.h"
 
diff --git a/libavcodec/ljpegenc.c b/libavcodec/ljpegenc.c
index e15f448f90..2eef77c60f 100644
--- a/libavcodec/ljpegenc.c
+++ b/libavcodec/ljpegenc.c
@@ -36,9 +36,9 @@ 
 #include "libavutil/pixdesc.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "idctdsp.h"
-#include "internal.h"
 #include "jpegtables.h"
 #include "mathops.h"
 #include "mjpegenc_common.h"
diff --git a/libavcodec/loco.c b/libavcodec/loco.c
index ebd81f43f2..5088655a4f 100644
--- a/libavcodec/loco.c
+++ b/libavcodec/loco.c
@@ -25,6 +25,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "golomb.h"
 #include "internal.h"
diff --git a/libavcodec/lscrdec.c b/libavcodec/lscrdec.c
index 18f46bd27c..836ca54d17 100644
--- a/libavcodec/lscrdec.c
+++ b/libavcodec/lscrdec.c
@@ -28,6 +28,7 @@ 
 #include "avcodec.h"
 #include "bytestream.h"
 #include "codec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "packet.h"
 #include "png.h"
diff --git a/libavcodec/m101.c b/libavcodec/m101.c
index dd0ace76f5..665afb0aa4 100644
--- a/libavcodec/m101.c
+++ b/libavcodec/m101.c
@@ -21,6 +21,7 @@ 
 #include "libavutil/intreadwrite.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 
diff --git a/libavcodec/mace.c b/libavcodec/mace.c
index 9ed4747ba9..c32c9fc582 100644
--- a/libavcodec/mace.c
+++ b/libavcodec/mace.c
@@ -25,6 +25,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/common.h"
 
diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c
index 46515780fc..a2787c8b10 100644
--- a/libavcodec/magicyuv.c
+++ b/libavcodec/magicyuv.c
@@ -28,6 +28,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "huffyuvdsp.h"
 #include "internal.h"
diff --git a/libavcodec/magicyuvenc.c b/libavcodec/magicyuvenc.c
index 7fb7578327..5e642fc2cf 100644
--- a/libavcodec/magicyuvenc.c
+++ b/libavcodec/magicyuvenc.c
@@ -28,9 +28,9 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "put_bits.h"
-#include "internal.h"
 #include "thread.h"
 #include "lossless_videoencdsp.h"
 
diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
index 986712cd06..5d04268598 100644
--- a/libavcodec/mdec.c
+++ b/libavcodec/mdec.c
@@ -32,8 +32,8 @@ 
 #include "avcodec.h"
 #include "blockdsp.h"
 #include "bswapdsp.h"
+#include "codec_internal.h"
 #include "idctdsp.h"
-#include "internal.h"
 #include "mpeg12data.h"
 #include "mpeg12dec.h"
 #include "thread.h"
diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c
index fc1f6a7c4d..c7e41f5495 100644
--- a/libavcodec/mediacodecdec.c
+++ b/libavcodec/mediacodecdec.c
@@ -33,6 +33,7 @@ 
 #include "libavutil/internal.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "h264_parse.h"
 #include "h264_ps.h"
diff --git a/libavcodec/metasound.c b/libavcodec/metasound.c
index 37c6556abd..db771dd869 100644
--- a/libavcodec/metasound.c
+++ b/libavcodec/metasound.c
@@ -30,9 +30,9 @@ 
 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "fft.h"
 #include "get_bits.h"
-#include "internal.h"
 #include "lsp.h"
 #include "sinewin.h"
 
diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c
index 043026112a..2f91e9722b 100644
--- a/libavcodec/mfenc.c
+++ b/libavcodec/mfenc.c
@@ -27,6 +27,7 @@ 
 #include "libavutil/imgutils.h"
 #include "libavutil/opt.h"
 #include "libavutil/time.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct MFContext {
diff --git a/libavcodec/microdvddec.c b/libavcodec/microdvddec.c
index c45fe043bf..ae7fddd1f2 100644
--- a/libavcodec/microdvddec.c
+++ b/libavcodec/microdvddec.c
@@ -31,7 +31,7 @@ 
 #include "libavutil/bprint.h"
 #include "avcodec.h"
 #include "ass.h"
-#include "internal.h"
+#include "codec_internal.h"
 
 static int indexof(const char *s, int c)
 {
diff --git a/libavcodec/midivid.c b/libavcodec/midivid.c
index 4a3ba33f11..6f37bb05bc 100644
--- a/libavcodec/midivid.c
+++ b/libavcodec/midivid.c
@@ -32,6 +32,7 @@ 
 #include "avcodec.h"
 #include "get_bits.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct MidiVidContext {
diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c
index d3343b5da7..760fb77570 100644
--- a/libavcodec/mimic.c
+++ b/libavcodec/mimic.c
@@ -28,6 +28,7 @@ 
 
 #include "avcodec.h"
 #include "blockdsp.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "get_bits.h"
 #include "bytestream.h"
diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c
index 218be41192..77bdc8d2a6 100644
--- a/libavcodec/mjpegbdec.c
+++ b/libavcodec/mjpegbdec.c
@@ -27,7 +27,7 @@ 
 #include <inttypes.h>
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "mjpeg.h"
 #include "mjpegdec.h"
 
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 7ff6985bc4..28bd1d1c72 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -38,6 +38,7 @@ 
 #include "libavutil/opt.h"
 #include "avcodec.h"
 #include "blockdsp.h"
+#include "codec_internal.h"
 #include "copy_block.h"
 #include "decode.h"
 #include "hwconfig.h"
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index 5290bcf60c..e3d7bbcd26 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -35,6 +35,7 @@ 
 #include "libavutil/pixdesc.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "jpegtables.h"
 #include "mjpegenc_common.h"
 #include "mjpegenc_huffman.h"
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index c51e0fbed7..2abdb6f81a 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -35,6 +35,7 @@ 
 #include "libavutil/mem_internal.h"
 #include "libavutil/thread.h"
 #include "libavutil/opt.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "libavutil/crc.h"
diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c
index 2e1896d78c..56a129a960 100644
--- a/libavcodec/mlpenc.c
+++ b/libavcodec/mlpenc.c
@@ -23,8 +23,8 @@ 
 #include "config_components.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "put_bits.h"
 #include "audio_frame_queue.h"
 #include "libavutil/channel_layout.h"
diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index cd645189d9..e0b16ed117 100644
--- a/libavcodec/mmaldec.c
+++ b/libavcodec/mmaldec.c
@@ -34,6 +34,7 @@ 
 #include <stdatomic.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "hwconfig.h"
 #include "internal.h"
diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c
index 8dfcc71934..1c1fe5df18 100644
--- a/libavcodec/mmvideo.c
+++ b/libavcodec/mmvideo.c
@@ -34,6 +34,7 @@ 
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #define MM_PREAMBLE_SIZE    6
diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c
index 23d64f76f6..ced5cabccc 100644
--- a/libavcodec/mobiclip.c
+++ b/libavcodec/mobiclip.c
@@ -29,6 +29,7 @@ 
 #include "avcodec.h"
 #include "bytestream.h"
 #include "bswapdsp.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "golomb.h"
 #include "internal.h"
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index 7ac9634538..a89e678bb8 100644
--- a/libavcodec/motionpixels.c
+++ b/libavcodec/motionpixels.c
@@ -26,6 +26,7 @@ 
 #include "avcodec.h"
 #include "get_bits.h"
 #include "bswapdsp.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #define MAX_HUFF_CODES 16
diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index dc30fdc698..a8fea3b34a 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -28,7 +28,7 @@ 
 #include "libavutil/intreadwrite.h"
 #include "libavutil/mem.h"
 #include "bytestream.h"
-#include "internal.h"
+#include "codec_internal.h"
 
 #define STYLE_FLAG_BOLD         (1<<0)
 #define STYLE_FLAG_ITALIC       (1<<1)
diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c
index 221cd76fea..57dca6e464 100644
--- a/libavcodec/movtextenc.c
+++ b/libavcodec/movtextenc.c
@@ -29,7 +29,7 @@ 
 #include "ass_split.h"
 #include "ass.h"
 #include "bytestream.h"
-#include "internal.h"
+#include "codec_internal.h"
 
 #define STYLE_FLAG_BOLD         (1<<0)
 #define STYLE_FLAG_ITALIC       (1<<1)
diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c
index c3ca9cfe31..4beffe373c 100644
--- a/libavcodec/mpc7.c
+++ b/libavcodec/mpc7.c
@@ -32,6 +32,7 @@ 
 #include "libavutil/thread.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "mpegaudiodsp.h"
diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c
index a0466ec135..869b4152fa 100644
--- a/libavcodec/mpc8.c
+++ b/libavcodec/mpc8.c
@@ -29,6 +29,7 @@ 
 #include "libavutil/lfg.h"
 #include "libavutil/thread.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "mpegaudiodsp.h"
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 7791dcb5fd..715f24ff4f 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -38,6 +38,7 @@ 
 #include "libavutil/timecode.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "error_resilience.h"
 #include "hwconfig.h"
 #include "idctdsp.h"
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index 6110f117c6..c53bcacc90 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -38,6 +38,7 @@ 
 #include "libavutil/stereo3d.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "mathops.h"
 #include "mpeg12.h"
 #include "mpeg12data.h"
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 8fb5ec119e..cefec7ab3e 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -27,10 +27,10 @@ 
 #include "libavutil/internal.h"
 #include "libavutil/opt.h"
 #include "libavutil/thread.h"
+#include "codec_internal.h"
 #include "error_resilience.h"
 #include "hwconfig.h"
 #include "idctdsp.h"
-#include "internal.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
 #include "mpegvideodata.h"
diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c
index 4a4adeb1c3..2911bf7a3e 100644
--- a/libavcodec/mpeg4videoenc.c
+++ b/libavcodec/mpeg4videoenc.c
@@ -24,6 +24,7 @@ 
 #include "libavutil/log.h"
 #include "libavutil/opt.h"
 #include "libavutil/thread.h"
+#include "codec_internal.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
 #include "h263.h"
diff --git a/libavcodec/mpegaudiodec_fixed.c b/libavcodec/mpegaudiodec_fixed.c
index ac0b1f3bb3..ad401f5af6 100644
--- a/libavcodec/mpegaudiodec_fixed.c
+++ b/libavcodec/mpegaudiodec_fixed.c
@@ -24,6 +24,7 @@ 
 
 #define USE_FLOATS 0
 
+#include "codec_internal.h"
 #include "mpegaudio.h"
 
 #define SHR(a,b)       (((int)(a))>>(b))
diff --git a/libavcodec/mpegaudiodec_float.c b/libavcodec/mpegaudiodec_float.c
index 912e6d189a..bef4918a90 100644
--- a/libavcodec/mpegaudiodec_float.c
+++ b/libavcodec/mpegaudiodec_float.c
@@ -25,6 +25,7 @@ 
 
 #define USE_FLOATS 1
 
+#include "codec_internal.h"
 #include "mpegaudio.h"
 
 #define SHR(a,b)       ((a)*(1.0f/(1<<(b))))
diff --git a/libavcodec/mpegaudioenc_fixed.c b/libavcodec/mpegaudioenc_fixed.c
index 23ee61fac5..ad2aa46eb3 100644
--- a/libavcodec/mpegaudioenc_fixed.c
+++ b/libavcodec/mpegaudioenc_fixed.c
@@ -20,6 +20,7 @@ 
  */
 
 #include "libavutil/channel_layout.h"
+#include "codec_internal.h"
 #include "mpegaudioenc_template.c"
 
 const AVCodec ff_mp2fixed_encoder = {
diff --git a/libavcodec/mpegaudioenc_float.c b/libavcodec/mpegaudioenc_float.c
index 9f9b885d21..bfb12ea2b8 100644
--- a/libavcodec/mpegaudioenc_float.c
+++ b/libavcodec/mpegaudioenc_float.c
@@ -21,6 +21,7 @@ 
 
 #include "libavutil/channel_layout.h"
 #define USE_FLOATS 1
+#include "codec_internal.h"
 #include "mpegaudioenc_template.c"
 
 const AVCodec ff_mp2_encoder = {
diff --git a/libavcodec/mpl2dec.c b/libavcodec/mpl2dec.c
index 61e47050ec..5031e02c10 100644
--- a/libavcodec/mpl2dec.c
+++ b/libavcodec/mpl2dec.c
@@ -27,7 +27,7 @@ 
 
 #include "avcodec.h"
 #include "ass.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "libavutil/bprint.h"
 
 static int mpl2_event_to_ass(AVBPrint *buf, const char *p)
diff --git a/libavcodec/mscc.c b/libavcodec/mscc.c
index d9a6de094a..0b36f8e9ce 100644
--- a/libavcodec/mscc.c
+++ b/libavcodec/mscc.c
@@ -26,6 +26,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #include <zlib.h>
diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index afbeda4fac..f2eb9cbb33 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/msmpeg4dec.c
@@ -27,7 +27,7 @@ 
 #include "libavutil/thread.h"
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
 #include "msmpeg4.h"
diff --git a/libavcodec/msmpeg4enc.c b/libavcodec/msmpeg4enc.c
index c0ae4adc44..41bc3465d3 100644
--- a/libavcodec/msmpeg4enc.c
+++ b/libavcodec/msmpeg4enc.c
@@ -33,11 +33,11 @@ 
 #include "libavutil/attributes.h"
 #include "libavutil/avutil.h"
 #include "libavutil/thread.h"
+#include "codec_internal.h"
 #include "mpegvideo.h"
 #include "mpegvideoenc.h"
 #include "h263.h"
 #include "h263data.h"
-#include "internal.h"
 #include "mpeg4video.h"
 #include "msmpeg4.h"
 #include "msmpeg4data.h"
diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c
index b6f80653c1..a4c39dfacc 100644
--- a/libavcodec/msrle.c
+++ b/libavcodec/msrle.c
@@ -33,6 +33,7 @@ 
 #include <string.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "internal.h"
 #include "msrledec.h"
diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c
index a9a7a81d21..782c79076f 100644
--- a/libavcodec/mss1.c
+++ b/libavcodec/mss1.c
@@ -25,6 +25,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "mss12.h"
 
diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
index 630448ddb5..2f3ba3b34b 100644
--- a/libavcodec/mss2.c
+++ b/libavcodec/mss2.c
@@ -24,6 +24,7 @@ 
  */
 
 #include "libavutil/avassert.h"
+#include "codec_internal.h"
 #include "error_resilience.h"
 #include "internal.h"
 #include "mpeg_er.h"
diff --git a/libavcodec/mss3.c b/libavcodec/mss3.c
index 8ac2c23d35..81f3634470 100644
--- a/libavcodec/mss3.c
+++ b/libavcodec/mss3.c
@@ -26,6 +26,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "mathops.h"
 #include "mss34dsp.h"
diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c
index 216df2852d..9cedfbddb2 100644
--- a/libavcodec/mss4.c
+++ b/libavcodec/mss4.c
@@ -29,6 +29,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "jpegtables.h"
diff --git a/libavcodec/msvideo1.c b/libavcodec/msvideo1.c
index 182b3c38ad..364c35fff0 100644
--- a/libavcodec/msvideo1.c
+++ b/libavcodec/msvideo1.c
@@ -33,6 +33,7 @@ 
 #include "libavutil/internal.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "internal.h"
 
diff --git a/libavcodec/msvideo1enc.c b/libavcodec/msvideo1enc.c
index a8761bdd2e..b252de4663 100644
--- a/libavcodec/msvideo1enc.c
+++ b/libavcodec/msvideo1enc.c
@@ -25,8 +25,8 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "bytestream.h"
 #include "libavutil/lfg.h"
 #include "elbg.h"
diff --git a/libavcodec/mv30.c b/libavcodec/mv30.c
index 21f52679c0..5fc6d26a8c 100644
--- a/libavcodec/mv30.c
+++ b/libavcodec/mv30.c
@@ -28,6 +28,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "copy_block.h"
 #include "mathops.h"
 #include "blockdsp.h"
diff --git a/libavcodec/mvcdec.c b/libavcodec/mvcdec.c
index 410fd95875..83ff0bda18 100644
--- a/libavcodec/mvcdec.c
+++ b/libavcodec/mvcdec.c
@@ -30,6 +30,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct MvcContext {
diff --git a/libavcodec/mvha.c b/libavcodec/mvha.c
index 4048e4625c..8a8e0233f6 100644
--- a/libavcodec/mvha.c
+++ b/libavcodec/mvha.c
@@ -29,6 +29,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "lossless_videodsp.h"
diff --git a/libavcodec/mwsc.c b/libavcodec/mwsc.c
index b62db67ff5..b8460129c8 100644
--- a/libavcodec/mwsc.c
+++ b/libavcodec/mwsc.c
@@ -26,6 +26,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #include <zlib.h>
diff --git a/libavcodec/mxpegdec.c b/libavcodec/mxpegdec.c
index 16e586c1e9..407726fcaa 100644
--- a/libavcodec/mxpegdec.c
+++ b/libavcodec/mxpegdec.c
@@ -25,6 +25,7 @@ 
  * MxPEG decoder
  */
 
+#include "codec_internal.h"
 #include "internal.h"
 #include "mjpeg.h"
 #include "mjpegdec.h"
diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c
index 6870ffea0e..52200ac92c 100644
--- a/libavcodec/nellymoserdec.c
+++ b/libavcodec/nellymoserdec.c
@@ -39,6 +39,7 @@ 
 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "fft.h"
 #include "get_bits.h"
 #include "internal.h"
diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c
index abf7d82160..ae894d5ff3 100644
--- a/libavcodec/nellymoserenc.c
+++ b/libavcodec/nellymoserenc.c
@@ -42,9 +42,9 @@ 
 
 #include "audio_frame_queue.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "fft.h"
-#include "internal.h"
 #include "nellymoser.h"
 #include "sinewin.h"
 
diff --git a/libavcodec/notchlc.c b/libavcodec/notchlc.c
index 9dd3bf95a0..2abf38e619 100644
--- a/libavcodec/notchlc.c
+++ b/libavcodec/notchlc.c
@@ -27,6 +27,7 @@ 
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "lzf.h"
diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c
index 089ce68338..00239b4e2b 100644
--- a/libavcodec/nuv.c
+++ b/libavcodec/nuv.c
@@ -29,6 +29,7 @@ 
 #include "libavutil/lzo.h"
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "idctdsp.h"
 #include "internal.h"
 #include "rtjpeg.h"
diff --git a/libavcodec/nvenc_h264.c b/libavcodec/nvenc_h264.c
index 89e9a043fc..24942c1996 100644
--- a/libavcodec/nvenc_h264.c
+++ b/libavcodec/nvenc_h264.c
@@ -19,7 +19,7 @@ 
 #include "libavutil/internal.h"
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 
 #include "nvenc.h"
 
diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c
index c2c13bb210..d2fd1db4da 100644
--- a/libavcodec/nvenc_hevc.c
+++ b/libavcodec/nvenc_hevc.c
@@ -19,7 +19,7 @@ 
 #include "libavutil/internal.h"
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 
 #include "nvenc.h"
 
diff --git a/libavcodec/omx.c b/libavcodec/omx.c
index cec0d04b8a..bc20b1db52 100644
--- a/libavcodec/omx.c
+++ b/libavcodec/omx.c
@@ -41,8 +41,8 @@ 
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "h264.h"
-#include "internal.h"
 #include "pthread_internal.h"
 
 #ifdef OMX_SKIP64BIT
diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c
index 1d5a9487b3..401691d03e 100644
--- a/libavcodec/on2avc.c
+++ b/libavcodec/on2avc.c
@@ -27,6 +27,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "fft.h"
 #include "get_bits.h"
 #include "internal.h"
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 33f11480a7..306625f25e 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -27,7 +27,7 @@ 
 #include "config_components.h"
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "libavutil/avassert.h"
 #include "libavutil/internal.h"
 #include "libavutil/mem.h"
diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c
index 2133a4c63b..4bd9555031 100644
--- a/libavcodec/opusdec.c
+++ b/libavcodec/opusdec.c
@@ -43,6 +43,7 @@ 
 #include "libswresample/swresample.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "mathops.h"
diff --git a/libavcodec/opusenc.c b/libavcodec/opusenc.c
index a36f59bf23..b220206ab3 100644
--- a/libavcodec/opusenc.c
+++ b/libavcodec/opusenc.c
@@ -29,9 +29,9 @@ 
 #include "libavutil/float_dsp.h"
 #include "libavutil/mem_internal.h"
 #include "libavutil/opt.h"
-#include "internal.h"
 #include "bytestream.h"
 #include "audio_frame_queue.h"
+#include "codec_internal.h"
 
 typedef struct OpusEncContext {
     AVClass *av_class;
diff --git a/libavcodec/pafaudio.c b/libavcodec/pafaudio.c
index 8d0e65a829..793a30e82f 100644
--- a/libavcodec/pafaudio.c
+++ b/libavcodec/pafaudio.c
@@ -23,6 +23,7 @@ 
 #include "libavutil/intreadwrite.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "mathops.h"
 #include "paf.h"
diff --git a/libavcodec/pafvideo.c b/libavcodec/pafvideo.c
index bb5c17b6a1..91dd92edec 100644
--- a/libavcodec/pafvideo.c
+++ b/libavcodec/pafvideo.c
@@ -24,6 +24,7 @@ 
 #include "avcodec.h"
 #include "bytestream.h"
 #include "copy_block.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 
diff --git a/libavcodec/pamenc.c b/libavcodec/pamenc.c
index d2ceb33555..c81b5f2da0 100644
--- a/libavcodec/pamenc.c
+++ b/libavcodec/pamenc.c
@@ -21,8 +21,8 @@ 
 
 #include "libavutil/avassert.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 
 static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
                             const AVFrame *p, int *got_packet)
diff --git a/libavcodec/pcm-blurayenc.c b/libavcodec/pcm-blurayenc.c
index d9aba3df88..1c5b1c6cb8 100644
--- a/libavcodec/pcm-blurayenc.c
+++ b/libavcodec/pcm-blurayenc.c
@@ -21,6 +21,7 @@ 
 #include "libavutil/channel_layout.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 
diff --git a/libavcodec/pcm-dvd.c b/libavcodec/pcm-dvd.c
index 7f991bba65..3beaadd925 100644
--- a/libavcodec/pcm-dvd.c
+++ b/libavcodec/pcm-dvd.c
@@ -26,6 +26,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct PCMDVDContext {
diff --git a/libavcodec/pcm-dvdenc.c b/libavcodec/pcm-dvdenc.c
index e16c2a5fe4..4305ba99b4 100644
--- a/libavcodec/pcm-dvdenc.c
+++ b/libavcodec/pcm-dvdenc.c
@@ -22,6 +22,7 @@ 
 #include "libavutil/channel_layout.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index 51b98edae5..c8000d454e 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -31,6 +31,7 @@ 
 #include "libavutil/thread.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 #include "mathops.h"
diff --git a/libavcodec/pcxenc.c b/libavcodec/pcxenc.c
index 27ebc1b2f4..10bad080e1 100644
--- a/libavcodec/pcxenc.c
+++ b/libavcodec/pcxenc.c
@@ -29,8 +29,8 @@ 
 #include "avcodec.h"
 #include "bytestream.h"
 #include "libavutil/imgutils.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 
 static const uint32_t monoblack_pal[16] = { 0x000000, 0xFFFFFF };
 
diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c
index bdd20c914b..fe0a6e226d 100644
--- a/libavcodec/pgssubdec.c
+++ b/libavcodec/pgssubdec.c
@@ -26,6 +26,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "mathops.h"
 
diff --git a/libavcodec/photocd.c b/libavcodec/photocd.c
index 23a8994ca3..293455d1cb 100644
--- a/libavcodec/photocd.c
+++ b/libavcodec/photocd.c
@@ -35,6 +35,7 @@ 
 #include "libavutil/opt.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "thread.h"
diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c
index a07690c6d0..450cf49dea 100644
--- a/libavcodec/pixlet.c
+++ b/libavcodec/pixlet.c
@@ -27,6 +27,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "thread.h"
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index bd6feeadef..9730118814 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -33,6 +33,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "apng.h"
 #include "png.h"
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 3ebcc1e571..fc5007498b 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -20,8 +20,8 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "bytestream.h"
 #include "lossless_videoencdsp.h"
 #include "png.h"
diff --git a/libavcodec/pnmenc.c b/libavcodec/pnmenc.c
index 58337a6499..fbe26ede25 100644
--- a/libavcodec/pnmenc.c
+++ b/libavcodec/pnmenc.c
@@ -25,8 +25,8 @@ 
 #include "libavutil/imgutils.h"
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 
 static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
                             const AVFrame *p, int *got_packet)
diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c
index e3016df55d..22fd78ffd8 100644
--- a/libavcodec/proresdec2.c
+++ b/libavcodec/proresdec2.c
@@ -34,6 +34,7 @@ 
 #include "libavutil/mem_internal.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "hwconfig.h"
 #include "idctdsp.h"
diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index b7e00f2087..4f634587a9 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -30,6 +30,7 @@ 
 #include "libavutil/mem_internal.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "dct.h"
 #include "encode.h"
 #include "internal.h"
diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
index beceee621d..39cd38bcfa 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -27,12 +27,12 @@ 
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "fdctdsp.h"
 #include "put_bits.h"
 #include "profiles.h"
 #include "bytestream.h"
-#include "internal.h"
 #include "proresdata.h"
 
 #define CFACTOR_Y422 2
diff --git a/libavcodec/prosumer.c b/libavcodec/prosumer.c
index f57d8dda41..69a31ee9d1 100644
--- a/libavcodec/prosumer.c
+++ b/libavcodec/prosumer.c
@@ -30,6 +30,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct ProSumerContext {
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 5adc3c43a3..41cf03d91f 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -32,7 +32,7 @@ 
 #include "libavutil/thread.h"
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "pthread_internal.h"
 #include "thread.h"
 
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index 6f648f6034..41ad3c76f5 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -28,6 +28,7 @@ 
 #include <stdint.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "hwconfig.h"
 #include "internal.h"
 #include "pthread_internal.h"
diff --git a/libavcodec/pthread_slice.c b/libavcodec/pthread_slice.c
index 86411b21be..2645eb4cdc 100644
--- a/libavcodec/pthread_slice.c
+++ b/libavcodec/pthread_slice.c
@@ -25,6 +25,7 @@ 
 #include "config.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "pthread_internal.h"
 #include "thread.h"
diff --git a/libavcodec/qcelpdec.c b/libavcodec/qcelpdec.c
index 9f3ef309db..1114dd750a 100644
--- a/libavcodec/qcelpdec.c
+++ b/libavcodec/qcelpdec.c
@@ -33,6 +33,7 @@ 
 #include "libavutil/channel_layout.h"
 #include "libavutil/float_dsp.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "get_bits.h"
 #include "qcelpdata.h"
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index de68e651cd..a167e2b25a 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -43,6 +43,7 @@ 
 #include "avcodec.h"
 #include "get_bits.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "mpegaudio.h"
 #include "mpegaudiodsp.h"
diff --git a/libavcodec/qdmc.c b/libavcodec/qdmc.c
index 4827c02269..9e467246a3 100644
--- a/libavcodec/qdmc.c
+++ b/libavcodec/qdmc.c
@@ -31,6 +31,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c
index 829e08aba1..14d9ea945e 100644
--- a/libavcodec/qpeg.c
+++ b/libavcodec/qpeg.c
@@ -26,6 +26,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "internal.h"
 
diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
index bec3633268..ec9dd9fded 100644
--- a/libavcodec/qsvenc_h264.c
+++ b/libavcodec/qsvenc_h264.c
@@ -30,7 +30,7 @@ 
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "qsv.h"
 #include "qsv_internal.h"
 #include "qsvenc.h"
diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c
index ade546d4ca..84f41336b5 100644
--- a/libavcodec/qsvenc_hevc.c
+++ b/libavcodec/qsvenc_hevc.c
@@ -29,11 +29,11 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "hevc.h"
 #include "hevcdec.h"
 #include "h2645_parse.h"
-#include "internal.h"
 #include "qsv.h"
 #include "qsv_internal.h"
 #include "qsvenc.h"
diff --git a/libavcodec/qsvenc_jpeg.c b/libavcodec/qsvenc_jpeg.c
index dd082692be..1aa63b7f7d 100644
--- a/libavcodec/qsvenc_jpeg.c
+++ b/libavcodec/qsvenc_jpeg.c
@@ -28,7 +28,7 @@ 
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "qsv.h"
 #include "qsv_internal.h"
 #include "qsvenc.h"
diff --git a/libavcodec/qsvenc_mpeg2.c b/libavcodec/qsvenc_mpeg2.c
index 525df99e50..0d7c510b84 100644
--- a/libavcodec/qsvenc_mpeg2.c
+++ b/libavcodec/qsvenc_mpeg2.c
@@ -28,7 +28,7 @@ 
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "qsv.h"
 #include "qsv_internal.h"
 #include "qsvenc.h"
diff --git a/libavcodec/qsvenc_vp9.c b/libavcodec/qsvenc_vp9.c
index 1168ddda0e..b8fea9e3a7 100644
--- a/libavcodec/qsvenc_vp9.c
+++ b/libavcodec/qsvenc_vp9.c
@@ -28,7 +28,7 @@ 
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "qsv.h"
 #include "qsv_internal.h"
 #include "qsvenc.h"
diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
index d6c5eaec16..d5092f87c4 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -38,6 +38,7 @@ 
 #include "avcodec.h"
 #include "decode.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct QtrleContext {
diff --git a/libavcodec/qtrleenc.c b/libavcodec/qtrleenc.c
index fd131995b3..d02fd4f415 100644
--- a/libavcodec/qtrleenc.c
+++ b/libavcodec/qtrleenc.c
@@ -25,8 +25,8 @@ 
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 
 /** Maximum RLE code for bulk copy */
 #define MAX_RLE_BULK   127
diff --git a/libavcodec/r210dec.c b/libavcodec/r210dec.c
index 3acb5e58c7..77ccf724d8 100644
--- a/libavcodec/r210dec.c
+++ b/libavcodec/r210dec.c
@@ -21,6 +21,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "config_components.h"
 #include "internal.h"
 #include "libavutil/bswap.h"
diff --git a/libavcodec/r210enc.c b/libavcodec/r210enc.c
index cd349f3b4f..ef0d00b97a 100644
--- a/libavcodec/r210enc.c
+++ b/libavcodec/r210enc.c
@@ -23,6 +23,7 @@ 
 #include "config_components.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 #include "bytestream.h"
diff --git a/libavcodec/ra144dec.c b/libavcodec/ra144dec.c
index 86d0d6e889..3d5aacb0a6 100644
--- a/libavcodec/ra144dec.c
+++ b/libavcodec/ra144dec.c
@@ -24,6 +24,7 @@ 
 
 #include "libavutil/channel_layout.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "ra144.h"
diff --git a/libavcodec/ra144enc.c b/libavcodec/ra144enc.c
index 19d46ffe0c..7fec6cac7a 100644
--- a/libavcodec/ra144enc.c
+++ b/libavcodec/ra144enc.c
@@ -31,8 +31,8 @@ 
 #include "avcodec.h"
 #include "audio_frame_queue.h"
 #include "celp_filters.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "mathops.h"
 #include "put_bits.h"
 #include "ra144.h"
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index 424601991a..51976e0481 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -27,6 +27,7 @@ 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
 #include "celp_filters.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "lpc.h"
diff --git a/libavcodec/ralf.c b/libavcodec/ralf.c
index c4fd586296..1c8bc29cb2 100644
--- a/libavcodec/ralf.c
+++ b/libavcodec/ralf.c
@@ -29,6 +29,7 @@ 
 #include "libavutil/attributes.h"
 #include "libavutil/channel_layout.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "golomb.h"
 #include "internal.h"
diff --git a/libavcodec/rasc.c b/libavcodec/rasc.c
index b328e219bb..5c97f0aaed 100644
--- a/libavcodec/rasc.c
+++ b/libavcodec/rasc.c
@@ -29,6 +29,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #include <zlib.h>
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index 9724cce13f..872bad75b9 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -26,6 +26,7 @@ 
 
 #include "avcodec.h"
 #include "bswapdsp.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "get_bits.h"
 #include "internal.h"
diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c
index 561d992a46..01ce3dd7d0 100644
--- a/libavcodec/rawenc.c
+++ b/libavcodec/rawenc.c
@@ -25,6 +25,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "raw.h"
 #include "internal.h"
diff --git a/libavcodec/realtextdec.c b/libavcodec/realtextdec.c
index 11b586d493..38d21d1f15 100644
--- a/libavcodec/realtextdec.c
+++ b/libavcodec/realtextdec.c
@@ -26,7 +26,7 @@ 
 
 #include "avcodec.h"
 #include "ass.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "libavutil/avstring.h"
 #include "libavutil/bprint.h"
 
diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c
index 4d13aec0c9..a51dcfb40f 100644
--- a/libavcodec/rl2.c
+++ b/libavcodec/rl2.c
@@ -34,6 +34,7 @@ 
 #include "libavutil/intreadwrite.h"
 #include "libavutil/mem.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 
diff --git a/libavcodec/roqaudioenc.c b/libavcodec/roqaudioenc.c
index d482fd213a..ad127e0a7a 100644
--- a/libavcodec/roqaudioenc.c
+++ b/libavcodec/roqaudioenc.c
@@ -23,8 +23,8 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "mathops.h"
 
 #define ROQ_FRAME_SIZE           735
diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c
index a3217035e3..3496ce7bbf 100644
--- a/libavcodec/roqvideodec.c
+++ b/libavcodec/roqvideodec.c
@@ -30,6 +30,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "roqvideo.h"
 
diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c
index 95012f7c1a..3098ccee20 100644
--- a/libavcodec/roqvideoenc.c
+++ b/libavcodec/roqvideoenc.c
@@ -61,6 +61,7 @@ 
 #include "libavutil/opt.h"
 #include "roqvideo.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "elbg.h"
 #include "encode.h"
 #include "internal.h"
diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c
index 270cfcc979..9871715902 100644
--- a/libavcodec/rpza.c
+++ b/libavcodec/rpza.c
@@ -42,6 +42,7 @@ 
 #include "libavutil/internal.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct RpzaContext {
diff --git a/libavcodec/rpzaenc.c b/libavcodec/rpzaenc.c
index 337b1faf5b..6846020d7e 100644
--- a/libavcodec/rpzaenc.c
+++ b/libavcodec/rpzaenc.c
@@ -28,8 +28,8 @@ 
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "put_bits.h"
 
 typedef struct RpzaContext {
diff --git a/libavcodec/rscc.c b/libavcodec/rscc.c
index 0ec54ac1b0..9470074fc9 100644
--- a/libavcodec/rscc.c
+++ b/libavcodec/rscc.c
@@ -43,6 +43,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "internal.h"
 
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index c0adcf8853..c92e6d80c4 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -31,6 +31,7 @@ 
 #include "libavutil/thread.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "error_resilience.h"
 #include "h263.h"
 #include "h263data.h"
diff --git a/libavcodec/rv10enc.c b/libavcodec/rv10enc.c
index a9922bda50..20168c96ee 100644
--- a/libavcodec/rv10enc.c
+++ b/libavcodec/rv10enc.c
@@ -25,6 +25,7 @@ 
  * RV10 encoder
  */
 
+#include "codec_internal.h"
 #include "mpegvideo.h"
 #include "mpegvideoenc.h"
 #include "put_bits.h"
diff --git a/libavcodec/rv20enc.c b/libavcodec/rv20enc.c
index 1baeea0b7d..21610fd3aa 100644
--- a/libavcodec/rv20enc.c
+++ b/libavcodec/rv20enc.c
@@ -25,6 +25,7 @@ 
  * RV20 encoder
  */
 
+#include "codec_internal.h"
 #include "mpegvideo.h"
 #include "mpegvideodata.h"
 #include "mpegvideoenc.h"
diff --git a/libavcodec/rv30.c b/libavcodec/rv30.c
index 7b9a5af9df..a5c348b29a 100644
--- a/libavcodec/rv30.c
+++ b/libavcodec/rv30.c
@@ -25,7 +25,7 @@ 
  */
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
 #include "mpegvideodec.h"
diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c
index 868d28096e..4fed7492ff 100644
--- a/libavcodec/rv40.c
+++ b/libavcodec/rv40.c
@@ -30,7 +30,7 @@ 
 #include "libavutil/thread.h"
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
 #include "mpegvideodec.h"
diff --git a/libavcodec/s302menc.c b/libavcodec/s302menc.c
index 56db25c76b..5f2c682a5d 100644
--- a/libavcodec/s302menc.c
+++ b/libavcodec/s302menc.c
@@ -22,8 +22,8 @@ 
 
 #include "libavutil/channel_layout.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "mathops.h"
 #include "put_bits.h"
 
diff --git a/libavcodec/samidec.c b/libavcodec/samidec.c
index 32d07447b4..b5cd2745f3 100644
--- a/libavcodec/samidec.c
+++ b/libavcodec/samidec.c
@@ -27,8 +27,8 @@ 
 #include "ass.h"
 #include "libavutil/avstring.h"
 #include "libavutil/bprint.h"
+#include "codec_internal.h"
 #include "htmlsubtitles.h"
-#include "internal.h"
 
 typedef struct {
     AVBPrint source;
diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c
index 9506bbe04c..aaac47892e 100644
--- a/libavcodec/sanm.c
+++ b/libavcodec/sanm.c
@@ -27,6 +27,7 @@ 
 #include "avcodec.h"
 #include "bytestream.h"
 #include "copy_block.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #define NGLYPHS 256
diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c
index 1c053ad9a7..8662e33da6 100644
--- a/libavcodec/sbcdec.c
+++ b/libavcodec/sbcdec.c
@@ -31,6 +31,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/channel_layout.h"
 #include "libavutil/intreadwrite.h"
diff --git a/libavcodec/sbcenc.c b/libavcodec/sbcenc.c
index cff93e8917..59fa82d2ed 100644
--- a/libavcodec/sbcenc.c
+++ b/libavcodec/sbcenc.c
@@ -33,8 +33,8 @@ 
 #include "libavutil/channel_layout.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "profiles.h"
 #include "put_bits.h"
 #include "sbc.h"
diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c
index ba6e849c66..539425d95c 100644
--- a/libavcodec/scpr.c
+++ b/libavcodec/scpr.c
@@ -26,6 +26,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "scpr.h"
 #include "scpr3.h"
diff --git a/libavcodec/screenpresso.c b/libavcodec/screenpresso.c
index dd4df6d405..fd0d469cfd 100644
--- a/libavcodec/screenpresso.c
+++ b/libavcodec/screenpresso.c
@@ -42,6 +42,7 @@ 
 #include "libavutil/mem.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct ScreenpressoContext {
diff --git a/libavcodec/sga.c b/libavcodec/sga.c
index 1bc6b0b140..6a594feb2b 100644
--- a/libavcodec/sga.c
+++ b/libavcodec/sga.c
@@ -22,6 +22,7 @@ 
 #include "avcodec.h"
 #include "get_bits.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #define PALDATA_FOLLOWS_TILEDATA 4
diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c
index 5fa3bf4a41..c7caeff622 100644
--- a/libavcodec/sgidec.c
+++ b/libavcodec/sgidec.c
@@ -22,6 +22,7 @@ 
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "sgi.h"
 
diff --git a/libavcodec/sgienc.c b/libavcodec/sgienc.c
index 5ed5e71cdc..329b0bfb1f 100644
--- a/libavcodec/sgienc.c
+++ b/libavcodec/sgienc.c
@@ -23,8 +23,8 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "sgi.h"
 #include "rle.h"
 
diff --git a/libavcodec/sgirledec.c b/libavcodec/sgirledec.c
index aa5107fe22..94d1c36818 100644
--- a/libavcodec/sgirledec.c
+++ b/libavcodec/sgirledec.c
@@ -29,6 +29,7 @@ 
 #include "libavutil/common.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 static av_cold int sgirle_decode_init(AVCodecContext *avctx)
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 6cce675c9f..df50d996c3 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -29,6 +29,7 @@ 
 #include "avcodec.h"
 #include "bswapdsp.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "golomb.h"
 #include "internal.h"
diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c
index 6c7293b6ec..447e2448be 100644
--- a/libavcodec/sipr.c
+++ b/libavcodec/sipr.c
@@ -31,6 +31,7 @@ 
 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "lsp.h"
diff --git a/libavcodec/siren.c b/libavcodec/siren.c
index add1773069..f8f5b26336 100644
--- a/libavcodec/siren.c
+++ b/libavcodec/siren.c
@@ -27,6 +27,7 @@ 
 #include "libavutil/mem_internal.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "mathops.h"
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 4a3999e4f1..d77d91f49e 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -50,6 +50,7 @@ 
 #endif
 #define BITSTREAM_READER_LE
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "mathops.h"
diff --git a/libavcodec/smc.c b/libavcodec/smc.c
index 9cd86216a2..41df4bf7b3 100644
--- a/libavcodec/smc.c
+++ b/libavcodec/smc.c
@@ -35,6 +35,7 @@ 
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "internal.h"
 
diff --git a/libavcodec/smcenc.c b/libavcodec/smcenc.c
index 52795efb5f..6b91019e0a 100644
--- a/libavcodec/smcenc.c
+++ b/libavcodec/smcenc.c
@@ -27,8 +27,8 @@ 
 #include "libavutil/common.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "bytestream.h"
 
 #define CPAIR 2
diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index d54036e02b..ab7989f4d6 100644
--- a/libavcodec/snowdec.c
+++ b/libavcodec/snowdec.c
@@ -22,8 +22,8 @@ 
 #include "libavutil/log.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "snow_dwt.h"
-#include "internal.h"
 #include "snow.h"
 
 #include "rangecoder.h"
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index e169ae601d..1733c33dab 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -24,8 +24,8 @@ 
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "packet_internal.h"
 #include "snow_dwt.h"
 #include "snow.h"
diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c
index e4d44ea4d2..16a19b3419 100644
--- a/libavcodec/sonic.c
+++ b/libavcodec/sonic.c
@@ -22,6 +22,7 @@ 
 #include "config_components.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "get_bits.h"
 #include "golomb.h"
diff --git a/libavcodec/sp5xdec.c b/libavcodec/sp5xdec.c
index e17e0d97b9..e00cf834e9 100644
--- a/libavcodec/sp5xdec.c
+++ b/libavcodec/sp5xdec.c
@@ -27,7 +27,7 @@ 
 #include "config_components.h"
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "mjpeg.h"
 #include "mjpegdec.h"
 #include "sp5x.h"
diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c
index 77c5e46e4b..8c181466bd 100644
--- a/libavcodec/speedhq.c
+++ b/libavcodec/speedhq.c
@@ -33,6 +33,7 @@ 
 
 #include "avcodec.h"
 #include "blockdsp.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "idctdsp.h"
 #include "internal.h"
diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c
index cd7b6e1763..6a1912a751 100644
--- a/libavcodec/speedhqenc.c
+++ b/libavcodec/speedhqenc.c
@@ -32,6 +32,7 @@ 
 #include "libavutil/thread.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "mpeg12data.h"
 #include "mpeg12enc.h"
 #include "mpegvideo.h"
diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c
index 7b482f5390..1fa1b20bb6 100644
--- a/libavcodec/speexdec.c
+++ b/libavcodec/speexdec.c
@@ -55,6 +55,7 @@ 
 #include "libavutil/float_dsp.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "speexdata.h"
diff --git a/libavcodec/srtdec.c b/libavcodec/srtdec.c
index f7c131ff3d..20d47931d0 100644
--- a/libavcodec/srtdec.c
+++ b/libavcodec/srtdec.c
@@ -27,8 +27,8 @@ 
 #include "libavutil/parseutils.h"
 #include "avcodec.h"
 #include "ass.h"
+#include "codec_internal.h"
 #include "htmlsubtitles.h"
-#include "internal.h"
 
 static int srt_to_ass(AVCodecContext *avctx, AVBPrint *dst,
                        const char *in, int x1, int y1, int x2, int y2)
diff --git a/libavcodec/srtenc.c b/libavcodec/srtenc.c
index 508770e319..7864ea3386 100644
--- a/libavcodec/srtenc.c
+++ b/libavcodec/srtenc.c
@@ -27,7 +27,7 @@ 
 #include "libavutil/bprint.h"
 #include "ass_split.h"
 #include "ass.h"
-#include "internal.h"
+#include "codec_internal.h"
 
 
 #define SRT_STACK_SIZE 64
diff --git a/libavcodec/subviewerdec.c b/libavcodec/subviewerdec.c
index 5c650d0cde..d5b6381aec 100644
--- a/libavcodec/subviewerdec.c
+++ b/libavcodec/subviewerdec.c
@@ -26,7 +26,7 @@ 
 
 #include "avcodec.h"
 #include "ass.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "libavutil/bprint.h"
 
 static int subviewer_event_to_ass(AVBPrint *buf, const char *p)
diff --git a/libavcodec/sunrastenc.c b/libavcodec/sunrastenc.c
index 965ee5b818..8057844511 100644
--- a/libavcodec/sunrastenc.c
+++ b/libavcodec/sunrastenc.c
@@ -23,8 +23,8 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "sunrast.h"
 
 typedef struct SUNRASTContext {
diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
index a2b3f71c07..02cf3e30c0 100644
--- a/libavcodec/svq1dec.c
+++ b/libavcodec/svq1dec.c
@@ -36,6 +36,7 @@ 
 #include "libavutil/thread.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "h263data.h"
 #include "hpeldsp.h"
diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index 9cef3d8ef6..8e8834e4e8 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -27,6 +27,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "hpeldsp.h"
 #include "me_cmp.h"
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index da61617f4e..8977f1afc5 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -46,6 +46,7 @@ 
 #include "libavutil/crc.h"
 #include "libavutil/mem_internal.h"
 
+#include "codec_internal.h"
 #include "internal.h"
 #include "avcodec.h"
 #include "mpegutils.h"
diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c
index 8bd8a55fd2..57ebb978b7 100644
--- a/libavcodec/takdec.c
+++ b/libavcodec/takdec.c
@@ -33,7 +33,7 @@ 
 #include "audiodsp.h"
 #include "thread.h"
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "unary.h"
 #include "tak.h"
 #include "takdsp.h"
diff --git a/libavcodec/targa_y216dec.c b/libavcodec/targa_y216dec.c
index 93b5148a18..d46292513a 100644
--- a/libavcodec/targa_y216dec.c
+++ b/libavcodec/targa_y216dec.c
@@ -20,6 +20,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 static av_cold int y216_decode_init(AVCodecContext *avctx)
diff --git a/libavcodec/targaenc.c b/libavcodec/targaenc.c
index cf1733bb2d..7d2ff60362 100644
--- a/libavcodec/targaenc.c
+++ b/libavcodec/targaenc.c
@@ -27,8 +27,8 @@ 
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "rle.h"
 #include "targa.h"
 
diff --git a/libavcodec/tdsc.c b/libavcodec/tdsc.c
index 79bdc422e1..a0ae9f1383 100644
--- a/libavcodec/tdsc.c
+++ b/libavcodec/tdsc.c
@@ -40,6 +40,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #define BITMAPINFOHEADER_SIZE 0x28
diff --git a/libavcodec/tests/avcodec.c b/libavcodec/tests/avcodec.c
index 006fd1ade9..b77d7c4bdc 100644
--- a/libavcodec/tests/avcodec.c
+++ b/libavcodec/tests/avcodec.c
@@ -19,6 +19,7 @@ 
 #include "libavutil/opt.h"
 #include "libavcodec/codec.h"
 #include "libavcodec/codec_desc.h"
+#include "libavcodec/codec_internal.h"
 #include "libavcodec/internal.h"
 
 static const char *get_type_string(enum AVMediaType type)
diff --git a/libavcodec/textdec.c b/libavcodec/textdec.c
index 420fcd1b14..690c0bbaad 100644
--- a/libavcodec/textdec.c
+++ b/libavcodec/textdec.c
@@ -27,7 +27,7 @@ 
 
 #include "avcodec.h"
 #include "ass.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "libavutil/bprint.h"
 #include "libavutil/opt.h"
 
diff --git a/libavcodec/tiertexseqv.c b/libavcodec/tiertexseqv.c
index 7170eb3155..6648fc4554 100644
--- a/libavcodec/tiertexseqv.c
+++ b/libavcodec/tiertexseqv.c
@@ -26,6 +26,7 @@ 
 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index e46a80e3ed..5e5cea42fe 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -41,6 +41,7 @@ 
 #include "libavutil/opt.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "faxcompr.h"
 #include "internal.h"
 #include "lzw.h"
diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c
index d350a5b826..2152d35f60 100644
--- a/libavcodec/tiffenc.c
+++ b/libavcodec/tiffenc.c
@@ -36,8 +36,8 @@ 
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "lzw.h"
 #include "put_bits.h"
 #include "rle.h"
diff --git a/libavcodec/tmv.c b/libavcodec/tmv.c
index 67aeb23665..5325c246de 100644
--- a/libavcodec/tmv.c
+++ b/libavcodec/tmv.c
@@ -29,6 +29,7 @@ 
 #include <string.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/internal.h"
 #include "libavutil/xga_font_data.h"
diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c
index 32d8fb4005..f14399a9ac 100644
--- a/libavcodec/truemotion1.c
+++ b/libavcodec/truemotion1.c
@@ -34,6 +34,7 @@ 
 #include <string.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/internal.h"
diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index f29db593f9..0ceeeade5e 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -29,6 +29,7 @@ 
 #include "avcodec.h"
 #include "bswapdsp.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/truemotion2rt.c b/libavcodec/truemotion2rt.c
index b6a19581a9..ef0fccfcc3 100644
--- a/libavcodec/truemotion2rt.c
+++ b/libavcodec/truemotion2rt.c
@@ -28,6 +28,7 @@ 
 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c
index 30a7e86a75..ad51e9096e 100644
--- a/libavcodec/truespeech.c
+++ b/libavcodec/truespeech.c
@@ -25,6 +25,7 @@ 
 
 #include "avcodec.h"
 #include "bswapdsp.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c
index 841f0c0d14..11f3b85637 100644
--- a/libavcodec/tscc.c
+++ b/libavcodec/tscc.c
@@ -38,6 +38,7 @@ 
 #include <stdlib.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "decode.h"
 #include "internal.h"
 #include "msrledec.h"
diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c
index 419a7775b3..bb8c95e65e 100644
--- a/libavcodec/tscc2.c
+++ b/libavcodec/tscc2.c
@@ -31,6 +31,7 @@ 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 #include "mathops.h"
diff --git a/libavcodec/tta.c b/libavcodec/tta.c
index 0291017eeb..18b7755c8d 100644
--- a/libavcodec/tta.c
+++ b/libavcodec/tta.c
@@ -38,10 +38,10 @@ 
 #include "ttadata.h"
 #include "ttadsp.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "thread.h"
 #include "unary.h"
-#include "internal.h"
 
 #define FORMAT_SIMPLE    1
 #define FORMAT_ENCRYPTED 2
diff --git a/libavcodec/ttaenc.c b/libavcodec/ttaenc.c
index 5717ec22d1..aefa2bee00 100644
--- a/libavcodec/ttaenc.c
+++ b/libavcodec/ttaenc.c
@@ -22,6 +22,7 @@ 
 #include "ttadata.h"
 #include "ttaencdsp.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "put_bits.h"
 #include "internal.h"
diff --git a/libavcodec/ttmlenc.c b/libavcodec/ttmlenc.c
index ad2eddfdd5..90766f8ea1 100644
--- a/libavcodec/ttmlenc.c
+++ b/libavcodec/ttmlenc.c
@@ -28,7 +28,7 @@ 
  */
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "libavutil/avstring.h"
 #include "libavutil/bprint.h"
 #include "libavutil/internal.h"
diff --git a/libavcodec/twinvqdec.c b/libavcodec/twinvqdec.c
index 0e35110150..5625d05fae 100644
--- a/libavcodec/twinvqdec.c
+++ b/libavcodec/twinvqdec.c
@@ -24,8 +24,8 @@ 
 
 #include "libavutil/channel_layout.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
-#include "internal.h"
 #include "twinvq.h"
 #include "metasound_data.h"
 #include "twinvq_data.h"
diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c
index 55548ae3f6..9f0f3d4cdf 100644
--- a/libavcodec/ulti.c
+++ b/libavcodec/ulti.c
@@ -30,6 +30,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #include "ulti_cb.h"
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index fe2db93782..b18af6d0a8 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -35,6 +35,7 @@ 
 #include "libavutil/pixfmt.h"
 #include "avcodec.h"
 #include "codec.h"
+#include "codec_internal.h"
 #include "hwconfig.h"
 #include "thread.h"
 #include "threadframe.h"
diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c
index a824112415..30e17ad2c5 100644
--- a/libavcodec/utvideodec.c
+++ b/libavcodec/utvideodec.c
@@ -35,8 +35,8 @@ 
 #include "avcodec.h"
 #include "bswapdsp.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
-#include "internal.h"
 #include "thread.h"
 #include "utvideo.h"
 
diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c
index 30907faa0f..44adf09286 100644
--- a/libavcodec/utvideoenc.c
+++ b/libavcodec/utvideoenc.c
@@ -29,8 +29,8 @@ 
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "bswapdsp.h"
 #include "bytestream.h"
 #include "put_bits.h"
diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c
index 19dd4eeeec..38a60eee35 100644
--- a/libavcodec/v210dec.c
+++ b/libavcodec/v210dec.c
@@ -22,7 +22,7 @@ 
  */
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "v210dec.h"
 #include "libavutil/bswap.h"
 #include "libavutil/internal.h"
diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c
index 16c4f82cf2..025bede3f1 100644
--- a/libavcodec/v210enc.c
+++ b/libavcodec/v210enc.c
@@ -23,6 +23,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 #include "v210enc.h"
diff --git a/libavcodec/v210x.c b/libavcodec/v210x.c
index 797f229a28..9ac57938f4 100644
--- a/libavcodec/v210x.c
+++ b/libavcodec/v210x.c
@@ -19,6 +19,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/bswap.h"
 #include "libavutil/internal.h"
diff --git a/libavcodec/v308dec.c b/libavcodec/v308dec.c
index d059474b36..af69a43a26 100644
--- a/libavcodec/v308dec.c
+++ b/libavcodec/v308dec.c
@@ -20,6 +20,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 static av_cold int v308_decode_init(AVCodecContext *avctx)
diff --git a/libavcodec/v308enc.c b/libavcodec/v308enc.c
index 85fb20729f..533583b0db 100644
--- a/libavcodec/v308enc.c
+++ b/libavcodec/v308enc.c
@@ -22,6 +22,7 @@ 
 
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 
diff --git a/libavcodec/v408dec.c b/libavcodec/v408dec.c
index f1b84421b1..215a3a1efd 100644
--- a/libavcodec/v408dec.c
+++ b/libavcodec/v408dec.c
@@ -22,6 +22,7 @@ 
 #include "config_components.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 static av_cold int v408_decode_init(AVCodecContext *avctx)
diff --git a/libavcodec/v408enc.c b/libavcodec/v408enc.c
index 50766772c2..2077bebca8 100644
--- a/libavcodec/v408enc.c
+++ b/libavcodec/v408enc.c
@@ -24,6 +24,7 @@ 
 
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 
diff --git a/libavcodec/v410dec.c b/libavcodec/v410dec.c
index ecf3ae2053..2cb3973e85 100644
--- a/libavcodec/v410dec.c
+++ b/libavcodec/v410dec.c
@@ -23,7 +23,7 @@ 
 #include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "thread.h"
 
 typedef struct ThreadData {
diff --git a/libavcodec/v410enc.c b/libavcodec/v410enc.c
index d14ecd5d27..54362a258c 100644
--- a/libavcodec/v410enc.c
+++ b/libavcodec/v410enc.c
@@ -23,6 +23,7 @@ 
 #include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 
diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c
index b0c3d30ac8..2c5a22a976 100644
--- a/libavcodec/v4l2_m2m_dec.c
+++ b/libavcodec/v4l2_m2m_dec.c
@@ -27,8 +27,8 @@ 
 #include "libavutil/pixdesc.h"
 #include "libavutil/opt.h"
 #include "libavcodec/avcodec.h"
+#include "codec_internal.h"
 #include "libavcodec/decode.h"
-#include "libavcodec/internal.h"
 
 #include "v4l2_context.h"
 #include "v4l2_m2m.h"
diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
index 043fe80c69..feccfe4911 100644
--- a/libavcodec/v4l2_m2m_enc.c
+++ b/libavcodec/v4l2_m2m_enc.c
@@ -26,10 +26,10 @@ 
 #include <search.h>
 #include "encode.h"
 #include "libavcodec/avcodec.h"
-#include "libavcodec/internal.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/pixfmt.h"
 #include "libavutil/opt.h"
+#include "codec_internal.h"
 #include "profiles.h"
 #include "v4l2_context.h"
 #include "v4l2_m2m.h"
diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index 1ca885fdbc..6ca6a63eec 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -29,10 +29,10 @@ 
 #include "avcodec.h"
 #include "cbs.h"
 #include "cbs_h264.h"
+#include "codec_internal.h"
 #include "h264.h"
 #include "h264_levels.h"
 #include "h264_sei.h"
-#include "internal.h"
 #include "vaapi_encode.h"
 #include "version.h"
 
diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c
index e1dc53dfa9..9d917f7ff4 100644
--- a/libavcodec/vaapi_encode_h265.c
+++ b/libavcodec/vaapi_encode_h265.c
@@ -30,10 +30,10 @@ 
 #include "avcodec.h"
 #include "cbs.h"
 #include "cbs_h265.h"
+#include "codec_internal.h"
 #include "h265_profile_level.h"
 #include "hevc.h"
 #include "hevc_sei.h"
-#include "internal.h"
 #include "put_bits.h"
 #include "vaapi_encode.h"
 
diff --git a/libavcodec/vaapi_encode_mjpeg.c b/libavcodec/vaapi_encode_mjpeg.c
index 6206b23e5f..6ba400975c 100644
--- a/libavcodec/vaapi_encode_mjpeg.c
+++ b/libavcodec/vaapi_encode_mjpeg.c
@@ -29,7 +29,7 @@ 
 #include "bytestream.h"
 #include "cbs.h"
 #include "cbs_jpeg.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "jpegtables.h"
 #include "mjpeg.h"
 #include "put_bits.h"
diff --git a/libavcodec/vaapi_encode_mpeg2.c b/libavcodec/vaapi_encode_mpeg2.c
index d084d8c4b9..c0289139cb 100644
--- a/libavcodec/vaapi_encode_mpeg2.c
+++ b/libavcodec/vaapi_encode_mpeg2.c
@@ -25,7 +25,7 @@ 
 #include "avcodec.h"
 #include "cbs.h"
 #include "cbs_mpeg2.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "mpeg12.h"
 #include "vaapi_encode.h"
 
diff --git a/libavcodec/vaapi_encode_vp8.c b/libavcodec/vaapi_encode_vp8.c
index 7d4578f674..d1d086f60b 100644
--- a/libavcodec/vaapi_encode_vp8.c
+++ b/libavcodec/vaapi_encode_vp8.c
@@ -26,7 +26,7 @@ 
 #include "libavutil/pixfmt.h"
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "vaapi_encode.h"
 #include "vp8.h"
 
diff --git a/libavcodec/vaapi_encode_vp9.c b/libavcodec/vaapi_encode_vp9.c
index be706e3bd6..5a60d2b7c1 100644
--- a/libavcodec/vaapi_encode_vp9.c
+++ b/libavcodec/vaapi_encode_vp9.c
@@ -26,7 +26,7 @@ 
 #include "libavutil/pixfmt.h"
 
 #include "avcodec.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "vaapi_encode.h"
 
 #define VP9_MAX_QUANT 255
diff --git a/libavcodec/vb.c b/libavcodec/vb.c
index eac2427ce3..0d09e8567b 100644
--- a/libavcodec/vb.c
+++ b/libavcodec/vb.c
@@ -29,6 +29,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 enum VBFlags {
diff --git a/libavcodec/vble.c b/libavcodec/vble.c
index bb542bef42..7118c4d67f 100644
--- a/libavcodec/vble.c
+++ b/libavcodec/vble.c
@@ -28,8 +28,8 @@ 
 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
-#include "internal.h"
 #include "lossless_videodsp.h"
 #include "mathops.h"
 #include "thread.h"
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 1c92b9d401..73a96690c0 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -30,6 +30,7 @@ 
 
 #include "avcodec.h"
 #include "blockdsp.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "hwconfig.h"
 #include "internal.h"
diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c
index 6b77c67844..ed00648101 100644
--- a/libavcodec/vc2enc.c
+++ b/libavcodec/vc2enc.c
@@ -22,10 +22,10 @@ 
 #include "libavutil/pixdesc.h"
 #include "libavutil/opt.h"
 #include "libavutil/version.h"
+#include "codec_internal.h"
 #include "dirac.h"
 #include "encode.h"
 #include "put_bits.h"
-#include "internal.h"
 #include "version.h"
 
 #include "vc2enc_dwt.h"
diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c
index 996c9118a2..f0f7b7425d 100644
--- a/libavcodec/vcr1.c
+++ b/libavcodec/vcr1.c
@@ -25,6 +25,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/avassert.h"
 #include "libavutil/internal.h"
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 418ff00b8d..95be432666 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -30,6 +30,7 @@ 
 #include "libavcodec/avcodec.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/hwcontext_videotoolbox.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include <pthread.h>
 #include "atsc_a53.h"
diff --git a/libavcodec/vima.c b/libavcodec/vima.c
index 5053feda90..f181e2d197 100644
--- a/libavcodec/vima.c
+++ b/libavcodec/vima.c
@@ -30,6 +30,7 @@ 
 
 #include "adpcm_data.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/vmdaudio.c b/libavcodec/vmdaudio.c
index 5e04686cb1..69b8494a8a 100644
--- a/libavcodec/vmdaudio.c
+++ b/libavcodec/vmdaudio.c
@@ -41,6 +41,7 @@ 
 #include "libavutil/intreadwrite.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #define BLOCK_TYPE_AUDIO    1
diff --git a/libavcodec/vmdvideo.c b/libavcodec/vmdvideo.c
index e0349cba6a..29b1439a9d 100644
--- a/libavcodec/vmdvideo.c
+++ b/libavcodec/vmdvideo.c
@@ -39,6 +39,7 @@ 
 #include "libavutil/intreadwrite.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "bytestream.h"
 
diff --git a/libavcodec/vmnc.c b/libavcodec/vmnc.c
index 645a2f5758..a1a55c0a34 100644
--- a/libavcodec/vmnc.c
+++ b/libavcodec/vmnc.c
@@ -31,6 +31,7 @@ 
 #include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "bytestream.h"
 
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index 798c7b1d67..cb009d902a 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -34,6 +34,7 @@ 
 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "fft.h"
 #include "get_bits.h"
 #include "internal.h"
diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c
index d85a46038a..2abc3686cd 100644
--- a/libavcodec/vorbisenc.c
+++ b/libavcodec/vorbisenc.c
@@ -28,8 +28,8 @@ 
 #include "libavutil/float_dsp.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 #include "fft.h"
 #include "mathops.h"
 #include "vorbis.h"
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 64532a70db..6ab70ccb3f 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -40,6 +40,7 @@ 
 #include "libavutil/mem_internal.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "hpeldsp.h"
 #include "internal.h"
diff --git a/libavcodec/vp5.c b/libavcodec/vp5.c
index 6146fbbc3a..b67b8439f2 100644
--- a/libavcodec/vp5.c
+++ b/libavcodec/vp5.c
@@ -27,6 +27,7 @@ 
 #include <string.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #include "vp56.h"
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c
index 40d266916e..bb49cf65dd 100644
--- a/libavcodec/vp6.c
+++ b/libavcodec/vp6.c
@@ -30,6 +30,7 @@ 
 #include <stdlib.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "huffman.h"
 #include "internal.h"
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 08338bc247..79ad89fc4f 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -30,6 +30,7 @@ 
 #include "libavutil/mem_internal.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "hwconfig.h"
 #include "internal.h"
 #include "mathops.h"
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 5da1b8a72e..900db5eb44 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -24,6 +24,7 @@ 
 #include "config_components.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "hwconfig.h"
 #include "internal.h"
diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c
index 1d97855e60..f53d2227a7 100644
--- a/libavcodec/vqavideo.c
+++ b/libavcodec/vqavideo.c
@@ -77,6 +77,7 @@ 
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #define PALETTE_COUNT 256
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 9a7dcf5f49..c1d1c581af 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -26,8 +26,8 @@ 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
-#include "internal.h"
 #include "thread.h"
 #include "threadframe.h"
 #include "unary.h"
diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c
index bc1049db0a..4ce821ee8c 100644
--- a/libavcodec/wavpackenc.c
+++ b/libavcodec/wavpackenc.c
@@ -24,6 +24,7 @@ 
 #include "libavutil/intreadwrite.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 #include "put_bits.h"
diff --git a/libavcodec/wcmv.c b/libavcodec/wcmv.c
index 04c597e767..63a0cae831 100644
--- a/libavcodec/wcmv.c
+++ b/libavcodec/wcmv.c
@@ -28,6 +28,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #include <zlib.h>
diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 417185e9be..e480a2813b 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -45,6 +45,7 @@ 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "exif.h"
 #include "get_bits.h"
 #include "internal.h"
diff --git a/libavcodec/webvttdec.c b/libavcodec/webvttdec.c
index 0093f328fa..61bf094a64 100644
--- a/libavcodec/webvttdec.c
+++ b/libavcodec/webvttdec.c
@@ -27,7 +27,7 @@ 
 
 #include "avcodec.h"
 #include "ass.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "libavutil/bprint.h"
 
 static const struct {
diff --git a/libavcodec/webvttenc.c b/libavcodec/webvttenc.c
index 89b49e42bf..f4ec3d48b4 100644
--- a/libavcodec/webvttenc.c
+++ b/libavcodec/webvttenc.c
@@ -26,7 +26,7 @@ 
 #include "libavutil/bprint.h"
 #include "ass_split.h"
 #include "ass.h"
-#include "internal.h"
+#include "codec_internal.h"
 
 #define WEBVTT_STACK_SIZE 64
 typedef struct {
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index 47e0f2c105..db5735eff2 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -39,6 +39,7 @@ 
 #include "libavutil/ffmath.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "wma.h"
 
diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c
index daf161251c..780cc76734 100644
--- a/libavcodec/wmaenc.c
+++ b/libavcodec/wmaenc.c
@@ -25,6 +25,7 @@ 
 #include "libavutil/ffmath.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 #include "wma.h"
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index cd05b22689..6971f56e51 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -29,6 +29,7 @@ 
 #include "libavutil/mem_internal.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "get_bits.h"
 #include "put_bits.h"
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 5c1d38eca5..4a011f7b96 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -97,6 +97,7 @@ 
 #include "libavutil/thread.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "get_bits.h"
 #include "put_bits.h"
diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
index 47fc0947c5..61f58be178 100644
--- a/libavcodec/wmavoice.c
+++ b/libavcodec/wmavoice.c
@@ -32,6 +32,7 @@ 
 #include "libavutil/mem_internal.h"
 #include "libavutil/thread.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "get_bits.h"
 #include "put_bits.h"
diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index 736376e5a2..79af6269b7 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -21,8 +21,8 @@ 
 #include "libavutil/mem_internal.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "h263dec.h"
-#include "internal.h"
 #include "intrax8.h"
 #include "mathops.h"
 #include "mpegutils.h"
diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c
index f6ff697043..5f50d9cdb1 100644
--- a/libavcodec/wmv2enc.c
+++ b/libavcodec/wmv2enc.c
@@ -19,6 +19,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "h263.h"
 #include "mpegvideo.h"
 #include "mpegvideoenc.h"
diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c
index 5d6c91d2d2..ae815a65a9 100644
--- a/libavcodec/wnv1.c
+++ b/libavcodec/wnv1.c
@@ -28,6 +28,7 @@ 
 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/wrapped_avframe.c b/libavcodec/wrapped_avframe.c
index a7834b86e8..2e908c84f7 100644
--- a/libavcodec/wrapped_avframe.c
+++ b/libavcodec/wrapped_avframe.c
@@ -25,8 +25,8 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "decode.h"
-#include "internal.h"
 
 #include "libavutil/internal.h"
 #include "libavutil/frame.h"
diff --git a/libavcodec/ws-snd1.c b/libavcodec/ws-snd1.c
index cd16445935..a3b2f94a66 100644
--- a/libavcodec/ws-snd1.c
+++ b/libavcodec/ws-snd1.c
@@ -25,6 +25,7 @@ 
 #include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 /**
diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index 7ab43db1e0..ac41e2456c 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -38,6 +38,7 @@ 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "internal.h"
 
diff --git a/libavcodec/xfacedec.c b/libavcodec/xfacedec.c
index 27295ff518..f165fff9e3 100644
--- a/libavcodec/xfacedec.c
+++ b/libavcodec/xfacedec.c
@@ -27,6 +27,7 @@ 
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "xface.h"
 
diff --git a/libavcodec/xl.c b/libavcodec/xl.c
index 25e5a6444e..493779e4b4 100644
--- a/libavcodec/xl.c
+++ b/libavcodec/xl.c
@@ -27,6 +27,7 @@ 
 #include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 static const int xl_table[32] = {
diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c
index 85cd7d1c20..dbfd1fe400 100644
--- a/libavcodec/xsubdec.c
+++ b/libavcodec/xsubdec.c
@@ -24,7 +24,7 @@ 
 #include "avcodec.h"
 #include "get_bits.h"
 #include "bytestream.h"
-#include "internal.h"
+#include "codec_internal.h"
 
 static av_cold int decode_init(AVCodecContext *avctx) {
     avctx->pix_fmt = AV_PIX_FMT_PAL8;
diff --git a/libavcodec/xsubenc.c b/libavcodec/xsubenc.c
index 03d0dc2d86..4c67566bc5 100644
--- a/libavcodec/xsubenc.c
+++ b/libavcodec/xsubenc.c
@@ -22,7 +22,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
-#include "internal.h"
+#include "codec_internal.h"
 #include "put_bits.h"
 
 /**
diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c
index 7c4aaf281f..b1948964fa 100644
--- a/libavcodec/xxan.c
+++ b/libavcodec/xxan.c
@@ -25,6 +25,7 @@ 
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct XanContext {
diff --git a/libavcodec/y41pdec.c b/libavcodec/y41pdec.c
index e63d184f25..b3c5992acf 100644
--- a/libavcodec/y41pdec.c
+++ b/libavcodec/y41pdec.c
@@ -21,6 +21,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 static av_cold int y41p_decode_init(AVCodecContext *avctx)
diff --git a/libavcodec/y41penc.c b/libavcodec/y41penc.c
index c5b211a1c2..e0182481c1 100644
--- a/libavcodec/y41penc.c
+++ b/libavcodec/y41penc.c
@@ -21,6 +21,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
 #include "internal.h"
 
diff --git a/libavcodec/ylc.c b/libavcodec/ylc.c
index cbe33fe174..f9971dd786 100644
--- a/libavcodec/ylc.c
+++ b/libavcodec/ylc.c
@@ -30,9 +30,9 @@ 
 #include "libavutil/mem.h"
 #include "avcodec.h"
 #include "bswapdsp.h"
+#include "codec_internal.h"
 #include "get_bits.h"
 #include "huffyuvdsp.h"
-#include "internal.h"
 #include "thread.h"
 #include "unary.h"
 
diff --git a/libavcodec/yop.c b/libavcodec/yop.c
index 38014edef6..6028cadce9 100644
--- a/libavcodec/yop.c
+++ b/libavcodec/yop.c
@@ -29,6 +29,7 @@ 
 #include "libavutil/intreadwrite.h"
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 typedef struct YopDecContext {
diff --git a/libavcodec/yuv4dec.c b/libavcodec/yuv4dec.c
index b180e96b5f..15a89a8f82 100644
--- a/libavcodec/yuv4dec.c
+++ b/libavcodec/yuv4dec.c
@@ -21,6 +21,7 @@ 
  */
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 static av_cold int yuv4_decode_init(AVCodecContext *avctx)
diff --git a/libavcodec/zerocodec.c b/libavcodec/zerocodec.c
index 3bd04567a1..1d28e0b61f 100644
--- a/libavcodec/zerocodec.c
+++ b/libavcodec/zerocodec.c
@@ -19,6 +19,7 @@ 
 #include <zlib.h>
 
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 #include "libavutil/common.h"
 
diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
index 0a5bb40ad5..aa544f5b79 100644
--- a/libavcodec/zmbv.c
+++ b/libavcodec/zmbv.c
@@ -31,6 +31,7 @@ 
 #include "libavutil/imgutils.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "internal.h"
 
 #include <zlib.h>
diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c
index 8efdbc963e..67c30738c8 100644
--- a/libavcodec/zmbvenc.c
+++ b/libavcodec/zmbvenc.c
@@ -30,8 +30,8 @@ 
 #include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
+#include "codec_internal.h"
 #include "encode.h"
-#include "internal.h"
 
 #include <zlib.h>