diff --git a/libavcodec/bfin/dsputil_bfin.h b/libavcodec/bfin/dsputil_bfin.h
index d50bf0424a..7edcf97b6b 100644
--- a/libavcodec/bfin/dsputil_bfin.h
+++ b/libavcodec/bfin/dsputil_bfin.h
@@ -24,6 +24,9 @@
 #ifndef AVCODEC_BFIN_DSPUTIL_BFIN_H
 #define AVCODEC_BFIN_DSPUTIL_BFIN_H
 
+#include "config.h"
+#include "libavcodec/dsputil.h"
+
 #if defined(__FDPIC__) && CONFIG_SRAM
 #define attribute_l1_text  __attribute__ ((l1_text))
 #define attribute_l1_data_b __attribute__((l1_data_B))
diff --git a/libavcodec/sh4/dsputil_sh4.h b/libavcodec/sh4/dsputil_sh4.h
index cd89196c30..2c1f77c770 100644
--- a/libavcodec/sh4/dsputil_sh4.h
+++ b/libavcodec/sh4/dsputil_sh4.h
@@ -19,6 +19,9 @@
 #ifndef AVCODEC_SH4_DSPUTIL_SH4_H
 #define AVCODEC_SH4_DSPUTIL_SH4_H
 
+#include "libavcodec/avcodec.h"
+#include "libavcodec/dsputil.h"
+
 void idct_sh4(DCTELEM *block);
 void dsputil_init_align(DSPContext* c, AVCodecContext *avctx);