PageRenderTime 35ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/H264Dec/source/h264bsd_dpb.h

http://github.com/mbebenita/Broadway
C Header | 149 lines | 84 code | 24 blank | 41 comment | 0 complexity | c2c9bc48bf079fbdaacaf8abf360da94 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_DPB_H
  24. #define H264SWDEC_DPB_H
  25. /*------------------------------------------------------------------------------
  26. 1. Include headers
  27. ------------------------------------------------------------------------------*/
  28. #include "basetype.h"
  29. #include "h264bsd_slice_header.h"
  30. #include "h264bsd_image.h"
  31. /*------------------------------------------------------------------------------
  32. 2. Module defines
  33. ------------------------------------------------------------------------------*/
  34. /*------------------------------------------------------------------------------
  35. 3. Data types
  36. ------------------------------------------------------------------------------*/
  37. /* enumeration to represent status of buffered image */
  38. typedef enum {
  39. UNUSED = 0,
  40. NON_EXISTING,
  41. SHORT_TERM,
  42. LONG_TERM
  43. } dpbPictureStatus_e;
  44. /* structure to represent a buffered picture */
  45. typedef struct {
  46. u8 *data; /* 16-byte aligned pointer of pAllocatedData */
  47. u8 *pAllocatedData; /* allocated picture pointer; (size + 15) bytes */
  48. i32 picNum;
  49. u32 frameNum;
  50. i32 picOrderCnt;
  51. dpbPictureStatus_e status;
  52. u32 toBeDisplayed;
  53. u32 picId;
  54. u32 numErrMbs;
  55. u32 isIdr;
  56. } dpbPicture_t;
  57. /* structure to represent display image output from the buffer */
  58. typedef struct {
  59. u8 *data;
  60. u32 picId;
  61. u32 numErrMbs;
  62. u32 isIdr;
  63. } dpbOutPicture_t;
  64. /* structure to represent DPB */
  65. typedef struct {
  66. dpbPicture_t *buffer;
  67. dpbPicture_t **list;
  68. dpbPicture_t *currentOut;
  69. dpbOutPicture_t *outBuf;
  70. u32 numOut;
  71. u32 outIndex;
  72. u32 maxRefFrames;
  73. u32 dpbSize;
  74. u32 maxFrameNum;
  75. u32 maxLongTermFrameIdx;
  76. u32 numRefFrames;
  77. u32 fullness;
  78. u32 prevRefFrameNum;
  79. u32 lastContainsMmco5;
  80. u32 noReordering;
  81. u32 flushed;
  82. } dpbStorage_t;
  83. /*------------------------------------------------------------------------------
  84. 4. Function prototypes
  85. ------------------------------------------------------------------------------*/
  86. u32 h264bsdInitDpb(
  87. dpbStorage_t *dpb,
  88. u32 picSizeInMbs,
  89. u32 dpbSize,
  90. u32 numRefFrames,
  91. u32 maxFrameNum,
  92. u32 noReordering);
  93. u32 h264bsdResetDpb(
  94. dpbStorage_t *dpb,
  95. u32 picSizeInMbs,
  96. u32 dpbSize,
  97. u32 numRefFrames,
  98. u32 maxFrameNum,
  99. u32 noReordering);
  100. void h264bsdInitRefPicList(dpbStorage_t *dpb);
  101. u8* h264bsdAllocateDpbImage(dpbStorage_t *dpb);
  102. u8* h264bsdGetRefPicData(dpbStorage_t *dpb, u32 index);
  103. u32 h264bsdReorderRefPicList(
  104. dpbStorage_t *dpb,
  105. refPicListReordering_t *order,
  106. u32 currFrameNum,
  107. u32 numRefIdxActive);
  108. u32 h264bsdMarkDecRefPic(
  109. dpbStorage_t *dpb,
  110. decRefPicMarking_t *mark,
  111. image_t *image,
  112. u32 frameNum,
  113. i32 picOrderCnt,
  114. u32 isIdr,
  115. u32 picId,
  116. u32 numErrMbs);
  117. u32 h264bsdCheckGapsInFrameNum(dpbStorage_t *dpb, u32 frameNum, u32 isRefPic,
  118. u32 gapsAllowed);
  119. dpbOutPicture_t* h264bsdDpbOutputPicture(dpbStorage_t *dpb);
  120. void h264bsdFlushDpb(dpbStorage_t *dpb);
  121. void h264bsdFreeDpb(dpbStorage_t *dpb);
  122. #endif /* #ifdef H264SWDEC_DPB_H */