[svn] / trunk / xvidcore / src / portab.h Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/portab.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 89, Sat Mar 30 00:58:20 2002 UTC revision 161, Mon May 6 03:51:43 2002 UTC
# Line 4  Line 4 
4  #if defined(WIN32)  #if defined(WIN32)
5    
6  #include <windows.h>  #include <windows.h>
7    #include <stdio.h>
8    
9    
10    #define DPRINTF_BUF_SZ  1024
11    static void dprintf(char *fmt, ...)
12    {
13            va_list args;
14            char buf[DPRINTF_BUF_SZ];
15    
16            va_start(args, fmt);
17            vsprintf(buf, fmt, args);
18            OutputDebugString(buf);
19            fprintf(stdout, "%s\n", buf);
20    }
21    
22    
23    #define DEBUGCBR(A,B,C) { char tmp[100]; wsprintf(tmp, "CBR: frame: %i, quant: %i, deviation: %i\n", (A), (B), (C)); OutputDebugString(tmp); }
24    
25  #ifdef _DEBUG  #ifdef _DEBUG
26  #define DEBUG(S) OutputDebugString((S));  #define DEBUG(S) OutputDebugString((S));
27  #define DEBUG1(S,I) { char tmp[100]; wsprintf(tmp, "%s %i\n", (S), (I)); OutputDebugString(tmp); }  #define DEBUG1(S,I) { char tmp[100]; wsprintf(tmp, "%s %i\n", (S), (I)); OutputDebugString(tmp); }
28  #define DEBUG2(X,A,B) { char tmp[100]; wsprintf(tmp, "%s %i %i\n", (X), (A), (B)); OutputDebugString(tmp); }  #define DEBUG2(X,A,B) { char tmp[100]; wsprintf(tmp, "%s %i %i\n", (X), (A), (B)); OutputDebugString(tmp); }
29  #define DEBUG3(X,A,B,C){ char tmp[1000]; wsprintf(tmp,"%s %i %i %i",(X),(A), (B), (C)); OutputDebugString(tmp); }  #define DEBUG3(X,A,B,C){ char tmp[1000]; wsprintf(tmp,"%s %i %i %i",(X),(A), (B), (C)); OutputDebugString(tmp); }
30    #define DEBUG4(X,A,B,C,D){ char tmp[1000]; wsprintf(tmp,"%s %i %i %i %i",(X),(A), (B), (C), (D)); OutputDebugString(tmp); }
31  #define DEBUG8(X,A,B,C,D,E,F,G,H){ char tmp[1000]; wsprintf(tmp,"%s %i %i %i %i %i %i %i %i",(X),(A),(B),(C),(D),(E),(F),(G),(H)); OutputDebugString(tmp); }  #define DEBUG8(X,A,B,C,D,E,F,G,H){ char tmp[1000]; wsprintf(tmp,"%s %i %i %i %i %i %i %i %i",(X),(A),(B),(C),(D),(E),(F),(G),(H)); OutputDebugString(tmp); }
32  #else  #else
33  #define DEBUG(S)  #define DEBUG(S)
34  #define DEBUG1(S,I)  #define DEBUG1(S,I)
35  #define DEBUG2(X,A,B)  #define DEBUG2(X,A,B)
36  #define DEBUG3(X,A,B,C)  #define DEBUG3(X,A,B,C)
37    #define DEBUG4(X,A,B,C,D)
38  #define DEBUG8(X,A,B,C,D,E,F,G,H)  #define DEBUG8(X,A,B,C,D,E,F,G,H)
39  #endif  #endif
40    
# Line 61  Line 80 
80          return ts;          return ts;
81  }  }
82    
83  #elif defined(LINUX) || defined(DJGPP)  #elif defined(LINUX) || defined(DJGPP) || defined(FREEBSD)
   
84    
85  #ifdef _DEBUG  #ifdef _DEBUG
86    
# Line 73  Line 91 
91  #define DEBUG2(S,A,B)             fprintf(DEBUG_WHERE, "%s%i=%i\n", (S), (A), (B))  #define DEBUG2(S,A,B)             fprintf(DEBUG_WHERE, "%s%i=%i\n", (S), (A), (B))
92  #define DEBUG3(S,A,B,C)           fprintf(DEBUG_WHERE, "%s %i %x %x\n", (S), (A), (B), (C))  #define DEBUG3(S,A,B,C)           fprintf(DEBUG_WHERE, "%s %i %x %x\n", (S), (A), (B), (C))
93  #define DEBUG8(S,A,B,C,D,E,F,G,H)  #define DEBUG8(S,A,B,C,D,E,F,G,H)
94    #define DEBUGCBR(A,B,C)           fprintf(DEBUG_WHERE, "CBR: frame: %i, quant: %i, deviation: %i\n", (A), (B), (C))
95  #else  #else
96  #define DEBUG(S)  #define DEBUG(S)
97  #define DEBUG1(S,I)  #define DEBUG1(S,I)
98  #define DEBUG2(X,A,B)  #define DEBUG2(X,A,B)
99  #define DEBUG3(X,A,B,C)  #define DEBUG3(X,A,B,C)
100  #define DEBUG8(X,A,B,C,D,E,F,G,H)  #define DEBUG8(X,A,B,C,D,E,F,G,H)
101    #define DEBUGCBR(A,B,C)
102  #endif  #endif
103    
104  #define CACHE_LINE  16  #define CACHE_LINE  16
# Line 93  Line 113 
113    
114  #else  #else
115    
116  #define #define #define DECLARE_ALIGNED_MATRIX(name,sizex,sizey,type,alignment) \  #define DECLARE_ALIGNED_MATRIX(name,sizex,sizey,type,alignment) \
117          __attribute__ ((__aligned__(CACHE_LINE))) type name[(sizex)*(sizey)]          __attribute__ ((__aligned__(CACHE_LINE))) type name[(sizex)*(sizey)]
118    
119  #define int8_t   char  #define int8_t   char
# Line 110  Line 130 
130    
131  // needed for bitstream.h  // needed for bitstream.h
132  #ifdef ARCH_PPC  #ifdef ARCH_PPC
133          #define BSWAP(a) __asm__ ( "lwbrx %0,0,%1; eieio" : "=r" (a) : \          #define BSWAP(a) __asm__ __volatile__ ( "lwbrx %0,0,%1; eieio" : "=r" (a) : \
134                  "r" (&(a)), "m" (a));                  "r" (&(a)), "m" (a));
135          #define EMMS()          #define EMMS()
136    
# Line 127  Line 147 
147          static __inline int64_t read_counter() {          static __inline int64_t read_counter() {
148                  unsigned long tb, tu;                  unsigned long tb, tu;
149                  do {                  do {
                         tb = get_tbl();  
150                          tu = get_tbu();                          tu = get_tbu();
151                            tb = get_tbl();
152                  } while(tb != get_tbl());                  } while(tb != get_tbl());
153                  return (((int64_t)tu) << 32) | (int64_t)tb;                  return (((int64_t)tu) << 32) | (int64_t)tb;
154          }          }
# Line 158  Line 178 
178  #define DEBUG2(X,A,B)  #define DEBUG2(X,A,B)
179  #define DEBUG3(X,A,B,C)  #define DEBUG3(X,A,B,C)
180  #define DEBUG8(X,A,B,C,D,E,F,G,H)  #define DEBUG8(X,A,B,C,D,E,F,G,H)
181    #define DEBUGCBR(A,B,C)
182    
183  #include <inttypes.h>  #include <inttypes.h>
184    

Legend:
Removed from v.89  
changed lines
  Added in v.161

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4