rvdecapi.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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 2007 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 : API for the 8190 RV Decoder
  17. --
  18. --------------------------------------------------------------------------------
  19. --
  20. -- Version control information, please leave untouched.
  21. --
  22. -- $RCSfile: rvdecapi.h,v $
  23. -- $Date: 2010/03/23 10:41:36 $
  24. -- $Revision: 1.7 $
  25. --
  26. ------------------------------------------------------------------------------*/
  27. #ifndef __RVDECAPI_H__
  28. #define __RVDECAPI_H__
  29. #ifdef __cplusplus
  30. extern "C"
  31. {
  32. #endif
  33. #include "basetype.h"
  34. #include "decapicommon.h"
  35. /*------------------------------------------------------------------------------
  36. API type definitions
  37. ------------------------------------------------------------------------------*/
  38. /* Return values */
  39. typedef enum
  40. {
  41. RVDEC_OK = 0,
  42. RVDEC_STRM_PROCESSED = 1,
  43. RVDEC_PIC_RDY = 2,
  44. RVDEC_HDRS_RDY = 3,
  45. RVDEC_HDRS_NOT_RDY = 4,
  46. RVDEC_PIC_DECODED = 5,
  47. RVDEC_PARAM_ERROR = -1,
  48. RVDEC_STRM_ERROR = -2,
  49. RVDEC_NOT_INITIALIZED = -3,
  50. RVDEC_MEMFAIL = -4,
  51. RVDEC_INITFAIL = -5,
  52. RVDEC_STREAM_NOT_SUPPORTED = -8,
  53. RVDEC_HW_RESERVED = -254,
  54. RVDEC_HW_TIMEOUT = -255,
  55. RVDEC_HW_BUS_ERROR = -256,
  56. RVDEC_SYSTEM_ERROR = -257,
  57. RVDEC_DWL_ERROR = -258,
  58. RVDEC_FORMAT_NOT_SUPPORTED = -1000
  59. } RvDecRet;
  60. /* decoder output picture format */
  61. typedef enum
  62. {
  63. RVDEC_SEMIPLANAR_YUV420 = 0x020001,
  64. RVDEC_TILED_YUV420 = 0x020002
  65. } RvDecOutFormat;
  66. typedef struct
  67. {
  68. u32 *pVirtualAddress;
  69. u32 busAddress;
  70. } RvDecLinearMem;
  71. /* Decoder instance */
  72. typedef void *RvDecInst;
  73. typedef struct
  74. {
  75. u32 offset;
  76. u32 isValid;
  77. } RvDecSliceInfo;
  78. /* Input structure */
  79. typedef struct
  80. {
  81. u8 *pStream; /* Pointer to stream to be decoded */
  82. u32 streamBusAddress; /* DMA bus address of the input stream */
  83. u32 dataLen; /* Number of bytes to be decoded */
  84. u32 picId;
  85. u32 timestamp; /* timestamp of current picture from rv frame header.
  86. * NOTE: timestamp of a B-frame should be adjusted referring
  87. * to its forward reference frame's timestamp */
  88. u32 sliceInfoNum; /* The number of slice offset entries. */
  89. RvDecSliceInfo *pSliceInfo; /* Pointer to the sliceInfo.
  90. * It contains offset value of each slice
  91. * in the data buffer, including start point "0"
  92. * and end point "dataLen" */
  93. } RvDecInput;
  94. /* Time code */
  95. typedef struct
  96. {
  97. u32 hours;
  98. u32 minutes;
  99. u32 seconds;
  100. u32 pictures;
  101. } RvDecTime;
  102. typedef struct
  103. {
  104. u8 *pStrmCurrPos;
  105. u32 strmCurrBusAddress; /* DMA bus address location where the decoding
  106. * ended */
  107. u32 dataLeft;
  108. u32 picId; /* Identifier of the picture (in enc/dec order) */
  109. u32 picType; /* picture coding type */
  110. u32 timestamp; /* timestamp for media player */
  111. u32 picWidth; /* Pixel width, up round */
  112. u32 picHeight; /* Pixel height, up round */
  113. RvDecOutFormat outputFormat; /* format of the output picture */
  114. } RvDecOutput;
  115. /* stream info filled by RvDecGetInfo */
  116. typedef struct
  117. {
  118. u32 frameWidth;
  119. u32 frameHeight;
  120. u32 codedWidth;
  121. u32 codedHeight;
  122. u32 profileAndLevelIndication;
  123. u32 sampleAspectRatio;
  124. u32 DisplayAspectRatio;
  125. u32 streamFormat;
  126. u32 videoFormat;
  127. u32 videoRange; /* ??? only [0-255] */
  128. u32 interlacedSequence;
  129. u32 multiBuffPpSize;
  130. RvDecOutFormat outputFormat;
  131. } RvDecInfo;
  132. typedef struct
  133. {
  134. u8 *pOutputPicture;
  135. u32 outputPictureBusAddress;
  136. u32 frameWidth;
  137. u32 frameHeight;
  138. u32 codedWidth;
  139. u32 codedHeight;
  140. u32 keyPicture;
  141. u32 picId;
  142. u32 interlaced;
  143. u32 fieldPicture;
  144. u32 topField;
  145. u32 firstField;
  146. u32 repeatFirstField;
  147. u32 repeatFrameCount;
  148. u32 numberOfErrMBs;
  149. RvDecTime timeCode;
  150. } RvDecPicture;
  151. /* Version information */
  152. typedef struct
  153. {
  154. u32 major; /* API major version */
  155. u32 minor; /* API minor version */
  156. } RvDecApiVersion;
  157. typedef struct
  158. {
  159. u32 swBuild; /* Software build ID */
  160. u32 hwBuild; /* Hardware build ID */
  161. DecHwConfig hwConfig; /* hardware supported configuration */
  162. } RvDecBuild;
  163. /*------------------------------------------------------------------------------
  164. Prototypes of Decoder API functions
  165. ------------------------------------------------------------------------------*/
  166. RvDecApiVersion RvDecGetAPIVersion(void);
  167. RvDecBuild RvDecGetBuild(void);
  168. RvDecRet RvDecInit(RvDecInst * pDecInst,
  169. u32 useVideoFreezeConcealment,
  170. u32 frameCodeLength,
  171. u32 *frameSizes,
  172. u32 rvVersion,
  173. u32 maxFrameWidth, u32 maxFrameHeight,
  174. u32 numFrameBuffers );
  175. RvDecRet RvDecDecode(RvDecInst decInst,
  176. RvDecInput * pInput,
  177. RvDecOutput * pOutput);
  178. RvDecRet RvDecGetInfo(RvDecInst decInst, RvDecInfo * pDecInfo);
  179. RvDecRet RvDecNextPicture(RvDecInst decInst,
  180. RvDecPicture * pPicture,
  181. u32 endOfStream);
  182. void RvDecRelease(RvDecInst decInst);
  183. RvDecRet RvDecPeek(RvDecInst decInst, RvDecPicture * pPicture);
  184. /*------------------------------------------------------------------------------
  185. Prototype of the API trace funtion. Traces all API entries and returns.
  186. This must be implemented by the application using the decoder API!
  187. Argument:
  188. string - trace message, a null terminated string
  189. ------------------------------------------------------------------------------*/
  190. void RvDecTrace(const char *string);
  191. #ifdef __cplusplus
  192. }
  193. #endif
  194. #endif /* __RVDECAPI_H__ */