h264hwd_vui.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. -- Abstract : Decode Video Usability Information (VUI) from the stream
  17. --
  18. --------------------------------------------------------------------------------
  19. --
  20. -- Version control information, please leave untouched.
  21. --
  22. -- $RCSfile: h264hwd_vui.h,v $
  23. -- $Date: 2008/03/13 12:48:06 $
  24. -- $Revision: 1.1 $
  25. --
  26. ------------------------------------------------------------------------------*/
  27. /*------------------------------------------------------------------------------
  28. Table of contents
  29. 1. Include headers
  30. 2. Module defines
  31. 3. Data types
  32. 4. Function prototypes
  33. ------------------------------------------------------------------------------*/
  34. #ifndef H264HWD_VUI_H
  35. #define H264HWD_VUI_H
  36. /*------------------------------------------------------------------------------
  37. 1. Include headers
  38. ------------------------------------------------------------------------------*/
  39. #include "basetype.h"
  40. #include "h264hwd_stream.h"
  41. /*------------------------------------------------------------------------------
  42. 2. Module defines
  43. ------------------------------------------------------------------------------*/
  44. #define MAX_CPB_CNT 32
  45. /*------------------------------------------------------------------------------
  46. 3. Data types
  47. ------------------------------------------------------------------------------*/
  48. /* enumerated sample aspect ratios, ASPECT_RATIO_M_N means M:N */
  49. enum
  50. {
  51. ASPECT_RATIO_UNSPECIFIED = 0,
  52. ASPECT_RATIO_1_1,
  53. ASPECT_RATIO_12_11,
  54. ASPECT_RATIO_10_11,
  55. ASPECT_RATIO_16_11,
  56. ASPECT_RATIO_40_33,
  57. ASPECT_RATIO_24_11,
  58. ASPECT_RATIO_20_11,
  59. ASPECT_RATIO_32_11,
  60. ASPECT_RATIO_80_33,
  61. ASPECT_RATIO_18_11,
  62. ASPECT_RATIO_15_11,
  63. ASPECT_RATIO_64_33,
  64. ASPECT_RATIO_160_99,
  65. ASPECT_RATIO_EXTENDED_SAR = 255
  66. };
  67. /* structure to store Hypothetical Reference Decoder (HRD) parameters */
  68. typedef struct
  69. {
  70. u32 cpbCnt;
  71. u32 bitRateScale;
  72. u32 cpbSizeScale;
  73. u32 bitRateValue[MAX_CPB_CNT];
  74. u32 cpbSizeValue[MAX_CPB_CNT];
  75. u32 cbrFlag[MAX_CPB_CNT];
  76. u32 initialCpbRemovalDelayLength;
  77. u32 cpbRemovalDelayLength;
  78. u32 dpbOutputDelayLength;
  79. u32 timeOffsetLength;
  80. } hrdParameters_t;
  81. /* storage for VUI parameters */
  82. typedef struct
  83. {
  84. u32 aspectRatioPresentFlag;
  85. u32 aspectRatioIdc;
  86. u32 sarWidth;
  87. u32 sarHeight;
  88. u32 overscanInfoPresentFlag;
  89. u32 overscanAppropriateFlag;
  90. u32 videoSignalTypePresentFlag;
  91. u32 videoFormat;
  92. u32 videoFullRangeFlag;
  93. u32 colourDescriptionPresentFlag;
  94. u32 colourPrimaries;
  95. u32 transferCharacteristics;
  96. u32 matrixCoefficients;
  97. u32 chromaLocInfoPresentFlag;
  98. u32 chromaSampleLocTypeTopField;
  99. u32 chromaSampleLocTypeBottomField;
  100. u32 timingInfoPresentFlag;
  101. u32 numUnitsInTick;
  102. u32 timeScale;
  103. u32 fixedFrameRateFlag;
  104. u32 nalHrdParametersPresentFlag;
  105. hrdParameters_t nalHrdParameters;
  106. u32 vclHrdParametersPresentFlag;
  107. hrdParameters_t vclHrdParameters;
  108. u32 lowDelayHrdFlag;
  109. u32 picStructPresentFlag;
  110. u32 bitstreamRestrictionFlag;
  111. u32 motionVectorsOverPicBoundariesFlag;
  112. u32 maxBytesPerPicDenom;
  113. u32 maxBitsPerMbDenom;
  114. u32 log2MaxMvLengthHorizontal;
  115. u32 log2MaxMvLengthVertical;
  116. u32 numReorderFrames;
  117. u32 maxDecFrameBuffering;
  118. } vuiParameters_t;
  119. /*------------------------------------------------------------------------------
  120. 4. Function prototypes
  121. ------------------------------------------------------------------------------*/
  122. u32 h264bsdDecodeVuiParameters(strmData_t *pStrmData,
  123. vuiParameters_t *pVuiParameters);
  124. #endif /* #ifdef H264HWD_VUI_H */