hi_comm_vi.h 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881
  1. /******************************************************************************
  2. Copyright (C), 2016, Hisilicon Tech. Co., Ltd.
  3. ******************************************************************************
  4. File Name : hi_comm_vi.h
  5. Version : Initial Draft
  6. Author : Hisilicon multimedia software group
  7. Created : 2016/09/19
  8. Last Modified :
  9. Description :
  10. Function List :
  11. ******************************************************************************/
  12. #ifndef __HI_COMM_VI_H__
  13. #define __HI_COMM_VI_H__
  14. #include "hi_common.h"
  15. #include "hi_errno.h"
  16. #include "hi_comm_video.h"
  17. #include "hi_comm_gdc.h"
  18. #ifdef __cplusplus
  19. #if __cplusplus
  20. extern "C"
  21. {
  22. #endif
  23. #endif /* __cplusplus */
  24. #define VI_MAX_ADCHN_NUM (4UL)
  25. #define VI_PMFCOEF_NUM (9UL)
  26. #define VI_COMPMASK_NUM (2UL)
  27. #define VI_PRO_MAX_FRAME_NUM (8UL)
  28. #define VI_SHARPEN_GAIN_NUM 32
  29. #define VI_AUTO_ISO_STRENGTH_NUM 16
  30. #define VI_INVALID_FRMRATE (-1)
  31. #define VI_CHN0 0
  32. #define VI_CHN1 1
  33. #define VI_CHN2 2
  34. #define VI_CHN3 3
  35. #define VI_INVALID_CHN -1
  36. #define VI_MAX_VC_NUM 4
  37. typedef struct hiVI_LOW_DELAY_INFO_S
  38. {
  39. HI_BOOL bEnable; /* RW; Low delay enable. */
  40. HI_U32 u32LineCnt; /* RW; Range: [32, 16384]; Low delay shoreline. */
  41. }VI_LOW_DELAY_INFO_S;
  42. /* Information of raw data cmpresss param */
  43. typedef struct hiVI_CMP_PARAM_S
  44. {
  45. HI_U8 au8CmpParam[VI_CMP_PARAM_SIZE];
  46. } VI_CMP_PARAM_S;
  47. typedef enum hi_VI_USERPIC_MODE_E
  48. {
  49. VI_USERPIC_MODE_PIC = 0, /* YUV picture */
  50. VI_USERPIC_MODE_BGC, /* Background picture only with a color */
  51. VI_USERPIC_MODE_BUTT,
  52. } VI_USERPIC_MODE_E;
  53. typedef struct hiVI_USERPIC_BGC_S
  54. {
  55. HI_U32 u32BgColor;
  56. } VI_USERPIC_BGC_S;
  57. typedef struct hiVI_USERPIC_ATTR_S
  58. {
  59. VI_USERPIC_MODE_E enUsrPicMode; /* User picture mode */
  60. union
  61. {
  62. VIDEO_FRAME_INFO_S stUsrPicFrm; /* Information about a YUV picture */
  63. VI_USERPIC_BGC_S stUsrPicBg; /* Information about a background picture only with a color */
  64. } unUsrPic;
  65. } VI_USERPIC_ATTR_S;
  66. typedef enum hiEN_VI_ERR_CODE_E
  67. {
  68. ERR_VI_FAILED_NOTENABLE = 64, /* device or channel not enable*/
  69. ERR_VI_FAILED_NOTDISABLE, /* device not disable*/
  70. ERR_VI_FAILED_CHNOTDISABLE, /* channel not disable*/
  71. ERR_VI_CFG_TIMEOUT, /* config timeout*/
  72. ERR_VI_NORM_UNMATCH, /* video norm of ADC and VIU is unmatch*/
  73. ERR_VI_INVALID_WAYID, /* invlalid way ID */
  74. ERR_VI_INVALID_PHYCHNID, /* invalid phychn id*/
  75. ERR_VI_FAILED_NOTBIND, /* device or channel not bind */
  76. ERR_VI_FAILED_BINDED, /* device or channel not unbind */
  77. ERR_VI_DIS_PROCESS_FAIL /* dis process failed */
  78. } EN_VI_ERR_CODE_E;
  79. #define HI_ERR_VI_INVALID_PARA HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM)
  80. #define HI_ERR_VI_INVALID_DEVID HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID)
  81. #define HI_ERR_VI_INVALID_PIPEID HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_PIPEID)
  82. #define HI_ERR_VI_INVALID_STITCHGRPID HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_STITCHGRPID)
  83. #define HI_ERR_VI_INVALID_CHNID HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID)
  84. #define HI_ERR_VI_INVALID_NULL_PTR HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR)
  85. #define HI_ERR_VI_FAILED_NOTCONFIG HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG)
  86. #define HI_ERR_VI_SYS_NOTREADY HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY)
  87. #define HI_ERR_VI_BUF_EMPTY HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY)
  88. #define HI_ERR_VI_BUF_FULL HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL)
  89. #define HI_ERR_VI_NOMEM HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM)
  90. #define HI_ERR_VI_NOT_SUPPORT HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT)
  91. #define HI_ERR_VI_BUSY HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY)
  92. #define HI_ERR_VI_NOT_PERM HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM)
  93. #define HI_ERR_VI_FAILED_NOTENABLE HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, ERR_VI_FAILED_NOTENABLE)
  94. #define HI_ERR_VI_FAILED_NOTDISABLE HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, ERR_VI_FAILED_NOTDISABLE)
  95. #define HI_ERR_VI_FAILED_CHNOTDISABLE HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, ERR_VI_FAILED_CHNOTDISABLE)
  96. #define HI_ERR_VI_CFG_TIMEOUT HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, ERR_VI_CFG_TIMEOUT)
  97. #define HI_ERR_VI_NORM_UNMATCH HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, ERR_VI_NORM_UNMATCH)
  98. #define HI_ERR_VI_INVALID_WAYID HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, ERR_VI_INVALID_WAYID)
  99. #define HI_ERR_VI_INVALID_PHYCHNID HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, ERR_VI_INVALID_PHYCHNID)
  100. #define HI_ERR_VI_FAILED_NOTBIND HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, ERR_VI_FAILED_NOTBIND)
  101. #define HI_ERR_VI_FAILED_BINDED HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, ERR_VI_FAILED_BINDED)
  102. #define HI_ERR_VI_PIPE_EXIST HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST)
  103. #define HI_ERR_VI_PIPE_UNEXIST HI_DEF_ERR(HI_ID_VI, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST)
  104. /* interface mode of video input */
  105. typedef enum hiVI_INTF_MODE_E
  106. {
  107. VI_MODE_BT656 = 0, /* ITU-R BT.656 YUV4:2:2 */
  108. VI_MODE_BT601, /* ITU-R BT.601 YUV4:2:2 */
  109. VI_MODE_DIGITAL_CAMERA, /* digatal camera mode */
  110. VI_MODE_BT1120_STANDARD, /* BT.1120 progressive mode */
  111. VI_MODE_BT1120_INTERLEAVED, /* BT.1120 interstage mode */
  112. VI_MODE_MIPI, /* MIPI RAW mode */
  113. VI_MODE_MIPI_YUV420_NORMAL, /* MIPI YUV420 normal mode */
  114. VI_MODE_MIPI_YUV420_LEGACY, /* MIPI YUV420 legacy mode */
  115. VI_MODE_MIPI_YUV422, /* MIPI YUV422 mode */
  116. VI_MODE_LVDS, /* LVDS mode */
  117. VI_MODE_HISPI, /* HiSPi mode */
  118. VI_MODE_SLVS, /* SLVS mode */
  119. VI_MODE_BUTT
  120. } VI_INTF_MODE_E;
  121. /* Input mode */
  122. typedef enum hiVI_INPUT_MODE_E
  123. {
  124. VI_INPUT_MODE_BT656 = 0, /* ITU-R BT.656 YUV4:2:2 */
  125. VI_INPUT_MODE_BT601, /* ITU-R BT.601 YUV4:2:2 */
  126. VI_INPUT_MODE_DIGITAL_CAMERA, /* digatal camera mode */
  127. VI_INPUT_MODE_INTERLEAVED, /* interstage mode */
  128. VI_INPUT_MODE_MIPI, /* MIPI mode */
  129. VI_INPUT_MODE_LVDS, /* LVDS mode */
  130. VI_INPUT_MODE_HISPI, /* HiSPi mode */
  131. VI_INPUT_MODE_SLVS, /* SLVS mode */
  132. VI_INPUT_MODE_BUTT
  133. } VI_INPUT_MODE_E;
  134. /* Work mode */
  135. typedef enum hiVI_WORK_MODE_E
  136. {
  137. VI_WORK_MODE_1Multiplex = 0, /* 1 Multiplex mode */
  138. VI_WORK_MODE_2Multiplex, /* 2 Multiplex mode */
  139. VI_WORK_MODE_3Multiplex, /* 3 Multiplex mode */
  140. VI_WORK_MODE_4Multiplex, /* 4 Multiplex mode */
  141. VI_WORK_MODE_BUTT
  142. } VI_WORK_MODE_E;
  143. /* whether an input picture is interlaced or progressive */
  144. typedef enum hiVI_SCAN_MODE_E
  145. {
  146. VI_SCAN_INTERLACED = 0, /* interlaced mode */
  147. VI_SCAN_PROGRESSIVE, /* progressive mode */
  148. VI_SCAN_BUTT
  149. } VI_SCAN_MODE_E;
  150. /* Sequence of YUV data */
  151. typedef enum hiVI_YUV_DATA_SEQ_E
  152. {
  153. VI_DATA_SEQ_VUVU = 0, /* The input sequence of the second component(only contains u and v) in BT.1120 mode is VUVU */
  154. VI_DATA_SEQ_UVUV, /* The input sequence of the second component(only contains u and v) in BT.1120 mode is UVUV */
  155. VI_DATA_SEQ_UYVY, /* The input sequence of YUV is UYVY */
  156. VI_DATA_SEQ_VYUY, /* The input sequence of YUV is VYUY */
  157. VI_DATA_SEQ_YUYV, /* The input sequence of YUV is YUYV */
  158. VI_DATA_SEQ_YVYU, /* The input sequence of YUV is YVYU */
  159. VI_DATA_SEQ_BUTT
  160. } VI_YUV_DATA_SEQ_E;
  161. /* Clock edge mode */
  162. typedef enum hiVI_CLK_EDGE_E
  163. {
  164. VI_CLK_EDGE_SINGLE_UP = 0, /* single-edge mode and in rising edge */
  165. VI_CLK_EDGE_SINGLE_DOWN, /* single-edge mode and in falling edge */
  166. VI_CLK_EDGE_BUTT
  167. } VI_CLK_EDGE_E;
  168. /* Component mode */
  169. typedef enum hiVI_COMPONENT_MODE_E
  170. {
  171. VI_COMPONENT_MODE_SINGLE = 0, /* single component mode */
  172. VI_COMPONENT_MODE_DOUBLE, /* double component mode */
  173. VI_COMPONENT_MODE_BUTT
  174. } VI_COMPONENT_MODE_E;
  175. /* Y/C composite or separation mode */
  176. typedef enum hiVI_COMBINE_MODE_E
  177. {
  178. VI_COMBINE_COMPOSITE = 0, /* Composite mode */
  179. VI_COMBINE_SEPARATE, /* Separate mode */
  180. VI_COMBINE_BUTT
  181. } VI_COMBINE_MODE_E;
  182. /* Attribute of the vertical synchronization signal */
  183. typedef enum hiVI_VSYNC_E
  184. {
  185. VI_VSYNC_FIELD = 0, /* Field/toggle mode:a signal reversal means a new frame or a field */
  186. VI_VSYNC_PULSE, /* Pusle/effective mode:a pusle or an effective signal means a new frame or a field */
  187. VI_VSYNC_BUTT
  188. } VI_VSYNC_E;
  189. /* Polarity of the vertical synchronization signal */
  190. typedef enum hiVI_VSYNC_NEG_E
  191. {
  192. VI_VSYNC_NEG_HIGH = 0, /* if VIU_VSYNC_E = VIU_VSYNC_FIELD,then the vertical synchronization signal of even field is high-level,
  193. if VIU_VSYNC_E = VIU_VSYNC_PULSE,then the vertical synchronization pulse is positive pulse. */
  194. VI_VSYNC_NEG_LOW, /* if VIU_VSYNC_E = VIU_VSYNC_FIELD,then the vertical synchronization signal of even field is low-level,
  195. if VIU_VSYNC_E = VIU_VSYNC_PULSE,then the vertical synchronization pulse is negative pulse. */
  196. VI_VSYNC_NEG_BUTT
  197. } VI_VSYNC_NEG_E;
  198. /* Attribute of the horizontal synchronization signal */
  199. typedef enum hiVI_HSYNC_E
  200. {
  201. VI_HSYNC_VALID_SINGNAL = 0, /* the horizontal synchronization is valid signal mode */
  202. VI_HSYNC_PULSE, /* the horizontal synchronization is pulse mode, a new pulse means the beginning of a new line */
  203. VI_HSYNC_BUTT
  204. } VI_HSYNC_E;
  205. /* Polarity of the horizontal synchronization signal */
  206. typedef enum hiVI_HSYNC_NEG_E
  207. {
  208. VI_HSYNC_NEG_HIGH = 0, /*if VI_HSYNC_E = VI_HSYNC_VALID_SINGNAL,then the valid horizontal synchronization signal is high-level;
  209. if VI_HSYNC_E = VI_HSYNC_PULSE,then the horizontal synchronization pulse is positive pulse */
  210. VI_HSYNC_NEG_LOW, /*if VI_HSYNC_E = VI_HSYNC_VALID_SINGNAL,then the valid horizontal synchronization signal is low-level;
  211. if VI_HSYNC_E = VI_HSYNC_PULSE,then the horizontal synchronization pulse is negative pulse */
  212. VI_HSYNC_NEG_BUTT
  213. } VI_HSYNC_NEG_E;
  214. /* Attribute of the valid vertical synchronization signal */
  215. typedef enum hiVI_VSYNC_VALID_E
  216. {
  217. VI_VSYNC_NORM_PULSE = 0, /* the vertical synchronization is pusle mode, a pusle means a new frame or field */
  218. VI_VSYNC_VALID_SINGAL, /* the vertical synchronization is effective mode, a effective signal means a new frame or field */
  219. VI_VSYNC_VALID_BUTT
  220. } VI_VSYNC_VALID_E;
  221. /* Polarity of the valid vertical synchronization signal */
  222. typedef enum hiVI_VSYNC_VALID_NEG_E
  223. {
  224. VI_VSYNC_VALID_NEG_HIGH = 0, /* if VI_VSYNC_VALID_E = VI_VSYNC_NORM_PULSE,a positive pulse means vertical synchronization pulse;
  225. if VI_VSYNC_VALID_E = VI_VSYNC_VALID_SINGAL,the valid vertical synchronization signal is high-level */
  226. VI_VSYNC_VALID_NEG_LOW, /* if VI_VSYNC_VALID_E = VI_VSYNC_NORM_PULSE,a negative pulse means vertical synchronization pulse;
  227. if VI_VSYNC_VALID_E = VI_VSYNC_VALID_SINGAL,the valid vertical synchronization signal is low-level */
  228. VI_VSYNC_VALID_NEG_BUTT
  229. } VI_VSYNC_VALID_NEG_E;
  230. /* Blank information of the input timing */
  231. typedef struct hiVI_TIMING_BLANK_S
  232. {
  233. HI_U32 u32HsyncHfb ; /* RW;Horizontal front blanking width */
  234. HI_U32 u32HsyncAct ; /* RW;Horizontal effetive width */
  235. HI_U32 u32HsyncHbb ; /* RW;Horizontal back blanking width */
  236. HI_U32 u32VsyncVfb ; /* RW;Vertical front blanking height of one frame or odd-field frame picture */
  237. HI_U32 u32VsyncVact ; /* RW;Vertical effetive width of one frame or odd-field frame picture */
  238. HI_U32 u32VsyncVbb ; /* RW;Vertical back blanking height of one frame or odd-field frame picture */
  239. HI_U32 u32VsyncVbfb ; /* RW;Even-field vertical front blanking height when input mode is interlace (invalid when progressive input mode) */
  240. HI_U32 u32VsyncVbact ; /* RW;Even-field vertical effetive width when input mode is interlace (invalid when progressive input mode) */
  241. HI_U32 u32VsyncVbbb ; /* RW;Even-field vertical back blanking height when input mode is interlace (invalid when progressive input mode) */
  242. } VI_TIMING_BLANK_S;
  243. /* synchronization information about the BT.601 or DC timing */
  244. typedef struct hiVI_SYNC_CFG_S
  245. {
  246. VI_VSYNC_E enVsync;
  247. VI_VSYNC_NEG_E enVsyncNeg;
  248. VI_HSYNC_E enHsync;
  249. VI_HSYNC_NEG_E enHsyncNeg;
  250. VI_VSYNC_VALID_E enVsyncValid;
  251. VI_VSYNC_VALID_NEG_E enVsyncValidNeg;
  252. VI_TIMING_BLANK_S stTimingBlank;
  253. } VI_SYNC_CFG_S;
  254. /* the highest bit of the BT.656 timing reference code */
  255. typedef enum hiVI_BT656_FIXCODE_E
  256. {
  257. VI_BT656_FIXCODE_1 = 0, /* The highest bit of the EAV/SAV data over the BT.656 protocol is always 1. */
  258. VI_BT656_FIXCODE_0, /* The highest bit of the EAV/SAV data over the BT.656 protocol is always 0. */
  259. VI_BT656_FIXCODE_BUTT
  260. } VI_BT656_FIXCODE_E;
  261. /* Polarity of the field indicator bit (F) of the BT.656 timing reference code */
  262. typedef enum hiVI_BT656_FIELD_POLAR_E
  263. {
  264. VI_BT656_FIELD_POLAR_STD = 0, /* the standard BT.656 mode,the first filed F=0,the second filed F=1 */
  265. VI_BT656_FIELD_POLAR_NSTD, /* the non-standard BT.656 mode,the first filed F=1,the second filed F=0 */
  266. VI_BT656_FIELD_POLAR_BUTT
  267. } VI_BT656_FIELD_POLAR_E;
  268. /* synchronization information about the BT.656 */
  269. typedef struct hiVI_BT656_SYNC_CFG_S
  270. {
  271. VI_BT656_FIXCODE_E enFixCode;
  272. VI_BT656_FIELD_POLAR_E enFieldPolar;
  273. } VI_BT656_SYNC_CFG_S;
  274. /* Input data type */
  275. typedef enum hiVI_DATA_TYPE_E
  276. {
  277. VI_DATA_TYPE_YUV = 0,
  278. VI_DATA_TYPE_RGB,
  279. VI_DATA_TYPE_BUTT
  280. } VI_DATA_TYPE_E;
  281. typedef enum hiVI_REPHASE_MODE_E
  282. {
  283. VI_REPHASE_MODE_NONE = 0,
  284. VI_REPHASE_MODE_SKIP_1_2, /* skip 1/2 */
  285. VI_REPHASE_MODE_SKIP_1_3, /* skip 1/3 */
  286. VI_REPHASE_MODE_BINNING_1_2, /* binning 1/2 */
  287. VI_REPHASE_MODE_BINNING_1_3, /* binning 1/3 */
  288. VI_REPHASE_MODE_BUTT
  289. } VI_REPHASE_MODE_E;
  290. typedef struct hiVI_BAS_REPHASE_ATTR_S
  291. {
  292. VI_REPHASE_MODE_E enHRephaseMode;
  293. VI_REPHASE_MODE_E enVRephaseMode;
  294. } VI_BAS_REPHASE_ATTR_S;
  295. /* Attribute of bas scale */
  296. typedef struct hiVI_BAS_SCALE_ATTR_S
  297. {
  298. SIZE_S stBasSize; /* RW;bayer scale size.*/
  299. } VI_BAS_SCALE_ATTR_S;
  300. /* Attribute of bayer scale */
  301. typedef struct hiVI_BAS_ATTR_S
  302. {
  303. VI_BAS_SCALE_ATTR_S stSacleAttr;
  304. VI_BAS_REPHASE_ATTR_S stRephaseAttr;
  305. } VI_BAS_ATTR_S;
  306. /* Attribute of wdr */
  307. typedef struct hiVI_WDR_ATTR_S
  308. {
  309. WDR_MODE_E enWDRMode; /* RW; WDR mode.*/
  310. HI_U32 u32CacheLine; /* RW; WDR cache line.*/
  311. } VI_WDR_ATTR_S;
  312. /* the extended attributes of VI device */
  313. typedef struct hiVI_DEV_ATTR_EX_S
  314. {
  315. VI_INPUT_MODE_E enInputMode; /* RW;Input mode */
  316. VI_WORK_MODE_E enWorkMode; /* RW; Work mode */
  317. VI_COMBINE_MODE_E enCombineMode; /* RW;Y/C composite or separation mode */
  318. VI_COMPONENT_MODE_E enComponentMode; /* RW;Component mode (single-component or dual-component) */
  319. VI_CLK_EDGE_E enClkEdge; /* RW;Clock edge mode (sampling on the rising or falling edge) */
  320. HI_U32 au32ComponentMask[VI_COMPMASK_NUM]; /* RW;Component mask */
  321. VI_SCAN_MODE_E enScanMode; /* RW;Input scanning mode (progressive or interlaced) */
  322. HI_S32 as32AdChnId[VI_MAX_ADCHN_NUM]; /* RW;AD channel ID. Typically, the default value -1 is recommended */
  323. VI_YUV_DATA_SEQ_E enDataSeq; /* RW;Input data sequence (only the YUV format is supported) */
  324. VI_SYNC_CFG_S stSynCfg; /* RW;Sync timing. This member must be configured in BT.601 mode or DC mode */
  325. VI_BT656_SYNC_CFG_S stBT656SynCfg; /* RW;Sync timing. This member must be configured in BT.656 mode */
  326. VI_DATA_TYPE_E enInputDataType; /* RW;RGB: CSC-709 or CSC-601, PT YUV444 disable; YUV: default yuv CSC coef PT YUV444 enable. */
  327. HI_BOOL bDataReverse; /* RW;Data reverse */
  328. SIZE_S stSize; /* RW;Input size */
  329. VI_BAS_ATTR_S stBasAttr; /* RW;Attribute of BAS */
  330. VI_WDR_ATTR_S stWDRAttr; /* RW;Attribute of WDR */
  331. DATA_RATE_E enDataRate; /* RW;Data rate of Device */
  332. } VI_DEV_ATTR_EX_S;
  333. /* The attributes of a VI device */
  334. typedef struct hiVI_DEV_ATTR_S
  335. {
  336. VI_INTF_MODE_E enIntfMode; /* RW;Interface mode */
  337. VI_WORK_MODE_E enWorkMode; /* RW;Work mode */
  338. HI_U32 au32ComponentMask[VI_COMPMASK_NUM]; /* RW;Component mask */
  339. VI_SCAN_MODE_E enScanMode; /* RW;Input scanning mode (progressive or interlaced) */
  340. HI_S32 as32AdChnId[VI_MAX_ADCHN_NUM]; /* RW;AD channel ID. Typically, the default value -1 is recommended */
  341. /* The below members must be configured in BT.601 mode or DC mode and are invalid in other modes */
  342. VI_YUV_DATA_SEQ_E enDataSeq; /* RW;Input data sequence (only the YUV format is supported) */
  343. VI_SYNC_CFG_S stSynCfg; /* RW;Sync timing. This member must be configured in BT.601 mode or DC mode */
  344. VI_DATA_TYPE_E enInputDataType; /* RW;RGB: CSC-709 or CSC-601, PT YUV444 disable; YUV: default yuv CSC coef PT YUV444 enable. */
  345. HI_BOOL bDataReverse; /* RW;Data reverse */
  346. SIZE_S stSize; /* RW;Input size */
  347. VI_BAS_ATTR_S stBasAttr; /* RW;Attribute of BAS */
  348. VI_WDR_ATTR_S stWDRAttr; /* RW;Attribute of WDR */
  349. DATA_RATE_E enDataRate; /* RW;Data rate of Device */
  350. } VI_DEV_ATTR_S;
  351. /* Information of pipe binded to device */
  352. typedef struct hiVI_DEV_BIND_PIPE_S
  353. {
  354. HI_U32 u32Num; /* RW;Range [1,VI_MAX_PIPE_NUM] */
  355. VI_PIPE PipeId[VI_MAX_PIPE_NUM]; /* RW;Array of pipe ID */
  356. } VI_DEV_BIND_PIPE_S;
  357. /* Source of 3DNR reference frame */
  358. typedef enum hiVI_NR_REF_SOURCE_E
  359. {
  360. VI_NR_REF_FROM_RFR = 0, /* Reference frame from reconstruction frame */
  361. VI_NR_REF_FROM_CHN0, /* Reference frame from CHN0's frame */
  362. VI_NR_REF_FROM_BUTT
  363. } VI_NR_REF_SOURCE_E;
  364. typedef enum hiVI_PIPE_BYPASS_MODE_E
  365. {
  366. VI_PIPE_BYPASS_NONE,
  367. VI_PIPE_BYPASS_FE,
  368. VI_PIPE_BYPASS_BE,
  369. VI_PIPE_BYPASS_BUTT
  370. } VI_PIPE_BYPASS_MODE_E;
  371. /* The attributes of 3DNR */
  372. typedef struct hiVI_NR_ATTR_S
  373. {
  374. PIXEL_FORMAT_E enPixFmt; /* RW;Pixel format of reference frame */
  375. DATA_BITWIDTH_E enBitWidth; /* RW;Bit Width of reference frame */
  376. VI_NR_REF_SOURCE_E enNrRefSource; /* RW;Source of 3DNR reference frame */
  377. COMPRESS_MODE_E enCompressMode; /* RW;Reference frame compress mode */
  378. } VI_NR_ATTR_S;
  379. /* The attributes of pipe */
  380. typedef struct hiVI_PIPE_ATTR_S
  381. {
  382. VI_PIPE_BYPASS_MODE_E enPipeBypassMode;
  383. HI_BOOL bYuvSkip; /* RW;YUV skip enable */
  384. HI_BOOL bIspBypass; /* RW;ISP bypass enable */
  385. HI_U32 u32MaxW; /* RW;Range[VI_PIPE_MIN_WIDTH,VI_PIPE_MAX_WIDTH];Maximum width */
  386. HI_U32 u32MaxH; /* RW;Range[VI_PIPE_MIN_HEIGHT,VI_PIPE_MAX_HEIGHT];Maximum height */
  387. PIXEL_FORMAT_E enPixFmt; /* RW;Pixel format */
  388. COMPRESS_MODE_E enCompressMode; /* RW;Compress mode.*/
  389. DATA_BITWIDTH_E enBitWidth; /* RW;Bit width*/
  390. HI_BOOL bNrEn; /* RW;3DNR enable */
  391. VI_NR_ATTR_S stNrAttr; /* RW;Attribute of 3DNR*/
  392. HI_BOOL bSharpenEn; /* RW;Sharpen enable*/
  393. FRAME_RATE_CTRL_S stFrameRate; /* RW;Frame rate */
  394. HI_BOOL bDiscardProPic; /* RW;when professional mode snap, whether to discard long exposure picture in the video pipe. */
  395. } VI_PIPE_ATTR_S;
  396. typedef struct hiVI_PIPE_SHARPEN_MANUAL_ATTR_S
  397. {
  398. HI_U16 au16TextureStr[VI_SHARPEN_GAIN_NUM]; /* RW; range: [0, 4095]; Format:7.5;Undirectional sharpen strength for texture and detail enhancement*/
  399. HI_U16 au16EdgeStr[VI_SHARPEN_GAIN_NUM]; /* RW; range: [0, 4095]; Format:7.5;Directional sharpen strength for edge enhancement*/
  400. HI_U16 u16TextureFreq; /* RW; range: [0, 4095]; Format:6.6; Texture frequency adjustment. Texture and detail will be finer when it increase*/
  401. HI_U16 u16EdgeFreq; /* RW; range: [0, 4095]; Format:6.6; Edge frequency adjustment. Edge will be narrower and thiner when it increase*/
  402. HI_U8 u8OverShoot; /* RW; range: [0, 127]; Format:7.0;u8OvershootAmt*/
  403. HI_U8 u8UnderShoot; /* RW; range: [0, 127]; Format:7.0;u8UndershootAmt*/
  404. HI_U8 u8ShootSupStr; /* RW; range: [0, 255]; Format:8.0;overshoot and undershoot suppression strength, the amplitude and width of shoot will be decrease when shootSupSt increase*/
  405. } VI_PIPE_SHARPEN_MANUAL_ATTR_S;
  406. typedef struct hiVI_PIPE_SHARPEN_AUTO_ATTR_S
  407. {
  408. HI_U16 au16TextureStr[VI_SHARPEN_GAIN_NUM][VI_AUTO_ISO_STRENGTH_NUM]; /* RW; range: [0, 4095]; Format:7.5;Undirectional sharpen strength for texture and detail enhancement*/
  409. HI_U16 au16EdgeStr[VI_SHARPEN_GAIN_NUM][VI_AUTO_ISO_STRENGTH_NUM]; /* RW; range: [0, 4095]; Format:7.5;Directional sharpen strength for edge enhancement*/
  410. HI_U16 au16TextureFreq[VI_AUTO_ISO_STRENGTH_NUM]; /* RW; range: [0, 4095]; Format:6.6;Texture frequency adjustment. Texture and detail will be finer when it increase*/
  411. HI_U16 au16EdgeFreq[VI_AUTO_ISO_STRENGTH_NUM]; /* RW; range: [0, 4095]; Format:6.6;Edge frequency adjustment. Edge will be narrower and thiner when it increase*/
  412. HI_U8 au8OverShoot[VI_AUTO_ISO_STRENGTH_NUM]; /* RW; range: [0, 127]; Format:7.0;u8OvershootAmt*/
  413. HI_U8 au8UnderShoot[VI_AUTO_ISO_STRENGTH_NUM]; /* RW; range: [0, 127]; Format:7.0;u8UndershootAmt*/
  414. HI_U8 au8ShootSupStr[VI_AUTO_ISO_STRENGTH_NUM]; /* RW; range: [0, 255]; Format:8.0;overshoot and undershoot suppression strength, the amplitude and width of shoot will be decrease when shootSupSt increase*/
  415. } VI_PIPE_SHARPEN_AUTO_ATTR_S;
  416. typedef struct hiVI_PIPE_SHARPEN_ATTR_S
  417. {
  418. OPERATION_MODE_E enOpType;
  419. HI_U8 au8LumaWgt[VI_SHARPEN_GAIN_NUM]; /* RW; range: [0, 127]; Format:7.0;*/
  420. VI_PIPE_SHARPEN_MANUAL_ATTR_S stSharpenManualAttr;
  421. VI_PIPE_SHARPEN_AUTO_ATTR_S stSharpenAutoAttr;
  422. } VI_PIPE_SHARPEN_ATTR_S;
  423. typedef enum hiVI_STITCH_ISP_CFG_MODE_E
  424. {
  425. VI_STITCH_ISP_CFG_NORMAL = 0,
  426. VI_STITCH_ISP_CFG_SYNC,
  427. VI_STITCH_ISP_CFG_BUTT
  428. }VI_STITCH_ISP_CFG_MODE_E;
  429. /* Information of stitch group */
  430. typedef struct hiVI_STITCH_GRP_ATTR_S
  431. {
  432. HI_BOOL bStitch;
  433. VI_STITCH_ISP_CFG_MODE_E enMode;
  434. HI_U32 u32PipeNum; /* RW;Range [2,VI_MAX_PIPE_NUM] */
  435. VI_PIPE PipeId[VI_MAX_PIPE_NUM]; /* RW;Array of pipe ID */
  436. } VI_STITCH_GRP_ATTR_S;
  437. typedef enum hiVI_PIPE_REPEAT_MODE_E
  438. {
  439. VI_PIPE_REPEAT_NONE = 0,
  440. VI_PIPE_REPEAT_ONCE = 1,
  441. VI_PIPE_REPEAT_BUTT
  442. } VI_PIPE_REPEAT_MODE_E;
  443. typedef struct
  444. {
  445. HI_U8 IES; /* RW; Range:[0,255];Format 8.0;the absolute strength of image enhancement for edge */
  446. HI_U8 IESS; /* RW; Range:[0,255];Format 8.0;the absolute strength of image enhancement for texture and shadow */
  447. HI_U16 IEDZ; /* RW; Range:[0,8192];Format 14.0;the threshold of image enhancement for controlling noise */
  448. } tV59aIEy;
  449. typedef struct
  450. {
  451. HI_U8 SBF : 2; /* RW; Range:[0,3];Format 2.0;the band type of spatial filter,notice: SBF0,SBF1 range is [2,3];SBF2,SBF3 range is [0,3] */
  452. HI_U8 STR : 4; /* RW; Range:[0,13];Format 4.0;the relative strength of spatial filter refer to the previous frame */
  453. HI_U8 STHp : 2; /* RW; Range:[0,2];Format 2.0;Not recommended for debugging */
  454. HI_U8 SFT : 5; /* RW; Range:[0,31];Format 5.0;Not recommended for debugging */
  455. HI_U8 kPro : 3; /* RW; Range:[0,7];Format 3.0;notice: the kPro of SFy2 range is [0,7],the kPro of SFy3 range is [0,4] */
  456. HI_U16 STH[3]; /* RW; Range:[0,999];Format 10.0;the edge-preserve threshold for spatial filter */
  457. HI_U16 SBS[3]; /* RW; Range:[0,9999];Format 14.0;the noise reduction strength of spatial filter for the relative bright pixel */
  458. HI_U16 SDS[3]; /* RW; Range:[0,9999];Format 14.0;the noise reduction strength of spatial filter for the relative dark pixel */
  459. } tV59aSFy;
  460. typedef struct
  461. {
  462. HI_U16 MATH : 10; /* RW; Range:[0,1023];Format 10.0;the motion detection threshold for temporal filter */
  463. HI_U16 MATE : 4; /* RW; Range:[0,11];Format 4.0;the motion detection index of flat area for temporal filter */
  464. HI_U16 MATW : 2; /* RW; Range:[0,3];Format 2.0;the index of suppressing trailing for temporal filter */
  465. HI_U8 MASW : 4; /* RW; Range:[0,12];Format 4.0;the index of suppressing raindrop noise for temporal filter */
  466. HI_U8 MABW : 3; /* RW; Range:[0,4];Format 3.0;the window of motion detection for temporal filter */
  467. HI_U8 MAXN : 1; /* RW; Range:[0,1];Format 1.0;Not recommended for debugging */
  468. } tV59aMDy;
  469. typedef struct
  470. {
  471. HI_U8 TFR[4]; /* RW; Range:[0,255];Format 8.0;the relative strength of temporal filter for the static area */
  472. HI_U16 TDZ : 14; /* RW; Range:[0,999];Format 10.0;the threshold of dead-area of temporal filter */
  473. HI_U16 TDX : 2; /* RW; Range:[0,2];Format 2.0;Not recommended for debugging */
  474. HI_U16 TFS : 6; /* RW; Range:[0,63];Format 6.0;the absolute strength of temporal filter */
  475. } tV59aTFy;
  476. typedef struct
  477. {
  478. HI_U16 SFC : 10; /* RW; Range:[0,1023];Format 10.0;the strength of spatial filter for NRC0 */
  479. HI_U16 TFC : 6; /* RW; Range:[0,63];Format 6.0;the strength of temporal filter for NRC0 */
  480. HI_U16 CSFS : 14; /* RW; Range:[0,999];Format 10.0;the strength of spatial filter for NRC1 */
  481. HI_U16 CSFk : 2; /* RW; Range:[0,3];Format 2.0;Not recommended for debugging */
  482. HI_U16 CTFS : 4; /* RW; Range:[0,15];Format 4.0;the strength of temporal filter for NRC1 */
  483. HI_U16 CIIR : 1; /* RW; Range:[0,1];Format 1.0;the mode of spatial filter for NRC1 */
  484. HI_U16 CTFR : 11; /* RW; Range:[0,999];Format 10.0;the relative strength of temporal filter for NRC1 */
  485. } tV59aNRc;
  486. /* 3DNR Spatial Filter: SFy0,SFy1,SFy2,SFy3; Temporal Filter:TFy0,TFy1;Chroma Noise Reduction: NRC0,NRC1 */
  487. typedef struct
  488. {
  489. tV59aIEy IEy;
  490. tV59aSFy SFy[5];
  491. tV59aMDy MDy[2];
  492. tV59aTFy TFy[2];
  493. HI_U16 HdgType : 1; /* RW; Range:[0,1];Format 1.0;the type of complexed mixed spatial filter whether is SFi or SFk */
  494. HI_U16 BriType : 1; /* RW; Range:[0,1];Format 1.0;the mode decide SFy3 whether is SFk type or SFi type */
  495. HI_U16 HdgMode : 2; /* RW; Range:[0,3];Format 2.0;the mode decide complexed mixed spatial filter band for flat area */
  496. HI_U16 kTab2 : 1; /* RW; Range:[0,1];Format 1.0;the parameter decide SFy2 whether or not based on the image absolute luminance*/
  497. HI_U16 HdgWnd : 1; /* RW; Range:[0,1];Format 1.0;the sampling window of complexed mixed spatial filter for noise detection*/
  498. HI_U16 kTab3 : 1; /* RW; Range:[0,1];Format 1.0;the parameter decide SFy3 whether or not based on the image absolute luminance*/
  499. HI_U16 HdgSFR : 4; /* RW; Range:[0,13];Format 4.0;the trend of the noise reduction of complexed mixed spatial filter for flat area*/
  500. HI_U16 nOut : 5; /* RW; Range:[0,27];Format 5.0;the parameter for output intermediate result of SFy3 */
  501. HI_U8 HdgIES; /* RW; Range:[0,255];Format 8.0;the strength of image enhancement for complexed mixed spatial filter */
  502. HI_U8 nRef : 1; /* RW; Range:[0,1];Format 1.0;Not recommended for debugging */
  503. HI_U8 SFRi[4]; /* RW; Range:[0,255];Format 8.0;the relative strength of SFy3 when the filter type is SFi */
  504. HI_U8 SFRk[4]; /* RW; Range:[0,255];Format 8.0;the relative strength of SFy3 when the filter type is SFk */
  505. HI_U16 SBSk2[32]; /* RW; Range:[0,9999];Format 14.0;the noise reduction strength of SFy2 for the relative bright pixel based on the image absolute luminance */
  506. HI_U16 SBSk3[32]; /* RW; Range:[0,9999];Format 14.0;the noise reduction strength of SFy3 for the relative bright pixel based on the image absolute luminance */
  507. HI_U16 SDSk2[32]; /* RW; Range:[0,9999];Format 14.0;the noise reduction strength of SFy2 for the relative dark pixel based on the image absolute luminance */
  508. HI_U16 SDSk3[32]; /* RW; Range:[0,9999];Format 14.0;the noise reduction strength of SFy3 for the relative dark pixel based on the image absolute luminance */
  509. HI_U16 BriThr[16]; /* RW; Range:[0,1024];Format 11.0;the threshold decide SFy3 choose the SFi type filter or SFk type filter in dark and bright area */
  510. tV59aNRc NRc;
  511. } VI_PIPE_NRX_PARAM_V1_S;
  512. typedef enum hiVI_NR_VERSION_E
  513. {
  514. VI_NR_V1 = 1,
  515. VI_NR_V2 = 2,
  516. VI_NR_V3 = 3,
  517. VI_NR_V4 = 4,
  518. VI_NR_BUTT
  519. }VI_NR_VERSION_E;
  520. typedef struct hiNRX_PARAM_MANUAL_V1_S
  521. {
  522. VI_PIPE_NRX_PARAM_V1_S stNRXParamV1;
  523. } NRX_PARAM_MANUAL_V1_S;
  524. typedef struct hiNRX_PARAM_AUTO_V1_S
  525. {
  526. HI_U32 u32ParamNum;
  527. HI_U32 * ATTRIBUTE pau32ISO;
  528. VI_PIPE_NRX_PARAM_V1_S * ATTRIBUTE pastNRXParamV1;
  529. } NRX_PARAM_AUTO_V1_S;
  530. typedef struct hiNRX_PARAM_V1_S
  531. {
  532. OPERATION_MODE_E enOptMode; /* RW;Adaptive NR */
  533. NRX_PARAM_MANUAL_V1_S stNRXManualV1; /* RW;NRX V1 param for manual */
  534. NRX_PARAM_AUTO_V1_S stNRXAutoV1; /* RW;NRX V1 param for auto */
  535. } NRX_PARAM_V1_S;
  536. typedef struct
  537. {
  538. HI_U8 IES0, IES1, IES2, IES3;
  539. HI_U16 IEDZ : 10, IEEn : 1, _rb_ : 5;
  540. } tV500_VI_IEy;
  541. typedef struct
  542. {
  543. HI_U8 SPN3 : 3 ;
  544. HI_U8 SBN3 : 3, PBR3 : 5, JMODE;
  545. HI_U8 SFR;
  546. HI_U8 JSFR[3];
  547. HI_U8 SFS1, SFT1, SBR1;
  548. HI_U8 SFS2, SFT2, SBR2;
  549. HI_U8 SFS4, SFT4, SBR4;
  550. HI_U8 CPRat, CPMode;
  551. HI_U8 BRT0, BRT1;
  552. HI_U16 STH1 : 9, SFN1 : 3, SFN0 : 3, NRyEn : 1;
  553. HI_U16 STH2 : 9, SFN2 : 3, kWnd : 1, kMode : 3;
  554. HI_U16 STH3 : 9, SFN3 : 3, _rb_ : 3, TriTh : 1;
  555. HI_U16 STHd1 : 9;
  556. HI_U16 STHd2 : 9;
  557. HI_U16 STHd3 : 9;
  558. } tV500_VI_SFy;
  559. typedef struct
  560. {
  561. tV500_VI_IEy IEy;
  562. tV500_VI_SFy SFy;
  563. } VI_PIPE_NRX_PARAM_V2_S;
  564. typedef struct hiNRX_PARAM_MANUAL_V2_S
  565. {
  566. VI_PIPE_NRX_PARAM_V2_S stNRXParamV2;
  567. } NRX_PARAM_MANUAL_V2_S;
  568. typedef struct hiNRX_PARAM_AUTO_V2_S
  569. {
  570. HI_U32 u32ParamNum;
  571. HI_U32 * ATTRIBUTE pau32ISO;
  572. VI_PIPE_NRX_PARAM_V2_S * ATTRIBUTE pastNRXParamV2;
  573. } NRX_PARAM_AUTO_V2_S;
  574. typedef struct hiNRX_PARAM_V2_S
  575. {
  576. OPERATION_MODE_E enOptMode; /* RW;Adaptive NR */
  577. NRX_PARAM_MANUAL_V2_S stNRXManualV2; /* RW;NRX V1 param for manual */
  578. NRX_PARAM_AUTO_V2_S stNRXAutoV2; /* RW;NRX V1 param for auto */
  579. } NRX_PARAM_V2_S;
  580. typedef struct hiVI_PIPE_NRX_PARAM_S
  581. {
  582. VI_NR_VERSION_E enNRVersion; /* RW;3DNR Version*/
  583. union
  584. {
  585. NRX_PARAM_V1_S stNRXParamV1; /* RW;3DNR X param version 1 */
  586. NRX_PARAM_V2_S stNRXParamV2; /* RW;3DNR X param version 2 */
  587. };
  588. }VI_PIPE_NRX_PARAM_S;
  589. /* The attributes of channel */
  590. typedef struct hiVI_CHN_ATTR_S
  591. {
  592. SIZE_S stSize; /* RW;Channel out put size */
  593. PIXEL_FORMAT_E enPixelFormat; /* RW;Pixel format */
  594. DYNAMIC_RANGE_E enDynamicRange; /* RW;Dynamic Range */
  595. VIDEO_FORMAT_E enVideoFormat; /* RW;Video format */
  596. COMPRESS_MODE_E enCompressMode; /* RW;256B Segment compress or no compress. */
  597. HI_BOOL bMirror; /* RW;Mirror enable */
  598. HI_BOOL bFlip; /* RW;Flip enable */
  599. HI_U32 u32Depth; /* RW;Range [0,8];Depth */
  600. FRAME_RATE_CTRL_S stFrameRate; /* RW;Frame rate */
  601. } VI_CHN_ATTR_S;
  602. /* The status of pipe */
  603. typedef struct hiVI_PIPE_STATUS_S
  604. {
  605. HI_BOOL bEnable; /* RO;Whether this pipe is enabled */
  606. HI_U32 u32IntCnt; /* RO;The video frame interrupt count */
  607. HI_U32 u32FrameRate; /* RO;Current frame rate */
  608. HI_U32 u32LostFrame; /* RO;Lost frame count */
  609. HI_U32 u32VbFail; /* RO;Video buffer malloc failure */
  610. SIZE_S stSize; /* RO;Current pipe output size */
  611. } VI_PIPE_STATUS_S;
  612. /* VS signal output mode */
  613. typedef enum hiVI_VS_SIGNAL_MODE_E
  614. {
  615. VI_VS_SIGNAL_ONCE = 0, /* output one time */
  616. VI_VS_SIGNAL_FREQ, /* output frequently */
  617. VI_VS_SIGNAL_MODE_BUTT
  618. } VI_VS_SIGNAL_MODE_E;
  619. /* The attributes of VS signal */
  620. typedef struct hiVI_VS_SIGNAL_ATTR_S
  621. {
  622. VI_VS_SIGNAL_MODE_E enMode; /* RW;output one time, output frequently*/
  623. HI_U32 u32StartTime; /* RW;output start time,unit: sensor pix clk.*/
  624. HI_U32 u32Duration; /* RW;output high duration, unit: sensor pix clk.*/
  625. HI_U32 u32CapFrmIndex; /* RW;VS signal will be output after trigger by which vframe, default is 0. */
  626. HI_U32 u32Interval; /* RW;output frequently interval, unit: frame*/
  627. } VI_VS_SIGNAL_ATTR_S;
  628. typedef enum hiVI_EXT_CHN_SOURCE_E
  629. {
  630. VI_EXT_CHN_SOURCE_TAIL,
  631. VI_EXT_CHN_SOURCE_HEAD,
  632. VI_EXT_CHN_SOURCE_BUTT
  633. } VI_EXT_CHN_SOURCE_E;
  634. typedef struct hiVI_EXT_CHN_ATTR_S
  635. {
  636. VI_EXT_CHN_SOURCE_E enSource;
  637. VI_CHN s32BindChn; /* RW;Range [VI_CHN0, VI_MAX_PHY_CHN_NUM);The channel num which extend channel will bind to*/
  638. SIZE_S stSize; /* RW;Channel out put size */
  639. PIXEL_FORMAT_E enPixFormat; /* RW;Pixel format */
  640. DYNAMIC_RANGE_E enDynamicRange; /* RW;Dynamic Range */
  641. COMPRESS_MODE_E enCompressMode; /* RW;256B Segment compress or no compress. */
  642. HI_U32 u32Depth; /* RW;Range [0,8];Depth */
  643. FRAME_RATE_CTRL_S stFrameRate; /* RW;Frame rate */
  644. } VI_EXT_CHN_ATTR_S;
  645. typedef enum hiVI_CROP_COORDINATE_E
  646. {
  647. VI_CROP_RATIO_COOR = 0, /* Ratio coordinate */
  648. VI_CROP_ABS_COOR, /* Absolute coordinate */
  649. VI_CROP_BUTT
  650. } VI_CROP_COORDINATE_E;
  651. /* Information of chn crop */
  652. typedef struct hiVI_CROP_INFO_S
  653. {
  654. HI_BOOL bEnable; /* RW;CROP enable*/
  655. VI_CROP_COORDINATE_E enCropCoordinate; /* RW;Coordinate mode of the crop start point*/
  656. RECT_S stCropRect; /* RW;CROP rectangular*/
  657. } VI_CROP_INFO_S;
  658. /* The attributes of LDC */
  659. typedef struct hiVI_LDC_ATTR_S
  660. {
  661. HI_BOOL bEnable; /* RW;Whether LDC is enbale */
  662. LDC_ATTR_S stAttr;
  663. } VI_LDC_ATTR_S;
  664. /* The attributes of LDCV2 */
  665. typedef struct hiVI_LDCV2_ATTR_S
  666. {
  667. HI_BOOL bEnable; /* RW;Whether LDC is enbale */
  668. LDCV2_ATTR_S stAttr;
  669. } VI_LDCV2_ATTR_S;
  670. typedef struct hiVI_ROTATION_EX_ATTR_S
  671. {
  672. HI_BOOL bEnable; /* RW;Whether ROTATE_EX_S is enbale */
  673. ROTATION_EX_S stRotationEx;
  674. }VI_ROTATION_EX_ATTR_S;
  675. /* The status of chn */
  676. typedef struct hiVI_CHN_STATUS_S
  677. {
  678. HI_BOOL bEnable; /* RO;Whether this channel is enabled */
  679. HI_U32 u32FrameRate; /* RO;current frame rate */
  680. HI_U32 u32LostFrame; /* RO;Lost frame count */
  681. HI_U32 u32VbFail; /* RO;Video buffer malloc failure */
  682. SIZE_S stSize; /* RO;chn output size */
  683. } VI_CHN_STATUS_S;
  684. typedef struct hiVI_PMF_ATTR_S
  685. {
  686. HI_BOOL bEnable; /* RW;Whether PMF is enable */
  687. SIZE_S stDestSize; /* RW;Target size */
  688. HI_S64 as64PMFCoef[VI_PMFCOEF_NUM]; /* RW; Array of PMF coefficients */
  689. } VI_PMF_ATTR_S;
  690. typedef struct hiVI_DUMP_ATTR_S
  691. {
  692. HI_BOOL bEnable; /* RW;Whether dump is enable */
  693. HI_U32 u32Depth; /* RW;Range [0,8];Depth */
  694. } VI_DUMP_ATTR_S;
  695. typedef enum hiVI_PIPE_FRAME_SOURCE_E
  696. {
  697. VI_PIPE_FRAME_SOURCE_DEV = 0, /* RW;Source from dev */
  698. VI_PIPE_FRAME_SOURCE_USER_FE, /* RW;User send to FE */
  699. VI_PIPE_FRAME_SOURCE_USER_BE, /* RW;User send to BE */
  700. VI_PIPE_FRAME_SOURCE_BUTT
  701. } VI_PIPE_FRAME_SOURCE_E;
  702. typedef struct hi_VI_RAW_INFO_S
  703. {
  704. VIDEO_FRAME_INFO_S stVideoFrame;
  705. ISP_CONFIG_INFO_S stIspInfo;
  706. } VI_RAW_INFO_S;
  707. /* module params */
  708. typedef struct hiVI_MOD_PARAM_S
  709. {
  710. HI_S32 s32DetectErrFrame;
  711. HI_U32 u32DropErrFrame;
  712. } VI_MOD_PARAM_S;
  713. typedef struct hiVI_DEV_TIMING_ATTR_S
  714. {
  715. HI_BOOL bEnable; /* RW;Whether enable VI generate timing */
  716. HI_S32 s32FrmRate; /* RW;Generate timing Frame rate*/
  717. }VI_DEV_TIMING_ATTR_S;
  718. typedef struct hiVI_EARLY_INTERRUPT_S
  719. {
  720. HI_BOOL bEnable;
  721. HI_U32 u32LineCnt;
  722. } VI_EARLY_INTERRUPT_S;
  723. #ifdef __cplusplus
  724. #if __cplusplus
  725. }
  726. #endif
  727. #endif /* __cplusplus */
  728. #endif /* End of #ifndef__HI_COMM_VIDEO_IN_H__ */