PageRenderTime 81ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/H264Dec/source/h264bsd_sei.h

http://github.com/mbebenita/Broadway
C Header | 252 lines | 185 code | 30 blank | 37 comment | 0 complexity | fd6918a22e928a01af46e6d57d7d19e1 MD5 | raw file
Possible License(s): BSD-3-Clause
  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_SEI_H
  24. #define H264SWDEC_SEI_H
  25. /*------------------------------------------------------------------------------
  26. 1. Include headers
  27. ------------------------------------------------------------------------------*/
  28. #include "basetype.h"
  29. #include "h264bsd_stream.h"
  30. #include "h264bsd_slice_header.h"
  31. #include "h264bsd_seq_param_set.h"
  32. #include "h264bsd_vui.h"
  33. /*------------------------------------------------------------------------------
  34. 2. Module defines
  35. ------------------------------------------------------------------------------*/
  36. #define MAX_PAN_SCAN_CNT 32
  37. #define MAX_NUM_SPARE_PICS 16
  38. #define MAX_NUM_CLOCK_TS 3
  39. #define MAX_NUM_SUB_SEQ_LAYERS 256
  40. /*------------------------------------------------------------------------------
  41. 3. Data types
  42. ------------------------------------------------------------------------------*/
  43. typedef struct
  44. {
  45. u32 seqParameterSetId;
  46. u32 initialCpbRemovalDelay[MAX_CPB_CNT];
  47. u32 initialCpbRemovalDelayOffset[MAX_CPB_CNT];
  48. } seiBufferingPeriod_t;
  49. typedef struct
  50. {
  51. u32 cpbRemovalDelay;
  52. u32 dpbOutputDelay;
  53. u32 picStruct;
  54. u32 clockTimeStampFlag[MAX_NUM_CLOCK_TS];
  55. u32 clockTimeStamp[MAX_NUM_CLOCK_TS];
  56. u32 ctType[MAX_NUM_CLOCK_TS];
  57. u32 nuitFieldBasedFlag[MAX_NUM_CLOCK_TS];
  58. u32 countingType[MAX_NUM_CLOCK_TS];
  59. u32 fullTimeStampFlag[MAX_NUM_CLOCK_TS];
  60. u32 discontinuityFlag[MAX_NUM_CLOCK_TS];
  61. u32 cntDroppedFlag[MAX_NUM_CLOCK_TS];
  62. u32 nFrames[MAX_NUM_CLOCK_TS];
  63. u32 secondsFlag[MAX_NUM_CLOCK_TS];
  64. u32 secondsValue[MAX_NUM_CLOCK_TS];
  65. u32 minutesFlag[MAX_NUM_CLOCK_TS];
  66. u32 minutesValue[MAX_NUM_CLOCK_TS];
  67. u32 hoursFlag[MAX_NUM_CLOCK_TS];
  68. u32 hoursValue[MAX_NUM_CLOCK_TS];
  69. i32 timeOffset[MAX_NUM_CLOCK_TS];
  70. } seiPicTiming_t;
  71. typedef struct
  72. {
  73. u32 panScanRectId;
  74. u32 panScanRectCancelFlag;
  75. u32 panScanCnt;
  76. i32 panScanRectLeftOffset[MAX_PAN_SCAN_CNT];
  77. i32 panScanRectRightOffset[MAX_PAN_SCAN_CNT];
  78. i32 panScanRectTopOffset[MAX_PAN_SCAN_CNT];
  79. i32 panScanRectBottomOffset[MAX_PAN_SCAN_CNT];
  80. u32 panScanRectRepetitionPeriod;
  81. } seiPanScanRect_t;
  82. typedef struct
  83. {
  84. u32 ituTT35CountryCode;
  85. u32 ituTT35CountryCodeExtensionByte;
  86. u8 *ituTT35PayloadByte;
  87. u32 numPayloadBytes;
  88. } seiUserDataRegisteredItuTT35_t;
  89. typedef struct
  90. {
  91. u32 uuidIsoIec11578[4];
  92. u8 *userDataPayloadByte;
  93. u32 numPayloadBytes;
  94. } seiUserDataUnregistered_t;
  95. typedef struct
  96. {
  97. u32 recoveryFrameCnt;
  98. u32 exactMatchFlag;
  99. u32 brokenLinkFlag;
  100. u32 changingSliceGroupIdc;
  101. } seiRecoveryPoint_t;
  102. typedef struct
  103. {
  104. u32 originalIdrFlag;
  105. u32 originalFrameNum;
  106. decRefPicMarking_t decRefPicMarking;
  107. } seiDecRefPicMarkingRepetition_t;
  108. typedef struct
  109. {
  110. u32 targetFrameNum;
  111. u32 spareFieldFlag;
  112. u32 targetBottomFieldFlag;
  113. u32 numSparePics;
  114. u32 deltaSpareFrameNum[MAX_NUM_SPARE_PICS];
  115. u32 spareBottomFieldFlag[MAX_NUM_SPARE_PICS];
  116. u32 spareAreaIdc[MAX_NUM_SPARE_PICS];
  117. u32 *spareUnitFlag[MAX_NUM_SPARE_PICS];
  118. u32 *zeroRunLength[MAX_NUM_SPARE_PICS];
  119. } seiSparePic_t;
  120. typedef struct
  121. {
  122. u32 sceneInfoPresentFlag;
  123. u32 sceneId;
  124. u32 sceneTransitionType;
  125. u32 secondSceneId;
  126. } seiSceneInfo_t;
  127. typedef struct
  128. {
  129. u32 subSeqLayerNum;
  130. u32 subSeqId;
  131. u32 firstRefPicFlag;
  132. u32 leadingNonRefPicFlag;
  133. u32 lastPicFlag;
  134. u32 subSeqFrameNumFlag;
  135. u32 subSeqFrameNum;
  136. } seiSubSeqInfo_t;
  137. typedef struct
  138. {
  139. u32 numSubSeqLayers;
  140. u32 accurateStatisticsFlag[MAX_NUM_SUB_SEQ_LAYERS];
  141. u32 averageBitRate[MAX_NUM_SUB_SEQ_LAYERS];
  142. u32 averageFrameRate[MAX_NUM_SUB_SEQ_LAYERS];
  143. } seiSubSeqLayerCharacteristics_t;
  144. typedef struct
  145. {
  146. u32 subSeqLayerNum;
  147. u32 subSeqId;
  148. u32 durationFlag;
  149. u32 subSeqDuration;
  150. u32 averageRateFlag;
  151. u32 accurateStatisticsFlag;
  152. u32 averageBitRate;
  153. u32 averageFrameRate;
  154. u32 numReferencedSubseqs;
  155. u32 refSubSeqLayerNum[MAX_NUM_SUB_SEQ_LAYERS];
  156. u32 refSubSeqId[MAX_NUM_SUB_SEQ_LAYERS];
  157. u32 refSubSeqDirection[MAX_NUM_SUB_SEQ_LAYERS];
  158. } seiSubSeqCharacteristics_t;
  159. typedef struct
  160. {
  161. u32 fullFrameFreezeRepetitionPeriod;
  162. } seiFullFrameFreeze_t;
  163. typedef struct
  164. {
  165. u32 snapShotId;
  166. } seiFullFrameSnapshot_t;
  167. typedef struct
  168. {
  169. u32 progressiveRefinementId;
  170. u32 numRefinementSteps;
  171. } seiProgressiveRefinementSegmentStart_t;
  172. typedef struct
  173. {
  174. u32 progressiveRefinementId;
  175. } seiProgressiveRefinementSegmentEnd_t;
  176. typedef struct
  177. {
  178. u32 numSliceGroupsInSet;
  179. u32 sliceGroupId[MAX_NUM_SLICE_GROUPS];
  180. u32 exactSampleValueMatchFlag;
  181. u32 panScanRectFlag;
  182. u32 panScanRectId;
  183. } seiMotionConstrainedSliceGroupSet_t;
  184. typedef struct
  185. {
  186. u8 *reservedSeiMessagePayloadByte;
  187. u32 numPayloadBytes;
  188. } seiReservedSeiMessage_t;
  189. typedef struct
  190. {
  191. u32 payloadType;
  192. seiBufferingPeriod_t bufferingPeriod;
  193. seiPicTiming_t picTiming;
  194. seiPanScanRect_t panScanRect;
  195. seiUserDataRegisteredItuTT35_t userDataRegisteredItuTT35;
  196. seiUserDataUnregistered_t userDataUnregistered;
  197. seiRecoveryPoint_t recoveryPoint;
  198. seiDecRefPicMarkingRepetition_t decRefPicMarkingRepetition;
  199. seiSparePic_t sparePic;
  200. seiSceneInfo_t sceneInfo;
  201. seiSubSeqInfo_t subSeqInfo;
  202. seiSubSeqLayerCharacteristics_t subSeqLayerCharacteristics;
  203. seiSubSeqCharacteristics_t subSeqCharacteristics;
  204. seiFullFrameFreeze_t fullFrameFreeze;
  205. seiFullFrameSnapshot_t fullFrameSnapshot;
  206. seiProgressiveRefinementSegmentStart_t progressiveRefinementSegmentStart;
  207. seiProgressiveRefinementSegmentEnd_t progressiveRefinementSegmentEnd;
  208. seiMotionConstrainedSliceGroupSet_t motionConstrainedSliceGroupSet;
  209. seiReservedSeiMessage_t reservedSeiMessage;
  210. } seiMessage_t;
  211. /*------------------------------------------------------------------------------
  212. 4. Function prototypes
  213. ------------------------------------------------------------------------------*/
  214. u32 h264bsdDecodeSeiMessage(
  215. strmData_t *pStrmData,
  216. seqParamSet_t *pSeqParamSet,
  217. seiMessage_t *pSeiMessage,
  218. u32 numSliceGroups);
  219. #endif /* #ifdef H264SWDEC_SEI_H */