hi_comm_dpu_match.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /******************************************************************************
  2. Copyright (C), 2017-2018, Hisilicon Tech. Co., Ltd.
  3. ******************************************************************************
  4. File Name : hi_comm_match.h
  5. Version : Initial Draft
  6. Author : Hisilicon multimedia software group
  7. Created : 2017/07/22
  8. Description :
  9. History :
  10. 1.Date : 2017/07/22
  11. Modification: Created file
  12. ******************************************************************************/
  13. #ifndef __HI_COMM_MATCH_H__
  14. #define __HI_COMM_MATCH_H__
  15. #ifdef __cplusplus
  16. #if __cplusplus
  17. extern "C"{
  18. #endif
  19. #endif /* __cplusplus */
  20. #include "hi_common.h"
  21. #include "hi_errno.h"
  22. #include "hi_defines.h"
  23. #include "hi_comm_video.h"
  24. #define DPU_MATCH_LEFT_PIPE 0
  25. #define DPU_MATCH_RIGHT_PIPE 1
  26. typedef HI_S32 DPU_MATCH_GRP;
  27. typedef HI_S32 DPU_MATCH_PIPE;
  28. typedef HI_S32 DPU_MATCH_CHN;
  29. typedef enum hiEN_DPU_MATCH_ERR_CODE_E
  30. {
  31. ERR_DPU_MATCH_SYS_TIMEOUT = 0x40, /* DPU MATCH process timeout */
  32. ERR_DPU_MATCH_OPEN_FILE = 0x41, /* DPU MATCH open file error */
  33. ERR_DPU_MATCH_READ_FILE = 0x42, /* DPU MATCH read file error */
  34. ERR_DPU_MATCH_WRITE_FILE = 0x43, /* DPU MATCH write file error */
  35. ERR_DPU_MATCH_BUTT
  36. }EN_DPU_MATCH_ERR_CODE_E;
  37. #define HI_ERR_DPU_MATCH_NULL_PTR HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR)
  38. #define HI_ERR_DPU_MATCH_NOTREADY HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY)
  39. #define HI_ERR_DPU_MATCH_INVALID_DEVID HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID)
  40. #define HI_ERR_DPU_MATCH_INVALID_CHNID HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID)
  41. #define HI_ERR_DPU_MATCH_EXIST HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST)
  42. #define HI_ERR_DPU_MATCH_UNEXIST HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST)
  43. #define HI_ERR_DPU_MATCH_NOT_SUPPORT HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT)
  44. #define HI_ERR_DPU_MATCH_NOT_PERM HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM)
  45. #define HI_ERR_DPU_MATCH_NOMEM HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM)
  46. #define HI_ERR_DPU_MATCH_NOBUF HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF)
  47. #define HI_ERR_DPU_MATCH_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM)
  48. #define HI_ERR_DPU_MATCH_BUSY HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY)
  49. #define HI_ERR_DPU_MATCH_BUF_EMPTY HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY)
  50. #define HI_ERR_DPU_MATCH_SYS_TIMEOUT HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, ERR_DPU_MATCH_SYS_TIMEOUT)
  51. #define HI_ERR_DPU_MATCH_OPEN_FILE HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, ERR_DPU_MATCH_OPEN_FILE)
  52. #define HI_ERR_DPU_MATCH_READ_FILE HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, ERR_DPU_MATCH_READ_FILE)
  53. #define HI_ERR_DPU_MATCH_WRITE_FILE HI_DEF_ERR(HI_ID_DPU_MATCH, EN_ERR_LEVEL_ERROR, ERR_DPU_MATCH_WRITE_FILE)
  54. typedef struct hiDPU_MATCH_MEM_INFO_S
  55. {
  56. HI_U64 u64PhyAddr;
  57. HI_U64 u64VirAddr;
  58. HI_U32 u32Size;
  59. }DPU_MATCH_MEM_INFO_S;
  60. typedef enum hiDPU_MATCH_MASK_MODE_E
  61. {
  62. DPU_MATCH_MASK_DEFAULT_MODE = 0x0,
  63. DPU_MATCH_MASK_1X1_MODE = 0x1,
  64. DPU_MATCH_MASK_3X3_MODE = 0x2,
  65. DPU_MATCH_MASK_5X5_MODE = 0x3,
  66. DPU_MATCH_MASK_7X7_MODE = 0x4,
  67. DPU_MATCH_MASK_9X9_MODE = 0x5,
  68. DPU_MATCH_MASK_MODE_BUTT
  69. }DPU_MATCH_MASK_MODE_E;
  70. typedef enum hiDPU_MATCH_DENS_ACCU_MODE_E
  71. {
  72. DPU_MATCH_DENS_ACCU_MODE_D0_A9 = 0x0,
  73. DPU_MATCH_DENS_ACCU_MODE_D1_A8 = 0x1,
  74. DPU_MATCH_DENS_ACCU_MODE_D2_A7 = 0x2,
  75. DPU_MATCH_DENS_ACCU_MODE_D3_A6 = 0x3,
  76. DPU_MATCH_DENS_ACCU_MODE_D4_A5 = 0x4,
  77. DPU_MATCH_DENS_ACCU_MODE_D5_A4 = 0x5,
  78. DPU_MATCH_DENS_ACCU_MODE_D6_A3 = 0x6,
  79. DPU_MATCH_DENS_ACCU_MODE_D7_A2 = 0x7,
  80. DPU_MATCH_DENS_ACCU_MODE_D8_A1 = 0x8,
  81. DPU_MATCH_DENS_ACCU_MODE_D9_A0 = 0x9,
  82. DPU_MATCH_DENS_ACCU_MODE_BUTT
  83. }DPU_MATCH_DENS_ACCU_MODE_E;
  84. typedef enum hiDPU_MATCH_SPEED_ACCU_MODE_E
  85. {
  86. DPU_MATCH_SPEED_ACCU_MODE_SPEED = 0x0,
  87. DPU_MATCH_SPEED_ACCU_MODE_ACCU = 0x1,
  88. DPU_MATCH_SPEED_ACCU_MODE_BUTT
  89. }DPU_MATCH_SPEED_ACCU_MODE_E;
  90. typedef enum hiDPU_MATCH_DISP_SUBPIXEL_E
  91. {
  92. DPU_MATCH_DISP_SUBPIXEL_DISABLE = 0x0,
  93. DPU_MATCH_DISP_SUBPIXEL_ENABLE = 0x1,
  94. DPU_MATCH_DISP_SUBPIXEL_BUTT
  95. }DPU_MATCH_DISP_SUBPIXEL_E;
  96. typedef struct hiDPU_MATCH_GRP_ATTR_S
  97. {
  98. SIZE_S stLeftImageSize; /* Left image size. */
  99. SIZE_S stRightImageSize; /* Right image size. */
  100. DPU_MATCH_MASK_MODE_E enMatchMaskMode; /* Aggregation mask mode. */
  101. DPU_MATCH_DENS_ACCU_MODE_E enDensAccuMode; /* Adjust density-accuracy trade-off. */
  102. DPU_MATCH_SPEED_ACCU_MODE_E enSpeedAccuMode; /* Adjust speed-accuracy trade-off. */
  103. DPU_MATCH_DISP_SUBPIXEL_E enDispSubpixelEn; /* Calculate subpixel disparity or not. */
  104. HI_U16 u16DispNum; /* The number of disparity, when the value is less than or equal to 128,
  105. it must be the multiple of 16, and when the value is greater than 128,
  106. it must be the multiple of 32. Range:[16,256] */
  107. HI_U16 u16DispStartPos; /* Minimum disparity, it must be the multiple of 2. Range:[0,126] */
  108. HI_U32 u32Depth; /* The depth of user image queue for getting Match output image,
  109. it can not be changed dynamic. Range:[0,8] */
  110. HI_BOOL bNeedSrcFrame; /* The flag of getting source videoframe.It will effect when bind dpu rect. */
  111. DPU_MATCH_MEM_INFO_S stAssistBuf; /* Assistance buffer. */
  112. FRAME_RATE_CTRL_S stFrameRate; /* Grp frame rate contrl. */
  113. }DPU_MATCH_GRP_ATTR_S;
  114. typedef struct hiDPU_MATCH_CHN_ATTR_S
  115. {
  116. SIZE_S stImageSize; /* Output image size. */
  117. }DPU_MATCH_CHN_ATTR_S;
  118. #ifdef __cplusplus
  119. #if __cplusplus
  120. }
  121. #endif
  122. #endif /* __cplusplus */
  123. #endif /* __HI_COMM_MATCH_H__ */