[FFmpeg-cvslog] Don't include common.h from avutil.h

Martin Storsjö git at videolan.org
Thu Aug 16 16:24:42 CEST 2012


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Mon Aug  6 16:49:32 2012 +0300| [1d9c2dc89a2302076a68b4a3ae3639abbb1a502d] | committer: Martin Storsjö

Don't include common.h from avutil.h

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1d9c2dc89a2302076a68b4a3ae3639abbb1a502d
---

 doc/APIchanges                         |    3 +++
 libavcodec/8bps.c                      |    2 ++
 libavcodec/8svx.c                      |    1 +
 libavcodec/a64multienc.c               |    1 +
 libavcodec/aac_ac3_parser.c            |    1 +
 libavcodec/acelp_filters.c             |    1 +
 libavcodec/acelp_pitch_delay.c         |    1 +
 libavcodec/acelp_vectors.c             |    2 ++
 libavcodec/adx.c                       |    1 +
 libavcodec/allcodecs.c                 |    1 +
 libavcodec/amr.h                       |    2 ++
 libavcodec/amrwbdec.c                  |    1 +
 libavcodec/ansi.c                      |    1 +
 libavcodec/api-example.c               |    1 +
 libavcodec/ass.c                       |    1 +
 libavcodec/assdec.c                    |    4 ++++
 libavcodec/assenc.c                    |    4 ++++
 libavcodec/atrac.c                     |    1 +
 libavcodec/audio_frame_queue.c         |    1 +
 libavcodec/audioconvert.c              |    1 +
 libavcodec/aura.c                      |    1 +
 libavcodec/avpacket.c                  |    3 +++
 libavcodec/bitstream_filter.c          |    3 +++
 libavcodec/cavsdsp.c                   |    1 +
 libavcodec/celp_filters.c              |    1 +
 libavcodec/celp_math.c                 |    1 +
 libavcodec/cinepak.c                   |    1 +
 libavcodec/codec_desc.c                |    1 +
 libavcodec/cscd.c                      |    1 +
 libavcodec/cyuv.c                      |    1 +
 libavcodec/dct.c                       |    1 +
 libavcodec/dirac_parser.c              |    3 +++
 libavcodec/dnxhddata.c                 |    1 +
 libavcodec/dpxenc.c                    |    1 +
 libavcodec/dump_extradata_bsf.c        |    3 +++
 libavcodec/dv_profile.c                |    1 +
 libavcodec/dvdsub_parser.c             |    3 +++
 libavcodec/dwt.c                       |    1 +
 libavcodec/dxa.c                       |    1 +
 libavcodec/dxtory.c                    |    1 +
 libavcodec/eacmv.c                     |    1 +
 libavcodec/eaidct.c                    |    1 +
 libavcodec/elbg.c                      |    1 +
 libavcodec/faandct.c                   |    2 ++
 libavcodec/faanidct.c                  |    1 +
 libavcodec/fmtconvert.c                |    1 +
 libavcodec/g722enc.c                   |    1 +
 libavcodec/h264_mp4toannexb_bsf.c      |    3 +++
 libavcodec/h264dsp.c                   |    1 +
 libavcodec/h264idct_template.c         |    1 +
 libavcodec/idcinvideo.c                |    1 +
 libavcodec/iirfilter.c                 |    1 +
 libavcodec/imgconvert.c                |    1 +
 libavcodec/intrax8dsp.c                |    1 +
 libavcodec/jpegls.h                    |    1 +
 libavcodec/kgv1dec.c                   |    1 +
 libavcodec/lclenc.c                    |    2 ++
 libavcodec/libfaac.c                   |    1 +
 libavcodec/libfdk-aacenc.c             |    1 +
 libavcodec/libgsm.c                    |    1 +
 libavcodec/libilbc.c                   |    1 +
 libavcodec/libmp3lame.c                |    1 +
 libavcodec/libopencore-amr.c           |    1 +
 libavcodec/libspeexdec.c               |    1 +
 libavcodec/libspeexenc.c               |    1 +
 libavcodec/libtheoraenc.c              |    1 +
 libavcodec/libvo-amrwbenc.c            |    4 ++++
 libavcodec/libvpxdec.c                 |    1 +
 libavcodec/libvpxenc.c                 |    1 +
 libavcodec/libx264.c                   |    2 ++
 libavcodec/lpc.c                       |    1 +
 libavcodec/lzw.c                       |    1 +
 libavcodec/mace.c                      |    1 +
 libavcodec/motion-test.c               |    2 ++
 libavcodec/movsub_bsf.c                |    1 +
 libavcodec/mp3_header_compress_bsf.c   |    1 +
 libavcodec/mp3_header_decompress_bsf.c |    1 +
 libavcodec/mpegaudio_parser.c          |    1 +
 libavcodec/msvideo1.c                  |    1 +
 libavcodec/noise_bsf.c                 |    4 ++++
 libavcodec/nuv.c                       |    1 +
 libavcodec/options.c                   |    2 ++
 libavcodec/options_table.h             |    1 +
 libavcodec/parser.c                    |    3 +++
 libavcodec/pnm.c                       |    3 +++
 libavcodec/ppc/fmtconvert_altivec.c    |    1 +
 libavcodec/ppc/gmc_altivec.c           |    1 +
 libavcodec/ppc/h264_altivec_template.c |    2 ++
 libavcodec/ppc/vp8dsp_altivec.c        |    1 +
 libavcodec/proresdsp.c                 |    1 +
 libavcodec/psymodel.c                  |    3 +++
 libavcodec/pthread.c                   |    1 +
 libavcodec/ptx.c                       |    1 +
 libavcodec/qdrw.c                      |    1 +
 libavcodec/r210dec.c                   |    1 +
 libavcodec/ra144.c                     |    1 +
 libavcodec/ra288.h                     |    1 +
 libavcodec/raw.c                       |    1 +
 libavcodec/rawdec.c                    |    1 +
 libavcodec/rawenc.c                    |    1 +
 libavcodec/resample.c                  |    3 +++
 libavcodec/resample2.c                 |    1 +
 libavcodec/rl2.c                       |    2 ++
 libavcodec/rle.c                       |    1 +
 libavcodec/rpza.c                      |    1 +
 libavcodec/rtjpeg.h                    |    1 +
 libavcodec/rv34dsp.c                   |    1 +
 libavcodec/rv40dsp.c                   |    1 +
 libavcodec/s302m.c                     |    1 +
 libavcodec/sinewin_tablegen.h          |    1 +
 libavcodec/sipr.h                      |    1 +
 libavcodec/sipr16k.c                   |    1 +
 libavcodec/srtdec.c                    |    1 +
 libavcodec/sunrast.c                   |    1 +
 libavcodec/targaenc.c                  |    3 +++
 libavcodec/tiff.c                      |    1 +
 libavcodec/tiffenc.c                   |    1 +
 libavcodec/tmv.c                       |    3 +++
 libavcodec/truemotion1.c               |    2 ++
 libavcodec/v210dec.c                   |    2 ++
 libavcodec/v210x.c                     |    2 ++
 libavcodec/v410dec.c                   |    1 +
 libavcodec/v410enc.c                   |    1 +
 libavcodec/vc1dsp.c                    |    1 +
 libavcodec/vcr1.c                      |    1 +
 libavcodec/vmdav.c                     |    1 +
 libavcodec/vmnc.c                      |    1 +
 libavcodec/vorbis_data.c               |    1 +
 libavcodec/vp3dsp.c                    |    1 +
 libavcodec/vp56dsp.c                   |    1 +
 libavcodec/vp8dsp.c                    |    1 +
 libavcodec/ws-snd1.c                   |    1 +
 libavcodec/x86/idct_mmx_xvid.c         |    3 +++
 libavcodec/x86/idct_sse2_xvid.c        |    2 ++
 libavcodec/x86/lpc_mmx.c               |    1 +
 libavcodec/x86/mlpdsp.c                |    1 +
 libavcodec/x86/motion_est_mmx.c        |    2 ++
 libavcodec/x86/rv40dsp_init.c          |    1 +
 libavcodec/x86/simple_idct_mmx.c       |    2 ++
 libavcodec/x86/vc1dsp_mmx.c            |    2 ++
 libavcodec/x86/vp8dsp-init.c           |    1 +
 libavcodec/xbmenc.c                    |    1 +
 libavcodec/xl.c                        |    1 +
 libavcodec/zerocodec.c                 |    1 +
 libavcodec/zmbv.c                      |    1 +
 libavcodec/zmbvenc.c                   |    1 +
 libavdevice/avdevice.c                 |    1 +
 libavdevice/timefilter.c               |    1 +
 libavfilter/af_aformat.c               |    1 +
 libavfilter/af_amix.c                  |    1 +
 libavfilter/af_anull.c                 |    1 +
 libavfilter/af_asyncts.c               |    1 +
 libavfilter/af_channelmap.c            |    1 +
 libavfilter/af_channelsplit.c          |    1 +
 libavfilter/af_join.c                  |    1 +
 libavfilter/af_resample.c              |    1 +
 libavfilter/allfilters.c               |    1 +
 libavfilter/asink_anullsink.c          |    1 +
 libavfilter/asrc_anullsrc.c            |    4 ++++
 libavfilter/audio.c                    |    1 +
 libavfilter/avfilter.c                 |    1 +
 libavfilter/avfiltergraph.c            |    1 +
 libavfilter/buffer.c                   |    1 +
 libavfilter/buffersink.c               |    1 +
 libavfilter/buffersrc.c                |    1 +
 libavfilter/drawutils.c                |    3 +++
 libavfilter/fifo.c                     |    1 +
 libavfilter/formats.c                  |    1 +
 libavfilter/graphparser.c              |    2 ++
 libavfilter/split.c                    |    4 ++++
 libavfilter/vf_aspect.c                |    1 +
 libavfilter/vf_blackframe.c            |    4 ++++
 libavfilter/vf_boxblur.c               |    1 +
 libavfilter/vf_copy.c                  |    1 +
 libavfilter/vf_crop.c                  |    3 +++
 libavfilter/vf_cropdetect.c            |    3 +++
 libavfilter/vf_delogo.c                |    1 +
 libavfilter/vf_drawbox.c               |    1 +
 libavfilter/vf_fade.c                  |    1 +
 libavfilter/vf_fieldorder.c            |    4 ++++
 libavfilter/vf_format.c                |    4 ++++
 libavfilter/vf_fps.c                   |    1 +
 libavfilter/vf_gradfun.c               |    1 +
 libavfilter/vf_hflip.c                 |    3 +++
 libavfilter/vf_hqdn3d.c                |    1 +
 libavfilter/vf_lut.c                   |    1 +
 libavfilter/vf_null.c                  |    1 +
 libavfilter/vf_overlay.c               |    1 +
 libavfilter/vf_pad.c                   |    1 +
 libavfilter/vf_pixdesctest.c           |    1 +
 libavfilter/vf_scale.c                 |    4 ++++
 libavfilter/vf_select.c                |    1 +
 libavfilter/vf_setpts.c                |    1 +
 libavfilter/vf_settb.c                 |    4 ++++
 libavfilter/vf_showinfo.c              |    1 +
 libavfilter/vf_slicify.c               |    1 +
 libavfilter/vf_transpose.c             |    3 +++
 libavfilter/vf_vflip.c                 |    1 +
 libavfilter/video.c                    |    3 +++
 libavfilter/vsink_nullsink.c           |    1 +
 libavfilter/vsrc_color.c               |    5 +++++
 libavfilter/vsrc_nullsrc.c             |    3 +++
 libavfilter/vsrc_testsrc.c             |    1 +
 libavfilter/x86/gradfun.c              |    1 +
 libavfilter/x86/yadif.c                |    2 ++
 libavresample/audio_convert.c          |    1 +
 libavresample/audio_data.c             |    1 +
 libavresample/audio_mix.c              |    1 +
 libavresample/audio_mix_matrix.c       |    1 +
 libavresample/avresample-test.c        |    1 +
 libavresample/options.c                |    1 +
 libavresample/resample.c               |    1 +
 libavresample/utils.c                  |    1 +
 libavutil/audio_fifo.c                 |    1 +
 libavutil/audioconvert.c               |    1 +
 libavutil/avstring.c                   |    2 ++
 libavutil/avutil.h                     |    1 -
 libavutil/dict.c                       |    3 +++
 libavutil/error.c                      |    1 +
 libavutil/error.h                      |    1 +
 libavutil/eval.c                       |    1 +
 libavutil/fifo.h                       |    1 +
 libavutil/file.c                       |    1 +
 libavutil/file.h                       |    2 ++
 libavutil/imgutils.c                   |    1 +
 libavutil/log.c                        |    1 +
 libavutil/mem.h                        |    2 ++
 libavutil/opt.c                        |    1 +
 libavutil/parseutils.c                 |    1 +
 libavutil/samplefmt.c                  |    1 +
 libavutil/samplefmt.h                  |    3 +++
 libavutil/timer.h                      |    1 +
 libavutil/tree.c                       |    2 ++
 libavutil/version.h                    |    2 +-
 libswscale/colorspace-test.c           |    1 +
 libswscale/swscale.h                   |    2 ++
 libswscale/swscale_internal.h          |    1 +
 tools/graph2dot.c                      |    3 +++
 238 files changed, 346 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index f94670c..5e67e0d 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,9 @@ libavutil:     2011-04-18
 
 API changes, most recent first:
 
