coda9.h 4.3 KB

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