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.

276 lines
14 KiB

  1. /*
  2. * @DEC_COPYRIGHT@
  3. */
  4. /*
  5. * HISTORY
  6. * $Log: $
  7. * $EndLog$
  8. */
  9. /*****************************************************************************
  10. ** Copyright (c) Digital Equipment Corporation, 1994 **
  11. ** **
  12. ** All Rights Reserved. Unpublished rights reserved under the copyright **
  13. ** laws of the United States. **
  14. ** **
  15. ** The software contained on this media is proprietary to and embodies **
  16. ** the confidential technology of Digital Equipment Corporation. **
  17. ** Possession, use, duplication or dissemination of the software and **
  18. ** media is authorized only pursuant to a valid written license from **
  19. ** Digital Equipment Corporation. **
  20. ** **
  21. ** RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure by the U.S. **
  22. ** Government is subject to restrictions as set forth in Subparagraph **
  23. ** (c)(1)(ii) of DFARS 252.227-7013, or in FAR 52.227-19, as applicable. **
  24. ******************************************************************************/
  25. #ifndef _SV_H263_PROTO_H_
  26. #define _SV_H263_PROTO_H_
  27. #include "sv_intrn.h"
  28. #define svH263mputv(n, b) ScBSPutBits(BSOut,b,n)
  29. #define svH263mputb(b) ScBSPutBit(BSOut,b?1:0)
  30. void svH263Error(char *text);
  31. /*
  32. ** sv_h263_getpic.c
  33. */
  34. extern SvStatus_t sv_H263GetPicture(SvCodecInfo_t *Info);
  35. /*
  36. ** sv_h263_gethdr.c
  37. */
  38. extern SvStatus_t sv_H263GetHeader(SvH263DecompressInfo_t *H263Info, ScBitstream_t *BSIn, int *pgob);
  39. extern SvStatus_t sv_H263StartCode(ScBitstream_t *BSIn);
  40. /*
  41. ** sv_h263_recon.c
  42. */
  43. extern void sv_H263Reconstruct(SvH263DecompressInfo_t *H263Info, int bx, int by, int P, int bdx, int bdy);
  44. /*
  45. ** sv_h263_getvlc.c
  46. */
  47. extern int sv_H263GetTMNMV(SvH263DecompressInfo_t *H263Info, ScBitstream_t *BSIn);
  48. extern int sv_H263GetMCBPC(SvH263DecompressInfo_t *H263Info, ScBitstream_t *BSIn);
  49. extern int sv_H263GetMODB(SvH263DecompressInfo_t *H263Info, ScBitstream_t *BSIn);
  50. extern int sv_H263GetMCBPCintra(SvH263DecompressInfo_t *H263Info, ScBitstream_t *BSIn);
  51. extern int sv_H263GetCBPY(SvH263DecompressInfo_t *H263Info, ScBitstream_t *BSIn);
  52. /*
  53. ** sv_h263_getblk.c
  54. */
  55. extern void sv_H263GetBlock(SvH263DecompressInfo_t *H263Info, ScBitstream_t *BSIn, int comp, int mode);
  56. extern void sv_H263GetSACblock(SvH263DecompressInfo_t *H263Info, ScBitstream_t *BSIn, int comp, int ptype);
  57. /*
  58. ** sv_h263_sac.c
  59. */
  60. extern void sv_H263SACDecoderReset(ScBitstream_t *BSIn);
  61. extern int sv_H263SACDecode_a_symbol(ScBitstream_t *BSIn, int cumul_freq[ ]);
  62. extern int sv_H263AREncode(SvH263CompressInfo_t *H263Info, ScBitstream_t *BSOut,
  63. int index, int cumul_freq[ ]);
  64. extern int sv_H263AREncoderFlush(SvH263CompressInfo_t *H263Info, ScBitstream_t *BSOut);
  65. int sv_H263IndexFN(int value, int table[], int max);
  66. /* sc_h263_idct3.s */
  67. void sv_H263IDCTAddToFrameP_S(dword *inbuf,unsigned char *rfp,int incr);
  68. void sv_H263IDCTToFrameP_S(dword *inbuf,unsigned char *rfp, int incr) ;
  69. /*
  70. int sv_H263lim_S(int input);
  71. */
  72. int sv_H263lim_S( int input, int low, int upp) ;
  73. /* sv_h263_recon2.s */
  74. void svH263Load16_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  75. void svH263Rec16_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  76. void svH263Rec8_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  77. void svH263Rec16A_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  78. void svH263Rec8A_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  79. void svH263Rec16H_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  80. void svH263Rec8H_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  81. void svH263Rec16HA_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  82. void svH263Rec8HA_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  83. void svH263Rec16V_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  84. void svH263Rec8V_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  85. void svH263Rec16VA_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  86. void svH263Rec8VA_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  87. void svH263Rec16B_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  88. void svH263Rec8B_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  89. void svH263Rec16BA_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  90. void svH263Rec8BA_S(unsigned char *s, unsigned char *d, int lx, int lx2, int h);
  91. /*
  92. ** sv_h263_encode.c
  93. */
  94. void sv_H263UpdateQuality(SvCodecInfo_t *Info);
  95. H263_PictImage *sv_H263InitImage(int size);
  96. void sv_H263FreeImage(H263_PictImage *image);
  97. H263_PictImage *sv_H263CodeOneIntra(SvCodecInfo_t *Info, H263_PictImage *curr,
  98. H263_PictImage *recon, int QP, H263_Bits *bits, H263_Pict *pic);
  99. void sv_H263Clip(H263_MB_Structure *data);
  100. SvStatus_t sv_H263RefreshCompressor(SvCodecInfo_t *Info);
  101. /*
  102. ** sv_h263_edge.c
  103. */
  104. unsigned char *sv_H263EdgeGrow(unsigned char *Edge, int rows, int cols, int sr, int sc);
  105. void sv_H263EdgeMap(unsigned char *image, unsigned char *EdgeMag, unsigned char *EdgeOrient,
  106. int rows, int cols);
  107. /*
  108. ** sv_h263_quant.c
  109. */
  110. int sv_H263Quant(short *coeff, int QP, int Mode);
  111. void sv_H263Dequant(short *qcoeff, short *rcoeff, int QP, int Mode);
  112. /*
  113. ** sv_h263_pred.c
  114. */
  115. void sv_H263PredictB(SvH263CompressInfo_t *H263Info,
  116. H263_PictImage *curr_image, H263_PictImage *prev_image,
  117. unsigned char *prev_ipol,int x, int y,
  118. H263_MotionVector *MV[5][H263_MBR+1][H263_MBC+2],
  119. H263_MB_Structure *recon_P, int TRD,int TRB,
  120. H263_MB_Structure *p_err, H263_MB_Structure *pred);
  121. void sv_H263PredictP(SvH263CompressInfo_t *H263Info,
  122. H263_PictImage *curr_image, H263_PictImage *prev_image,
  123. unsigned char *prev_ipol, int x, int y,
  124. H263_MotionVector *MV[6][H263_MBR+1][H263_MBC+2], int PB,
  125. H263_MB_Structure *pred_error);
  126. void sv_H263MBReconP(SvH263CompressInfo_t *H263Info,
  127. H263_PictImage *prev_image, unsigned char *prev_ipol,
  128. H263_MB_Structure *diff, int x_curr, int y_curr,
  129. H263_MotionVector *MV[6][H263_MBR+1][H263_MBC+2], int PB,
  130. H263_MB_Structure *recon_data);
  131. void sv_H263MBReconB(SvH263CompressInfo_t *H263Info,
  132. H263_PictImage *prev_image, H263_MB_Structure *diff,
  133. unsigned char *prev_ipol,int x, int y,
  134. H263_MotionVector *MV[5][H263_MBR+1][H263_MBC+2],
  135. H263_MB_Structure *recon_P,int TRD, int TRB,
  136. H263_MB_Structure *recon_B,H263_MB_Structure *pred);
  137. void sv_H263FindHalfPel(SvH263CompressInfo_t *H263Info,
  138. int x, int y, H263_MotionVector *fr, unsigned char *prev,
  139. unsigned char *curr, int bs, int comp);
  140. void sv_H263AdvHalfPel(SvH263CompressInfo_t *H263Info, int x, int y,
  141. H263_MotionVector *fr0, H263_MotionVector *fr1,
  142. H263_MotionVector *fr2, H263_MotionVector *fr3,
  143. H263_MotionVector *fr4,
  144. unsigned char *prev, unsigned char *curr,
  145. int bs, int comp);
  146. int sv_H263ChooseMode(SvH263CompressInfo_t *H263Info, unsigned char *curr,
  147. int x_pos, int y_pos, int min_SAD, int *VARmb);
  148. /*
  149. int sv_H263ChooseMode(SvH263CompressInfo_t *H263Info, unsigned char *curr,
  150. int x_pos, int y_pos, int min_SAD);
  151. */
  152. int sv_H263ModifyMode(int Mode, int dquant);
  153. /*
  154. ** sv_h263_putbits.c
  155. */
  156. int sv_H263EqualVec(H263_MotionVector *MV2, H263_MotionVector *MV1);
  157. void sv_H263AddBitsPicture(H263_Bits *bits);
  158. void sv_H263AddBits(H263_Bits *total, H263_Bits *bits);
  159. void sv_H263ZeroBits(H263_Bits *bits);
  160. void sv_H263ZeroRes(H263_Results *res);
  161. int sv_H263CountBitsPicture(SvH263CompressInfo_t *H263Info, ScBitstream_t *BSOut, H263_Pict *pic);
  162. int sv_H263CountBitsSlice(SvH263CompressInfo_t *H263Info, ScBitstream_t *BSOut,
  163. int slice, int quant);
  164. void sv_H263CountBitsMB(ScBitstream_t *BSOut, int Mode, int COD, int CBP,
  165. int CBPB, H263_Pict *pic, H263_Bits *bits);
  166. void sv_H263CountSACBitsMB(SvH263CompressInfo_t *H263Info, ScBitstream_t *BSOut,
  167. int Mode,int COD,int CBP,int CBPB,H263_Pict *pic,H263_Bits *bits);
  168. void sv_H263CountBitsCoeff(ScBitstream_t *BSOut, short *qcoeff, int Mode,
  169. int CBP, H263_Bits *bits, int ncoeffs);
  170. void sv_H263CountSACBitsCoeff(SvH263CompressInfo_t *H263Info, ScBitstream_t *BSOut,
  171. short *qcoeff,int Mode,
  172. int CBP, H263_Bits *bits, int ncoeffs);
  173. void sv_H263CountBitsVectors(SvH263CompressInfo_t *H263Info, ScBitstream_t *BSOut,
  174. H263_MotionVector *MV[6][H263_MBR+1][H263_MBC+2], H263_Bits *bits,
  175. int x, int y, int Mode, int newgob, H263_Pict *pic);
  176. void sv_H263CountSACBitsVectors(SvH263CompressInfo_t *H263Info, ScBitstream_t *BSOut,
  177. H263_MotionVector *MV[6][H263_MBR+1][H263_MBC+2], H263_Bits *bits,
  178. int x, int y, int Mode, int newgob, H263_Pict *pic);
  179. void sv_H263InitHuff(SvH263CompressInfo_t *H263Info);
  180. void sv_H263FreeHuff(SvH263CompressInfo_t *H263Info);
  181. void sv_H263FindPMV(H263_MotionVector *MV[6][H263_MBR+1][H263_MBC+2], int x, int y,
  182. int *pmv0, int *pmv1, int block, int newgob, int half_pel);
  183. void sv_H263ZeroVec(H263_MotionVector *MV);
  184. void sv_H263MarkVec(H263_MotionVector *MV);
  185. /*
  186. ** sv_h263_morph.c
  187. */
  188. H263_PictImage *sv_H263AdaptClean(SvH263CompressInfo_t *H263Info,
  189. H263_PictImage *curr_image, int rows, int cols, int sr, int sc);
  190. H263_PictImage **sv_H263MorphLayers(H263_PictImage *img, int depth, int rows, int cols, int sz);
  191. /*
  192. ** sv_h263_ratectrl.c
  193. */
  194. int sv_H263FrameUpdateQP(int buf, int bits, int frames_left, int QP, int B,
  195. float seconds);
  196. /*
  197. ** sv_h263_dct.c
  198. */
  199. void sv_H263init_idctref();
  200. void sv_H263idctref(short *coeff, short *block);
  201. int sv_H263IDCT(short *inbuf, short *outbuf, int QP, int Mode, int outbuf_size);
  202. int sv_H263DCT( short *block, short *coeff, int QP, int Mode);
  203. int sv_H263ZoneDCT( short *block, short *coeff, int QP, int Mode);
  204. int sv_H263ZoneIDCT(short *inbuf, short *outbuf, int QP, int Mode, int outbuf_size);
  205. /*
  206. ** sv_h263_motion.c
  207. */
  208. void sv_H263FastME(SvH263CompressInfo_t *H263Info,
  209. unsigned char *curr, unsigned char *prev, int x_curr,
  210. int y_curr, int xoff, int yoff, int seek_dist,
  211. short *MVx, short *MVy, short *MVer, int *SAD_0);
  212. void sv_H263MotionEstimation(SvH263CompressInfo_t *H263Info,
  213. unsigned char *curr, unsigned char *prev, int x_curr,
  214. int y_curr, int xoff, int yoff, int seek_dist,
  215. H263_MotionVector *MV[6][H263_MBR+1][H263_MBC+2], int *SAD_0);
  216. void sv_H263FindMB(SvH263CompressInfo_t *H263Info, int x, int y, unsigned char *image, short MB[16][16]);
  217. int sv_H263BError16x16_C(unsigned char *ii, unsigned char *aa, unsigned char *bb,
  218. int width, int min_sofar);
  219. int sv_H263MySADBlock(unsigned char *ii, unsigned char *act_block,
  220. int h_length, int lx2, int min_sofar);
  221. void sv_H263LdSubs2Area(unsigned char *im, int x, int y,
  222. int x_size, int y_size, int lx,
  223. unsigned char *srch_area, int area_length);
  224. #ifdef USE_C
  225. int sv_H263SADMacroblock(unsigned char *ii, unsigned char *act_block,
  226. int h_length, int lx2, int Min_FRAME);
  227. #endif
  228. /*
  229. ** sv_h263_me1.c
  230. */
  231. void sv_H263ME_2levels_7_1(SvH263CompressInfo_t *H263Info,
  232. unsigned char *curr, unsigned char *prev, int x_curr,
  233. int y_curr, int xoff, int yoff, int seek_dist,
  234. H263_MotionVector *MV[6][H263_MBR+1][H263_MBC+2], int *SAD_0);
  235. unsigned char *sv_H263LoadSubs2Area(unsigned char *im, int x, int y,
  236. int x_size, int y_size, int lx);
  237. int sv_H263MySADSubBlock(unsigned char *ii, unsigned char *act_block,
  238. int h_length, int min_sofar);
  239. #ifdef USE_C
  240. int sv_H263MySADBlock(unsigned char *ii, unsigned char *act_block,
  241. int h_length, int lx2, int min_sofar);
  242. #endif
  243. /*
  244. ** sv_h263_me2.c
  245. */
  246. void sv_H263ME_2levels_421_1(SvH263CompressInfo_t *H263Info,
  247. unsigned char *curr, unsigned char *prev, int x_curr,
  248. int y_curr, int xoff, int yoff, int seek_dist,
  249. H263_MotionVector *MV[6][H263_MBR+1][H263_MBC+2], int *SAD_0);
  250. /*
  251. ** sv_h263_me3.c
  252. */
  253. void sv_H263ME_2levels_7_polint(SvH263CompressInfo_t *H263Info,
  254. unsigned char *curr, unsigned char *prev, int x_curr,
  255. int y_curr, int xoff, int yoff, int seek_dist,
  256. H263_MotionVector *MV[6][H263_MBR+1][H263_MBC+2], int *SAD_0);
  257. /*
  258. ** sv_h263_me4.c
  259. */
  260. void sv_H263ME_2levels_7_pihp(SvH263CompressInfo_t *H263Info,
  261. unsigned char *curr, unsigned char *prev, int x_curr,
  262. int y_curr, int xoff, int yoff, int seek_dist,
  263. H263_MotionVector *MV[6][H263_MBR+1][H263_MBC+2], int *SAD_0);
  264. #endif /* _SV_H263_PROTO_H_ */