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.

120 lines
2.7 KiB

  1. //==========================================================================;
  2. //
  3. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. // PURPOSE.
  7. //
  8. // Copyright (c) 1993-1996 Microsoft Corporation
  9. //
  10. //--------------------------------------------------------------------------;
  11. //
  12. // g711.h
  13. //
  14. // Description:
  15. // This file contains prototypes for the filtering routines.
  16. //
  17. //
  18. //==========================================================================;
  19. #ifndef _INC_G711
  20. #define _INC_G711 // #defined if g711.h has been included
  21. #ifndef RC_INVOKED
  22. #pragma pack(1) // assume byte packing throughout
  23. #endif
  24. #ifndef EXTERN_C
  25. #ifdef __cplusplus
  26. #define EXTERN_C extern "C"
  27. #else
  28. #define EXTERN_C extern
  29. #endif
  30. #endif
  31. #ifdef __cplusplus
  32. extern "C" // assume C declarations for C++
  33. {
  34. #endif
  35. //
  36. //
  37. //
  38. #define G711_MAX_CHANNELS 2
  39. #define G711_BITS_PER_SAMPLE 8
  40. #define G711_WFX_EXTRA_BYTES 0
  41. //
  42. // macros to compute block alignment and convert between samples and bytes
  43. // of G711 data. note that these macros assume:
  44. //
  45. // wBitsPerSample = 8
  46. // nChannels = 1 or 2
  47. //
  48. // the pwfx argument is a pointer to a WAVEFORMATEX structure.
  49. //
  50. #define G711_BLOCKALIGNMENT(pwfx) (UINT)(pwfx->nChannels)
  51. #define G711_AVGBYTESPERSEC(pwfx) (DWORD)((pwfx)->nSamplesPerSec * (pwfx)->nChannels)
  52. #define G711_BYTESTOSAMPLES(pwfx, dw) (DWORD)(dw / G711_BLOCKALIGNMENT(pwfx))
  53. #define G711_SAMPLESTOBYTES(pwfx, dw) (DWORD)(dw * G711_BLOCKALIGNMENT(pwfx))
  54. //
  55. // function prototypes from G711.C
  56. //
  57. //
  58. LRESULT FNGLOBAL AlawToPcm
  59. (
  60. LPACMDRVSTREAMINSTANCE padsi,
  61. LPACMDRVSTREAMHEADER padsh
  62. );
  63. LRESULT FNGLOBAL PcmToAlaw
  64. (
  65. LPACMDRVSTREAMINSTANCE padsi,
  66. LPACMDRVSTREAMHEADER padsh
  67. );
  68. LRESULT FNGLOBAL UlawToPcm
  69. (
  70. LPACMDRVSTREAMINSTANCE padsi,
  71. LPACMDRVSTREAMHEADER padsh
  72. );
  73. LRESULT FNGLOBAL PcmToUlaw
  74. (
  75. LPACMDRVSTREAMINSTANCE padsi,
  76. LPACMDRVSTREAMHEADER padsh
  77. );
  78. LRESULT FNGLOBAL AlawToUlaw
  79. (
  80. LPACMDRVSTREAMINSTANCE padsi,
  81. LPACMDRVSTREAMHEADER padsh
  82. );
  83. LRESULT FNGLOBAL UlawToAlaw
  84. (
  85. LPACMDRVSTREAMINSTANCE padsi,
  86. LPACMDRVSTREAMHEADER padsh
  87. );
  88. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  89. //
  90. //
  91. //
  92. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  93. #ifndef RC_INVOKED
  94. #pragma pack() // revert to default packing
  95. #endif
  96. #ifdef __cplusplus
  97. } // end of extern "C" {
  98. #endif
  99. #endif // _INC_G711