vc1hwd_storage.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. /*------------------------------------------------------------------------------
  2. -- --
  3. -- This software is confidential and proprietary and may be used --
  4. -- only as expressly authorized by a licensing agreement from --
  5. -- --
  6. -- Hantro Products Oy. --
  7. -- --
  8. -- (C) COPYRIGHT 2006 HANTRO PRODUCTS OY --
  9. -- ALL RIGHTS RESERVED --
  10. -- --
  11. -- The entire notice above must be reproduced --
  12. -- on all copies and should not be removed. --
  13. -- --
  14. --------------------------------------------------------------------------------
  15. --
  16. -- Description : Storage handling functionality
  17. --
  18. --------------------------------------------------------------------------------
  19. --
  20. -- Version control information, please leave untouched.
  21. --
  22. -- $RCSfile: vc1hwd_storage.h,v $
  23. -- $Revision: 1.16 $
  24. -- $Date: 2010/03/31 08:55:00 $
  25. --
  26. ------------------------------------------------------------------------------*/
  27. #ifndef VC1HWD_STORAGE_H
  28. #define VC1HWD_STORAGE_H
  29. /*------------------------------------------------------------------------------
  30. Include headers
  31. ------------------------------------------------------------------------------*/
  32. #include "vc1hwd_picture_layer.h"
  33. #include "vc1hwd_picture.h"
  34. #include "vc1decapi.h"
  35. #include "bqueue.h"
  36. /*------------------------------------------------------------------------------
  37. Module defines
  38. ------------------------------------------------------------------------------*/
  39. #define MB_SKIPPED 4
  40. #define MB_4MV 2
  41. #define MB_AC_PRED 4
  42. #define MB_DIRECT 2
  43. #define MB_FIELD_TX 1
  44. #define MB_OVERLAP_SMOOTH 2
  45. #define MB_FORWARD_MB 4
  46. #define MAX_OUTPUT_PICS (16)
  47. typedef enum
  48. {
  49. /* Headers */
  50. HDR_SEQ = 1,
  51. HDR_ENTRY = 2,
  52. /* Combinations */
  53. HDR_BOTH = HDR_SEQ | HDR_ENTRY
  54. } hdr_e;
  55. /*------------------------------------------------------------------------------
  56. Data types
  57. ------------------------------------------------------------------------------*/
  58. typedef struct swStrmStorage
  59. {
  60. u16x maxCodedWidth; /* Maximum horizontal size in pixels */
  61. u16x maxCodedHeight; /* Maximum vertical size in pixels */
  62. u16x curCodedWidth;
  63. u16x curCodedHeight;
  64. u16x picWidthInMbs;
  65. u16x picHeightInMbs;
  66. u16x numOfMbs;
  67. u16x loopFilter; /* Is loop filter used */
  68. u16x multiRes; /* Can resolution change */
  69. u16x fastUvMc; /* Fast motion compensation */
  70. u16x extendedMv; /* Extended motion vectors used */
  71. u16x maxBframes; /* Maximum number of B frames [0,7] */
  72. u16x dquant; /* Can quantization step vary */
  73. u16x rangeRed; /* Is range reduction used */
  74. u16x vsTransform; /* Variable sized transform */
  75. u16x overlap; /* Overlap smooting enabled */
  76. u16x syncMarker; /* Sync markers present */
  77. u16x frameInterpFlag; /* Is frame interpolation hints present */
  78. u16x quantizer; /* Quantizer used for the sequence */
  79. const picture_t* pPicBuf; /* Picture descriptors for required
  80. * reference frames and work buffers */
  81. u16x outpBuf[MAX_OUTPUT_PICS];
  82. u16x outPicId[2][MAX_OUTPUT_PICS];
  83. u16x outErrMbs[MAX_OUTPUT_PICS];
  84. u32 fieldToReturn; /* 0 = First, 1 second */
  85. u16x outpIdx;
  86. u16x prevOutpIdx;
  87. u16x outpCount;
  88. u32 minCount; /* for vc1hwdNextPicture */
  89. u32 fieldCount;
  90. u32 maxNumBuffers;
  91. u32 numPpBuffers;
  92. u16x workBufAmount; /* Amount of work buffers */
  93. u16x workOut; /* Index for output */
  94. u16x work0; /* Index for last anchor frame */
  95. u16x work1; /* Index for previous to last anchor frame */
  96. u16x prevBIdx;
  97. pictureLayer_t picLayer;
  98. u16x rnd;
  99. u8 *pMbFlags;
  100. /* Sequence layer */
  101. u32 profile;
  102. u32 level;
  103. u32 colorDiffFormat; /* color-difference/luma format (1 = 4:2:0) */
  104. u32 frmrtqPostProc;
  105. u32 bitrtqPostProc;
  106. u32 postProcFlag;
  107. u32 pullDown;
  108. u32 interlace;
  109. u32 tfcntrFlag;
  110. u32 finterpFlag;
  111. u32 psf;
  112. u32 dispHorizSize;
  113. u32 dispVertSize;
  114. u32 aspectHorizSize;
  115. u32 aspectVertSize;
  116. u32 frameRateFlag;
  117. u32 frameRateInd;
  118. u32 frameRateNr;
  119. u32 frameRateDr;
  120. u32 colorFormatFlag;
  121. u32 colorPrim;
  122. u32 transferChar;
  123. u32 matrixCoef;
  124. u32 hrdParamFlag;
  125. u32 hrdNumLeakyBuckets;
  126. u32 bitRateExponent;
  127. u32 bufferSizeExponent;
  128. u32* hrdRate;
  129. u32* hrdBuffer;
  130. /* entry-point */
  131. u32 brokenLink;
  132. u32 closedEntry;
  133. u32 panScanFlag;
  134. u32 refDistFlag;
  135. u32* hrdFullness;
  136. u32 extendedDmv;
  137. u32 rangeMapYFlag;
  138. u32 rangeMapY;
  139. u32 rangeMapUvFlag;
  140. u32 rangeMapUv;
  141. u32 anchorInter[2]; /* [0] top field / frame, [1] bottom field */
  142. u32 skipB;
  143. u32 resolutionChanged;
  144. strmData_t tmpStrmData;
  145. u32 prevDecResult;
  146. u32 slice;
  147. u32 firstFrame;
  148. u32 ffStart; /* picture layer of the first field processed */
  149. u32 missingField;
  150. hdr_e hdrsDecoded; /* Contains info of decoded headers */
  151. u32 pictureBroken;
  152. u32 intraFreeze;
  153. u32 previousB;
  154. u32 previousModeFull;
  155. u32 keepHwReserved;
  156. bufferQueue_t bq;
  157. bufferQueue_t bqPp;
  158. } swStrmStorage_t;
  159. /*------------------------------------------------------------------------------
  160. Function prototypes
  161. ------------------------------------------------------------------------------*/
  162. #endif /* #ifndef VC1HWD_STORAGE_H */