Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
3.0 KiB

  1. #define FILEIO 0
  2. // Assembly switches for MMX code
  3. #ifdef _X86_
  4. #if !defined(COMPILE_MMX)
  5. #define COMPILE_MMX 1
  6. #endif
  7. #endif
  8. #ifdef _ALPHA_
  9. //No MMX on Alpha
  10. #if defined(COMPILE_MMX)
  11. #undef COMPILE_MMX
  12. #endif
  13. #endif
  14. #if COMPILE_MMX
  15. #define ASM_FTOSS 1
  16. #define ASM_CORR 1
  17. #define ASM_SVQ 1
  18. #define ASM_FACBK 1
  19. #else
  20. #define ASM_FTOSS 0
  21. #define ASM_CORR 0
  22. #define ASM_SVQ 0
  23. #define ASM_FACBK 0
  24. #endif
  25. // These don't make a numerical difference (compared to model code)
  26. // ...
  27. #ifdef _X86_
  28. #define OPT_PULSE4 1
  29. #define OPT_FLOOR 1
  30. #define OPT_ACBKF 1
  31. #endif
  32. // These are the tricks from FT
  33. #define FT_FBFILT 1 // much faster Find_Best filter that exploits 0's
  34. #define FT_FINDL 1 // faster Find_L with OccPos test removed
  35. // These make a minor numerical difference (max diff = 1)
  36. #ifdef _X86_
  37. #define OPT_DOT 1 // assembly dot product
  38. #define OPT_REV 1 // assembly reverse dot product
  39. #define FIND_L_OPT 1
  40. #endif
  41. //These can't change for alpha
  42. #ifdef _ALPHA_
  43. #define OPT_DOT 0 // assembly dot product
  44. #define OPT_REV 0 // assembly reverse dot product
  45. #define FIND_L_OPT 0
  46. #endif //Alpha
  47. // Bits in "shortcut" flag
  48. #define SC_FINDB 1 // only do 1 Find_Best per subframe
  49. //#define SC_GAIN 2 // only search every other gain
  50. #define SC_GAIN 0
  51. #define SC_LAG1 4 // only search lag=1 in acbk gain search
  52. #define SC_THRES 8 // use 75% of max instead of 50% for codebook threshold
  53. #define SC_DEF (SC_LAG1 | SC_GAIN | SC_FINDB | SC_THRES) // use all shortcuts
  54. #define asint(x) (*(int *)&(x)) // look as FP value as an int
  55. #define ASM __asm
  56. #define QP QWORD PTR
  57. #define DP DWORD PTR
  58. #define WP WORD PTR
  59. #define fxch(n) ASM fxch ST(n)
  60. //no ';' at end of definition so that can be used as
  61. // DECLARE_CHAR(mybytes, 100);
  62. // DECLARE_SHORT(mywords, 32);
  63. // ...
  64. // ALIGN_ARRAY(mybytes);
  65. // ALIGN_ARRAY(mywords);
  66. #define DECLARE_CHAR(array,size) \
  67. char array##_raw[size+8/sizeof(char)]; \
  68. char *array
  69. #define DECLARE_SHORT(array,size) \
  70. short array##_raw[size+8/sizeof(short)]; \
  71. short *array
  72. #define DECLARE_INT(array,size) \
  73. int array##_raw[size+8/sizeof(int)]; \
  74. int *array
  75. #define ALIGN_ARRAY(array) \
  76. array = array##_raw; \
  77. __asm mov eax,array \
  78. __asm add eax,7 \
  79. __asm and eax,0fffffff8h \
  80. __asm mov array,eax
  81. #define ALIGN_SHORT_OFFSET(array,offset) \
  82. array = array##_raw; \
  83. __asm mov eax,array \
  84. __asm mov ebx,offset \
  85. __asm shl ebx,1 \
  86. __asm add eax, ebx \
  87. __asm add eax,7 \
  88. __asm and eax,0fffffff8h \
  89. __asm sub eax,ebx \
  90. __asm mov array,eax
  91. #define DECLARE_STRUCTPTR(type,array) \
  92. struct {type data; char dummy[8];} array##_raw; \
  93. type *array
  94. #define ALIGN_STRUCTPTR(array) \
  95. array = &array##_raw.data; \
  96. __asm mov eax,array \
  97. __asm add eax,7 \
  98. __asm and eax,0fffffff8h \
  99. __asm mov array,eax