vp8decapi.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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 2008 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 : VP7/8 Decoder API
  17. -
  18. --------------------------------------------------------------------------------
  19. -
  20. - Version control information, please leave untouched.
  21. -
  22. - $RCSfile: vp8decapi.h,v $
  23. - $Revision: 1.8 $
  24. - $Date: 2010/12/13 13:04:01 $
  25. -
  26. ------------------------------------------------------------------------------*/
  27. #ifndef __VP8DECAPI_H__
  28. #define __VP8DECAPI_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 VP8DecRet_
  40. {
  41. VP8DEC_OK = 0,
  42. VP8DEC_STRM_PROCESSED = 1,
  43. VP8DEC_PIC_RDY = 2,
  44. VP8DEC_PIC_DECODED = 3,
  45. VP8DEC_HDRS_RDY = 4,
  46. VP8DEC_ADVANCED_TOOLS = 5,
  47. VP8DEC_SLICE_RDY = 6,
  48. VP8DEC_PARAM_ERROR = -1,
  49. VP8DEC_STRM_ERROR = -2,
  50. VP8DEC_NOT_INITIALIZED = -3,
  51. VP8DEC_MEMFAIL = -4,
  52. VP8DEC_INITFAIL = -5,
  53. VP8DEC_HDRS_NOT_RDY = -6,
  54. VP8DEC_STREAM_NOT_SUPPORTED = -8,
  55. VP8DEC_HW_RESERVED = -254,
  56. VP8DEC_HW_TIMEOUT = -255,
  57. VP8DEC_HW_BUS_ERROR = -256,
  58. VP8DEC_SYSTEM_ERROR = -257,
  59. VP8DEC_DWL_ERROR = -258,
  60. VP8DEC_EVALUATION_LIMIT_EXCEEDED = -999,
  61. VP8DEC_FORMAT_NOT_SUPPORTED = -1000
  62. } VP8DecRet;
  63. /* decoder output Frame format */
  64. typedef enum VP8DecOutFormat_
  65. {
  66. VP8DEC_SEMIPLANAR_YUV420 = 0x020001,
  67. VP8DEC_TILED_YUV420 = 0x020002
  68. } VP8DecOutFormat;
  69. /* decoder input stream format */
  70. typedef enum VP8DecFormat_
  71. {
  72. VP8DEC_VP7 = 0x01,
  73. VP8DEC_VP8 = 0x02,
  74. VP8DEC_WEBP = 0x03
  75. } VP8DecFormat;
  76. /* Input structure */
  77. typedef struct VP8DecInput_
  78. {
  79. const u8 *pStream; /* Pointer to the input data */
  80. u32 streamBusAddress; /* DMA bus address of the input stream */
  81. u32 dataLen; /* Number of bytes to be decoded */
  82. /* used only for WebP */
  83. u32 sliceHeight;
  84. u32 *pPicBufferY; /* luma output address ==> if user allocated */
  85. u32 picBufferBusAddressY;
  86. u32 *pPicBufferC; /* chroma output address ==> if user allocated */
  87. u32 picBufferBusAddressC;
  88. } VP8DecInput;
  89. /* Output structure */
  90. typedef struct VP8DecOutput_
  91. {
  92. u32 unused;
  93. } VP8DecOutput;
  94. #define VP8_SCALE_MAINTAIN_ASPECT_RATIO 0
  95. #define VP8_SCALE_TO_FIT 1
  96. #define VP8_SCALE_CENTER 2
  97. #define VP8_SCALE_OTHER 3
  98. /* stream info filled by VP8DecGetInfo */
  99. typedef struct VP8DecInfo_
  100. {
  101. u32 vpVersion;
  102. u32 vpProfile;
  103. u32 codedWidth; /* coded width */
  104. u32 codedHeight; /* coded height */
  105. u32 frameWidth; /* pixels width of the frame as stored in memory */
  106. u32 frameHeight; /* pixel height of the frame as stored in memory */
  107. u32 scaledWidth; /* scaled width of the displayed video */
  108. u32 scaledHeight; /* scaled height of the displayed video */
  109. VP8DecOutFormat outputFormat; /* format of the output frame */
  110. } VP8DecInfo;
  111. /* Version information */
  112. typedef struct VP8DecApiVersion_
  113. {
  114. u32 major; /* API major version */
  115. u32 minor; /* API minor version */
  116. } VP8DecApiVersion;
  117. typedef struct VP8DecBuild_
  118. {
  119. u32 swBuild; /* Software build ID */
  120. u32 hwBuild; /* Hardware build ID */
  121. DecHwConfig hwConfig; /* hardware supported configuration */
  122. } VP8DecBuild;
  123. /* Output structure for VP8DecNextPicture */
  124. typedef struct VP8DecPicture_
  125. {
  126. u32 codedWidth; /* coded width of the picture */
  127. u32 codedHeight; /* coded height of the picture */
  128. u32 frameWidth; /* pixels width of the frame as stored in memory */
  129. u32 frameHeight; /* pixel height of the frame as stored in memory */
  130. const u32 *pOutputFrame; /* Pointer to the frame */
  131. u32 outputFrameBusAddress; /* DMA bus address of the output frame buffer */
  132. const u32 *pOutputFrameC; /* Pointer to chroma output */
  133. u32 outputFrameBusAddressC;
  134. u32 picId; /* Identifier of the Frame to be displayed */
  135. u32 isIntraFrame; /* Indicates if Frame is an Intra Frame */
  136. u32 isGoldenFrame; /* Indicates if Frame is a Golden reference Frame */
  137. u32 nbrOfErrMBs; /* Number of concealed MB's in the frame */
  138. u32 numSliceRows;
  139. DecOutFrmFormat outputFormat;
  140. } VP8DecPicture;
  141. /* Decoder instance */
  142. typedef const void *VP8DecInst;
  143. /*------------------------------------------------------------------------------
  144. Prototypes of Decoder API functions
  145. ------------------------------------------------------------------------------*/
  146. VP8DecApiVersion VP8DecGetAPIVersion(void);
  147. VP8DecBuild VP8DecGetBuild(void);
  148. VP8DecRet VP8DecInit(VP8DecInst * pDecInst, VP8DecFormat decFormat,
  149. u32 useVideoFreezeConcealment,
  150. u32 numFrameBuffers,
  151. DecRefFrmFormat referenceFrameFormat );
  152. void VP8DecRelease(VP8DecInst decInst);
  153. VP8DecRet VP8DecDecode(VP8DecInst decInst,
  154. const VP8DecInput * pInput, VP8DecOutput * pOutput);
  155. VP8DecRet VP8DecNextPicture(VP8DecInst decInst,
  156. VP8DecPicture * pOutput, u32 endOfStream);
  157. VP8DecRet VP8DecGetInfo(VP8DecInst decInst, VP8DecInfo * pDecInfo);
  158. VP8DecRet VP8DecPeek(VP8DecInst decInst, VP8DecPicture * pOutput);
  159. /*------------------------------------------------------------------------------
  160. Prototype of the API trace funtion. Traces all API entries and returns.
  161. This must be implemented by the application using the decoder API!
  162. Argument:
  163. string - trace message, a null terminated string
  164. ------------------------------------------------------------------------------*/
  165. void VP8DecTrace(const char *string);
  166. #ifdef __cplusplus
  167. }
  168. #endif
  169. #endif /* __VP8DECAPI_H__ */