├── .gitignore ├── CMakeLists.txt ├── README.md ├── hisi_sdk ├── include │ ├── aacdec.h │ ├── aacenc.h │ ├── acodec.h │ ├── autoconf.h │ ├── fisheye_calibrate.h │ ├── hi_ae_comm.h │ ├── hi_af_comm.h │ ├── hi_avs_lut_generate.h │ ├── hi_avs_position_query.h │ ├── hi_awb_comm.h │ ├── hi_buffer.h │ ├── hi_comm_3a.h │ ├── hi_comm_adec.h │ ├── hi_comm_aenc.h │ ├── hi_comm_ai.h │ ├── hi_comm_aio.h │ ├── hi_comm_ao.h │ ├── hi_comm_avs.h │ ├── hi_comm_dis.h │ ├── hi_comm_dpu_match.h │ ├── hi_comm_dpu_rect.h │ ├── hi_comm_gdc.h │ ├── hi_comm_hdmi.h │ ├── hi_comm_isp.h │ ├── hi_comm_ive.h │ ├── hi_comm_rc.h │ ├── hi_comm_region.h │ ├── hi_comm_snap.h │ ├── hi_comm_sns.h │ ├── hi_comm_svp.h │ ├── hi_comm_sys.h │ ├── hi_comm_vb.h │ ├── hi_comm_vdec.h │ ├── hi_comm_venc.h │ ├── hi_comm_vgs.h │ ├── hi_comm_vi.h │ ├── hi_comm_video.h │ ├── hi_comm_vo.h │ ├── hi_comm_vpss.h │ ├── hi_common.h │ ├── hi_common_cipher.h │ ├── hi_debug.h │ ├── hi_defines.h │ ├── hi_dsp.h │ ├── hi_errno.h │ ├── hi_i2c.h │ ├── hi_isp_bin.h │ ├── hi_isp_debug.h │ ├── hi_isp_defines.h │ ├── hi_ive.h │ ├── hi_math.h │ ├── hi_md.h │ ├── hi_mipi.h │ ├── hi_mipi_tx.h │ ├── hi_nnie.h │ ├── hi_resampler_api.h │ ├── hi_securec.h │ ├── hi_sns_ctrl.h │ ├── hi_spi.h │ ├── hi_ssp.h │ ├── hi_tde_api.h │ ├── hi_tde_errcode.h │ ├── hi_tde_type.h │ ├── hi_type.h │ ├── hi_types.h │ ├── hi_unf_cipher.h │ ├── hifb.h │ ├── hiir.h │ ├── ivs_md.h │ ├── list.h │ ├── mpi_ae.h │ ├── mpi_audio.h │ ├── mpi_avs.h │ ├── mpi_awb.h │ ├── mpi_dpu_match.h │ ├── mpi_dpu_rect.h │ ├── mpi_dsp.h │ ├── mpi_gdc.h │ ├── mpi_hdmi.h │ ├── mpi_isp.h │ ├── mpi_ive.h │ ├── mpi_nnie.h │ ├── mpi_region.h │ ├── mpi_snap.h │ ├── mpi_sys.h │ ├── mpi_vb.h │ ├── mpi_vdec.h │ ├── mpi_venc.h │ ├── mpi_vgs.h │ ├── mpi_vi.h │ ├── mpi_vo.h │ ├── mpi_vpss.h │ ├── sample_comm.h │ ├── securec.h │ ├── securectype.h │ ├── vdec_exp.h │ ├── vou_exp.h │ └── watchdog.h └── lib │ ├── libVoiceEngine.a │ ├── libVoiceEngine.so │ ├── lib_hiae.a │ ├── lib_hiae.so │ ├── lib_hiawb.a │ ├── lib_hiawb.so │ ├── lib_hiawb_natura.a │ ├── lib_hiawb_natura.so │ ├── lib_hidehaze.a │ ├── lib_hidehaze.so │ ├── lib_hidrc.a │ ├── lib_hidrc.so │ ├── lib_hildci.a │ ├── lib_hildci.so │ ├── libaacdec.a │ ├── libaacdec.so │ ├── libaacenc.a │ ├── libaacenc.so │ ├── libdnvqe.a │ ├── libdnvqe.so │ ├── libdpu_match.a │ ├── libdpu_match.so │ ├── libdpu_rect.a │ ├── libdpu_rect.so │ ├── libdsp.a │ ├── libdsp.so │ ├── libgomp.so.1 │ ├── libhdmi.a │ ├── libhdmi.so │ ├── libhi_cipher.a │ ├── libhi_cipher.so │ ├── libhiavslut.a │ ├── libhiavslut.so │ ├── libhifisheyecalibrate.a │ ├── libhifisheyecalibrate.so │ ├── libhive_AEC.so │ ├── libhive_AGC.so │ ├── libhive_ANR.so │ ├── libhive_EQ.so │ ├── libhive_HPF.so │ ├── libhive_RES.so │ ├── libhive_common.so │ ├── libhive_record.so │ ├── libisp.a │ ├── libisp.so │ ├── libive.a │ ├── libive.so │ ├── libmd.a │ ├── libmd.so │ ├── libmpi.a │ ├── libmpi.so │ ├── libnnie.a │ ├── libnnie.so │ ├── libpos_query.a │ ├── libpos_query.so │ ├── libsecurec.a │ ├── libsecurec.so │ ├── libsns_imx290.a │ ├── libsns_imx290.so │ ├── libsns_imx290_slave.a │ ├── libsns_imx290_slave.so │ ├── libsns_imx334.a │ ├── libsns_imx334.so │ ├── libtde.a │ ├── libtde.so │ ├── libupvqe.a │ └── libupvqe.so ├── include ├── common.h ├── common_struct.h ├── parameters.h ├── yolov3.h └── yolov3_struct.h ├── main.c ├── resources ├── dog_bike_car.jpg └── dog_bike_car_416x416.bgr ├── run.sh └── src ├── common.c └── yolov3.c /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | build -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project(yolov3_hisi_nnie) 3 | 4 | set(CMAKE_CXX_STANDARD 11) 5 | SET(CMAKE_C_COMPILER /opt/hisi-linux/x86-arm/arm-himix200-linux/bin/arm-himix200-linux-gcc) 6 | SET(CMAKE_CXX_COMPILER /opt/hisi-linux/x86-arm/arm-himix200-linux/bin/arm-himix200-linux-g++) 7 | include_directories( 8 | ${PROJECT_SOURCE_DIR}/include 9 | ${PROJECT_SOURCE_DIR}/hisi_sdk/include 10 | ) 11 | set(LIB_DIR ${PROJECT_SOURCE_DIR}/hisi_sdk/lib) 12 | link_directories(${LIB_DIR}) 13 | aux_source_directory(${PROJECT_SOURCE_DIR}/src SRC_DIR) 14 | 15 | add_library(yolov3 SHARED ${SRC_DIR}) 16 | 17 | target_link_libraries(yolov3 18 | pthread dnvqe isp ive mpi nnie 19 | securec upvqe VoiceEngine 20 | _hiae _hiawb _hidehaze _hidrc 21 | _hildci hive_common 22 | ) 23 | 24 | add_executable(yolov3_sample ${PROJECT_SOURCE_DIR}/main.c) 25 | target_link_libraries(yolov3_sample yolov3) 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HISILICON NNIE YOLOV3 SAMPLE 2 | 基于海思3519的YOLOv3_NNIE例程 3 | 海思官方文档附带了很多目标检测算法的例子,但是在阅读的时候十分痛苦(我自己),函数各种跳跃;自带的Makefile也是一层一层嵌套,实在难以理解。所以单独将YOLOv3提取出来,并用CMakeLists替代层层嵌套的Makefile,方便阅读和将YOLOv3替换为其他网络。目前将海思例程中的YOLOv3分为两部分,一部分为通用的直接调用海思SDK的common部分,和YOLOv3特定的数据结构及方法。 4 | 萌新刚学海思,希望有海思大佬能提供一下其他网络的优化和部署。(海思好难啊)

