Browse code

Replace many includes of libavutil/common.h with what is actually needed

This reduces the number of false dependencies on header files and
speeds up compilation.

Originally committed as revision 22407 to svn://svn.ffmpeg.org/ffmpeg/trunk

Måns Rullgård authored on 2010/03/10 02:39:19
Showing 28 changed files
... ...
@@ -26,6 +26,8 @@
26 26
  * FFT/IFFT transforms.
27 27
  */
28 28
 
29
+#include <stdlib.h>
30
+#include <string.h>
29 31
 #include "libavutil/mathematics.h"
30 32
 #include "fft.h"
31 33
 
... ...
@@ -19,6 +19,9 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include <stdlib.h>
23
+#include <string.h>
24
+#include "libavutil/common.h"
22 25
 #include "libavutil/mathematics.h"
23 26
 #include "fft.h"
24 27
 
... ...
@@ -18,6 +18,7 @@
18 18
  * License along with FFmpeg; if not, write to the Free Software
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21
+#include <stdlib.h>
21 22
 #include <math.h>
22 23
 #include "libavutil/mathematics.h"
23 24
 #include "fft.h"
... ...
@@ -21,7 +21,7 @@
21 21
  * 3. This notice may not be removed or altered from any source distribution.
22 22
  */
23 23
 
24
-#include "common.h"
24
+#include "config.h"
25 25
 #include "adler32.h"
26 26
 
27 27
 #define BASE 65521L /* largest prime smaller than 65536 */
... ...
@@ -53,6 +53,7 @@ unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, unsigne
53 53
 
54 54
 #ifdef TEST
55 55
 #include "log.h"
56
+#include "timer.h"
56 57
 #define LEN 7001
57 58
 volatile int checksum;
58 59
 int main(void){
... ...
@@ -22,7 +22,7 @@
22 22
 #define AVUTIL_ADLER32_H
23 23
 
24 24
 #include <stdint.h>
25
-#include "common.h"
25
+#include "attributes.h"
26 26
 
27 27
 unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf,
28 28
                                 unsigned int len) av_pure;
... ...
@@ -21,7 +21,7 @@
21 21
 
22 22
 #include <stdint.h>
23 23
 #include "config.h"
24
-#include "libavutil/common.h"
24
+#include "libavutil/attributes.h"
25 25
 
26 26
 #ifdef __ARMCC_VERSION
27 27
 
... ...
@@ -22,7 +22,7 @@
22 22
 #define AVUTIL_ARM_INTMATH_H
23 23
 
24 24
 #include "config.h"
25
-#include "libavutil/common.h"
25
+#include "libavutil/attributes.h"
26 26
 
27 27
 #if HAVE_INLINE_ASM
28 28
 
... ...
@@ -21,7 +21,7 @@
21 21
 
22 22
 #include <stdint.h>
23 23
 #include "config.h"
24
-#include "libavutil/common.h"
24
+#include "libavutil/attributes.h"
25 25
 
26 26
 #if HAVE_INLINE_ASM
27 27
 
... ...
@@ -28,7 +28,7 @@
28 28
 
29 29
 #include <stdint.h>
30 30
 #include "config.h"
31
-#include "libavutil/common.h"
31
+#include "libavutil/attributes.h"
32 32
 
33 33
 #define bswap_32 bswap_32
34 34
 static av_always_inline av_const uint32_t bswap_32(uint32_t x)
... ...
@@ -28,7 +28,7 @@
28 28
 
29 29
 #include <stdint.h>
30 30
 #include "config.h"
31
-#include "common.h"
31
+#include "attributes.h"
32 32
 
33 33
 #if   ARCH_ARM
34 34
 #   include "arm/bswap.h"
... ...
@@ -19,6 +19,7 @@
19 19
  */
20 20
 
21 21
 #include "config.h"
22
+#include "common.h"
22 23
 #include "bswap.h"
23 24
 #include "crc.h"
24 25
 
... ...
@@ -23,7 +23,7 @@
23 23
 
24 24
 #include <stdint.h>
25 25
 #include <stddef.h>
26
-#include "common.h"
26
+#include "attributes.h"
27 27
 
28 28
 typedef uint32_t AVCRC;
29 29
 
... ...
@@ -25,8 +25,6 @@
25 25
 #define AVUTIL_FIFO_H
26 26
 
27 27
 #include <stdint.h>
28
-#include "avutil.h"
29
-#include "common.h"
30 28
 
