Mercurial > libavcodec.hg
comparison common.h @ 426:a69ba632a048 libavcodec
better logic for bswap
author | glantau |
---|---|
date | Sat, 25 May 2002 22:38:02 +0000 |
parents | ed6098c4216a |
children | b245457fb912 |
comparison
equal
deleted
inserted
replaced
425:d69e752cf8d1 | 426:a69ba632a048 |
---|---|
48 typedef INT8 int8_t; | 48 typedef INT8 int8_t; |
49 typedef UINT16 uint16_t; | 49 typedef UINT16 uint16_t; |
50 typedef INT16 int16_t; | 50 typedef INT16 int16_t; |
51 typedef UINT32 uint32_t; | 51 typedef UINT32 uint32_t; |
52 typedef INT32 int32_t; | 52 typedef INT32 int32_t; |
53 typedef UINT64 uint64_t; | |
54 typedef INT64 int64_t; | |
53 | 55 |
54 #ifndef __MINGW32__ | 56 #ifndef __MINGW32__ |
55 #define INT64_C(c) (c ## i64) | 57 #define INT64_C(c) (c ## i64) |
56 #define UINT64_C(c) (c ## i64) | 58 #define UINT64_C(c) (c ## i64) |
57 | 59 |
67 | 69 |
68 #ifdef _DEBUG | 70 #ifdef _DEBUG |
69 #define DEBUG | 71 #define DEBUG |
70 #endif | 72 #endif |
71 | 73 |
72 // code from bits/byteswap.h (C) 1997, 1998 Free Software Foundation, Inc. | |
73 #define bswap_32(x) \ | |
74 ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \ | |
75 (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) | |
76 #define be2me_32(x) bswap_32(x) | |
77 | |
78 #define snprintf _snprintf | 74 #define snprintf _snprintf |
79 | 75 |
80 #ifndef __MINGW32__ | 76 #ifdef HAVE_AV_CONFIG_H |
81 /* no config.h with VC */ | 77 |
82 #define CONFIG_ENCODERS 1 | 78 #define MANGLE(a) "_" #a |
83 #define CONFIG_DECODERS 1 | 79 |
84 #define CONFIG_AC3 1 | 80 #endif /* HAVE_AV_CONFIG_H */ |
85 #endif | 81 |
86 | 82 #else /* CONFIG_WIN32 */ |
87 #else | |
88 | 83 |
89 /* unix */ | 84 /* unix */ |
90 | 85 |
91 #include <inttypes.h> | 86 #include <inttypes.h> |
92 | 87 |
112 #ifndef INT64_C | 107 #ifndef INT64_C |
113 #define INT64_C(c) (c ## LL) | 108 #define INT64_C(c) (c ## LL) |
114 #define UINT64_C(c) (c ## ULL) | 109 #define UINT64_C(c) (c ## ULL) |
115 #endif | 110 #endif |
116 | 111 |
117 #include "bswap.h" | |
118 | |
119 #ifdef USE_FASTMEMCPY | 112 #ifdef USE_FASTMEMCPY |
120 #include "fastmemcpy.h" | 113 #include "fastmemcpy.h" |
121 #endif | 114 #endif |
122 | 115 |
116 #define MANGLE(a) #a | |
117 | |
123 #endif /* HAVE_AV_CONFIG_H */ | 118 #endif /* HAVE_AV_CONFIG_H */ |
124 | 119 |
125 #endif /* !CONFIG_WIN32 */ | 120 #endif /* !CONFIG_WIN32 */ |
126 | 121 |
127 | 122 |
123 #ifdef HAVE_AV_CONFIG_H | |
124 | |
125 #include "bswap.h" | |
126 | |
128 /* debug stuff */ | 127 /* debug stuff */ |
129 #ifdef HAVE_AV_CONFIG_H | |
130 | 128 |
131 #ifndef DEBUG | 129 #ifndef DEBUG |
132 #define NDEBUG | 130 #define NDEBUG |
133 #endif | 131 #endif |
134 #include <assert.h> | 132 #include <assert.h> |