/H264Dec/source/h264bsd_vui.h

http://github.com/mbebenita/Broadway · C Header · 130 lines · 76 code · 14 blank · 40 comment · 0 complexity · 6ecff05625817d9cf310fea59868b570 MD5 · raw file

  1. /*
  2. * Copyright (C) 2009 The Android Open Source Project
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /*------------------------------------------------------------------------------
  17. Table of contents
  18. 1. Include headers
  19. 2. Module defines
  20. 3. Data types
  21. 4. Function prototypes
  22. ------------------------------------------------------------------------------*/
  23. #ifndef H264SWDEC_VUI_H
  24. #define H264SWDEC_VUI_H
  25. /*------------------------------------------------------------------------------
  26. 1. Include headers
  27. ------------------------------------------------------------------------------*/
  28. #include "basetype.h"
  29. #include "h264bsd_stream.h"
  30. /*------------------------------------------------------------------------------
  31. 2. Module defines
  32. ------------------------------------------------------------------------------*/
  33. #define MAX_CPB_CNT 32
  34. /*------------------------------------------------------------------------------
  35. 3. Data types
  36. ------------------------------------------------------------------------------*/
  37. /* enumerated sample aspect ratios, ASPECT_RATIO_M_N means M:N */
  38. enum
  39. {
  40. ASPECT_RATIO_UNSPECIFIED = 0,
  41. ASPECT_RATIO_1_1,
  42. ASPECT_RATIO_12_11,
  43. ASPECT_RATIO_10_11,
  44. ASPECT_RATIO_16_11,
  45. ASPECT_RATIO_40_33,
  46. ASPECT_RATIO_24_11,
  47. ASPECT_RATIO_20_11,
  48. ASPECT_RATIO_32_11,
  49. ASPECT_RATIO_80_33,
  50. ASPECT_RATIO_18_11,
  51. ASPECT_RATIO_15_11,
  52. ASPECT_RATIO_64_33,
  53. ASPECT_RATIO_160_99,
  54. ASPECT_RATIO_EXTENDED_SAR = 255
  55. };
  56. /* structure to store Hypothetical Reference Decoder (HRD) parameters */
  57. typedef struct
  58. {
  59. u32 cpbCnt;
  60. u32 bitRateScale;
  61. u32 cpbSizeScale;
  62. u32 bitRateValue[MAX_CPB_CNT];
  63. u32 cpbSizeValue[MAX_CPB_CNT];
  64. u32 cbrFlag[MAX_CPB_CNT];
  65. u32 initialCpbRemovalDelayLength;
  66. u32 cpbRemovalDelayLength;
  67. u32 dpbOutputDelayLength;
  68. u32 timeOffsetLength;
  69. } hrdParameters_t;
  70. /* storage for VUI parameters */
  71. typedef struct
  72. {
  73. u32 aspectRatioPresentFlag;
  74. u32 aspectRatioIdc;
  75. u32 sarWidth;
  76. u32 sarHeight;
  77. u32 overscanInfoPresentFlag;
  78. u32 overscanAppropriateFlag;
  79. u32 videoSignalTypePresentFlag;
  80. u32 videoFormat;
  81. u32 videoFullRangeFlag;
  82. u32 colourDescriptionPresentFlag;
  83. u32 colourPrimaries;
  84. u32 transferCharacteristics;
  85. u32 matrixCoefficients;
  86. u32 chromaLocInfoPresentFlag;
  87. u32 chromaSampleLocTypeTopField;
  88. u32 chromaSampleLocTypeBottomField;
  89. u32 timingInfoPresentFlag;
  90. u32 numUnitsInTick;
  91. u32 timeScale;
  92. u32 fixedFrameRateFlag;
  93. u32 nalHrdParametersPresentFlag;
  94. hrdParameters_t nalHrdParameters;
  95. u32 vclHrdParametersPresentFlag;
  96. hrdParameters_t vclHrdParameters;
  97. u32 lowDelayHrdFlag;
  98. u32 picStructPresentFlag;
  99. u32 bitstreamRestrictionFlag;
  100. u32 motionVectorsOverPicBoundariesFlag;
  101. u32 maxBytesPerPicDenom;
  102. u32 maxBitsPerMbDenom;
  103. u32 log2MaxMvLengthHorizontal;
  104. u32 log2MaxMvLengthVertical;
  105. u32 numReorderFrames;
  106. u32 maxDecFrameBuffering;
  107. } vuiParameters_t;
  108. /*------------------------------------------------------------------------------
  109. 4. Function prototypes
  110. ------------------------------------------------------------------------------*/
  111. u32 h264bsdDecodeVuiParameters(strmData_t *pStrmData,
  112. vuiParameters_t *pVuiParameters);
  113. #endif /* #ifdef H264SWDEC_VUI_H */