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.

286 lines
11 KiB

  1. /*
  2. * @DEC_COPYRIGHT@
  3. */
  4. /*
  5. * HISTORY
  6. * $Log: sa_prototypes.h,v $
  7. * Revision 1.1.8.4 1996/11/14 21:49:25 Hans_Graves
  8. * Added sa_AC3SetParamInt() proto.
  9. * [1996/11/14 21:48:29 Hans_Graves]
  10. *
  11. * Revision 1.1.8.3 1996/11/08 21:50:58 Hans_Graves
  12. * Added AC3 stuff.
  13. * [1996/11/08 21:18:58 Hans_Graves]
  14. *
  15. * Revision 1.1.8.2 1996/09/18 23:46:14 Hans_Graves
  16. * Changed proto for sa_PsychoAnal()
  17. * [1996/09/18 21:58:47 Hans_Graves]
  18. *
  19. * Revision 1.1.6.4 1996/04/10 21:47:34 Hans_Graves
  20. * Added sa_MpegGet/SetParam functions
  21. * [1996/04/10 21:38:49 Hans_Graves]
  22. *
  23. * Revision 1.1.6.3 1996/04/09 16:04:38 Hans_Graves
  24. * Fix protos for sa_SetMPEGBitrate and sa_SetMPEGParams)
  25. * [1996/04/09 16:02:14 Hans_Graves]
  26. *
  27. * Revision 1.1.6.2 1996/03/29 22:21:11 Hans_Graves
  28. * Added MPEG_SUPPORT and GSM_SUPPORT ifdefs
  29. * [1996/03/29 22:13:39 Hans_Graves]
  30. *
  31. * Revision 1.1.4.3 1996/01/19 15:29:34 Bjorn_Engberg
  32. * Removed compiler wanrnings for NT.
  33. * [1996/01/19 14:57:39 Bjorn_Engberg]
  34. *
  35. * Revision 1.1.4.2 1996/01/15 16:26:24 Hans_Graves
  36. * Added prototype for sa_SetMPEGBitrate()
  37. * [1996/01/15 15:43:13 Hans_Graves]
  38. *
  39. * Revision 1.1.2.3 1995/06/27 13:54:26 Hans_Graves
  40. * Added prototypes for GSM.
  41. * [1995/06/27 13:24:34 Hans_Graves]
  42. *
  43. * Revision 1.1.2.2 1995/05/31 18:09:45 Hans_Graves
  44. * Inclusion in new SLIB location.
  45. * [1995/05/31 15:34:15 Hans_Graves]
  46. *
  47. * Revision 1.1.2.3 1995/04/17 18:38:58 Hans_Graves
  48. * Added MPEG Encoding prototypes
  49. * [1995/04/17 18:32:28 Hans_Graves]
  50. *
  51. * Revision 1.1.2.2 1995/04/07 19:36:59 Hans_Graves
  52. * Inclusion in SLIB
  53. * [1995/04/07 19:31:43 Hans_Graves]
  54. *
  55. * $EndLog$
  56. */
  57. /*****************************************************************************
  58. ** Copyright (c) Digital Equipment Corporation, 1995 **
  59. ** **
  60. ** All Rights Reserved. Unpublished rights reserved under the copyright **
  61. ** laws of the United States. **
  62. ** **
  63. ** The software contained on this media is proprietary to and embodies **
  64. ** the confidential technology of Digital Equipment Corporation. **
  65. ** Possession, use, duplication or dissemination of the software and **
  66. ** media is authorized only pursuant to a valid written license from **
  67. ** Digital Equipment Corporation. **
  68. ** **
  69. ** RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure by the U.S. **
  70. ** Government is subject to restrictions as set forth in Subparagraph **
  71. ** (c)(1)(ii) of DFARS 252.227-7013, or in FAR 52.227-19, as applicable. **
  72. ******************************************************************************/
  73. /*--------------------------------------------------------------------------
  74. * SLIB Internals Prototype file (externals are in SA.h)
  75. *
  76. * Modification History: sa_prototypes.h
  77. *
  78. * 29-Jul-94 PSG Created
  79. *---------------------------------------------------------------------------*/
  80. #ifndef _SA_PROTOTYPES_H
  81. #define _SA_PROTOTYPES_H
  82. #ifdef MPEG_SUPPORT
  83. #include "sa_mpeg.h"
  84. #endif /* MPEG_SUPPORT */
  85. #ifdef GSM_SUPPORT
  86. #include "sa_gsm.h"
  87. #endif /* GSM_SUPPORT */
  88. #ifdef AC3_SUPPORT
  89. #include "sa_ac3.h"
  90. #endif /* GSM_SUPPORT */
  91. #include "sa_intrn.h"
  92. /*---------------------------------------------------------------------------*/
  93. /* Compress/Decompress Codec Prototypes */
  94. /*---------------------------------------------------------------------------*/
  95. #ifdef MPEG_SUPPORT
  96. /*
  97. * sa_mpeg_common.c
  98. */
  99. extern SaStatus_t saMpegSetParamInt(SaHandle_t Sah, SaParameter_t param,
  100. qword value);
  101. extern SaStatus_t saMpegSetParamBoolean(SaHandle_t Sah, SaParameter_t param,
  102. ScBoolean_t value);
  103. extern qword saMpegGetParamInt(SaHandle_t Sah, SaParameter_t param);
  104. extern ScBoolean_t saMpegGetParamBoolean(SaHandle_t Svh, SaParameter_t param);
  105. extern int sa_PickTable(SaFrameParams_t *fr_ps);
  106. extern void sa_ShowHeader(SaFrameParams_t *fr_ps);
  107. extern void sa_ShowBitAlloc(unsigned int bit_alloc[2][SBLIMIT],
  108. SaFrameParams_t *f_p);
  109. extern void sa_ShowScale(unsigned int bit_alloc[2][SBLIMIT],
  110. unsigned int scfsi[2][SBLIMIT],
  111. unsigned int scalar[2][3][SBLIMIT],
  112. SaFrameParams_t *fr_ps);
  113. extern void sa_ShowSamples(int ch, unsigned int FAR sample[SBLIMIT],
  114. unsigned int bit_alloc[SBLIMIT], SaFrameParams_t *fr_ps);
  115. extern int sa_BitrateIndex(int layr, int bRate);
  116. extern int sa_SmpFrqIndex(long sRate);
  117. extern void sa_CRCupdate(unsigned int data, unsigned int length, unsigned int *crc);
  118. extern void sa_CRCcalcI(SaFrameParams_t *fr_ps, unsigned int bit_alloc[2][SBLIMIT],
  119. unsigned int *crc);
  120. extern void sa_CRCcalcII(SaFrameParams_t *fr_ps, unsigned int bit_alloc[2][SBLIMIT],
  121. unsigned int scfsi[2][SBLIMIT], unsigned int *crc);
  122. extern SaStatus_t sa_hdr_to_frps(SaFrameParams_t *fr_ps);
  123. /*
  124. * sa_mpeg_decode.c
  125. */
  126. extern SaStatus_t sa_DecompressMPEG(SaCodecInfo_t *Info,
  127. unsigned char *buffer, unsigned int size,
  128. unsigned int *ret_length);
  129. extern SaStatus_t sa_DecodeInfo(ScBitstream_t *bs, SaFrameParams_t *fr_ps);
  130. extern SaStatus_t sa_InitMpegDecoder(SaCodecInfo_t *Info);
  131. extern SaStatus_t sa_EndMpegDecoder(SaCodecInfo_t *Info);
  132. /*
  133. * sa_mpeg_encode.c
  134. */
  135. extern SaStatus_t sa_MpegVerifyEncoderSettings(SaHandle_t Sah);
  136. extern SaStatus_t sa_CompressMPEG(SaCodecInfo_t *Info,
  137. unsigned char *dcmp_buf, unsigned int *dcmp_len,
  138. unsigned int *comp_len);
  139. extern SaStatus_t sa_InitMpegEncoder(SaCodecInfo_t *Info);
  140. extern SaStatus_t sa_EndMpegEncoder(SaCodecInfo_t *Info);
  141. extern unsigned int sa_GetMPEGSampleSize(SaCodecInfo_t *Info);
  142. /*
  143. ** sa_mpeg_tonal.c
  144. */
  145. extern void sa_II_Psycho_One(float buffer[2][1152], float scale[2][SBLIMIT],
  146. float ltmin[2][SBLIMIT], SaFrameParams_t *fr_ps);
  147. extern void sa_I_Psycho_One(float buffer[2][1152], float scale[2][SBLIMIT],
  148. float ltmin[2][SBLIMIT], SaFrameParams_t *fr_ps);
  149. /*
  150. ** sa_mpeg_psy.c
  151. */
  152. extern void sa_PsychoAnal(SaMpegCompressInfo_t *MCInfo, float *buffer,
  153. float savebuf[1056],int chn,int lay,
  154. float snr32[32],float sfreq,int num_pass);
  155. #endif /* MPEG_SUPPORT */
  156. #ifdef GSM_SUPPORT
  157. /*
  158. ** sa_gsm_common.c
  159. */
  160. SaStatus_t sa_InitGSM(SaGSMInfo_t *info);
  161. extern word gsm_mult(word a, word b);
  162. extern dword gsm_L_mult(word a, word b);
  163. extern word gsm_mult_r(word a, word b);
  164. extern word gsm_div(word num, word denum);
  165. extern word gsm_add( word a, word b );
  166. extern dword gsm_L_add(dword a, dword b );
  167. extern word gsm_sub(word a, word b);
  168. extern dword gsm_L_sub(dword a, dword b);
  169. extern word gsm_abs(word a);
  170. extern word gsm_norm(dword a);
  171. extern dword gsm_L_asl(dword a, int n);
  172. extern word gsm_asl(word a, int n);
  173. extern dword gsm_L_asr(dword a, int n);
  174. extern word gsm_asr(word a, int n);
  175. /*
  176. ** sa_gsm_encode.c
  177. */
  178. extern SaStatus_t sa_GSMEncode(SaGSMInfo_t *s, word *dcmp_buf,
  179. unsigned int *dcmp_len,
  180. unsigned char *comp_buf,
  181. ScBitstream_t *bsout);
  182. extern void Gsm_Long_Term_Predictor(SaGSMInfo_t *S, word *d, word *dp, word *e, word *dpp,
  183. word *Nc, word *bc);
  184. extern void Gsm_Encoding(SaGSMInfo_t *S, word *e, word *ep, word *xmaxc,
  185. word *Mc, word *xMc);
  186. extern void Gsm_Short_Term_Analysis_Filter(SaGSMInfo_t *S,word *LARc,word *d);
  187. /*
  188. ** sa_gsm_decode.c
  189. */
  190. extern int sa_GSMDecode(SaGSMInfo_t *s, unsigned char *comp_buf, word *dcmp_buf);
  191. extern void Gsm_Decoding(SaGSMInfo_t *S, word xmaxcr, word Mcr, word *xMcr, word *erp);
  192. extern void Gsm_Long_Term_Synthesis_Filtering(SaGSMInfo_t *S, word Ncr, word bcr,
  193. word *erp, word *drp);
  194. void Gsm_RPE_Decoding(SaGSMInfo_t *S, word xmaxcr, word Mcr, word * xMcr, word * erp);
  195. void Gsm_RPE_Encoding(SaGSMInfo_t *S, word *e, word *xmaxc, word *Mc, word *xMc);
  196. /*
  197. ** sa_gsm_filter.c
  198. */
  199. extern void Gsm_Short_Term_Synthesis_Filter(SaGSMInfo_t *S, word *LARcr,
  200. word *drp, word *s);
  201. extern void Gsm_Update_of_reconstructed_short_time_residual_signal(word *dpp,
  202. word *ep, word *dp);
  203. /*
  204. ** sa_gsm_table.c
  205. */
  206. extern word gsm_A[8], gsm_B[8], gsm_MIC[8], gsm_MAC[8];
  207. extern word gsm_INVA[8];
  208. extern word gsm_DLB[4], gsm_QLB[4];
  209. extern word gsm_H[11];
  210. extern word gsm_NRFAC[8];
  211. extern word gsm_FAC[8];
  212. #endif /* GSM_SUPPORT */
  213. #ifdef AC3_SUPPORT
  214. /* AC-3 specific stuff goes here */
  215. /*
  216. * sa_ac3_decode.c
  217. */
  218. extern SaStatus_t sa_DecompressAC3(SaCodecInfo_t *Info,
  219. unsigned char **buffer, unsigned int size,
  220. unsigned int *ret_length);
  221. extern SaStatus_t sa_InitAC3Decoder(SaCodecInfo_t *Info);
  222. extern SaStatus_t sa_EndAC3Decoder(SaCodecInfo_t *Info);
  223. extern SaStatus_t saAC3SetParamInt(SaHandle_t Sah, SaParameter_t param,
  224. qword value);
  225. #endif /* AC3_SUPPORT */
  226. #ifdef G723_SUPPORT
  227. /* G723 encoder functions.
  228. sa_g723_coder.c
  229. */
  230. typedef short int Flag ;
  231. extern void saG723CompressInit(SaG723Info_t *psaG723Info);
  232. //DataBuff :Input frame (480 bytes)
  233. //Vout :Encoded frame (20 bytes :5.3K bits/s
  234. // (24 bytes :6.3K bits/s)
  235. extern SaStatus_t saG723Compress( SaCodecInfo_t *Info,word *DataBuff, char *Vout );
  236. extern void saG723CompressFree(SaG723Info_t *psaG723Info);
  237. /* G723 decoder functions.
  238. sa_g723_decod.c
  239. */
  240. extern void saG723DecompressInit(SaG723Info_t *psaG723Info);
  241. //DataBuff :Empty Buffer to hold decoded frame(480 bytes)
  242. //Vinp :Encoded frame (20 bytes :5.3K bits/s
  243. // (24 bytes :6.3K bits/s)
  244. //Crc : Transmission Error code (Cyclic Redundant code)
  245. extern SaStatus_t saG723Decompress( SaCodecInfo_t *Info,word *DataBuff,
  246. char *Vinp, word Crc );
  247. extern void saG723DecompressFree(SaG723Info_t *psaG723Info);
  248. extern SaStatus_t saG723SetParamInt(SaHandle_t Sah, SaParameter_t param,
  249. qword value);
  250. extern SaStatus_t saG723SetParamBoolean(SaHandle_t Sah, SaParameter_t param,
  251. ScBoolean_t value);
  252. extern qword saG723GetParamInt(SaHandle_t Sah, SaParameter_t param);
  253. extern ScBoolean_t saG723GetParamBoolean(SaHandle_t Svh, SaParameter_t param);
  254. #endif /* G723_SUPPORT */
  255. #endif _SA_PROTOTYPES_H