vp8hwd_decoder.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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 : ...
  17. -
  18. --------------------------------------------------------------------------------
  19. -
  20. - Version control information, please leave untouched.
  21. -
  22. - $RCSfile: vp8hwd_decoder.h,v $
  23. - $Revision: 1.9 $
  24. - $Date: 2010/10/20 07:29:05 $
  25. -
  26. ------------------------------------------------------------------------------*/
  27. #ifndef __VP8_DECODER_H__
  28. #define __VP8_DECODER_H__
  29. #include "basetype.h"
  30. #define VP8HWD_VP7 1U
  31. #define VP8HWD_VP8 2U
  32. #define DEC_8190_ALIGN_MASK 0x07U
  33. #define DEC_8190_MODE_VP8 0x09U
  34. #define VP8HWDEC_HW_RESERVED 0x0100
  35. #define VP8HWDEC_SYSTEM_ERROR 0x0200
  36. #define VP8HWDEC_SYSTEM_TIMEOUT 0x0300
  37. #define MAX_NBR_OF_DCT_PARTITIONS (8)
  38. #define MAX_NBR_OF_SEGMENTS (4)
  39. #define MAX_NBR_OF_MB_REF_LF_DELTAS (4)
  40. #define MAX_NBR_OF_MB_MODE_LF_DELTAS (4)
  41. #define MAX_NBR_OF_VP7_MB_FEATURES (4)
  42. #define MAX_SNAPSHOT_WIDTH 1024
  43. #define MAX_SNAPSHOT_HEIGHT 1024
  44. #define VP7_MV_PROBS_PER_COMPONENT (17)
  45. #define VP8_MV_PROBS_PER_COMPONENT (19)
  46. /*enum
  47. {
  48. HANTRO_NOK = 1,
  49. HANTRO_OK = 0
  50. };*/
  51. #define HANTRO_OK (0)
  52. #define HANTRO_NOK (1)
  53. #ifndef HANTRO_FALSE
  54. #define HANTRO_FALSE (0)
  55. #endif
  56. #ifndef HANTRO_TRUE
  57. #define HANTRO_TRUE (1)
  58. #endif
  59. enum {
  60. VP8_SEG_FEATURE_DELTA,
  61. VP8_SEG_FEATURE_ABS
  62. };
  63. typedef enum
  64. {
  65. VP8_YCbCr_BT601,
  66. VP8_CUSTOM
  67. } vpColorSpace_e;
  68. typedef struct vp8EntropyProbs_s
  69. {
  70. u8 probLuma16x16PredMode[4];
  71. u8 probChromaPredMode[3];
  72. u8 probMvContext[2][VP8_MV_PROBS_PER_COMPONENT];
  73. u8 probCoeffs[4][8][3][11];
  74. } vp8EntropyProbs_t;
  75. typedef struct vp8Decoder_s
  76. {
  77. u32 decMode;
  78. /* Current frame dimensions */
  79. u32 width;
  80. u32 height;
  81. u32 scaledWidth;
  82. u32 scaledHeight;
  83. u32 vpVersion;
  84. u32 vpProfile;
  85. u32 keyFrame;
  86. u32 coeffSkipMode;
  87. /* DCT coefficient partitions */
  88. u32 offsetToDctParts;
  89. u32 nbrDctPartitions;
  90. u32 dctPartitionOffsets[MAX_NBR_OF_DCT_PARTITIONS];
  91. vpColorSpace_e colorSpace;
  92. u32 clamping;
  93. u32 showFrame;
  94. u32 refreshGolden;
  95. u32 refreshAlternate;
  96. u32 refreshLast;
  97. u32 refreshEntropyProbs;
  98. u32 copyBufferToGolden;
  99. u32 copyBufferToAlternate;
  100. u32 refFrameSignBias[2];
  101. u32 useAsReference;
  102. u32 loopFilterType;
  103. u32 loopFilterLevel;
  104. u32 loopFilterSharpness;
  105. /* Quantization parameters */
  106. i32 qpYAc, qpYDc, qpY2Ac, qpY2Dc, qpChAc, qpChDc;
  107. /* From here down, frame-to-frame persisting stuff */
  108. u32 vp7ScanOrder[16];
  109. u32 vp7PrevScanOrder[16];
  110. /* Probabilities */
  111. u32 probIntra;
  112. u32 probRefLast;
  113. u32 probRefGolden;
  114. u32 probMbSkipFalse;
  115. u32 probSegment[3];
  116. vp8EntropyProbs_t entropy,
  117. entropyLast;
  118. /* Segment and macroblock specific values */
  119. u32 segmentationEnabled;
  120. u32 segmentationMapUpdate;
  121. u32 segmentFeatureMode; /* delta/abs */
  122. i32 segmentQp[MAX_NBR_OF_SEGMENTS];
  123. i32 segmentLoopfilter[MAX_NBR_OF_SEGMENTS];
  124. u32 modeRefLfEnabled;
  125. i32 mbRefLfDelta[MAX_NBR_OF_MB_REF_LF_DELTAS];
  126. i32 mbModeLfDelta[MAX_NBR_OF_MB_MODE_LF_DELTAS];
  127. u32 frameTagSize;
  128. /* Value to remember last frames prediction for hits into most
  129. * probable reference frame */
  130. u32 refbuPredHits;
  131. }
  132. vp8Decoder_t;
  133. struct DecAsicBuffers;
  134. void vp8hwdResetDecoder( vp8Decoder_t * dec, struct DecAsicBuffers *asicBuff );
  135. void vp8hwdPrepareVp7Scan( vp8Decoder_t * dec, u32 * newOrder );
  136. #endif /* __VP8_BOOL_H__ */