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

Diff of /xvidcore/src/portab.h

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

revision 1.8, Thu Mar 28 12:24:41 2002 UTC revision 1.9, Thu Mar 28 20:57:24 2002 UTC
# Line 32  Line 32 
32  #define EMMS() __asm {emms}  #define EMMS() __asm {emms}
33    
34  #define CACHE_LINE  16  #define CACHE_LINE  16
35    
36  #if _MSC_VER <= 1200  #if _MSC_VER <= 1200
37  #define CACHE_ALIGN  #define #define DECLARE_ALIGNED_MATRIX(name,sizex,sizey,type,alignment) \
38            type name##_storage[(sizex)*(sizey)+(alignment)-1]; \
39            type * name = (type *) (((int32_t) name##_storage+(alignment - 1)) & ~((int32_t)(alignment)-1))
40  #else  #else
41  #define CACHE_ALIGN __declspec(align(CACHE_LINE))  #define #define DECLARE_ALIGNED_MATRIX(name,sizex,sizey,type,alignment) \
42            __declspec(align(CACHE_LINE)) type name[(sizex)*(sizey)]
43  #endif  #endif
44    
45  // needed for bitstream.h  // needed for bitstream.h
# Line 85  Line 89 
89    
90  #define DECLARE_ALIGNED_MATRIX(name,sizex,sizey,type,alignment) \  #define DECLARE_ALIGNED_MATRIX(name,sizex,sizey,type,alignment) \
91          type name##_storage[(sizex)*(sizey)+(alignment)-1]; \          type name##_storage[(sizex)*(sizey)+(alignment)-1]; \
92          typedef type  name##_sub[sizey]; \          type * name = (type *) (((int32_t) name##_storage+(alignment - 1)) & ~((int32_t)(alignment)-1))
         name##_sub * name = (void *) (((int32_t) name##_storage+(alignment)) & ~((int32_t)(alignment)-1))  
93    
94  #else  #else
95    
96  #define CACHE_ALIGN __attribute__ ((__aligned__(CACHE_LINE)))  #define #define #define DECLARE_ALIGNED_MATRIX(name,sizex,sizey,type,alignment) \
97            __attribute__ ((__aligned__(CACHE_LINE))) type name[(sizex)*(sizey)]
98    
99  #define int8_t char  #define int8_t char
100  #define uint8_t unsigned char  #define uint8_t unsigned char
101  #define int16_t short  #define int16_t short
# Line 111  Line 116 
116  #else  #else
117          #define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) )          #define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) )
118          #define EMMS() __asm__("emms\n\t")          #define EMMS() __asm__("emms\n\t")
119  #endif  
120    
121  // needed for timer.c  // needed for timer.c
122  static __inline int64_t read_counter() {  static __inline int64_t read_counter() {
# Line 125  Line 130 
130      return ts;      return ts;
131  }  }
132    
133    #endif
134    
135  #else // OTHER OS  #else // OTHER OS
136    
137  #define DEBUG(S)  #define DEBUG(S)

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

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