Source code of Windows XP (NT5)
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.

137 lines
3.3 KiB

  1. /***********************************************************
  2. Copyrights : ksWaves Ltd. 1998.
  3. Provided to Microsoft under contract between ksWaves and Microsoft.
  4. ************************************************************/
  5. /****************************************************************************
  6. Const defines :
  7. *****************************************************************************/
  8. #define FPU_DENORM_OFFS (float)1.0E-30
  9. #define BASE_REV_DELAY 0x4000
  10. #define BASE_DSPS_DELAY 0x800
  11. #define DSPS_MASK 0x7ff
  12. #define REV_MASK 0x3fff
  13. /****************************************************************************
  14. Coefs Struct :
  15. *****************************************************************************/
  16. typedef struct
  17. {
  18. long mySize;
  19. long myVersion;
  20. float SampleRate;
  21. float directGain;
  22. long l_directGain;
  23. float revGain;
  24. long l_revGain;
  25. long lDelay1;
  26. long lDelay2;
  27. long lDelay3;
  28. long lDelay4;
  29. long lDDly1;
  30. long lDDly2;
  31. float dDsps;
  32. long l_dDsps;
  33. float dDG1;
  34. long l_dDG1;
  35. float dDG2;
  36. long l_dDG2;
  37. float dFB11;
  38. long l_dFB11;
  39. float dFB12;
  40. long l_dFB12;
  41. float dFB21;
  42. long l_dFB21;
  43. float dFB22;
  44. long l_dFB22;
  45. float dFB31;
  46. long l_dFB31;
  47. float dFB32;
  48. long l_dFB32;
  49. float dFB41;
  50. long l_dFB41;
  51. float dFB42;
  52. long l_dFB42;
  53. float dDamp;
  54. long l_dDamp;
  55. } sCoefsStruct;
  56. /****************************************************************************
  57. Initialization and control functions :
  58. *****************************************************************************/
  59. #ifdef __cplusplus
  60. extern "C"
  61. {
  62. #endif
  63. #define MAX_16 (float)((unsigned long)0x00008000)
  64. void InitSVerbStates( long *pStates );
  65. long DToF32( float dbl );
  66. void ConvertCoefsToFix( void *pC );
  67. void InitSVerb( float SampleRate, void *pCoefs);
  68. void SetSVerb( float InGain, float dRevMix, float dRevTime,
  69. float dHighFreqRTRatio, void *pCoefs );
  70. long GetCoefsSize(void);
  71. long GetStatesSize(void);
  72. long GetSVerbVersion(void);
  73. float VerifySampleRate(void *pCoefs);
  74. long VerifyVersion(void *pCoefs);
  75. long VerifySize(void *pCoefs);
  76. #define CLIP_SHORT_TO_SHORT(x)\
  77. if (x>32767)\
  78. x = 32767;\
  79. else if (x<-32768)\
  80. x = -32768;
  81. /****************************************************************************
  82. //Process Functions :
  83. *****************************************************************************/
  84. __inline void dsps( float *pDly, long ref, long delay, float dDG1, float dDsps, float *inL, float *inR );
  85. __inline void dspsL( long *pDly, long ref, long delay, long dDG1, long dDsps, long *inL, long *inR );
  86. void SVerbMonoToMonoShort(long NumInFrames, short *pInShort, short *pOutShort,
  87. void *pCoefs, long *pStates);
  88. void SVerbMonoToStereoShort(long NumInFrames, short *pInShort, short *pOutShort,
  89. void *pCoefs, long *pStates);
  90. void SVerbStereoToStereoShort(long NumInFrames, short *pInShort, short *pOutShort,
  91. void *pCoefs, long *pStates);
  92. void SVerbMonoToMonoFloat(long NumInFrames, float *pInFloat, float *pOutFloat,
  93. void *pCoefs, float *pStates);
  94. void SVerbMonoToStereoFloat(long NumInFrames, float *pInFloat, float *pOutFloat,
  95. void *pCoefs, float *pStates);
  96. void SVerbStereoToStereoFloat(long NumInFrames, float *pInFloat, float *pOutFloat,
  97. void *pCoefs, float *pStates);
  98. #ifdef __cplusplus
  99. }
  100. #endif