34 |
* Common things |
* Common things |
35 |
****************************************************************************/ |
****************************************************************************/ |
36 |
|
|
37 |
|
/* Debug level masks */ |
38 |
|
#define DPRINTF_ERROR 0x00000001 |
39 |
|
#define DPRINTF_STARTCODE 0x00000002 |
40 |
|
#define DPRINTF_HEADER 0x00000004 |
41 |
|
#define DPRINTF_TIMECODE 0x00000008 |
42 |
|
#define DPRINTF_MB 0x00000010 |
43 |
|
#define DPRINTF_COEFF 0x00000020 |
44 |
|
#define DPRINTF_MV 0x00000040 |
45 |
|
#define DPRINTF_RC 0x00000080 |
46 |
|
#define DPRINTF_DEBUG 0x80000000 |
47 |
|
|
48 |
|
/* debug level for this library */ |
49 |
|
#ifdef _DEBUG |
50 |
|
#define DPRINTF_LEVEL 0x000000ff |
51 |
|
#else |
52 |
|
#define DPRINTF_LEVEL 0 |
53 |
|
#endif |
54 |
|
|
55 |
/* Buffer size for msvc implementation because it outputs to DebugOutput */ |
/* Buffer size for msvc implementation because it outputs to DebugOutput */ |
|
#if defined(_DEBUG) |
|
|
extern unsigned int xvid_debug; |
|
56 |
#define DPRINTF_BUF_SZ 1024 |
#define DPRINTF_BUF_SZ 1024 |
|
#endif |
|
57 |
|
|
58 |
/***************************************************************************** |
/***************************************************************************** |
59 |
* Types used in XviD sources |
* Types used in XviD sources |
141 |
# ifdef _DEBUG |
# ifdef _DEBUG |
142 |
static __inline void DPRINTF(int level, char *fmt, ...) |
static __inline void DPRINTF(int level, char *fmt, ...) |
143 |
{ |
{ |
144 |
if (xvid_debug & level) { |
if (DPRINTF_LEVEL & level) { |
145 |
va_list args; |
va_list args; |
146 |
char buf[DPRINTF_BUF_SZ]; |
char buf[DPRINTF_BUF_SZ]; |
147 |
va_start(args, fmt); |
va_start(args, fmt); |
232 |
{ |
{ |
233 |
va_list args; |
va_list args; |
234 |
va_start(args, format); |
va_start(args, format); |
235 |
if(xvid_debug & level) { |
if(DPRINTF_LEVEL & level) { |
236 |
vfprintf(stderr, format, args); |
vfprintf(stderr, format, args); |
237 |
fprintf(stderr, "\n"); |
fprintf(stderr, "\n"); |
238 |
} |
} |
345 |
# ifdef _DEBUG |
# ifdef _DEBUG |
346 |
static __inline void DPRINTF(int level, char *fmt, ...) |
static __inline void DPRINTF(int level, char *fmt, ...) |
347 |
{ |
{ |
348 |
if (xvid_debug & level) { |
if (DPRINTF_LEVEL & level) { |
349 |
va_list args; |
va_list args; |
350 |
char buf[DPRINTF_BUF_SZ]; |
char buf[DPRINTF_BUF_SZ]; |
351 |
va_start(args, fmt); |
va_start(args, fmt); |
425 |
{ |
{ |
426 |
va_list args; |
va_list args; |
427 |
va_start(args, format); |
va_start(args, format); |
428 |
if(xvid_debug & level) { |
if(DPRINTF_LEVEL & level) { |
429 |
vfprintf(stderr, format, args); |
vfprintf(stderr, format, args); |
430 |
fprintf(stderr, "\n"); |
fprintf(stderr, "\n"); |
431 |
} |
} |