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.

295 lines
13 KiB

  1. /*
  2. * @DEC_COPYRIGHT@
  3. */
  4. /*
  5. * HISTORY
  6. * $Log: SC_convert.h,v $
  7. * Revision 1.1.9.4 1996/09/29 22:19:34 Hans_Graves
  8. * Added stride argument to ScYuv411ToRgb()
  9. * [1996/09/29 21:27:43 Hans_Graves]
  10. *
  11. * Revision 1.1.9.3 1996/09/18 23:45:50 Hans_Graves
  12. * Added protos for ScRgbToYuv411(), 411sTo422i, 411sTo422s,
  13. * and 1611PlanarTo411
  14. * [1996/09/18 23:31:09 Hans_Graves]
  15. *
  16. * Revision 1.1.9.2 1996/08/20 22:11:52 Bjorn_Engberg
  17. * For NT - Made several routines public to support JV3.DLL and SOFTJPEG.DLL.
  18. * [1996/08/20 21:53:26 Bjorn_Engberg]
  19. *
  20. * Revision 1.1.6.5 1996/04/11 20:22:02 Hans_Graves
  21. * Removed protos for GetDitherTemplate10/15(), their static now.
  22. * [1996/04/11 20:05:44 Hans_Graves]
  23. *
  24. * Revision 1.1.6.4 1996/04/10 21:47:19 Hans_Graves
  25. * Added _S after assembly routines
  26. * [1996/04/10 21:21:54 Hans_Graves]
  27. *
  28. * Revision 1.1.6.3 1996/04/09 16:04:34 Hans_Graves
  29. * Added USE_C ifdef.
  30. * [1996/04/09 14:48:31 Hans_Graves]
  31. *
  32. * Revision 1.1.6.2 1996/03/29 22:21:02 Hans_Graves
  33. * Cleaned up convert protos
  34. * [1996/03/29 21:46:48 Hans_Graves]
  35. *
  36. * Revision 1.1.4.4 1996/01/08 16:20:39 Bjorn_Engberg
  37. * Got rid of compiler warning messages.
  38. * [1996/01/08 15:23:14 Bjorn_Engberg]
  39. *
  40. * Revision 1.1.4.3 1996/01/02 18:31:15 Bjorn_Engberg
  41. * Added and improved function prototypes.
  42. * [1996/01/02 15:03:03 Bjorn_Engberg]
  43. *
  44. * Revision 1.1.4.2 1995/12/07 19:31:21 Hans_Graves
  45. * Added prototype for ScConvert422PlanarTo411_C()
  46. * [1995/12/07 17:44:41 Hans_Graves]
  47. *
  48. * Revision 1.1.2.18 1995/11/30 20:17:04 Hans_Graves
  49. * Renamed ScYuvToRgb() to ScYuv422toRgb()
  50. * [1995/11/30 20:10:09 Hans_Graves]
  51. *
  52. * Revision 1.1.2.17 1995/11/28 22:47:31 Hans_Graves
  53. * Added prototype for ScYuv1611ToRgb()
  54. * [1995/11/28 21:34:55 Hans_Graves]
  55. *
  56. * Revision 1.1.2.16 1995/11/17 21:31:25 Hans_Graves
  57. * Added prototype for ScYuv411ToRgb()
  58. * [1995/11/17 20:51:27 Hans_Graves]
  59. *
  60. * Revision 1.1.2.15 1995/10/17 15:37:05 Karen_Dintino
  61. * Move DitherTemplate routines from render to common
  62. * [1995/10/17 15:36:49 Karen_Dintino]
  63. *
  64. * Revision 1.1.2.14 1995/10/13 16:57:16 Bjorn_Engberg
  65. * Added prototypes for routines in sc_convert_yuv.c
  66. * [1995/10/13 16:48:55 Bjorn_Engberg]
  67. *
  68. * Revision 1.1.2.13 1995/10/10 21:43:04 Bjorn_Engberg
  69. * Modified RgbToYuv prototype declarations.
  70. * [1995/10/10 21:10:52 Bjorn_Engberg]
  71. *
  72. * Revision 1.1.2.12 1995/10/06 20:46:29 Farokh_Morshed
  73. * Change ScRgbInterlToYuvInterl to take a Bmh by reference
  74. * [1995/10/06 20:46:06 Farokh_Morshed]
  75. *
  76. * Revision 1.1.2.11 1995/10/02 19:30:52 Bjorn_Engberg
  77. * Added more BI_BITFIELDS formats.
  78. * [1995/10/02 18:15:47 Bjorn_Engberg]
  79. *
  80. * Revision 1.1.2.10 1995/09/26 15:58:48 Paul_Gauthier
  81. * Fix mono JPEG to interlaced 422 YUV conversion
  82. * [1995/09/26 15:58:12 Paul_Gauthier]
  83. *
  84. * Revision 1.1.2.9 1995/09/22 12:58:40 Bjorn_Engberg
  85. * Changed uchar to u_char in a function prototype.
  86. * [1995/09/22 12:48:40 Bjorn_Engberg]
  87. *
  88. * Revision 1.1.2.8 1995/09/20 17:39:19 Karen_Dintino
  89. * Add RGB support to JPEG
  90. * [1995/09/20 17:37:04 Karen_Dintino]
  91. *
  92. * Revision 1.1.2.7 1995/09/18 19:47:49 Paul_Gauthier
  93. * Added conversion of MPEG planar 4:1:1 to interleaved 4:2:2
  94. * [1995/09/18 19:46:15 Paul_Gauthier]
  95. *
  96. * Revision 1.1.2.6 1995/09/15 18:17:47 Farokh_Morshed
  97. * Move ValidBI_BITFIELDSKinds from SC.h to SC_convert.h
  98. * [1995/09/15 18:17:19 Farokh_Morshed]
  99. *
  100. * Revision 1.1.2.5 1995/09/14 14:40:35 Karen_Dintino
  101. * Move RgbToYuv out of rendition
  102. * [1995/09/14 14:25:20 Karen_Dintino]
  103. *
  104. * Revision 1.1.2.4 1995/09/11 19:17:25 Hans_Graves
  105. * Added ValidateBI_BITFIELDS() prototype.
  106. * [1995/09/11 19:14:45 Hans_Graves]
  107. *
  108. * Revision 1.1.2.3 1995/08/03 15:01:09 Hans_Graves
  109. * Added prototype for ScConvert422ToYUV_char()
  110. * [1995/08/03 15:00:49 Hans_Graves]
  111. *
  112. * Revision 1.1.2.2 1995/05/31 18:09:23 Hans_Graves
  113. * Inclusion in new SLIB location.
  114. * [1995/05/31 15:22:50 Hans_Graves]
  115. *
  116. * $EndLog$
  117. */
  118. /*****************************************************************************
  119. ** Copyright (c) Digital Equipment Corporation, 1995 **
  120. ** **
  121. ** All Rights Reserved. Unpublished rights reserved under the copyright **
  122. ** laws of the United States. **
  123. ** **
  124. ** The software contained on this media is proprietary to and embodies **
  125. ** the confidential technology of Digital Equipment Corporation. **
  126. ** Possession, use, duplication or dissemination of the software and **
  127. ** media is authorized only pursuant to a valid written license from **
  128. ** Digital Equipment Corporation. **
  129. ** **
  130. ** RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure by the U.S. **
  131. ** Government is subject to restrictions as set forth in Subparagraph **
  132. ** (c)(1)(ii) of DFARS 252.227-7013, or in FAR 52.227-19, as applicable. **
  133. ******************************************************************************/
  134. /*
  135. ** Filename: SC_convert.h
  136. ** Purpose: Header info for using conversion routines.
  137. */
  138. #include "SC.h"
  139. enum ValidBI_BITFIELDSKinds {
  140. pRGB, /* 32-bit 00RRGGBB special case */
  141. pBGR, /* 32-bit 00BBGGRR special case */
  142. pRGB555, /* 16-bit 0RRRRRGGGGGBBBBB special case */
  143. pRGB565, /* 16-bit RRRRRGGGGGGBBBBB special case */
  144. pRGBnnn, /* 16-bit general case */
  145. InvalidBI_BITFIELDS
  146. };
  147. /*********************** Prototypes *************************/
  148. /*
  149. ** sc_convert.c
  150. */
  151. EXTERN enum ValidBI_BITFIELDSKinds ValidateBI_BITFIELDS(LPBITMAPINFOHEADER lpbi);
  152. EXTERN int ScIsUpsideDown(BITMAPINFOHEADER *lpbiIn,
  153. BITMAPINFOHEADER *lpbiOut);
  154. extern BITMAPINFOHEADER *ScCreateBMHeader(int width, int height, int bpp,
  155. int format, int ncolors);
  156. extern ScStatus_t ScConvertSepYUVToOther(BITMAPINFOHEADER *InBmh,
  157. BITMAPINFOHEADER *OutBmh,
  158. u_char *OutImage,
  159. u_char *YData, u_char *CbData, u_char *CrData);
  160. extern ScStatus_t ScYuv422ToRgb (BITMAPINFOHEADER *Bmh, u_char *Y,
  161. u_char *Cb, u_char *Cr, u_char *ImageOut);
  162. extern ScStatus_t ScYuv411ToRgb (BITMAPINFOHEADER *Bmh, u_char *Y,
  163. u_char *Cb, u_char *Cr, u_char *ImageOut,
  164. int width, int height, long stride);
  165. extern ScStatus_t ScYuv1611ToRgb (BITMAPINFOHEADER *Bmh, u_char *Y, u_char *Cb,
  166. u_char *Cr, u_char *ImageOut);
  167. extern ScStatus_t ScConvertRGB24sTo422i_C(BITMAPINFOHEADER *Bmh,
  168. u_char *R, u_char *G, u_char *B, u_short *ImageOut);
  169. extern ScStatus_t ScConvertRGB24To411s_C(u_char *inimage,
  170. u_char *Y, u_char *U, u_char *V, int width, int height);
  171. extern ScStatus_t ScConvertRGB555To411s_C(u_char *inimage, u_char *outimage,
  172. int width, int height);
  173. extern ScStatus_t ScConvertRGB565To411s_C(u_char *inimage, u_char *outimage,
  174. int width, int height);
  175. EXTERN ScStatus_t ScRgbInterlToYuvInterl (LPBITMAPINFOHEADER Bmh, int Width,
  176. int Height, u_char *ImageIn, u_short *ImageOut);
  177. extern ScStatus_t ScConvert422ToYUV_char_C (u_char *RawImage,
  178. u_char *Y, u_char *U, u_char *V,
  179. int Width, int Height);
  180. extern int ScConvert422ToBlockYUV(u_char *, int, float *, float *, float *,
  181. int, int);
  182. extern void ScConvertSep422ToBlockYUV (u_char *RawImage, int bpp,
  183. float *Comp1, float *Comp2, float *Comp3,
  184. int Width, int Height);
  185. extern void ScConvertGrayToBlock (u_char *RawImage, int bpp,
  186. float *Comp1, int Width, int Height);
  187. extern int ScSepYUVto422i_C(u_char *Y, u_char *U,
  188. u_char *V, u_char *ImageOut,
  189. u_int width, u_int height);
  190. extern ScStatus_t ScConvert422PlanarTo411_C (u_char *RawImage,
  191. u_char *Y, u_char *U, u_char *V,
  192. int Width, int Height);
  193. extern void ScConvert422PlanarTo422i_C(u_char *Y, u_char *Cb,
  194. u_char *Cr, u_char *ImageOut,
  195. long width, long height );
  196. extern void ScConvert422iTo422s_C(u_char *InImage,
  197. u_char *Y, u_char *Cb, u_char *Cr,
  198. long width, long height);
  199. extern void ScConvert422iTo422sf_C(u_char *InImage, int bpp,
  200. float *Y, float *U, float *V,
  201. long width, long height);
  202. extern void ScConvert411sTo422i_C(u_char *Y, u_char *Cb,
  203. u_char *Cr, u_char *ImageOut,
  204. long width, long height );
  205. extern void ScConvert411sTo422s_C(u_char *Y, u_char *Cb,
  206. u_char *Cr, u_char *ImageOut,
  207. long width, long height );
  208. extern ScStatus_t ScConvert1611sTo411s_C(u_char *inimage,
  209. u_char *Y, u_char *U, u_char *V,
  210. int Width, int Height);
  211. extern ScStatus_t ScConvert411sTo1611s_C (u_char *inimage,
  212. u_char *Y, u_char *U, u_char *V,
  213. int Width, int Height);
  214. extern ScStatus_t ScConvert1611sTo422s_C(u_char *inimage,
  215. u_char *Y, u_char *U, u_char *V,
  216. int Width, int Height);
  217. extern ScStatus_t ScConvert1611sTo422i_C(u_char *inimage, u_char *outimage,
  218. int Width, int Height);
  219. extern ScStatus_t ScConvertNTSC422toCIF411_C(u_char *framein,
  220. u_char *yp, u_char *up, u_char *vp,
  221. int stride);
  222. /*
  223. ** sc_convert2.s
  224. */
  225. extern void ScConvert422iTo422sf_S(u_char *InImage, int bpp,
  226. float *Y, float *U, float *V,
  227. long width, long height);
  228. extern int ScSepYUVto422i_S(u_char *Y, u_char *U,
  229. u_char *V, u_char *ImageOut,
  230. u_int width, u_int height);
  231. extern ScStatus_t ScConvert422ToYUV_char_S(u_char *RawImage,
  232. u_char *Y, u_char *U, u_char *V,
  233. int Width, int Height);
  234. extern void ScConvert422PlanarTo422i_S(u_char *Y, u_char *Cb,
  235. u_char *Cr, u_char *ImageOut,
  236. long width, long height );
  237. /*
  238. ** sc_convert_yuv.c
  239. */
  240. extern int ScInitYUVcvt();
  241. extern int ScInitYUVtoRGB(void **pColpack,
  242. BITMAPINFOHEADER *lpbiIn,
  243. BITMAPINFOHEADER *lpbiOut);
  244. extern int sc_SIFrenderYUVtoRGBnn(u_char *pY, u_char *pU, u_char *pV,
  245. u_char *Oimage,
  246. void *Colpack,
  247. int pixels, int lines);
  248. extern void YUV_To_RGB_422_Init(int bSign, int bBGR, _int64 * pTable);
  249. #ifdef USE_C
  250. #define ScConvert422ToYUV_char ScConvert422ToYUV_char_C
  251. #define ScConvert422PlanarTo422i ScConvert422PlanarTo422i_C
  252. #define ScConvert411sTo422i ScConvert411sTo422i_C
  253. #define ScConvert411sTo422s ScConvert411sTo422s_C
  254. #define ScSepYUVto422i ScSepYUVto422i_C
  255. #define ScConvert422PlanarTo411 ScConvert422PlanarTo411_C
  256. #define ScConvertNTSC422toCIF411 ScConvertNTSC422toCIF411_C
  257. #define ScConvert422iTo422s ScConvert422iTo422s_C
  258. #define ScConvert422iTo422sf ScConvert422iTo422sf_C
  259. #define ScConvert1611sTo411s ScConvert1611sTo411s_C
  260. #define ScConvert411sTo1611s ScConvert411sTo1611s_C
  261. #define ScConvert1611sTo422s ScConvert1611sTo422s_C
  262. #define ScConvert1611sTo422i ScConvert1611sTo422i_C
  263. #define ScConvertRGB24sTo422i ScConvertRGB24sTo422i_C
  264. #define ScConvertRGB24To411s ScConvertRGB24To411s_C
  265. #define ScConvertRGB555To411s ScConvertRGB555To411s_C
  266. #define ScConvertRGB565To411s ScConvertRGB565To411s_C
  267. #else /* USE_C */
  268. #define ScConvert422ToYUV_char ScConvert422ToYUV_char_S
  269. #define ScConvert422PlanarTo422i ScConvert422PlanarTo422i_S
  270. #define ScConvert411sTo422i ScConvert411sTo422i_C
  271. #define ScConvert411sTo422s ScConvert411sTo422s_C
  272. #define ScSepYUVto422i ScSepYUVto422i_S
  273. #define ScConvert422PlanarTo411 ScConvert422PlanarTo411_C
  274. #define ScConvertNTSC422toCIF411 ScConvertNTSC422toCIF411_C
  275. #define ScConvert422iTo422s ScConvert422iTo422s_C
  276. #define ScConvert422iTo422sf ScConvert422iTo422sf_S
  277. #define ScConvert1611sTo411s ScConvert1611sTo411s_C
  278. #define ScConvert411sTo1611s ScConvert411sTo1611s_C
  279. #define ScConvert1611sTo422s ScConvert1611sTo422s_C
  280. #define ScConvert1611sTo422i ScConvert1611sTo422i_C
  281. #define ScConvertRGB24sTo422i ScConvertRGB24sTo422i_C
  282. #define ScConvertRGB24To411s ScConvertRGB24To411s_C
  283. #define ScConvertRGB555To411s ScConvertRGB555To411s_C
  284. #define ScConvertRGB565To411s ScConvertRGB565To411s_C
  285. #endif /* USE_C */