diff --git a/libavcodec/mips/mathops.h b/libavcodec/mips/mathops.h
index e763f7be9e93417c3edc65211f6d1a0f1e456b07..b281e5f77684049ce773780b48efdb9611f5fde7 100644
--- a/libavcodec/mips/mathops.h
+++ b/libavcodec/mips/mathops.h
@@ -21,7 +21,8 @@
 #ifndef AVCODEC_MIPS_MATHOPS_H
 #define AVCODEC_MIPS_MATHOPS_H
 
-#include "config.h"
+#include <stdint.h>
+#include "libavutil/common.h"
 
 #if HAVE_LOONGSON
 
diff --git a/libavcodec/ppc/mathops.h b/libavcodec/ppc/mathops.h
index 1dcc09aebd8c3325e57a8b2d78007c9bba40a9a7..51311fa13243f108f2efdbe9bea58cb515d1c4d9 100644
--- a/libavcodec/ppc/mathops.h
+++ b/libavcodec/ppc/mathops.h
@@ -23,7 +23,8 @@
 #ifndef AVCODEC_PPC_MATHOPS_H
 #define AVCODEC_PPC_MATHOPS_H
 
-#include "config.h"
+#include <stdint.h>
+#include "libavutil/common.h"
 
 #if HAVE_PPC4XX
 /* signed 16x16 -> 32 multiply add accumulate */