31 29
 typedef struct AVFifoBuffer {
32 30
     uint8_t *buffer;
... ...
@@ -35,8 +35,7 @@
35 35
 #include <stddef.h>
36 36
 #include <assert.h>
37 37
 #include "config.h"
38
-#include "common.h"
39
-#include "mem.h"
38
+#include "attributes.h"
40 39
 #include "timer.h"
41 40
 
42 41
 #ifndef attribute_align_arg
... ...
@@ -25,7 +25,8 @@
25 25
  * portable IEEE float/double read/write functions
26 26
  */
27 27
 
28
-#include "common.h"
28
+#include <stdint.h>
29
+#include <math.h>
29 30
 #include "intfloat_readwrite.h"
30 31
 
31 32
 double av_int2dbl(int64_t v){
... ...
@@ -22,7 +22,7 @@
22 22
 #define AVUTIL_INTFLOAT_READWRITE_H
23 23
 
24 24
 #include <stdint.h>
25
-#include "common.h"
25
+#include "attributes.h"
26 26
 
27 27
 /* IEEE 80 bits extended float */
28 28
 typedef struct AVExtFloat  {
... ...
@@ -23,6 +23,7 @@
23 23
 #include "lfg.h"
24 24
 #include "md5.h"
25 25
 #include "intreadwrite.h"
26
+#include "attributes.h"
26 27
 
27 28
 void av_cold av_lfg_init(AVLFG *c, unsigned int seed){
28 29
     uint8_t tmp[16]={0};
... ...
@@ -56,7 +57,7 @@ void av_bmg_get(AVLFG *lfg, double out[2])
56 56
 
57 57
 #ifdef TEST
58 58
 #include "log.h"
59
-#include "common.h"
59
+#include "timer.h"
60 60
 
61 61
 int main(void)
62 62
 {
... ...
@@ -24,8 +24,8 @@
24 24
  */
25 25
 
26 26
 #include <assert.h>
27
-#include "avutil.h"
28
-#include "common.h"
27
+#include <stdint.h>
28
+#include <limits.h>
29 29
 #include "mathematics.h"
30 30
 
31 31
 const uint8_t ff_sqrt_tab[256]={
... ...
@@ -23,7 +23,7 @@
23 23
 
24 24
 #include <stdint.h>
25 25
 #include <math.h>
26
-#include "common.h"
26
+#include "attributes.h"
27 27
 #include "rational.h"
28 28
 
29 29
 #ifndef M_E
... ...
@@ -163,6 +163,7 @@ void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len){
163 163
 
164 164
 #ifdef TEST
165 165
 #include <stdio.h>
166
+#include <inttypes.h>
166 167
 #undef printf
167 168
 int main(void){
168 169
     uint64_t md5val;
... ...
@@ -26,7 +26,7 @@
26 26
 #ifndef AVUTIL_MEM_H
27 27
 #define AVUTIL_MEM_H
28 28
 
29
-#include "common.h"
29
+#include "attributes.h"
30 30
 
31 31
 #if defined(__ICC) || defined(__SUNPRO_C)
32 32
     #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
... ...
@@ -29,7 +29,7 @@
29 29
 #define AVUTIL_RATIONAL_H
30 30
 
31 31
 #include <stdint.h>
32
-#include "common.h"
32
+#include "attributes.h"
33 33
 
34 34
 /**
35 35
  * rational number numerator/denominator
... ...
@@ -26,7 +26,7 @@
26 26
 
27 27
 #include <stdint.h>
28 28
 #include "config.h"
29
-#include "libavutil/common.h"
29
+#include "libavutil/attributes.h"
30 30
 
31 31
 #define bswap_16 bswap_16
32 32
 static av_always_inline av_const uint16_t bswap_16(uint16_t x)
... ...
@@ -21,8 +21,7 @@
21 21
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 22
  */
23 23
 
24
-#include "common.h"
25
-#include "avutil.h"
24
+#include <string.h>
26 25
 #include "bswap.h"
27 26
 #include "sha.h"
28 27
 #include "sha1.h"
... ...
@@ -18,7 +18,6 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
  */
20 20
 
21
-#include "common.h"
22 21
 #include "log.h"
23 22
 #include "tree.h"
24 23
 
... ...
@@ -26,7 +26,7 @@
26 26
 
27 27
 #include <stdint.h>
28 28
 #include "config.h"
29
-#include "libavutil/common.h"
29
+#include "libavutil/attributes.h"
30 30
 
31 31
 #define bswap_16 bswap_16
32 32
 static av_always_inline av_const uint16_t bswap_16(uint16_t x)
... ...
@@ -21,8 +21,6 @@
21 21
 #ifndef AVUTIL_X86_INTMATH_H
22 22
 #define AVUTIL_X86_INTMATH_H
23 23
 
24
-#include "libavutil/common.h"
25
-
26 24
 #define FASTDIV(a,b) \
27 25
     ({\
28 26
         int ret, dmy;\
... ...
@@ -23,7 +23,7 @@
23 23
 
24 24
 #include <stdint.h>
25 25
 #include "config.h"
26
-#include "libavutil/common.h"
26
+#include "libavutil/attributes.h"
27 27
 
28 28
 #if HAVE_MMX
29 29