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.

669 lines
26 KiB

  1. /*
  2. * @DEC_COPYRIGHT@
  3. */
  4. /*
  5. * HISTORY
  6. * $Log: sv_prototypes.h,v $
  7. * Revision 1.1.9.6 1996/10/28 17:32:26 Hans_Graves
  8. * Changed sv_MpegGet/SetParamInt() to use qwords.
  9. * [1996/10/28 17:07:11 Hans_Graves]
  10. *
  11. * Revision 1.1.9.5 1996/10/02 18:42:52 Hans_Graves
  12. * Added InputFourCC to sv_MpegEncodeFrameInOrder().
  13. * [1996/10/02 18:34:36 Hans_Graves]
  14. *
  15. * Revision 1.1.9.4 1996/07/19 02:11:09 Hans_Graves
  16. * Change 422i motion recon function protos.
  17. * [1996/07/19 01:27:59 Hans_Graves]
  18. *
  19. * Revision 1.1.9.3 1996/05/24 22:21:42 Hans_Graves
  20. * Added MPEG 422i protos
  21. * [1996/05/24 21:55:51 Hans_Graves]
  22. *
  23. * Revision 1.1.9.2 1996/05/07 19:56:10 Hans_Graves
  24. * Added HUFF_SUPPORT
  25. * [1996/05/07 17:24:56 Hans_Graves]
  26. *
  27. * Revision 1.1.7.7 1996/04/10 21:47:39 Hans_Graves
  28. * Added Set/GetParamBoolean()
  29. * [1996/04/10 20:39:51 Hans_Graves]
  30. *
  31. * Revision 1.1.7.6 1996/04/09 20:50:35 Karen_Dintino
  32. * Adding WIN32 support
  33. * [1996/04/09 20:47:45 Karen_Dintino]
  34. *
  35. * Revision 1.1.7.5 1996/04/09 16:04:40 Hans_Graves
  36. * Fix protos for sv_MpegIDCTToFrame/AddToFrame()
  37. * [1996/04/09 16:03:24 Hans_Graves]
  38. *
  39. * Revision 1.1.7.4 1996/04/04 23:35:05 Hans_Graves
  40. * Added protos for sv_MpegReconFieldBlock() and sv_MpegReconFrameBlock()
  41. * [1996/04/04 22:59:42 Hans_Graves]
  42. *
  43. * Revision 1.1.7.3 1996/03/29 22:21:21 Hans_Graves
  44. * Added JPEG_SUPPORT ifdefs.
  45. * [1996/03/29 22:14:58 Hans_Graves]
  46. *
  47. * Added protos for SvMpegIDCTToFrameP_S() and SvMpegIDCTAddToFrameP_S()
  48. * [1996/03/27 21:54:00 Hans_Graves]
  49. *
  50. * Revision 1.1.7.2 1996/03/08 18:46:37 Hans_Graves
  51. * Added protos for new MPEG assembly
  52. * [1996/03/08 16:25:05 Hans_Graves]
  53. *
  54. * Revision 1.1.4.5 1996/02/06 22:54:03 Hans_Graves
  55. * Added MpegGet/SetParam() prototypes
  56. * [1996/02/06 22:50:20 Hans_Graves]
  57. *
  58. * Revision 1.1.4.4 1996/01/24 19:33:21 Hans_Graves
  59. * Changed DCT block for shorts to ints
  60. * [1996/01/24 18:13:05 Hans_Graves]
  61. *
  62. * Revision 1.1.4.3 1996/01/08 16:41:29 Hans_Graves
  63. * Updated MPEG I and II prototypes for new decoder
  64. * [1996/01/08 15:47:45 Hans_Graves]
  65. *
  66. * Revision 1.1.4.2 1995/12/07 19:31:35 Hans_Graves
  67. * Removed prototype for error()
  68. * [1995/12/07 19:20:55 Hans_Graves]
  69. *
  70. * Added MPEG encoder prototypes
  71. * [1995/12/07 18:00:18 Hans_Graves]
  72. *
  73. * Revision 1.1.2.16 1995/09/22 12:58:43 Bjorn_Engberg
  74. * Use MPEG_SUPPORT and H261_SUPPORT.
  75. * [1995/09/22 12:50:18 Bjorn_Engberg]
  76. *
  77. * Revision 1.1.2.15 1995/09/11 20:36:34 Paul_Gauthier
  78. * Add version string to JPEG header as APP1 segment
  79. * [1995/09/11 20:35:13 Paul_Gauthier]
  80. *
  81. * Revision 1.1.2.14 1995/08/15 19:13:57 Karen_Dintino
  82. * {** Merge Information **}
  83. * {** Command used: bsubmit **}
  84. * {** Ancestor revision: 1.1.2.12 **}
  85. * {** Merge revision: 1.1.2.13 **}
  86. * {** End **}
  87. * fix reentrant problem
  88. * [1995/08/15 18:31:06 Karen_Dintino]
  89. *
  90. * Revision 1.1.2.13 1995/08/14 19:40:28 Hans_Graves
  91. * Fixed H261 Init prototypes.
  92. * [1995/08/14 18:43:51 Hans_Graves]
  93. *
  94. * Revision 1.1.2.12 1995/08/07 22:09:52 Hans_Graves
  95. * Added prototype for CrawlMotionEstimation()
  96. * [1995/08/07 22:09:31 Hans_Graves]
  97. *
  98. * Revision 1.1.2.11 1995/08/04 16:32:28 Karen_Dintino
  99. * Change to SvStatus_t for some low level rtns
  100. * [1995/08/04 16:22:50 Karen_Dintino]
  101. *
  102. * Revision 1.1.2.10 1995/08/03 18:02:07 Karen_Dintino
  103. * Encode/Decode routines need to return SvStatus_t
  104. * [1995/08/03 18:00:02 Karen_Dintino]
  105. *
  106. * Revision 1.1.2.9 1995/08/02 15:27:00 Hans_Graves
  107. * Changed prototype for blockdiff16_C()
  108. * [1995/08/02 15:25:00 Hans_Graves]
  109. *
  110. * Revision 1.1.2.8 1995/07/28 17:36:05 Hans_Graves
  111. * Added prototype for sv_CompressH261()
  112. * [1995/07/28 17:29:00 Hans_Graves]
  113. *
  114. * Revision 1.1.2.7 1995/07/26 17:48:57 Hans_Graves
  115. * Added prototype for sv_DecompressH261()
  116. * [1995/07/26 17:47:19 Hans_Graves]
  117. *
  118. * Revision 1.1.2.6 1995/07/17 16:12:17 Hans_Graves
  119. * Added H261 prototypes.
  120. * [1995/07/17 15:54:27 Hans_Graves]
  121. *
  122. * Revision 1.1.2.5 1995/06/27 13:54:27 Hans_Graves
  123. * Removed prototype for sv_RdRunLevel().
  124. * [1995/06/27 13:52:12 Hans_Graves]
  125. *
  126. * Revision 1.1.2.4 1995/06/20 14:13:39 Karen_Dintino
  127. * Separate H.261 prototypes
  128. * [1995/06/20 13:29:25 Karen_Dintino]
  129. *
  130. * Revision 1.1.2.3 1995/06/19 20:31:18 Karen_Dintino
  131. * Added support for H.261
  132. * [1995/06/19 20:14:23 Karen_Dintino]
  133. *
  134. * Revision 1.1.2.2 1995/05/31 18:10:24 Hans_Graves
  135. * Inclusion in new SLIB location.
  136. * [1995/05/31 15:51:00 Hans_Graves]
  137. *
  138. * Revision 1.1.2.8 1994/12/14 19:09:54 Paul_Gauthier
  139. * Removed sv_gentoc.c from SLIB
  140. * [1994/12/14 19:07:29 Paul_Gauthier]
  141. *
  142. * Revision 1.1.2.7 1994/12/12 15:39:31 Paul_Gauthier
  143. * Merge changes from other SLIB versions
  144. * [1994/12/12 15:35:04 Paul_Gauthier]
  145. *
  146. * Revision 1.1.2.6 1994/11/09 21:33:12 Paul_Gauthier
  147. * Optimizations
  148. * [1994/11/09 15:31:22 Paul_Gauthier]
  149. *
  150. * Revision 1.1.2.3 1994/10/13 20:34:53 Paul_Gauthier
  151. * MPEG cleanup
  152. * [1994/10/12 21:08:55 Paul_Gauthier]
  153. *
  154. * Revision 1.1.2.2 1994/10/07 14:58:16 Paul_Gauthier
  155. * SLIB v3.0 incl. MPEG Decode
  156. * [1994/10/07 13:57:07 Paul_Gauthier]
  157. *
  158. * $EndLog$
  159. */
  160. /*
  161. **++
  162. ** FACILITY: Workstation Multimedia (WMM) v1.0
  163. **
  164. ** FILE NAME:
  165. ** MODULE NAME:
  166. **
  167. ** MODULE DESCRIPTION:
  168. **
  169. ** DESIGN OVERVIEW:
  170. **
  171. **--
  172. */
  173. /*****************************************************************************
  174. ** Copyright (c) Digital Equipment Corporation, 1994 **
  175. ** **
  176. ** All Rights Reserved. Unpublished rights reserved under the copyright **
  177. ** laws of the United States. **
  178. ** **
  179. ** The software contained on this media is proprietary to and embodies **
  180. ** the confidential technology of Digital Equipment Corporation. **
  181. ** Possession, use, duplication or dissemination of the software and **
  182. ** media is authorized only pursuant to a valid written license from **
  183. ** Digital Equipment Corporation. **
  184. ** **
  185. ** RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure by the U.S. **
  186. ** Government is subject to restrictions as set forth in Subparagraph **
  187. ** (c)(1)(ii) of DFARS 252.227-7013, or in FAR 52.227-19, as applicable. **
  188. ******************************************************************************/
  189. /*--------------------------------------------------------------------------
  190. * SLIB Internals Prototype file (externals are in SV.h)
  191. *
  192. * Modification History: sv_prototypes.h
  193. *
  194. * 29-Jul-94 PSG Created
  195. *---------------------------------------------------------------------------*/
  196. #ifndef _SV_PROTOTYPES_H
  197. #define _SV_PROTOTYPES_H
  198. extern void DumpBlock(char *title, short *blk);
  199. /*---------------------------------------------------------------------------*/
  200. /* Compress/Decompress Codec Prototypes */
  201. /*---------------------------------------------------------------------------*/
  202. /*
  203. ** sv_codec_api.c
  204. */
  205. static SvStatus_t sv_GetYUVComponentPointers(int, int, int, u_char *, int,
  206. u_char **, u_char **, u_char **);
  207. static SvStatus_t sv_JpegExtractBlocks (SvCodecInfo_t *, u_char *);
  208. #ifdef JPEG_SUPPORT
  209. /*
  210. ** sv_jpeg_decode.c
  211. */
  212. static void sv_FillBitBuffer (int);
  213. static SvStatus_t sv_ProcessRestart (SvCodecInfo_t *);
  214. extern SvStatus_t sv_DecodeJpeg (SvCodecInfo_t *);
  215. extern void sv_ReInitJpegDecoder (SvCodecInfo_t *);
  216. /*
  217. ** sv_jpeg_encode.c
  218. */
  219. extern void WriteJpegData(char *, int, u_char **);
  220. extern void FlushBytes (u_char **);
  221. static void EmitBits(u_short, int);
  222. static void FlushBits (void);
  223. extern void sv_EncodeOneBlock (SvRLE_t *, SvHt_t *, SvHt_t *);
  224. extern void sv_HuffEncoderInit (SvCodecInfo_t *);
  225. extern void EmitRestart (SvJpegCompressInfo_t *);
  226. extern void sv_HuffEncoderTerm (u_char **);
  227. /*
  228. ** sv_jpeg_format.c
  229. */
  230. extern SvStatus_t sv_AddJpegHeader (SvHandle_t, u_char *, int, int *);
  231. extern SvStatus_t sv_AddJpegTrailer (SvHandle_t, u_char *, int, int *);
  232. extern SvStatus_t sv_FormatJpegData (SvHandle_t, char *, char *, int, int *);
  233. static SvStatus_t sv_AddCompSpecs (int, int, int, int, char **, char *);
  234. static SvStatus_t sv_AddEntropyData (SvCodecInfo_t *, char *, char **, char *);
  235. static SvStatus_t sv_AddFrame (SvCodecInfo_t *, char *, char **, char *);
  236. static SvStatus_t sv_AddFrameHeader (SvCodecInfo_t *, char **, char *);
  237. static SvStatus_t sv_AddMarker ();
  238. static SvStatus_t sv_AddScanHeader (SvCodecInfo_t *, char **, char *);
  239. static SvStatus_t sv_AddSLIBHeader (char **, char *);
  240. static SvStatus_t sv_Write16bits (short, char **, char *);
  241. static SvStatus_t sv_Write8bits (int, char **, char *);
  242. static SvStatus_t sv_AddMMSVer (char **, char *);
  243. /*
  244. ** sv_jpeg_init.c
  245. */
  246. static SvStatus_t sv_InitEncoderStruct (SvCodecInfo_t *);
  247. static SvStatus_t sv_InitDecoderStruct (SvCodecInfo_t *);
  248. static SvStatus_t sv_InitHDecoder (SvCodecInfo_t *);
  249. extern SvStatus_t sv_InitJpegEncoder (SvCodecInfo_t *);
  250. extern SvStatus_t sv_InitJpegDecoder (SvCodecInfo_t *);
  251. extern SvStatus_t sv_InitInfo (SvCodecInfo_t *);
  252. extern void sv_copyHTable (SvHt_t *, SvHt_t *);
  253. extern SvStatus_t sv_CheckChroma (SvCodecInfo_t *);
  254. static int JroundUp (int, int);
  255. /*
  256. ** sv_jpeg_tables.c
  257. */
  258. extern SvStatus_t sv_MakeQTables (int, SvCodecInfo_t *);
  259. extern SvStatus_t sv_MakeHEncodingTables (SvCodecInfo_t *);
  260. extern SvStatus_t sv_MakeHDecodingTables (SvCodecInfo_t *);
  261. extern SvStatus_t sv_MakeEncoderBlkTable (SvCodecInfo_t *);
  262. extern SvStatus_t sv_MakeDecoderBlkTable (SvCodecInfo_t *);
  263. static void sv_MakeHCodeTables (SvHt_t *, char *, u_short *, u_int *);
  264. extern SvStatus_t sv_ConvertQTable (SvCodecInfo_t *, SvQuantTables_t *);
  265. extern SvStatus_t sv_LoadDefaultHTable (SvCodecInfo_t *);
  266. /*
  267. ** sv_jpeg_parse.c
  268. */
  269. static u_int sv_GetShort (SvCodecInfo_t *);
  270. static int sv_GetNextMarker (void);
  271. static void sv_ProcessBogusMarker (SvCodecInfo_t *);
  272. static SvStatus_t sv_ProcessDHT (SvCodecInfo_t *);
  273. static SvStatus_t sv_ProcessDQT (SvCodecInfo_t *);
  274. static SvStatus_t sv_ProcessDRI (SvCodecInfo_t *);
  275. static SvStatus_t sv_ProcessAPP0 (SvCodecInfo_t *);
  276. static SvStatus_t sv_ProcessSOF (SvCodecInfo_t *, int);
  277. static SvStatus_t sv_ProcessSOS (SvCodecInfo_t *);
  278. static SvStatus_t sv_ProcessSOI (SvCodecInfo_t *);
  279. /*static int sv_ProcessTables (SvCodecInfo_t *);*/
  280. static SvStatus_t sv_ParseFileHeader (SvCodecInfo_t *);
  281. extern SvStatus_t sv_ParseScanHeader (SvCodecInfo_t *);
  282. extern SvStatus_t sv_ParseFrame (u_char *, int, SvCodecInfo_t *);
  283. #endif /* JPEG_SUPPORT */
  284. #ifdef MPEG_SUPPORT
  285. /*---------------------------------------------------------------------------*/
  286. /* MPEG Prototypes */
  287. /*---------------------------------------------------------------------------*/
  288. /*
  289. ** sv_mpeg_common.c
  290. */
  291. extern SvStatus_t sv_MpegSetParamBoolean(SvHandle_t Svh, SvParameter_t param,
  292. ScBoolean_t value);
  293. extern SvStatus_t sv_MpegSetParamInt(SvHandle_t Svh, SvParameter_t param,
  294. qword value);
  295. extern SvStatus_t sv_MpegSetParamFloat(SvHandle_t Svh, SvParameter_t param,
  296. float value);
  297. extern ScBoolean_t sv_MpegGetParamBoolean(SvHandle_t Svh, SvParameter_t param);
  298. extern qword sv_MpegGetParamInt(SvHandle_t Svh, SvParameter_t param);
  299. extern float sv_MpegGetParamFloat(SvHandle_t Svh, SvParameter_t param);
  300. /*
  301. ** sv_mpeg_parse.c
  302. */
  303. extern SvStatus_t sv_MpegGetHeader(SvMpegDecompressInfo_t *MpegInfo,
  304. ScBitstream_t *bs);
  305. extern int sv_MpegGetSliceHdr(SvMpegDecompressInfo_t *MpegInfo,
  306. ScBitstream_t *bs,
  307. SvMpegLayer_t *layer);
  308. extern SvStatus_t sv_MpegGetImageInfo(int fd, SvImageInfo_t *iminfo);
  309. extern SvStatus_t sv_MpegFindNextPicture(SvCodecInfo_t *Info,
  310. SvPictureInfo_t *PictureInfo);
  311. /*
  312. ** sv_mpeg_decode.c
  313. */
  314. extern SvStatus_t sv_MpegInitDecoder (SvCodecInfo_t *Info);
  315. extern SvStatus_t sv_MpegFreeDecoder(SvCodecInfo_t *Info);
  316. extern SvStatus_t sv_MpegDecompressFrame(SvCodecInfo_t *, u_char *, u_char **);
  317. /*
  318. ** sv_mpeg_block.c
  319. */
  320. extern ScBoolean_t sv_MpegGetIntraBlock(
  321. ScBitstream_t *bs, SvMpegLayer_t *layer, int comp,
  322. int *dc_dct_pred);
  323. extern ScBoolean_t sv_MpegGetInterBlock(SvMpegDecompressInfo_t *MpegInfo,
  324. ScBitstream_t *bs, SvMpegLayer_t *layer, int comp);
  325. extern ScBoolean_t sv_Mpeg2GetIntraBlock(SvMpegDecompressInfo_t *MpegInfo,
  326. ScBitstream_t *bs, SvMpegLayer_t *layer, int comp,
  327. int *dc_dct_pred);
  328. extern ScBoolean_t sv_Mpeg2GetInterBlock(SvMpegDecompressInfo_t *MpegInfo,
  329. ScBitstream_t *bs, SvMpegLayer_t *layer, int comp);
  330. extern ScBoolean_t sv_MpegMotionVectors(ScBitstream_t *bs,
  331. int PMV[2][2][2],
  332. int dmvector[2], int mv_field_sel[2][2],
  333. int s, int mv_count, int mv_format,
  334. int h_r_size, int v_r_size, int dmv, int mvscale);
  335. extern ScBoolean_t sv_MpegMotionVector(ScBitstream_t *bs,
  336. int *PMV, int *dmvector,
  337. int h_r_size, int v_r_size,
  338. int dmv, int mvscale, int full_pel_vector);
  339. extern void sv_MpegCalcDMV(SvMpegDecompressInfo_t *MpegInfo,
  340. int DMV[][2], int *dmvector, int mvx, int mvy);
  341. extern int sv_MpegGetDClum_C(ScBitString_t bits, unsigned int *bitsleft);
  342. extern int sv_MpegGetDCchrom_C(ScBitString_t bits, unsigned int *bitsleft);
  343. /*
  344. ** sv_mpeg_block2.s
  345. */
  346. extern void sv_MpegClearBlock_S(int *block);
  347. extern int sv_MpegInterHuffToDCT_S(int *dctblk, unsigned int zzpos,
  348. ScBitString_t bits, unsigned int *pbitsleft,
  349. int quant_scale, int *quant_matrix);
  350. extern int sv_MpegIntraHuffToDCT_S(int *dctblk, unsigned int comp,
  351. ScBitString_t bits, unsigned int *pbitsleft,
  352. int quant_scale, int *quant_matrix,
  353. int *dc_dct_pred);
  354. extern int sv_MpegGetDClum_S(ScBitString_t bits, unsigned int *bitsleft);
  355. extern int sv_MpegGetDCchrom_S(ScBitString_t bits, unsigned int *bitsleft);
  356. /*
  357. ** sv_mpeg_recon.c
  358. */
  359. extern void sv_MpegReconstruct(SvMpegDecompressInfo_t *MpegInfo,
  360. unsigned char **newframe, int bx, int by,
  361. int mb_type, int motion_type, int PMV[2][2][2],
  362. int mv_field_sel[2][2], int dmvector[2], int stwtype);
  363. extern void sv_MpegReconFieldBlock(int chroma,
  364. unsigned char *src[], int sfield,
  365. unsigned char *dst[], int dfield, int lx, int lx2,
  366. int w, int h, int x, int y, int dx, int dy, int addflag);
  367. extern void sv_MpegReconFrameBlock(int chroma,
  368. unsigned char *src[], unsigned char *dst[], int lx, int lx2,
  369. int w, int h, int x, int y, int dx, int dy, int addflag);
  370. /*
  371. ** sv_mpeg_getmb.c
  372. */
  373. extern int sv_MpegGetMBtype(SvMpegDecompressInfo_t *MpegInfo,
  374. ScBitstream_t *bs, SvMpegLayer_t *layer);
  375. extern int sv_MpegGetIMBtype(SvMpegDecompressInfo_t *MpegInfo,
  376. ScBitstream_t *bs);
  377. extern int sv_MpegGetPMBtype(SvMpegDecompressInfo_t *MpegInfo,
  378. ScBitstream_t *bs);
  379. extern int sv_MpegGetBMBtype(SvMpegDecompressInfo_t *MpegInfo,
  380. ScBitstream_t *bs);
  381. extern int sv_MpegGetDMBtype(SvMpegDecompressInfo_t *MpegInfo,
  382. ScBitstream_t *bs);
  383. extern int sv_MpegGetSpIMBtype(SvMpegDecompressInfo_t *MpegInfo,
  384. ScBitstream_t *bs);
  385. extern int sv_MpegGetSpPMBtype(SvMpegDecompressInfo_t *MpegInfo,
  386. ScBitstream_t *bs);
  387. extern int sv_MpegGetSpBMBtype(SvMpegDecompressInfo_t *MpegInfo,
  388. ScBitstream_t *bs);
  389. extern int sv_MpegGetSNRMBtype(SvMpegDecompressInfo_t *MpegInfo,
  390. ScBitstream_t *bs);
  391. extern int sv_MpegGetCBP(ScBitstream_t *bs);
  392. /*
  393. ** sv_mpeg_422recon.c
  394. */
  395. void sv_CopyCBP_C(int *cpbdata, unsigned char *np, unsigned int w);
  396. void sv_CopyCBPf_C(int *cpbdata, unsigned char *np, unsigned int w);
  397. void sv_MpegFrameCopy411to422i(unsigned char *refframe,
  398. unsigned char *newframe,
  399. int x, int y, unsigned int w,
  400. int dx, int dy, unsigned char *tmpbuf);
  401. void sv_MpegFrameMC411to422i(int *block, unsigned int cbp,
  402. unsigned char *refframe, unsigned char *newframe,
  403. int x, int y, unsigned int w, int dx, int dy,
  404. ScBoolean_t fdct, unsigned char *tmpbuf);
  405. void sv_MpegDFrameMC411to422i(int *block, unsigned int cbp,
  406. unsigned char *brefframe, unsigned char *frefframe,
  407. unsigned char *newframe,
  408. int x, int y, unsigned int w,
  409. int bdx, int bdy, int fdx, int fdy, ScBoolean_t fdct,
  410. unsigned char *tmpbuf);
  411. void sv_MpegDFieldMC411to422i(int *block, unsigned int cbp,
  412. unsigned char *refframe, int rfield0, int rfield1,
  413. unsigned char *newframe, int x, int y, unsigned int w,
  414. int dx0, int dy0, int dx1, int dy1, ScBoolean_t fdct,
  415. unsigned char *tmpbuf);
  416. void sv_MpegQFieldMC411to422i(int *blocks, unsigned int cbp,
  417. unsigned char *bframe, int bfield0, int bfield1,
  418. unsigned char *fframe, int ffield0, int ffield1,
  419. unsigned char *newframe, int x, int y, unsigned int w,
  420. int bdx0, int bdy0, int bdx1, int bdy1,
  421. int fdx0, int fdy0, int fdx1, int fdy1,
  422. ScBoolean_t fdct, unsigned char *tmpbuf);
  423. /*
  424. ** sv_mpeg_422reconcbp.s
  425. */
  426. void sv_CopyCBP_S(int *cpbdata, unsigned char *np, unsigned int w);
  427. void sv_CopyCBPf_S(int *cpbdata, unsigned char *np, unsigned int w);
  428. /*
  429. ** sv_mpeg_idct.c
  430. */
  431. void sv_MpegIDCTToFrame_C(int *inbuf, unsigned char *rfp, int incr);
  432. void sv_MpegIDCTAddToFrame_C(int *inbuf, unsigned char *rfp, int incr);
  433. void sv_MpegIDCTToFrame2_C(int *inbuf, unsigned char *rfp, int rinc,
  434. unsigned char *ffp, int finc, int comp);
  435. void sv_MpegIDCTAddToFrame2_C(int *inbuf, unsigned char *rfp, int rinc,
  436. unsigned char *ffp, int finc, int comp);
  437. /*
  438. ** sv_mpeg_idct2.s
  439. */
  440. void sv_MpegIDCTToFrame_S(int *inbuf, unsigned char *rfp, int incr);
  441. void sv_MpegIDCTAddToFrame_S(int *inbuf, unsigned char *rfp, int incr);
  442. /*
  443. ** sv_mpeg_idct3.s
  444. */
  445. void sv_MpegIDCTToFrameP_S(int *inbuf, unsigned char *rfp, int incr);
  446. void sv_MpegIDCTAddToFrameP_S(int *inbuf, unsigned char *rfp, int incr);
  447. /*
  448. ** sv_mpeg_init.c
  449. */
  450. extern SvStatus_t sv_MpegInitEncoder(SvCodecInfo_t *Info);
  451. extern SvStatus_t sv_MpegFreeEncoder(SvCodecInfo_t *Info);
  452. /*
  453. ** sv_mpeg_encode.c
  454. */
  455. extern SvStatus_t sv_MpegEncoderBegin(SvCodecInfo_t *Info);
  456. extern SvStatus_t sv_MpegEncodeFrame(SvCodecInfo_t *Info,
  457. unsigned char *InputImage);
  458. extern SvStatus_t sv_MpegEncodeFrameInOrder(SvCodecInfo_t *Info,
  459. unsigned char *InputImage,
  460. unsigned int InputFourCC);
  461. extern SvStatus_t sv_MpegEncoderEnd(SvCodecInfo_t *Info);
  462. /*
  463. ** sv_mpeg_putpic.c
  464. */
  465. extern void sv_MpegPutPict(SvMpegCompressInfo_t *MpegInfo, ScBitstream_t *BS,
  466. unsigned char *frame);
  467. /*
  468. ** sv_mpeg_puthdr.c
  469. */
  470. extern void sv_MpegPutSeqHdr(SvMpegCompressInfo_t *MpegInfo, ScBitstream_t *bs);
  471. extern void sv_MpegPutSeqExt(SvMpegCompressInfo_t *MpegInfo, ScBitstream_t *bs);
  472. extern void sv_MpegPutSeqDispExt(SvMpegCompressInfo_t *MpegInfo,
  473. ScBitstream_t *bs);
  474. extern void sv_MpegPutUserData(ScBitstream_t *bs, char *userdata);
  475. extern void sv_MpegPutGOPHdr(ScBitstream_t *bs, float frame_rate, int tco,
  476. int frame, int closed_gop);
  477. extern void sv_MpegPutSeqEnd(ScBitstream_t *bs);
  478. /*
  479. ** sv_mpeg_motion.c
  480. */
  481. extern void sv_MpegMotionEstimation(SvMpegCompressInfo_t *MpegInfo,
  482. unsigned char *oldorg, unsigned char *neworg,
  483. unsigned char *oldref, unsigned char *newref,
  484. unsigned char *cur, unsigned char *curref,
  485. int sxf, int syf, int sxb, int syb,
  486. struct mbinfo *mbi, int secondfield, int ipflag);
  487. /*
  488. ** sv_mpeg_quantize.c
  489. */
  490. int sv_MpegIntraQuant(short *src, short *dst, int dc_prec,
  491. unsigned char *quant_mat, int mquant, int mpeg1);
  492. int sv_MpegNonIntraQuant(short *src, short *dst,
  493. unsigned char *quant_mat, int mquant, int mpeg1);
  494. void sv_MpegIntraInvQuant(short *src, short *dst, int dc_prec,
  495. unsigned char *quant_mat, int mquant, int mpeg1);
  496. void sv_MpegNonIntraInvQuant(short *src, short *dst,
  497. unsigned char *quant_mat, int mquant, int mpeg1);
  498. /*
  499. ** sv_mpeg_transfrm.c
  500. */
  501. void sv_MpegTransform(SvMpegCompressInfo_t *MpegInfo,
  502. unsigned char *pred[], unsigned char *cur[],
  503. struct mbinfo *mbi, short blocks[][64]);
  504. void sv_MpegInvTransform(SvMpegCompressInfo_t *MpegInfo,
  505. unsigned char *pred[], unsigned char *cur[],
  506. struct mbinfo *mbi,short blocks[][64]);
  507. void sv_MpegDCTtypeEstimation(SvMpegCompressInfo_t *MpegInfo,
  508. unsigned char *pred, unsigned char *cur,
  509. struct mbinfo *mbi);
  510. /*
  511. ** sv_mpeg_predict.c
  512. */
  513. extern void sv_MpegPredict(SvMpegCompressInfo_t *MpegInfo,
  514. unsigned char *reff[], unsigned char *refb[],
  515. unsigned char *cur[3], int secondfield, struct mbinfo *mbi);
  516. /*
  517. ** sv_mpeg_ratectl.c
  518. */
  519. extern void rc_init_seq(SvMpegCompressInfo_t *MpegInfo);
  520. extern void rc_init_GOP(SvMpegCompressInfo_t *MpegInfo, int np, int nb);
  521. extern void rc_init_pict(SvMpegCompressInfo_t *MpegInfo, ScBitstream_t *bs,
  522. unsigned char *frame);
  523. extern void rc_update_pict(SvMpegCompressInfo_t *MpegInfo, ScBitstream_t *bs);
  524. extern int rc_start_mb(SvMpegCompressInfo_t *MpegInfo);
  525. extern int rc_calc_mquant(SvMpegCompressInfo_t *MpegInfo, ScBitstream_t *bs,
  526. int j);
  527. void sv_MpegVBVendofpic(ScBitstream_t *bs);
  528. void sv_MpegVBVcalcdelay(SvMpegCompressInfo_t *MpegInfo, ScBitstream_t *bs);
  529. #endif /* MPEG_SUPPORT */
  530. #ifdef H261_SUPPORT
  531. /*---------------------------------------------------------------------------*/
  532. /* H.261 Prototypes */
  533. /*---------------------------------------------------------------------------*/
  534. /*
  535. ** sv_h261_init.c
  536. */
  537. extern SvStatus_t svH261Init(SvCodecInfo_t *Info);
  538. extern SvStatus_t svH261CompressInit(SvCodecInfo_t *Info);
  539. extern SvStatus_t svH261SetParamInt(SvHandle_t Svh, SvParameter_t param, qword value);
  540. extern qword svH261GetParamInt(SvHandle_t Svh, SvParameter_t param);
  541. extern SvStatus_t svH261SetParamFloat(SvHandle_t Svh, SvParameter_t param, float value);
  542. extern float svH261GetParamFloat(SvHandle_t Svh, SvParameter_t param);
  543. extern SvStatus_t svH261SetParamBoolean(SvHandle_t Svh, SvParameter_t param, ScBoolean_t value);
  544. extern ScBoolean_t svH261GetParamBoolean(SvHandle_t Svh, SvParameter_t param);
  545. /*
  546. ** sv_h261_decompress.c
  547. */
  548. extern SvStatus_t svH261Decompress(SvCodecInfo_t *Info,
  549. u_char *MultiBuf, u_char **ImagePtr);
  550. extern SvStatus_t svH261DecompressFree(SvHandle_t Svh);
  551. /*
  552. ** sv_h261_compress.c
  553. */
  554. extern SvStatus_t svH261Compress(SvCodecInfo_t *Info, u_char *InputImage);
  555. extern SvStatus_t svH261CompressFree(SvHandle_t Svh);
  556. extern SvStatus_t SvSetFrameSkip (SvHandle_t Svh, int FrameSkip);
  557. extern SvStatus_t SvSetFrameCount (SvHandle_t Svh, int FrameCount);
  558. extern SvStatus_t SvSetSearchLimit (SvHandle_t Svh, int SearchLimit);
  559. extern SvStatus_t SvSetImageType (SvHandle_t Svh, int ImageType);
  560. extern SvStatus_t SvGetFrameNumber (SvHandle_t Svh, u_int *FrameNumber);
  561. #endif /* H261_SUPPORT */
  562. #ifdef H263_SUPPORT
  563. /*---------------------------------------------------------------------------*/
  564. /* H263 Prototypes */
  565. /*---------------------------------------------------------------------------*/
  566. /*
  567. ** sv_h263_common.c
  568. */
  569. extern SvStatus_t svH263SetParamInt(SvHandle_t Svh, SvParameter_t param, qword value);
  570. extern qword svH263GetParamInt(SvHandle_t Svh, SvParameter_t param);
  571. extern SvStatus_t svH263SetParamFloat(SvHandle_t Svh, SvParameter_t param, float value);
  572. extern float svH263GetParamFloat(SvHandle_t Svh, SvParameter_t param);
  573. extern SvStatus_t svH263SetParamBoolean(SvHandle_t Svh, SvParameter_t param, ScBoolean_t value);
  574. extern ScBoolean_t svH263GetParamBoolean(SvHandle_t Svh, SvParameter_t param);
  575. /*
  576. ** sv_h263_decode.c
  577. */
  578. extern SvStatus_t svH263InitDecompressor(SvCodecInfo_t *Info);
  579. extern SvStatus_t svH263Decompress(SvCodecInfo_t *Info, u_char **ImagePtr);
  580. extern SvStatus_t svH263FreeDecompressor(SvCodecInfo_t *Info);
  581. /*
  582. ** sv_h263_encode.c
  583. */
  584. extern SvStatus_t svH263InitCompressor(SvCodecInfo_t *Info);
  585. extern SvStatus_t svH263Compress(SvCodecInfo_t *Info, u_char *ImagePtr);
  586. extern SvStatus_t svH263FreeCompressor(SvCodecInfo_t *Info);
  587. #endif /* H263_SUPPORT */
  588. #ifdef HUFF_SUPPORT
  589. /*---------------------------------------------------------------------------*/
  590. /* Huff Prototypes */
  591. /*---------------------------------------------------------------------------*/
  592. /*
  593. ** sv_huff_encode.c
  594. */
  595. extern SvStatus_t sv_HuffInitEncoder(SvCodecInfo_t *Info);
  596. extern SvStatus_t sv_HuffFreeEncoder(SvCodecInfo_t *Info);
  597. extern SvStatus_t sv_HuffEncodeFrame(SvCodecInfo_t *Info,
  598. unsigned char *InputImage);
  599. extern SvStatus_t sv_HuffPutHeader(SvHuffInfo_t *HInfo, ScBitstream_t *bs);
  600. /*
  601. ** sv_huff_decode.c
  602. */
  603. extern SvStatus_t sv_HuffInitDecoder(SvCodecInfo_t *Info);
  604. extern SvStatus_t sv_HuffFreeDecoder(SvCodecInfo_t *Info);
  605. extern SvStatus_t sv_HuffDecodeFrame(SvCodecInfo_t *Info,
  606. unsigned char *OutputImage);
  607. extern SvStatus_t sv_HuffGetHeader(SvHuffInfo_t *HInfo, ScBitstream_t *bs);
  608. /*
  609. ** sv_huff_encode.c
  610. */
  611. #endif /* HUFF_SUPPORT */
  612. #endif /* _SV_PROTOTYPES_H */