Source code of Windows XP (NT5)
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.

193 lines
8.6 KiB

  1. /****************************************************************************
  2. * @doc INTERNAL H26XINC
  3. *
  4. * @module H26XInc.h | Header file for the common H.26X video codec defines.
  5. ***************************************************************************/
  6. #ifndef _H26XINC_H_
  7. #define _H26XINC_H_
  8. enum FrameSize {FORBIDDEN=0, SQCIF=1, QCIF=2, CIF=3, fCIF=4, ssCIF=5};
  9. // MSH26X Configuration Information
  10. typedef struct tagMSH26XCONF{
  11. BOOL bInitialized; // Whether custom msgs can be rcv'd.
  12. BOOL bCompressBegin; // Whether the CompressBegin msg was rcv'd.
  13. BOOL bRTPHeader; // Whether to generate RTP header info
  14. /* used if bRTPHeader */
  15. UINT unPacketSize; // Maximum packet size
  16. BOOL bEncoderResiliency; // Whether to use resiliency restrictions
  17. /* used if bEncoderResiliency */
  18. UINT unPacketLoss;
  19. BOOL bBitRateState;
  20. /* used if bBitRateState */
  21. UINT unBytesPerSecond;
  22. /* The following information is determined from the packet loss value. */
  23. /* These values are calculated each time we receive a resiliency msg or */
  24. /* the value is changed through the dialog box. They are not stored in */
  25. /* the registry. Only the above elements are stored in the registry. */
  26. BOOL bDisallowPosVerMVs; // if true, disallow positive vertical MVs
  27. BOOL bDisallowAllVerMVs; // if true, disallow all vertical MVs
  28. UINT unPercentForcedUpdate; // Percent Forced Update per Frame
  29. UINT unDefaultIntraQuant; // Default Intra Quant
  30. UINT unDefaultInterQuant; // Default Inter Quant
  31. } MSH26XCONF;
  32. // MSH26X Compressor Instance information
  33. typedef struct tagMSH26XCOMPINSTINFO{
  34. BOOL Initialized;
  35. WORD xres, yres;
  36. FrameSize FrameSz; // Which of the supported frame sizes.
  37. float FrameRate;
  38. DWORD DataRate; // Data rate in bytes per second.
  39. HGLOBAL hEncoderInst; // Instance data private to encoder.
  40. LPVOID EncoderInst;
  41. WORD CompressedSize;
  42. BOOL Is160x120;
  43. BOOL Is240x180;
  44. BOOL Is320x240;
  45. MSH26XCONF Configuration;
  46. } MSH26XCOMPINSTINFO, *PMSH26XCOMPINSTINFO;
  47. // MSH26X BitStream Info Trailer structure
  48. typedef struct tagH26X_RTP_BSINFO_TRAILER {
  49. DWORD dwVersion;
  50. DWORD dwFlags;
  51. DWORD dwUniqueCode;
  52. DWORD dwCompressedSize;
  53. DWORD dwNumOfPackets;
  54. BYTE bySrc;
  55. BYTE byTR;
  56. BYTE byTRB;
  57. BYTE byDBQ;
  58. } H26X_RTP_BSINFO_TRAILER, *PH26X_RTP_BSINFO_TRAILER;
  59. // MSH263 BitStream Info structure
  60. typedef struct tagRTP_H263_BSINFO {
  61. DWORD dwFlags;
  62. DWORD dwBitOffset;
  63. BYTE byMode;
  64. BYTE byMBA;
  65. BYTE byQuant;
  66. BYTE byGOBN;
  67. char cHMV1;
  68. char cVMV1;
  69. char cHMV2;
  70. char cVMV2;
  71. } RTP_H263_BSINFO, *PRTP_H263_BSINFO;
  72. // MSH261 BitStream Info structure
  73. typedef struct tagRTP_H261_BSINFO {
  74. DWORD dwFlags;
  75. DWORD dwBitOffset;
  76. BYTE byMBA;
  77. BYTE byQuant;
  78. BYTE byGOBN;
  79. char cHMV;
  80. char cVMV;
  81. BYTE byPadding0;
  82. WORD wPadding1;
  83. } RTP_H261_BSINFO, *PRTP_H261_BSINFO;
  84. // Constants
  85. #define H263_RTP_BS_START_CODE MakeFOURCC('H','2','6','3')
  86. #define H261_RTP_BS_START_CODE MakeFOURCC('H','2','6','1')
  87. #define RTP_H26X_INTRA_CODED 0x00000001
  88. #define RTP_H263_PB 0x00000002
  89. #define RTP_H263_AP 0x00000004
  90. #define RTP_H263_SAC 0x00000008
  91. #define RTP_H263_UMV 0x00000010
  92. #define RTP_H263_MODE_A 0x00
  93. #define RTP_H263_MODE_B 0x01
  94. #define RTP_H263_MODE_C 0x02
  95. #define H26X_RTP_PAYLOAD_VERSION 0x00000000
  96. #define RTP_H26X_PACKET_LOST 0x00000001
  97. // Decompressor Instance information
  98. typedef struct
  99. {
  100. BOOL Initialized;
  101. BOOL bProposedCorrectAspectRatio;// proposed
  102. BOOL bCorrectAspectRatio; // whether to correct the aspect ratio
  103. WORD xres, yres; // size of image within movie
  104. FrameSize FrameSz; // Which of the supported frame sizes.
  105. // int pXScale, pYScale; // proposed scaling (Query)
  106. // int XScale, YScale; // current scaling (Begin)
  107. UINT uColorConvertor; // Current Color Convertor
  108. WORD outputDepth; // and bit depth
  109. LPVOID pDecoderInst;
  110. BOOL UseActivePalette; // decompress to active palette == 1
  111. BOOL InitActivePalette; // active palette initialized == 1
  112. BOOL bUseBlockEdgeFilter; // switch for block edge filter
  113. RGBQUAD ActivePalette[256]; // stored active palette
  114. } DECINSTINFO, FAR *LPDECINST;
  115. // Configuration Information
  116. typedef struct
  117. {
  118. BOOL bInitialized; // Whether custom msgs can be rcv'd.
  119. BOOL bCompressBegin; // Whether the CompressBegin msg was rcv'd.
  120. BOOL bRTPHeader; // Whether to generate RTP header info
  121. // Used if bRTPHeader
  122. UINT unPacketSize; // Maximum packet size
  123. BOOL bEncoderResiliency; // Whether to use resiliency restrictions
  124. // Used if bEncoderResiliency
  125. UINT unPacketLoss;
  126. BOOL bBitRateState;
  127. // Used if bBitRateState
  128. UINT unBytesPerSecond;
  129. /* The following information is determined from the packet loss value. */
  130. /* These values are calculated each time we receive a resiliency msg or */
  131. /* the value is changed through the dialog box. They are not stored in */
  132. /* the registry. Only the above elements are stored in the registry. */
  133. BOOL bDisallowPosVerMVs; // if true, disallow positive vertical MVs
  134. BOOL bDisallowAllVerMVs; // if true, disallow all vertical MVs
  135. UINT unPercentForcedUpdate; // Percent Forced Update per Frame
  136. UINT unDefaultIntraQuant; // Default Intra Quant
  137. UINT unDefaultInterQuant; // Default Inter Quant
  138. } T_CONFIGURATION;
  139. // Compressor Instance information
  140. typedef struct
  141. {
  142. BOOL Initialized;
  143. WORD xres, yres;
  144. FrameSize FrameSz; // Which of the supported frame sizes.
  145. float FrameRate;
  146. DWORD DataRate; // Data rate in bytes per second.
  147. HGLOBAL hEncoderInst; // Instance data private to encoder.
  148. LPVOID EncoderInst;
  149. WORD CompressedSize;
  150. BOOL Is160x120;
  151. BOOL Is240x180;
  152. BOOL Is320x240;
  153. T_CONFIGURATION Configuration;
  154. } COMPINSTINFO, FAR *LPCODINST;
  155. // Instance information
  156. // @todo Remove useless fields of this structure
  157. typedef struct tagINSTINFO
  158. {
  159. DWORD dwFlags;
  160. DWORD fccHandler; // So we know what codec has been opened.
  161. BOOL enabled;
  162. LPCODINST CompPtr; // ICM
  163. LPDECINST DecompPtr; // ICM
  164. } INSTINFO, FAR *LPINST;
  165. // For GetProcAddresss on DriverProc
  166. typedef LRESULT (WINAPI *LPFNDRIVERPROC)(IN DWORD dwDriverID, IN HDRVR hDriver, UINT uiMessage, LPARAM lParam1, LPARAM lParam2);
  167. // FourCC codes for DDraw and codecs
  168. #define FOURCC_YUY2 mmioFOURCC('Y', 'U', 'Y', '2')
  169. #define FOURCC_UYVY mmioFOURCC('U', 'Y', 'V', 'Y')
  170. #define FOURCC_I420 mmioFOURCC('I', '4', '2', '0')
  171. #define FOURCC_IYUV mmioFOURCC('I', 'Y', 'U', 'V')
  172. #define FOURCC_YV12 mmioFOURCC('Y', 'V', '1', '2')
  173. #define FOURCC_M263 mmioFOURCC('M', '2', '6', '3')
  174. #define FOURCC_M261 mmioFOURCC('M', '2', '6', '1')
  175. #define FOURCC_R263 mmioFOURCC('R', '2', '6', '3')
  176. #define FOURCC_R261 mmioFOURCC('R', '2', '6', '1')
  177. #endif // _H26XINC_H_