diff --git a/libavcodec/liba52/a52.h b/libavcodec/liba52/a52.h
index 9db52ccf83d609d4bce0ae2d74ef99842bab6f4f..ca3c9f10877e87c311705772b38b47f780008b58 100644
--- a/libavcodec/liba52/a52.h
+++ b/libavcodec/liba52/a52.h
@@ -24,6 +24,8 @@
 #ifndef A52_H
 #define A52_H
 
+#include "../avcodec.h"
+
 #ifndef LIBA52_DOUBLE
 typedef float sample_t;
 #else
diff --git a/libavcodec/liba52/bit_allocate.c b/libavcodec/liba52/bit_allocate.c
index 0567b2285286ed018c8d521b4b36df79e932f8fb..c988024552da15631bce4cb16eb6c16841e3b1cf 100644
--- a/libavcodec/liba52/bit_allocate.c
+++ b/libavcodec/liba52/bit_allocate.c
@@ -20,11 +20,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-
-#include "config.h"
-
-#include <inttypes.h>
-
 #include "a52.h"
 #include "a52_internal.h"
 
diff --git a/libavcodec/liba52/bitstream.c b/libavcodec/liba52/bitstream.c
index 70621c7c11243064faa2aced946eb005bc763358..48632104fc1c003bbb857c14d1bcb170f68f000e 100644
--- a/libavcodec/liba52/bitstream.c
+++ b/libavcodec/liba52/bitstream.c
@@ -21,10 +21,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "config.h"
-
-#include <inttypes.h>
-
 #include "a52.h"
 #include "a52_internal.h"
 #include "bitstream.h"
diff --git a/libavcodec/liba52/downmix.c b/libavcodec/liba52/downmix.c
index b9ac1fdeaaff66b8dfdd653eb8fc494a891e3e4f..d8d9c8012b4470a0b4c2a9ef1a1af7d7c2bee504 100644
--- a/libavcodec/liba52/downmix.c
+++ b/libavcodec/liba52/downmix.c
@@ -21,11 +21,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "config.h"
-
-#include <string.h>
-#include <inttypes.h>
-
 #include "a52.h"
 #include "a52_internal.h"
 
diff --git a/libavcodec/liba52/imdct.c b/libavcodec/liba52/imdct.c
index ba08318aa2b5d0636cb8e6dc80fd7b2198ccb520..c61004b9b5974735a65b679679a45b6e312d06cf 100644
--- a/libavcodec/liba52/imdct.c
+++ b/libavcodec/liba52/imdct.c
@@ -24,18 +24,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "config.h"
-
-#include <math.h>
-#include <stdio.h>
-#ifdef LIBA52_DJBFFT
-#include <fftc4.h>
-#endif
-#ifndef M_PI
-#define M_PI 3.1415926535897932384626433832795029
-#endif
-#include <inttypes.h>
-
 #include "a52.h"
 #include "a52_internal.h"
 #include "mm_accel.h"
diff --git a/libavcodec/liba52/parse.c b/libavcodec/liba52/parse.c
index 74dce78d9d4ce47ff75f334a9ea3b805a523504e..59f21591b7a7cd0c44c6acb761173e939fa79a1b 100644
--- a/libavcodec/liba52/parse.c
+++ b/libavcodec/liba52/parse.c
@@ -21,12 +21,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "config.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-
 #include "a52.h"
 #include "a52_internal.h"
 #include "bitstream.h"
diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c
index 59dd654dd11bdba604ef437a1dd8e76a094fbf60..3198441d097d2dcf49ad1d4e38bcebf9712a9442 100644
--- a/libavcodec/ratecontrol.c
+++ b/libavcodec/ratecontrol.c
@@ -1,27 +1,24 @@
 /*
-    Copyright (C) 2002 Michael Niedermayer <michaelni@gmx.at>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <inttypes.h>
-#include <stdio.h>
-
-#include "common.h" //needed for mpegvideo.h to compile
-#include "dsputil.h" //needed for mpegvideo.h to compile
+ * Rate control for video encoders
+ *
+ * Copyright (c) 2002 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 #include "avcodec.h"
+#include "dsputil.h"
 #include "mpegvideo.h"
 
 #define STATS_FILE "lavc_stats.txt"