home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Graphics / Viewers / VideoStreamV1.0 / Source / aviDecodeSrc / xanim_avi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-12  |  4.6 KB  |  165 lines

  1.  
  2. /*
  3.  * xanim.h
  4.  *
  5.  * Copyright (C) 1990,1991,1992,1993 by Mark Podlipec. 
  6.  * All rights reserved.
  7.  *
  8.  * This software may be freely copied, modified and redistributed
  9.  * without fee provided that this copyright notice is preserved 
  10.  * intact on all copies and modified copies.
  11.  * 
  12.  * There is no warranty or other guarantee of fitness of this software.
  13.  * It is provided solely "as is". The author(s) disclaim(s) all
  14.  * responsibility and liability with respect to this software's usage
  15.  * or its effect upon hardware or computer systems.
  16.  *
  17.  */
  18.  
  19. /** WAR: Wildly hacked to stream AVI RGB data to stdout, 7/2/94 **/
  20.  
  21.  
  22. #include "xanim.h"
  23.  
  24. #define TRUE 1
  25. #define FALSE 0
  26.  
  27. #ifndef MIN
  28. #define MIN(x,y)    ( ((x)>(y))?(y):(x) )
  29. #endif
  30.  
  31. #ifndef MAX
  32. #define MAX(x,y)    ( ((x)>(y))?(x):(y) )
  33. #endif
  34.  
  35. #define RIFF_RIFF 0x52494646
  36. #define RIFF_LIST 0x4C495354
  37. #define RIFF_avih 0x61766968
  38. #define RIFF_strd 0x73747264
  39. #define RIFF_strh 0x73747268
  40. #define RIFF_strf 0x73747266
  41. #define RIFF_vedt 0x76656474
  42. #define RIFF_JUNK 0x4A554E4B
  43. #define RIFF_00dc 0x30306463
  44. #define RIFF_01wb 0x30317762
  45. #define RIFF_idx1 0x69647831
  46. #define RIFF_CRAM 0x4352414D
  47.  
  48. #define RIFF_AVI  0x41564920
  49. #define RIFF_hdrl 0x6864726C
  50. #define RIFF_strl 0x7374726C
  51. #define RIFF_DISP 0x44495350
  52. #define RIFF_ISBJ 0x4953424a
  53.  
  54. /* fcc Types */
  55. #define RIFF_vids 0x76696473
  56. #define RIFF_auds 0x61756473
  57.  
  58. /* fcc handlers */
  59. #define RIFF_RLE  0x524C4432
  60. #define RIFF_msvc 0x6D737663
  61.  
  62. typedef struct {
  63.     ULONG ckid;
  64.     ULONG flags;
  65.     ULONG chunk_offset;            /* position of chunk rel to movi list include 8b hdr */
  66.     ULONG chunk_size;            /* length of chunk excluding 8 bytes for RIFF hdr */
  67. } AVI_INDEX_ENTRY;
  68.  
  69. /* Flags for AVI_INDEX_ENTRY */
  70. #define AVIIF_LIST          0x00000001L
  71. #define AVIIF_TWOCC         0x00000002L
  72.  /* keyframe doesn't need previous info to be decompressed */
  73. #define AVIIF_KEYFRAME      0x00000010L
  74.  /* this chunk needs the frames following it to be used */
  75. #define AVIIF_FIRSTPART     0x00000020L
  76.  /* this chunk needs the frames before it to be used */
  77. #define AVIIF_LASTPART      0x00000040L
  78. #define AVIIF_MIDPART       (AVIIF_LASTPART|AVIIF_FIRSTPART)
  79.  /* this chunk doesn't affect timing ie palette change */
  80. #define AVIIF_NOTIME        0x00000100L
  81. #define AVIIF_COMPUSE       0x0FFF0000L
  82.  
  83. typedef struct {
  84.     ULONG us_frame;                /* MicroSecPerFrame - timing between frames */
  85.     ULONG max_bps;                /* MaxBytesPerSec - approx bps system must handle */
  86.     ULONG pad_gran;                /* */
  87.     ULONG flags;                /* Flags */
  88.     ULONG tot_frames;            /* TotalFrames */
  89.     ULONG init_frames;            /* InitialFrames - initial frame before interleaving */
  90.     ULONG streams;                /* Streams */
  91.     ULONG sug_bsize;            /* SuggestedBufferSize */
  92.     ULONG width;                /* Width */
  93.     ULONG height;                /* Height */
  94.     ULONG scale;                /* Scale */
  95.     ULONG rate;                    /* Rate */
  96.     ULONG start;                /* Start */
  97.     ULONG length;                /* Length */
  98. } AVI_HDR;
  99.  
  100. /* AVI_HDR Flags */
  101.  /* had idx1 chunk */
  102. #define AVIF_HASINDEX           0x00000010
  103.  /* must use idx1 chunk to determine order */
  104. #define AVIF_MUSTUSEINDEX       0x00000020
  105.  /* AVI file is interleaved */
  106. #define AVIF_ISINTERLEAVED      0x00000100
  107.  /* specially allocated used for capturing real time video */
  108. #define AVIF_WASCAPTUREFILE     0x00010000
  109.  /* contains copyrighted data */
  110. #define AVIF_COPYRIGHTED        0x00020000
  111.  
  112.  
  113. typedef struct {
  114.     ULONG fcc_type;                /* fccType  {vids} */
  115.     ULONG fcc_handler;            /* fccHandler {msvc,RLE} */
  116.     ULONG flags;                /* Flags */
  117.     ULONG priority;                /* Priority */
  118.     ULONG init_frames;            /* InitialFrames */
  119.     ULONG scale;                /* Scale */
  120.     ULONG rate;                    /* Rate */
  121.     ULONG start;                /* Start */
  122.     ULONG length;                /* Length In units above... */
  123.     ULONG sug_bsize;            /* SuggestedBufferSize */
  124.     ULONG quality;                /* Quality */
  125.     ULONG samp_size;            /* SampleSize */
  126. } AVI_STREAM_HDR;
  127.  
  128. /* AVI_STREAM_HDR Flags */
  129. #define AVISF_DISABLED                  0x00000001
  130. #define AVISF_VIDEO_PALCHANGES          0x00010000
  131.  
  132.  
  133. typedef struct {                /* BitMapInfoHeader */
  134.     ULONG size;                    /* Size */
  135.     ULONG width;                /* Width */
  136.     ULONG height;                /* Height */
  137.     ULONG planes;                /* short Planes */
  138.     ULONG bit_cnt;                /* short BitCount */
  139.     ULONG compression;            /* Compression {1} */
  140.     ULONG image_size;            /* SizeImage */
  141.     ULONG xpels_meter;            /* XPelsPerMeter */
  142.     ULONG ypels_meter;            /* XPelsPerMeter */
  143.     ULONG num_colors;            /* ClrUsed */
  144.     ULONG imp_colors;            /* ClrImportant */
  145. } VIDS_HDR;
  146.  
  147.  
  148. typedef struct AVI_FRAME_STRUCT {
  149.     ULONG time;
  150.     XA_ACTION *act;
  151.     struct AVI_FRAME_STRUCT *next;
  152. } AVI_FRAME;
  153.  
  154.  
  155. /* FUNCTIONS IN AVI.C */
  156. LONG Is_AVI_File();
  157. void AVI_Read_File();
  158. void AVI_Print_ID();
  159. AVI_FRAME *AVI_Add_Frame();
  160. void AVI_Free_Frame_List();
  161. ULONG AVI_Decode_CRAM();
  162. void RIFF_Read_AVIH();
  163. void RIFF_Read_STRH();
  164. void RIFF_Read_VIDS();
  165.