vp6decapi.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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 : VP6 Decoder API
  17. -
  18. --------------------------------------------------------------------------------
  19. -
  20. - Version control information, please leave untouched.
  21. -
  22. - $RCSfile: vp6decapi.h,v $
  23. - $Revision: 1.7 $
  24. - $Date: 2010/02/25 12:30:19 $
  25. -
  26. ------------------------------------------------------------------------------*/
  27. #ifndef __VP6DECAPI_H__
  28. #define __VP6DECAPI_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 VP6DecRet_
  40. {
  41. VP6DEC_OK = 0,
  42. VP6DEC_STRM_PROCESSED = 1,
  43. VP6DEC_PIC_RDY = 2,
  44. VP6DEC_PIC_DECODED = 3,
  45. VP6DEC_HDRS_RDY = 4,
  46. VP6DEC_ADVANCED_TOOLS = 5,
  47. VP6DEC_PARAM_ERROR = -1,
  48. VP6DEC_STRM_ERROR = -2,
  49. VP6DEC_NOT_INITIALIZED = -3,
  50. VP6DEC_MEMFAIL = -4,
  51. VP6DEC_INITFAIL = -5,
  52. VP6DEC_HDRS_NOT_RDY = -6,
  53. VP6DEC_STREAM_NOT_SUPPORTED = -8,
  54. VP6DEC_HW_RESERVED = -254,
  55. VP6DEC_HW_TIMEOUT = -255,
  56. VP6DEC_HW_BUS_ERROR = -256,
  57. VP6DEC_SYSTEM_ERROR = -257,
  58. VP6DEC_DWL_ERROR = -258,
  59. VP6DEC_EVALUATION_LIMIT_EXCEEDED = -999,
  60. VP6DEC_FORMAT_NOT_SUPPORTED = -1000
  61. } VP6DecRet;
  62. /* decoder output Frame format */
  63. typedef enum VP6DecOutFormat_
  64. {
  65. VP6DEC_SEMIPLANAR_YUV420 = 0x020001,
  66. VP6DEC_TILED_YUV420 = 0x020002
  67. } VP6DecOutFormat;
  68. /* Input structure */
  69. typedef struct VP6DecInput_
  70. {
  71. const u8 *pStream; /* Pointer to the input data */
  72. u32 streamBusAddress; /* DMA bus address of the input stream */
  73. u32 dataLen; /* Number of bytes to be decoded */
  74. } VP6DecInput;
  75. /* Output structure */
  76. typedef struct VP6DecOutput_
  77. {
  78. u32 reserved;
  79. } VP6DecOutput;
  80. #define VP6_SCALE_MAINTAIN_ASPECT_RATIO 0
  81. #define VP6_SCALE_TO_FIT 1
  82. #define VP6_SCALE_CENTER 2
  83. #define VP6_SCALE_OTHER 3
  84. /* stream info filled by VP6DecGetInfo */
  85. typedef struct VP6DecInfo_
  86. {
  87. u32 vp6Version;
  88. u32 vp6Profile;
  89. u32 width; /* coded width */
  90. u32 height; /* coded height */
  91. u32 scaledWidth; /* width of the displayed video */
  92. u32 scaledHeight; /* height of the displayed video */
  93. u32 scalingMode; /* way to scale the frame to output */
  94. VP6DecOutFormat outputFormat; /* format of the output frame */
  95. } VP6DecInfo;
  96. /* Version information */
  97. typedef struct VP6DecApiVersion_
  98. {
  99. u32 major; /* API major version */
  100. u32 minor; /* API minor version */
  101. } VP6DecApiVersion;
  102. typedef struct VP6DecBuild_
  103. {
  104. u32 swBuild; /* Software build ID */
  105. u32 hwBuild; /* Hardware build ID */
  106. DecHwConfig hwConfig; /* hardware supported configuration */
  107. } VP6DecBuild;
  108. /* Output structure for VP6DecNextPicture */
  109. typedef struct VP6DecPicture_
  110. {
  111. u32 picWidth; /* pixels width of the frame as stored in memory */
  112. u32 picHeight; /* pixel height of the frame as stored in memory */
  113. const u32 *pOutputFrame; /* Pointer to the frame */
  114. u32 outputFrameBusAddress; /* DMA bus address of the output frame buffer */
  115. u32 picId; /* Identifier of the Frame to be displayed */
  116. u32 isIntraFrame; /* Indicates if Frame is an Intra Frame */
  117. u32 isGoldenFrame; /* Indicates if Frame is a Golden reference Frame */
  118. u32 nbrOfErrMBs; /* Number of concealed MB's in the frame */
  119. } VP6DecPicture;
  120. /* Decoder instance */
  121. typedef const void *VP6DecInst;
  122. /*------------------------------------------------------------------------------
  123. Prototypes of Decoder API functions
  124. ------------------------------------------------------------------------------*/
  125. VP6DecApiVersion VP6DecGetAPIVersion(void);
  126. VP6DecBuild VP6DecGetBuild(void);
  127. VP6DecRet VP6DecInit(VP6DecInst * pDecInst,
  128. u32 useVideoFreezeConcealment,
  129. u32 numFrameBuffers );
  130. void VP6DecRelease(VP6DecInst decInst);
  131. VP6DecRet VP6DecDecode(VP6DecInst decInst,
  132. const VP6DecInput * pInput, VP6DecOutput * pOutput);
  133. VP6DecRet VP6DecNextPicture(VP6DecInst decInst,
  134. VP6DecPicture * pOutput, u32 endOfStream);
  135. VP6DecRet VP6DecGetInfo(VP6DecInst decInst, VP6DecInfo * pDecInfo);
  136. VP6DecRet VP6DecPeek(VP6DecInst decInst, VP6DecPicture * pOutput);
  137. /*------------------------------------------------------------------------------
  138. Prototype of the API trace funtion. Traces all API entries and returns.
  139. This must be implemented by the application using the decoder API!
  140. Argument:
  141. string - trace message, a null terminated string
  142. ------------------------------------------------------------------------------*/
  143. void VP6DecTrace(const char *string);
  144. #ifdef __cplusplus
  145. }
  146. #endif
  147. #endif /* __VP6DECAPI_H__ */