+2012-08-08 - xxxxxxx - lavu 51.39 - avutil.h
+  Don't implicitly include libavutil/common.h in avutil.h
+
 2012-08-08 - xxxxxxx - lavu 51.38 - dict.h
   Add av_dict_count().
 
diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c
index a686b72..12e9358 100644
--- a/libavcodec/8bps.c
+++ b/libavcodec/8bps.c
@@ -33,7 +33,9 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
+#include "libavutil/internal.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c
index 3c0c091..328fc65 100644
--- a/libavcodec/8svx.c
+++ b/libavcodec/8svx.c
@@ -29,6 +29,7 @@
  */
 
 #include "avcodec.h"
+#include "libavutil/common.h"
 
 /** decoder context */
 typedef struct EightSvxContext {
diff --git a/libavcodec/a64multienc.c b/libavcodec/a64multienc.c
index 4e604dc..c9d3b3c 100644
--- a/libavcodec/a64multienc.c
+++ b/libavcodec/a64multienc.c
@@ -29,6 +29,7 @@
 #include "a64tables.h"
 #include "elbg.h"
 #include "internal.h"
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 
 #define DITHERSTEPS   8
diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c
index fc51612..b17cd4d 100644
--- a/libavcodec/aac_ac3_parser.c
+++ b/libavcodec/aac_ac3_parser.c
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "parser.h"
 #include "aac_ac3_parser.h"
 
diff --git a/libavcodec/acelp_filters.c b/libavcodec/acelp_filters.c
index 16e2da1..93bec65 100644
--- a/libavcodec/acelp_filters.c
+++ b/libavcodec/acelp_filters.c
@@ -22,6 +22,7 @@
 
 #include <inttypes.h>
 
+#include "libavutil/common.h"
 #include "avcodec.h"
 #include "acelp_filters.h"
 
diff --git a/libavcodec/acelp_pitch_delay.c b/libavcodec/acelp_pitch_delay.c
index 214a272..8aa5008 100644
--- a/libavcodec/acelp_pitch_delay.c
+++ b/libavcodec/acelp_pitch_delay.c
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/mathematics.h"
 #include "avcodec.h"
 #include "dsputil.h"
diff --git a/libavcodec/acelp_vectors.c b/libavcodec/acelp_vectors.c
index b7c05e7..4b378ca 100644
--- a/libavcodec/acelp_vectors.c
+++ b/libavcodec/acelp_vectors.c
@@ -21,6 +21,8 @@
  */
 
 #include <inttypes.h>
+
+#include "libavutil/common.h"
 #include "avcodec.h"
 #include "acelp_vectors.h"
 #include "celp_math.h"
diff --git a/libavcodec/adx.c b/libavcodec/adx.c
index 1e5d89c..870216c 100644
--- a/libavcodec/adx.c
+++ b/libavcodec/adx.c
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/mathematics.h"
 #include "adx.h"
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index f85892b..755b4ab 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -25,6 +25,7 @@
  */
 
 #include "avcodec.h"
+#include "config.h"
 
 #define REGISTER_HWACCEL(X,x) { \
           extern AVHWAccel ff_##x##_hwaccel; \
diff --git a/libavcodec/amr.h b/libavcodec/amr.h
index 9498d57..676c963 100644
--- a/libavcodec/amr.h
+++ b/libavcodec/amr.h
@@ -23,6 +23,8 @@
 #ifndef AVCODEC_AMR_H
 #define AVCODEC_AMR_H
 
+#include <string.h>
+
 #include "avcodec.h"
 
 #ifdef AMR_USE_16BIT_TABLES
diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index 4dc90da..4885c2d 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -24,6 +24,7 @@
  * AMR wideband decoder
  */
 
+#include "libavutil/common.h"
 #include "libavutil/lfg.h"
 
 #include "avcodec.h"
diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c
index bd58dd1..04a1106 100644
--- a/libavcodec/ansi.c
+++ b/libavcodec/ansi.c
@@ -24,6 +24,7 @@
  * ASCII/ANSI art decoder
  */
 
+#include "libavutil/common.h"
 #include "libavutil/lfg.h"
 #include "avcodec.h"
 #include "cga_data.h"
diff --git a/libavcodec/api-example.c b/libavcodec/api-example.c
index 4db92d3..d025354 100644
--- a/libavcodec/api-example.c
+++ b/libavcodec/api-example.c
@@ -38,6 +38,7 @@
 
 #include "libavcodec/avcodec.h"
 #include "libavutil/audioconvert.h"
+#include "libavutil/common.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/samplefmt.h"
diff --git a/libavcodec/ass.c b/libavcodec/ass.c
index 327a77b..3585b93 100644
--- a/libavcodec/ass.c
+++ b/libavcodec/ass.c
@@ -22,6 +22,7 @@
 #include "avcodec.h"
 #include "ass.h"
 #include "libavutil/avstring.h"
+#include "libavutil/common.h"
 
 /**
  * Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS.
diff --git a/libavcodec/assdec.c b/libavcodec/assdec.c
index 225eceb..7a69582 100644
--- a/libavcodec/assdec.c
+++ b/libavcodec/assdec.c
@@ -19,8 +19,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <string.h>
+
 #include "avcodec.h"
 #include "ass.h"
+#include "libavutil/internal.h"
+#include "libavutil/mem.h"
 
 static av_cold int ass_decode_init(AVCodecContext *avctx)
 {
diff --git a/libavcodec/assenc.c b/libavcodec/assenc.c
index 28ca6dd..6b44623 100644
--- a/libavcodec/assenc.c
+++ b/libavcodec/assenc.c
@@ -19,8 +19,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <string.h>
+
 #include "avcodec.h"
 #include "libavutil/avstring.h"
+#include "libavutil/internal.h"
+#include "libavutil/mem.h"
 
 static av_cold int ass_encode_init(AVCodecContext *avctx)
 {
diff --git a/libavcodec/atrac.c b/libavcodec/atrac.c
index b9b33aa..a772e7d 100644
--- a/libavcodec/atrac.c
+++ b/libavcodec/atrac.c
@@ -27,6 +27,7 @@
 #include <math.h>
 #include <stddef.h>
 #include <stdio.h>
+#include <string.h>
 
 #include "avcodec.h"
 #include "dsputil.h"
diff --git a/libavcodec/audio_frame_queue.c b/libavcodec/audio_frame_queue.c
index 156c3a1..1cd96a7 100644
--- a/libavcodec/audio_frame_queue.c
+++ b/libavcodec/audio_frame_queue.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/mathematics.h"
 #include "internal.h"
 #include "audio_frame_queue.h"
diff --git a/libavcodec/audioconvert.c b/libavcodec/audioconvert.c
index 112e220..3714de7 100644
--- a/libavcodec/audioconvert.c
+++ b/libavcodec/audioconvert.c
@@ -26,6 +26,7 @@
  */
 
 #include "libavutil/avstring.h"
+#include "libavutil/common.h"
 #include "libavutil/libm.h"
 #include "libavutil/samplefmt.h"
 #include "avcodec.h"
diff --git a/libavcodec/aura.c b/libavcodec/aura.c
index e015aac..68e0c7a 100644
--- a/libavcodec/aura.c
+++ b/libavcodec/aura.c
@@ -24,6 +24,7 @@
  */
 
 #include "avcodec.h"
+#include "libavutil/internal.h"
 
 typedef struct AuraDecodeContext {
     AVCodecContext *avctx;
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 4b85081..3344cf9 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -19,7 +19,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <string.h>
+
 #include "libavutil/avassert.h"
+#include "libavutil/mem.h"
 #include "avcodec.h"
 
 void av_destruct_packet_nofree(AVPacket *pkt)
diff --git a/libavcodec/bitstream_filter.c b/libavcodec/bitstream_filter.c
index ee56174..b2d61da 100644
--- a/libavcodec/bitstream_filter.c
+++ b/libavcodec/bitstream_filter.c
@@ -18,7 +18,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <string.h>
+
 #include "avcodec.h"
+#include "libavutil/mem.h"
 
 static AVBitStreamFilter *first_bitstream_filter= NULL;
 
diff --git a/libavcodec/cavsdsp.c b/libavcodec/cavsdsp.c
index 04e521b..983d9d7 100644
--- a/libavcodec/cavsdsp.c
+++ b/libavcodec/cavsdsp.c
@@ -25,6 +25,7 @@
 #include <stdio.h>
 #include "dsputil.h"
 #include "cavsdsp.h"
+#include "libavutil/common.h"
 
 /*****************************************************************************
  *
diff --git a/libavcodec/celp_filters.c b/libavcodec/celp_filters.c
index d764d19..381ffa4 100644
--- a/libavcodec/celp_filters.c
+++ b/libavcodec/celp_filters.c
@@ -24,6 +24,7 @@
 
 #include "avcodec.h"
 #include "celp_filters.h"
+#include "libavutil/common.h"
 
 void ff_celp_convolve_circ(int16_t* fc_out, const int16_t* fc_in,
                            const int16_t* filter, int len)
diff --git a/libavcodec/celp_math.c b/libavcodec/celp_math.c
index 8d36d4e..a34508f 100644
--- a/libavcodec/celp_math.c
+++ b/libavcodec/celp_math.c
@@ -26,6 +26,7 @@
 
 #include "avcodec.h"
 #include "celp_math.h"
+#include "libavutil/common.h"
 
 /**
  * Cosine table: base_cos[i] = (1<<15) * cos(i*PI/64)
diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
index 9c29f5e..2b06992 100644
--- a/libavcodec/cinepak.c
+++ b/libavcodec/cinepak.c
@@ -34,6 +34,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index a0c1fd2..2ace53b 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -18,6 +18,7 @@
 
 #include "avcodec.h"
 
+#include "libavutil/common.h"
 #include "libavutil/internal.h"
 
 static const AVCodecDescriptor codec_descriptors[] = {
diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c
index 6c84f03..1e210ef 100644
--- a/libavcodec/cscd.c
+++ b/libavcodec/cscd.c
@@ -22,6 +22,7 @@
 #include <stdlib.h>
 
 #include "avcodec.h"
+#include "libavutil/common.h"
 
 #if CONFIG_ZLIB
 #include <zlib.h>
diff --git a/libavcodec/cyuv.c b/libavcodec/cyuv.c
index 4e30538..1cf7013 100644
--- a/libavcodec/cyuv.c
+++ b/libavcodec/cyuv.c
@@ -34,6 +34,7 @@
 
 #include "avcodec.h"
 #include "dsputil.h"
+#include "libavutil/internal.h"
 
 
 typedef struct CyuvDecodeContext {
diff --git a/libavcodec/dct.c b/libavcodec/dct.c
index e65671e..73716d3 100644
--- a/libavcodec/dct.c
+++ b/libavcodec/dct.c
@@ -28,6 +28,7 @@
  */
 
 #include <math.h>
+#include <string.h>
 
 #include "libavutil/mathematics.h"
 #include "dct.h"
diff --git a/libavcodec/dirac_parser.c b/libavcodec/dirac_parser.c
index 4fd47ae..46f5430 100644
--- a/libavcodec/dirac_parser.c
+++ b/libavcodec/dirac_parser.c
@@ -27,7 +27,10 @@
  * @author Marco Gerards <marco at gnu.org>
  */
 
+#include <string.h>
+
 #include "libavutil/intreadwrite.h"
+#include "libavutil/mem.h"
 #include "parser.h"
 
 #define DIRAC_PARSE_INFO_PREFIX 0x42424344
diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index 576e85e..96895da 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -21,6 +21,7 @@
 
 #include "avcodec.h"
 #include "dnxhddata.h"
+#include "libavutil/common.h"
 
 static const uint8_t dnxhd_1235_luma_weight[] = {
      0, 32, 32, 32, 33, 35, 38, 39,
diff --git a/libavcodec/dpxenc.c b/libavcodec/dpxenc.c
index a48a898..ce84df0 100644
--- a/libavcodec/dpxenc.c
+++ b/libavcodec/dpxenc.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
diff --git a/libavcodec/dump_extradata_bsf.c b/libavcodec/dump_extradata_bsf.c
index ba77b15..17d9434 100644
--- a/libavcodec/dump_extradata_bsf.c
+++ b/libavcodec/dump_extradata_bsf.c
@@ -18,7 +18,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <string.h>
+
 #include "avcodec.h"
+#include "libavutil/mem.h"
 
 
 static int dump_extradata(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
diff --git a/libavcodec/dv_profile.c b/libavcodec/dv_profile.c
index 8b604c2..b494f97 100644
--- a/libavcodec/dv_profile.c
+++ b/libavcodec/dv_profile.c
@@ -18,6 +18,7 @@
 
 #include <stdint.h>
 
+#include "libavutil/common.h"
 #include "libavutil/log.h"
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
diff --git a/libavcodec/dvdsub_parser.c b/libavcodec/dvdsub_parser.c
index 76978cd..2ad3b33 100644
--- a/libavcodec/dvdsub_parser.c
+++ b/libavcodec/dvdsub_parser.c
@@ -19,7 +19,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <string.h>
+
 #include "libavutil/intreadwrite.h"
+#include "libavutil/mem.h"
 #include "avcodec.h"
 
 /* parser definition */
diff --git a/libavcodec/dwt.c b/libavcodec/dwt.c
index 56e4a57..3f8a53d 100644
--- a/libavcodec/dwt.c
+++ b/libavcodec/dwt.c
@@ -19,6 +19,7 @@
  */
 
 #include "libavutil/attributes.h"
+#include "libavutil/common.h"
 #include "dsputil.h"
 #include "dwt.h"
 
diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c
index 966c2fb..a6e2a11 100644
--- a/libavcodec/dxa.c
+++ b/libavcodec/dxa.c
@@ -27,6 +27,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
diff --git a/libavcodec/dxtory.c b/libavcodec/dxtory.c
index d11b942..83abc72 100644
--- a/libavcodec/dxtory.c
+++ b/libavcodec/dxtory.c
@@ -21,6 +21,7 @@
  */
 
 #include "avcodec.h"
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 
 static av_cold int decode_init(AVCodecContext *avctx)
diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c
index b3cd25b..50cb686 100644
--- a/libavcodec/eacmv.c
+++ b/libavcodec/eacmv.c
@@ -28,6 +28,7 @@
  * http://wiki.multimedia.cx/index.php?title=Electronic_Arts_CMV
  */
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
diff --git a/libavcodec/eaidct.c b/libavcodec/eaidct.c
index 5e628b0..9f2d5cc 100644
--- a/libavcodec/eaidct.c
+++ b/libavcodec/eaidct.c
@@ -27,6 +27,7 @@
 
 #include "dsputil.h"
 #include "eaidct.h"
+#include "libavutil/common.h"
 
 #define ASQRT 181 /* (1/sqrt(2))<<8 */
 #define A4    669 /* cos(pi/8)*sqrt(2)<<9 */
diff --git a/libavcodec/elbg.c b/libavcodec/elbg.c
index 030c3a6..31195f3 100644
--- a/libavcodec/elbg.c
+++ b/libavcodec/elbg.c
@@ -25,6 +25,7 @@
 
 #include <string.h>
 
+#include "libavutil/common.h"
 #include "libavutil/lfg.h"
 #include "elbg.h"
 #include "avcodec.h"
diff --git a/libavcodec/faandct.c b/libavcodec/faandct.c
index eaf4b65..1379394 100644
--- a/libavcodec/faandct.c
+++ b/libavcodec/faandct.c
@@ -27,6 +27,8 @@
 
 #include "dsputil.h"
 #include "faandct.h"
+#include "libavutil/internal.h"
+#include "libavutil/libm.h"
 
 #define FLOAT float
 
diff --git a/libavcodec/faanidct.c b/libavcodec/faanidct.c
index 0b9b458..cd8ca27 100644
--- a/libavcodec/faanidct.c
+++ b/libavcodec/faanidct.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include "faanidct.h"
+#include "libavutil/common.h"
 
 /* To allow switching to double. */
 #define FLOAT float
diff --git a/libavcodec/fmtconvert.c b/libavcodec/fmtconvert.c
index 58fece7..c90ffc1 100644
--- a/libavcodec/fmtconvert.c
+++ b/libavcodec/fmtconvert.c
@@ -22,6 +22,7 @@
 
 #include "avcodec.h"
 #include "fmtconvert.h"
+#include "libavutil/common.h"
 
 static void int32_to_float_fmul_scalar_c(float *dst, const int *src, float mul, int len){
     int i;
diff --git a/libavcodec/g722enc.c b/libavcodec/g722enc.c
index efc8540..cc87936 100644
--- a/libavcodec/g722enc.c
+++ b/libavcodec/g722enc.c
@@ -30,6 +30,7 @@
 #include "avcodec.h"
 #include "internal.h"
 #include "g722.h"
+#include "libavutil/common.h"
 
 #define FREEZE_INTERVAL 128
 
diff --git a/libavcodec/h264_mp4toannexb_bsf.c b/libavcodec/h264_mp4toannexb_bsf.c
index eceebeb..276751e 100644
--- a/libavcodec/h264_mp4toannexb_bsf.c
+++ b/libavcodec/h264_mp4toannexb_bsf.c
@@ -19,7 +19,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <string.h>
+
 #include "libavutil/intreadwrite.h"
+#include "libavutil/mem.h"
 #include "avcodec.h"
 
 typedef struct H264BSFContext {
diff --git a/libavcodec/h264dsp.c b/libavcodec/h264dsp.c
index ba96707..ec59e4a 100644
--- a/libavcodec/h264dsp.c
+++ b/libavcodec/h264dsp.c
@@ -28,6 +28,7 @@
 #include <stdint.h>
 #include "avcodec.h"
 #include "h264dsp.h"
+#include "libavutil/common.h"
 
 #define BIT_DEPTH 8
 #include "h264dsp_template.c"
diff --git a/libavcodec/h264idct_template.c b/libavcodec/h264idct_template.c
index e476f89..554483c 100644
--- a/libavcodec/h264idct_template.c
+++ b/libavcodec/h264idct_template.c
@@ -26,6 +26,7 @@
  */
 
 #include "bit_depth_template.c"
+#include "libavutil/common.h"
 
 #ifndef AVCODEC_H264IDCT_INTERNAL_H
 #define AVCODEC_H264IDCT_INTERNAL_H
diff --git a/libavcodec/idcinvideo.c b/libavcodec/idcinvideo.c
index 4a3df46..b6b9eb7 100644
--- a/libavcodec/idcinvideo.c
+++ b/libavcodec/idcinvideo.c
@@ -49,6 +49,7 @@
 #include <string.h>
 
 #include "avcodec.h"
+#include "libavutil/internal.h"
 
 #define HUFFMAN_TABLE_SIZE 64 * 1024
 #define HUF_TOKENS 256
diff --git a/libavcodec/iirfilter.c b/libavcodec/iirfilter.c
index 34d3962..f9b9ff6 100644
--- a/libavcodec/iirfilter.c
+++ b/libavcodec/iirfilter.c
@@ -26,6 +26,7 @@
 
 #include "iirfilter.h"
 #include <math.h>
+#include "libavutil/common.h"
 
 /**
  * IIR filter global parameters
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index a6c832d..62ec35a 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -35,6 +35,7 @@
 #include "internal.h"
 #include "imgconvert.h"
 #include "libavutil/colorspace.h"
+#include "libavutil/common.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/imgutils.h"
 
diff --git a/libavcodec/intrax8dsp.c b/libavcodec/intrax8dsp.c
index 0e79276..5ba210e 100644
--- a/libavcodec/intrax8dsp.c
+++ b/libavcodec/intrax8dsp.c
@@ -22,6 +22,7 @@
  */
 
 #include "dsputil.h"
+#include "libavutil/common.h"
 
 /*
 area positions, #3 is 1 pixel only, other are 8 pixels
diff --git a/libavcodec/jpegls.h b/libavcodec/jpegls.h
index 1c1817e..18c71a8 100644
--- a/libavcodec/jpegls.h
+++ b/libavcodec/jpegls.h
@@ -29,6 +29,7 @@
 #define AVCODEC_JPEGLS_H
 
 #include "avcodec.h"
+#include "libavutil/common.h"
 
 typedef struct JpeglsContext{
     AVCodecContext *avctx;
diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c
index 5977e83..d19563f 100644
--- a/libavcodec/kgv1dec.c
+++ b/libavcodec/kgv1dec.c
@@ -24,6 +24,7 @@
  * Kega Game Video decoder
  */
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
diff --git a/libavcodec/lclenc.c b/libavcodec/lclenc.c
index c5c2ff2..6540e9e 100644
--- a/libavcodec/lclenc.c
+++ b/libavcodec/lclenc.c
@@ -43,6 +43,8 @@
 
 #include "avcodec.h"
 #include "lcl.h"
+#include "libavutil/internal.h"
+#include "libavutil/mem.h"
 
 #include <zlib.h>
 
diff --git a/libavcodec/libfaac.c b/libavcodec/libfaac.c
index 19f55aa..7297179 100644
--- a/libavcodec/libfaac.c
+++ b/libavcodec/libfaac.c
@@ -30,6 +30,7 @@
 #include "audio_frame_queue.h"
 #include "internal.h"
 #include "libavutil/audioconvert.h"
+#include "libavutil/common.h"
 
 
 /* libfaac has an encoder delay of 1024 samples */
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
index 659874b..66c93fc 100644
--- a/libavcodec/libfdk-aacenc.c
+++ b/libavcodec/libfdk-aacenc.c
@@ -25,6 +25,7 @@
 #include "audio_frame_queue.h"
 #include "internal.h"
 #include "libavutil/audioconvert.h"
+#include "libavutil/common.h"
 #include "libavutil/opt.h"
 
 typedef struct AACContext {
diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c
index c35acd3..e6d435b 100644
--- a/libavcodec/libgsm.c
+++ b/libavcodec/libgsm.c
@@ -32,6 +32,7 @@
 #include "avcodec.h"
 #include "internal.h"
 #include "gsm.h"
+#include "libavutil/common.h"
 
 static av_cold int libgsm_encode_init(AVCodecContext *avctx) {
     if (avctx->channels > 1) {
diff --git a/libavcodec/libilbc.c b/libavcodec/libilbc.c
index 5a98012..d17560d 100644
--- a/libavcodec/libilbc.c
+++ b/libavcodec/libilbc.c
@@ -22,6 +22,7 @@
 #include <ilbc.h>
 
 #include "avcodec.h"
+#include "libavutil/common.h"
 #include "libavutil/opt.h"
 #include "internal.h"
 
diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index 75b6c67..d754f46 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -27,6 +27,7 @@
 #include <lame/lame.h>
 
 #include "libavutil/audioconvert.h"
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/log.h"
 #include "libavutil/opt.h"
diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c
index 80b79f0..7f45450 100644
--- a/libavcodec/libopencore-amr.c
+++ b/libavcodec/libopencore-amr.c
@@ -21,6 +21,7 @@
 
 #include "avcodec.h"
 #include "libavutil/avstring.h"
+#include "libavutil/common.h"
 #include "libavutil/opt.h"
 #include "audio_frame_queue.h"
 #include "internal.h"
diff --git a/libavcodec/libspeexdec.c b/libavcodec/libspeexdec.c
index e0ce7bb..a63d394 100644
--- a/libavcodec/libspeexdec.c
+++ b/libavcodec/libspeexdec.c
@@ -23,6 +23,7 @@
 #include <speex/speex_stereo.h>
 #include <speex/speex_callbacks.h>
 #include "avcodec.h"
+#include "libavutil/common.h"
 
 typedef struct {
     AVFrame frame;
diff --git a/libavcodec/libspeexenc.c b/libavcodec/libspeexenc.c
index 18c43ad..d61a512 100644
--- a/libavcodec/libspeexenc.c
+++ b/libavcodec/libspeexenc.c
@@ -69,6 +69,7 @@
 #include <speex/speex_stereo.h>
 
 #include "libavutil/audioconvert.h"
+#include "libavutil/common.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
 #include "internal.h"
diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c
index bb2bd08..3f861e1 100644
--- a/libavcodec/libtheoraenc.c
+++ b/libavcodec/libtheoraenc.c
@@ -31,6 +31,7 @@
  */
 
 /* Libav includes */
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/log.h"
 #include "libavutil/base64.h"
diff --git a/libavcodec/libvo-amrwbenc.c b/libavcodec/libvo-amrwbenc.c
index b1584dd..9ea180c 100644
--- a/libavcodec/libvo-amrwbenc.c
+++ b/libavcodec/libvo-amrwbenc.c
@@ -20,8 +20,12 @@
  */
 
 #include <vo-amrwbenc/enc_if.h>
+#include <stdio.h>
+#include <stdlib.h>
 
 #include "libavutil/avstring.h"
+#include "libavutil/internal.h"
+#include "libavutil/mem.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
 #include "internal.h"
diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index 402998d..648187c 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -27,6 +27,7 @@
 #include <vpx/vpx_decoder.h>
 #include <vpx/vp8dx.h>
 
+#include "libavutil/common.h"
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
 
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 74e7780..c5c522a 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -31,6 +31,7 @@
 #include "avcodec.h"
 #include "internal.h"
 #include "libavutil/base64.h"
+#include "libavutil/common.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 16df833..862fe35 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -19,7 +19,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/internal.h"
 #include "libavutil/opt.h"
+#include "libavutil/mem.h"
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
 #include "internal.h"
diff --git a/libavcodec/lpc.c b/libavcodec/lpc.c
index 0d6910f..6ce5dde 100644
--- a/libavcodec/lpc.c
+++ b/libavcodec/lpc.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/lls.h"
 
 #define LPC_USE_DOUBLE
diff --git a/libavcodec/lzw.c b/libavcodec/lzw.c
index 8761510..2c99014 100644
--- a/libavcodec/lzw.c
+++ b/libavcodec/lzw.c
@@ -29,6 +29,7 @@
 
 #include "avcodec.h"
 #include "lzw.h"
+#include "libavutil/mem.h"
 
 #define LZW_MAXBITS                 12
 #define LZW_SIZTABLE                (1<<LZW_MAXBITS)
diff --git a/libavcodec/mace.c b/libavcodec/mace.c
index 00f6f89..9d07180 100644
--- a/libavcodec/mace.c
+++ b/libavcodec/mace.c
@@ -25,6 +25,7 @@
  */
 
 #include "avcodec.h"
+#include "libavutil/common.h"
 
 /*
  * Adapted to libavcodec by Francois Revol <revol at free.fr>
diff --git a/libavcodec/motion-test.c b/libavcodec/motion-test.c
index ccf14f4..4c80368 100644
--- a/libavcodec/motion-test.c
+++ b/libavcodec/motion-test.c
@@ -31,7 +31,9 @@
 
 #include "config.h"
 #include "dsputil.h"
+#include "libavutil/internal.h"
 #include "libavutil/lfg.h"
+#include "libavutil/mem.h"
 #include "libavutil/time.h"
 
 #undef printf
diff --git a/libavcodec/movsub_bsf.c b/libavcodec/movsub_bsf.c
index 423ebeb..506750f 100644
--- a/libavcodec/movsub_bsf.c
+++ b/libavcodec/movsub_bsf.c
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
diff --git a/libavcodec/mp3_header_compress_bsf.c b/libavcodec/mp3_header_compress_bsf.c
index bc3659e..06a7ebe 100644
--- a/libavcodec/mp3_header_compress_bsf.c
+++ b/libavcodec/mp3_header_compress_bsf.c
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 #include "mpegaudiodecheader.h"
diff --git a/libavcodec/mp3_header_decompress_bsf.c b/libavcodec/mp3_header_decompress_bsf.c
index 78025cc..8e086a1 100644
--- a/libavcodec/mp3_header_decompress_bsf.c
+++ b/libavcodec/mp3_header_decompress_bsf.c
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 #include "mpegaudiodecheader.h"
diff --git a/libavcodec/mpegaudio_parser.c b/libavcodec/mpegaudio_parser.c
index 2a01e1a..c904873 100644
--- a/libavcodec/mpegaudio_parser.c
+++ b/libavcodec/mpegaudio_parser.c
@@ -22,6 +22,7 @@
 
 #include "parser.h"
 #include "mpegaudiodecheader.h"
+#include "libavutil/common.h"
 
 
 typedef struct MpegAudioParseContext {
diff --git a/libavcodec/msvideo1.c b/libavcodec/msvideo1.c
index ea2cf14..0d772b9 100644
--- a/libavcodec/msvideo1.c
+++ b/libavcodec/msvideo1.c
@@ -31,6 +31,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "libavutil/internal.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
diff --git a/libavcodec/noise_bsf.c b/libavcodec/noise_bsf.c
index 489e3c7..3e552e2 100644
--- a/libavcodec/noise_bsf.c
+++ b/libavcodec/noise_bsf.c
@@ -18,7 +18,11 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <stdlib.h>
+#include <string.h>
+
 #include "avcodec.h"
+#include "libavutil/mem.h"
 
 
 static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c
index d62bb18..b74ee31 100644
--- a/libavcodec/nuv.c
+++ b/libavcodec/nuv.c
@@ -23,6 +23,7 @@
 #include <stdlib.h>
 
 #include "libavutil/bswap.h"
+#include "libavutil/common.h"
 #include "libavutil/lzo.h"
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
diff --git a/libavcodec/options.c b/libavcodec/options.c
index abbca0b..8b1f6a3 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -27,8 +27,10 @@
 #include "avcodec.h"
 #include "internal.h"
 #include "libavutil/avassert.h"
+#include "libavutil/mem.h"
 #include "libavutil/opt.h"
 #include <float.h>              /* FLT_MIN, FLT_MAX */
+#include <string.h>
 
 #include "options_table.h"
 
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 45acd4c..afd6f37 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -25,6 +25,7 @@
 
 #include "libavutil/opt.h"
 #include "avcodec.h"
+#include "config.h"
 
 #define OFFSET(x) offsetof(AVCodecContext,x)
 #define DEFAULT 0 //should be NAN but it does not work as it is not a constant in glibc as required by ANSI/ISO C
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index bd997ab..29904f9 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -20,7 +20,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <string.h>
+
 #include "parser.h"
+#include "libavutil/mem.h"
 
 static AVCodecParser *av_first_parser = NULL;
 
diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c
index 13572dd..f60d0e0 100644
--- a/libavcodec/pnm.c
+++ b/libavcodec/pnm.c
@@ -19,6 +19,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <stdlib.h>
+#include <string.h>
+
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
 #include "pnm.h"
diff --git a/libavcodec/ppc/fmtconvert_altivec.c b/libavcodec/ppc/fmtconvert_altivec.c
index 9759a2b..db2c258 100644
--- a/libavcodec/ppc/fmtconvert_altivec.c
+++ b/libavcodec/ppc/fmtconvert_altivec.c
@@ -21,6 +21,7 @@
 #include "libavcodec/fmtconvert.h"
 
 #include "libavutil/ppc/util_altivec.h"
+#include "libavutil/mem.h"
 #include "dsputil_altivec.h"
 
 static void int32_to_float_fmul_scalar_altivec(float *dst, const int *src,
diff --git a/libavcodec/ppc/gmc_altivec.c b/libavcodec/ppc/gmc_altivec.c
index 45243c2..f86964b 100644
--- a/libavcodec/ppc/gmc_altivec.c
+++ b/libavcodec/ppc/gmc_altivec.c
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/mem.h"
 #include "libavutil/ppc/types_altivec.h"
 #include "libavutil/ppc/util_altivec.h"
 #include "libavcodec/dsputil.h"
diff --git a/libavcodec/ppc/h264_altivec_template.c b/libavcodec/ppc/h264_altivec_template.c
index 2a8f4bf..0964bbe 100644
--- a/libavcodec/ppc/h264_altivec_template.c
+++ b/libavcodec/ppc/h264_altivec_template.c
@@ -18,6 +18,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/mem.h"
+
 #ifdef DEBUG
 #define ASSERT_ALIGNED(ptr) assert(((unsigned long)ptr&0x0000000F));
 #else
diff --git a/libavcodec/ppc/vp8dsp_altivec.c b/libavcodec/ppc/vp8dsp_altivec.c
index f570000..4336453 100644
--- a/libavcodec/ppc/vp8dsp_altivec.c
+++ b/libavcodec/ppc/vp8dsp_altivec.c
@@ -21,6 +21,7 @@
  */
 
 #include "libavutil/cpu.h"
+#include "libavutil/mem.h"
 #include "libavutil/ppc/types_altivec.h"
 #include "libavutil/ppc/util_altivec.h"
 #include "libavcodec/vp8dsp.h"
diff --git a/libavcodec/proresdsp.c b/libavcodec/proresdsp.c
index 99adf64..39d1206 100644
--- a/libavcodec/proresdsp.c
+++ b/libavcodec/proresdsp.c
@@ -22,6 +22,7 @@
 
 #include "proresdsp.h"
 #include "simple_idct.h"
+#include "libavutil/common.h"
 
 #define BIAS     (1 << (PRORES_BITS_PER_SAMPLE - 1))           ///< bias value for converting signed pixels into unsigned ones
 #define CLIP_MIN (1 << (PRORES_BITS_PER_SAMPLE - 8))           ///< minimum value for clipping resulting pixels
diff --git a/libavcodec/psymodel.c b/libavcodec/psymodel.c
index d145a53..a2af611 100644
--- a/libavcodec/psymodel.c
+++ b/libavcodec/psymodel.c
@@ -19,9 +19,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <string.h>
+
 #include "avcodec.h"
 #include "psymodel.h"
 #include "iirfilter.h"
+#include "libavutil/mem.h"
 
 extern const FFPsyModel ff_aac_psy_model;
 
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index c7edb9e..fd2dc18 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -52,6 +52,7 @@
 #include "avcodec.h"
 #include "internal.h"
 #include "thread.h"
+#include "libavutil/common.h"
 
 #if HAVE_PTHREADS
 #include <pthread.h>
diff --git a/libavcodec/ptx.c b/libavcodec/ptx.c
index 51a69f9..e0f5a1b 100644
--- a/libavcodec/ptx.c
+++ b/libavcodec/ptx.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c
index 0228c52..9e8c204 100644
--- a/libavcodec/qdrw.c
+++ b/libavcodec/qdrw.c
@@ -24,6 +24,7 @@
  * Apple QuickDraw codec.
  */
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
diff --git a/libavcodec/r210dec.c b/libavcodec/r210dec.c
index d85e970..5b87ebd 100644
--- a/libavcodec/r210dec.c
+++ b/libavcodec/r210dec.c
@@ -22,6 +22,7 @@
 
 #include "avcodec.h"
 #include "libavutil/bswap.h"
+#include "libavutil/common.h"
 
 static av_cold int decode_init(AVCodecContext *avctx)
 {
diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c
index 8b5ea3a..3c76a0a 100644
--- a/libavcodec/ra144.c
+++ b/libavcodec/ra144.c
@@ -23,6 +23,7 @@
 #include "avcodec.h"
 #include "celp_filters.h"
 #include "ra144.h"
+#include "libavutil/common.h"
 
 const int16_t ff_gain_val_tab[256][3] = {
     { 541, 956,  768}, { 877, 581,  568}, { 675,1574,  635}, {1248,1464,  668},
diff --git a/libavcodec/ra288.h b/libavcodec/ra288.h
index 5e44c82..8083580 100644
--- a/libavcodec/ra288.h
+++ b/libavcodec/ra288.h
@@ -24,6 +24,7 @@
 
 #include <stdint.h>
 #include "dsputil.h"
+#include "libavutil/common.h"
 
 static const float amptable[8]={
      0.515625,  0.90234375,  1.57910156,  2.76342773,
diff --git a/libavcodec/raw.c b/libavcodec/raw.c
index c41f756..ecf5365 100644
--- a/libavcodec/raw.c
+++ b/libavcodec/raw.c
@@ -26,6 +26,7 @@
 
 #include "avcodec.h"
 #include "raw.h"
+#include "libavutil/common.h"
 
 const PixelFormatTag ff_raw_pix_fmt_tags[] = {
     { PIX_FMT_YUV420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index e8a6a3b..6f4c0ce 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -27,6 +27,7 @@
 #include "avcodec.h"
 #include "imgconvert.h"
 #include "raw.h"
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/imgutils.h"
 
diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c
index 56edf50..927d6f6 100644
--- a/libavcodec/rawenc.c
+++ b/libavcodec/rawenc.c
@@ -29,6 +29,7 @@
 #include "internal.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/intreadwrite.h"
+#include "libavutil/internal.h"
 
 static av_cold int raw_init_encoder(AVCodecContext *avctx)
 {
diff --git a/libavcodec/resample.c b/libavcodec/resample.c
index eacffed..ca6a84d 100644
--- a/libavcodec/resample.c
+++ b/libavcodec/resample.c
@@ -24,9 +24,12 @@
  * samplerate conversion for both audio and video
  */
 
+#include <string.h>
+
 #include "avcodec.h"
 #include "audioconvert.h"
 #include "libavutil/opt.h"
+#include "libavutil/mem.h"
 #include "libavutil/samplefmt.h"
 
 #define MAX_CHANNELS 8
diff --git a/libavcodec/resample2.c b/libavcodec/resample2.c
index 48c20c2..79e6279 100644
--- a/libavcodec/resample2.c
+++ b/libavcodec/resample2.c
@@ -27,6 +27,7 @@
 
 #include "avcodec.h"
 #include "dsputil.h"
+#include "libavutil/common.h"
 
 #ifndef CONFIG_RESAMPLE_HP
 #define FILTER_SHIFT 15
diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c
index 9f9ecc2..57015e7 100644
--- a/libavcodec/rl2.c
+++ b/libavcodec/rl2.c
@@ -30,7 +30,9 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "libavutil/internal.h"
 #include "libavutil/intreadwrite.h"
+#include "libavutil/mem.h"
 #include "avcodec.h"
 
 
diff --git a/libavcodec/rle.c b/libavcodec/rle.c
index 8a009e7..cbbde93 100644
--- a/libavcodec/rle.c
+++ b/libavcodec/rle.c
@@ -20,6 +20,7 @@
  */
 #include "avcodec.h"
 #include "rle.h"
+#include "libavutil/common.h"
 
 /**
  * Count up to 127 consecutive pixels which are either all the same or
diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c
index 79e993a..9337360 100644
--- a/libavcodec/rpza.c
+++ b/libavcodec/rpza.c
@@ -38,6 +38,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "libavutil/internal.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
diff --git a/libavcodec/rtjpeg.h b/libavcodec/rtjpeg.h
index d159895..18f843b 100644
--- a/libavcodec/rtjpeg.h
+++ b/libavcodec/rtjpeg.h
@@ -24,6 +24,7 @@
 
 #include <stdint.h>
 #include "dsputil.h"
+#include "libavutil/mem.h"
 
 #define RTJPEG_FILE_VERSION 0
 #define RTJPEG_HEADER_SIZE 12
diff --git a/libavcodec/rv34dsp.c b/libavcodec/rv34dsp.c
index 1ddcea4..ac14ed9 100644
--- a/libavcodec/rv34dsp.c
+++ b/libavcodec/rv34dsp.c
@@ -26,6 +26,7 @@
  */
 #include "dsputil.h"
 #include "rv34dsp.h"
+#include "libavutil/common.h"
 
 /**
  * @name RV30/40 inverse transform functions
diff --git a/libavcodec/rv40dsp.c b/libavcodec/rv40dsp.c
index 19a18d3..762f714 100644
--- a/libavcodec/rv40dsp.c
+++ b/libavcodec/rv40dsp.c
@@ -27,6 +27,7 @@
 #include "avcodec.h"
 #include "dsputil.h"
 #include "rv34dsp.h"
+#include "libavutil/common.h"
 
 #define RV40_LOWPASS(OPNAME, OP) \
 static av_unused void OPNAME ## rv40_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride,\
diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c
index bffd3c6..087e948 100644
--- a/libavcodec/s302m.c
+++ b/libavcodec/s302m.c
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
diff --git a/libavcodec/sinewin_tablegen.h b/libavcodec/sinewin_tablegen.h
index 7d92026..1ee225b 100644
--- a/libavcodec/sinewin_tablegen.h
+++ b/libavcodec/sinewin_tablegen.h
@@ -28,6 +28,7 @@
 // for the host and the target and config.h is only valid for the target
 #include <math.h>
 #include "libavutil/attributes.h"
+#include "libavutil/common.h"
 
 #if !CONFIG_HARDCODED_TABLES
 SINETABLE(  32);
diff --git a/libavcodec/sipr.h b/libavcodec/sipr.h
index 9515321..5007c75 100644
--- a/libavcodec/sipr.h
+++ b/libavcodec/sipr.h
@@ -27,6 +27,7 @@
 #include "avcodec.h"
 #include "dsputil.h"
 #include "acelp_pitch_delay.h"
+#include "libavutil/mem.h"
 
 #define LP_FILTER_ORDER_16k  16
 #define L_SUBFR_16k          80
diff --git a/libavcodec/sipr16k.c b/libavcodec/sipr16k.c
index ca10cd9..bd0600c 100644
--- a/libavcodec/sipr16k.c
+++ b/libavcodec/sipr16k.c
@@ -24,6 +24,7 @@
 #include <math.h>
 
 #include "sipr.h"
+#include "libavutil/common.h"
 #include "libavutil/mathematics.h"
 #include "lsp.h"
 #include "celp_math.h"
diff --git a/libavcodec/srtdec.c b/libavcodec/srtdec.c
index a5c46af..bbc8061 100644
--- a/libavcodec/srtdec.c
+++ b/libavcodec/srtdec.c
@@ -20,6 +20,7 @@
  */
 
 #include "libavutil/avstring.h"
+#include "libavutil/common.h"
 #include "libavutil/parseutils.h"
 #include "avcodec.h"
 #include "ass.h"
diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c
index 441e689..43c93af 100644
--- a/libavcodec/sunrast.c
+++ b/libavcodec/sunrast.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
diff --git a/libavcodec/targaenc.c b/libavcodec/targaenc.c
index c2045ef..1d9b5bd 100644
--- a/libavcodec/targaenc.c
+++ b/libavcodec/targaenc.c
@@ -19,6 +19,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <string.h>
+
+#include "libavutil/internal.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 8825c47..f60c65e 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -26,6 +26,7 @@
  */
 
 #include "avcodec.h"
+#include "config.h"
 #if CONFIG_ZLIB
 #include <zlib.h>
 #endif
diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c
index 2404f7f..6938944 100644
--- a/libavcodec/tiffenc.c
+++ b/libavcodec/tiffenc.c
@@ -29,6 +29,7 @@
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
+#include "config.h"
 #if CONFIG_ZLIB
 #include <zlib.h>
 #endif
diff --git a/libavcodec/tmv.c b/libavcodec/tmv.c
index 908e5cf..396dff0 100644
--- a/libavcodec/tmv.c
+++ b/libavcodec/tmv.c
@@ -26,7 +26,10 @@
  * @see http://www.oldskool.org/pc/8088_Corruption
  */
 
+#include <string.h>
+
 #include "avcodec.h"
+#include "libavutil/internal.h"
 
 #include "cga_data.h"
 
diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c
index 8738736..6525ddc 100644
--- a/libavcodec/truemotion1.c
+++ b/libavcodec/truemotion1.c
@@ -36,6 +36,8 @@
 #include "avcodec.h"
 #include "dsputil.h"
 #include "libavutil/imgutils.h"
+#include "libavutil/internal.h"
+#include "libavutil/mem.h"
 
 #include "truemotion1data.h"
 
diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c
index 8d70823..dad8618 100644
--- a/libavcodec/v210dec.c
+++ b/libavcodec/v210dec.c
@@ -23,6 +23,8 @@
 
 #include "avcodec.h"
 #include "libavutil/bswap.h"
+#include "libavutil/internal.h"
+#include "libavutil/mem.h"
 
 static av_cold int decode_init(AVCodecContext *avctx)
 {
diff --git a/libavcodec/v210x.c b/libavcodec/v210x.c
index 75449cd..9fd4f7a 100644
--- a/libavcodec/v210x.c
+++ b/libavcodec/v210x.c
@@ -20,6 +20,8 @@
 
 #include "avcodec.h"
 #include "libavutil/bswap.h"
+#include "libavutil/internal.h"
+#include "libavutil/mem.h"
 
 static av_cold int decode_init(AVCodecContext *avctx)
 {
diff --git a/libavcodec/v410dec.c b/libavcodec/v410dec.c
index d23c590..09d09d0 100644
--- a/libavcodec/v410dec.c
+++ b/libavcodec/v410dec.c
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
diff --git a/libavcodec/v410enc.c b/libavcodec/v410enc.c
index 76aedcb..fce1f8b 100644
--- a/libavcodec/v410enc.c
+++ b/libavcodec/v410enc.c
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 #include "internal.h"
diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c
index 7b50af6..ffbf62f 100644
--- a/libavcodec/vc1dsp.c
+++ b/libavcodec/vc1dsp.c
@@ -26,6 +26,7 @@
  */
 
 #include "vc1dsp.h"
+#include "libavutil/common.h"
 
 
 /** Apply overlap transform to horizontal edge
diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c
index d1d63b5..cc742f0 100644
--- a/libavcodec/vcr1.c
+++ b/libavcodec/vcr1.c
@@ -26,6 +26,7 @@
 
 #include "avcodec.h"
 #include "dsputil.h"
+#include "libavutil/internal.h"
 
 typedef struct VCR1Context {
     AVFrame picture;
diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
index d744cc3..fce7aec 100644
--- a/libavcodec/vmdav.c
+++ b/libavcodec/vmdav.c
@@ -43,6 +43,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
diff --git a/libavcodec/vmnc.c b/libavcodec/vmnc.c
index bf12739..be6c66c 100644
--- a/libavcodec/vmnc.c
+++ b/libavcodec/vmnc.c
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
diff --git a/libavcodec/vorbis_data.c b/libavcodec/vorbis_data.c
index bd27b82..98c7a59 100644
--- a/libavcodec/vorbis_data.c
+++ b/libavcodec/vorbis_data.c
@@ -21,6 +21,7 @@
 #include "dsputil.h"
 #include "vorbis.h"
 #include "libavutil/audioconvert.h"
+#include "libavutil/mem.h"
 
 const uint8_t ff_vorbis_channel_layout_offsets[8][8] = {
     { 0 },
diff --git a/libavcodec/vp3dsp.c b/libavcodec/vp3dsp.c
index 395526e..9b0b5d0 100644
--- a/libavcodec/vp3dsp.c
+++ b/libavcodec/vp3dsp.c
@@ -25,6 +25,7 @@
  */
 
 #include "libavutil/attributes.h"
+#include "libavutil/common.h"
 #include "avcodec.h"
 #include "dsputil.h"
 #include "vp3dsp.h"
diff --git a/libavcodec/vp56dsp.c b/libavcodec/vp56dsp.c
index 7f13605..e208a03 100644
--- a/libavcodec/vp56dsp.c
+++ b/libavcodec/vp56dsp.c
@@ -22,6 +22,7 @@
 #include <stdint.h>
 #include "avcodec.h"
 #include "vp56dsp.h"
+#include "libavutil/common.h"
 
 /* Gives very similar result than the vp6 version except in a few cases */
 static int vp5_adjust(int v, int t)
diff --git a/libavcodec/vp8dsp.c b/libavcodec/vp8dsp.c
index f6c9443..3700cc3 100644
--- a/libavcodec/vp8dsp.c
+++ b/libavcodec/vp8dsp.c
@@ -26,6 +26,7 @@
 
 #include "dsputil.h"
 #include "vp8dsp.h"
+#include "libavutil/common.h"
 
 // TODO: Maybe add dequant
 static void vp8_luma_dc_wht_c(DCTELEM block[4][4][16], DCTELEM dc[16])
diff --git a/libavcodec/ws-snd1.c b/libavcodec/ws-snd1.c
index d9ca77d..880ae85 100644
--- a/libavcodec/ws-snd1.c
+++ b/libavcodec/ws-snd1.c
@@ -20,6 +20,7 @@
  */
 
 #include <stdint.h>
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
diff --git a/libavcodec/x86/idct_mmx_xvid.c b/libavcodec/x86/idct_mmx_xvid.c
index e4c778c..23180b2 100644
--- a/libavcodec/x86/idct_mmx_xvid.c
+++ b/libavcodec/x86/idct_mmx_xvid.c
@@ -40,7 +40,10 @@
  */
 
 #include <inttypes.h>
+
+#include "config.h"
 #include "libavcodec/avcodec.h"
+#include "libavutil/mem.h"
 #include "idct_xvid.h"
 
 #if HAVE_INLINE_ASM
diff --git a/libavcodec/x86/idct_sse2_xvid.c b/libavcodec/x86/idct_sse2_xvid.c
index b58db79..fe2478e 100644
--- a/libavcodec/x86/idct_sse2_xvid.c
+++ b/libavcodec/x86/idct_sse2_xvid.c
@@ -39,6 +39,8 @@
  */
 
 #include "libavcodec/dsputil.h"
+#include "libavutil/internal.h"
+#include "libavutil/mem.h"
 #include "libavutil/x86/asm.h"
 #include "idct_xvid.h"
 #include "dsputil_mmx.h"
diff --git a/libavcodec/x86/lpc_mmx.c b/libavcodec/x86/lpc_mmx.c
index 609f4e5..82f7761 100644
--- a/libavcodec/x86/lpc_mmx.c
+++ b/libavcodec/x86/lpc_mmx.c
@@ -21,6 +21,7 @@
 
 #include "libavutil/x86/asm.h"
 #include "libavutil/cpu.h"
+#include "libavutil/internal.h"
 #include "libavcodec/lpc.h"
 
 #if HAVE_INLINE_ASM
diff --git a/libavcodec/x86/mlpdsp.c b/libavcodec/x86/mlpdsp.c
index d793c7d..f81c329 100644
--- a/libavcodec/x86/mlpdsp.c
+++ b/libavcodec/x86/mlpdsp.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/internal.h"
 #include "libavutil/x86/asm.h"
 #include "libavcodec/dsputil.h"
 #include "libavcodec/mlp.h"
diff --git a/libavcodec/x86/motion_est_mmx.c b/libavcodec/x86/motion_est_mmx.c
index c3136eb..6eb44d4 100644
--- a/libavcodec/x86/motion_est_mmx.c
+++ b/libavcodec/x86/motion_est_mmx.c
@@ -22,6 +22,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/internal.h"
+#include "libavutil/mem.h"
 #include "libavutil/x86/asm.h"
 #include "libavcodec/dsputil.h"
 #include "dsputil_mmx.h"
diff --git a/libavcodec/x86/rv40dsp_init.c b/libavcodec/x86/rv40dsp_init.c
index bee3365..cf52b41 100644
--- a/libavcodec/x86/rv40dsp_init.c
+++ b/libavcodec/x86/rv40dsp_init.c
@@ -27,6 +27,7 @@
  */
 
 #include "libavcodec/rv34dsp.h"
+#include "libavutil/mem.h"
 #include "dsputil_mmx.h"
 
 void ff_put_rv40_chroma_mc8_mmx  (uint8_t *dst, uint8_t *src,
diff --git a/libavcodec/x86/simple_idct_mmx.c b/libavcodec/x86/simple_idct_mmx.c
index f455eb8..0e80933 100644
--- a/libavcodec/x86/simple_idct_mmx.c
+++ b/libavcodec/x86/simple_idct_mmx.c
@@ -21,6 +21,8 @@
  */
 #include "libavcodec/dsputil.h"
 #include "libavcodec/simple_idct.h"
+#include "libavutil/internal.h"
+#include "libavutil/mem.h"
 #include "dsputil_mmx.h"
 
 #if HAVE_INLINE_ASM
diff --git a/libavcodec/x86/vc1dsp_mmx.c b/libavcodec/x86/vc1dsp_mmx.c
index 9200798..f7ca714 100644
--- a/libavcodec/x86/vc1dsp_mmx.c
+++ b/libavcodec/x86/vc1dsp_mmx.c
@@ -25,6 +25,8 @@
  */
 
 #include "libavutil/cpu.h"
+#include "libavutil/internal.h"
+#include "libavutil/mem.h"
 #include "libavutil/x86/asm.h"
 #include "libavcodec/dsputil.h"
 #include "dsputil_mmx.h"
diff --git a/libavcodec/x86/vp8dsp-init.c b/libavcodec/x86/vp8dsp-init.c
index 4568a38..04cfecc 100644
--- a/libavcodec/x86/vp8dsp-init.c
+++ b/libavcodec/x86/vp8dsp-init.c
@@ -21,6 +21,7 @@
  */
 
 #include "libavutil/cpu.h"
+#include "libavutil/mem.h"
 #include "libavutil/x86/asm.h"
 #include "libavcodec/vp8dsp.h"
 
diff --git a/libavcodec/xbmenc.c b/libavcodec/xbmenc.c
index 358a25a..98afdcd 100644
--- a/libavcodec/xbmenc.c
+++ b/libavcodec/xbmenc.c
@@ -22,6 +22,7 @@
 
 #include "avcodec.h"
 #include "internal.h"
+#include "libavutil/common.h"
 
 static av_cold int xbm_encode_init(AVCodecContext *avctx)
 {
diff --git a/libavcodec/xl.c b/libavcodec/xl.c
index 6f6729b..7ba2413 100644
--- a/libavcodec/xl.c
+++ b/libavcodec/xl.c
@@ -24,6 +24,7 @@
  * Miro VideoXL codec.
  */
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
diff --git a/libavcodec/zerocodec.c b/libavcodec/zerocodec.c
index c8c2453..789181c 100644
--- a/libavcodec/zerocodec.c
+++ b/libavcodec/zerocodec.c
@@ -19,6 +19,7 @@
 #include <zlib.h>
 
 #include "avcodec.h"
+#include "libavutil/common.h"
 
 typedef struct {
     AVFrame  previous_frame;
diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
index 4557cb1..b95a518 100644
--- a/libavcodec/zmbv.c
+++ b/libavcodec/zmbv.c
@@ -27,6 +27,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c
index 85651be..ae91c19 100644
--- a/libavcodec/zmbvenc.c
+++ b/libavcodec/zmbvenc.c
@@ -27,6 +27,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 #include "internal.h"
diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c
index 4813a3d..5a5c762 100644
--- a/libavdevice/avdevice.c
+++ b/libavdevice/avdevice.c
@@ -17,6 +17,7 @@
  */
 
 #include "avdevice.h"
+#include "config.h"
 
 unsigned avdevice_version(void)
 {
diff --git a/libavdevice/timefilter.c b/libavdevice/timefilter.c
index cf9d2c6..649d3c2 100644
--- a/libavdevice/timefilter.c
+++ b/libavdevice/timefilter.c
@@ -22,6 +22,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/mem.h"
 #include "config.h"
 #include "timefilter.h"
diff --git a/libavfilter/af_aformat.c b/libavfilter/af_aformat.c
index 6c46f4b..9e69fd0 100644
--- a/libavfilter/af_aformat.c
+++ b/libavfilter/af_aformat.c
@@ -25,6 +25,7 @@
 
 #include "libavutil/audioconvert.h"
 #include "libavutil/avstring.h"
+#include "libavutil/common.h"
 #include "libavutil/opt.h"
 
 #include "audio.h"
diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c
index d79a626..7bb43ea 100644
--- a/libavfilter/af_amix.c
+++ b/libavfilter/af_amix.c
@@ -32,6 +32,7 @@
 #include "libavutil/audio_fifo.h"
 #include "libavutil/avassert.h"
 #include "libavutil/avstring.h"
+#include "libavutil/common.h"
 #include "libavutil/float_dsp.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
diff --git a/libavfilter/af_anull.c b/libavfilter/af_anull.c
index 462ad68..7082adb 100644
--- a/libavfilter/af_anull.c
+++ b/libavfilter/af_anull.c
@@ -24,6 +24,7 @@
 #include "audio.h"
 #include "avfilter.h"
 #include "internal.h"
+#include "libavutil/internal.h"
 
 AVFilter avfilter_af_anull = {
     .name      = "anull",
diff --git a/libavfilter/af_asyncts.c b/libavfilter/af_asyncts.c
index 21850dd..b58e249 100644
--- a/libavfilter/af_asyncts.c
+++ b/libavfilter/af_asyncts.c
@@ -18,6 +18,7 @@
 
 #include "libavresample/avresample.h"
 #include "libavutil/audio_fifo.h"
+#include "libavutil/common.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 #include "libavutil/samplefmt.h"
diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c
index b5cd96a..3e945d6 100644
--- a/libavfilter/af_channelmap.c
+++ b/libavfilter/af_channelmap.c
@@ -27,6 +27,7 @@
 
 #include "libavutil/audioconvert.h"
 #include "libavutil/avstring.h"
+#include "libavutil/common.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 #include "libavutil/samplefmt.h"
diff --git a/libavfilter/af_channelsplit.c b/libavfilter/af_channelsplit.c
index 32b85d8..68615aa 100644
--- a/libavfilter/af_channelsplit.c
+++ b/libavfilter/af_channelsplit.c
@@ -24,6 +24,7 @@
  */
 
 #include "libavutil/audioconvert.h"
+#include "libavutil/internal.h"
 #include "libavutil/opt.h"
 
 #include "audio.h"
diff --git a/libavfilter/af_join.c b/libavfilter/af_join.c
index f25ec92..c44788b 100644
--- a/libavfilter/af_join.c
+++ b/libavfilter/af_join.c
@@ -27,6 +27,7 @@
 
 #include "libavutil/audioconvert.h"
 #include "libavutil/avassert.h"
+#include "libavutil/common.h"
 #include "libavutil/opt.h"
 
 #include "audio.h"
diff --git a/libavfilter/af_resample.c b/libavfilter/af_resample.c
index 1360c1c..eb2d2f9 100644
--- a/libavfilter/af_resample.c
+++ b/libavfilter/af_resample.c
@@ -24,6 +24,7 @@
 
 #include "libavutil/avassert.h"
 #include "libavutil/avstring.h"
+#include "libavutil/common.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 9c22b4f..94b3115 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -20,6 +20,7 @@
  */
 
 #include "avfilter.h"
+#include "config.h"
 
 
 #define REGISTER_FILTER(X,x,y) { \
diff --git a/libavfilter/asink_anullsink.c b/libavfilter/asink_anullsink.c
index 557655f..cada5c5 100644
--- a/libavfilter/asink_anullsink.c
+++ b/libavfilter/asink_anullsink.c
@@ -16,6 +16,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/internal.h"
 #include "avfilter.h"
 #include "internal.h"
 
diff --git a/libavfilter/asrc_anullsrc.c b/libavfilter/asrc_anullsrc.c
index 20489e7..6627c33 100644
--- a/libavfilter/asrc_anullsrc.c
+++ b/libavfilter/asrc_anullsrc.c
@@ -21,9 +21,13 @@
  * null audio source
  */
 
+#include <inttypes.h>
+#include <stdio.h>
+
 #include "avfilter.h"
 #include "internal.h"
 #include "libavutil/audioconvert.h"
+#include "libavutil/internal.h"
 
 typedef struct {
     uint64_t channel_layout;
diff --git a/libavfilter/audio.c b/libavfilter/audio.c
index bd718c6..66010c1 100644
--- a/libavfilter/audio.c
+++ b/libavfilter/audio.c
@@ -17,6 +17,7 @@
  */
 
 #include "libavutil/audioconvert.h"
+#include "libavutil/common.h"
 
 #include "audio.h"
 #include "avfilter.h"
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index d302264..77b3633 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -21,6 +21,7 @@
 
 /* #define DEBUG */
 
+#include "libavutil/common.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/rational.h"
 #include "libavutil/audioconvert.h"
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index a0aa807..525a1dc 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -30,6 +30,7 @@
 
 #include "libavutil/audioconvert.h"
 #include "libavutil/avassert.h"
+#include "libavutil/common.h"
 #include "libavutil/log.h"
 
 static const AVClass filtergraph_class = {
diff --git a/libavfilter/buffer.c b/libavfilter/buffer.c
index e3ebc9b..c939388 100644
--- a/libavfilter/buffer.c
+++ b/libavfilter/buffer.c
@@ -17,6 +17,7 @@
  */
 
 #include "libavutil/audioconvert.h"
+#include "libavutil/common.h"
 #include "libavcodec/avcodec.h"
 
 #include "avfilter.h"
diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c
index 04320b5..d62b081 100644
--- a/libavfilter/buffersink.c
+++ b/libavfilter/buffersink.c
@@ -26,6 +26,7 @@
 #include "libavutil/audio_fifo.h"
 #include "libavutil/audioconvert.h"
 #include "libavutil/avassert.h"
+#include "libavutil/common.h"
 #include "libavutil/mathematics.h"
 
 #include "audio.h"
diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
index 33cb63b..5f4e9b7 100644
--- a/libavfilter/buffersrc.c
+++ b/libavfilter/buffersrc.c
@@ -31,6 +31,7 @@
 #include "video.h"
 
 #include "libavutil/audioconvert.h"
+#include "libavutil/common.h"
 #include "libavutil/fifo.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/opt.h"
diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index 6aaf5c5..6071024 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -16,8 +16,11 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <string.h>
+
 #include "libavutil/avutil.h"
 #include "libavutil/colorspace.h"
+#include "libavutil/mem.h"
 #include "libavutil/pixdesc.h"
 #include "drawutils.h"
 
diff --git a/libavfilter/fifo.c b/libavfilter/fifo.c
index 3226a0d..bf78bb6 100644
--- a/libavfilter/fifo.c
+++ b/libavfilter/fifo.c
@@ -25,6 +25,7 @@
 
 #include "libavutil/avassert.h"
 #include "libavutil/audioconvert.h"
+#include "libavutil/common.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/samplefmt.h"
 
diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index 3ec6839..98cda8b 100644
--- a/libavfilter/formats.c
+++ b/libavfilter/formats.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
 #include "internal.h"
diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c
index 4915529..3921189 100644
--- a/libavfilter/graphparser.c
+++ b/libavfilter/graphparser.c
@@ -22,8 +22,10 @@
 
 #include <ctype.h>
 #include <string.h>
+#include <stdio.h>
 
 #include "libavutil/avstring.h"
+#include "libavutil/mem.h"
 #include "avfilter.h"
 #include "avfiltergraph.h"
 
diff --git a/libavfilter/split.c b/libavfilter/split.c
index 084d555..8822409 100644
--- a/libavfilter/split.c
+++ b/libavfilter/split.c
@@ -23,6 +23,10 @@
  * audio and video splitter
  */
 
+#include <stdio.h>
+
+#include "libavutil/internal.h"
+#include "libavutil/mem.h"
 #include "avfilter.h"
 #include "audio.h"
 #include "internal.h"
diff --git a/libavfilter/vf_aspect.c b/libavfilter/vf_aspect.c
index 8738b0a..04c854d 100644
--- a/libavfilter/vf_aspect.c
+++ b/libavfilter/vf_aspect.c
@@ -23,6 +23,7 @@
  * aspect ratio modification video filters
  */
 
+#include "libavutil/common.h"
 #include "libavutil/mathematics.h"
 #include "avfilter.h"
 #include "internal.h"
diff --git a/libavfilter/vf_blackframe.c b/libavfilter/vf_blackframe.c
index bf0b18b..65443fc 100644
--- a/libavfilter/vf_blackframe.c
+++ b/libavfilter/vf_blackframe.c
@@ -27,6 +27,10 @@
  * Ported from MPlayer libmpcodecs/vf_blackframe.c.
  */
 
+#include <stdio.h>
+#include <inttypes.h>
+
+#include "libavutil/internal.h"
 #include "avfilter.h"
 #include "formats.h"
 #include "internal.h"
diff --git a/libavfilter/vf_boxblur.c b/libavfilter/vf_boxblur.c
index 0247e93..cfe33da 100644
--- a/libavfilter/vf_boxblur.c
+++ b/libavfilter/vf_boxblur.c
@@ -26,6 +26,7 @@
  */
 
 #include "libavutil/avstring.h"
+#include "libavutil/common.h"
 #include "libavutil/eval.h"
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
diff --git a/libavfilter/vf_copy.c b/libavfilter/vf_copy.c
index 425b0eb..243702b 100644
--- a/libavfilter/vf_copy.c
+++ b/libavfilter/vf_copy.c
@@ -21,6 +21,7 @@
  * copy video filter
  */
 
+#include "libavutil/internal.h"
 #include "avfilter.h"
 #include "internal.h"
 #include "video.h"
diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c
index 4361ba5..1c8e877 100644
--- a/libavfilter/vf_crop.c
+++ b/libavfilter/vf_crop.c
@@ -25,12 +25,15 @@
 
 /* #define DEBUG */
 
+#include <stdio.h>
+
 #include "avfilter.h"
 #include "formats.h"
 #include "internal.h"
 #include "video.h"
 #include "libavutil/eval.h"
 #include "libavutil/avstring.h"
+#include "libavutil/internal.h"
 #include "libavutil/libm.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/mathematics.h"
diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
index 8b6063c..e107f47 100644
--- a/libavfilter/vf_cropdetect.c
+++ b/libavfilter/vf_cropdetect.c
@@ -23,7 +23,10 @@
  * Ported from MPlayer libmpcodecs/vf_cropdetect.c.
  */
 
+#include <stdio.h>
+
 #include "libavutil/imgutils.h"
+#include "libavutil/internal.h"
 #include "avfilter.h"
 #include "formats.h"
 #include "internal.h"
diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c
index e8b5431..5e2cf48 100644
--- a/libavfilter/vf_delogo.c
+++ b/libavfilter/vf_delogo.c
@@ -25,6 +25,7 @@
  * Ported from MPlayer libmpcodecs/vf_delogo.c.
  */
 
+#include "libavutil/common.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c
index 96b1c00..69fdd79 100644
--- a/libavfilter/vf_drawbox.c
+++ b/libavfilter/vf_drawbox.c
@@ -25,6 +25,7 @@
  */
 
 #include "libavutil/colorspace.h"
+#include "libavutil/common.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/parseutils.h"
 #include "avfilter.h"
diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c
index c30a862..ca84792 100644
--- a/libavfilter/vf_fade.c
+++ b/libavfilter/vf_fade.c
@@ -25,6 +25,7 @@
  * based heavily on vf_negate.c by Bobby Bingham
  */
 
+#include "libavutil/common.h"
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
 #include "formats.h"
diff --git a/libavfilter/vf_fieldorder.c b/libavfilter/vf_fieldorder.c
index 4ea7fe1..5a8e6f9 100644
--- a/libavfilter/vf_fieldorder.c
+++ b/libavfilter/vf_fieldorder.c
@@ -25,7 +25,11 @@
 
 /* #define DEBUG */
 
+#include <stdio.h>
+#include <string.h>
+
 #include "libavutil/imgutils.h"
+#include "libavutil/internal.h"
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
 #include "formats.h"
diff --git a/libavfilter/vf_format.c b/libavfilter/vf_format.c
index 8528b0b..0437bfa 100644
--- a/libavfilter/vf_format.c
+++ b/libavfilter/vf_format.c
@@ -23,6 +23,10 @@
  * format and noformat video filters
  */
 
+#include <string.h>
+
+#include "libavutil/internal.h"
+#include "libavutil/mem.h"
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
 #include "formats.h"
diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index d95fef5..7305800 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -21,6 +21,7 @@
  * a filter enforcing given constant framerate
  */
 
+#include "libavutil/common.h"
 #include "libavutil/fifo.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c
index f8896b5..2953256 100644
--- a/libavfilter/vf_gradfun.c
+++ b/libavfilter/vf_gradfun.c
@@ -33,6 +33,7 @@
  */
 
 #include "libavutil/imgutils.h"
+#include "libavutil/common.h"
 #include "libavutil/cpu.h"
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
diff --git a/libavfilter/vf_hflip.c b/libavfilter/vf_hflip.c
index 06c4248..87bfe11 100644
--- a/libavfilter/vf_hflip.c
+++ b/libavfilter/vf_hflip.c
@@ -24,11 +24,14 @@
  * horizontal flip filter
  */
 
+#include <string.h>
+
 #include "avfilter.h"
 #include "formats.h"
 #include "internal.h"
 #include "video.h"
 #include "libavutil/pixdesc.h"
+#include "libavutil/internal.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/imgutils.h"
 
diff --git a/libavfilter/vf_hqdn3d.c b/libavfilter/vf_hqdn3d.c
index 138b527..3a81f37 100644
--- a/libavfilter/vf_hqdn3d.c
+++ b/libavfilter/vf_hqdn3d.c
@@ -26,6 +26,7 @@
  * libmpcodecs/vf_hqdn3d.c.
  */
 
+#include "libavutil/common.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/intreadwrite.h"
 #include "avfilter.h"
diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c
index c56c55b..adbc0f0 100644
--- a/libavfilter/vf_lut.c
+++ b/libavfilter/vf_lut.c
@@ -24,6 +24,7 @@
  * value, and apply it to input video.
  */
 
+#include "libavutil/common.h"
 #include "libavutil/eval.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
diff --git a/libavfilter/vf_null.c b/libavfilter/vf_null.c
index 8a2a8cb..9f2e15a 100644
--- a/libavfilter/vf_null.c
+++ b/libavfilter/vf_null.c
@@ -21,6 +21,7 @@
  * null video filter
  */
 
+#include "libavutil/internal.h"
 #include "avfilter.h"
 #include "internal.h"
 #include "video.h"
diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c
index 5a8da27..6dd9be4 100644
--- a/libavfilter/vf_overlay.c
+++ b/libavfilter/vf_overlay.c
@@ -27,6 +27,7 @@
 
 #include "avfilter.h"
 #include "formats.h"
+#include "libavutil/common.h"
 #include "libavutil/eval.h"
 #include "libavutil/avstring.h"
 #include "libavutil/pixdesc.h"
diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c
index ed2e2e0..2291b13 100644
--- a/libavfilter/vf_pad.c
+++ b/libavfilter/vf_pad.c
@@ -29,6 +29,7 @@
 #include "internal.h"
 #include "video.h"
 #include "libavutil/avstring.h"
+#include "libavutil/common.h"
 #include "libavutil/eval.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/colorspace.h"
diff --git a/libavfilter/vf_pixdesctest.c b/libavfilter/vf_pixdesctest.c
index 11905e6..cf08977 100644
--- a/libavfilter/vf_pixdesctest.c
+++ b/libavfilter/vf_pixdesctest.c
@@ -23,6 +23,7 @@
  * pixdesc test filter
  */
 
+#include "libavutil/common.h"
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
 #include "internal.h"
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 6600530..949691f 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -23,12 +23,16 @@
  * scale video filter
  */
 
+#include <stdio.h>
+#include <string.h>
+
 #include "avfilter.h"
 #include "formats.h"
 #include "internal.h"
 #include "video.h"
 #include "libavutil/avstring.h"
 #include "libavutil/eval.h"
+#include "libavutil/internal.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
diff --git a/libavfilter/vf_select.c b/libavfilter/vf_select.c
index 59030eb..dabd3d1 100644
--- a/libavfilter/vf_select.c
+++ b/libavfilter/vf_select.c
@@ -25,6 +25,7 @@
 
 #include "libavutil/eval.h"
 #include "libavutil/fifo.h"
+#include "libavutil/internal.h"
 #include "libavutil/mathematics.h"
 #include "avfilter.h"
 #include "internal.h"
diff --git a/libavfilter/vf_setpts.c b/libavfilter/vf_setpts.c
index c4339b2..e347716 100644
--- a/libavfilter/vf_setpts.c
+++ b/libavfilter/vf_setpts.c
@@ -27,6 +27,7 @@
 /* #define DEBUG */
 
 #include "libavutil/eval.h"
+#include "libavutil/internal.h"
 #include "libavutil/mathematics.h"
 #include "avfilter.h"
 #include "internal.h"
diff --git a/libavfilter/vf_settb.c b/libavfilter/vf_settb.c
index 0a5ce4d..24c2a63 100644
--- a/libavfilter/vf_settb.c
+++ b/libavfilter/vf_settb.c
@@ -23,8 +23,12 @@
  * Set timebase for the output link.
  */
 
+#include <inttypes.h>
+#include <stdio.h>
+
 #include "libavutil/avstring.h"
 #include "libavutil/eval.h"
+#include "libavutil/internal.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/rational.h"
 #include "avfilter.h"
diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
index 254141d..b53ccd1 100644
--- a/libavfilter/vf_showinfo.c
+++ b/libavfilter/vf_showinfo.c
@@ -24,6 +24,7 @@
 
 #include "libavutil/adler32.h"
 #include "libavutil/imgutils.h"
+#include "libavutil/internal.h"
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
 #include "internal.h"
diff --git a/libavfilter/vf_slicify.c b/libavfilter/vf_slicify.c
index 3c69cfd..e0e2718 100644
--- a/libavfilter/vf_slicify.c
+++ b/libavfilter/vf_slicify.c
@@ -26,6 +26,7 @@
 #include "avfilter.h"
 #include "internal.h"
 #include "video.h"
+#include "libavutil/common.h"
 #include "libavutil/pixdesc.h"
 
 typedef struct {
diff --git a/libavfilter/vf_transpose.c b/libavfilter/vf_transpose.c
index 90f08e4..8135f5b 100644
--- a/libavfilter/vf_transpose.c
+++ b/libavfilter/vf_transpose.c
@@ -25,9 +25,12 @@
  * Based on MPlayer libmpcodecs/vf_rotate.c.
  */
 
+#include <stdio.h>
+
 #include "libavutil/intreadwrite.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/imgutils.h"
+#include "libavutil/internal.h"
 #include "avfilter.h"
 #include "formats.h"
 #include "internal.h"
diff --git a/libavfilter/vf_vflip.c b/libavfilter/vf_vflip.c
index f0fb32a..742fe6a 100644
--- a/libavfilter/vf_vflip.c
+++ b/libavfilter/vf_vflip.c
@@ -23,6 +23,7 @@
  * video vertical flip filter
  */
 
+#include "libavutil/internal.h"
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
 #include "internal.h"
diff --git a/libavfilter/video.c b/libavfilter/video.c
index ebbbc34..31a093e 100644
--- a/libavfilter/video.c
+++ b/libavfilter/video.c
@@ -16,7 +16,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <string.h>
+
 #include "libavutil/imgutils.h"
+#include "libavutil/mem.h"
 
 #include "avfilter.h"
 #include "internal.h"
diff --git a/libavfilter/vsink_nullsink.c b/libavfilter/vsink_nullsink.c
index e03dcf0..27d85a0 100644
--- a/libavfilter/vsink_nullsink.c
+++ b/libavfilter/vsink_nullsink.c
@@ -18,6 +18,7 @@
 
 #include "avfilter.h"
 #include "internal.h"
+#include "libavutil/internal.h"
 
 static int start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
 {
diff --git a/libavfilter/vsrc_color.c b/libavfilter/vsrc_color.c
index ec83f03..d7a26a7 100644
--- a/libavfilter/vsrc_color.c
+++ b/libavfilter/vsrc_color.c
@@ -23,6 +23,9 @@
  * color source
  */
 
+#include <stdio.h>
+#include <string.h>
+
 #include "avfilter.h"
 #include "formats.h"
 #include "internal.h"
@@ -30,7 +33,9 @@
 #include "libavutil/pixdesc.h"
 #include "libavutil/colorspace.h"
 #include "libavutil/imgutils.h"
+#include "libavutil/internal.h"
 #include "libavutil/mathematics.h"
+#include "libavutil/mem.h"
 #include "libavutil/parseutils.h"
 #include "drawutils.h"
 
diff --git a/libavfilter/vsrc_nullsrc.c b/libavfilter/vsrc_nullsrc.c
index 84a2ff8..888dbcc 100644
--- a/libavfilter/vsrc_nullsrc.c
+++ b/libavfilter/vsrc_nullsrc.c
@@ -21,8 +21,11 @@
  * null video source
  */
 
+#include <stdio.h>
+
 #include "libavutil/avstring.h"
 #include "libavutil/eval.h"
+#include "libavutil/internal.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/parseutils.h"
 #include "avfilter.h"
diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index 42cd58e..56404fe 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -32,6 +32,7 @@
 
 #include <float.h>
 
+#include "libavutil/common.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 #include "libavutil/intreadwrite.h"
diff --git a/libavfilter/x86/gradfun.c b/libavfilter/x86/gradfun.c
index 4cd481c..140f5e8 100644
--- a/libavfilter/x86/gradfun.c
+++ b/libavfilter/x86/gradfun.c
@@ -20,6 +20,7 @@
 
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
+#include "libavutil/mem.h"
 #include "libavutil/x86/asm.h"
 #include "libavfilter/gradfun.h"
 
diff --git a/libavfilter/x86/yadif.c b/libavfilter/x86/yadif.c
index ee3a016..750db42 100644
--- a/libavfilter/x86/yadif.c
+++ b/libavfilter/x86/yadif.c
@@ -20,6 +20,8 @@
 
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
+#include "libavutil/internal.h"
+#include "libavutil/mem.h"
 #include "libavutil/x86/asm.h"
 #include "libavcodec/x86/dsputil_mmx.h"
 #include "libavfilter/yadif.h"
diff --git a/libavresample/audio_convert.c b/libavresample/audio_convert.c
index 200eb10..1138ef8 100644
--- a/libavresample/audio_convert.c
+++ b/libavresample/audio_convert.c
@@ -22,6 +22,7 @@
 #include <stdint.h>
 
 #include "config.h"
+#include "libavutil/common.h"
 #include "libavutil/libm.h"
 #include "libavutil/log.h"
 #include "libavutil/mem.h"
diff --git a/libavresample/audio_data.c b/libavresample/audio_data.c
index 3f82c50..d624ad3 100644
--- a/libavresample/audio_data.c
+++ b/libavresample/audio_data.c
@@ -19,6 +19,7 @@
  */
 
 #include <stdint.h>
+#include <string.h>
 
 #include "libavutil/mem.h"
 #include "audio_data.h"
diff --git a/libavresample/audio_mix.c b/libavresample/audio_mix.c
index f948c82..dd2f33d 100644
--- a/libavresample/audio_mix.c
+++ b/libavresample/audio_mix.c
@@ -20,6 +20,7 @@
 
 #include <stdint.h>
 
+#include "libavutil/common.h"
 #include "libavutil/libm.h"
 #include "libavutil/samplefmt.h"
 #include "avresample.h"
diff --git a/libavresample/audio_mix_matrix.c b/libavresample/audio_mix_matrix.c
index 522a177..3fbc4a4 100644
--- a/libavresample/audio_mix_matrix.c
+++ b/libavresample/audio_mix_matrix.c
@@ -21,6 +21,7 @@
 
 #include <stdint.h>
 
+#include "libavutil/common.h"
 #include "libavutil/libm.h"
 #include "libavutil/samplefmt.h"
 #include "avresample.h"
diff --git a/libavresample/avresample-test.c b/libavresample/avresample-test.c
index ad2f16d..0d4f2df 100644
--- a/libavresample/avresample-test.c
+++ b/libavresample/avresample-test.c
@@ -23,6 +23,7 @@
 #include <stdio.h>
 
 #include "libavutil/avstring.h"
+#include "libavutil/common.h"
 #include "libavutil/lfg.h"
 #include "libavutil/libm.h"
 #include "libavutil/log.h"
diff --git a/libavresample/options.c b/libavresample/options.c
index e7e0c27..53076f4 100644
--- a/libavresample/options.c
+++ b/libavresample/options.c
@@ -19,6 +19,7 @@
  */
 
 #include "libavutil/mathematics.h"
+#include "libavutil/mem.h"
 #include "libavutil/opt.h"
 #include "avresample.h"
 #include "internal.h"
diff --git a/libavresample/resample.c b/libavresample/resample.c
index e6e0892..f0af1ff 100644
--- a/libavresample/resample.c
+++ b/libavresample/resample.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/libm.h"
 #include "libavutil/log.h"
 #include "internal.h"
diff --git a/libavresample/utils.c b/libavresample/utils.c
index 2d83372..4819b57 100644
--- a/libavresample/utils.c
+++ b/libavresample/utils.c
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/dict.h"
 #include "libavutil/error.h"
 #include "libavutil/log.h"
diff --git a/libavutil/audio_fifo.c b/libavutil/audio_fifo.c
index 97c51a7..b562537 100644
--- a/libavutil/audio_fifo.c
+++ b/libavutil/audio_fifo.c
@@ -26,6 +26,7 @@
 
 #include "avutil.h"
 #include "audio_fifo.h"
+#include "common.h"
 #include "fifo.h"
 #include "mem.h"
 #include "samplefmt.h"
diff --git a/libavutil/audioconvert.c b/libavutil/audioconvert.c
index 1ac63a3..09750ff 100644
--- a/libavutil/audioconvert.c
+++ b/libavutil/audioconvert.c
@@ -26,6 +26,7 @@
 #include "avstring.h"
 #include "avutil.h"
 #include "audioconvert.h"
+#include "common.h"
 
 static const char * const channel_names[] = {
     [0]  = "FL",        /* front left */
diff --git a/libavutil/avstring.c b/libavutil/avstring.c
index 11f3a7c..9b88c0b 100644
--- a/libavutil/avstring.c
+++ b/libavutil/avstring.c
@@ -20,6 +20,7 @@
  */
 
 #include <stdarg.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
@@ -157,6 +158,7 @@ int av_strncasecmp(const char *a, const char *b, size_t n)
 
 #ifdef TEST
 
+#include "common.h"
 #undef printf
 
 int main(void)
diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index 6811ad5..a1433b4 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -263,7 +263,6 @@ char av_get_picture_type_char(enum AVPictureType pict_type);
  * @}
  */
 
-#include "common.h"
 #include "error.h"
 #include "version.h"
 
diff --git a/libavutil/dict.c b/libavutil/dict.c
index bbee732..3c3194c 100644
--- a/libavutil/dict.c
+++ b/libavutil/dict.c
@@ -18,6 +18,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <ctype.h>
+#include <string.h>
+
 #include "avstring.h"
 #include "dict.h"
 #include "internal.h"
diff --git a/libavutil/error.c b/libavutil/error.c
index 21b6876..c335cde 100644
--- a/libavutil/error.c
+++ b/libavutil/error.c
@@ -18,6 +18,7 @@
 
 #include "avutil.h"
 #include "avstring.h"
+#include "common.h"
 
 int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
 {
diff --git a/libavutil/error.h b/libavutil/error.h
index 11bcc5c..8ac355c 100644
--- a/libavutil/error.h
+++ b/libavutil/error.h
@@ -25,6 +25,7 @@
 #define AVUTIL_ERROR_H
 
 #include <errno.h>
+#include <stddef.h>
 #include "avutil.h"
 
 /**
diff --git a/libavutil/eval.c b/libavutil/eval.c
index d274272..9d17930 100644
--- a/libavutil/eval.c
+++ b/libavutil/eval.c
@@ -27,6 +27,7 @@
  */
 
 #include "avutil.h"
+#include "common.h"
 #include "eval.h"
 #include "log.h"
 #include "mathematics.h"
diff --git a/libavutil/fifo.h b/libavutil/fifo.h
index f106239..e670175 100644
--- a/libavutil/fifo.h
+++ b/libavutil/fifo.h
@@ -26,6 +26,7 @@
 
 #include <stdint.h>
 #include "avutil.h"
+#include "attributes.h"
 
 typedef struct AVFifoBuffer {
     uint8_t *buffer;
diff --git a/libavutil/file.c b/libavutil/file.c
index e1d0831..0739641 100644
--- a/libavutil/file.c
+++ b/libavutil/file.c
@@ -16,6 +16,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "config.h"
 #include "file.h"
 #include "log.h"
 #include <fcntl.h>
diff --git a/libavutil/file.h b/libavutil/file.h
index c481c37..e3f02a8 100644
--- a/libavutil/file.h
+++ b/libavutil/file.h
@@ -19,6 +19,8 @@
 #ifndef AVUTIL_FILE_H
 #define AVUTIL_FILE_H
 
+#include <stdint.h>
+
 #include "avutil.h"
 
 /**
diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
index 3d28e56..4e394b6 100644
--- a/libavutil/imgutils.c
+++ b/libavutil/imgutils.c
@@ -21,6 +21,7 @@
  * misc image utilities
  */
 
+#include "common.h"
 #include "imgutils.h"
 #include "internal.h"
 #include "log.h"
diff --git a/libavutil/log.c b/libavutil/log.c
index 9f1d59a..d2cf88f 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -32,6 +32,7 @@
 #include <stdlib.h>
 #include "avstring.h"
 #include "avutil.h"
+#include "common.h"
 #include "log.h"
 
 static int av_log_level = AV_LOG_INFO;
diff --git a/libavutil/mem.h b/libavutil/mem.h
index 211d33f..21fecc8 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -26,6 +26,8 @@
 #ifndef AVUTIL_MEM_H
 #define AVUTIL_MEM_H
 
+#include <limits.h>
+
 #include "attributes.h"
 #include "avutil.h"
 
diff --git a/libavutil/opt.c b/libavutil/opt.c
index b1e50f7..607f7e6 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -27,6 +27,7 @@
 
 #include "avutil.h"
 #include "avstring.h"
+#include "common.h"
 #include "opt.h"
 #include "eval.h"
 #include "dict.h"
diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index 34f45eb..3149537 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -25,6 +25,7 @@
 
 #include "avstring.h"
 #include "avutil.h"
+#include "common.h"
 #include "eval.h"
 #include "log.h"
 #include "random_seed.h"
diff --git a/libavutil/samplefmt.c b/libavutil/samplefmt.c
index b6e785c..102376a 100644
--- a/libavutil/samplefmt.c
+++ b/libavutil/samplefmt.c
@@ -16,6 +16,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "common.h"
 #include "samplefmt.h"
 
 #include <stdio.h>
diff --git a/libavutil/samplefmt.h b/libavutil/samplefmt.h
index e3aa6a9..445856d 100644
--- a/libavutil/samplefmt.h
+++ b/libavutil/samplefmt.h
@@ -19,7 +19,10 @@
 #ifndef AVUTIL_SAMPLEFMT_H
 #define AVUTIL_SAMPLEFMT_H
 
+#include <stdint.h>
+
 #include "avutil.h"
+#include "attributes.h"
 
 /**
  * Audio Sample Formats
diff --git a/libavutil/timer.h b/libavutil/timer.h
index 78d2b5f..ea5c891 100644
--- a/libavutil/timer.h
+++ b/libavutil/timer.h
@@ -28,6 +28,7 @@
 
 #include <stdlib.h>
 #include <stdint.h>
+#include <inttypes.h>
 
 #include "config.h"
 
diff --git a/libavutil/tree.c b/libavutil/tree.c
index e614f72..0e68bb7 100644
--- a/libavutil/tree.c
+++ b/libavutil/tree.c
@@ -19,6 +19,7 @@
  */
 
 #include "log.h"
+#include "mem.h"
 #include "tree.h"
 
 typedef struct AVTreeNode {
@@ -157,6 +158,7 @@ void av_tree_enumerate(AVTreeNode *t, void *opaque,
 
 #ifdef TEST
 
+#include "common.h"
 #include "lfg.h"
 
 static int check(AVTreeNode *t)
diff --git a/libavutil/version.h b/libavutil/version.h
index de5731a..2dc821d 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -37,7 +37,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR 51
-#define LIBAVUTIL_VERSION_MINOR 38
+#define LIBAVUTIL_VERSION_MINOR 39
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
diff --git a/libswscale/colorspace-test.c b/libswscale/colorspace-test.c
index 135924c..1c4cc2a 100644
--- a/libswscale/colorspace-test.c
+++ b/libswscale/colorspace-test.c
@@ -26,6 +26,7 @@
 
 #include "swscale.h"
 #include "rgb2rgb.h"
+#include "libavutil/mem.h"
 
 #define SIZE    1000
 #define srcByte 0x55
diff --git a/libswscale/swscale.h b/libswscale/swscale.h
index c3efd48..3b304d5 100644
--- a/libswscale/swscale.h
+++ b/libswscale/swscale.h
@@ -27,6 +27,8 @@
  *     external api for the swscale stuff
  */
 
+#include <stdint.h>
+
 #include "libavutil/avutil.h"
 #include "libavutil/log.h"
 #include "libavutil/pixfmt.h"
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 2a7d2db..9583fb9 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -28,6 +28,7 @@
 #endif
 
 #include "libavutil/avutil.h"
+#include "libavutil/common.h"
 #include "libavutil/log.h"
 #include "libavutil/pixfmt.h"
 #include "libavutil/pixdesc.h"
diff --git a/tools/graph2dot.c b/tools/graph2dot.c
index 6ea2f32..51a1ab1 100644
--- a/tools/graph2dot.c
+++ b/tools/graph2dot.c
@@ -19,7 +19,10 @@
  */
 
 #include <unistd.h>             /* getopt */
+#include <stdio.h>
+#include <string.h>
 
+#include "libavutil/mem.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/audioconvert.h"
 #include "libavfilter/avfiltergraph.h"



More information about the ffmpeg-cvslog mailing list