home *** CD-ROM | disk | FTP | other *** search
/ MPEG Toolkit / MPEG Toolkit.iso / dos / secmpeg3 / header.h < prev    next >
Encoding:
Text File  |  1997-01-01  |  4.6 KB  |  162 lines

  1.  
  2. /* ------ DEBUG ------ */
  3.  
  4. INT groupofpictures_count = 0;
  5. INT pictureheader_count = 0;
  6. INT sliceheader_count = 0;
  7. int current_makroblock = 0;
  8.  
  9. /* ------ Rate Control               ------ */
  10. int Rate = 0;
  11. int BufferSize = 0;
  12.  
  13.  
  14.  
  15. /* ------ Video sequence information ------ */
  16.  
  17. int HorizontalSize=0;               /* Horizontal dimensions */
  18. int VerticalSize=0;                 /* Vertical dimensions */
  19. int Aprat = 1;                      /* Aspect ratio */
  20. int DropFrameFlag=0;                /* Whether frame will be dropped */
  21. int Prate = 5;                      /* Picture rate (def 30fps) */
  22. int Brate = 0x3fff;                 /* Bit rate */
  23. int Bsize = 0;                      /* Buffer size */
  24. int ConstrainedParameterFlag=0;     /* Default: unconstrained */
  25. int LoadIntraQuantizerMatrix=0;     /* Quantization load */
  26. int LoadNonIntraQuantizerMatrix=0;
  27.  
  28.  
  29. /* Group of pictures layer */
  30.  
  31. int TimeCode= -1;                    /* SMPTE timestamp */
  32. int ClosedGOP=0;                    /* Back pred. needed of GOP */
  33. int BrokenLink=0;                   /* Whether editing has occurred. */
  34.                                     /* Picture layer */
  35. int TemporalReference=0;            /* "frame" reference with base of GOP */
  36. int PType=P_INTRA;                  /* Picture type */
  37. INT BufferFullness=0;               /* Current fullness of buffer */
  38. int FullPelForward=0;               /* Foward motion vector on full pel */
  39. int ForwardIndex=0;                 /* Decoding table to be used */
  40. int FullPelBackward=0;              /* Backward motion vector on full pel */
  41. int BackwardIndex=0;                /* Decoding table to be used */
  42. int PictureExtra=0;                 /* Flag set if extra info present */
  43. int PictureExtraInfo=0;
  44.  
  45. /* slice layer */
  46.  
  47. int SQuant=1;          /* Slice quantization */
  48. int MBperSlice=0;      /* Number of macroblocks per slice */
  49.                        /* If zero, set automaticallly */
  50. int SliceExtra=0;      /* (Last) slice extra flag */
  51. int SliceExtraInfo=0;  /* (Last) slice extra information */
  52.  
  53. /* makroblock layer */
  54.  
  55. int MType=0;           /* Macroblock type */
  56.  
  57.  
  58. int LastMType;  /* Last encoded MType */
  59. int SkipMode;   /* Whether we skip coding */
  60. int EncStartSlice;    /* If encoder has started a slice */
  61. int EncEndSlice;      /* If encoder has ended a slice */
  62. int EncPerfectSlice=1;  /* Set if you want first and  last block */
  63.                    /* of a slice to be defined. Clear if you */
  64.                    /* allow skipped macroblocks between frames */
  65. int UseTimeCode=0;/*If 1 forces frame number to be same as time code */
  66.  
  67. int MQuant=1;          /* Macroblock quantization */
  68. int SVP=0;             /* Slice vertical position */
  69. int MVD1H=0;           /* Forward motion vector */
  70. int MVD1V=0;
  71. int MVD2H=0;           /* Backward motion vector */
  72. int MVD2V=0;
  73. int LastMVD1H=0;       /* Interpolative predictors */
  74. int LastMVD1V=0;
  75. int LastMVD2H=0;
  76. int LastMVD2V=0;
  77. int CBP=0x3f;          /* Coded block pattern */
  78.  
  79. int MBSRead=0;
  80. int MBAIncrement=0;
  81. int LastMBA=0;
  82. int CurrentMBA=0;
  83.  
  84. /* ------ Type Definitions ------ */
  85.  
  86. /*
  87. We define the following variables by layers, to avoid compatibility
  88. problems with compilers unable to do automatic aggregate
  89. initialization.
  90.  
  91. The MType arrays are indexed on macroblock type.
  92. The PMType arrays are indexed on picture type and macroblock type.
  93. */
  94.  
  95. /* --- Quantization used --- */
  96.  
  97. int DCQuantMType[] = {0};
  98. int IntraQuantMType[] = {0,1};
  99. int PredQuantMType[] = {0,0,0,0,1,1,1};
  100. int InterQuantMType[] = {0,0,0,0,0,0,0,1,1,1,1};
  101. int *QuantPMType[] = {
  102.   (int *) 0,
  103.   IntraQuantMType,
  104.   PredQuantMType,
  105.   InterQuantMType,
  106.   DCQuantMType};
  107.  
  108. /* --- Motion forward vector used --- */
  109.  
  110.  
  111. int IntraMFMType[] = {0,0};
  112. int PredMFMType[] = {1,0,1,0,1,0,0};
  113. int InterMFMType[] = {1,1,0,0,1,1,0,1,1,0,0};
  114. int DCMFMType[] = {0};
  115. int *MFPMType[] = {
  116.   (int *) 0,
  117.   IntraMFMType,
  118.   PredMFMType,
  119.   InterMFMType,
  120.   DCMFMType};
  121.  
  122. /* --- Motion backward vector used --- */
  123.  
  124. int IntraMBMType[] = {0,0};
  125. int PredMBMType[] = {0,0,0,0,0,0,0};
  126. int InterMBMType[] = {1,1,1,1,0,0,0,1,0,1,0};
  127. int DCMBMType[] = {0};
  128. int *MBPMType[] = {
  129.   (int *) 0,
  130.   IntraMBMType,
  131.   PredMBMType,
  132.   InterMBMType,
  133.   DCMBMType};
  134.  
  135. /* --- CBP used in coding --- */
  136.  
  137. int IntraCBPMType[] = {0,0};
  138. int PredCBPMType[] = {1,1,0,0,1,1,0};
  139. int InterCBPMType[] = {0,1,0,1,0,1,0,1,1,1,0};
  140. int DCCBPMType[] = {0};
  141. int *CBPPMType[] = {
  142.   (int *) 0,
  143.   IntraCBPMType,
  144.   PredCBPMType,
  145.   InterCBPMType,
  146.   DCCBPMType};
  147.  
  148. /* --- Intra coded macroblock --- */
  149.  
  150. int IntraIMType[] = {1,1};
  151. int PredIMType[] = {0,0,0,1,0,0,1};
  152. int InterIMType[] = {0,0,0,0,0,0,1,0,0,0,1};
  153. int DCIMType[] = {1};
  154. int *IPMType[] = {
  155.   (int *) 0,
  156.   IntraIMType,
  157.   PredIMType,
  158.   InterIMType,
  159.   DCIMType};
  160.  
  161.  
  162.