coda9.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /*
  2. * Copyright (c) 2019, Chips&Media
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright notice, this
  9. * list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright notice,
  11. * this list of conditions and the following disclaimer in the documentation
  12. * and/or other materials provided with the distribution.
  13. *
  14. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  15. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  16. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  17. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
  18. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  19. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  20. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  21. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  23. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. #ifndef __CODA9_FUNCTION_H__
  26. #define __CODA9_FUNCTION_H__
  27. #ifdef USE_FEEDING_METHOD_BUFFER
  28. #include "wave511/vpuapi/vpuapi.h"
  29. #include "wave511/vpuapi/product.h"
  30. #else
  31. #include "vpuapi.h"
  32. #include "../product.h"
  33. #endif
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif /* __cplusplus */
  37. extern void
  38. Coda9BitIssueCommand(
  39. Uint32 coreIdx,
  40. CodecInst* inst,
  41. int cmd
  42. );
  43. extern Uint32 Coda9VpuGetProductId(
  44. Uint32 coreIdx
  45. );
  46. extern RetCode Coda9VpuGetVersion(
  47. Uint32 coreIdx,
  48. Uint32* versionInfo,
  49. Uint32* revision
  50. );
  51. extern RetCode Coda9VpuInit(
  52. Uint32 coreIdx,
  53. void* firmware,
  54. Uint32 size
  55. );
  56. extern RetCode Coda9VpuReInit(
  57. Uint32 coreIdx,
  58. void* firmware,
  59. Uint32 size
  60. );
  61. extern Uint32 Coda9VpuIsInit(
  62. Uint32 coreIdx
  63. );
  64. extern Int32 Coda9VpuIsBusy(
  65. Uint32 coreIdx
  66. );
  67. extern Int32 Coda9VpuWaitInterrupt(
  68. CodecInst* handle,
  69. Int32 timeout
  70. );
  71. extern RetCode Coda9VpuReset(
  72. Uint32 coreIdx,
  73. SWResetMode resetMode
  74. );
  75. extern RetCode Coda9VpuSleepWake(
  76. Uint32 coreIdx,
  77. int iSleepWake,
  78. const Uint16* code,
  79. Uint32 size
  80. );
  81. extern RetCode Coda9VpuClearInterrupt(
  82. Uint32 coreIdx
  83. );
  84. extern RetCode Coda9VpuFiniSeq(
  85. CodecInst* instance
  86. );
  87. extern RetCode Coda9VpuBuildUpDecParam(
  88. CodecInst* instance,
  89. DecOpenParam* param
  90. );
  91. extern RetCode Coda9VpuDecInitSeq(
  92. DecHandle handle
  93. );
  94. extern RetCode Coda9VpuDecRegisterFramebuffer(
  95. CodecInst* instance
  96. );
  97. extern RetCode Coda9VpuDecSetBitstreamFlag(
  98. CodecInst* instance,
  99. BOOL running,
  100. BOOL eos
  101. );
  102. extern RetCode Coda9VpuDecGetSeqInfo(
  103. CodecInst* instance,
  104. DecInitialInfo* info
  105. );
  106. extern RetCode Coda9VpuDecode(
  107. CodecInst* instance,
  108. DecParam* option
  109. );
  110. extern RetCode Coda9VpuDecGetResult(
  111. CodecInst* instance,
  112. DecOutputInfo* result
  113. );
  114. extern RetCode Coda9VpuDecFlush(
  115. CodecInst* instance,
  116. FramebufferIndex* framebufferIndexes,
  117. Uint32 size
  118. );
  119. /************************************************************************/
  120. /* Encoder */
  121. /************************************************************************/
  122. extern RetCode Coda9VpuEncRegisterFramebuffer(
  123. CodecInst* instance
  124. );
  125. extern RetCode Coda9VpuBuildUpEncParam(
  126. CodecInst* pCodec,
  127. EncOpenParam* param
  128. );
  129. extern RetCode Coda9VpuEncSetup(
  130. CodecInst* instance
  131. );
  132. extern RetCode Coda9VpuEncode(
  133. CodecInst* pCodecInst,
  134. EncParam* param
  135. );
  136. extern RetCode Coda9VpuEncGetResult(
  137. CodecInst* pCodecInst,
  138. EncOutputInfo* info
  139. );
  140. extern RetCode Coda9VpuEncGiveCommand(
  141. CodecInst* pCodecInst,
  142. CodecCommand cmd,
  143. void* param
  144. );
  145. #ifdef __cplusplus
  146. }
  147. #endif /* __cplusplus */
  148. #endif /* __CODA9_FUNCTION_H__ */