5 | 水平很菜,随缘更新。 6 | 7 | 8 | ## 1. 下载 9 | ```git clone https://github.com/gesilaa/yolov3_hisi_nnie.git``` 10 | 11 | ## 2. 编译 12 | 我使用的是海思3519芯片,所以如果芯片不同的话,需要在CMakeLists.txt里面替换自己的交叉编译工具链。 13 | ``` 14 | export LC_ALL=C 15 | cd yolov3_hisi_nnie 16 | mkdir build; cd build 17 | cmake.. 18 | make 19 | cp ../run.sh ./ 20 | ``` 21 | 22 | ## 3. 运行 23 | 将工程复制到海思终端上 24 | ``` 25 | cd yolov3_hisi_nnie/build 26 | sh ./run.sh 27 | ``` 28 | -------------------------------------------------------------------------------- /hisi_sdk/include/fisheye_calibrate.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : histitch.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 10 | Description : 11 | History : 12 | 1.Date : 2016/09/25 13 | Author : 14 | Modification: Created file 15 | ******************************************************************************/ 16 | 17 | 18 | #ifndef __HIGDC_H__ 19 | #define __HIGDC_H__ 20 | 21 | #ifdef __cplusplus 22 | #if __cplusplus 23 | extern "C" { 24 | #endif 25 | #endif /* __cplusplus */ 26 | 27 | #include "hi_comm_video.h" 28 | 29 | #define HI_ERR_FISHEYE_CALIBRATE_NULL_PTR 0xA0258011 30 | #define HI_ERR_FISHEYE_CALIBRATE_ILLEGAL_PARAM 0xA0258012 31 | #define HI_ERR_FISHEYE_CALIBRATE_NOT_SUPPORT 0xA0258013 32 | 33 | 34 | typedef enum hiFISHEYE_CALIBRATE_LEVEL_E 35 | { 36 | LEVEL_0 = 0, /*calibrate level 0*/ 37 | LEVEL_1 = 1, /*calibrate level 1*/ 38 | LEVEL_2 = 2, /*calibrate level 2*/ 39 | 40 | LEVEL_BUTT 41 | } FISHEYE_CALIBRATE_LEVEL_E; 42 | 43 | 44 | typedef struct hiFISHEYE_CALIBTATE_RESULT_S 45 | { 46 | HI_S32 s32OffsetV; /* the horizontal offset between image center and physical center of len*/ 47 | HI_S32 s32OffsetH; /* the vertical offset between image center and physical center of len*/ 48 | HI_S32 s32Radius_X; /* the X coordinate of physical center of len*/ 49 | HI_S32 s32Radius_Y; /* the Y coordinate of physical center of len*/ 50 | HI_U32 u32Radius; /* the radius of len*/ 51 | } FISHEYE_CALIBTATE_RESULT_S; 52 | 53 | typedef struct hiCALIBTATE_OUTPUT_S 54 | { 55 | FISHEYE_CALIBTATE_RESULT_S stCalibrateResult; /*the output of result*/ 56 | } CALIBTATE_OUTPUT_S; 57 | 58 | 59 | HI_S32 HI_FISHEYE_ComputeCalibrateResult(VIDEO_FRAME_S *pstVFramIn, FISHEYE_CALIBRATE_LEVEL_E enLevel, CALIBTATE_OUTPUT_S *pOutCalibrate); 60 | HI_S32 HI_FISHEYE_MarkCalibrateResult(VIDEO_FRAME_S *pstPicIn, VIDEO_FRAME_S *pstPicOut, FISHEYE_CALIBTATE_RESULT_S *pCalibrateResult); 61 | 62 | 63 | #ifdef __cplusplus 64 | #if __cplusplus 65 | } 66 | #endif 67 | #endif /* __cplusplus */ 68 | 69 | 70 | #endif /* __HISTITCH_H__ */ 71 | 72 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_af_comm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_af_comm.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2012/12/20 10 | Description : 11 | History : 12 | 1.Date : 2012/12/20 13 | Author : 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | #ifndef __HI_AF_COMM_H__ 18 | #define __HI_AF_COMM_H__ 19 | 20 | #include "hi_type.h" 21 | 22 | #ifdef __cplusplus 23 | #if __cplusplus 24 | extern "C" { 25 | #endif 26 | #endif /* End of #ifdef __cplusplus */ 27 | 28 | #define HI_AF_LIB_NAME "hisi_af_lib" 29 | 30 | #ifdef __cplusplus 31 | #if __cplusplus 32 | } 33 | #endif 34 | #endif /* End of #ifdef __cplusplus */ 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_avs_lut_generate.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2017-2018, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : hi_avs_lut_generate.h 5 | Version : Version 4.1 (for Hi3559A) 6 | Created : 2017/7/5 7 | Last Modified : 8 | Description : API for mesh(LUT) library in ARM. 9 | Function List : 10 | History : 11 | 12 | 1.Date : 2018/02/26 13 | Modification : First time to delivery 14 | ******************************************************************************/ 15 | 16 | #ifndef __HI_AVS_LUT_GENERATE_H__ 17 | #define __HI_AVS_LUT_GENERATE_H__ 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | #include "hi_type.h" 24 | #include "hi_comm_avs.h" 25 | 26 | #define AVS_MAX_CAMERA_NUMBER 8 27 | #define AVS_LUT_SIZE 0x400000 //4MB 28 | #define AVS_CALIBRATION_FILE_LENGTH 0x2800 //10KB 29 | 30 | 31 | /* the status of avs interface returned */ 32 | typedef enum hiAVS_STATUS_E 33 | { 34 | AVS_STATUS_EOF = -1, /*internal error codes*/ 35 | AVS_STATUS_OK = 0, /*success*/ 36 | 37 | /* error statuses*/ 38 | AVS_STATUS_FILE_READ_ERROR, 39 | AVS_STATUS_FILE_WRITE_ERROR, 40 | AVS_STATUS_FILE_INVALID, 41 | AVS_STATUS_ALLOC_FAILED, 42 | AVS_STATUS_INVALID_PARAM, 43 | 44 | AVS_STATUS_BUTT 45 | }AVS_STATUS_E; 46 | 47 | /* 48 | Specification of calibration file type 49 | AVS_TYPE_AVSP: calibration file come from AVSP calibration 50 | AVS_TYPE_PTGUI: calibration file come from PTGUI calibration 51 | AVS_TYPE_HUGIN: calibration file come from HUGIN calibration 52 | AVS_TYPE_BUTT: reserved. 53 | */ 54 | typedef enum hiAVS_TYPE_E 55 | { 56 | AVS_TYPE_AVSP = 0, 57 | AVS_TYPE_PTGUI = 1, 58 | AVS_TYPE_HUGIN = 2, 59 | AVS_TYPE_BUTT 60 | }AVS_TYPE_E; 61 | 62 | /* 63 | Specification of the mask type 64 | AVS_MASK_SHAPE_RECT: build a rect shape mask; 65 | AVS_MASK_SHAPE_ELLIPSE: build a ecllipse shape mask, including circl shape; 66 | AVS_MASK_SHAPE_BUTT: reserved. 67 | */ 68 | typedef enum hiAVS_MASK_SHAPE_E 69 | { 70 | AVS_MASK_SHAPE_RECT = 0, 71 | AVS_MASK_SHAPE_ELLIPSE = 1, 72 | AVS_MASK_SHAPE_BUTT 73 | }AVS_MASK_SHAPE_E; 74 | 75 | /* 76 | Specification of the mask define. 77 | enMaskShape : The mask shape type 78 | s32OffsetH : The offset of center in x direction 79 | s32OffsetV : The offset of center in y direction 80 | u32HalfMajorAxis : The half of long axis in X direction 81 | u32HalfMinorAxis : The half of short axis in Y direction 82 | */ 83 | typedef struct hiAVS_MASK_DEFINE_S 84 | { 85 | AVS_MASK_SHAPE_E enMaskShape; 86 | HI_S32 s32OffsetH; 87 | HI_S32 s32OffsetV; 88 | HI_U32 u32HalfMajorAxis; 89 | HI_U32 u32HalfMinorAxis; 90 | }AVS_MASK_DEFINE_S; 91 | 92 | /* 93 | Specification of each lut mask input. 94 | bSameMask: If true, all the mask using mask[0] parameters, otherwise using eack mask parameters; 95 | bInputYuvMask: If ture, using the yuv400 mask directly; else creat a new yuv400 by using stMaskDefine parameters. 96 | stMaskDefine : Mask define for each camera 97 | u64MaskVirAddr : Virtual memory for saving each mask, the memory size for each one should be sizeof(HI_U16)*u32Width*u32Height, which u32Width and u32Height are the input resolution. 98 | */ 99 | typedef struct hiAVS_LUT_MASK_S 100 | { 101 | HI_BOOL bSameMask; 102 | HI_BOOL bInputYuvMask; 103 | AVS_MASK_DEFINE_S stMaskDefine[AVS_MAX_CAMERA_NUMBER]; 104 | HI_U64 u64MaskVirAddr[AVS_MAX_CAMERA_NUMBER]; 105 | }AVS_LUT_MASK_S; 106 | 107 | /* 108 | Specification of fine tuning for each camera. 109 | bAdjustEn: the enable of fine tuning for each camera. 110 | s32Yaw: the Yaw-direction adjustment for each camera. 111 | s32Pitch : the Pitch-direction adjustment for each camera. 112 | s32Roll: the Roll-direction adjustment for each camera. 113 | s32OffsetX: the X-direction adjustment for each camera. 114 | s32OffsetY : the Y-direction adjustment for each camera. 115 | */ 116 | typedef struct hiAVS_ADJUST_S 117 | { 118 | HI_BOOL bAdjustEn; 119 | HI_S32 s32Yaw; /* Range: [-18000, 18000]; Yaw angle. */ 120 | HI_S32 s32Pitch; /* Range: [-18000, 18000]; Pitch angle. */ 121 | HI_S32 s32Roll; /* Range: [-18000, 18000]; Roll angle. */ 122 | HI_S32 s32OffsetX; 123 | HI_S32 s32OffsetY; 124 | } AVS_ADJUST_S; 125 | 126 | /* 127 | Specification of fine tuning. 128 | bFineTuningEn: the enable of fine tuning function. 129 | stAdjust: the adjustment for each camera. 130 | */ 131 | typedef struct hiAVS_FINE_TUNING_S 132 | { 133 | HI_BOOL bFineTuningEn; 134 | AVS_ADJUST_S stAdjust[AVS_MAX_CAMERA_NUMBER]; 135 | } AVS_FINE_TUNING_S; 136 | 137 | /* 138 | the input of lut generate function. 139 | enType: input calibration file type 140 | u64FileInputVirAddr: Virtual memory for saving input calibration file, the max memory size is 10KB; 141 | pstMask : The input parameters which define the mask 142 | fStitchDistance: The radius of the sphere used to create points to sample from. Stitching will be performed correctly at this distance. (Ignored if calibration from PTGui.) 143 | enLutAccuracy: The accuracy of the lookup table. Valid values are 0 or 1. 144 | stFineTuningCfg : Pitch/Yaw/Roll/Xoffset/Yoffset for each camera 145 | */ 146 | typedef struct hiAVS_LUT_GENERATE_INPUT_S 147 | { 148 | AVS_TYPE_E enType; 149 | HI_U64 u64FileInputVirAddr; 150 | AVS_LUT_MASK_S *pstMask; 151 | HI_FLOAT fStitchDistance; 152 | AVS_LUT_ACCURACY_E enLutAccuracy; 153 | AVS_FINE_TUNING_S stFineTuningCfg; 154 | }AVS_LUT_GENERATE_INPUT_S; 155 | 156 | /* 157 | Generates mesh(LUT) files. 158 | stLutInput: the input of lut Generates. 159 | u64LutOutputVirAddr: Virtual memory for saving each output lookup tables, the memory size for each one should be 4MB. 160 | */ 161 | AVS_STATUS_E HI_AVS_LutGenerate(AVS_LUT_GENERATE_INPUT_S stLutInput, HI_U64 u64LutOutputVirAddr[AVS_MAX_CAMERA_NUMBER]); 162 | 163 | #ifdef __cplusplus 164 | } 165 | #endif 166 | 167 | #endif // __hi_avs_lut_generate_H__ -------------------------------------------------------------------------------- /hisi_sdk/include/hi_avs_position_query.h: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | Copyright (C), 2017-2018, Hisilicon Tech. Co., Ltd. 4 | ****************************************************************************** 5 | File Name : hi_avs_position_query.h 6 | Version : Version 1.0 7 | Created : 2018/1/24 8 | Last Modified : 9 | Description : API for avs position query library. 10 | Function List : 11 | History : 12 | 13 | 1.Date : 2018/05/09 14 | Modification : First time to delivery 15 | ******************************************************************************/ 16 | 17 | #ifndef __HI_AVS_POSITION_QUERY_H__ 18 | #define __HI_AVS_POSITION_QUERY_H__ 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | #include "hi_comm_avs.h" 26 | 27 | #define AVS_MAX_INPUT_NUMBER 6 28 | 29 | /**Specification of the LUT accuracy*/ 30 | typedef enum hiAVS_QUERY_MODE_E 31 | { 32 | AVS_DST_QUERY_SRC = 0, 33 | AVS_SRC_QUERY_DST = 1, /* Not support */ 34 | AVS_QUERY_MODE_BUTT 35 | }AVS_QUERY_MODE_E; 36 | 37 | typedef struct hiAVS_CONFIG_S 38 | { 39 | AVS_QUERY_MODE_E enMeshMode; /* mesh generating mode. */ 40 | HI_U32 u32Camera; /* camera number*/ 41 | SIZE_S stSrcSize; /* Range: Hi3559AV100ES = [256, 8192] | Hi3559AV100 = [256, 8192] | Hi3556AV100 = [256, 8192]; Size of source image. */ 42 | SIZE_S stDstSize; /* Range: Hi3559AV100ES = [256, 16384] | Hi3559AV100 = [256, 16384] | Hi3556AV100 = [256, 8192]; Size of target image. */ 43 | AVS_PROJECTION_MODE_E enPrjMode; /* Projection mode. */ 44 | POINT_S stCenter; /* Range: [-8192,8192]: Center point. */ 45 | AVS_FOV_S stFOV; /* Output FOV. */ 46 | AVS_ROTATION_S stORIRotation; /* Output original rotation. */ 47 | AVS_ROTATION_S stRotation; /* Output rotation. */ 48 | HI_U32 u32MeshWinSize; /* Range:[2,256], the window size of mesh data. */ 49 | AVS_LUT_ACCURACY_E enLutAccuracy; /* Accuracy of lut file. */ 50 | HI_U64 u64LutVirAddr[AVS_MAX_INPUT_NUMBER]; /* the virtual address of lut data. */ 51 | }AVS_CONFIG_S; 52 | 53 | /** 54 | Generates the lookup table about the position between output image and source image. 55 | pstAvsConfig: output image config 56 | u64MeshVirAddr: the virtual address of mesh data to save. 57 | **/ 58 | HI_S32 HI_AVS_PosMeshGenerate(AVS_CONFIG_S *pstAvsConfig, HI_U64 u64MeshVirAddr[AVS_MAX_INPUT_NUMBER]); 59 | 60 | /** 61 | Query the position in source image space from the output image space 62 | pstDstSize : the resolution of destination image; 63 | u32WindowSize : the windows size of position mesh data, should be same as generating the position mesh. 64 | u64MeshVirAddr: the virtual address of position mesh data, the memory size should be same as the mesh file. 65 | pstDstPointIn : the input position in destination image space. 66 | pstSrcPointOut: the output position in source image space. 67 | **/ 68 | HI_S32 HI_AVS_PosQueryDst2Src(SIZE_S *pstDstSize, HI_U32 u32WindowSize,HI_U64 u64MeshVirAddr, 69 | POINT_S *pstDstPointIn, POINT_S *pstSrcPointOut); 70 | 71 | /** 72 | Query the position in output stitch image space from the source image space 73 | pstSrcSize: the resolution of source image; 74 | u32WindowSize: the windows size of position mesh data, should be same as generating the position mesh. 75 | u64MeshVirAddr:the virtual address of position mesh data, the memory size should be same as the mesh file. 76 | pstSrcPointIn: the input position in source image space. 77 | pstDstPointOut:the output position in destination image space. 78 | **/ 79 | HI_S32 HI_AVS_PosQuerySrc2Dst(SIZE_S *pstSrcSize, HI_U32 u32WindowSize, HI_U64 u64MeshVirAddr, 80 | POINT_S *pstSrcPointIn, POINT_S *pstDstPointOut); 81 | 82 | 83 | #ifdef __cplusplus 84 | } 85 | #endif 86 | 87 | #endif /*hi_avs_position_query.h*/ 88 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_awb_comm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_awb_comm.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2012/12/19 10 | Description : 11 | History : 12 | 1.Date : 2012/12/19 13 | Author : 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | #ifndef __HI_AWB_COMM_H__ 18 | #define __HI_AWB_COMM_H__ 19 | 20 | #include "hi_type.h" 21 | 22 | #ifdef __cplusplus 23 | #if __cplusplus 24 | extern "C" { 25 | #endif 26 | #endif /* End of #ifdef __cplusplus */ 27 | 28 | #define HI_AWB_LIB_NAME "hisi_awb_lib" 29 | 30 | typedef struct hiAWB_DBG_ATTR_S 31 | { 32 | HI_U16 u16WhiteLevel; 33 | HI_U16 u16BlackLevel; 34 | HI_U16 u16CrMax; 35 | HI_U16 u16CrMin; 36 | HI_U16 u16CbMax; 37 | HI_U16 u16CbMin; 38 | HI_U16 u16CrHigh; 39 | HI_U16 u16CrLow; 40 | HI_U16 u16CbHigh; 41 | HI_U16 u16CbLow; 42 | HI_U16 u16RawWhiteLevel; 43 | HI_U16 u16RawBlackLevel; 44 | HI_U16 u16RawCrMax; 45 | HI_U16 u16RawCrMin; 46 | HI_U16 u16RawCbMax; 47 | HI_U16 u16RawCbMin; 48 | HI_U16 u16RawCrHigh; 49 | HI_U16 u16RawCrLow; 50 | HI_U16 u16RawCbHigh; 51 | HI_U16 u16RawCbLow; 52 | 53 | HI_U16 u16WDRMode; 54 | HI_U16 u16Enable; 55 | HI_U16 u16ManualEnable; 56 | HI_U16 u16Zone; 57 | HI_U16 u16HighTemp; 58 | HI_U16 u16LowTemp; 59 | HI_U16 u16RefTemp; 60 | HI_U16 u16RgainBase; 61 | HI_U16 u16GgainBase; 62 | HI_U16 u16BgainBase; 63 | HI_S32 s32p1; 64 | HI_S32 s32p2; 65 | HI_S32 s32q; 66 | HI_S32 s32a; 67 | HI_S32 s32c; 68 | 69 | HI_U16 u16ManSatEnable; 70 | HI_U16 u16SatTarget; 71 | } AWB_DBG_ATTR_S; 72 | 73 | typedef struct hiAWB_ZONE_DBG_S 74 | { 75 | HI_U16 u16Sum; 76 | HI_U16 u16Rg; 77 | HI_U16 u16Bg; 78 | HI_U16 u16CountAll; 79 | HI_U16 u16CountMin; 80 | HI_U16 u16CountMax; 81 | HI_U16 u16RawRAvg; 82 | HI_U16 u16RawGAvg; 83 | HI_U16 u16RawBAvg; 84 | HI_U16 u16TK; 85 | HI_U16 u16Weight; 86 | HI_S16 s16Shift; 87 | } AWB_ZONE_DBG_S; 88 | 89 | typedef struct hiAWB_DBG_STATUS_S 90 | { 91 | HI_U32 u32FrmNumBgn; 92 | HI_U32 u32GlobalSum; 93 | HI_U16 u16GlobalRgSta; 94 | HI_U16 u16GlobalBgSta; 95 | HI_U16 u16GlobalCountAll; 96 | HI_U16 u16GlobalCountMin; 97 | HI_U16 u16GlobalCountMax; 98 | HI_U16 u16GlobalRAvg; 99 | HI_U16 u16GlobalGAvg; 100 | HI_U16 u16GlobalBAvg; 101 | HI_U16 u16TK; 102 | HI_U16 u16Rgain; 103 | HI_U16 u16Ggain; 104 | HI_U16 u16Bgain; 105 | HI_U16 au16CCM[CCM_MATRIX_SIZE]; 106 | 107 | HI_U32 au32HistInfo[256]; 108 | AWB_ZONE_DBG_S astZoneDebug[AWB_ZONE_NUM]; 109 | 110 | HI_U32 u32FrmNumEnd; 111 | } AWB_DBG_STATUS_S; 112 | 113 | /************************** sensor's interface to awb *********************/ 114 | 115 | typedef struct hiAWB_CCM_TAB_S 116 | { 117 | HI_U16 u16ColorTemp; /*RW; Range:[2000,10000]; Format:16.0; the current color temperature */ 118 | HI_U16 au16CCM[CCM_MATRIX_SIZE]; /*RW; Range: [0x0, 0xFFFF]; Format:8.8; CCM matrixes for different color temperature*/ 119 | } AWB_CCM_TAB_S; 120 | 121 | typedef struct hiAWB_CCM_S 122 | { 123 | HI_U16 u16CCMTabNum; /*RW; Range: [0x3, 0x7]; Format:16.0; The number of CCM matrixes*/ 124 | AWB_CCM_TAB_S astCCMTab[CCM_MATRIX_NUM]; 125 | } AWB_CCM_S; 126 | 127 | typedef struct hiAWB_AGC_TABLE_S 128 | { 129 | HI_BOOL bValid; 130 | 131 | HI_U8 au8Saturation[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW;adjust saturation, different iso with different saturation */ 132 | } AWB_AGC_TABLE_S; 133 | 134 | typedef struct hiAWB_SENSOR_DEFAULT_S 135 | { 136 | HI_U16 u16WbRefTemp; /* RW;reference color temperature for WB */ 137 | HI_U16 au16GainOffset[ISP_BAYER_CHN_NUM]; /*RW; gain offset for white balance */ 138 | HI_S32 as32WbPara[AWB_CURVE_PARA_NUM]; /*RW; parameter for wb curve,p1,p2,q1,a1,b1,c1 */ 139 | 140 | HI_U16 u16GoldenRgain; /* Rgain for the golden sample */ 141 | HI_U16 u16GoldenBgain; /* Bgain for the golden sample */ 142 | HI_U16 u16SampleRgain; /* Rgain for the current sample */ 143 | HI_U16 u16SampleBgain; /* Bgain for the current sample */ 144 | AWB_AGC_TABLE_S stAgcTbl; 145 | AWB_CCM_S stCcm; 146 | HI_U16 u16InitRgain; /*Init WB gain*/ 147 | HI_U16 u16InitGgain; 148 | HI_U16 u16InitBgain; 149 | HI_U8 u8AWBRunInterval; /*RW;AWB Run Interval*/ 150 | } AWB_SENSOR_DEFAULT_S; 151 | 152 | typedef struct hiAWB_SPEC_SENSOR_DEFAULT_S 153 | { 154 | ISP_SPECAWB_ATTR_S stSpecAwbAttrs; 155 | ISP_SPECAWB_CAA_CONTROl_S stCaaControl; 156 | } AWB_SPEC_SENSOR_DEFAULT_S; 157 | 158 | typedef struct hiAWB_SENSOR_EXP_FUNC_S 159 | { 160 | HI_S32(*pfn_cmos_get_awb_default)(VI_PIPE ViPipe, AWB_SENSOR_DEFAULT_S *pstAwbSnsDft); 161 | HI_S32(*pfn_cmos_get_awb_spec_default)(VI_PIPE ViPipe, AWB_SPEC_SENSOR_DEFAULT_S *pstAwbSpecSnsDft); 162 | } AWB_SENSOR_EXP_FUNC_S; 163 | 164 | typedef struct hiAWB_SENSOR_REGISTER_S 165 | { 166 | AWB_SENSOR_EXP_FUNC_S stSnsExp; 167 | } AWB_SENSOR_REGISTER_S; 168 | 169 | #ifdef __cplusplus 170 | #if __cplusplus 171 | } 172 | #endif 173 | #endif /* End of #ifdef __cplusplus */ 174 | 175 | #endif 176 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_comm_adec.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2018, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_comm_adec.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2006/12/15 10 | Last Modified : 11 | Description : 12 | Function List : 13 | History : 14 | 1.Date : 2006/12/15 15 | Author : z50825 16 | Modification : Created file 17 | 2.Date : 2007/5/10 18 | Author : z50825 19 | Modification : add err code 20 | ******************************************************************************/ 21 | 22 | 23 | #ifndef __HI_COMM_ADEC_H__ 24 | #define __HI_COMM_ADEC_H__ 25 | 26 | 27 | #include "hi_type.h" 28 | #include "hi_common.h" 29 | #include "hi_comm_aio.h" 30 | 31 | #ifdef __cplusplus 32 | #if __cplusplus 33 | extern "C"{ 34 | #endif 35 | #endif /* End of #ifdef __cplusplus */ 36 | 37 | typedef struct hiADEC_ATTR_G711_S 38 | { 39 | HI_U32 resv; 40 | }ADEC_ATTR_G711_S; 41 | 42 | typedef struct hiADEC_ATTR_G726_S 43 | { 44 | G726_BPS_E enG726bps; 45 | }ADEC_ATTR_G726_S; 46 | 47 | typedef struct hiADEC_ATTR_ADPCM_S 48 | { 49 | ADPCM_TYPE_E enADPCMType; 50 | }ADEC_ATTR_ADPCM_S; 51 | 52 | typedef struct hiADEC_ATTR_LPCM_S 53 | { 54 | HI_U32 resv; 55 | }ADEC_ATTR_LPCM_S; 56 | 57 | typedef enum hiADEC_MODE_E 58 | { 59 | ADEC_MODE_PACK = 0,/*require input is valid dec pack(a 60 | complete frame encode result), 61 | e.g.the stream get from AENC is a 62 | valid dec pack, the stream know actually 63 | pack len from file is also a dec pack. 64 | this mode is high-performative*/ 65 | ADEC_MODE_STREAM ,/*input is stream,low-performative, 66 | if you couldn't find out whether a stream is 67 | vaild dec pack,you could use 68 | this mode*/ 69 | ADEC_MODE_BUTT 70 | }ADEC_MODE_E; 71 | 72 | typedef struct hiADEC_CH_ATTR_S 73 | { 74 | PAYLOAD_TYPE_E enType; 75 | HI_U32 u32BufSize; /*buf size[2~MAX_AUDIO_FRAME_NUM]*/ 76 | ADEC_MODE_E enMode; /*decode mode*/ 77 | HI_VOID ATTRIBUTE *pValue; 78 | }ADEC_CHN_ATTR_S; 79 | 80 | typedef struct hiADEC_DECODER_S 81 | { 82 | PAYLOAD_TYPE_E enType; 83 | HI_CHAR aszName[17]; 84 | HI_S32 (*pfnOpenDecoder)(HI_VOID *pDecoderAttr, HI_VOID **ppDecoder); /*struct ppDecoder is packed by user,user malloc and free memory for this struct */ 85 | HI_S32 (*pfnDecodeFrm)(HI_VOID *pDecoder, HI_U8 **pu8Inbuf,HI_S32 *ps32LeftByte, 86 | HI_U16 *pu16Outbuf,HI_U32 *pu32OutLen,HI_U32 *pu32Chns); 87 | HI_S32 (*pfnGetFrmInfo)(HI_VOID *pDecoder, HI_VOID *pInfo); 88 | HI_S32 (*pfnCloseDecoder)(HI_VOID *pDecoder); 89 | HI_S32 (*pfnResetDecoder)(HI_VOID *pDecoder); 90 | } ADEC_DECODER_S; 91 | 92 | typedef enum hiEN_ADEC_ERR_CODE_E 93 | { 94 | ADEC_ERR_DECODER_ERR = 64, 95 | ADEC_ERR_BUF_LACK, 96 | 97 | } EN_ADEC_ERR_CODE_E; 98 | 99 | 100 | /* invlalid device ID */ 101 | #define HI_ERR_ADEC_INVALID_DEVID HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) 102 | /* invlalid channel ID */ 103 | #define HI_ERR_ADEC_INVALID_CHNID HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) 104 | /* at lease one parameter is illagal ,eg, an illegal enumeration value */ 105 | #define HI_ERR_ADEC_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 106 | /* channel exists */ 107 | #define HI_ERR_ADEC_EXIST HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) 108 | /* channel unexists */ 109 | #define HI_ERR_ADEC_UNEXIST HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) 110 | /* using a NULL point */ 111 | #define HI_ERR_ADEC_NULL_PTR HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 112 | /* try to enable or initialize system,device or channel, before configing attribute */ 113 | #define HI_ERR_ADEC_NOT_CONFIG HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) 114 | /* operation is not supported by NOW */ 115 | #define HI_ERR_ADEC_NOT_SUPPORT HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 116 | /* operation is not permitted ,eg, try to change stati attribute */ 117 | #define HI_ERR_ADEC_NOT_PERM HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 118 | /* failure caused by malloc memory */ 119 | #define HI_ERR_ADEC_NOMEM HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 120 | /* failure caused by malloc buffer */ 121 | #define HI_ERR_ADEC_NOBUF HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 122 | /* no data in buffer */ 123 | #define HI_ERR_ADEC_BUF_EMPTY HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) 124 | /* no buffer for new data */ 125 | #define HI_ERR_ADEC_BUF_FULL HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) 126 | /* system is not ready,had not initialed or loaded*/ 127 | #define HI_ERR_ADEC_SYS_NOTREADY HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 128 | /* decoder internal err */ 129 | #define HI_ERR_ADEC_DECODER_ERR HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_DECODER_ERR) 130 | /* input buffer not enough to decode one frame */ 131 | #define HI_ERR_ADEC_BUF_LACK HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_BUF_LACK) 132 | 133 | 134 | 135 | 136 | #ifdef __cplusplus 137 | #if __cplusplus 138 | } 139 | #endif 140 | #endif /* End of #ifdef __cplusplus */ 141 | 142 | #endif/* End of #ifndef __HI_COMM_ADEC_H__*/ 143 | 144 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_comm_aenc.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2018, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_comm_aenc.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2006/12/15 10 | Last Modified : 11 | Description : 12 | Function List : 13 | History : 14 | 1.Date : 2006/12/15 15 | Author : z50825 16 | Modification : Created file 17 | 2.Date : 2007/5/10 18 | Author : z50825 19 | Modification : add err code 20 | ******************************************************************************/ 21 | 22 | 23 | #ifndef __HI_COMM_AENC_H__ 24 | #define __HI_COMM_AENC_H__ 25 | 26 | #include "hi_type.h" 27 | #include "hi_common.h" 28 | #include "hi_comm_aio.h" 29 | 30 | 31 | #ifdef __cplusplus 32 | #if __cplusplus 33 | extern "C"{ 34 | #endif 35 | #endif /* End of #ifdef __cplusplus */ 36 | 37 | typedef struct hiAENC_ATTR_G711_S 38 | { 39 | HI_U32 resv; /*reserve item*/ 40 | }AENC_ATTR_G711_S; 41 | 42 | typedef struct hiAENC_ATTR_G726_S 43 | { 44 | G726_BPS_E enG726bps; 45 | }AENC_ATTR_G726_S; 46 | 47 | typedef struct hiAENC_ATTR_ADPCM_S 48 | { 49 | ADPCM_TYPE_E enADPCMType; 50 | }AENC_ATTR_ADPCM_S; 51 | 52 | typedef struct hiAENC_ATTR_LPCM_S 53 | { 54 | HI_U32 resv; /*reserve item*/ 55 | }AENC_ATTR_LPCM_S; 56 | 57 | typedef struct hiAENC_ENCODER_S 58 | { 59 | PAYLOAD_TYPE_E enType; 60 | HI_U32 u32MaxFrmLen; 61 | HI_CHAR aszName[17]; /* encoder type,be used to print proc information */ 62 | HI_S32 (*pfnOpenEncoder)(HI_VOID *pEncoderAttr, HI_VOID **ppEncoder); /* pEncoder is the handle to control the encoder */ 63 | HI_S32 (*pfnEncodeFrm)(HI_VOID *pEncoder, const AUDIO_FRAME_S *pstData, 64 | HI_U8 *pu8Outbuf,HI_U32 *pu32OutLen); 65 | HI_S32 (*pfnCloseEncoder)(HI_VOID *pEncoder); 66 | } AENC_ENCODER_S; 67 | 68 | typedef struct hiAENC_CHN_ATTR_S 69 | { 70 | PAYLOAD_TYPE_E enType; /*payload type ()*/ 71 | HI_U32 u32PtNumPerFrm; 72 | HI_U32 u32BufSize; /*buf size [2~MAX_AUDIO_FRAME_NUM]*/ 73 | HI_VOID ATTRIBUTE *pValue; /*point to attribute of definite audio encoder*/ 74 | }AENC_CHN_ATTR_S; 75 | 76 | typedef enum hiEN_AENC_ERR_CODE_E 77 | { 78 | AENC_ERR_ENCODER_ERR = 64 , 79 | AENC_ERR_VQE_ERR = 65 , 80 | 81 | } EN_AENC_ERR_CODE_E; 82 | 83 | 84 | /* invlalid device ID */ 85 | #define HI_ERR_AENC_INVALID_DEVID HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) 86 | /* invlalid channel ID */ 87 | #define HI_ERR_AENC_INVALID_CHNID HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) 88 | /* at lease one parameter is illagal ,eg, an illegal enumeration value */ 89 | #define HI_ERR_AENC_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 90 | /* channel exists */ 91 | #define HI_ERR_AENC_EXIST HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) 92 | /* channel unexists */ 93 | #define HI_ERR_AENC_UNEXIST HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) 94 | /* using a NULL point */ 95 | #define HI_ERR_AENC_NULL_PTR HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 96 | /* try to enable or initialize system,device or channel, before configing attribute */ 97 | #define HI_ERR_AENC_NOT_CONFIG HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) 98 | /* operation is not supported by NOW */ 99 | #define HI_ERR_AENC_NOT_SUPPORT HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 100 | /* operation is not permitted ,eg, try to change static attribute */ 101 | #define HI_ERR_AENC_NOT_PERM HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 102 | /* failure caused by malloc memory */ 103 | #define HI_ERR_AENC_NOMEM HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 104 | /* failure caused by malloc buffer */ 105 | #define HI_ERR_AENC_NOBUF HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 106 | /* no data in buffer */ 107 | #define HI_ERR_AENC_BUF_EMPTY HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) 108 | /* no buffer for new data */ 109 | #define HI_ERR_AENC_BUF_FULL HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) 110 | /* system is not ready,had not initialed or loaded*/ 111 | #define HI_ERR_AENC_SYS_NOTREADY HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 112 | /* encoder internal err */ 113 | #define HI_ERR_AENC_ENCODER_ERR HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, AENC_ERR_ENCODER_ERR) 114 | /* vqe internal err */ 115 | #define HI_ERR_AENC_VQE_ERR HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, AENC_ERR_VQE_ERR) 116 | 117 | 118 | #ifdef __cplusplus 119 | #if __cplusplus 120 | } 121 | #endif 122 | #endif /* End of #ifdef __cplusplus */ 123 | 124 | #endif/* End of #ifndef __HI_COMM_AENC_H__*/ 125 | 126 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_comm_ai.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2018, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_comm_ai.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2009/5/5 10 | Description : 11 | History : 12 | 1.Date : 2009/5/5 13 | Author : p00123320 14 | Modification: Created file 15 | ******************************************************************************/ 16 | 17 | 18 | #ifndef __HI_COMM_AI_H__ 19 | #define __HI_COMM_AI_H__ 20 | 21 | #ifdef __cplusplus 22 | #if __cplusplus 23 | extern "C"{ 24 | #endif 25 | #endif /* End of #ifdef __cplusplus */ 26 | 27 | 28 | 29 | #ifdef __cplusplus 30 | #if __cplusplus 31 | } 32 | #endif 33 | #endif /* End of #ifdef __cplusplus */ 34 | 35 | #endif /* End of #ifndef __HI_COMM_AI_H__ */ 36 | 37 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_comm_ao.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2018, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_comm_ao.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2009/5/5 10 | Description : 11 | History : 12 | 1.Date : 2009/5/5 13 | Author : p00123320 14 | Modification: Created file 15 | ******************************************************************************/ 16 | 17 | 18 | #ifndef __HI_COMM_AO_H__ 19 | #define __HI_COMM_AO_H__ 20 | 21 | #ifdef __cplusplus 22 | #if __cplusplus 23 | extern "C"{ 24 | #endif 25 | #endif /* End of #ifdef __cplusplus */ 26 | 27 | 28 | 29 | 30 | #ifdef __cplusplus 31 | #if __cplusplus 32 | } 33 | #endif 34 | #endif /* End of #ifdef __cplusplus */ 35 | 36 | #endif /* End of #ifndef __HI_COMM_AO_H__ */ 37 | 38 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_comm_dis.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2017-2018, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_comm_dis.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2016/08/23 10 | Description : hi_comm_dis.h header file 11 | History : 12 | ******************************************************************************/ 13 | 14 | #ifndef __HI_COMM_DIS_H__ 15 | #define __HI_COMM_DIS_H__ 16 | 17 | 18 | #ifdef __cplusplus 19 | #if __cplusplus 20 | extern "C"{ 21 | #endif 22 | #endif /* End of #ifdef __cplusplus */ 23 | 24 | #include "hi_type.h" 25 | #include "hi_common.h" 26 | #include "hi_errno.h" 27 | #include "hi_comm_video.h" 28 | 29 | /* failure caused by malloc buffer */ 30 | #define HI_ERR_DIS_NOBUF HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 31 | #define HI_ERR_DIS_BUF_EMPTY HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) 32 | #define HI_ERR_DIS_NULL_PTR HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 33 | #define HI_ERR_DIS_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 34 | #define HI_ERR_DIS_BUF_FULL HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) 35 | #define HI_ERR_DIS_SYS_NOTREADY HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 36 | #define HI_ERR_DIS_NOT_SUPPORT HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 37 | #define HI_ERR_DIS_NOT_PERMITTED HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 38 | #define HI_ERR_DIS_BUSY HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) 39 | #define HI_ERR_DIS_INVALID_CHNID HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) 40 | #define HI_ERR_DIS_CHN_UNEXIST HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) 41 | 42 | 43 | /* Different mode of DIS */ 44 | typedef enum hiDIS_MODE_E 45 | { 46 | DIS_MODE_4_DOF_GME = 0, /* Only use with GME in 4 dof */ 47 | DIS_MODE_6_DOF_GME, /* Only use with GME in 6 dof */ 48 | DIS_MODE_GYRO, /* Only use with gryo in 6 dof */ 49 | DIS_MODE_HYBRID, /* Both use with GME and gyro in 6 dof */ 50 | DIS_MODE_DOF_BUTT, 51 | } DIS_MODE_E; 52 | 53 | /* The motion level of camera */ 54 | typedef enum hiDIS_MOTION_LEVEL_E 55 | { 56 | DIS_MOTION_LEVEL_LOW = 0, /* Low motion level*/ 57 | DIS_MOTION_LEVEL_NORMAL, /* Normal motion level */ 58 | DIS_MOTION_LEVEL_HIGH, /* High motion level */ 59 | DIS_MOTION_LEVEL_BUTT 60 | }DIS_MOTION_LEVEL_E; 61 | 62 | 63 | /* Different product type used DIS */ 64 | typedef enum hiDIS_PDT_TYPE_E 65 | { 66 | DIS_PDT_TYPE_IPC = 0, /* IPC product type */ 67 | DIS_PDT_TYPE_DV, /* DV product type */ 68 | DIS_PDT_TYPE_DRONE, /* DRONE product type */ 69 | DIS_PDT_TYPE_BUTT 70 | } DIS_PDT_TYPE_E; 71 | 72 | /* The Attribute of DIS */ 73 | typedef struct hiDIS_ATTR_S 74 | { 75 | HI_BOOL bEnable; /* RW; DIS enable */ 76 | HI_BOOL bGdcBypass; /* RW; gdc correction process , DIS = GME&GDC correction*/ 77 | HI_U32 u32MovingSubjectLevel; /* RW; Range:[0,6]; Moving Subject level */ 78 | HI_S32 s32RollingShutterCoef; /* RW; Range:[0,1000]; Rolling shutter coefficients */ 79 | HI_U32 u32Timelag; /* RW; Range:[0,200000]; Timestamp delay between Gyro and Frame PTS */ 80 | HI_U32 u32ViewAngle; /* Reserved */ 81 | HI_U32 u32HorizontalLimit; /* RW; Range:[0,1000]; Parameter to limit horizontal drift by large foreground */ 82 | HI_U32 u32VerticalLimit; /* RW; Range:[0,1000]; Parameter to limit vertical drift by large foreground */ 83 | HI_BOOL bStillCrop; /* RW; The stabilization will be not working ,but the output image still be cropped */ 84 | }DIS_ATTR_S; 85 | 86 | /* The Config of DIS */ 87 | typedef struct hiDIS_CONFIG_S 88 | { 89 | DIS_MODE_E enMode; /* RW; DIS Mode */ 90 | DIS_MOTION_LEVEL_E enMotionLevel; /* RW; DIS Motion level of the camera */ 91 | DIS_PDT_TYPE_E enPdtType; /* RW; DIS product type*/ 92 | HI_U32 u32BufNum; /* RW; Range:[5,10]; Buf num for DIS */ 93 | HI_U32 u32CropRatio; /* RW; Range:[50,98]; Crop ratio of output image */ 94 | HI_U32 u32FrameRate; /* RW; Range:[25,120]; The input framerate */ 95 | HI_U32 u32GyroOutputRange; /* RW; Range:[0,360]; The range of Gyro output in degree */ 96 | HI_U32 u32GyroDataBitWidth; /* RW; Range:[0,32]; The bits used for gyro angular velocity output */ 97 | HI_BOOL bCameraSteady; /* RW; The camera is steady or not */ 98 | HI_BOOL bScale; /* RW; Scale output image or not*/ 99 | }DIS_CONFIG_S; 100 | 101 | #ifdef __cplusplus 102 | #if __cplusplus 103 | } 104 | #endif 105 | #endif /* End of #ifdef __cplusplus */ 106 | 107 | 108 | #endif /* End of #ifndef __HI_COMM_DIS_H__ */ 109 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_comm_dpu_rect.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2017-2018, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_comm_rect.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2017/09/20 10 | Description : 11 | History : 12 | 1.Date : 2017/09/20 13 | Modification: Created file 14 | 15 | ******************************************************************************/ 16 | 17 | #ifndef __HI_COMM_RECT_H__ 18 | #define __HI_COMM_RECT_H__ 19 | 20 | 21 | #ifdef __cplusplus 22 | #if __cplusplus 23 | extern "C"{ 24 | #endif 25 | #endif /* __cplusplus */ 26 | #include "hi_common.h" 27 | #include "hi_errno.h" 28 | #include "hi_defines.h" 29 | #include "hi_comm_video.h" 30 | 31 | #define DPU_RECT_LEFT_PIPE 0 32 | #define DPU_RECT_RIGHT_PIPE 1 33 | #define DPU_RECT_LEFT_CHN 0 34 | #define DPU_RECT_RIGHT_CHN 1 35 | 36 | typedef enum hiEN_DPU_RECT_ERR_CODE_E 37 | { 38 | ERR_DPU_RECT_SYS_TIMEOUT = 0x40, /* DPU RECT process timeout */ 39 | ERR_DPU_RECT_OPEN_FILE = 0x41, /* DPU RECT open file error */ 40 | ERR_DPU_RECT_READ_FILE = 0x42, /* DPU RECT read file error */ 41 | ERR_DPU_RECT_WRITE_FILE = 0x43, /* DPU RECT write file error */ 42 | 43 | ERR_DPU_RECT_BUTT 44 | }EN_DPU_RECT_ERR_CODE_E; 45 | 46 | #define HI_ERR_DPU_RECT_NULL_PTR HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 47 | #define HI_ERR_DPU_RECT_NOTREADY HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 48 | #define HI_ERR_DPU_RECT_INVALID_DEVID HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) 49 | #define HI_ERR_DPU_RECT_INVALID_CHNID HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) 50 | #define HI_ERR_DPU_RECT_EXIST HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) 51 | #define HI_ERR_DPU_RECT_UNEXIST HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) 52 | #define HI_ERR_DPU_RECT_NOT_SUPPORT HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 53 | #define HI_ERR_DPU_RECT_NOT_PERM HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 54 | #define HI_ERR_DPU_RECT_NOMEM HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 55 | #define HI_ERR_DPU_RECT_NOBUF HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 56 | #define HI_ERR_DPU_RECT_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 57 | #define HI_ERR_DPU_RECT_BUSY HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) 58 | #define HI_ERR_DPU_RECT_BUF_EMPTY HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) 59 | 60 | #define HI_ERR_DPU_RECT_SYS_TIMEOUT HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, ERR_DPU_RECT_SYS_TIMEOUT) 61 | #define HI_ERR_DPU_RECT_OPEN_FILE HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, ERR_DPU_RECT_OPEN_FILE) 62 | #define HI_ERR_DPU_RECT_READ_FILE HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, ERR_DPU_RECT_READ_FILE) 63 | #define HI_ERR_DPU_RECT_WRITE_FILE HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, ERR_DPU_RECT_WRITE_FILE) 64 | 65 | typedef HI_S32 DPU_RECT_LUT_ID; 66 | typedef HI_S32 DPU_RECT_GRP; 67 | typedef HI_S32 DPU_RECT_PIPE; 68 | typedef HI_S32 DPU_RECT_CHN; 69 | 70 | typedef struct hiDPU_RECT_MEM_INFO_S 71 | { 72 | HI_U64 u64PhyAddr; 73 | HI_U64 u64VirAddr; 74 | HI_U32 u32Size; 75 | }DPU_RECT_MEM_INFO_S; 76 | 77 | typedef enum hiDPU_RECT_MODE_E 78 | { 79 | DPU_RECT_MODE_SINGLE = 0x0, /* only channel 0 work */ 80 | DPU_RECT_MODE_DOUBLE = 0x1, /* two channel work */ 81 | DPU_RECT_MODE_BUTT 82 | }DPU_RECT_MODE_E; 83 | 84 | typedef struct hiDPU_RECT_GRP_ATTR_S 85 | { 86 | DPU_RECT_MODE_E enRectMode; /* Rectification mode, it can not be changed dynamic */ 87 | SIZE_S stLeftImageSize; /* Left image size. */ 88 | SIZE_S stRightImageSize; /* Right image size. */ 89 | DPU_RECT_LUT_ID LeftLutId; /* Left image rectification lut */ 90 | DPU_RECT_LUT_ID RightLutId; /* Right image rectification lut */ 91 | HI_U32 u32Depth; /* The depth of user image queue for getting Rectification output image, 92 | it can not be changed dynamic. Range:[0,8] */ 93 | HI_BOOL bNeedSrcFrame; /* The flag of getting source videoframe. */ 94 | FRAME_RATE_CTRL_S stFrameRate; /* Grp frame rate contrl. */ 95 | }DPU_RECT_GRP_ATTR_S; 96 | 97 | typedef struct hiDPU_RECT_CHN_ATTR_S 98 | { 99 | SIZE_S stImageSize; /* Rectify output image size */ 100 | }DPU_RECT_CHN_ATTR_S; 101 | 102 | #ifdef __cplusplus 103 | #if __cplusplus 104 | } 105 | #endif 106 | #endif /* __cplusplus */ 107 | 108 | 109 | #endif /* __HI_COMM_DPU_RECT_H__ */ 110 | 111 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_comm_snap.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2017, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_comm_snap.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2017/06/19 10 | Last Modified : 11 | Description : 12 | Function List : 13 | History : 14 | ******************************************************************************/ 15 | 16 | #ifndef __HI_COMM_SNAP_H__ 17 | #define __HI_COMM_SNAP_H__ 18 | 19 | #include "hi_common.h" 20 | #include "hi_comm_video.h" 21 | #include "hi_comm_isp.h" 22 | 23 | #ifdef __cplusplus 24 | #if __cplusplus 25 | extern "C" 26 | { 27 | #endif 28 | #endif /* __cplusplus */ 29 | 30 | typedef enum hiSNAP_TYPE_E 31 | { 32 | SNAP_TYPE_NORMAL, /* ZSL and none-ZSL type */ 33 | SNAP_TYPE_PRO, /* Professional type support HDR, AEB, LongExposure */ 34 | SNAP_TYPE_BUTT 35 | } SNAP_TYPE_E; 36 | 37 | 38 | typedef struct hiSNAP_PRO_MANUAL_PARAM_S 39 | { 40 | HI_U32 au32ManExpTime[PRO_MAX_FRAME_NUM];/*RW; Range: [0x0, 0xFFFFFFFF];sensor exposure time (unit: us ), it's related to the specific sensor */ 41 | HI_U32 au32ManSysgain[PRO_MAX_FRAME_NUM];/*RW; Range : [0x400, 0xFFFFFFFF];system gain (unit: times, 10bit precision) , it's related to the specific sensor and ISP Dgain range */ 42 | } SNAP_PRO_MANUAL_PARAM_S; 43 | 44 | 45 | typedef struct hiSNAP_PRO_AUTO_PARAM_S 46 | { 47 | HI_U16 au16ProExpStep[PRO_MAX_FRAME_NUM];/*RW; Range:[0x0, 0xFFFF];Professional exposure step (unit: times, 8bit precision)*/ 48 | } SNAP_PRO_AUTO_PARAM_S; 49 | 50 | 51 | typedef struct hiSNAP_PRO_PARAM_S 52 | { 53 | OPERATION_MODE_E enOperationMode; 54 | SNAP_PRO_AUTO_PARAM_S stAutoParam; 55 | SNAP_PRO_MANUAL_PARAM_S stManualParam; 56 | } SNAP_PRO_PARAM_S; 57 | 58 | 59 | typedef struct hiSNAP_NORMAL_ATTR_S 60 | { 61 | HI_U32 u32FrameCnt; /* RW;Set capture frame counts */ 62 | HI_U32 u32RepeatSendTimes; /* [0,2]; When FE-BE is offline, the first raw frame that is triggered should be sent repeatedly to the BE. */ 63 | 64 | /* ZSL struct */ 65 | HI_BOOL bZSL; /* RW;statical attrs */ 66 | HI_U32 u32FrameDepth; /* buffer depth */ 67 | HI_U32 u32RollbackMs; /* RW;Rollback time, unit(ms), invalid when bZSL is HI_FALSE */ 68 | HI_U32 u32Interval; /* RW;For continuous capture, select frame every u32Intercal frames */ 69 | } SNAP_NORMAL_ATTR_S; 70 | 71 | typedef struct hiSNAP_PRO_ATTR_S 72 | { 73 | HI_U32 u32FrameCnt; /* [1, PRO_MAX_FRAME_NUM] */ 74 | HI_U32 u32RepeatSendTimes; /* [0,2];When FE-BE is offline, the first raw frame that is triggered should be sent repeatedly to the BE. */ 75 | SNAP_PRO_PARAM_S stProParam; 76 | } SNAP_PRO_ATTR_S; 77 | 78 | 79 | typedef struct hiSNAP_USER_ATTR_S 80 | { 81 | HI_U32 u32FrameDepth; 82 | } SNAP_USER_ATTR_S; 83 | 84 | 85 | typedef struct hiSNAP_ATTR_S 86 | { 87 | SNAP_TYPE_E enSnapType; 88 | HI_BOOL bLoadCCM; /*HI_TRUE:use CCM of SnapIspInfo, HI_FALSE: Algorithm calculate */ 89 | union 90 | { 91 | SNAP_NORMAL_ATTR_S stNormalAttr; 92 | SNAP_PRO_ATTR_S stProAttr; 93 | }; 94 | } SNAP_ATTR_S; 95 | 96 | 97 | typedef struct hiISP_PRO_BNR_PARAM_S 98 | { 99 | HI_BOOL bEnable; 100 | HI_U32 u32ParamNum; 101 | ISP_NR_AUTO_ATTR_S *pastNrAttr; 102 | } ISP_PRO_BNR_PARAM_S; 103 | 104 | typedef struct hiISP_PRO_SHARPEN_PARAM_S 105 | { 106 | HI_BOOL bEnable; 107 | HI_U32 u32ParamNum; 108 | ISP_SHARPEN_AUTO_ATTR_S *pastShpAttr; 109 | } ISP_PRO_SHARPEN_PARAM_S; 110 | 111 | typedef struct hiBNR_DUMP_ATTR_S 112 | { 113 | HI_BOOL bEnable; 114 | HI_U32 u32Depth; 115 | } BNR_DUMP_ATTR_S; 116 | 117 | #ifdef __cplusplus 118 | #if __cplusplus 119 | } 120 | #endif 121 | #endif /* __cplusplus */ 122 | 123 | #endif /* End of #ifndef __HI_COMM_SNAP_H__ */ 124 | 125 | 126 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_comm_svp.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2017, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_comm_svp.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software (SVP) group 9 | Created : 2017/09/19 10 | Description : 11 | History : 12 | 1.Date : 2017/09/19 13 | Author : 14 | Modification: Created file 15 | ******************************************************************************/ 16 | 17 | #ifndef __HI_COMM_SVP_H__ 18 | #define __HI_COMM_SVP_H__ 19 | 20 | #ifdef __cplusplus 21 | #if __cplusplus 22 | extern "C"{ 23 | #endif 24 | #endif /* __cplusplus */ 25 | 26 | #include "hi_type.h" 27 | #include "hi_errno.h" 28 | 29 | /*Blob type*/ 30 | typedef enum hiSVP_BLOB_TYPE_E 31 | { 32 | SVP_BLOB_TYPE_S32 = 0x0, 33 | 34 | SVP_BLOB_TYPE_U8 = 0x1, 35 | 36 | /*channel = 3*/ 37 | SVP_BLOB_TYPE_YVU420SP = 0x2, 38 | /*channel = 3*/ 39 | SVP_BLOB_TYPE_YVU422SP = 0x3, 40 | 41 | SVP_BLOB_TYPE_VEC_S32 = 0x4, 42 | 43 | SVP_BLOB_TYPE_SEQ_S32 = 0x5, 44 | 45 | SVP_BLOB_TYPE_BUTT 46 | }SVP_BLOB_TYPE_E; 47 | 48 | /****************************** Blob struct ****************************** 49 | In Caffe, the blob contain shape info as the following order: 50 | Image\FeatureMap: N C H W 51 | FC(normal vector): N C 52 | RNN\LSTM(Recurrent) vector: T N D 53 | 54 | The relationship of the following blob struct with Caffe blob is as follows: 55 | Image\FeatureMap: Num Chn Height With 56 | FC(VEC_S32): Num Width 57 | RNN\LSTM(SEQ_S32) vector: Step Num Dim 58 | The stride, which measuring unit is byte, is always algined by the width or 59 | dim direction. 60 | **************************************************************************/ 61 | typedef struct hiSVP_BLOB_S 62 | { 63 | SVP_BLOB_TYPE_E enType; /*Blob type*/ 64 | HI_U32 u32Stride; /*Stride, a line bytes num*/ 65 | 66 | HI_U64 u64VirAddr; /*virtual addr*/ 67 | HI_U64 u64PhyAddr; /*physical addr*/ 68 | 69 | HI_U32 u32Num; /*N: frame num or sequence num,correspond to caffe blob's n*/ 70 | union 71 | { 72 | struct 73 | { 74 | HI_U32 u32Width; /*W: frame width, correspond to caffe blob's w*/ 75 | HI_U32 u32Height; /*H: frame height, correspond to caffe blob's h*/ 76 | HI_U32 u32Chn; /*C: frame channel,correspond to caffe blob's c*/ 77 | }stWhc; 78 | struct 79 | { 80 | HI_U32 u32Dim; /*D: vecotr dimension*/ 81 | HI_U64 u64VirAddrStep; /*T: virtual adress of time steps array in each sequence*/ 82 | }stSeq; 83 | }unShape; 84 | }SVP_BLOB_S; 85 | 86 | typedef SVP_BLOB_S SVP_SRC_BLOB_S; 87 | typedef SVP_BLOB_S SVP_DST_BLOB_S; 88 | 89 | /*Mem information*/ 90 | typedef struct hiSVP_MEM_INFO_S 91 | { 92 | HI_U64 u64PhyAddr; /* RW;The physical address of the memory */ 93 | HI_U64 u64VirAddr; /* RW;The virtual address of the memory */ 94 | HI_U32 u32Size; /* RW;The size of memory */ 95 | }SVP_MEM_INFO_S; 96 | 97 | typedef SVP_MEM_INFO_S SVP_SRC_MEM_INFO_S; 98 | typedef SVP_MEM_INFO_S SVP_DST_MEM_INFO_S; 99 | 100 | /*Image type*/ 101 | typedef enum hiSVP_IMAGE_TYPE_E 102 | { 103 | SVP_IMAGE_TYPE_U8C1 = 0x0, 104 | SVP_IMAGE_TYPE_S8C1 = 0x1, 105 | 106 | SVP_IMAGE_TYPE_YUV420SP = 0x2, /*YUV420 SemiPlanar*/ 107 | SVP_IMAGE_TYPE_YUV422SP = 0x3, /*YUV422 SemiPlanar*/ 108 | SVP_IMAGE_TYPE_YUV420P = 0x4, /*YUV420 Planar */ 109 | SVP_IMAGE_TYPE_YUV422P = 0x5, /*YUV422 planar */ 110 | 111 | SVP_IMAGE_TYPE_S8C2_PACKAGE = 0x6, 112 | SVP_IMAGE_TYPE_S8C2_PLANAR = 0x7, 113 | 114 | SVP_IMAGE_TYPE_S16C1 = 0x8, 115 | SVP_IMAGE_TYPE_U16C1 = 0x9, 116 | 117 | SVP_IMAGE_TYPE_U8C3_PACKAGE = 0xa, 118 | SVP_IMAGE_TYPE_U8C3_PLANAR = 0xb, 119 | 120 | SVP_IMAGE_TYPE_S32C1 = 0xc, 121 | SVP_IMAGE_TYPE_U32C1 = 0xd, 122 | 123 | SVP_IMAGE_TYPE_S64C1 = 0xe, 124 | SVP_IMAGE_TYPE_U64C1 = 0xf, 125 | 126 | SVP_IMAGE_TYPE_BUTT 127 | 128 | }SVP_IMAGE_TYPE_E; 129 | 130 | /*Image*/ 131 | typedef struct hiSVP_IMAGE_S 132 | { 133 | HI_U64 au64PhyAddr[3]; /* RW;The physical address of the image */ 134 | HI_U64 au64VirAddr[3]; /* RW;The virtual address of the image */ 135 | HI_U32 au32Stride[3]; /* RW;The stride of the image */ 136 | HI_U32 u32Width; /* RW;The width of the image */ 137 | HI_U32 u32Height; /* RW;The height of the image */ 138 | SVP_IMAGE_TYPE_E enType; /* RW;The type of the image */ 139 | }SVP_IMAGE_S; 140 | 141 | typedef SVP_IMAGE_S SVP_SRC_IMAGE_S; 142 | typedef SVP_IMAGE_S SVP_DST_IMAGE_S; 143 | 144 | #ifdef __cplusplus 145 | #if __cplusplus 146 | } 147 | #endif 148 | #endif /* __cplusplus */ 149 | 150 | 151 | #endif /* __HI_COMM_SVP_H__ */ 152 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_comm_vb.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : hi_comm_vb.h 5 | Version : Initial Draft 6 | Author : Hisilicon multimedia software group 7 | Created : 2016/07/15 8 | Last Modified : 9 | Description : The common data type defination for VB module. 10 | Function List : 11 | ******************************************************************************/ 12 | #ifndef __HI_COMM_VB_H__ 13 | #define __HI_COMM_VB_H__ 14 | 15 | #include "hi_type.h" 16 | #include "hi_errno.h" 17 | #include "hi_debug.h" 18 | 19 | 20 | #ifdef __cplusplus 21 | #if __cplusplus 22 | extern "C"{ 23 | #endif 24 | #endif /* End of #ifdef __cplusplus */ 25 | 26 | #define VB_INVALID_POOLID (-1U) 27 | #define VB_INVALID_HANDLE (-1U) 28 | 29 | 30 | #define VB_MAX_COMM_POOLS 16 31 | #define VB_MAX_MOD_COMM_POOLS 16 32 | 33 | 34 | /* user ID for VB */ 35 | #define VB_MAX_USER VB_UID_BUTT 36 | 37 | typedef enum hiVB_UID_E 38 | { 39 | VB_UID_VI = 0, 40 | VB_UID_VO = 1, 41 | VB_UID_VGS = 2, 42 | VB_UID_VENC = 3, 43 | VB_UID_VDEC = 4, 44 | VB_UID_H265E = 5, 45 | VB_UID_H264E = 6, 46 | VB_UID_JPEGE = 7, 47 | VB_UID_H264D = 8, 48 | VB_UID_JPEGD = 9, 49 | VB_UID_VPSS = 10, 50 | VB_UID_DIS = 11, 51 | VB_UID_USER = 12, 52 | VB_UID_PCIV = 13, 53 | VB_UID_AI = 14, 54 | VB_UID_AENC = 15, 55 | VB_UID_RC = 16, 56 | VB_UID_VFMW = 17, 57 | VB_UID_GDC = 18, 58 | VB_UID_AVS = 19, 59 | VB_UID_DPU_RECT = 20, 60 | VB_UID_DPU_MATCH = 21, 61 | VB_UID_MCF = 22, 62 | VB_UID_BUTT = 23, 63 | 64 | } VB_UID_E; 65 | 66 | 67 | 68 | /* Generall common pool use this owner id, module common pool use VB_UID as owner id */ 69 | #define POOL_OWNER_COMMON -1 70 | 71 | /* Private pool use this owner id */ 72 | #define POOL_OWNER_PRIVATE -2 73 | 74 | 75 | 76 | typedef HI_U32 VB_POOL; 77 | typedef HI_U32 VB_BLK; 78 | 79 | #define RESERVE_MMZ_NAME "window" 80 | 81 | typedef enum hiVB_REMAP_MODE_E 82 | { 83 | VB_REMAP_MODE_NONE = 0, /* no remap */ 84 | VB_REMAP_MODE_NOCACHE = 1, /* no cache remap */ 85 | VB_REMAP_MODE_CACHED = 2, /* cache remap, if you use this mode, you should flush cache by yourself */ 86 | VB_REMAP_MODE_BUTT 87 | } VB_REMAP_MODE_E; 88 | 89 | 90 | typedef struct hiVB_POOL_CONFIG_S 91 | { 92 | HI_U64 u64BlkSize; 93 | HI_U32 u32BlkCnt; 94 | VB_REMAP_MODE_E enRemapMode; 95 | HI_CHAR acMmzName[MAX_MMZ_NAME_LEN]; 96 | }VB_POOL_CONFIG_S; 97 | 98 | typedef struct hiVB_CONFIG_S 99 | { 100 | HI_U32 u32MaxPoolCnt; 101 | VB_POOL_CONFIG_S astCommPool[VB_MAX_COMM_POOLS]; 102 | } VB_CONFIG_S; 103 | 104 | 105 | typedef struct hiVB_POOL_STATUS_S 106 | { 107 | HI_U32 bIsCommPool; 108 | HI_U32 u32BlkCnt; 109 | HI_U32 u32FreeBlkCnt; 110 | }VB_POOL_STATUS_S; 111 | 112 | #define VB_SUPPLEMENT_JPEG_MASK 0x1 113 | #define VB_SUPPLEMENT_ISPINFO_MASK 0x2 114 | #define VB_SUPPLEMENT_MOTION_DATA_MASK 0x4 115 | #define VB_SUPPLEMENT_DNG_MASK 0x8 116 | 117 | typedef struct hiVB_SUPPLEMENT_CONFIG_S 118 | { 119 | HI_U32 u32SupplementConfig; 120 | }VB_SUPPLEMENT_CONFIG_S; 121 | 122 | 123 | #define HI_ERR_VB_NULL_PTR HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 124 | #define HI_ERR_VB_NOMEM HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 125 | #define HI_ERR_VB_NOBUF HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 126 | #define HI_ERR_VB_UNEXIST HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) 127 | #define HI_ERR_VB_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 128 | #define HI_ERR_VB_NOTREADY HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 129 | #define HI_ERR_VB_BUSY HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) 130 | #define HI_ERR_VB_NOT_PERM HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 131 | #define HI_ERR_VB_SIZE_NOT_ENOUGH HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_SIZE_NOT_ENOUGH) 132 | 133 | #define HI_ERR_VB_2MPOOLS HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_BUTT + 1) 134 | 135 | #define HI_TRACE_VB(level, fmt,...)\ 136 | do{ \ 137 | HI_TRACE(level, HI_ID_VB,"[Func]:%s [Line]:%d [Info]:"fmt,__FUNCTION__, __LINE__,##__VA_ARGS__);\ 138 | }while(0) 139 | 140 | #ifdef __cplusplus 141 | #if __cplusplus 142 | } 143 | #endif 144 | #endif /* __cplusplus */ 145 | 146 | #endif /* __HI_COMM_VB_H_ */ 147 | 148 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_comm_vgs.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2016-2018, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_comm_vgs.h 7 | Version : 8 | Author : Hisilicon multimedia software group 9 | Created : 2013/07/24 10 | Last Modified : 11 | Description : common struct definition for VGS 12 | Function List : 13 | 14 | ******************************************************************************/ 15 | #ifndef __HI_COMM_VGS_H__ 16 | #define __HI_COMM_VGS_H__ 17 | 18 | #ifdef __cplusplus 19 | #if __cplusplus 20 | extern "C" { 21 | #endif 22 | #endif /* __cplusplus */ 23 | 24 | #include "hi_type.h" 25 | #include "hi_common.h" 26 | #include "hi_errno.h" 27 | #include "hi_comm_video.h" 28 | 29 | /* failure caused by malloc buffer */ 30 | #define HI_ERR_VGS_NOBUF HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 31 | #define HI_ERR_VGS_BUF_EMPTY HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) 32 | #define HI_ERR_VGS_NULL_PTR HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 33 | #define HI_ERR_VGS_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 34 | #define HI_ERR_VGS_BUF_FULL HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) 35 | #define HI_ERR_VGS_SYS_NOTREADY HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 36 | #define HI_ERR_VGS_NOT_SUPPORT HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 37 | #define HI_ERR_VGS_NOT_PERMITTED HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 38 | 39 | #define VGS_PRIVATE_DATA_LEN 6 40 | 41 | typedef HI_S32 VGS_HANDLE; 42 | 43 | typedef enum hiVGS_COLOR_REVERT_MODE_E 44 | { 45 | VGS_COLOR_REVERT_NONE = 0, /* Not revert */ 46 | VGS_COLOR_REVERT_RGB, /* Revert RGB */ 47 | VGS_COLOR_REVERT_ALPHA, /* Revert alpha */ 48 | VGS_COLOR_REVERT_BOTH, /* Revert RGB and alpha*/ 49 | VGS_COLOR_REVERT_BUTT 50 | } VGS_COLOR_REVERT_MODE_E; 51 | 52 | typedef struct hiVGS_OSD_REVERT_S 53 | { 54 | RECT_S stSrcRect; /* OSD color revert area */ 55 | VGS_COLOR_REVERT_MODE_E enColorRevertMode; /* OSD color revert mode */ 56 | } VGS_OSD_REVERT_S; 57 | 58 | typedef struct hiVGS_TASK_ATTR_S 59 | { 60 | VIDEO_FRAME_INFO_S stImgIn; /* Input picture */ 61 | VIDEO_FRAME_INFO_S stImgOut; /* Output picture */ 62 | HI_U64 au64PrivateData[4]; /* RW; Private data of task */ 63 | HI_U32 reserved; /* RW; Debug information,state of current picture */ 64 | } VGS_TASK_ATTR_S; 65 | 66 | typedef struct hiVGS_DRAW_LINE_S 67 | { 68 | POINT_S stStartPoint; /* Line start point */ 69 | POINT_S stEndPoint; /* Line end point */ 70 | HI_U32 u32Thick; /* RW; Width of line */ 71 | HI_U32 u32Color; /* RW; Range: [0,0xFFFFFF]; Color of line */ 72 | } VGS_DRAW_LINE_S; 73 | 74 | typedef enum hiVGS_COVER_TYPE_E 75 | { 76 | COVER_RECT = 0, /* Retangle cover */ 77 | COVER_QUAD_RANGLE, /* Quadrangle cover */ 78 | COVER_BUTT 79 | } VGS_COVER_TYPE_E; 80 | 81 | typedef struct hiVGS_QUADRANGLE_COVER_S 82 | { 83 | HI_BOOL bSolid; /* Solid or hollow cover */ 84 | HI_U32 u32Thick; /* RW; Range: [2,8]; Thick of the hollow quadrangle */ 85 | POINT_S stPoint[4]; /* Four points of the quadrangle */ 86 | } VGS_QUADRANGLE_COVER_S; 87 | 88 | typedef struct hiVGS_ADD_COVER_S 89 | { 90 | VGS_COVER_TYPE_E enCoverType; /* Cover type */ 91 | union 92 | { 93 | RECT_S stDstRect; /* The rectangle area */ 94 | VGS_QUADRANGLE_COVER_S stQuadRangle; /* The quadrangle area */ 95 | }; 96 | 97 | HI_U32 u32Color; /* RW; Range: [0,0xFFFFFF]; Color of cover */ 98 | } VGS_ADD_COVER_S; 99 | 100 | typedef struct hiVGS_ADD_OSD_S 101 | { 102 | RECT_S stRect; /* Osd area */ 103 | HI_U32 u32BgColor; /* RW; Background color of osd, depends on pixel format of osd, ARGB8888:[0,0xFFFFFFFF], ARGB4444:[0,0xFFFF], ARGB1555:[0,0x1FFF] */ 104 | PIXEL_FORMAT_E enPixelFmt; /* Pixel format of osd */ 105 | HI_U64 u64PhyAddr; /* RW; Physical address of osd */ 106 | HI_U32 u32Stride; /* RW; Range: [32,8192]; Stride of osd */ 107 | HI_U32 u32BgAlpha; /* RW; Range: [0,255]; Background alpha of osd */ 108 | HI_U32 u32FgAlpha; /* RW; Range: [0,255]; Foreground alpha of osd */ 109 | HI_BOOL bOsdRevert; /* RW; Enable osd color revert */ 110 | VGS_OSD_REVERT_S stOsdRevert; /* Osd color revert information */ 111 | HI_U16 u16ColorLUT[2]; 112 | } VGS_ADD_OSD_S; 113 | 114 | typedef enum hiVGS_SCLCOEF_MODE_E 115 | { 116 | VGS_SCLCOEF_NORMAL = 0, /* normal scale coefficient*/ 117 | VGS_SCLCOEF_TAP2 = 1, /* scale coefficient of 2 tap */ 118 | VGS_SCLCOEF_TAP4 = 2, /* scale coefficient of 4 tap */ 119 | VGS_SCLCOEF_TAP6 = 3, /* scale coefficient of 6 tap */ 120 | VGS_SCLCOEF_TAP8 = 4, /* scale coefficient of 8 tap */ 121 | VGS_SCLCOEF_BUTT 122 | } VGS_SCLCOEF_MODE_E; 123 | 124 | 125 | #ifdef __cplusplus 126 | #if __cplusplus 127 | } 128 | #endif 129 | #endif /* __cplusplus */ 130 | 131 | #endif /* __HI_COMM_VGS_H__ */ 132 | 133 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_common_cipher.h: -------------------------------------------------------------------------------- 1 | #ifndef __HI_COMMON_CIPHER__ 2 | #define __HI_COMMON_CIPHER__ 3 | 4 | #ifdef __cplusplus 5 | #if __cplusplus 6 | extern "C" { 7 | #endif 8 | #endif /* __cplusplus */ 9 | 10 | #define HI_ERR_CIPHER_NOT_INIT (HI_S32)(0x804D0001) 11 | #define HI_ERR_CIPHER_INVALID_HANDLE (HI_S32)(0x804D0002) 12 | #define HI_ERR_CIPHER_INVALID_POINT (HI_S32)(0x804D0003) 13 | #define HI_ERR_CIPHER_INVALID_PARA (HI_S32)(0x804D0004) 14 | #define HI_ERR_CIPHER_FAILED_INIT (HI_S32)(0x804D0005) 15 | #define HI_ERR_CIPHER_FAILED_GETHANDLE (HI_S32)(0x804D0006) 16 | #define HI_ERR_CIPHER_FAILED_RELEASEHANDLE (HI_S32)(0x804D0007) 17 | #define HI_ERR_CIPHER_FAILED_CONFIGAES (HI_S32)(0x804D0008) 18 | #define HI_ERR_CIPHER_FAILED_CONFIGDES (HI_S32)(0x804D0009) 19 | #define HI_ERR_CIPHER_FAILED_ENCRYPT (HI_S32)(0x804D000A) 20 | #define HI_ERR_CIPHER_FAILED_DECRYPT (HI_S32)(0x804D000B) 21 | #define HI_ERR_CIPHER_BUSY (HI_S32)(0x804D000C) 22 | #define HI_ERR_CIPHER_NO_AVAILABLE_RNG (HI_S32)(0x804D000D) 23 | #define HI_ERR_CIPHER_FAILED_MEM (HI_S32)(0x804D000E) 24 | #define HI_ERR_CIPHER_UNAVAILABLE (HI_S32)(0x804D000F) 25 | #define HI_ERR_CIPHER_OVERFLOW (HI_S32)(0x804D0010) 26 | #define HI_ERR_CIPHER_HARD_STATUS (HI_S32)(0x804D0011) 27 | #define HI_ERR_CIPHER_TIMEOUT (HI_S32)(0x804D0012) 28 | #define HI_ERR_CIPHER_UNSUPPORTED (HI_S32)(0x804D0013) 29 | #define HI_ERR_CIPHER_REGISTER_IRQ (HI_S32)(0x804D0014) 30 | #define HI_ERR_CIPHER_ILLEGAL_UUID (HI_S32)(0x804D0015) 31 | #define HI_ERR_CIPHER_ILLEGAL_KEY (HI_S32)(0x804D0016) 32 | #define HI_ERR_CIPHER_INVALID_ADDR (HI_S32)(0x804D0017) 33 | #define HI_ERR_CIPHER_INVALID_LENGTH (HI_S32)(0x804D0018) 34 | #define HI_ERR_CIPHER_ILLEGAL_DATA (HI_S32)(0x804D0019) 35 | #define HI_ERR_CIPHER_RSA_SIGN (HI_S32)(0x804D001A) 36 | #define HI_ERR_CIPHER_RSA_VERIFY (HI_S32)(0x804D001B) 37 | 38 | 39 | #ifdef __cplusplus 40 | #if __cplusplus 41 | } 42 | #endif 43 | #endif /* __cplusplus */ 44 | 45 | #endif /* __CRYP_CIPHER_H__ */ 46 | 47 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_debug.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : hi_debug.h 5 | Version : Initial Draft 6 | Author : Hisilicon multimedia software group 7 | Created : 2016/07/15 8 | Last Modified : 9 | Description : all struct and maro definition for debug 10 | Function List : 11 | ******************************************************************************/ 12 | #ifndef __HI_DEBUG_H__ 13 | #define __HI_DEBUG_H__ 14 | 15 | #ifndef __KERNEL__ 16 | #include 17 | #include 18 | #endif 19 | 20 | #include "hi_type.h" 21 | #include "hi_common.h" 22 | 23 | #ifdef __cplusplus 24 | #if __cplusplus 25 | extern "C"{ 26 | #endif 27 | #endif /* __cplusplus */ 28 | 29 | #define _EX__FILE_LINE(fxx,lxx) "[File]:"fxx"\n[Line]:"#lxx"\n[Info]:" 30 | #define EX__FILE_LINE(fxx,lxx) _EX__FILE_LINE(fxx,lxx) 31 | #define __FILE_LINE__ EX__FILE_LINE(__FILE__, __LINE__) 32 | 33 | #define HI_DBG_EMERG 0 /* system is unusable */ 34 | #define HI_DBG_ALERT 1 /* action must be taken immediately */ 35 | #define HI_DBG_CRIT 2 /* critical conditions */ 36 | #define HI_DBG_ERR 3 /* error conditions */ 37 | #define HI_DBG_WARN 4 /* warning conditions */ 38 | #define HI_DBG_NOTICE 5 /* normal but significant condition */ 39 | #define HI_DBG_INFO 6 /* informational */ 40 | #define HI_DBG_DEBUG 7 /* debug-level messages */ 41 | 42 | typedef struct hiLOG_LEVEL_CONF_S 43 | { 44 | MOD_ID_E enModId; 45 | HI_S32 s32Level; 46 | HI_CHAR cModName[16]; 47 | } LOG_LEVEL_CONF_S; 48 | 49 | #ifndef __KERNEL__ 50 | /****************************************************************************** 51 | ** For User Mode : HI_PRINT, HI_ASSERT, HI_TRACE 52 | ******************************************************************************/ 53 | 54 | #define HI_PRINT printf 55 | 56 | /* #ifdef HI_DEBUG */ 57 | #if 1 58 | /* Using samples: HI_ASSERT(x>y); */ 59 | #define HI_ASSERT(expr) \ 60 | do{ \ 61 | if (!(expr)) { \ 62 | printf("\nASSERT at:\n"\ 63 | " >Function : %s\n" \ 64 | " >Line No. : %d\n" \ 65 | " >Condition: %s\n", \ 66 | __FUNCTION__, __LINE__, #expr);\ 67 | _exit(-1);\ 68 | } \ 69 | }while(0) 70 | 71 | /* Using samples: 72 | ** HI_TRACE(HI_DBG_DEBUG, HI_ID_CMPI, "Test %d, %s\n", 12, "Test"); 73 | **/ 74 | #define HI_TRACE(level, enModId, fmt...) fprintf(stderr,##fmt) 75 | #else 76 | #define HI_ASSERT(expr) 77 | #define HI_TRACE(level, enModId, fmt...) 78 | #endif 79 | 80 | #else 81 | /****************************************************************************** 82 | ** For Linux Kernel : HI_PRINT, HI_ASSERT, HI_TRACE 83 | ******************************************************************************/ 84 | //#include "hi_osal.h" 85 | #define HI_PRINT osal_printk 86 | 87 | extern HI_S32 HI_ChkLogLevel(HI_S32 s32Levle, MOD_ID_E enModId); 88 | 89 | int HI_LOG(HI_S32 level, MOD_ID_E enModId,const char *fmt, ...) __attribute__((format(printf,3,4))); 90 | 91 | /* #ifdef HI_DEBUG */ 92 | #if 1 93 | /* Using samples: HI_ASSERT(x>y); */ 94 | #define HI_ASSERT(expr) \ 95 | do{ \ 96 | if (!(expr)) { \ 97 | osal_panic("\nASSERT at:\n" \ 98 | " >Function : %s\n" \ 99 | " >Line No. : %d\n" \ 100 | " >Condition: %s\n", \ 101 | __FUNCTION__, __LINE__, #expr);\ 102 | } \ 103 | }while(0) 104 | 105 | /* Using samples: 106 | ** HI_TRACE(HI_DBG_DEBUG, HI_ID_CMPI, "Test %d, %s\n", 12, "Test"); 107 | **/ 108 | #define HI_TRACE HI_LOG 109 | #else 110 | #define HI_ASSERT(expr) 111 | #define HI_TRACE(level, enModId, fmt...) 112 | #endif 113 | 114 | 115 | #endif /* end of __KERNEL__ */ 116 | 117 | 118 | #define HI_PRINT_BLOCK(pu8Datablock, u32Length) \ 119 | { \ 120 | HI_U32 u32ii = 0; \ 121 | HI_U8* pu8VirAddr = (HI_U8*)(pu8Datablock); \ 122 | if(HI_NULL != pu8VirAddr)\ 123 | {\ 124 | HI_PRINT("\n[Func]:%s [Line]:%d [Info]:%s\n", __FUNCTION__, __LINE__, #pu8Datablock); \ 125 | for (u32ii = 0; u32ii < (u32Length);) \ 126 | { \ 127 | HI_PRINT(" %02X", *pu8VirAddr);\ 128 | pu8VirAddr++;\ 129 | u32ii++;\ 130 | if(0 == (u32ii % 16))HI_PRINT("\n");\ 131 | } \ 132 | HI_PRINT("\n\n");\ 133 | }\ 134 | else\ 135 | {\ 136 | HI_PRINT("\n[Func]:%s [Line]:%d [Info]:pointer(%s) is null!\n", __FUNCTION__, __LINE__, #pu8Datablock); \ 137 | }\ 138 | } 139 | 140 | 141 | 142 | 143 | #ifdef __cplusplus 144 | #if __cplusplus 145 | } 146 | #endif 147 | #endif /* __cplusplus */ 148 | 149 | #endif /* __HI_DEBUG_H__ */ 150 | 151 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_dsp.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2017, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_dsp.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software (SVP) group 9 | Created : 2017/10/17 10 | Description : 11 | History : 12 | 1.Date : 2017/10/17 13 | Author : 14 | Modification: Created file 15 | ******************************************************************************/ 16 | #ifndef _HI_DSP_H_ 17 | #define _HI_DSP_H_ 18 | 19 | #ifdef __cplusplus 20 | #if __cplusplus 21 | extern "C"{ 22 | #endif 23 | #endif 24 | 25 | #include "hi_comm_svp.h" 26 | //if sdk environment,include hi_common.h,else typedef HI_S32 SVP_DSP_HANDLE 27 | #include "hi_common.h" 28 | 29 | /**************************************SVP_DSP Error Code***********************************************************************/ 30 | typedef enum hiEN_SVP_DSP_ERR_CODE_E 31 | { 32 | ERR_SVP_DSP_SYS_TIMEOUT = 0x40, /* SVP_DSP process timeout */ 33 | ERR_SVP_DSP_QUERY_TIMEOUT = 0x41, /* SVP_DSP query timeout */ 34 | ERR_SVP_DSP_OPEN_FILE = 0x42, /* SVP_DSP open file error*/ 35 | ERR_SVP_DSP_READ_FILE = 0x43, /* SVP_DSP read file error*/ 36 | 37 | ERR_SVP_DSP_BUTT 38 | }EN_SVP_DSP_ERR_CODE_E; 39 | /*Invalid device ID*/ 40 | #define HI_ERR_SVP_DSP_INVALID_DEVID HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) 41 | /*Invalid channel ID*/ 42 | #define HI_ERR_SVP_DSP_INVALID_CHNID HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) 43 | /*At least one parameter is illegal. For example, an illegal enumeration value exists.*/ 44 | #define HI_ERR_SVP_DSP_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 45 | /*The channel exists.*/ 46 | #define HI_ERR_SVP_DSP_EXIST HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) 47 | /*The UN exists.*/ 48 | #define HI_ERR_SVP_DSP_UNEXIST HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) 49 | /*A null point is used.*/ 50 | #define HI_ERR_SVP_DSP_NULL_PTR HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 51 | /*Try to enable or initialize the system, device, or channel before configuring attributes.*/ 52 | #define HI_ERR_SVP_DSP_NOT_CONFIG HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) 53 | /*The operation is not supported currently.*/ 54 | #define HI_ERR_SVP_DSP_NOT_SURPPORT HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 55 | /*The operation, changing static attributes for example, is not permitted.*/ 56 | #define HI_ERR_SVP_DSP_NOT_PERM HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 57 | /*A failure caused by the malloc memory occurs.*/ 58 | #define HI_ERR_SVP_DSP_NOMEM HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 59 | /*A failure caused by the malloc buffer occurs.*/ 60 | #define HI_ERR_SVP_DSP_NOBUF HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 61 | /*The buffer is empty.*/ 62 | #define HI_ERR_SVP_DSP_BUF_EMPTY HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) 63 | /*No buffer is provided for storing new data.*/ 64 | #define HI_ERR_SVP_DSP_BUF_FULL HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) 65 | /*The system is not ready because it may be not initialized or loaded. 66 | *The error code is returned when a device file fails to be opened. */ 67 | #define HI_ERR_SVP_DSP_NOTREADY HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 68 | /*The source address or target address is incorrect during the operations such as calling copy_from_user or copy_to_user.*/ 69 | #define HI_ERR_SVP_DSP_BADADDR HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, EN_ERR_BADADDR) 70 | /*The resource is busy during the operations such as destroying a VENC channel without deregistering it.*/ 71 | #define HI_ERR_SVP_DSP_BUSY HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) 72 | /*SVP_DSP process timeout*/ 73 | #define HI_ERR_SVP_DSP_SYS_TIMEOUT HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, ERR_SVP_DSP_SYS_TIMEOUT) 74 | /*SVP_DSP query timeout*/ 75 | #define HI_ERR_SVP_DSP_QUERY_TIMEOUT HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, ERR_SVP_DSP_QUERY_TIMEOUT) 76 | /*SVP_DSP open file error*/ 77 | #define HI_ERR_SVP_DSP_OPEN_FILE HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, ERR_SVP_DSP_OPEN_FILE) 78 | /*SVP_DSP read file error*/ 79 | #define HI_ERR_SVP_DSP_READ_FILE HI_DEF_ERR(HI_ID_SVP_DSP, EN_ERR_LEVEL_ERROR, ERR_SVP_DSP_READ_FILE) 80 | 81 | 82 | /*SVP_DSP core id*/ 83 | typedef enum hiSVP_DSP_ID_E 84 | { 85 | SVP_DSP_ID_0 = 0x0, 86 | 87 | SVP_DSP_ID_BUTT 88 | }SVP_DSP_ID_E; 89 | 90 | /*SVP_DSP priority*/ 91 | typedef enum hiSVP_DSP_PRI_E 92 | { 93 | SVP_DSP_PRI_0 = 0x0, 94 | SVP_DSP_PRI_1 = 0x1, 95 | SVP_DSP_PRI_2 = 0x2, 96 | 97 | SVP_DSP_PRI_BUTT 98 | }SVP_DSP_PRI_E; 99 | 100 | /*SVP_DSP memory type*/ 101 | typedef enum hiSVP_DSP_MEM_TYPE_E 102 | { 103 | SVP_DSP_MEM_TYPE_SYS_DDR_DSP_0 = 0x0, 104 | SVP_DSP_MEM_TYPE_IRAM_DSP_0 = 0x1, 105 | SVP_DSP_MEM_TYPE_DRAM_0_DSP_0 = 0x2, 106 | SVP_DSP_MEM_TYPE_DRAM_1_DSP_0 = 0x3, 107 | 108 | SVP_DSP_MEM_TYPE_BUTT 109 | }SVP_DSP_MEM_TYPE_E; 110 | 111 | /*SVP_DSP cmd*/ 112 | typedef enum hiSVP_DSP_CMD_E 113 | { 114 | SVP_DSP_CMD_INIT = 0x0, 115 | SVP_DSP_CMD_EXIT = 0x1, 116 | SVP_DSP_CMD_ERODE_3X3 = 0x2, 117 | SVP_DSP_CMD_DILATE_3X3 = 0x3, 118 | 119 | #ifdef CONFIG_HI_PHOTO_SUPPORT 120 | SVP_DSP_CMD_PHOTO_PROC, 121 | #endif 122 | 123 | SVP_DSP_CMD_BUTT 124 | }SVP_DSP_CMD_E; 125 | 126 | /*SVP_DSP ARM->DSP request message*/ 127 | typedef struct hiSVP_DSP_MESSAGE_S 128 | { 129 | HI_U32 u32CMD; /*CMD ID, user-defined SVP_DSP_CMD_BUTT + */ 130 | HI_U32 u32MsgId; /*Message ID*/ 131 | HI_U64 u64Body; /*Message body*/ 132 | HI_U32 u32BodyLen; /*Length of pBody*/ 133 | } SVP_DSP_MESSAGE_S; 134 | 135 | #ifdef __cplusplus 136 | #if __cplusplus 137 | } 138 | #endif 139 | #endif 140 | #endif/*_HI_DSP_H_*/ 141 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_errno.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : hi_errno.h 5 | Version : Initial Draft 6 | Author : Hisilicon multimedia software group 7 | Created : 2016/07/15 8 | Last Modified : 9 | Description : define the format of error code 10 | Function List : 11 | ******************************************************************************/ 12 | #ifndef __HI_ERRNO_H__ 13 | #define __HI_ERRNO_H__ 14 | 15 | #include "hi_debug.h" 16 | 17 | #ifdef __cplusplus 18 | #if __cplusplus 19 | extern "C"{ 20 | #endif 21 | #endif /* End of #ifdef __cplusplus */ 22 | 23 | 24 | /* 1010 0000b 25 | * VTOP use APPID from 0~31 26 | * so, hisilicon use APPID based on 32 27 | */ 28 | #define HI_ERR_APPID (0x80000000L + 0x20000000L) 29 | 30 | typedef enum hiERR_LEVEL_E 31 | { 32 | EN_ERR_LEVEL_DEBUG = 0, /* debug-level */ 33 | EN_ERR_LEVEL_INFO, /* informational */ 34 | EN_ERR_LEVEL_NOTICE, /* normal but significant condition */ 35 | EN_ERR_LEVEL_WARNING, /* warning conditions */ 36 | EN_ERR_LEVEL_ERROR, /* error conditions */ 37 | EN_ERR_LEVEL_CRIT, /* critical conditions */ 38 | EN_ERR_LEVEL_ALERT, /* action must be taken immediately */ 39 | EN_ERR_LEVEL_FATAL, /* just for compatibility with previous version */ 40 | EN_ERR_LEVEL_BUTT 41 | }ERR_LEVEL_E; 42 | 43 | 44 | /****************************************************************************** 45 | |----------------------------------------------------------------| 46 | | 1 | APP_ID | MOD_ID | ERR_LEVEL | ERR_ID | 47 | |----------------------------------------------------------------| 48 | |<--><--7bits----><----8bits---><--3bits---><------13bits------->| 49 | ******************************************************************************/ 50 | 51 | #define HI_DEF_ERR( module, level, errid) \ 52 | ((HI_S32)( (HI_ERR_APPID) | ((module) << 16 ) | ((level)<<13) | (errid) )) 53 | 54 | /* NOTE! the following defined all common error code, 55 | ** all module must reserved 0~63 for their common error code 56 | */ 57 | typedef enum hiEN_ERR_CODE_E 58 | { 59 | EN_ERR_INVALID_DEVID = 1, /* invlalid device ID */ 60 | EN_ERR_INVALID_CHNID = 2, /* invlalid channel ID */ 61 | EN_ERR_ILLEGAL_PARAM = 3, /* at lease one parameter is illagal 62 | * eg, an illegal enumeration value */ 63 | EN_ERR_EXIST = 4, /* resource exists */ 64 | EN_ERR_UNEXIST = 5, /* resource unexists */ 65 | 66 | EN_ERR_NULL_PTR = 6, /* using a NULL point */ 67 | 68 | EN_ERR_NOT_CONFIG = 7, /* try to enable or initialize system, device 69 | ** or channel, before configing attribute */ 70 | 71 | EN_ERR_NOT_SUPPORT = 8, /* operation or type is not supported by NOW */ 72 | EN_ERR_NOT_PERM = 9, /* operation is not permitted 73 | ** eg, try to change static attribute */ 74 | EN_ERR_INVALID_PIPEID = 10, /* invlalid pipe ID */ 75 | EN_ERR_INVALID_STITCHGRPID = 11, /* invlalid stitch group ID */ 76 | 77 | EN_ERR_NOMEM = 12,/* failure caused by malloc memory */ 78 | EN_ERR_NOBUF = 13,/* failure caused by malloc buffer */ 79 | 80 | EN_ERR_BUF_EMPTY = 14,/* no data in buffer */ 81 | EN_ERR_BUF_FULL = 15,/* no buffer for new data */ 82 | 83 | EN_ERR_SYS_NOTREADY = 16,/* System is not ready,maybe not initialed or 84 | ** loaded. Returning the error code when opening 85 | ** a device file failed. */ 86 | 87 | EN_ERR_BADADDR = 17,/* bad address, 88 | ** eg. used for copy_from_user & copy_to_user */ 89 | 90 | EN_ERR_BUSY = 18,/* resource is busy, 91 | ** eg. destroy a venc chn without unregister it */ 92 | EN_ERR_SIZE_NOT_ENOUGH = 19, /* buffer size is smaller than the actual size required */ 93 | 94 | EN_ERR_BUTT = 63,/* maxium code, private error code of all modules 95 | ** must be greater than it */ 96 | }EN_ERR_CODE_E; 97 | 98 | 99 | 100 | #ifdef __cplusplus 101 | #if __cplusplus 102 | } 103 | #endif 104 | #endif /* __cplusplus */ 105 | 106 | #endif /* __HI_ERRNO_H__ */ 107 | 108 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_i2c.h: -------------------------------------------------------------------------------- 1 | #ifndef _HI_I2C_H 2 | #define _HI_I2C_H 3 | 4 | 5 | 6 | /* /dev/i2c-X ioctl commands. The ioctl's parameter is always an 7 | * unsigned long, except for: 8 | * - I2C_FUNCS, takes pointer to an unsigned long 9 | * - I2C_RDWR, takes pointer to struct i2c_rdwr_ioctl_data 10 | * - I2C_SMBUS, takes pointer to struct i2c_smbus_ioctl_data 11 | */ 12 | #define I2C_RETRIES 0x0701 /* number of times a device address should 13 | be polled when not acknowledging */ 14 | #define I2C_TIMEOUT 0x0702 /* set timeout in units of 10 ms */ 15 | 16 | /* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses 17 | * are NOT supported! (due to code brokenness) 18 | */ 19 | #define I2C_SLAVE 0x0703 /* Use this slave address */ 20 | #define I2C_SLAVE_FORCE 0x0706 /* Use this slave address, even if it 21 | is already in use by a driver! */ 22 | #define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */ 23 | 24 | #define I2C_FUNCS 0x0705 /* Get the adapter functionality mask */ 25 | 26 | #define I2C_RDWR 0x0707 /* Combined R/W transfer (one STOP only) */ 27 | 28 | #define I2C_PEC 0x0708 /* != 0 to use PEC with SMBus */ 29 | #define I2C_SMBUS 0x0720 /* SMBus transfer */ 30 | #define I2C_16BIT_REG 0x0709 /* 16BIT REG WIDTH */ 31 | #define I2C_16BIT_DATA 0x070a /* 16BIT DATA WIDTH */ 32 | 33 | typedef struct hiI2C_DATA_S 34 | { 35 | unsigned char dev_addr; 36 | unsigned int reg_addr; 37 | unsigned int addr_byte_num; 38 | unsigned int data; 39 | unsigned int data_byte_num; 40 | }I2C_DATA_S; 41 | 42 | #endif 43 | 44 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_isp_bin.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_isp_bin.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2015/01/14 10 | Description : 11 | History : 12 | 1.Date : 2015/01/14 13 | Author : 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | 18 | #ifndef __HI_ISP_BIN_H__ 19 | #define __HI_ISP_BIN_H__ 20 | 21 | #include "hi_type.h" 22 | #include "hi_comm_isp.h" 23 | 24 | #ifdef __cplusplus 25 | #if __cplusplus 26 | extern "C" { 27 | #endif 28 | #endif /* End of #ifdef __cplusplus */ 29 | 30 | /**************************************************************************** 31 | * MACRO DEFINITION * 32 | ****************************************************************************/ 33 | #define MAX_BIN_REG_NUM 5 34 | 35 | /**************************************************************************** 36 | * GENERAL STRUCTURES * 37 | ****************************************************************************/ 38 | typedef struct hiISP_BIN_REG_ATTR_S 39 | { 40 | HI_U32 u32Addr; /* register addr */ 41 | HI_U8 u8StartBit; /* start bit of register addr */ 42 | HI_U8 u8EndBit; /* end bit of register addr */ 43 | } ISP_BIN_REG_ATTR_S; 44 | 45 | /*-------------------------------------------* 46 | The base addr of ISP logic register 47 | The base addr of ISP ext register 48 | The base addr of Hisi AE ext register 49 | The base addr of Hisi AWB ext register 50 | *-------------------------------------------*/ 51 | 52 | ISP_BIN_REG_ATTR_S g_astIspBinRegAttr[ISP_MAX_PIPE_NUM][MAX_BIN_REG_NUM] = 53 | { 54 | [0 ... (ISP_MAX_PIPE_NUM - 1)] = {0} 55 | }; 56 | 57 | 58 | #ifdef __cplusplus 59 | #if __cplusplus 60 | } 61 | #endif 62 | #endif /* End of #ifdef __cplusplus */ 63 | 64 | #endif /*__HI_ISP_BIN_H__ */ 65 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_isp_debug.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_isp_debug.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2010/08/30 10 | Description : 11 | History : 12 | 1.Date : 2010/08/30 13 | Author : 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | 18 | #ifndef __HI_ISP_DEBUG_H__ 19 | #define __HI_ISP_DEBUG_H__ 20 | 21 | #include "hi_debug.h" 22 | 23 | #if 0 24 | #define PRINT_DEBUG_INFO 25 | #endif 26 | 27 | #if 0 28 | #define PRINT_INFO_2FILE 29 | #endif 30 | 31 | #define ISP_TRACE(level, fmt, ...)\ 32 | do{ \ 33 | HI_TRACE(level, HI_ID_ISP,"[Func]:%s [Line]:%d [Info]:"fmt,__FUNCTION__, __LINE__,##__VA_ARGS__);\ 34 | }while(0) 35 | 36 | /* To avoid divide-0 exception in code. */ 37 | #define DIV_0_TO_1(a) ( (0 == (a)) ? 1 : (a) ) 38 | #define DIV_0_TO_1_FLOAT(a) ((((a) < 1E-10) && ((a) > -1E-10)) ? 1 : (a)) 39 | 40 | #endif /* __HI_ISP_DEBUG_H__ */ 41 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_isp_defines.h: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | 4 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 5 | 6 | ****************************************************************************** 7 | File Name : hi_isp_defines.h 8 | 9 | Version : Initial Draft 10 | Author : Hisilicon multimedia software group 11 | Created : 2013/11/07 12 | Description : 13 | History : 14 | 1.Date : 2013/11/07 15 | Author : 16 | Modification: Created file 17 | 18 | ******************************************************************************/ 19 | #ifndef __HI_ISP_DEFINES_H__ 20 | #define __HI_ISP_DEFINES_H__ 21 | 22 | #ifdef __cplusplus 23 | #if __cplusplus 24 | extern "C" { 25 | #endif 26 | #endif /* End of #ifdef __cplusplus */ 27 | 28 | /* isp sys part */ 29 | #define ISP_STRIPING_MAX_NUM (2) 30 | #define ISP_NORMAL_BLOCK_NUM (1) 31 | #define ISP_DEFAULT_BLOCK_NUM (2) 32 | #define ISP_SBS_BLOCK_NUM (2) 33 | 34 | #define ISP_BE0_PIPE_ID (0) 35 | #define ISP_BE1_PIPE_ID (8) 36 | #define ISP_MAX_BE_NUM (1) 37 | #define ISP_MAX_STITCH_NUM (4) 38 | 39 | #define ISP_MAX_PHY_PIPE_NUM (6) 40 | #define ISP_MAX_VIR_PIPE_NUM (2) 41 | #define ISP_MAX_PIPE_NUM (ISP_MAX_PHY_PIPE_NUM + ISP_MAX_VIR_PIPE_NUM) 42 | 43 | #define ISP_STRIPING_OVERLAP_DEFAULT (256) 44 | 45 | #define ISP_WDR_CHN_MAX (2) 46 | #define ISP_SUPPORT_DE_MODULE (0) 47 | 48 | #define ISP_RES_WIDTH_MAX 8192,8192,8192,8192,8192,8192,8192,8192 49 | #define ISP_RES_HEIGHT_MAX 8192,8192,8192,8192,8192,8192,8192,8192 50 | 51 | extern HI_U16 g_au16ResWMax[ISP_MAX_PIPE_NUM]; 52 | extern HI_U16 g_au16ResHMax[ISP_MAX_PIPE_NUM]; 53 | 54 | /* isp alg part */ 55 | #define HI_ISP_CLUT_LUT_LENGTH (4913) 56 | #define HI_ISP_CA_YRATIO_LUT_LENGTH (256) 57 | 58 | #define STATIC_DP_COUNT_NORMAL (4096) 59 | #define STATIC_DP_COUNT_MAX (STATIC_DP_COUNT_NORMAL * ISP_STRIPING_MAX_NUM) 60 | #define ISP_SUPPORT_OFFLINE_DPC_CALIBRATION (1) 61 | 62 | #define HI_ISP_SPECAWB_FACT_ELEMENT_LUT0 (4096) 63 | #define HI_ISP_SPECAWB_FACT_ELEMENT_LUT1 (4096) 64 | #define HI_ISP_SPECAWB_FACT_ELEMENT_LUT2 (4096) 65 | #define HI_ISP_SPECAWB_FACT_ELEMENT_LUT3 (4096) 66 | #define HI_ISP_SPECAWB_FACT_ELEMENT_LUT4 (4096) 67 | #define HI_ISP_SPECAWB_FACT_ELEMENT_LUT5 (4096) 68 | #define HI_ISP_SPECAWB_FACT_ELEMENT_LUT6 (4096) 69 | #define HI_ISP_SPECAWB_WB_CNVTBL_LUT (16384) 70 | #define HI_ISP_SPECAWB_KELDBB_LUT (16384) 71 | #define HI_ISP_SPECAWB_BBL_LUT (240) 72 | #define HI_ISP_SPECAWB_CAA_LUT1 (16384) 73 | #define HI_ISP_SPECAWB_CAA_LUT2 (16384) 74 | #define HI_ISP_SPECAWB_CAA_LUT3 (16384) 75 | #define ISP_SPECAWB_BUF_SIZE (110832) 76 | 77 | #define AWB_ZONE_BIN (4) 78 | #define AWB_LIB_NUM (ISP_MAX_PIPE_NUM) 79 | #define AE_LIB_NUM (ISP_MAX_PIPE_NUM) 80 | 81 | #define HI_ISP_SHARPEN_RGAIN (32) 82 | #define HI_ISP_SHARPEN_BGAIN (32) 83 | #define HI_ISP_SHARPEN_RGAIN_MAX (32) 84 | #define HI_ISP_SHARPEN_BGAIN_MAX (32) 85 | #define HI_ISP_SHARPEN_RGAIN_BIT (63) 86 | #define HI_ISP_SHARPEN_BGAIN_BIT (63) 87 | 88 | 89 | #define HI_ISP_SHARPEN_LUMAWGT_MAX (127) 90 | #define HI_ISP_SHARPEN_LUMAWGT (127) 91 | #define HI_ISP_SHARPEN_LUMAWGT_BIT (127) 92 | 93 | #define HI_ISP_DRC_STRENGTH_MAX (1023) 94 | #define HI_ISP_DRC_SPA_FLT_COEF_MAX (5) 95 | 96 | #define HI_ISP_DEMOSAIC_DETAIL_SMOOTH_RANGE_MAX (7) 97 | #define HI_ISP_DEMOSAIC_DETAIL_SMOOTH_RANGE_MIN (1) 98 | #define HI_ISP_DEMOSAIC_NONDIR_MFDETALEHC_STR_MAX (127) 99 | 100 | #define HI_ISP_LDCI_HEPOSWGT_MAX (0x80) 101 | #define HI_ISP_LDCI_HENEGWGT_MAX (0x80) 102 | #define HI_ISP_PREGAMMA_LUT_MAX (0x100000) 103 | 104 | #define EXPANDER_NODE_NUM (257) 105 | 106 | #define DEFOG_ZONE_ROW (32) 107 | #define DEFOG_ZONE_COLUMN (32) 108 | #define DEFOG_ZONE_NUM (1024) 109 | #define DEFOG_MAX_ZONE_NUM (1024) 110 | 111 | 112 | #define HI_ISP_LSC_MESHSTR_MAX (65535) 113 | #define HI_ISP_LSC_DEFAULT_MESH_STRENGTH (4096) 114 | #define HI_ISP_LSC_DEFAULT_WEIGHT (256) 115 | #define HI_ISP_LSC_GRID_COL (33) 116 | #define HI_ISP_LSC_GRID_ROW (33) 117 | #define HI_ISP_LSC_GRID_POINTS (HI_ISP_LSC_GRID_COL * HI_ISP_LSC_GRID_ROW) 118 | #define HI_ISP_LSC_DEFAULT_MESH_SCALE (4) 119 | #define HI_ISP_LSC_XGRID_WIDTH_MAX(x) ((x) / 4 - 60) 120 | #define HI_ISP_LSC_YGRID_WIDTH_MAX(x) ((x) / 4 - 60) 121 | 122 | #define AF_GAMMA_VALUE_MAX (6) 123 | #define HI_EXT_SYSTEM_MANUAL_DEHAZE_HBLK_DEFAULT (32) 124 | #define HI_EXT_SYSTEM_MANUAL_DEHAZE_VBLK_DEFAULT (32) 125 | 126 | #define HI_ISP_CR_SLOPE_MAX (14) 127 | #define HI_ISP_CR_THR_MAX (16383) 128 | #define HI_ISP_CR_NPOFFSET_MAX (16383) 129 | #define HI_ISP_CR_NPOFFSET_MIN (512) 130 | 131 | #ifdef __cplusplus 132 | #if __cplusplus 133 | } 134 | #endif 135 | #endif /* End of #ifdef __cplusplus */ 136 | 137 | #endif /* __HI_ISP_DEFINES_H__ */ 138 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_md.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2015, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_md.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software (IVE) group 9 | Created : 2014/11/10 10 | Description : 11 | History : 12 | 1.Date : 2014/11/10 13 | Author : 14 | Modification: Created file 15 | 2.Date : 2015/11/24 16 | Author : 17 | Modification: Modify MD_ATTR_S 18 | ******************************************************************************/ 19 | #ifndef _HI_MD_H_ 20 | #define _HI_MD_H_ 21 | 22 | #include "hi_ive.h" 23 | 24 | #ifdef __cplusplus 25 | #if __cplusplus 26 | extern "C"{ 27 | #endif 28 | #endif 29 | /* 30 | * Definition md algorithm mode 31 | */ 32 | typedef enum hiMD_ALG_MODE_E 33 | { 34 | MD_ALG_MODE_BG = 0x0,/*Base on background image*/ 35 | MD_ALG_MODE_REF = 0x1,/*Base on reference image*/ 36 | 37 | MD_ALG_MODE_BUTT 38 | }MD_ALG_MODE_E; 39 | /* 40 | * Definition of md attribute 41 | */ 42 | typedef struct hiMD_ATTR_S 43 | { 44 | MD_ALG_MODE_E enAlgMode; /*Md algorithm mode*/ 45 | IVE_SAD_MODE_E enSadMode; /*Sad mode*/ 46 | IVE_SAD_OUT_CTRL_E enSadOutCtrl; /*Sad output ctrl*/ 47 | HI_U32 u32Width; /*Image width*/ 48 | HI_U32 u32Height; /*Image height*/ 49 | HI_U16 u16SadThr; /*Sad thresh*/ 50 | IVE_CCL_CTRL_S stCclCtrl; /*Ccl ctrl*/ 51 | IVE_ADD_CTRL_S stAddCtrl; /*Add ctrl*/ 52 | }MD_ATTR_S; 53 | 54 | #ifdef __cplusplus 55 | #if __cplusplus 56 | } 57 | #endif 58 | #endif 59 | 60 | #endif/*_HI_MD_H_*/ -------------------------------------------------------------------------------- /hisi_sdk/include/hi_mipi_tx.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : hi_mipi_tx.h 5 | Version : Initial Draft 6 | Author : Hisilicon multimedia software group 7 | Created : 2016/11/15 8 | Last Modified : 9 | Description : 10 | Function List : 11 | ******************************************************************************/ 12 | #ifndef __HI_MIPI_TX__ 13 | #define __HI_MIPI_TX__ 14 | 15 | #define CMD_MAX_NUM 4 16 | #define LANE_MAX_NUM 4 17 | 18 | #define HI_MIPI_TX_ERR(x...) \ 19 | do { \ 20 | osal_printk("%s(%d): ", __FUNCTION__, __LINE__); \ 21 | osal_printk(x); \ 22 | } while (0) 23 | 24 | #define MIPITX_CHECK_NULL_PTR(ptr)\ 25 | do{\ 26 | if(NULL == ptr)\ 27 | {\ 28 | HI_MIPI_TX_ERR("NULL point \r\n");\ 29 | return -1;\ 30 | }\ 31 | } while(0) 32 | 33 | typedef enum 34 | { 35 | OUTPUT_MODE_CSI = 0x0, /* csi mode */ 36 | OUTPUT_MODE_DSI_VIDEO = 0x1, /* dsi video mode */ 37 | OUTPUT_MODE_DSI_CMD = 0x2, /* dsi command mode */ 38 | 39 | OUTPUT_MODE_BUTT 40 | } output_mode_t; 41 | 42 | typedef enum 43 | { 44 | BRUST_MODE = 0x0, 45 | NON_BRUST_MODE_SYNC_PULSES = 0x1, 46 | NON_BRUST_MODE_SYNC_EVENTS = 0x2, 47 | } video_mode_t; 48 | 49 | typedef enum 50 | { 51 | OUT_FORMAT_RGB_16_BIT = 0x0, 52 | OUT_FORMAT_RGB_18_BIT = 0x1, 53 | OUT_FORMAT_RGB_24_BIT = 0x2, 54 | OUT_FORMAT_YUV420_8_BIT_NORMAL = 0x3, 55 | OUT_FORMAT_YUV420_8_BIT_LEGACY = 0x4, 56 | OUT_FORMAT_YUV422_8_BIT = 0x5, 57 | 58 | OUT_FORMAT_BUTT 59 | } output_format_t; 60 | 61 | typedef struct 62 | { 63 | unsigned short vid_pkt_size; 64 | unsigned short vid_hsa_pixels; 65 | unsigned short vid_hbp_pixels; 66 | unsigned short vid_hline_pixels; 67 | unsigned short vid_vsa_lines; 68 | unsigned short vid_vbp_lines; 69 | unsigned short vid_vfp_lines; 70 | unsigned short vid_active_lines; 71 | unsigned short edpi_cmd_size; 72 | } sync_info_t; 73 | 74 | typedef struct 75 | { 76 | unsigned int devno; /* device number*/ 77 | short lane_id[LANE_MAX_NUM]; /* lane_id: -1 - disable */ 78 | output_mode_t output_mode; /* output mode: CSI/DSI_VIDEO/DSI_CMD */ 79 | video_mode_t video_mode; 80 | output_format_t output_format; 81 | sync_info_t sync_info; 82 | unsigned int phy_data_rate; /*mbps*/ 83 | unsigned int pixel_clk; /*KHz*/ 84 | } combo_dev_cfg_t; 85 | 86 | typedef struct 87 | { 88 | unsigned int devno; /* device number */ 89 | unsigned short data_type; 90 | unsigned short cmd_size; 91 | unsigned char *cmd; 92 | } cmd_info_t; 93 | 94 | #define HI_MIPI_TX_IOC_MAGIC 't' 95 | 96 | #define HI_MIPI_TX_SET_DEV_CFG _IOW(HI_MIPI_TX_IOC_MAGIC, 0x01, combo_dev_cfg_t) 97 | #define HI_MIPI_TX_SET_CMD _IOW(HI_MIPI_TX_IOC_MAGIC, 0x02, cmd_info_t) 98 | #define HI_MIPI_TX_ENABLE _IO(HI_MIPI_TX_IOC_MAGIC, 0x03) 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_resampler_api.h: -------------------------------------------------------------------------------- 1 | #ifndef _HI_RESAMPLER_API_H_ 2 | #define _HI_RESAMPLER_API_H_ 3 | 4 | #include "hi_type.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #define MAXFRAMESIZE 2048 11 | 12 | /************************************************************************************** 13 | * Function: HI_Resampler_Create 14 | * 15 | * Description: allocate memory for platform-specific data 16 | * clear all the user-accessible fields 17 | * 18 | * Inputs: inrate: 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 19 | * outrate: 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 20 | * chans: 1 or 2 21 | * Outputs: none 22 | * 23 | * Return: handle to Resampler instance, 0 if malloc fails 24 | **************************************************************************************/ 25 | HI_VOID* HI_Resampler_Create(HI_S32 s32Inrate, HI_S32 s32Outrate, HI_S32 s32Chans); 26 | 27 | 28 | /************************************************************************************** 29 | * Function: HI_Resampler_Process 30 | * 31 | * Description: Resample pcm data to specific samplerate, only for interlaced format 32 | * 33 | * Inputs: inst: valid Resampler instance pointer (HResampler) 34 | * inbuf: pointer to inputbuf 35 | * insamps: input number of sample pointers 36 | * Outputs: outbuf: pointer to outputbuf 37 | * 38 | * Return: output sample number per-channel 39 | * Notes: sure insamps < MAXFRAMESIZE 40 | 41 | 42 | **************************************************************************************/ 43 | HI_S32 HI_Resampler_Process(HI_VOID* inst, HI_S16* s16Inbuf, HI_S32 s32Insamps, HI_S16* s16Outbuf); 44 | 45 | 46 | /************************************************************************************** 47 | * Function: HI_Resampler_Destroy 48 | * 49 | * Description: free platform-specific data allocated by ResamplerCreate 50 | * 51 | * Inputs: valid Resampler instance pointer (HResampler) 52 | * Outputs: none 53 | * 54 | * Return: none 55 | **************************************************************************************/ 56 | HI_VOID HI_Resampler_Destroy(HI_VOID* inst); 57 | 58 | 59 | /******************************************************************************* 60 | * Function: HI_Resampler_GetMaxOutputNum 61 | * 62 | * Description: Caculate max output number at specific input number 63 | * 64 | * Inputs: inst: valid Resampler instance pointer (HI_HANDLE) 65 | * insamps: input data number per-channel, insamps must be even 66 | * Outputs: none 67 | * Return: >=0: Success, return the max output number per-channel 68 | * other: Fail, return error code 69 | * Notes: 70 | * 1 if stereo(chans==2), sure insamps%2 == 0 71 | ******************************************************************************/ 72 | HI_S32 HI_Resampler_GetMaxOutputNum(HI_VOID* inst, HI_S32 s32Insamps); 73 | 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_sns_ctrl.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_sns_ctrl.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2011/01/10 10 | Description : 11 | History : 12 | 1.Date : 2011/01/10 13 | Author : 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | 18 | #ifndef __HI_SNS_CTRL_H__ 19 | #define __HI_SNS_CTRL_H__ 20 | 21 | #include "hi_type.h" 22 | #include "hi_comm_3a.h" 23 | 24 | #ifdef __cplusplus 25 | #if __cplusplus 26 | extern "C" { 27 | #endif 28 | #endif /* End of #ifdef __cplusplus */ 29 | 30 | 31 | typedef struct hiISP_SNS_STATE_S 32 | { 33 | HI_BOOL bInit; /* HI_TRUE: Sensor init */ 34 | HI_BOOL bSyncInit; /* HI_TRUE: Sync Reg init */ 35 | HI_U8 u8ImgMode; 36 | HI_U8 u8Hdr; /* HI_TRUE: HDR enbale */ 37 | WDR_MODE_E enWDRMode; 38 | 39 | ISP_SNS_REGS_INFO_S astRegsInfo[2]; /* [0]: Sensor reg info of cur-frame; [1]: Sensor reg info of pre-frame ; */ 40 | 41 | HI_U32 au32FL[2]; /* [0]: FullLines of cur-frame; [1]: Pre FullLines of pre-frame */ 42 | HI_U32 u32FLStd; /* FullLines std */ 43 | HI_U32 au32WDRIntTime[4]; 44 | } ISP_SNS_STATE_S; 45 | 46 | typedef enum hiISP_SNS_MIRRORFLIP_TYPE_E 47 | { 48 | ISP_SNS_NORMAL = 0, 49 | ISP_SNS_MIRROR = 1, 50 | ISP_SNS_FLIP = 2, 51 | ISP_SNS_MIRROR_FLIP = 3, 52 | ISP_SNS_BUTT 53 | }ISP_SNS_MIRRORFLIP_TYPE_E; 54 | 55 | typedef struct hiISP_SNS_OBJ_S 56 | { 57 | HI_S32 (*pfnRegisterCallback)(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib, ALG_LIB_S *pstAwbLib); 58 | HI_S32 (*pfnUnRegisterCallback)(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib, ALG_LIB_S *pstAwbLib); 59 | HI_S32 (*pfnSetBusInfo)(VI_PIPE ViPipe, ISP_SNS_COMMBUS_U unSNSBusInfo); 60 | HI_VOID (*pfnStandby)(VI_PIPE ViPipe); 61 | HI_VOID (*pfnRestart)(VI_PIPE ViPipe); 62 | HI_VOID (*pfnMirrorFlip)(VI_PIPE ViPipe, ISP_SNS_MIRRORFLIP_TYPE_E eSnsMirrorFlip); 63 | HI_S32 (*pfnWriteReg)(VI_PIPE ViPipe, HI_S32 s32Addr, HI_S32 s32Data); 64 | HI_S32 (*pfnReadReg)(VI_PIPE ViPipe, HI_S32 s32Addr); 65 | HI_S32 (*pfnSetInit)(VI_PIPE ViPipe, ISP_INIT_ATTR_S *pstInitAttr); 66 | } ISP_SNS_OBJ_S; 67 | 68 | extern ISP_SNS_OBJ_S stSnsMn34220Obj; 69 | extern ISP_SNS_OBJ_S stSnsImx377Obj; 70 | extern ISP_SNS_OBJ_S stSnsImx299Obj; 71 | extern ISP_SNS_OBJ_S stSnsImx477Obj; 72 | extern ISP_SNS_OBJ_S stSnsImx299SlvsObj; 73 | extern ISP_SNS_OBJ_S stSnsImx290Obj; 74 | extern ISP_SNS_OBJ_S stSnsImx327Obj; 75 | extern ISP_SNS_OBJ_S stSnsImx334Obj; 76 | extern ISP_SNS_OBJ_S stSnsOV2718Obj; 77 | extern ISP_SNS_OBJ_S stSnsCmv50000Obj; 78 | extern ISP_SNS_OBJ_S stSnsImx277SlvsObj; 79 | extern ISP_SNS_OBJ_S stSnsImx117Obj; 80 | extern ISP_SNS_OBJ_S stSnsImx290SlaveObj; 81 | extern ISP_SNS_OBJ_S stSnsImx334SlaveObj; 82 | extern ISP_SNS_OBJ_S stSnsImx226Obj; 83 | extern ISP_SNS_OBJ_S stSnsImx335Obj; 84 | extern ISP_SNS_OBJ_S stSnsImx458Obj; 85 | 86 | #define CMOS_CHECK_POINTER(ptr)\ 87 | do {\ 88 | if (HI_NULL == ptr)\ 89 | {\ 90 | ISP_TRACE(HI_DBG_ERR, "Null Pointer!\n");\ 91 | return HI_ERR_ISP_NULL_PTR;\ 92 | }\ 93 | }while(0) 94 | 95 | #define CMOS_CHECK_POINTER_VOID(ptr)\ 96 | do {\ 97 | if (HI_NULL == ptr)\ 98 | {\ 99 | ISP_TRACE(HI_DBG_ERR, "Null Pointer!\n");\ 100 | return;\ 101 | }\ 102 | }while(0) 103 | 104 | #define SENSOR_FREE(ptr)\ 105 | do{\ 106 | if (HI_NULL != ptr)\ 107 | {\ 108 | free(ptr);\ 109 | ptr = HI_NULL;\ 110 | }\ 111 | } while (0) 112 | 113 | 114 | #ifdef __cplusplus 115 | #if __cplusplus 116 | } 117 | #endif 118 | #endif /* End of #ifdef __cplusplus */ 119 | 120 | #endif /* __HI_SNS_CTRL_H__ */ 121 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_spi.h: -------------------------------------------------------------------------------- 1 | #ifndef __HI_SPI_H__ 2 | #define __HI_SPI_H__ 3 | 4 | typedef unsigned long long __u64; 5 | typedef unsigned int __u32; 6 | typedef unsigned short __u16; 7 | typedef unsigned char __u8; 8 | 9 | #ifdef __HuaweiLite__ 10 | #include 11 | #else 12 | 13 | 14 | /* User space versions of kernel symbols for SPI clocking modes, 15 | * matching 16 | */ 17 | 18 | #define SPI_CPHA 0x01 19 | #define SPI_CPOL 0x02 20 | 21 | #define SPI_MODE_0 (0|0) 22 | #define SPI_MODE_1 (0|SPI_CPHA) 23 | #define SPI_MODE_2 (SPI_CPOL|0) 24 | #define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) 25 | 26 | #define SPI_CS_HIGH 0x04 27 | #define SPI_LSB_FIRST 0x08 28 | #define SPI_3WIRE 0x10 29 | #define SPI_LOOP 0x20 30 | #define SPI_NO_CS 0x40 31 | #define SPI_READY 0x80 32 | 33 | /*---------------------------------------------------------------------------*/ 34 | 35 | /* IOCTL commands */ 36 | 37 | #define SPI_IOC_MAGIC 'k' 38 | 39 | /** 40 | * struct spi_ioc_transfer - describes a single SPI transfer 41 | * @tx_buf: Holds pointer to userspace buffer with transmit data, or null. 42 | * If no data is provided, zeroes are shifted out. 43 | * @rx_buf: Holds pointer to userspace buffer for receive data, or null. 44 | * @len: Length of tx and rx buffers, in bytes. 45 | * @speed_hz: Temporary override of the device's bitrate. 46 | * @bits_per_word: Temporary override of the device's wordsize. 47 | * @delay_usecs: If nonzero, how long to delay after the last bit transfer 48 | * before optionally deselecting the device before the next transfer. 49 | * @cs_change: True to deselect device before starting the next transfer. 50 | * 51 | * This structure is mapped directly to the kernel spi_transfer structure; 52 | * the fields have the same meanings, except of course that the pointers 53 | * are in a different address space (and may be of different sizes in some 54 | * cases, such as 32-bit i386 userspace over a 64-bit x86_64 kernel). 55 | * Zero-initialize the structure, including currently unused fields, to 56 | * accommodate potential future updates. 57 | * 58 | * SPI_IOC_MESSAGE gives userspace the equivalent of kernel spi_sync(). 59 | * Pass it an array of related transfers, they'll execute together. 60 | * Each transfer may be half duplex (either direction) or full duplex. 61 | * 62 | * struct spi_ioc_transfer mesg[4]; 63 | * ... 64 | * status = ioctl(fd, SPI_IOC_MESSAGE(4), mesg); 65 | * 66 | * So for example one transfer might send a nine bit command (right aligned 67 | * in a 16-bit word), the next could read a block of 8-bit data before 68 | * terminating that command by temporarily deselecting the chip; the next 69 | * could send a different nine bit command (re-selecting the chip), and the 70 | * last transfer might write some register values. 71 | */ 72 | struct spi_ioc_transfer { 73 | __u64 tx_buf; 74 | __u64 rx_buf; 75 | 76 | __u32 len; 77 | __u32 speed_hz; 78 | 79 | __u16 delay_usecs; 80 | __u8 bits_per_word; 81 | __u8 cs_change; 82 | __u32 pad; 83 | 84 | /* If the contents of 'struct spi_ioc_transfer' ever change 85 | * incompatibly, then the ioctl number (currently 0) must change; 86 | * ioctls with constant size fields get a bit more in the way of 87 | * error checking than ones (like this) where that field varies. 88 | * 89 | * NOTE: struct layout is the same in 64bit and 32bit userspace. 90 | */ 91 | }; 92 | 93 | /* not all platforms use or _IOC_TYPECHECK() ... */ 94 | #define SPI_MSGSIZE(N) \ 95 | ((((N)*(sizeof (struct spi_ioc_transfer))) < (1 << _IOC_SIZEBITS)) \ 96 | ? ((N)*(sizeof (struct spi_ioc_transfer))) : 0) 97 | #define SPI_IOC_MESSAGE(N) _IOW(SPI_IOC_MAGIC, 0, char[SPI_MSGSIZE(N)]) 98 | 99 | 100 | /* Read / Write of SPI mode (SPI_MODE_0..SPI_MODE_3) */ 101 | #define SPI_IOC_RD_MODE _IOR(SPI_IOC_MAGIC, 1, __u8) 102 | #define SPI_IOC_WR_MODE _IOW(SPI_IOC_MAGIC, 1, __u8) 103 | 104 | /* Read / Write SPI bit justification */ 105 | #define SPI_IOC_RD_LSB_FIRST _IOR(SPI_IOC_MAGIC, 2, __u8) 106 | #define SPI_IOC_WR_LSB_FIRST _IOW(SPI_IOC_MAGIC, 2, __u8) 107 | 108 | /* Read / Write SPI device word length (1..N) */ 109 | #define SPI_IOC_RD_BITS_PER_WORD _IOR(SPI_IOC_MAGIC, 3, __u8) 110 | #define SPI_IOC_WR_BITS_PER_WORD _IOW(SPI_IOC_MAGIC, 3, __u8) 111 | 112 | /* Read / Write SPI device default max speed hz */ 113 | #define SPI_IOC_RD_MAX_SPEED_HZ _IOR(SPI_IOC_MAGIC, 4, __u32) 114 | #define SPI_IOC_WR_MAX_SPEED_HZ _IOW(SPI_IOC_MAGIC, 4, __u32) 115 | 116 | #endif 117 | #endif /* __HI_SPI_H__ */ 118 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_ssp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * extdrv/include/hi_ssp.h for Linux . 3 | * 4 | * History: 5 | * 2006-4-11 create this file 6 | */ 7 | 8 | #ifndef __HI_SSP_H__ 9 | #define __HI_SSP_H__ 10 | 11 | #define SSP_READ_ALT 0x1 12 | #define SSP_WRITE_ALT 0X3 13 | 14 | typedef struct hiSPI_DATA_S 15 | { 16 | unsigned int spi_no; 17 | unsigned char dev_addr; 18 | unsigned int dev_byte_num; 19 | unsigned int reg_addr; 20 | unsigned int addr_byte_num; 21 | unsigned int data; 22 | unsigned int data_byte_num; 23 | }SPI_DATA_S; 24 | 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_tde_errcode.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2016-2018, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : tde_errcode.h 5 | Version : Initial Draft 6 | Author : Hisilicon multimedia software group 7 | Created : 8 | Last Modified : 9 | Description : err code define 10 | Function List : 11 | History : May modify the code to errcode.h FOR hi3110 12 | ******************************************************************************/ 13 | #ifndef __TDE_ERRCODE_H__ 14 | #define __TDE_ERRCODE_H__ 15 | 16 | //#include "hi_debug.h" 17 | #include "hi_type.h" 18 | 19 | #ifdef __cplusplus 20 | #if __cplusplus 21 | extern "C" { 22 | #endif 23 | #endif /* __cplusplus */ 24 | 25 | //#define HI_ID_TDE 100 26 | /* tde start err no. */ 27 | #define HI_ERR_TDE_BASE ((HI_S32)( ((0x80UL + 0x20UL)<<24) | (100 << 16 ) | (4 << 13) | 1 )) 28 | 29 | enum 30 | { 31 | HI_ERR_TDE_DEV_NOT_OPEN = HI_ERR_TDE_BASE, /**< tde device not open yet */ 32 | HI_ERR_TDE_DEV_OPEN_FAILED, /**< open tde device failed */ 33 | HI_ERR_TDE_NULL_PTR, /**< input parameters contain null ptr */ 34 | HI_ERR_TDE_NO_MEM, /**< malloc failed */ 35 | HI_ERR_TDE_INVALID_HANDLE, /**< invalid job handle */ 36 | HI_ERR_TDE_INVALID_PARA, /**< invalid parameter */ 37 | HI_ERR_TDE_NOT_ALIGNED, /**< aligned error for position, stride, width */ 38 | HI_ERR_TDE_MINIFICATION, /**< invalid minification */ 39 | HI_ERR_TDE_CLIP_AREA, /**< clip area and operation area have no intersection */ 40 | HI_ERR_TDE_JOB_TIMEOUT, /**< blocked job wait timeout */ 41 | HI_ERR_TDE_UNSUPPORTED_OPERATION, /**< unsupported operation */ 42 | HI_ERR_TDE_QUERY_TIMEOUT, /**< query time out */ 43 | HI_ERR_TDE_INTERRUPT /* blocked job was interrupted */ 44 | }; 45 | 46 | 47 | #ifdef __cplusplus 48 | #if __cplusplus 49 | } 50 | #endif 51 | #endif /* __cplusplus */ 52 | 53 | #endif /* __TDE_ERRCODE_H__*/ 54 | 55 | 56 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_type.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : hi_type.h 5 | Version : Initial Draft 6 | Author : Hisilicon multimedia software group 7 | Created : 2016/07/15 8 | Last Modified : 9 | Description : The common data type defination 10 | Function List : 11 | ******************************************************************************/ 12 | #ifndef __HI_TYPE_H__ 13 | #define __HI_TYPE_H__ 14 | 15 | 16 | #ifdef __cplusplus 17 | #if __cplusplus 18 | extern "C"{ 19 | #endif 20 | #endif /* __cplusplus */ 21 | 22 | /*----------------------------------------------* 23 | * The common data type, will be used in the whole project.* 24 | *----------------------------------------------*/ 25 | 26 | typedef unsigned char HI_U8; 27 | typedef unsigned short HI_U16; 28 | typedef unsigned int HI_U32; 29 | 30 | typedef signed char HI_S8; 31 | typedef short HI_S16; 32 | typedef int HI_S32; 33 | 34 | typedef unsigned long HI_UL; 35 | typedef signed long HI_SL; 36 | 37 | typedef float HI_FLOAT; 38 | typedef double HI_DOUBLE; 39 | 40 | #ifndef _M_IX86 41 | typedef unsigned long long HI_U64; 42 | typedef long long HI_S64; 43 | #else 44 | typedef unsigned __int64 HI_U64; 45 | typedef __int64 HI_S64; 46 | #endif 47 | 48 | typedef char HI_CHAR; 49 | #define HI_VOID void 50 | 51 | typedef unsigned int HI_HANDLE; 52 | 53 | /*----------------------------------------------* 54 | * const defination * 55 | *----------------------------------------------*/ 56 | typedef enum { 57 | HI_FALSE = 0, 58 | HI_TRUE = 1, 59 | } HI_BOOL; 60 | 61 | 62 | #ifndef NULL 63 | #define NULL 0L 64 | #endif 65 | 66 | #define HI_NULL 0L 67 | #define HI_SUCCESS 0 68 | #define HI_FAILURE (-1) 69 | 70 | 71 | #ifdef __cplusplus 72 | #if __cplusplus 73 | } 74 | #endif 75 | #endif /* __cplusplus */ 76 | 77 | #endif /* __HI_TYPE_H__ */ 78 | 79 | -------------------------------------------------------------------------------- /hisi_sdk/include/hi_types.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : hi_type.h 5 | Version : Initial Draft 6 | Author : Hisilicon multimedia software group 7 | Created : 2005/4/23 8 | Last Modified : 9 | Description : Common data types of the system. 10 | Function List : 11 | History : 12 | ******************************************************************************/ 13 | #ifndef __HI_TYPES_H__ 14 | #define __HI_TYPES_H__ 15 | 16 | #include "hi_type.h" 17 | 18 | #ifdef __cplusplus 19 | #if __cplusplus 20 | extern "C"{ 21 | #endif 22 | #endif /* __cplusplus */ 23 | 24 | /*--------------------------------------------------------------------------------------------------------------* 25 | * Defintion of basic data types. The data types are applicable to both the application layer and kernel codes. * 26 | *--------------------------------------------------------------------------------------------------------------*/ 27 | /*************************** Structure Definition ****************************/ 28 | /** \addtogroup Common_TYPE */ 29 | /** @{ */ /** |<--- 8bit --->|<--- 8bit --->| 42 | |--------------------------------------------------------------| 43 | | HI_MOD_ID_E | mod defined data | chnID | 44 | |--------------------------------------------------------------| 45 | 46 | mod defined data: private data define by each module(for example: sub-mod id), usually, set to 0. 47 | */ 48 | 49 | #define HI_HANDLE_MAKEHANDLE(mod, privatedata, chnid) (HI_HANDLE)( (((mod)& 0xffff) << 16) | ((((privatedata)& 0xff) << 8) ) | (((chnid) & 0xff)) ) 50 | 51 | #define HI_HANDLE_GET_MODID(handle) (((handle) >> 16) & 0xffff) 52 | #define HI_HANDLE_GET_PriDATA(handle) (((handle) >> 8) & 0xff) 53 | #define HI_HANDLE_GET_CHNID(handle) (((handle)) & 0xff) 54 | 55 | 56 | /** @} */ /**