~ubuntu-branches/ubuntu/lucid/ffmpeg/lucid-updates

« back to all changes in this revision

Viewing changes to libavutil/internal.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-02-05 21:45:05 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20090205214505-fvn0jkiv3lrkaaq4
Tags: 3:0.svn20090204-2ubuntu1+unstripped1
rebuild using a clean, uncrippled ffmpeg tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
 
21
21
/**
22
 
 * @file internal.h
23
 
 * common internal api header.
 
22
 * @file libavutil/internal.h
 
23
 * common internal API header
24
24
 */
25
25
 
26
26
#ifndef AVUTIL_INTERNAL_H
30
30
#    define NDEBUG
31
31
#endif
32
32
 
 
33
#include <limits.h>
33
34
#include <stdint.h>
34
35
#include <stddef.h>
35
36
#include <assert.h>
 
37
#include "config.h"
36
38
#include "common.h"
 
39
#include "mem.h"
37
40
#include "timer.h"
38
41
 
39
42
#ifndef attribute_align_arg
96
99
#    define PIC
97
100
#endif
98
101
 
99
 
#include "config.h"
100
 
 
101
102
#ifndef offsetof
102
103
#    define offsetof(T,F) ((unsigned int)((char *)&((T *)0)->F))
103
104
#endif
164
165
 
165
166
extern const uint8_t ff_sqrt_tab[256];
166
167
 
167
 
static inline int av_log2_16bit(unsigned int v);
168
 
 
169
168
static inline av_const unsigned int ff_sqrt(unsigned int a)
170
169
{
171
170
    unsigned int b;
219
218
}
220
219
#endif
221
220
 
222
 
/* avoid usage of various functions */
 
221
/* avoid usage of dangerous/inappropriate system functions */
223
222
#undef  malloc
224
223
#define malloc please_use_av_malloc
225
224
#undef  free
231
230
#undef  rand
232
231
#define rand rand_is_forbidden_due_to_state_trashing_use_av_random
233
232
#undef  srand
234
 
#define srand srand_is_forbidden_due_to_state_trashing_use_av_init_random
 
233
#define srand srand_is_forbidden_due_to_state_trashing_use_av_random_init
235
234
#undef  random
236
235
#define random random_is_forbidden_due_to_state_trashing_use_av_random
237
236
#undef  sprintf
242
241
#define exit exit_is_forbidden
243
242
#ifndef LIBAVFORMAT_BUILD
244
243
#undef  printf
245
 
#define printf please_use_av_log
 
244
#define printf please_use_av_log_instead_of_printf
246
245
#undef  fprintf
247
 
#define fprintf please_use_av_log
 
246
#define fprintf please_use_av_log_instead_of_fprintf
248
247
#undef  puts
249
 
#define puts please_use_av_log
 
248
#define puts please_use_av_log_instead_of_puts
250
249
#undef  perror
251
250
#define perror please_use_av_log_instead_of_perror
252
251
#endif
260
259
    }\
261
260
}
262
261
 
 
262
#if defined(__ICC) || defined(__SUNPRO_C)
 
263
    #define DECLARE_ALIGNED(n,t,v)      t v __attribute__ ((aligned (n)))
 
264
    #define DECLARE_ASM_CONST(n,t,v)    const t __attribute__ ((aligned (n))) v
 
265
#elif defined(__GNUC__)
 
266
    #define DECLARE_ALIGNED(n,t,v)      t v __attribute__ ((aligned (n)))
 
267
    #define DECLARE_ASM_CONST(n,t,v)    static const t v attribute_used __attribute__ ((aligned (n)))
 
268
#elif defined(_MSC_VER)
 
269
    #define DECLARE_ALIGNED(n,t,v)      __declspec(align(n)) t v
 
270
    #define DECLARE_ASM_CONST(n,t,v)    __declspec(align(n)) static const t v
 
271
#elif HAVE_INLINE_ASM
 
272
    #error The asm code needs alignment, but we do not know how to do it for this compiler.
 
273
#else
 
274
    #define DECLARE_ALIGNED(n,t,v)      t v
 
275
    #define DECLARE_ASM_CONST(n,t,v)    static const t v
 
276
#endif
 
277
 
 
278
 
263
279
#if !HAVE_LLRINT
264
280
static av_always_inline av_const long long llrint(double x)
265
281
{
303
319
#endif /* HAVE_TRUNCF */
304
320
 
305
321
/**
306
 
 * Returns NULL if CONFIG_SMALL is true otherwise the argument
307
 
 * without modifications, used to disable the definition of strings
 
322
 * Returns NULL if CONFIG_SMALL is true, otherwise the argument
 
323
 * without modification. Used to disable the definition of strings
308
324
 * (for example AVCodec long_names).
309
325
 */
310
326
#if CONFIG_SMALL