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.

216 lines
6.5 KiB

  1. /*
  2. * msyuv.h Microsoft YUV Codec
  3. *
  4. * Copyright (c) Microsoft 1993.
  5. */
  6. #include <winmm.h>
  7. #include <vfw.h>
  8. #include "debug.h"
  9. // #define COLOR_MODIFY
  10. #ifndef FOURCC_YUV411
  11. #define FOURCC_YUV411 mmioFOURCC('Y', '4', '1', '1')
  12. #endif
  13. #ifndef FOURCC_YUV422
  14. //
  15. // compatible with the format produced by the 16-bit Spigot driver.
  16. //
  17. #define FOURCC_YUV422 mmioFOURCC('S', '4', '2', '2')
  18. #endif
  19. #ifdef TOSHIBA
  20. //
  21. // compatible with the format produced by the Pistachio driver.
  22. //
  23. #ifndef FOURCC_YUV12
  24. #if 1
  25. #define FOURCC_YUV12 mmioFOURCC('T', '4', '2', '0')
  26. #else
  27. #define FOURCC_YUV12 mmioFOURCC('I', '4', '2', '0')
  28. #endif
  29. #endif
  30. //
  31. // compatible with the format produced by the Pistachio driver.
  32. //
  33. #ifndef FOURCC_YUV9
  34. #define FOURCC_YUV9 mmioFOURCC('Y', 'V', 'U', '9')
  35. #endif
  36. #endif//TOSHIBA
  37. typedef struct {
  38. DWORD dwFlags; // flags from ICOPEN
  39. DWORD dwFormat; // format that pXlate is built for (FOURCC)
  40. PVOID pXlate; // xlate table (for decompress)
  41. BOOL bRGB565; // true if 5-6-5 format output (otherwise 555)
  42. #ifdef TOSHIBA
  43. #ifdef COLOR_MODIFY
  44. BOOL bRGB24; // true if 24 bit format output (otherwise 16 bit)
  45. #endif//COLOR_MODIFY
  46. #endif//TOSHIBA
  47. #if 0
  48. /* support for drawing */
  49. VCUSER_HANDLE vh;
  50. HWND hwnd;
  51. RECT rcSource;
  52. RECT rcDest;
  53. HBRUSH hKeyBrush;
  54. #endif
  55. } INSTINFO, *PINSTINFO;
  56. /*
  57. * message processing functions in msyuv.c
  58. */
  59. INSTINFO * NEAR PASCAL Open(ICOPEN FAR * icinfo);
  60. DWORD NEAR PASCAL Close(INSTINFO * pinst);
  61. BOOL NEAR PASCAL QueryAbout(INSTINFO * pinst);
  62. DWORD NEAR PASCAL About(INSTINFO * pinst, HWND hwnd);
  63. BOOL NEAR PASCAL QueryConfigure(INSTINFO * pinst);
  64. DWORD NEAR PASCAL Configure(INSTINFO * pinst, HWND hwnd);
  65. DWORD NEAR PASCAL GetState(INSTINFO * pinst, LPVOID pv, DWORD dwSize);
  66. DWORD NEAR PASCAL SetState(INSTINFO * pinst, LPVOID pv, DWORD dwSize);
  67. DWORD NEAR PASCAL GetInfo(INSTINFO * pinst, ICINFO FAR *icinfo, DWORD dwSize);
  68. DWORD FAR PASCAL CompressQuery(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  69. DWORD FAR PASCAL CompressGetFormat(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  70. DWORD FAR PASCAL CompressBegin(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  71. DWORD FAR PASCAL CompressGetSize(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  72. DWORD FAR PASCAL Compress(INSTINFO * pinst, ICCOMPRESS FAR *icinfo, DWORD dwSize);
  73. DWORD FAR PASCAL CompressEnd(INSTINFO * pinst);
  74. DWORD NEAR PASCAL DecompressQuery(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  75. DWORD NEAR PASCAL DecompressGetFormat(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  76. DWORD NEAR PASCAL DecompressBegin(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  77. DWORD NEAR PASCAL Decompress(INSTINFO * pinst, ICDECOMPRESS FAR *icinfo, DWORD dwSize);
  78. DWORD NEAR PASCAL DecompressGetPalette(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  79. DWORD NEAR PASCAL DecompressEnd(INSTINFO * pinst);
  80. DWORD DrawQuery(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  81. DWORD DrawBegin(INSTINFO * pinst,ICDRAWBEGIN FAR *icinfo, DWORD dwSize);
  82. DWORD Draw(INSTINFO * pinst, ICDRAW FAR *icinfo, DWORD dwSize);
  83. DWORD DrawEnd(INSTINFO * pinst);
  84. DWORD DrawWindow(PINSTINFO pinst, PRECT prc);
  85. /* yuv411 or yuv422 to rgb translation, in xlate.c */
  86. /*
  87. * build yuv411->RGB555 xlate table
  88. */
  89. LPVOID BuildYUVToRGB555(PINSTINFO pinst);
  90. // build yuv411 -> rgb565
  91. LPVOID BuildYUVToRGB565(PINSTINFO pinst);
  92. /*
  93. * build yuv422 -> RGB555 xlate table
  94. */
  95. LPVOID BuildYUV422ToRGB555(PINSTINFO pinst);
  96. // build yuv422 -> RGB565
  97. LPVOID BuildYUV422ToRGB565(PINSTINFO pinst);
  98. #ifdef TOSHIBA
  99. #ifdef COLOR_MODIFY
  100. /*
  101. * build yuv12 -> RGB555 xlate table
  102. */
  103. LPVOID BuildYUVToRB(PINSTINFO pinst);
  104. #else //COLOR_MODIFY
  105. /*
  106. * build yuv12 -> RGB555 xlate table
  107. */
  108. LPVOID BuildYUV12ToRGB555(PINSTINFO pinst);
  109. // build yuv12 -> RGB565
  110. LPVOID BuildYUV12ToRGB565(PINSTINFO pinst);
  111. #endif//COLOR_MODIFY
  112. #endif//TOSHIBA
  113. /*
  114. * translate one frame from yuv411 to rgb 555 or 565
  115. */
  116. VOID YUV411ToRGB(PINSTINFO pinst,
  117. LPBITMAPINFOHEADER lpbiInput,
  118. LPVOID lpInput,
  119. LPBITMAPINFOHEADER lpbiOutput,
  120. LPVOID lpOutput);
  121. VOID YUV422ToRGB(PINSTINFO pinst,
  122. LPBITMAPINFOHEADER lpbiInput,
  123. LPVOID lpInput,
  124. LPBITMAPINFOHEADER lpbiOutput,
  125. LPVOID lpOutput);
  126. #ifdef TOSHIBA
  127. #ifdef COLOR_MODIFY
  128. VOID YUV12ToRGB24(PINSTINFO pinst,
  129. LPBITMAPINFOHEADER lpbiInput,
  130. LPVOID lpInput,
  131. LPBITMAPINFOHEADER lpbiOutput,
  132. LPVOID lpOutput);
  133. VOID YUV12ToRGB565(PINSTINFO pinst,
  134. LPBITMAPINFOHEADER lpbiInput,
  135. LPVOID lpInput,
  136. LPBITMAPINFOHEADER lpbiOutput,
  137. LPVOID lpOutput);
  138. VOID YUV12ToRGB555(PINSTINFO pinst,
  139. LPBITMAPINFOHEADER lpbiInput,
  140. LPVOID lpInput,
  141. LPBITMAPINFOHEADER lpbiOutput,
  142. LPVOID lpOutput);
  143. VOID YUV9ToRGB24(PINSTINFO pinst,
  144. LPBITMAPINFOHEADER lpbiInput,
  145. LPVOID lpInput,
  146. LPBITMAPINFOHEADER lpbiOutput,
  147. LPVOID lpOutput);
  148. VOID YUV9ToRGB565(PINSTINFO pinst,
  149. LPBITMAPINFOHEADER lpbiInput,
  150. LPVOID lpInput,
  151. LPBITMAPINFOHEADER lpbiOutput,
  152. LPVOID lpOutput);
  153. VOID YUV9ToRGB555(PINSTINFO pinst,
  154. LPBITMAPINFOHEADER lpbiInput,
  155. LPVOID lpInput,
  156. LPBITMAPINFOHEADER lpbiOutput,
  157. LPVOID lpOutput);
  158. #else //COLOR_MODIFY
  159. VOID YUV12ToRGB(PINSTINFO pinst,
  160. LPBITMAPINFOHEADER lpbiInput,
  161. LPVOID lpInput,
  162. LPBITMAPINFOHEADER lpbiOutput,
  163. LPVOID lpOutput);
  164. VOID YUV9ToRGB(PINSTINFO pinst,
  165. LPBITMAPINFOHEADER lpbiInput,
  166. LPVOID lpInput,
  167. LPBITMAPINFOHEADER lpbiOutput,
  168. LPVOID lpOutput);
  169. #endif//COLOR_MODIFY
  170. #endif//TOSHIBA
  171. VOID FreeXlate(PINSTINFO pinst);
  172.