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.

102 lines
4.3 KiB

  1. /*----------------------------------------------------------------------+
  2. | compress.h - Microsoft Video 1 Compressor - compress header file |
  3. | |
  4. | Copyright (c) 1990-1994 Microsoft Corporation. |
  5. | Portions Copyright Media Vision Inc. |
  6. | All Rights Reserved. |
  7. | |
  8. | You have a non-exclusive, worldwide, royalty-free, and perpetual |
  9. | license to use this source code in developing hardware, software |
  10. | (limited to drivers and other software required for hardware |
  11. | functionality), and firmware for video display and/or processing |
  12. | boards. Microsoft makes no warranties, express or implied, with |
  13. | respect to the Video 1 codec, including without limitation warranties |
  14. | of merchantability or fitness for a particular purpose. Microsoft |
  15. | shall not be liable for any damages whatsoever, including without |
  16. | limitation consequential damages arising from your use of the Video 1 |
  17. | codec. |
  18. | |
  19. | |
  20. +----------------------------------------------------------------------*/
  21. /*******************************************************************
  22. encoding a skip - if the mask (first word) has the high bit set
  23. then it is either a skip cell code, or a solid color code.
  24. you can't encode a r=01 solid color, this is how we tell a skip
  25. from a solid (not a big loss)
  26. *******************************************************************/
  27. #define SKIP_MAX SKIP_MASK
  28. #define SKIP_MASK ((WORD) (((1<<10)-1)))
  29. #define MAGIC_MASK ~SKIP_MASK
  30. #define SKIP_MAGIC 0x8400 // r=01
  31. #define SOLID_MAGIC 0x8000
  32. #define MASK_MAGIC 0xA000
  33. /*******************************************************************
  34. *******************************************************************/
  35. extern DWORD numberOfBlocks;
  36. extern DWORD numberOfSolids;
  37. extern DWORD numberOfSolid4;
  38. extern DWORD numberOfEdges;
  39. extern DWORD numberOfSkips;
  40. extern DWORD numberOfSkipCodes;
  41. /*******************************************************************
  42. *******************************************************************/
  43. //
  44. // this is a CELL (4x4) array of RGBQUADs
  45. //
  46. typedef RGBQUAD CELL[HEIGHT_CBLOCK * WIDTH_CBLOCK];
  47. typedef RGBQUAD *PCELL;
  48. typedef struct _CELLS {
  49. CELL cell;
  50. CELL cellT;
  51. CELL cellPrev;
  52. } CELLS;
  53. typedef CELLS * PCELLS;
  54. /*******************************************************************
  55. routine: CompressFrame
  56. purp: compress a frame
  57. returns: number of bytes in compressed buffer
  58. *******************************************************************/
  59. DWORD FAR CompressFrame16(LPBITMAPINFOHEADER lpbi, // DIB header to compress
  60. LPVOID lpBits, // DIB bits to compress
  61. LPVOID lpData, // put compressed data here
  62. DWORD threshold, // edge threshold
  63. DWORD thresholdInter, // inter-frame threshold
  64. LPBITMAPINFOHEADER lpbiPrev, // previous frame
  65. LPVOID lpPrev, // previous frame
  66. LONG (CALLBACK *Status) (LPARAM lParam, UINT message, LONG l),
  67. LPARAM lParam,
  68. PCELLS pCells);
  69. DWORD FAR CompressFrame8(LPBITMAPINFOHEADER lpbi, // DIB header to compress
  70. LPVOID lpBits, // DIB bits to compress
  71. LPVOID lpData, // put compressed data here
  72. DWORD threshold, // edge threshold
  73. DWORD thresholdInter, // inter-frame threshold
  74. LPBITMAPINFOHEADER lpbiPrev, // previous frame
  75. LPVOID lpPrev, // previous frame
  76. LONG (CALLBACK *Status) (LPARAM lParam, UINT message, LONG l),
  77. LPARAM lParam,
  78. PCELLS pCells,
  79. LPBYTE lpITable,
  80. RGBQUAD *prgbqOut);
  81. DWORD FAR CompressFrameBegin(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut,
  82. LPBYTE *lplpITable, RGBQUAD *prgbIn);
  83. DWORD FAR CompressFrameEnd(LPBYTE *lplpITable);
  84. void FAR CompressFrameFree(void);
  85. DWORD FAR QualityToThreshold(DWORD dwQuality);