home *** CD-ROM | disk | FTP | other *** search
/ Chip: Extra / Image.bin / aol / vfw / vfw_spec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-11  |  8.2 KB  |  270 lines

  1. /************************************************************************
  2. *  vfw_spec.h                                                           *
  3. *                                                                       *
  4. * This code and information is provided "as is" without warranty of     *
  5. * any kind, either expressed or implied, including but not limited to    *
  6. * the implied warranties of merchantability and/or fitness for a        *
  7. * particular purpose.                                                   *
  8. *                                                                       *
  9. *               Copyright (c) 1994-1995 Intel Corporation.              *
  10. *                         All Rights Reserved.                          *
  11. *                                                                       *
  12. ************************************************************************/
  13. /*
  14.  *
  15.  *  DESCRIPTION:
  16.  *  The Indeo(R) Video Interactive codec provides access to new features
  17.  *  using the ICM_SETCODECSTATE and ICM_GETCODECSTATE messages. This header
  18.  *  file defines the data structures used in these messages.
  19.  */
  20.  
  21. /* $Revision:   1.11  $
  22.  */
  23. /* Remove these three lines (23-25) before distributing publicly
  24.  * $Header:   I:\proj\src\common\vcs\vfw_spec.h_v   1.11   30 Oct 1995 14:06:46   CPZIELKE  $
  25.  */
  26.  
  27.  
  28. #ifndef __VFW_SPEC_H__
  29. #define __VFW_SPEC_H__
  30.  
  31.  
  32. /* The specific interface version is defined as follows:
  33.  */
  34. #define INTERFACE_MAJOR_NUMBER(v)            ((v) >> 16)
  35. #define INTERFACE_MINOR_NUMBER(v)            ((v) & 0xffff)
  36. #define CREATE_INTERFACE_VERSION(maj,min)    ((((DWORD)maj)<<16) | (((DWORD)min) & 0xffff))
  37. #define SPECIFIC_INTERFACE_VERSION             CREATE_INTERFACE_VERSION(1,0)
  38.  
  39. /* The codec specific information is handled by the general state
  40.  * handler.
  41.  */
  42. #define ICM_GETCODECSTATE                    ICM_GETSTATE
  43. #define ICM_SETCODECSTATE                    ICM_SETSTATE
  44.  
  45. /* OS Environments - Within the Microsoft Windows domain (Win 3.1, Win 95,
  46.  * and Win NT), both applications and codecs can be compiled in either 16 or
  47.  * 32-bit formats.  Any combination is allowed with the knowledge that data
  48.  * pointers will not be thunked.
  49.  */
  50. typedef enum {
  51.     OE_UNDEFINED,
  52.     OE_16,
  53.     OE_32,
  54. } R4_OS_ENVIRONMENT;
  55.  
  56.  
  57. /* The type field identifies the kind of operation that should be done as part
  58.  * of the ICM_GETCODECSTATE and ICM_SETCODECSTATE messages.
  59.  *
  60.  * The MT_UNDEFINED value is not a supported type - it should only be used
  61.  * to initialize variables to an "undefined" state.
  62.  */
  63. typedef enum {
  64.     MT_UNDEFINED,
  65.     MT_DECODE_FRAME_DEFAULT,
  66.     MT_DECODE_FRAME_VALUE,
  67.     MT_DECODE_SEQ_DEFAULT,
  68.     MT_DECODE_SEQ_VALUE,
  69.     MT_ENCODE_SEQ_DEFAULT,
  70.     MT_ENCODE_SEQ_VALUE
  71. } R4_MESSAGE_TYPE;
  72.  
  73. /*
  74.  * MT_QUEUE is for 16-bit applications that call 32-bit codecs, only.  It
  75.  * is necessary to pre-set ICM_GETCODECSTATE messages by first issuing an
  76.  * ICM_SETCODECSTATE with the MT_QUEUE flag or'ed with the desired
  77.  * message type to get.  The ICM_GETCODECSTATE message which follows
  78.  * must set its dwFourCC field to 0.
  79.  */
  80. #define    MT_QUEUE  (1UL<<31)
  81.  
  82.  
  83. /* A flag is false if it is zero, otherwise it is true.
  84.  */
  85. typedef DWORD R4_FLAG;
  86.  
  87. /* Pointer to a Flag - A pointer to a flag is used by the codec to write 
  88.  * status information at a later time.
  89.  */
  90. typedef R4_FLAG FAR * PTR_R4_FLAG;
  91.  
  92.  
  93. /* Rectangle - The following structure is used to describe a rectangle.
  94.  */
  95. typedef struct {
  96.     DWORD dwX;
  97.     DWORD dwY;
  98.     DWORD dwWidth;
  99.     DWORD dwHeight;
  100. } R4_RECT, FAR * PTR_R4_RECT;
  101.  
  102.  
  103. /* Transparency Bitmask - A transparency bitmask contains one bit for each 
  104.  * pixel in the source image. If a bit is zero the data is transparent.  
  105.  * The first bit in each byte is identified by the mask 0x80.  The last 
  106.  * bit in each byte is identified by the mask 0x01. 
  107.  * 
  108.  * To allow faster access each row must begin on a DWORD boundary and the 
  109.  * total number of bytes must be rounded-up to a multipe of four.
  110.  */
  111. typedef BYTE FAR * PTR_R4_BITMASK;
  112.  
  113.  
  114. /* Playback Platform - The codec supports several playback options.  This is
  115.  * not hardware specific.  Instead it rates the relative capabilities of the  
  116.  * hardware.
  117.  */
  118. typedef enum {
  119.     PP_LOW,
  120.     PP_MEDIUM,
  121.     PP_HIGH,
  122. } R4_PLAYBACK_PLATFORM;
  123.  
  124.  
  125. /* Transparency Method - The codec supports a number of tranparency encoding
  126.  * methods. The enumeration specifies the transparency method.
  127.  */
  128. typedef enum {
  129.     TM_UNDEFINED,
  130.     TM_NONE,
  131.     TM_RANGE,
  132.     TM_BITMASK,
  133.     TM_FRAME,
  134.     TM_ALPHA_CHANNEL        /* XRGB color formats only */
  135. } R4_TRANS_METHOD;
  136.  
  137.  
  138. /* Transparency Range - A transparency range is specified using minimum 
  139.  * and maximum values for R, G, and B. Any pixel with values within this range 
  140.  * (inclusive) is considered transparent.
  141.  */
  142. typedef struct {
  143.     U16 u16Reserved;
  144.     U8 u8BlueLow;
  145.     U8 u8BlueHigh;
  146.     U8 u8GreenLow;
  147.     U8 u8GreenHigh;
  148.     U8 u8RedLow;
  149.     U8 u8RedHigh;
  150. } R4_RANGE, FAR * PTR_R4_RANGE;
  151.  
  152.  
  153. /* The structure header is a set fields that are common,
  154.  * to each of the data structures that follows.
  155.  */
  156. typedef struct {
  157.     DWORD    dwSize;
  158.     DWORD    dwFourCC;
  159.     DWORD    dwVersion;
  160.     LONG    mtType;    
  161.     LONG    oeEnvironment;
  162.     DWORD    dwFlags;
  163. } R4_HEADER, FAR * PTR_R4_HEADER;
  164. /* The structure header size is enough room for dwSize, dwFourCC,
  165.  * dwVersion, dwType, dwEnvironment, and dwFlags
  166.  */
  167. #define R4_STRUCTURE_HEADER_SIZE (sizeof(R4_HEADER))
  168.  
  169.  
  170. /* Some decode parameters can be changed prior to either an ICM_DECOMPRESS or 
  171.  * ICM_DECOMPRESSEX mesage. These are found in the  R4_DEC_FRAME_DATA 
  172.  * structure.  See CUSTOM_INTERFACE_ENCODER_DATA for structure size constraints.
  173.  */
  174. #define DECFRAME_TIME_LIMIT        (1UL<<0)
  175. #define DECFRAME_DECODE_RECT    (1UL<<1)
  176. #define DECFRAME_VIEW_RECT        (1UL<<2)
  177. #define DECFRAME_BOUNDING_RECT    (1UL<<3)
  178. #define DECFRAME_TRANS_BITMASK    (1UL<<4)
  179. #define DECFRAME_BRIGHTNESS        (1UL<<5)
  180. #define DECFRAME_SATURATION        (1UL<<6)
  181. #define DECFRAME_CONTRAST        (1UL<<7)
  182. #define DECFRAME_VALID            (1UL<<31)
  183.  
  184. typedef struct {
  185.     DWORD dwSize;
  186.     DWORD dwFourCC;
  187.     DWORD dwVersion;
  188.     LONG mtType;    
  189.     LONG oeEnvironment;
  190.     DWORD dwFlags;
  191.  
  192.     DWORD dwTimeLimit;
  193.     R4_RECT rDecodeRect;
  194.     R4_RECT rViewRect;
  195.     PTR_R4_RECT prBoundingRect;
  196.     PTR_R4_BITMASK pbmTransparencyBitmask;
  197.     PTR_R4_FLAG pfUpdatedTransparencyBitmask;
  198.     LONG lBrightness; 
  199.     LONG lSaturation;
  200.     LONG lContrast;
  201. } R4_DEC_FRAME_DATA, FAR * PTR_R4_DEC_FRAME_DATA;
  202.  
  203.  
  204. /* Other decode parameters can only be changed prior to either an 
  205.  * ICM_DECOMPRESS_BEGIN or an ICM_DECOMPRESSEX_BEGIN message.  These 
  206.  * are found in the R4_DEC_SEQ_DATA structure.
  207.  * See CUSTOM_INTERFACE_ENCODER_DATA for structure size constraints.
  208.  */ 
  209. #define DECSEQ_KEY                (1UL<<0)
  210. #define DECSEQ_SCALABILITY        (1UL<<1)
  211. #define DECSEQ_FILL_TRANSPARENT    (1UL<<2)
  212. #define DECSEQ_ALT_LINE            (1UL<<3)
  213. #define DECSEQ_VALID             (1UL<<31)
  214.  
  215. typedef struct {
  216.     DWORD dwSize;
  217.     DWORD dwFourCC;
  218.     DWORD dwVersion;
  219.     LONG mtType;
  220.     LONG oeEnvironment;
  221.     DWORD dwFlags;
  222.  
  223.     DWORD dwKey;
  224.     R4_FLAG fEnabledKey;
  225.     R4_FLAG fScalability;
  226.     R4_FLAG fFillTransparentPixels;
  227. } R4_DEC_SEQ_DATA, FAR * PTR_R4_DEC_SEQ_DATA;
  228.  
  229.  
  230. /* Encode parameters can only be changed prior to an ICM_COMPRESS_BEGIN 
  231.  * messsage.  These are found in the R4_ENC_SEQ_DATA structure (these 
  232.  * include the parameters that can be set in the super dialog box).
  233.  * See CUSTOM_INTERFACE_ENCODER_DATA for structure size constraints.
  234.  */  
  235. #define ENCSEQ_KEY                    (1UL<<0)
  236. #define ENCSEQ_MINIMUM_VIEWPORT        (1UL<<1)
  237. #define ENCSEQ_TRANSPARENCY            (1UL<<2)
  238. #define ENCSEQ_SCALABILITY            (1UL<<3)
  239. #define ENCSEQ_BI_DIR_PREDICTION    (1UL<<4)
  240. #define ENCSEQ_PLAYBACK_PLATFORM    (1UL<<5)
  241. #define ENCSEQ_RANDOM_KEY_AND_BIDIR (1UL<<6)
  242. #define ENCSEQ_FRAME_INFO            (1UL<<7)
  243. #define ENCSEQ_VALID                (1UL<<31)
  244.  
  245. typedef struct {
  246.     DWORD dwSize;
  247.     DWORD dwFourCC;
  248.     DWORD dwVersion;
  249.     LONG mtType;    
  250.     LONG oeEnvironment;
  251.     DWORD dwFlags;
  252.  
  253.     DWORD dwKey;
  254.     DWORD dwMinViewportWidth;
  255.     DWORD dwMinViewportHeight;
  256.     R4_RANGE rngTransparencyRange;
  257.     PTR_R4_BITMASK pbmTransparencyBitmask;
  258.     LONG tmTransparencyMethod;
  259.     R4_FLAG fEnabledKey;
  260.     R4_FLAG fScalability;
  261.     R4_FLAG fBiDirPrediction;
  262.     R4_FLAG fRandomKeyAndBiDir;
  263.     DWORD dwPlaybackPlatform;
  264.     WORD wFrameLatency;                /* Frame info flag */
  265.     WORD wDeadFrames;                /* Frame info flag */
  266. } R4_ENC_SEQ_DATA, FAR * PTR_R4_ENC_SEQ_DATA;
  267.  
  268.  
  269. #endif /* __VFW_SPEC_H__ */
  270.