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.

235 lines
6.0 KiB

  1. //==========================================================================;
  2. //
  3. // msadpcm.h
  4. //
  5. // Copyright (c) 1992-1994 Microsoft Corporation
  6. //
  7. // Description:
  8. //
  9. //
  10. // History:
  11. //
  12. //==========================================================================;
  13. //
  14. //
  15. //
  16. #define MSADPCM_MAX_CHANNELS 2
  17. #define MSADPCM_MAX_COEFFICIENTS 7
  18. #define MSADPCM_BITS_PER_SAMPLE 4
  19. #define MSADPCM_WFX_EXTRA_BYTES 32
  20. #define MSADPCM_HEADER_LENGTH 7 // in Bytes, per channel.
  21. #define CSCALE_NUM 256
  22. #define PSCALE_NUM 256
  23. #define CSCALE 8
  24. #define PSCALE 8
  25. #define DELTA4START 128
  26. #define DELTA8START 16
  27. #define DELTA4MIN 16
  28. #define DELTA8MIN 1
  29. #define OUTPUT4MASK (0x0F)
  30. #define OUTPUT4MAX 7
  31. #define OUTPUT4MIN (-8)
  32. #define OUTPUT8MAX 127
  33. #define OUTPUT8MIN (-128)
  34. //
  35. // note that these constants are used for encoding only. decode must take
  36. // all info from the file. note that then number of samples/bytes must be
  37. // small enough to let all stored arrays be DS ??? !!!
  38. //
  39. #define BPS4_COMPRESSED 4
  40. #define BPS8_COMPRESSED 8
  41. #define BLOCK4_SAMPLES 500
  42. #define BLOCK4_STREAM_SAMPLES 498
  43. #define BLOCK4_BYTES 256
  44. //
  45. // These are defined as integers (even though they will fit in shorts)
  46. // because they are accessed so often - this will speed stuff up.
  47. //
  48. #ifdef WIN32
  49. extern const int gaiCoef1[];
  50. extern const int gaiCoef2[];
  51. extern const int gaiP4[];
  52. #else
  53. extern short gaiCoef1[];
  54. extern short gaiCoef2[];
  55. extern short gaiP4[];
  56. #endif
  57. //
  58. // Function Prototypes.
  59. //
  60. DWORD FNGLOBAL adpcmEncode4Bit_M08_FullPass
  61. (
  62. HPBYTE pbSrc,
  63. DWORD cbSrcLength,
  64. HPBYTE pbDst,
  65. UINT nBlockAlignment,
  66. UINT cSamplesPerBlock,
  67. UINT nNumCoef,
  68. LPADPCMCOEFSET lpCoefSet
  69. );
  70. DWORD FNGLOBAL adpcmEncode4Bit_M16_FullPass
  71. (
  72. HPBYTE pbSrc,
  73. DWORD cbSrcLength,
  74. HPBYTE pbDst,
  75. UINT nBlockAlignment,
  76. UINT cSamplesPerBlock,
  77. UINT nNumCoef,
  78. LPADPCMCOEFSET lpCoefSet
  79. );
  80. DWORD FNGLOBAL adpcmEncode4Bit_S08_FullPass
  81. (
  82. HPBYTE pbSrc,
  83. DWORD cbSrcLength,
  84. HPBYTE pbDst,
  85. UINT nBlockAlignment,
  86. UINT cSamplesPerBlock,
  87. UINT nNumCoef,
  88. LPADPCMCOEFSET lpCoefSet
  89. );
  90. DWORD FNGLOBAL adpcmEncode4Bit_S16_FullPass
  91. (
  92. HPBYTE pbSrc,
  93. DWORD cbSrcLength,
  94. HPBYTE pbDst,
  95. UINT nBlockAlignment,
  96. UINT cSamplesPerBlock,
  97. UINT nNumCoef,
  98. LPADPCMCOEFSET lpCoefSet
  99. );
  100. #ifdef WIN32
  101. DWORD FNGLOBAL adpcmEncode4Bit_M08_OnePass
  102. (
  103. HPBYTE pbSrc,
  104. DWORD cbSrcLength,
  105. HPBYTE pbDst,
  106. UINT nBlockAlignment,
  107. UINT cSamplesPerBlock,
  108. UINT nNumCoef,
  109. LPADPCMCOEFSET lpCoefSet
  110. );
  111. DWORD FNGLOBAL adpcmEncode4Bit_M16_OnePass
  112. (
  113. HPBYTE pbSrc,
  114. DWORD cbSrcLength,
  115. HPBYTE pbDst,
  116. UINT nBlockAlignment,
  117. UINT cSamplesPerBlock,
  118. UINT nNumCoef,
  119. LPADPCMCOEFSET lpCoefSet
  120. );
  121. DWORD FNGLOBAL adpcmEncode4Bit_S08_OnePass
  122. (
  123. HPBYTE pbSrc,
  124. DWORD cbSrcLength,
  125. HPBYTE pbDst,
  126. UINT nBlockAlignment,
  127. UINT cSamplesPerBlock,
  128. UINT nNumCoef,
  129. LPADPCMCOEFSET lpCoefSet
  130. );
  131. DWORD FNGLOBAL adpcmEncode4Bit_S16_OnePass
  132. (
  133. HPBYTE pbSrc,
  134. DWORD cbSrcLength,
  135. HPBYTE pbDst,
  136. UINT nBlockAlignment,
  137. UINT cSamplesPerBlock,
  138. UINT nNumCoef,
  139. LPADPCMCOEFSET lpCoefSet
  140. );
  141. DWORD FNGLOBAL adpcmDecode4Bit_M08
  142. (
  143. HPBYTE pbSrc,
  144. DWORD cbSrcLength,
  145. HPBYTE pbDst,
  146. UINT nBlockAlignment,
  147. UINT cSamplesPerBlock,
  148. UINT nNumCoef,
  149. LPADPCMCOEFSET lpCoefSet
  150. );
  151. DWORD FNGLOBAL adpcmDecode4Bit_M16
  152. (
  153. HPBYTE pbSrc,
  154. DWORD cbSrcLength,
  155. HPBYTE pbDst,
  156. UINT nBlockAlignment,
  157. UINT cSamplesPerBlock,
  158. UINT nNumCoef,
  159. LPADPCMCOEFSET lpCoefSet
  160. );
  161. DWORD FNGLOBAL adpcmDecode4Bit_S08
  162. (
  163. HPBYTE pbSrc,
  164. DWORD cbSrcLength,
  165. HPBYTE pbDst,
  166. UINT nBlockAlignment,
  167. UINT cSamplesPerBlock,
  168. UINT nNumCoef,
  169. LPADPCMCOEFSET lpCoefSet
  170. );
  171. DWORD FNGLOBAL adpcmDecode4Bit_S16
  172. (
  173. HPBYTE pbSrc,
  174. DWORD cbSrcLength,
  175. HPBYTE pbDst,
  176. UINT nBlockAlignment,
  177. UINT cSamplesPerBlock,
  178. UINT nNumCoef,
  179. LPADPCMCOEFSET lpCoefSet
  180. );
  181. #else
  182. //
  183. // These prototypes are for assembler routines in dec386.asm and enc386.asm
  184. //
  185. DWORD FNGLOBAL DecodeADPCM_4Bit_386
  186. (
  187. LPADPCMWAVEFORMAT pwfADPCM,
  188. LPBYTE pbSrc,
  189. LPPCMWAVEFORMAT pwfPCM,
  190. LPBYTE pbDst,
  191. DWORD cbSrcLen
  192. );
  193. DWORD FNGLOBAL EncodeADPCM_4Bit_386
  194. (
  195. LPPCMWAVEFORMAT pwfPCM,
  196. LPBYTE pbSrc,
  197. LPADPCMWAVEFORMAT pwfADPCM,
  198. LPBYTE pbDst,
  199. DWORD cbSrcLen
  200. );
  201. #endif