hi_common.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. /******************************************************************************
  2. Copyright (C), 2016, Hisilicon Tech. Co., Ltd.
  3. ******************************************************************************
  4. File Name : hi_common.h
  5. Version : Initial Draft
  6. Author : Hisilicon multimedia software group
  7. Created : 2016/07/15
  8. Last Modified :
  9. Description : The common defination
  10. Function List :
  11. ******************************************************************************/
  12. #ifndef __HI_COMMON_H__
  13. #define __HI_COMMON_H__
  14. #include "hi_type.h"
  15. //#include "hi_math.h"
  16. #include "hi_defines.h"
  17. #ifndef __IGNORE_HWSEC__
  18. #ifndef __KERNEL__
  19. #include "hi_securec.h"
  20. #endif
  21. #ifdef __LITEOS__
  22. #include "hi_securec.h"
  23. #endif
  24. #endif
  25. #ifdef __cplusplus
  26. #if __cplusplus
  27. extern "C" {
  28. #endif
  29. #endif /* End of #ifdef __cplusplus */
  30. #ifndef VER_X
  31. #define VER_X 1
  32. #endif
  33. #ifndef VER_Y
  34. #define VER_Y 0
  35. #endif
  36. #ifndef VER_Z
  37. #define VER_Z 0
  38. #endif
  39. #ifndef VER_P
  40. #define VER_P 0
  41. #endif
  42. #ifndef VER_B
  43. #define VER_B 0
  44. #endif
  45. #ifdef HI_DEBUG
  46. #define VER_D " Debug"
  47. #else
  48. #define VER_D " Release"
  49. #endif
  50. #define ATTRIBUTE __attribute__((aligned (ALIGN_NUM)))
  51. #define COMPAT_POINTER(ptr, type)\
  52. do {\
  53. HI_UL ulAddr = (HI_UL)ptr;\
  54. HI_U32 u32Addr = (HI_U32)ulAddr;\
  55. ptr = (type)(HI_UL)u32Addr;\
  56. } while(0)
  57. #define __MK_VERSION(x,y,z,p,b) #x"."#y"."#z"."#p" B0"#b
  58. #define MK_VERSION(x,y,z,p,b) __MK_VERSION(x,y,z,p,b)
  59. #define MPP_VERSION CHIP_NAME MPP_VER_PRIX MK_VERSION(VER_X,VER_Y,VER_Z,VER_P,VER_B) VER_D
  60. #define VERSION_NAME_MAXLEN 64
  61. typedef struct hiMPP_VERSION_S
  62. {
  63. HI_CHAR aVersion[VERSION_NAME_MAXLEN];
  64. } MPP_VERSION_S;
  65. typedef HI_S32 AI_CHN;
  66. typedef HI_S32 AO_CHN;
  67. typedef HI_S32 AENC_CHN;
  68. typedef HI_S32 ADEC_CHN;
  69. typedef HI_S32 AUDIO_DEV;
  70. typedef HI_S32 VI_DEV;
  71. typedef HI_S32 VI_PIPE;
  72. typedef HI_S32 VI_CHN;
  73. typedef HI_S32 VI_STITCH_GRP;
  74. typedef HI_S32 VO_DEV;
  75. typedef HI_S32 VO_LAYER;
  76. typedef HI_S32 VO_CHN;
  77. typedef HI_S32 VO_WBC;
  78. typedef HI_S32 GRAPHIC_LAYER;
  79. typedef HI_S32 VENC_CHN;
  80. typedef HI_S32 VDEC_CHN;
  81. typedef HI_S32 IVE_HANDLE;
  82. typedef HI_S32 CLS_HANDLE;
  83. typedef HI_S32 FD_CHN;
  84. typedef HI_S32 MD_CHN;
  85. typedef HI_S32 ISP_DEV;
  86. typedef HI_S32 BLK_DEV;
  87. typedef HI_S32 SENSOR_ID;
  88. typedef HI_S32 MIPI_DEV;
  89. typedef HI_S32 SLAVE_DEV;
  90. typedef HI_S32 SVP_NNIE_HANDLE;
  91. typedef HI_S32 SVP_DSP_HANDLE;
  92. typedef HI_S32 VPSS_GRP;
  93. typedef HI_S32 VPSS_GRP_PIPE;
  94. typedef HI_S32 VPSS_CHN;
  95. typedef HI_S32 AVS_GRP;
  96. typedef HI_S32 AVS_PIPE;
  97. typedef HI_S32 AVS_CHN;
  98. #define HI_INVALID_CHN (-1)
  99. #define HI_INVALID_WAY (-1)
  100. #define HI_INVALID_LAYER (-1)
  101. #define HI_INVALID_DEV (-1)
  102. #define HI_INVALID_HANDLE (-1)
  103. #define HI_INVALID_VALUE (-1)
  104. #define HI_INVALID_TYPE (-1)
  105. #define CCM_MATRIX_SIZE (9)
  106. #define CCM_MATRIX_NUM (7)
  107. #define CLUT_R_NUM (17)
  108. #define CLUT_B_NUM (17)
  109. #define CLUT_G_NUM (17)
  110. #define HI_ISP_CLUT_COEFACMCNT (4850)
  111. #define CUBIC_POINT_MAX (5)
  112. typedef enum hiMOD_ID_E
  113. {
  114. HI_ID_CMPI = 0,
  115. HI_ID_VB = 1,
  116. HI_ID_SYS = 2,
  117. HI_ID_RGN = 3,
  118. HI_ID_CHNL = 4,
  119. HI_ID_VDEC = 5,
  120. HI_ID_AVS = 6,
  121. HI_ID_VPSS = 7,
  122. HI_ID_VENC = 8,
  123. HI_ID_SVP = 9,
  124. HI_ID_H264E = 10,
  125. HI_ID_JPEGE = 11,
  126. HI_ID_MPEG4E = 12,
  127. HI_ID_H265E = 13,
  128. HI_ID_JPEGD = 14,
  129. HI_ID_VO = 15,
  130. HI_ID_VI = 16,
  131. HI_ID_DIS = 17,
  132. HI_ID_VALG = 18,
  133. HI_ID_RC = 19,
  134. HI_ID_AIO = 20,
  135. HI_ID_AI = 21,
  136. HI_ID_AO = 22,
  137. HI_ID_AENC = 23,
  138. HI_ID_ADEC = 24,
  139. HI_ID_VPU = 25,
  140. HI_ID_PCIV = 26,
  141. HI_ID_PCIVFMW = 27,
  142. HI_ID_ISP = 28,
  143. HI_ID_IVE = 29,
  144. HI_ID_USER = 30,
  145. HI_ID_DCCM = 31,
  146. HI_ID_DCCS = 32,
  147. HI_ID_PROC = 33,
  148. HI_ID_LOG = 34,
  149. HI_ID_VFMW = 35,
  150. HI_ID_H264D = 36,
  151. HI_ID_GDC = 37,
  152. HI_ID_PHOTO = 38,
  153. HI_ID_FB = 39,
  154. HI_ID_HDMI = 40,
  155. HI_ID_VOIE = 41,
  156. HI_ID_TDE = 42,
  157. HI_ID_HDR = 43,
  158. HI_ID_PRORES = 44,
  159. HI_ID_VGS = 45,
  160. HI_ID_FD = 47,
  161. HI_ID_ODT = 48, //Object detection trace
  162. HI_ID_VQA = 49, //Video quality analysis
  163. HI_ID_LPR = 50, //Object detection trace
  164. HI_ID_SVP_NNIE = 51,
  165. HI_ID_SVP_DSP = 52,
  166. HI_ID_DPU_RECT = 53,
  167. HI_ID_DPU_MATCH = 54,
  168. HI_ID_MOTIONSENSOR = 55,
  169. HI_ID_MOTIONFUSION = 56,
  170. HI_ID_BUTT,
  171. } MOD_ID_E;
  172. typedef struct hiMPP_CHN_S
  173. {
  174. MOD_ID_E enModId;
  175. HI_S32 s32DevId;
  176. HI_S32 s32ChnId;
  177. } MPP_CHN_S;
  178. #define MPP_MOD_VI "vi"
  179. #define MPP_MOD_VO "vo"
  180. #define MPP_MOD_AVS "avs"
  181. #define MPP_MOD_HDMI "hdmi"
  182. #define MPP_MOD_VGS "vgs"
  183. #define MPP_MOD_GDC "gdc"
  184. #define MPP_MOD_DIS "dis"
  185. #define MPP_MOD_CHNL "chnl"
  186. #define MPP_MOD_VENC "venc"
  187. #define MPP_MOD_VPSS "vpss"
  188. #define MPP_MOD_RGN "rgn"
  189. #define MPP_MOD_IVE "ive"
  190. #define MPP_MOD_FD "fd"
  191. #define MPP_MOD_MD "md"
  192. #define MPP_MOD_SVP "svp"
  193. #define MPP_MOD_SVP_NNIE "nnie"
  194. #define MPP_MOD_SVP_DSP "dsp"
  195. #define MPP_MOD_DPU_RECT "rect"
  196. #define MPP_MOD_DPU_MATCH "match"
  197. #define MPP_MOD_H264E "h264e"
  198. #define MPP_MOD_H265E "h265e"
  199. #define MPP_MOD_JPEGE "jpege"
  200. #define MPP_MOD_MPEG4E "mpeg4e"
  201. #define MPP_MOD_VEDU "vedu"
  202. #define MPP_MOD_PRORES "prores"
  203. #define MPP_MOD_VDEC "vdec"
  204. #define MPP_MOD_H264D "h264d"
  205. #define MPP_MOD_JPEGD "jpegd"
  206. #define MPP_MOD_AI "ai"
  207. #define MPP_MOD_AO "ao"
  208. #define MPP_MOD_AENC "aenc"
  209. #define MPP_MOD_ADEC "adec"
  210. #define MPP_MOD_AIO "aio"
  211. #define MPP_MOD_ACODEC "acodec"
  212. #define MPP_MOD_VB "vb"
  213. #define MPP_MOD_SYS "sys"
  214. #define MPP_MOD_CMPI "cmpi"
  215. #define MPP_MOD_PCIV "pciv"
  216. #define MPP_MOD_PCIVFMW "pcivfmw"
  217. #define MPP_MOD_PROC "proc"
  218. #define MPP_MOD_LOG "logmpp"
  219. #define MPP_MOD_DCCM "dccm"
  220. #define MPP_MOD_DCCS "dccs"
  221. #define MPP_MOD_FB "fb"
  222. #define MPP_MOD_RC "rc"
  223. #define MPP_MOD_VOIE "voie"
  224. #define MPP_MOD_TDE "tde"
  225. #define MPP_MOD_ISP "isp"
  226. #define MPP_MOD_USR "usr"
  227. /* We just coyp this value of payload type from RTP/RTSP definition */
  228. typedef enum
  229. {
  230. PT_PCMU = 0,
  231. PT_1016 = 1,
  232. PT_G721 = 2,
  233. PT_GSM = 3,
  234. PT_G723 = 4,
  235. PT_DVI4_8K = 5,
  236. PT_DVI4_16K = 6,
  237. PT_LPC = 7,
  238. PT_PCMA = 8,
  239. PT_G722 = 9,
  240. PT_S16BE_STEREO = 10,
  241. PT_S16BE_MONO = 11,
  242. PT_QCELP = 12,
  243. PT_CN = 13,
  244. PT_MPEGAUDIO = 14,
  245. PT_G728 = 15,
  246. PT_DVI4_3 = 16,
  247. PT_DVI4_4 = 17,
  248. PT_G729 = 18,
  249. PT_G711A = 19,
  250. PT_G711U = 20,
  251. PT_G726 = 21,
  252. PT_G729A = 22,
  253. PT_LPCM = 23,
  254. PT_CelB = 25,
  255. PT_JPEG = 26,
  256. PT_CUSM = 27,
  257. PT_NV = 28,
  258. PT_PICW = 29,
  259. PT_CPV = 30,
  260. PT_H261 = 31,
  261. PT_MPEGVIDEO = 32,
  262. PT_MPEG2TS = 33,
  263. PT_H263 = 34,
  264. PT_SPEG = 35,
  265. PT_MPEG2VIDEO = 36,
  266. PT_AAC = 37,
  267. PT_WMA9STD = 38,
  268. PT_HEAAC = 39,
  269. PT_PCM_VOICE = 40,
  270. PT_PCM_AUDIO = 41,
  271. PT_MP3 = 43,
  272. PT_ADPCMA = 49,
  273. PT_AEC = 50,
  274. PT_X_LD = 95,
  275. PT_H264 = 96,
  276. PT_D_GSM_HR = 200,
  277. PT_D_GSM_EFR = 201,
  278. PT_D_L8 = 202,
  279. PT_D_RED = 203,
  280. PT_D_VDVI = 204,
  281. PT_D_BT656 = 220,
  282. PT_D_H263_1998 = 221,
  283. PT_D_MP1S = 222,
  284. PT_D_MP2P = 223,
  285. PT_D_BMPEG = 224,
  286. PT_MP4VIDEO = 230,
  287. PT_MP4AUDIO = 237,
  288. PT_VC1 = 238,
  289. PT_JVC_ASF = 255,
  290. PT_D_AVI = 256,
  291. PT_DIVX3 = 257,
  292. PT_AVS = 258,
  293. PT_REAL8 = 259,
  294. PT_REAL9 = 260,
  295. PT_VP6 = 261,
  296. PT_VP6F = 262,
  297. PT_VP6A = 263,
  298. PT_SORENSON = 264,
  299. PT_H265 = 265,
  300. PT_VP8 = 266,
  301. PT_MVC = 267,
  302. PT_PNG = 268,
  303. /* add by hisilicon */
  304. PT_AMR = 1001,
  305. PT_MJPEG = 1002,
  306. PT_AMRWB = 1003,
  307. PT_PRORES = 1006,
  308. PT_OPUS = 1007,
  309. PT_BUTT
  310. } PAYLOAD_TYPE_E;
  311. #ifdef __cplusplus
  312. #if __cplusplus
  313. }
  314. #endif
  315. #endif /* End of #ifdef __cplusplus */
  316. #endif /* _HI_COMMON_H_ */