hi_comm_gdc.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /******************************************************************************
  2. Copyright (C), 2016, Hisilicon Tech. Co., Ltd.
  3. ******************************************************************************
  4. File Name : hi_comm_gdc.h
  5. Version : Initial Draft
  6. Author : Hisilicon multimedia software group
  7. Created : 2016/07/15
  8. Last Modified :
  9. Description :
  10. Function List :
  11. ******************************************************************************/
  12. #ifndef __HI_COMM_GDC_H__
  13. #define __HI_COMM_GDC_H__
  14. #ifdef __cplusplus
  15. #if __cplusplus
  16. extern "C" {
  17. #endif
  18. #endif /* __cplusplus */
  19. #include "hi_type.h"
  20. #include "hi_common.h"
  21. #include "hi_errno.h"
  22. #include "hi_comm_video.h"
  23. //#define MAKE_DWORD(high,low) (((low)&0x0000ffff)|((high)<<16))
  24. //#define HIGH_WORD(x) (((x)&0xffff0000)>>16)
  25. //#define LOW_WORD(x) ((x)&0x0000ffff)
  26. /* failure caused by malloc buffer */
  27. #define HI_ERR_GDC_NOBUF HI_DEF_ERR(HI_ID_GDC, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF)
  28. #define HI_ERR_GDC_BUF_EMPTY HI_DEF_ERR(HI_ID_GDC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY)
  29. #define HI_ERR_GDC_NULL_PTR HI_DEF_ERR(HI_ID_GDC, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR)
  30. #define HI_ERR_GDC_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_GDC, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM)
  31. #define HI_ERR_GDC_BUF_FULL HI_DEF_ERR(HI_ID_GDC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL)
  32. #define HI_ERR_GDC_SYS_NOTREADY HI_DEF_ERR(HI_ID_GDC, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY)
  33. #define HI_ERR_GDC_NOT_SUPPORT HI_DEF_ERR(HI_ID_GDC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT)
  34. #define HI_ERR_GDC_NOT_PERMITTED HI_DEF_ERR(HI_ID_GDC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM)
  35. #define HI_ERR_GDC_BUSY HI_DEF_ERR(HI_ID_GDC, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY)
  36. #define HI_ERR_GDC_INVALID_CHNID HI_DEF_ERR(HI_ID_GDC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID)
  37. #define HI_ERR_GDC_CHN_UNEXIST HI_DEF_ERR(HI_ID_GDC, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST)
  38. #define FISHEYE_MAX_REGION_NUM 4
  39. #define FISHEYE_LMFCOEF_NUM 128
  40. #define GDC_PMFCOEF_NUM 9
  41. typedef HI_S32 GDC_HANDLE;
  42. typedef struct hiGDC_TASK_ATTR_S
  43. {
  44. VIDEO_FRAME_INFO_S stImgIn; /* Input picture */
  45. VIDEO_FRAME_INFO_S stImgOut; /* Output picture */
  46. HI_U64 au64privateData[4]; /* RW; Private data of task */
  47. HI_U64 reserved; /* RW; Debug information,state of current picture */
  48. } GDC_TASK_ATTR_S;
  49. /* Mount mode of device*/
  50. typedef enum hiFISHEYE_MOUNT_MODE_E
  51. {
  52. FISHEYE_DESKTOP_MOUNT = 0, /* Desktop mount mode */
  53. FISHEYE_CEILING_MOUNT = 1, /* Ceiling mount mode */
  54. FISHEYE_WALL_MOUNT = 2, /* wall mount mode */
  55. FISHEYE_MOUNT_MODE_BUTT
  56. } FISHEYE_MOUNT_MODE_E;
  57. /* View mode of client*/
  58. typedef enum hiFISHEYE_VIEW_MODE_E
  59. {
  60. FISHEYE_VIEW_360_PANORAMA = 0, /* 360 panorama mode of gdc correction */
  61. FISHEYE_VIEW_180_PANORAMA = 1, /* 180 panorama mode of gdc correction */
  62. FISHEYE_VIEW_NORMAL = 2, /* normal mode of gdc correction */
  63. FISHEYE_NO_TRANSFORMATION = 3, /* no gdc correction */
  64. FISHEYE_VIEW_MODE_BUTT
  65. } FISHEYE_VIEW_MODE_E;
  66. /*Fisheye region correction attribute */
  67. typedef struct hiFISHEYE_REGION_ATTR_S
  68. {
  69. FISHEYE_VIEW_MODE_E enViewMode; /* RW; gdc view mode */
  70. HI_U32 u32InRadius; /* RW; inner radius of gdc correction region*/
  71. HI_U32 u32OutRadius; /* RW; out radius of gdc correction region*/
  72. HI_U32 u32Pan; /* RW; Range: [0, 360] */
  73. HI_U32 u32Tilt; /* RW; Range: [0, 360] */
  74. HI_U32 u32HorZoom; /* RW; Range: [1, 4095] */
  75. HI_U32 u32VerZoom; /* RW; Range: [1, 4095] */
  76. RECT_S stOutRect; /* RW; out Imge rectangle attribute */
  77. } FISHEYE_REGION_ATTR_S;
  78. /*Fisheye all regions correction attribute */
  79. typedef struct hiFISHEYE_ATTR_S
  80. {
  81. HI_BOOL bEnable; /* RW; whether enable fisheye correction or not */
  82. HI_BOOL bLMF; /* RW; whether gdc len's LMF coefficient is from user config or from default linear config */
  83. HI_BOOL bBgColor; /* RW; whether use background color or not */
  84. HI_U32 u32BgColor; /* RW; Range: [0,0xffffff]the background color RGB888*/
  85. HI_S32 s32HorOffset; /* RW; Range: [-511, 511], the horizontal offset between image center and physical center of len*/
  86. HI_S32 s32VerOffset; /* RW; Range: [-511, 511], the vertical offset between image center and physical center of len*/
  87. HI_U32 u32TrapezoidCoef; /* RW; Range: [0, 32], strength coefficient of trapezoid correction */
  88. HI_S32 s32FanStrength; /* RW; Range: [-760, 760], strength coefficient of fan correction */
  89. FISHEYE_MOUNT_MODE_E enMountMode; /* RW; gdc mount mode */
  90. HI_U32 u32RegionNum; /* RW; Range: [1, FISHEYE_MAX_REGION_NUM], gdc correction region number */
  91. FISHEYE_REGION_ATTR_S astFishEyeRegionAttr[FISHEYE_MAX_REGION_NUM]; /* RW; attribution of gdc correction region */
  92. } FISHEYE_ATTR_S;
  93. /*Spread correction attribute */
  94. typedef struct hiSPREAD_ATTR_S
  95. {
  96. HI_BOOL bEnable; /* RW; whether enable spread or not */
  97. HI_U32 u32SpreadCoef; /* RW; Range: [0, 18],strength coefficient of spread correction */
  98. SIZE_S stDestSize; /* RW; dest size of spread*/
  99. } SPREAD_ATTR_S;
  100. /*Fisheye Job Config */
  101. typedef struct hiFISHEYE_JOB_CONFIG_S
  102. {
  103. HI_U64 u64LenMapPhyAddr; /* LMF coefficient Physic Addr*/
  104. } FISHEYE_JOB_CONFIG_S;
  105. /*Fisheye Config */
  106. typedef struct hiFISHEYE_CONFIG_S
  107. {
  108. HI_U16 au16LMFCoef[FISHEYE_LMFCOEF_NUM]; /*RW; LMF coefficient of gdc len */
  109. } FISHEYE_CONFIG_S;
  110. /*Gdc PMF Attr */
  111. typedef struct hiGDC_PMF_ATTR_S
  112. {
  113. HI_S64 as64PMFCoef[GDC_PMFCOEF_NUM]; /*W; PMF coefficient of gdc */
  114. } GDC_PMF_ATTR_S;
  115. #ifdef __cplusplus
  116. #if __cplusplus
  117. }
  118. #endif
  119. #endif /* __cplusplus */
  120. #endif /* __HI_COMM_GDC_H__ */